Class CmekSettings.Builder

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

    public static final class CmekSettings.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<CmekSettings.Builder>
    implements CmekSettingsOrBuilder
     Describes the customer-managed encryption key (CMEK) settings associated with
     a project, folder, organization, billing account, or flexible resource.
    
     Note: CMEK for the Log Router can currently only be configured for Google
     Cloud organizations. Once configured, it applies to all projects and folders
     in the Google Cloud organization.
    
     See [Enabling CMEK for Log
     Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
     more information.
     
    Protobuf type google.logging.v2.CmekSettings
    • 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<CmekSettings.Builder>
      • clear

        public CmekSettings.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<CmekSettings.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<CmekSettings.Builder>
      • getDefaultInstanceForType

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

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

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

        public CmekSettings.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<CmekSettings.Builder>
      • setField

        public CmekSettings.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<CmekSettings.Builder>
      • clearField

        public CmekSettings.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<CmekSettings.Builder>
      • clearOneof

        public CmekSettings.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<CmekSettings.Builder>
      • setRepeatedField

        public CmekSettings.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<CmekSettings.Builder>
      • addRepeatedField

        public CmekSettings.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<CmekSettings.Builder>
      • mergeFrom

        public CmekSettings.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<CmekSettings.Builder>
      • isInitialized

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

        public CmekSettings.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<CmekSettings.Builder>
        Throws:
        IOException
      • getName

        public String getName()
         Output only. The resource name of the CMEK settings.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getName in interface CmekSettingsOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Output only. The resource name of the CMEK settings.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getNameBytes in interface CmekSettingsOrBuilder
        Returns:
        The bytes for name.
      • setName

        public CmekSettings.Builder setName​(String value)
         Output only. The resource name of the CMEK settings.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public CmekSettings.Builder clearName()
         Output only. The resource name of the CMEK settings.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setNameBytes

        public CmekSettings.Builder setNameBytes​(com.google.protobuf.ByteString value)
         Output only. The resource name of the CMEK settings.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • getKmsKeyName

        public String getKmsKeyName()
         The resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
        
        
        
         To enable CMEK for the Log Router, set this field to a valid
         `kms_key_name` for which the associated service account has the required
         cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
        
         The Cloud KMS key used by the Log Router can be updated by changing the
         `kms_key_name` to a new valid key name or disabled by setting the key name
         to an empty string. Encryption operations that are in progress will be
         completed with the key that was in use when they started. Decryption
         operations will be completed using the key that was used at the time of
         encryption unless access to that key has been revoked.
        
         To disable CMEK for the Log Router, set this field to an empty string.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string kms_key_name = 2;
        Specified by:
        getKmsKeyName in interface CmekSettingsOrBuilder
        Returns:
        The kmsKeyName.
      • getKmsKeyNameBytes

        public com.google.protobuf.ByteString getKmsKeyNameBytes()
         The resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
        
        
        
         To enable CMEK for the Log Router, set this field to a valid
         `kms_key_name` for which the associated service account has the required
         cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
        
         The Cloud KMS key used by the Log Router can be updated by changing the
         `kms_key_name` to a new valid key name or disabled by setting the key name
         to an empty string. Encryption operations that are in progress will be
         completed with the key that was in use when they started. Decryption
         operations will be completed using the key that was used at the time of
         encryption unless access to that key has been revoked.
        
         To disable CMEK for the Log Router, set this field to an empty string.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string kms_key_name = 2;
        Specified by:
        getKmsKeyNameBytes in interface CmekSettingsOrBuilder
        Returns:
        The bytes for kmsKeyName.
      • setKmsKeyName

        public CmekSettings.Builder setKmsKeyName​(String value)
         The resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
        
        
        
         To enable CMEK for the Log Router, set this field to a valid
         `kms_key_name` for which the associated service account has the required
         cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
        
         The Cloud KMS key used by the Log Router can be updated by changing the
         `kms_key_name` to a new valid key name or disabled by setting the key name
         to an empty string. Encryption operations that are in progress will be
         completed with the key that was in use when they started. Decryption
         operations will be completed using the key that was used at the time of
         encryption unless access to that key has been revoked.
        
         To disable CMEK for the Log Router, set this field to an empty string.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string kms_key_name = 2;
        Parameters:
        value - The kmsKeyName to set.
        Returns:
        This builder for chaining.
      • clearKmsKeyName

        public CmekSettings.Builder clearKmsKeyName()
         The resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
        
        
        
         To enable CMEK for the Log Router, set this field to a valid
         `kms_key_name` for which the associated service account has the required
         cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
        
         The Cloud KMS key used by the Log Router can be updated by changing the
         `kms_key_name` to a new valid key name or disabled by setting the key name
         to an empty string. Encryption operations that are in progress will be
         completed with the key that was in use when they started. Decryption
         operations will be completed using the key that was used at the time of
         encryption unless access to that key has been revoked.
        
         To disable CMEK for the Log Router, set this field to an empty string.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string kms_key_name = 2;
        Returns:
        This builder for chaining.
      • setKmsKeyNameBytes

        public CmekSettings.Builder setKmsKeyNameBytes​(com.google.protobuf.ByteString value)
         The resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
        
        
        
         To enable CMEK for the Log Router, set this field to a valid
         `kms_key_name` for which the associated service account has the required
         cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
        
         The Cloud KMS key used by the Log Router can be updated by changing the
         `kms_key_name` to a new valid key name or disabled by setting the key name
         to an empty string. Encryption operations that are in progress will be
         completed with the key that was in use when they started. Decryption
         operations will be completed using the key that was used at the time of
         encryption unless access to that key has been revoked.
        
         To disable CMEK for the Log Router, set this field to an empty string.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string kms_key_name = 2;
        Parameters:
        value - The bytes for kmsKeyName to set.
        Returns:
        This builder for chaining.
      • getKmsKeyVersionName

        public String getKmsKeyVersionName()
         The CryptoKeyVersion resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
        
         This is a read-only field used to convey the specific configured
         CryptoKeyVersion of `kms_key` that has been configured. It will be
         populated in cases where the CMEK settings are bound to a single key
         version.
        
         If this field is populated, the `kms_key` is tied to a specific
         CryptoKeyVersion.
         
        string kms_key_version_name = 4;
        Specified by:
        getKmsKeyVersionName in interface CmekSettingsOrBuilder
        Returns:
        The kmsKeyVersionName.
      • getKmsKeyVersionNameBytes

        public com.google.protobuf.ByteString getKmsKeyVersionNameBytes()
         The CryptoKeyVersion resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
        
         This is a read-only field used to convey the specific configured
         CryptoKeyVersion of `kms_key` that has been configured. It will be
         populated in cases where the CMEK settings are bound to a single key
         version.
        
         If this field is populated, the `kms_key` is tied to a specific
         CryptoKeyVersion.
         
        string kms_key_version_name = 4;
        Specified by:
        getKmsKeyVersionNameBytes in interface CmekSettingsOrBuilder
        Returns:
        The bytes for kmsKeyVersionName.
      • setKmsKeyVersionName

        public CmekSettings.Builder setKmsKeyVersionName​(String value)
         The CryptoKeyVersion resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
        
         This is a read-only field used to convey the specific configured
         CryptoKeyVersion of `kms_key` that has been configured. It will be
         populated in cases where the CMEK settings are bound to a single key
         version.
        
         If this field is populated, the `kms_key` is tied to a specific
         CryptoKeyVersion.
         
        string kms_key_version_name = 4;
        Parameters:
        value - The kmsKeyVersionName to set.
        Returns:
        This builder for chaining.
      • clearKmsKeyVersionName

        public CmekSettings.Builder clearKmsKeyVersionName()
         The CryptoKeyVersion resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
        
         This is a read-only field used to convey the specific configured
         CryptoKeyVersion of `kms_key` that has been configured. It will be
         populated in cases where the CMEK settings are bound to a single key
         version.
        
         If this field is populated, the `kms_key` is tied to a specific
         CryptoKeyVersion.
         
        string kms_key_version_name = 4;
        Returns:
        This builder for chaining.
      • setKmsKeyVersionNameBytes

        public CmekSettings.Builder setKmsKeyVersionNameBytes​(com.google.protobuf.ByteString value)
         The CryptoKeyVersion resource name for the configured Cloud KMS key.
        
         KMS key name format:
        
             "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
        
         For example:
        
           `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
        
         This is a read-only field used to convey the specific configured
         CryptoKeyVersion of `kms_key` that has been configured. It will be
         populated in cases where the CMEK settings are bound to a single key
         version.
        
         If this field is populated, the `kms_key` is tied to a specific
         CryptoKeyVersion.
         
        string kms_key_version_name = 4;
        Parameters:
        value - The bytes for kmsKeyVersionName to set.
        Returns:
        This builder for chaining.
      • getServiceAccountId

        public String getServiceAccountId()
         Output only. The service account that will be used by the Log Router to
         access your Cloud KMS key.
        
         Before enabling CMEK for Log Router, you must first assign the
         cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
         the Log Router will use to access your Cloud KMS key. Use
         [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
         obtain the service account ID.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getServiceAccountId in interface CmekSettingsOrBuilder
        Returns:
        The serviceAccountId.
      • getServiceAccountIdBytes

        public com.google.protobuf.ByteString getServiceAccountIdBytes()
         Output only. The service account that will be used by the Log Router to
         access your Cloud KMS key.
        
         Before enabling CMEK for Log Router, you must first assign the
         cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
         the Log Router will use to access your Cloud KMS key. Use
         [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
         obtain the service account ID.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getServiceAccountIdBytes in interface CmekSettingsOrBuilder
        Returns:
        The bytes for serviceAccountId.
      • setServiceAccountId

        public CmekSettings.Builder setServiceAccountId​(String value)
         Output only. The service account that will be used by the Log Router to
         access your Cloud KMS key.
        
         Before enabling CMEK for Log Router, you must first assign the
         cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
         the Log Router will use to access your Cloud KMS key. Use
         [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
         obtain the service account ID.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The serviceAccountId to set.
        Returns:
        This builder for chaining.
      • clearServiceAccountId

        public CmekSettings.Builder clearServiceAccountId()
         Output only. The service account that will be used by the Log Router to
         access your Cloud KMS key.
        
         Before enabling CMEK for Log Router, you must first assign the
         cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
         the Log Router will use to access your Cloud KMS key. Use
         [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
         obtain the service account ID.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Returns:
        This builder for chaining.
      • setServiceAccountIdBytes

        public CmekSettings.Builder setServiceAccountIdBytes​(com.google.protobuf.ByteString value)
         Output only. The service account that will be used by the Log Router to
         access your Cloud KMS key.
        
         Before enabling CMEK for Log Router, you must first assign the
         cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
         the Log Router will use to access your Cloud KMS key. Use
         [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
         obtain the service account ID.
        
         See [Enabling CMEK for Log
         Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
         for more information.
         
        string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Parameters:
        value - The bytes for serviceAccountId to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final CmekSettings.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<CmekSettings.Builder>
      • mergeUnknownFields

        public final CmekSettings.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<CmekSettings.Builder>