public static final class ServiceAccount.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder> implements ServiceAccountOrBuilder
An IAM service account. A service account is an account for an application or a virtual machine (VM) instance, not a person. You can use a service account to call Google APIs. To learn more, read the [overview of service accounts](https://cloud.google.com/iam/help/service-accounts/overview). When you create a service account, you specify the project ID that owns the service account, as well as a name that must be unique within the project. IAM uses these values to create an email address that identifies the service account.Protobuf type
google.iam.admin.v1.ServiceAccount| Modifier and Type | Method and Description |
|---|---|
ServiceAccount.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
ServiceAccount |
build() |
ServiceAccount |
buildPartial() |
ServiceAccount.Builder |
clear() |
ServiceAccount.Builder |
clearDescription()
Optional.
|
ServiceAccount.Builder |
clearDisabled()
Output only.
|
ServiceAccount.Builder |
clearDisplayName()
Optional.
|
ServiceAccount.Builder |
clearEmail()
Output only.
|
ServiceAccount.Builder |
clearEtag()
Deprecated.
google.iam.admin.v1.ServiceAccount.etag is deprecated. See
google/iam/admin/v1/iam.proto;l=538
|
ServiceAccount.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
ServiceAccount.Builder |
clearName()
The resource name of the service account.
|
ServiceAccount.Builder |
clearOauth2ClientId()
Output only.
|
ServiceAccount.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
ServiceAccount.Builder |
clearProjectId()
Output only.
|
ServiceAccount.Builder |
clearUniqueId()
Output only.
|
ServiceAccount.Builder |
clone() |
ServiceAccount |
getDefaultInstanceForType() |
String |
getDescription()
Optional.
|
com.google.protobuf.ByteString |
getDescriptionBytes()
Optional.
|
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
boolean |
getDisabled()
Output only.
|
String |
getDisplayName()
Optional.
|
com.google.protobuf.ByteString |
getDisplayNameBytes()
Optional.
|
String |
getEmail()
Output only.
|
com.google.protobuf.ByteString |
getEmailBytes()
Output only.
|
com.google.protobuf.ByteString |
getEtag()
Deprecated.
google.iam.admin.v1.ServiceAccount.etag is deprecated. See
google/iam/admin/v1/iam.proto;l=538
|
String |
getName()
The resource name of the service account.
|
com.google.protobuf.ByteString |
getNameBytes()
The resource name of the service account.
|
String |
getOauth2ClientId()
Output only.
|
com.google.protobuf.ByteString |
getOauth2ClientIdBytes()
Output only.
|
String |
getProjectId()
Output only.
|
com.google.protobuf.ByteString |
getProjectIdBytes()
Output only.
|
String |
getUniqueId()
Output only.
|
com.google.protobuf.ByteString |
getUniqueIdBytes()
Output only.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
ServiceAccount.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
ServiceAccount.Builder |
mergeFrom(com.google.protobuf.Message other) |
ServiceAccount.Builder |
mergeFrom(ServiceAccount other) |
ServiceAccount.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
ServiceAccount.Builder |
setDescription(String value)
Optional.
|
ServiceAccount.Builder |
setDescriptionBytes(com.google.protobuf.ByteString value)
Optional.
|
ServiceAccount.Builder |
setDisabled(boolean value)
Output only.
|
ServiceAccount.Builder |
setDisplayName(String value)
Optional.
|
ServiceAccount.Builder |
setDisplayNameBytes(com.google.protobuf.ByteString value)
Optional.
|
ServiceAccount.Builder |
setEmail(String value)
Output only.
|
ServiceAccount.Builder |
setEmailBytes(com.google.protobuf.ByteString value)
Output only.
|
ServiceAccount.Builder |
setEtag(com.google.protobuf.ByteString value)
Deprecated.
google.iam.admin.v1.ServiceAccount.etag is deprecated. See
google/iam/admin/v1/iam.proto;l=538
|
ServiceAccount.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
ServiceAccount.Builder |
setName(String value)
The resource name of the service account.
|
ServiceAccount.Builder |
setNameBytes(com.google.protobuf.ByteString value)
The resource name of the service account.
|
ServiceAccount.Builder |
setOauth2ClientId(String value)
Output only.
|
ServiceAccount.Builder |
setOauth2ClientIdBytes(com.google.protobuf.ByteString value)
Output only.
|
ServiceAccount.Builder |
setProjectId(String value)
Output only.
|
ServiceAccount.Builder |
setProjectIdBytes(com.google.protobuf.ByteString value)
Output only.
|
ServiceAccount.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
ServiceAccount.Builder |
setUniqueId(String value)
Output only.
|
ServiceAccount.Builder |
setUniqueIdBytes(com.google.protobuf.ByteString value)
Output only.
|
ServiceAccount.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic ServiceAccount build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic ServiceAccount buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic ServiceAccount.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<ServiceAccount.Builder>public ServiceAccount.Builder mergeFrom(ServiceAccount other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public ServiceAccount.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<ServiceAccount.Builder>IOExceptionpublic String getName()
The resource name of the service account.
Use one of the following formats:
* `projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}`
As an alternative, you can use the `-` wildcard character instead of the
project ID:
* `projects/-/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/-/serviceAccounts/{UNIQUE_ID}`
When possible, avoid using the `-` wildcard character, because it can cause
response messages to contain misleading error codes. For example, if you
try to get the service account
`projects/-/serviceAccounts/fake@example.com`, which does not exist, the
response contains an HTTP `403 Forbidden` error instead of a `404 Not
Found` error.
string name = 1;getName in interface ServiceAccountOrBuilderpublic com.google.protobuf.ByteString getNameBytes()
The resource name of the service account.
Use one of the following formats:
* `projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}`
As an alternative, you can use the `-` wildcard character instead of the
project ID:
* `projects/-/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/-/serviceAccounts/{UNIQUE_ID}`
When possible, avoid using the `-` wildcard character, because it can cause
response messages to contain misleading error codes. For example, if you
try to get the service account
`projects/-/serviceAccounts/fake@example.com`, which does not exist, the
response contains an HTTP `403 Forbidden` error instead of a `404 Not
Found` error.
string name = 1;getNameBytes in interface ServiceAccountOrBuilderpublic ServiceAccount.Builder setName(String value)
The resource name of the service account.
Use one of the following formats:
* `projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}`
As an alternative, you can use the `-` wildcard character instead of the
project ID:
* `projects/-/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/-/serviceAccounts/{UNIQUE_ID}`
When possible, avoid using the `-` wildcard character, because it can cause
response messages to contain misleading error codes. For example, if you
try to get the service account
`projects/-/serviceAccounts/fake@example.com`, which does not exist, the
response contains an HTTP `403 Forbidden` error instead of a `404 Not
Found` error.
string name = 1;value - The name to set.public ServiceAccount.Builder clearName()
The resource name of the service account.
Use one of the following formats:
* `projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}`
As an alternative, you can use the `-` wildcard character instead of the
project ID:
* `projects/-/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/-/serviceAccounts/{UNIQUE_ID}`
When possible, avoid using the `-` wildcard character, because it can cause
response messages to contain misleading error codes. For example, if you
try to get the service account
`projects/-/serviceAccounts/fake@example.com`, which does not exist, the
response contains an HTTP `403 Forbidden` error instead of a `404 Not
Found` error.
string name = 1;public ServiceAccount.Builder setNameBytes(com.google.protobuf.ByteString value)
The resource name of the service account.
Use one of the following formats:
* `projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}`
As an alternative, you can use the `-` wildcard character instead of the
project ID:
* `projects/-/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/-/serviceAccounts/{UNIQUE_ID}`
When possible, avoid using the `-` wildcard character, because it can cause
response messages to contain misleading error codes. For example, if you
try to get the service account
`projects/-/serviceAccounts/fake@example.com`, which does not exist, the
response contains an HTTP `403 Forbidden` error instead of a `404 Not
Found` error.
string name = 1;value - The bytes for name to set.public String getProjectId()
Output only. The ID of the project that owns the service account.
string project_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];getProjectId in interface ServiceAccountOrBuilderpublic com.google.protobuf.ByteString getProjectIdBytes()
Output only. The ID of the project that owns the service account.
string project_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];getProjectIdBytes in interface ServiceAccountOrBuilderpublic ServiceAccount.Builder setProjectId(String value)
Output only. The ID of the project that owns the service account.
string project_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The projectId to set.public ServiceAccount.Builder clearProjectId()
Output only. The ID of the project that owns the service account.
string project_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];public ServiceAccount.Builder setProjectIdBytes(com.google.protobuf.ByteString value)
Output only. The ID of the project that owns the service account.
string project_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The bytes for projectId to set.public String getUniqueId()
Output only. The unique, stable numeric ID for the service account. Each service account retains its unique ID even if you delete the service account. For example, if you delete a service account, then create a new service account with the same name, the new service account has a different unique ID than the deleted service account.
string unique_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];getUniqueId in interface ServiceAccountOrBuilderpublic com.google.protobuf.ByteString getUniqueIdBytes()
Output only. The unique, stable numeric ID for the service account. Each service account retains its unique ID even if you delete the service account. For example, if you delete a service account, then create a new service account with the same name, the new service account has a different unique ID than the deleted service account.
string unique_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];getUniqueIdBytes in interface ServiceAccountOrBuilderpublic ServiceAccount.Builder setUniqueId(String value)
Output only. The unique, stable numeric ID for the service account. Each service account retains its unique ID even if you delete the service account. For example, if you delete a service account, then create a new service account with the same name, the new service account has a different unique ID than the deleted service account.
string unique_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The uniqueId to set.public ServiceAccount.Builder clearUniqueId()
Output only. The unique, stable numeric ID for the service account. Each service account retains its unique ID even if you delete the service account. For example, if you delete a service account, then create a new service account with the same name, the new service account has a different unique ID than the deleted service account.
string unique_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];public ServiceAccount.Builder setUniqueIdBytes(com.google.protobuf.ByteString value)
Output only. The unique, stable numeric ID for the service account. Each service account retains its unique ID even if you delete the service account. For example, if you delete a service account, then create a new service account with the same name, the new service account has a different unique ID than the deleted service account.
string unique_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The bytes for uniqueId to set.public String getEmail()
Output only. The email address of the service account.
string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];getEmail in interface ServiceAccountOrBuilderpublic com.google.protobuf.ByteString getEmailBytes()
Output only. The email address of the service account.
string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];getEmailBytes in interface ServiceAccountOrBuilderpublic ServiceAccount.Builder setEmail(String value)
Output only. The email address of the service account.
string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The email to set.public ServiceAccount.Builder clearEmail()
Output only. The email address of the service account.
string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];public ServiceAccount.Builder setEmailBytes(com.google.protobuf.ByteString value)
Output only. The email address of the service account.
string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The bytes for email to set.public String getDisplayName()
Optional. A user-specified, human-readable name for the service account. The maximum length is 100 UTF-8 bytes.
string display_name = 6 [(.google.api.field_behavior) = OPTIONAL];getDisplayName in interface ServiceAccountOrBuilderpublic com.google.protobuf.ByteString getDisplayNameBytes()
Optional. A user-specified, human-readable name for the service account. The maximum length is 100 UTF-8 bytes.
string display_name = 6 [(.google.api.field_behavior) = OPTIONAL];getDisplayNameBytes in interface ServiceAccountOrBuilderpublic ServiceAccount.Builder setDisplayName(String value)
Optional. A user-specified, human-readable name for the service account. The maximum length is 100 UTF-8 bytes.
string display_name = 6 [(.google.api.field_behavior) = OPTIONAL];value - The displayName to set.public ServiceAccount.Builder clearDisplayName()
Optional. A user-specified, human-readable name for the service account. The maximum length is 100 UTF-8 bytes.
string display_name = 6 [(.google.api.field_behavior) = OPTIONAL];public ServiceAccount.Builder setDisplayNameBytes(com.google.protobuf.ByteString value)
Optional. A user-specified, human-readable name for the service account. The maximum length is 100 UTF-8 bytes.
string display_name = 6 [(.google.api.field_behavior) = OPTIONAL];value - The bytes for displayName to set.@Deprecated public com.google.protobuf.ByteString getEtag()
Deprecated. Do not use.
bytes etag = 7 [deprecated = true];getEtag in interface ServiceAccountOrBuilder@Deprecated public ServiceAccount.Builder setEtag(com.google.protobuf.ByteString value)
Deprecated. Do not use.
bytes etag = 7 [deprecated = true];value - The etag to set.@Deprecated public ServiceAccount.Builder clearEtag()
Deprecated. Do not use.
bytes etag = 7 [deprecated = true];public String getDescription()
Optional. A user-specified, human-readable description of the service account. The maximum length is 256 UTF-8 bytes.
string description = 8 [(.google.api.field_behavior) = OPTIONAL];getDescription in interface ServiceAccountOrBuilderpublic com.google.protobuf.ByteString getDescriptionBytes()
Optional. A user-specified, human-readable description of the service account. The maximum length is 256 UTF-8 bytes.
string description = 8 [(.google.api.field_behavior) = OPTIONAL];getDescriptionBytes in interface ServiceAccountOrBuilderpublic ServiceAccount.Builder setDescription(String value)
Optional. A user-specified, human-readable description of the service account. The maximum length is 256 UTF-8 bytes.
string description = 8 [(.google.api.field_behavior) = OPTIONAL];value - The description to set.public ServiceAccount.Builder clearDescription()
Optional. A user-specified, human-readable description of the service account. The maximum length is 256 UTF-8 bytes.
string description = 8 [(.google.api.field_behavior) = OPTIONAL];public ServiceAccount.Builder setDescriptionBytes(com.google.protobuf.ByteString value)
Optional. A user-specified, human-readable description of the service account. The maximum length is 256 UTF-8 bytes.
string description = 8 [(.google.api.field_behavior) = OPTIONAL];value - The bytes for description to set.public String getOauth2ClientId()
Output only. The OAuth 2.0 client ID for the service account.
string oauth2_client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];getOauth2ClientId in interface ServiceAccountOrBuilderpublic com.google.protobuf.ByteString getOauth2ClientIdBytes()
Output only. The OAuth 2.0 client ID for the service account.
string oauth2_client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];getOauth2ClientIdBytes in interface ServiceAccountOrBuilderpublic ServiceAccount.Builder setOauth2ClientId(String value)
Output only. The OAuth 2.0 client ID for the service account.
string oauth2_client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The oauth2ClientId to set.public ServiceAccount.Builder clearOauth2ClientId()
Output only. The OAuth 2.0 client ID for the service account.
string oauth2_client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];public ServiceAccount.Builder setOauth2ClientIdBytes(com.google.protobuf.ByteString value)
Output only. The OAuth 2.0 client ID for the service account.
string oauth2_client_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The bytes for oauth2ClientId to set.public boolean getDisabled()
Output only. Whether the service account is disabled.
bool disabled = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];getDisabled in interface ServiceAccountOrBuilderpublic ServiceAccount.Builder setDisabled(boolean value)
Output only. Whether the service account is disabled.
bool disabled = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];value - The disabled to set.public ServiceAccount.Builder clearDisabled()
Output only. Whether the service account is disabled.
bool disabled = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];public final ServiceAccount.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>public final ServiceAccount.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>Copyright © 2025 Google LLC. All rights reserved.