Class ServiceAccountSpec.Builder (3.84.0)

public static final class ServiceAccountSpec.Builder extends GeneratedMessage.Builder<ServiceAccountSpec.Builder> implements ServiceAccountSpecOrBuilder

Configuration for the use of custom service account to run the workloads.

Protobuf type google.cloud.aiplatform.v1beta1.ServiceAccountSpec

Static Methods

getDescriptor()

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

Methods

build()

public ServiceAccountSpec build()
Returns
Type Description
ServiceAccountSpec

buildPartial()

public ServiceAccountSpec buildPartial()
Returns
Type Description
ServiceAccountSpec

clear()

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

clearEnableCustomServiceAccount()

public ServiceAccountSpec.Builder clearEnableCustomServiceAccount()

Required. If true, custom user-managed service account is enforced to run any workloads (for example, Vertex Jobs) on the resource. Otherwise, uses the Vertex AI Custom Code Service Agent.

bool enable_custom_service_account = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ServiceAccountSpec.Builder

This builder for chaining.

clearServiceAccount()

public ServiceAccountSpec.Builder clearServiceAccount()

Optional. Required when all below conditions are met

  • enable_custom_service_account is true;
  • any runtime is specified via ResourceRuntimeSpec on creation time, for example, Ray

    The users must have iam.serviceAccounts.actAs permission on this service account and then the specified runtime containers will run as it.

    Do not set this field if you want to submit jobs using custom service account to this PersistentResource after creation, but only specify the service_account inside the job.

string service_account = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ServiceAccountSpec.Builder

This builder for chaining.

getDefaultInstanceForType()

public ServiceAccountSpec getDefaultInstanceForType()
Returns
Type Description
ServiceAccountSpec

getDescriptorForType()

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

getEnableCustomServiceAccount()

public boolean getEnableCustomServiceAccount()

Required. If true, custom user-managed service account is enforced to run any workloads (for example, Vertex Jobs) on the resource. Otherwise, uses the Vertex AI Custom Code Service Agent.

bool enable_custom_service_account = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

The enableCustomServiceAccount.

getServiceAccount()

public String getServiceAccount()

Optional. Required when all below conditions are met

  • enable_custom_service_account is true;
  • any runtime is specified via ResourceRuntimeSpec on creation time, for example, Ray

    The users must have iam.serviceAccounts.actAs permission on this service account and then the specified runtime containers will run as it.

    Do not set this field if you want to submit jobs using custom service account to this PersistentResource after creation, but only specify the service_account inside the job.

string service_account = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The serviceAccount.

getServiceAccountBytes()

public ByteString getServiceAccountBytes()

Optional. Required when all below conditions are met

  • enable_custom_service_account is true;
  • any runtime is specified via ResourceRuntimeSpec on creation time, for example, Ray

    The users must have iam.serviceAccounts.actAs permission on this service account and then the specified runtime containers will run as it.

    Do not set this field if you want to submit jobs using custom service account to this PersistentResource after creation, but only specify the service_account inside the job.

string service_account = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for serviceAccount.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ServiceAccountSpec other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setEnableCustomServiceAccount(boolean value)

public ServiceAccountSpec.Builder setEnableCustomServiceAccount(boolean value)

Required. If true, custom user-managed service account is enforced to run any workloads (for example, Vertex Jobs) on the resource. Otherwise, uses the Vertex AI Custom Code Service Agent.

bool enable_custom_service_account = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value boolean

The enableCustomServiceAccount to set.

Returns
Type Description
ServiceAccountSpec.Builder

This builder for chaining.

setServiceAccount(String value)

public ServiceAccountSpec.Builder setServiceAccount(String value)

Optional. Required when all below conditions are met

  • enable_custom_service_account is true;
  • any runtime is specified via ResourceRuntimeSpec on creation time, for example, Ray

    The users must have iam.serviceAccounts.actAs permission on this service account and then the specified runtime containers will run as it.

    Do not set this field if you want to submit jobs using custom service account to this PersistentResource after creation, but only specify the service_account inside the job.

string service_account = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The serviceAccount to set.

Returns
Type Description
ServiceAccountSpec.Builder

This builder for chaining.

setServiceAccountBytes(ByteString value)

public ServiceAccountSpec.Builder setServiceAccountBytes(ByteString value)

Optional. Required when all below conditions are met

  • enable_custom_service_account is true;
  • any runtime is specified via ResourceRuntimeSpec on creation time, for example, Ray

    The users must have iam.serviceAccounts.actAs permission on this service account and then the specified runtime containers will run as it.

    Do not set this field if you want to submit jobs using custom service account to this PersistentResource after creation, but only specify the service_account inside the job.

string service_account = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for serviceAccount to set.

Returns
Type Description
ServiceAccountSpec.Builder

This builder for chaining.