public final class ServiceAccount extends com.google.protobuf.GeneratedMessageV3 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 | Class and Description |
|---|---|
static class |
ServiceAccount.Builder
An IAM service account.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
DESCRIPTION_FIELD_NUMBER |
static int |
DISABLED_FIELD_NUMBER |
static int |
DISPLAY_NAME_FIELD_NUMBER |
static int |
EMAIL_FIELD_NUMBER |
static int |
ETAG_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
OAUTH2_CLIENT_ID_FIELD_NUMBER |
static int |
PROJECT_ID_FIELD_NUMBER |
static int |
UNIQUE_ID_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static ServiceAccount |
getDefaultInstance() |
ServiceAccount |
getDefaultInstanceForType() |
String |
getDescription()
Optional.
|
com.google.protobuf.ByteString |
getDescriptionBytes()
Optional.
|
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
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.
|
com.google.protobuf.Parser<ServiceAccount> |
getParserForType() |
String |
getProjectId()
Output only.
|
com.google.protobuf.ByteString |
getProjectIdBytes()
Output only.
|
int |
getSerializedSize() |
String |
getUniqueId()
Output only.
|
com.google.protobuf.ByteString |
getUniqueIdBytes()
Output only.
|
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static ServiceAccount.Builder |
newBuilder() |
static ServiceAccount.Builder |
newBuilder(ServiceAccount prototype) |
ServiceAccount.Builder |
newBuilderForType() |
protected ServiceAccount.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static ServiceAccount |
parseDelimitedFrom(InputStream input) |
static ServiceAccount |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ServiceAccount |
parseFrom(byte[] data) |
static ServiceAccount |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ServiceAccount |
parseFrom(ByteBuffer data) |
static ServiceAccount |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ServiceAccount |
parseFrom(com.google.protobuf.ByteString data) |
static ServiceAccount |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ServiceAccount |
parseFrom(com.google.protobuf.CodedInputStream input) |
static ServiceAccount |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static ServiceAccount |
parseFrom(InputStream input) |
static ServiceAccount |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<ServiceAccount> |
parser() |
ServiceAccount.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int NAME_FIELD_NUMBER
public static final int PROJECT_ID_FIELD_NUMBER
public static final int UNIQUE_ID_FIELD_NUMBER
public static final int EMAIL_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
public static final int ETAG_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER
public static final int OAUTH2_CLIENT_ID_FIELD_NUMBER
public static final int DISABLED_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public 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 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 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 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 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 ServiceAccountOrBuilder@Deprecated public com.google.protobuf.ByteString getEtag()
Deprecated. Do not use.
bytes etag = 7 [deprecated = true];getEtag in interface ServiceAccountOrBuilderpublic 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 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 boolean getDisabled()
Output only. Whether the service account is disabled.
bool disabled = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];getDisabled in interface ServiceAccountOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static ServiceAccount parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ServiceAccount parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ServiceAccount parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ServiceAccount parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ServiceAccount parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ServiceAccount parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static ServiceAccount parseFrom(InputStream input) throws IOException
IOExceptionpublic static ServiceAccount parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static ServiceAccount parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static ServiceAccount parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static ServiceAccount parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static ServiceAccount parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic ServiceAccount.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static ServiceAccount.Builder newBuilder()
public static ServiceAccount.Builder newBuilder(ServiceAccount prototype)
public ServiceAccount.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected ServiceAccount.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static ServiceAccount getDefaultInstance()
public static com.google.protobuf.Parser<ServiceAccount> parser()
public com.google.protobuf.Parser<ServiceAccount> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public ServiceAccount getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2025 Google LLC. All rights reserved.