Class OAuthConfig.Builder (0.1.0)

public static final class OAuthConfig.Builder extends GeneratedMessage.Builder<OAuthConfig.Builder> implements OAuthConfigOrBuilder

Configurations for authentication with OAuth.

Protobuf type google.cloud.ces.v1.OAuthConfig

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllScopes(Iterable<String> values)

public OAuthConfig.Builder addAllScopes(Iterable<String> values)

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<String>

The scopes to add.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

addScopes(String value)

public OAuthConfig.Builder addScopes(String value)

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The scopes to add.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

addScopesBytes(ByteString value)

public OAuthConfig.Builder addScopesBytes(ByteString value)

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes of the scopes to add.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

build()

public OAuthConfig build()
Returns
Type Description
OAuthConfig

buildPartial()

public OAuthConfig buildPartial()
Returns
Type Description
OAuthConfig

clear()

public OAuthConfig.Builder clear()
Returns
Type Description
OAuthConfig.Builder
Overrides

clearClientId()

public OAuthConfig.Builder clearClientId()

Required. The client ID from the OAuth provider.

string client_id = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

clearClientSecretVersion()

public OAuthConfig.Builder clearClientSecretVersion()

Required. The name of the SecretManager secret version resource storing the client secret. Format: projects/{project}/secrets/{secret}/versions/{version}

Note: You should grant roles/secretmanager.secretAccessor role to the CES service agent service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com.

string client_secret_version = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

clearOauthGrantType()

public OAuthConfig.Builder clearOauthGrantType()

Required. OAuth grant types.

.google.cloud.ces.v1.OAuthConfig.OauthGrantType oauth_grant_type = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

clearScopes()

public OAuthConfig.Builder clearScopes()

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

clearTokenEndpoint()

public OAuthConfig.Builder clearTokenEndpoint()

Required. The token endpoint in the OAuth provider to exchange for an access token.

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

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

getClientId()

public String getClientId()

Required. The client ID from the OAuth provider.

string client_id = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The clientId.

getClientIdBytes()

public ByteString getClientIdBytes()

Required. The client ID from the OAuth provider.

string client_id = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for clientId.

getClientSecretVersion()

public String getClientSecretVersion()

Required. The name of the SecretManager secret version resource storing the client secret. Format: projects/{project}/secrets/{secret}/versions/{version}

Note: You should grant roles/secretmanager.secretAccessor role to the CES service agent service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com.

string client_secret_version = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The clientSecretVersion.

getClientSecretVersionBytes()

public ByteString getClientSecretVersionBytes()

Required. The name of the SecretManager secret version resource storing the client secret. Format: projects/{project}/secrets/{secret}/versions/{version}

Note: You should grant roles/secretmanager.secretAccessor role to the CES service agent service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com.

string client_secret_version = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for clientSecretVersion.

getDefaultInstanceForType()

public OAuthConfig getDefaultInstanceForType()
Returns
Type Description
OAuthConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getOauthGrantType()

public OAuthConfig.OauthGrantType getOauthGrantType()

Required. OAuth grant types.

.google.cloud.ces.v1.OAuthConfig.OauthGrantType oauth_grant_type = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OAuthConfig.OauthGrantType

The oauthGrantType.

getOauthGrantTypeValue()

public int getOauthGrantTypeValue()

Required. OAuth grant types.

.google.cloud.ces.v1.OAuthConfig.OauthGrantType oauth_grant_type = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for oauthGrantType.

getScopes(int index)

public String getScopes(int index)

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The scopes at the given index.

getScopesBytes(int index)

public ByteString getScopesBytes(int index)

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the scopes at the given index.

getScopesCount()

public int getScopesCount()

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The count of scopes.

getScopesList()

public ProtocolStringList getScopesList()

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProtocolStringList

A list containing the scopes.

getTokenEndpoint()

public String getTokenEndpoint()

Required. The token endpoint in the OAuth provider to exchange for an access token.

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

Returns
Type Description
String

The tokenEndpoint.

getTokenEndpointBytes()

public ByteString getTokenEndpointBytes()

Required. The token endpoint in the OAuth provider to exchange for an access token.

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

Returns
Type Description
ByteString

The bytes for tokenEndpoint.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(OAuthConfig other)

public OAuthConfig.Builder mergeFrom(OAuthConfig other)
Parameter
Name Description
other OAuthConfig
Returns
Type Description
OAuthConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public OAuthConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OAuthConfig.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public OAuthConfig.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
OAuthConfig.Builder
Overrides

setClientId(String value)

public OAuthConfig.Builder setClientId(String value)

Required. The client ID from the OAuth provider.

string client_id = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The clientId to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

setClientIdBytes(ByteString value)

public OAuthConfig.Builder setClientIdBytes(ByteString value)

Required. The client ID from the OAuth provider.

string client_id = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for clientId to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

setClientSecretVersion(String value)

public OAuthConfig.Builder setClientSecretVersion(String value)

Required. The name of the SecretManager secret version resource storing the client secret. Format: projects/{project}/secrets/{secret}/versions/{version}

Note: You should grant roles/secretmanager.secretAccessor role to the CES service agent service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com.

string client_secret_version = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The clientSecretVersion to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

setClientSecretVersionBytes(ByteString value)

public OAuthConfig.Builder setClientSecretVersionBytes(ByteString value)

Required. The name of the SecretManager secret version resource storing the client secret. Format: projects/{project}/secrets/{secret}/versions/{version}

Note: You should grant roles/secretmanager.secretAccessor role to the CES service agent service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com.

string client_secret_version = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for clientSecretVersion to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

setOauthGrantType(OAuthConfig.OauthGrantType value)

public OAuthConfig.Builder setOauthGrantType(OAuthConfig.OauthGrantType value)

Required. OAuth grant types.

.google.cloud.ces.v1.OAuthConfig.OauthGrantType oauth_grant_type = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value OAuthConfig.OauthGrantType

The oauthGrantType to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

setOauthGrantTypeValue(int value)

public OAuthConfig.Builder setOauthGrantTypeValue(int value)

Required. OAuth grant types.

.google.cloud.ces.v1.OAuthConfig.OauthGrantType oauth_grant_type = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value int

The enum numeric value on the wire for oauthGrantType to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

setScopes(int index, String value)

public OAuthConfig.Builder setScopes(int index, String value)

Optional. The OAuth scopes to grant.

repeated string scopes = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int

The index to set the value at.

value String

The scopes to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

setTokenEndpoint(String value)

public OAuthConfig.Builder setTokenEndpoint(String value)

Required. The token endpoint in the OAuth provider to exchange for an access token.

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

Parameter
Name Description
value String

The tokenEndpoint to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.

setTokenEndpointBytes(ByteString value)

public OAuthConfig.Builder setTokenEndpointBytes(ByteString value)

Required. The token endpoint in the OAuth provider to exchange for an access token.

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

Parameter
Name Description
value ByteString

The bytes for tokenEndpoint to set.

Returns
Type Description
OAuthConfig.Builder

This builder for chaining.