# Interface CopyBackupEncryptionConfigOrBuilder (6.118.0)

6.118.0 (latest) 6.116.0 6.111.1 6.108.0 6.107.0 6.103.0 6.102.1 6.101.1 6.100.0 6.99.0 6.98.1 6.97.1 6.96.1 6.95.1 6.94.0 6.93.0 6.89.0 6.88.0 6.87.0 6.86.0 6.85.0 6.83.0 6.82.0 6.80.1 6.79.0 6.77.0 6.74.1 6.72.0 6.71.0 6.69.0 6.68.0 6.66.0 6.65.1 6.62.0 6.60.0 6.58.0 6.57.0 6.56.0 6.55.0 6.54.0 6.53.0 6.52.1 6.51.0 6.50.1 6.49.0 6.25.1 6.24.0 6.23.4 6.22.0 6.21.2 6.20.0 6.19.1 6.18.0 6.17.4 6.14.1

    public interface CopyBackupEncryptionConfigOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getEncryptionType()

    public abstract CopyBackupEncryptionConfig.EncryptionType getEncryptionType()

Required. The encryption type of the backup.

`
.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType encryption_type = 1 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-spanner/latest/com.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType` | The encryptionType. |

### getEncryptionTypeValue()

    public abstract int getEncryptionTypeValue()

Required. The encryption type of the backup.

`
.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType encryption_type = 1 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for encryptionType. |

### getKmsKeyName()

    public abstract String getKmsKeyName()

Optional. The Cloud KMS key that will be used to protect the backup.
This field should be set only when
encryption_type
is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
`projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.

`
string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The kmsKeyName. |

### getKmsKeyNameBytes()

    public abstract ByteString getKmsKeyNameBytes()

Optional. The Cloud KMS key that will be used to protect the backup.
This field should be set only when
encryption_type
is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
`projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.

`
string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for kmsKeyName. |

### getKmsKeyNames(int index)

    public abstract String getKmsKeyNames(int index)

Optional. Specifies the KMS configuration for the one or more keys used to
protect the backup. Values are of the form
`projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
Kms keys specified can be in any order.

The keys referenced by kms_key_names must fully cover all
regions of the backup's instance configuration. Some examples:

- For single region instance configs, specify a single regional location KMS key.
- For multi-regional instance configs of type GOOGLE_MANAGED, either specify a multi-regional location KMS key or multiple regional location KMS keys that cover all regions in the instance config.
- For an instance config of type USER_MANAGED, please specify only regional location KMS keys to cover each region in the instance config. Multi-regional location KMS keys are not supported for USER_MANAGED instance configs.

`
repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The kmsKeyNames at the given index. |

### getKmsKeyNamesBytes(int index)

    public abstract ByteString getKmsKeyNamesBytes(int index)

Optional. Specifies the KMS configuration for the one or more keys used to
protect the backup. Values are of the form
`projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
Kms keys specified can be in any order.

The keys referenced by kms_key_names must fully cover all
regions of the backup's instance configuration. Some examples:

- For single region instance configs, specify a single regional location KMS key.
- For multi-regional instance configs of type GOOGLE_MANAGED, either specify a multi-regional location KMS key or multiple regional location KMS keys that cover all regions in the instance config.
- For an instance config of type USER_MANAGED, please specify only regional location KMS keys to cover each region in the instance config. Multi-regional location KMS keys are not supported for USER_MANAGED instance configs.

`
repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the value to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes of the kmsKeyNames at the given index. |

### getKmsKeyNamesCount()

    public abstract int getKmsKeyNamesCount()

Optional. Specifies the KMS configuration for the one or more keys used to
protect the backup. Values are of the form
`projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
Kms keys specified can be in any order.

The keys referenced by kms_key_names must fully cover all
regions of the backup's instance configuration. Some examples:

- For single region instance configs, specify a single regional location KMS key.
- For multi-regional instance configs of type GOOGLE_MANAGED, either specify a multi-regional location KMS key or multiple regional location KMS keys that cover all regions in the instance config.
- For an instance config of type USER_MANAGED, please specify only regional location KMS keys to cover each region in the instance config. Multi-regional location KMS keys are not supported for USER_MANAGED instance configs.

`
repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of kmsKeyNames. |

### getKmsKeyNamesList()

    public abstract List<String> getKmsKeyNamesList()

Optional. Specifies the KMS configuration for the one or more keys used to
protect the backup. Values are of the form
`projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
Kms keys specified can be in any order.

The keys referenced by kms_key_names must fully cover all
regions of the backup's instance configuration. Some examples:

- For single region instance configs, specify a single regional location KMS key.
- For multi-regional instance configs of type GOOGLE_MANAGED, either specify a multi-regional location KMS key or multiple regional location KMS keys that cover all regions in the instance config.
- For an instance config of type USER_MANAGED, please specify only regional location KMS keys to cover each region in the instance config. Multi-regional location KMS keys are not supported for USER_MANAGED instance configs.

`
repeated string kms_key_names = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` | A list containing the kmsKeyNames. |