Class GenerateAccessTokenRequest.Builder (2.4.0)

public static final class GenerateAccessTokenRequest.Builder extends GeneratedMessageV3.Builder<GenerateAccessTokenRequest.Builder> implements GenerateAccessTokenRequestOrBuilder

Protobuf type google.iam.credentials.v1.GenerateAccessTokenRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllDelegates(Iterable<String> values)

public GenerateAccessTokenRequest.Builder addAllDelegates(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
NameDescription
valuesIterable<String>

The delegates to add.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

addAllScope(Iterable<String> values)

public GenerateAccessTokenRequest.Builder addAllScope(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
NameDescription
valuesIterable<String>

The scope to add.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

addDelegates(String value)

public GenerateAccessTokenRequest.Builder addDelegates(String value)

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
NameDescription
valueString

The delegates to add.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

addDelegatesBytes(ByteString value)

public GenerateAccessTokenRequest.Builder addDelegatesBytes(ByteString value)

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
NameDescription
valueByteString

The bytes of the delegates to add.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public GenerateAccessTokenRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

addScope(String value)

public GenerateAccessTokenRequest.Builder addScope(String value)

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
NameDescription
valueString

The scope to add.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

addScopeBytes(ByteString value)

public GenerateAccessTokenRequest.Builder addScopeBytes(ByteString value)

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
NameDescription
valueByteString

The bytes of the scope to add.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

build()

public GenerateAccessTokenRequest build()
Returns
TypeDescription
GenerateAccessTokenRequest

buildPartial()

public GenerateAccessTokenRequest buildPartial()
Returns
TypeDescription
GenerateAccessTokenRequest

clear()

public GenerateAccessTokenRequest.Builder clear()
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

clearDelegates()

public GenerateAccessTokenRequest.Builder clearDelegates()

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
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public GenerateAccessTokenRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

clearLifetime()

public GenerateAccessTokenRequest.Builder clearLifetime()

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
TypeDescription
GenerateAccessTokenRequest.Builder

clearName()

public GenerateAccessTokenRequest.Builder clearName()

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
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public GenerateAccessTokenRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

clearScope()

public GenerateAccessTokenRequest.Builder clearScope()

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
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

clone()

public GenerateAccessTokenRequest.Builder clone()
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

getDefaultInstanceForType()

public GenerateAccessTokenRequest getDefaultInstanceForType()
Returns
TypeDescription
GenerateAccessTokenRequest

getDelegates(int index)

public String getDelegates(int index)

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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The delegates at the given index.

getDelegatesBytes(int index)

public ByteString getDelegatesBytes(int index)

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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the delegates at the given index.

getDelegatesCount()

public int getDelegatesCount()

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
TypeDescription
int

The count of delegates.

getDelegatesList()

public ProtocolStringList getDelegatesList()

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
TypeDescription
ProtocolStringList

A list containing the delegates.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLifetime()

public Duration 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.

.google.protobuf.Duration lifetime = 7;

Returns
TypeDescription
Duration

The lifetime.

getLifetimeBuilder()

public Duration.Builder getLifetimeBuilder()

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
TypeDescription
Builder

getLifetimeOrBuilder()

public DurationOrBuilder getLifetimeOrBuilder()

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
TypeDescription
DurationOrBuilder

getName()

public String 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.

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

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

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
TypeDescription
ByteString

The bytes for name.

getScope(int index)

public String getScope(int index)

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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The scope at the given index.

getScopeBytes(int index)

public ByteString getScopeBytes(int index)

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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the scope at the given index.

getScopeCount()

public int getScopeCount()

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
TypeDescription
int

The count of scope.

getScopeList()

public ProtocolStringList getScopeList()

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
TypeDescription
ProtocolStringList

A list containing the scope.

hasLifetime()

public boolean hasLifetime()

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
TypeDescription
boolean

Whether the lifetime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(GenerateAccessTokenRequest other)

public GenerateAccessTokenRequest.Builder mergeFrom(GenerateAccessTokenRequest other)
Parameter
NameDescription
otherGenerateAccessTokenRequest
Returns
TypeDescription
GenerateAccessTokenRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public GenerateAccessTokenRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public GenerateAccessTokenRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

mergeLifetime(Duration value)

public GenerateAccessTokenRequest.Builder mergeLifetime(Duration value)

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
NameDescription
valueDuration
Returns
TypeDescription
GenerateAccessTokenRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GenerateAccessTokenRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

setDelegates(int index, String value)

public GenerateAccessTokenRequest.Builder setDelegates(int index, String value)

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
NameDescription
indexint

The index to set the value at.

valueString

The delegates to set.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public GenerateAccessTokenRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

setLifetime(Duration value)

public GenerateAccessTokenRequest.Builder setLifetime(Duration value)

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
NameDescription
valueDuration
Returns
TypeDescription
GenerateAccessTokenRequest.Builder

setLifetime(Duration.Builder builderForValue)

public GenerateAccessTokenRequest.Builder setLifetime(Duration.Builder builderForValue)

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
NameDescription
builderForValueBuilder
Returns
TypeDescription
GenerateAccessTokenRequest.Builder

setName(String value)

public GenerateAccessTokenRequest.Builder setName(String value)

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
NameDescription
valueString

The name to set.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

setNameBytes(ByteString value)

public GenerateAccessTokenRequest.Builder setNameBytes(ByteString value)

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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

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

public GenerateAccessTokenRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides

setScope(int index, String value)

public GenerateAccessTokenRequest.Builder setScope(int index, String value)

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
NameDescription
indexint

The index to set the value at.

valueString

The scope to set.

Returns
TypeDescription
GenerateAccessTokenRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final GenerateAccessTokenRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GenerateAccessTokenRequest.Builder
Overrides