/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.kms.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes the configuration of this multi-Region key. This field appears only when the KMS key is a primary or * replica of a multi-Region key. *
** For more information about any listed KMS key, use the DescribeKey operation. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class MultiRegionConfiguration implements Serializable, Cloneable, StructuredPojo { /** *
* Indicates whether the KMS key is a PRIMARY
or REPLICA
key.
*
* Displays the key ARN and Region of the primary key. This field includes the current KMS key if it is the primary * key. *
*/ private MultiRegionKey primaryKey; /** ** displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a replica * key. *
*/ private com.amazonaws.internal.SdkInternalList
* Indicates whether the KMS key is a PRIMARY
or REPLICA
key.
*
PRIMARY
or REPLICA
key.
* @see MultiRegionKeyType
*/
public void setMultiRegionKeyType(String multiRegionKeyType) {
this.multiRegionKeyType = multiRegionKeyType;
}
/**
*
* Indicates whether the KMS key is a PRIMARY
or REPLICA
key.
*
PRIMARY
or REPLICA
key.
* @see MultiRegionKeyType
*/
public String getMultiRegionKeyType() {
return this.multiRegionKeyType;
}
/**
*
* Indicates whether the KMS key is a PRIMARY
or REPLICA
key.
*
PRIMARY
or REPLICA
key.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MultiRegionKeyType
*/
public MultiRegionConfiguration withMultiRegionKeyType(String multiRegionKeyType) {
setMultiRegionKeyType(multiRegionKeyType);
return this;
}
/**
*
* Indicates whether the KMS key is a PRIMARY
or REPLICA
key.
*
PRIMARY
or REPLICA
key.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MultiRegionKeyType
*/
public MultiRegionConfiguration withMultiRegionKeyType(MultiRegionKeyType multiRegionKeyType) {
this.multiRegionKeyType = multiRegionKeyType.toString();
return this;
}
/**
* * Displays the key ARN and Region of the primary key. This field includes the current KMS key if it is the primary * key. *
* * @param primaryKey * Displays the key ARN and Region of the primary key. This field includes the current KMS key if it is the * primary key. */ public void setPrimaryKey(MultiRegionKey primaryKey) { this.primaryKey = primaryKey; } /** ** Displays the key ARN and Region of the primary key. This field includes the current KMS key if it is the primary * key. *
* * @return Displays the key ARN and Region of the primary key. This field includes the current KMS key if it is the * primary key. */ public MultiRegionKey getPrimaryKey() { return this.primaryKey; } /** ** Displays the key ARN and Region of the primary key. This field includes the current KMS key if it is the primary * key. *
* * @param primaryKey * Displays the key ARN and Region of the primary key. This field includes the current KMS key if it is the * primary key. * @return Returns a reference to this object so that method calls can be chained together. */ public MultiRegionConfiguration withPrimaryKey(MultiRegionKey primaryKey) { setPrimaryKey(primaryKey); return this; } /** ** displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a replica * key. *
* * @return displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a * replica key. */ public java.util.List* displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a replica * key. *
* * @param replicaKeys * displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a * replica key. */ public void setReplicaKeys(java.util.Collection* displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a replica * key. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setReplicaKeys(java.util.Collection)} or {@link #withReplicaKeys(java.util.Collection)} if you want to * override the existing values. *
* * @param replicaKeys * displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a * replica key. * @return Returns a reference to this object so that method calls can be chained together. */ public MultiRegionConfiguration withReplicaKeys(MultiRegionKey... replicaKeys) { if (this.replicaKeys == null) { setReplicaKeys(new com.amazonaws.internal.SdkInternalList* displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a replica * key. *
* * @param replicaKeys * displays the key ARNs and Regions of all replica keys. This field includes the current KMS key if it is a * replica key. * @return Returns a reference to this object so that method calls can be chained together. */ public MultiRegionConfiguration withReplicaKeys(java.util.Collection