Google Cloud Iam Credentials V1 Client - Class GenerateAccessTokenRequest (1.2.4)

Reference documentation and code samples for the Google Cloud Iam Credentials V1 Client class GenerateAccessTokenRequest.

Generated from protobuf message google.iam.credentials.v1.GenerateAccessTokenRequest

Namespace

Google \ Cloud \ Iam \ Credentials \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

Required. The resource name of the service account for which the credentials are requested, in the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.

↳ delegates array

The sequence of service accounts in a delegation chain. Each service account must be granted the roles/iam.serviceAccountTokenCreator role on its next service account in the chain. The last service account in the chain must be granted the roles/iam.serviceAccountTokenCreator role on the service account that is specified in the name field of the request. The delegates must have the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.

↳ scope array

Required. Code to identify the scopes to be included in the OAuth 2.0 access token. See https://developers.google.com/identity/protocols/googlescopes for more information. At least one value required.

↳ lifetime Google\Protobuf\Duration

The desired lifetime duration of the access token in seconds. Must be set to a value less than or equal to 3600 (1 hour). If a value is not specified, the token's lifetime will be set to a default value of one hour.

getName

Required. The resource name of the service account for which the credentials are requested, in the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.

Returns
Type Description
string

setName

Required. The resource name of the service account for which the credentials are requested, in the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.

Parameter
Name Description
var string
Returns
Type Description
$this

getDelegates

The sequence of service accounts in a delegation chain. Each service account must be granted the roles/iam.serviceAccountTokenCreator role on its next service account in the chain. The last service account in the chain must be granted the roles/iam.serviceAccountTokenCreator role on the service account that is specified in the name field of the request.

The delegates must have the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setDelegates

The sequence of service accounts in a delegation chain. Each service account must be granted the roles/iam.serviceAccountTokenCreator role on its next service account in the chain. The last service account in the chain must be granted the roles/iam.serviceAccountTokenCreator role on the service account that is specified in the name field of the request.

The delegates must have the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getScope

Required. Code to identify the scopes to be included in the OAuth 2.0 access token.

See https://developers.google.com/identity/protocols/googlescopes for more information. At least one value required.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setScope

Required. Code to identify the scopes to be included in the OAuth 2.0 access token.

See https://developers.google.com/identity/protocols/googlescopes for more information. At least one value required.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getLifetime

The desired lifetime duration of the access token in seconds.

Must be set to a value less than or equal to 3600 (1 hour). If a value is not specified, the token's lifetime will be set to a default value of one hour.

Returns
Type Description
Google\Protobuf\Duration|null

hasLifetime

clearLifetime

setLifetime

The desired lifetime duration of the access token in seconds.

Must be set to a value less than or equal to 3600 (1 hour). If a value is not specified, the token's lifetime will be set to a default value of one hour.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this

static::build

Parameters
Name Description
name string

Required. The resource name of the service account for which the credentials are requested, in the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid. Please see Google\Cloud\Iam\Credentials\V1\IAMCredentialsClient::serviceAccountName() for help formatting this field.

delegates string[]

The sequence of service accounts in a delegation chain. Each service account must be granted the roles/iam.serviceAccountTokenCreator role on its next service account in the chain. The last service account in the chain must be granted the roles/iam.serviceAccountTokenCreator role on the service account that is specified in the name field of the request.

The delegates must have the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.

scope string[]

Required. Code to identify the scopes to be included in the OAuth 2.0 access token. See https://developers.google.com/identity/protocols/googlescopes for more information. At least one value required.

lifetime Google\Protobuf\Duration

The desired lifetime duration of the access token in seconds. Must be set to a value less than or equal to 3600 (1 hour). If a value is not specified, the token's lifetime will be set to a default value of one hour.

Returns
Type Description
Google\Cloud\Iam\Credentials\V1\GenerateAccessTokenRequest