Class ServiceAccount

  • All Implemented Interfaces:
    ServiceAccountOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    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
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getName

        public 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;
        Specified by:
        getName in interface ServiceAccountOrBuilder
        Returns:
        The name.
      • getNameBytes

        public 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;
        Specified by:
        getNameBytes in interface ServiceAccountOrBuilder
        Returns:
        The bytes for name.
      • getProjectId

        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];
        Specified by:
        getProjectId in interface ServiceAccountOrBuilder
        Returns:
        The projectId.
      • getProjectIdBytes

        public 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];
        Specified by:
        getProjectIdBytes in interface ServiceAccountOrBuilder
        Returns:
        The bytes for projectId.
      • getUniqueId

        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];
        Specified by:
        getUniqueId in interface ServiceAccountOrBuilder
        Returns:
        The uniqueId.
      • getUniqueIdBytes

        public 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];
        Specified by:
        getUniqueIdBytes in interface ServiceAccountOrBuilder
        Returns:
        The bytes for uniqueId.
      • getEmail

        public String getEmail()
         Output only. The email address of the service account.
         
        string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getEmail in interface ServiceAccountOrBuilder
        Returns:
        The email.
      • getEmailBytes

        public com.google.protobuf.ByteString getEmailBytes()
         Output only. The email address of the service account.
         
        string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getEmailBytes in interface ServiceAccountOrBuilder
        Returns:
        The bytes for email.
      • getDisplayName

        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];
        Specified by:
        getDisplayName in interface ServiceAccountOrBuilder
        Returns:
        The displayName.
      • getDisplayNameBytes

        public 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];
        Specified by:
        getDisplayNameBytes in interface ServiceAccountOrBuilder
        Returns:
        The bytes for displayName.
      • getEtag

        @Deprecated
        public com.google.protobuf.ByteString getEtag()
        Deprecated.
        google.iam.admin.v1.ServiceAccount.etag is deprecated. See google/iam/admin/v1/iam.proto;l=538
         Deprecated. Do not use.
         
        bytes etag = 7 [deprecated = true];
        Specified by:
        getEtag in interface ServiceAccountOrBuilder
        Returns:
        The etag.
      • getDescription

        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];
        Specified by:
        getDescription in interface ServiceAccountOrBuilder
        Returns:
        The description.
      • getDescriptionBytes

        public 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];
        Specified by:
        getDescriptionBytes in interface ServiceAccountOrBuilder
        Returns:
        The bytes for description.
      • getOauth2ClientId

        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];
        Specified by:
        getOauth2ClientId in interface ServiceAccountOrBuilder
        Returns:
        The oauth2ClientId.
      • getOauth2ClientIdBytes

        public 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];
        Specified by:
        getOauth2ClientIdBytes in interface ServiceAccountOrBuilder
        Returns:
        The bytes for oauth2ClientId.
      • getDisabled

        public boolean getDisabled()
         Output only. Whether the service account is disabled.
         
        bool disabled = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getDisabled in interface ServiceAccountOrBuilder
        Returns:
        The disabled.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static ServiceAccount parseFrom​(ByteBuffer data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceAccount parseFrom​(ByteBuffer data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceAccount parseFrom​(com.google.protobuf.ByteString data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceAccount parseFrom​(com.google.protobuf.ByteString data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceAccount parseFrom​(byte[] data)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceAccount parseFrom​(byte[] data,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceAccount parseFrom​(com.google.protobuf.CodedInputStream input,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws IOException
        Throws:
        IOException
      • newBuilderForType

        public ServiceAccount.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public ServiceAccount.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected ServiceAccount.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static ServiceAccount getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<ServiceAccount> parser()
      • getParserForType

        public com.google.protobuf.Parser<ServiceAccount> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public ServiceAccount getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder