Generated from protobuf messagegoogle.cloud.kms.v1.GenerateRandomBytesRequest
Namespace
Google \ Cloud \ Kms \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ location
string
The project-specific location in which to generate random bytes. For example, "projects/my-project/locations/us-central1".
↳ length_bytes
int
The length in bytes of the amount of randomness to retrieve. Minimum 8 bytes, maximum 1024 bytes.
↳ protection_level
int
TheProtectionLevelto use when generating the random data. Currently, onlyHSMprotection level is supported.
getLocation
The project-specific location in which to generate random bytes.
For example, "projects/my-project/locations/us-central1".
Returns
Type
Description
string
setLocation
The project-specific location in which to generate random bytes.
For example, "projects/my-project/locations/us-central1".
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getLengthBytes
The length in bytes of the amount of randomness to retrieve. Minimum 8
bytes, maximum 1024 bytes.
Returns
Type
Description
int
setLengthBytes
The length in bytes of the amount of randomness to retrieve. Minimum 8
bytes, maximum 1024 bytes.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getProtectionLevel
TheProtectionLevelto use when
generating the random data. Currently, onlyHSMprotection level is
supported.
Returns
Type
Description
int
setProtectionLevel
TheProtectionLevelto use when
generating the random data. Currently, onlyHSMprotection level is
supported.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
static::build
Parameters
Name
Description
location
string
The project-specific location in which to generate random bytes.
For example, "projects/my-project/locations/us-central1".
lengthBytes
int
The length in bytes of the amount of randomness to retrieve. Minimum 8
bytes, maximum 1024 bytes.
protectionLevel
int
TheProtectionLevelto use when
generating the random data. Currently, onlyHSMprotection level is
supported.
For allowed values, use constants defined onProtectionLevel
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud KMS V1 Client - Class GenerateRandomBytesRequest (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-kms/latest/V1.GenerateRandomBytesRequest)\n- [2.3.0](/php/docs/reference/cloud-kms/2.3.0/V1.GenerateRandomBytesRequest)\n- [2.2.0](/php/docs/reference/cloud-kms/2.2.0/V1.GenerateRandomBytesRequest)\n- [2.1.6](/php/docs/reference/cloud-kms/2.1.6/V1.GenerateRandomBytesRequest)\n- [2.0.0](/php/docs/reference/cloud-kms/2.0.0/V1.GenerateRandomBytesRequest)\n- [1.23.0](/php/docs/reference/cloud-kms/1.23.0/V1.GenerateRandomBytesRequest)\n- [1.22.1](/php/docs/reference/cloud-kms/1.22.1/V1.GenerateRandomBytesRequest)\n- [1.21.4](/php/docs/reference/cloud-kms/1.21.4/V1.GenerateRandomBytesRequest)\n- [1.20.3](/php/docs/reference/cloud-kms/1.20.3/V1.GenerateRandomBytesRequest)\n- [1.19.0](/php/docs/reference/cloud-kms/1.19.0/V1.GenerateRandomBytesRequest)\n- [1.18.1](/php/docs/reference/cloud-kms/1.18.1/V1.GenerateRandomBytesRequest)\n- [1.17.0](/php/docs/reference/cloud-kms/1.17.0/V1.GenerateRandomBytesRequest)\n- [1.16.4](/php/docs/reference/cloud-kms/1.16.4/V1.GenerateRandomBytesRequest)\n- [1.15.3](/php/docs/reference/cloud-kms/1.15.3/V1.GenerateRandomBytesRequest) \nReference documentation and code samples for the Cloud KMS V1 Client class GenerateRandomBytesRequest.\n\nRequest message for\n[KeyManagementService.GenerateRandomBytes](/php/docs/reference/cloud-kms/latest/V1.Client.KeyManagementServiceClient#_Google_Cloud_Kms_V1_Client_KeyManagementServiceClient__generateRandomBytes__).\n\nGenerated from protobuf message `google.cloud.kms.v1.GenerateRandomBytesRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Kms \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getLocation\n\nThe project-specific location in which to generate random bytes.\n\nFor example, \"projects/my-project/locations/us-central1\".\n\n### setLocation\n\nThe project-specific location in which to generate random bytes.\n\nFor example, \"projects/my-project/locations/us-central1\".\n\n### getLengthBytes\n\nThe length in bytes of the amount of randomness to retrieve. Minimum 8\nbytes, maximum 1024 bytes.\n\n### setLengthBytes\n\nThe length in bytes of the amount of randomness to retrieve. Minimum 8\nbytes, maximum 1024 bytes.\n\n### getProtectionLevel\n\nThe [ProtectionLevel](/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel) to use when\ngenerating the random data. Currently, only\n[HSM](/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel#_Google_Cloud_Kms_V1_ProtectionLevel__HSM) protection level is\nsupported.\n\n### setProtectionLevel\n\nThe [ProtectionLevel](/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel) to use when\ngenerating the random data. Currently, only\n[HSM](/php/docs/reference/cloud-kms/latest/V1.ProtectionLevel#_Google_Cloud_Kms_V1_ProtectionLevel__HSM) protection level is\nsupported.\n\n### static::build"]]