Class ServiceAccount.Builder

  • All Implemented Interfaces:
    ServiceAccountOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    ServiceAccount

    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
    • Method Detail

      • 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.Builder<ServiceAccount.Builder>
      • clear

        public ServiceAccount.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • getDefaultInstanceForType

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

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

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

        public ServiceAccount.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • setField

        public ServiceAccount.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                               Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • clearField

        public ServiceAccount.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • clearOneof

        public ServiceAccount.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • setRepeatedField

        public ServiceAccount.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                       int index,
                                                       Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • addRepeatedField

        public ServiceAccount.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                       Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • mergeFrom

        public ServiceAccount.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ServiceAccount.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • mergeFrom

        public ServiceAccount.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ServiceAccount.Builder>
        Throws:
        IOException
      • 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.
      • setName

        public 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;
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        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;
        Returns:
        This builder for chaining.
      • setNameBytes

        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;
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • 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.
      • setProjectId

        public 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];
        Parameters:
        value - The projectId to set.
        Returns:
        This builder for chaining.
      • clearProjectId

        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];
        Returns:
        This builder for chaining.
      • setProjectIdBytes

        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];
        Parameters:
        value - The bytes for projectId to set.
        Returns:
        This builder for chaining.
      • 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.
      • setUniqueId

        public 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];
        Parameters:
        value - The uniqueId to set.
        Returns:
        This builder for chaining.
      • clearUniqueId

        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];
        Returns:
        This builder for chaining.
      • setUniqueIdBytes

        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];
        Parameters:
        value - The bytes for uniqueId to set.
        Returns:
        This builder for chaining.
      • 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.
      • setEmail

        public ServiceAccount.Builder setEmail​(String value)
         Output only. The email address of the service account.
         
        string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The email to set.
        Returns:
        This builder for chaining.
      • clearEmail

        public ServiceAccount.Builder clearEmail()
         Output only. The email address of the service account.
         
        string email = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setEmailBytes

        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];
        Parameters:
        value - The bytes for email to set.
        Returns:
        This builder for chaining.
      • 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.
      • setDisplayName

        public 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];
        Parameters:
        value - The displayName to set.
        Returns:
        This builder for chaining.
      • clearDisplayName

        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];
        Returns:
        This builder for chaining.
      • setDisplayNameBytes

        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];
        Parameters:
        value - The bytes for displayName to set.
        Returns:
        This builder for chaining.
      • 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.
      • setEtag

        @Deprecated
        public 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
         Deprecated. Do not use.
         
        bytes etag = 7 [deprecated = true];
        Parameters:
        value - The etag to set.
        Returns:
        This builder for chaining.
      • clearEtag

        @Deprecated
        public ServiceAccount.Builder clearEtag()
        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];
        Returns:
        This builder for chaining.
      • 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.
      • setDescription

        public 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];
        Parameters:
        value - The description to set.
        Returns:
        This builder for chaining.
      • clearDescription

        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];
        Returns:
        This builder for chaining.
      • setDescriptionBytes

        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];
        Parameters:
        value - The bytes for description to set.
        Returns:
        This builder for chaining.
      • 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.
      • setOauth2ClientId

        public 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];
        Parameters:
        value - The oauth2ClientId to set.
        Returns:
        This builder for chaining.
      • clearOauth2ClientId

        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];
        Returns:
        This builder for chaining.
      • setOauth2ClientIdBytes

        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];
        Parameters:
        value - The bytes for oauth2ClientId to set.
        Returns:
        This builder for chaining.
      • 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.
      • setDisabled

        public ServiceAccount.Builder setDisabled​(boolean value)
         Output only. Whether the service account is disabled.
         
        bool disabled = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The disabled to set.
        Returns:
        This builder for chaining.
      • clearDisabled

        public ServiceAccount.Builder clearDisabled()
         Output only. Whether the service account is disabled.
         
        bool disabled = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final ServiceAccount.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>
      • mergeUnknownFields

        public final ServiceAccount.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ServiceAccount.Builder>