Class GenerateAccessTokenRequest.Builder (2.13.0)

publicstaticfinalclass GenerateAccessTokenRequest.BuilderextendsGeneratedMessageV3.Builder<GenerateAccessTokenRequest.Builder>implementsGenerateAccessTokenRequestOrBuilder

Protobuf type google.iam.credentials.v1.GenerateAccessTokenRequest

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addAllDelegates(Iterable<String> values)

publicGenerateAccessTokenRequest.BuilderaddAllDelegates(Iterable<String>values)

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.

repeated string delegates = 2;

Parameter
Name Description
values Iterable<String>

The delegates to add.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

addAllScope(Iterable<String> values)

publicGenerateAccessTokenRequest.BuilderaddAllScope(Iterable<String>values)

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<String>

The scope to add.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

addDelegates(String value)

publicGenerateAccessTokenRequest.BuilderaddDelegates(Stringvalue)

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.

repeated string delegates = 2;

Parameter
Name Description
value String

The delegates to add.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

addDelegatesBytes(ByteString value)

publicGenerateAccessTokenRequest.BuilderaddDelegatesBytes(ByteStringvalue)

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.

repeated string delegates = 2;

Parameter
Name Description
value ByteString

The bytes of the delegates to add.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicGenerateAccessTokenRequest.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

addScope(String value)

publicGenerateAccessTokenRequest.BuilderaddScope(Stringvalue)

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The scope to add.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

addScopeBytes(ByteString value)

publicGenerateAccessTokenRequest.BuilderaddScopeBytes(ByteStringvalue)

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes of the scope to add.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

build()

publicGenerateAccessTokenRequestbuild()
Returns
Type Description
GenerateAccessTokenRequest

buildPartial()

publicGenerateAccessTokenRequestbuildPartial()
Returns
Type Description
GenerateAccessTokenRequest

clear()

publicGenerateAccessTokenRequest.Builderclear()
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

clearDelegates()

publicGenerateAccessTokenRequest.BuilderclearDelegates()

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.

repeated string delegates = 2;

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicGenerateAccessTokenRequest.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

clearLifetime()

publicGenerateAccessTokenRequest.BuilderclearLifetime()

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.

.google.protobuf.Duration lifetime = 7;

Returns
Type Description
GenerateAccessTokenRequest.Builder

clearName()

publicGenerateAccessTokenRequest.BuilderclearName()

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.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicGenerateAccessTokenRequest.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

clearScope()

publicGenerateAccessTokenRequest.BuilderclearScope()

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

clone()

publicGenerateAccessTokenRequest.Builderclone()
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

getDefaultInstanceForType()

publicGenerateAccessTokenRequestgetDefaultInstanceForType()
Returns
Type Description
GenerateAccessTokenRequest

getDelegates(int index)

publicStringgetDelegates(intindex)

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.

repeated string delegates = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The delegates at the given index.

getDelegatesBytes(int index)

publicByteStringgetDelegatesBytes(intindex)

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.

repeated string delegates = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the delegates at the given index.

getDelegatesCount()

publicintgetDelegatesCount()

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.

repeated string delegates = 2;

Returns
Type Description
int

The count of delegates.

getDelegatesList()

publicProtocolStringListgetDelegatesList()

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.

repeated string delegates = 2;

Returns
Type Description
ProtocolStringList

A list containing the delegates.

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLifetime()

publicDurationgetLifetime()

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.

.google.protobuf.Duration lifetime = 7;

Returns
Type Description
Duration

The lifetime.

getLifetimeBuilder()

publicDuration.BuildergetLifetimeBuilder()

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.

.google.protobuf.Duration lifetime = 7;

Returns
Type Description
Builder

getLifetimeOrBuilder()

publicDurationOrBuildergetLifetimeOrBuilder()

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.

.google.protobuf.Duration lifetime = 7;

Returns
Type Description
DurationOrBuilder

getName()

publicStringgetName()

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.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The name.

getNameBytes()

publicByteStringgetNameBytes()

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.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for name.

getScope(int index)

publicStringgetScope(intindex)

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The scope at the given index.

getScopeBytes(int index)

publicByteStringgetScopeBytes(intindex)

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the scope at the given index.

getScopeCount()

publicintgetScopeCount()

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The count of scope.

getScopeList()

publicProtocolStringListgetScopeList()

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ProtocolStringList

A list containing the scope.

hasLifetime()

publicbooleanhasLifetime()

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.

.google.protobuf.Duration lifetime = 7;

Returns
Type Description
boolean

Whether the lifetime field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(GenerateAccessTokenRequest other)

publicGenerateAccessTokenRequest.BuildermergeFrom(GenerateAccessTokenRequestother)
Parameter
Name Description
other GenerateAccessTokenRequest
Returns
Type Description
GenerateAccessTokenRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicGenerateAccessTokenRequest.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicGenerateAccessTokenRequest.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

mergeLifetime(Duration value)

publicGenerateAccessTokenRequest.BuildermergeLifetime(Durationvalue)

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.

.google.protobuf.Duration lifetime = 7;

Parameter
Name Description
value Duration
Returns
Type Description
GenerateAccessTokenRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalGenerateAccessTokenRequest.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

setDelegates(int index, String value)

publicGenerateAccessTokenRequest.BuildersetDelegates(intindex,Stringvalue)

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.

repeated string delegates = 2;

Parameters
Name Description
index int

The index to set the value at.

value String

The delegates to set.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicGenerateAccessTokenRequest.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

setLifetime(Duration value)

publicGenerateAccessTokenRequest.BuildersetLifetime(Durationvalue)

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.

.google.protobuf.Duration lifetime = 7;

Parameter
Name Description
value Duration
Returns
Type Description
GenerateAccessTokenRequest.Builder

setLifetime(Duration.Builder builderForValue)

publicGenerateAccessTokenRequest.BuildersetLifetime(Duration.BuilderbuilderForValue)

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.

.google.protobuf.Duration lifetime = 7;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
GenerateAccessTokenRequest.Builder

setName(String value)

publicGenerateAccessTokenRequest.BuildersetName(Stringvalue)

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.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The name to set.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

setNameBytes(ByteString value)

publicGenerateAccessTokenRequest.BuildersetNameBytes(ByteStringvalue)

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.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicGenerateAccessTokenRequest.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

setScope(int index, String value)

publicGenerateAccessTokenRequest.BuildersetScope(intindex,Stringvalue)

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.

repeated string scope = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int

The index to set the value at.

value String

The scope to set.

Returns
Type Description
GenerateAccessTokenRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalGenerateAccessTokenRequest.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GenerateAccessTokenRequest.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.