/* * 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.accessanalyzer.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* The proposed access control configuration for an Amazon RDS DB cluster snapshot. You can propose a configuration for * a new Amazon RDS DB cluster snapshot or an Amazon RDS DB cluster snapshot that you own by specifying the * RdsDbClusterSnapshotAttributeValue and optional KMS encryption key. For more information, see ModifyDBClusterSnapshotAttribute. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RdsDbClusterSnapshotConfiguration implements Serializable, Cloneable, StructuredPojo { /** *

* The names and values of manual DB cluster snapshot attributes. Manual DB cluster snapshot attributes are used to * authorize other Amazon Web Services accounts to restore a manual DB cluster snapshot. The only valid value for * AttributeName for the attribute map is restore *

*/ private java.util.Map attributes; /** *

* The KMS key identifier for an encrypted Amazon RDS DB cluster snapshot. The KMS key identifier is the key ARN, * key ID, alias ARN, or alias name for the KMS key. *

* */ private String kmsKeyId; /** *

* The names and values of manual DB cluster snapshot attributes. Manual DB cluster snapshot attributes are used to * authorize other Amazon Web Services accounts to restore a manual DB cluster snapshot. The only valid value for * AttributeName for the attribute map is restore *

* * @return The names and values of manual DB cluster snapshot attributes. Manual DB cluster snapshot attributes are * used to authorize other Amazon Web Services accounts to restore a manual DB cluster snapshot. The only * valid value for AttributeName for the attribute map is restore */ public java.util.Map getAttributes() { return attributes; } /** *

* The names and values of manual DB cluster snapshot attributes. Manual DB cluster snapshot attributes are used to * authorize other Amazon Web Services accounts to restore a manual DB cluster snapshot. The only valid value for * AttributeName for the attribute map is restore *

* * @param attributes * The names and values of manual DB cluster snapshot attributes. Manual DB cluster snapshot attributes are * used to authorize other Amazon Web Services accounts to restore a manual DB cluster snapshot. The only * valid value for AttributeName for the attribute map is restore */ public void setAttributes(java.util.Map attributes) { this.attributes = attributes; } /** *

* The names and values of manual DB cluster snapshot attributes. Manual DB cluster snapshot attributes are used to * authorize other Amazon Web Services accounts to restore a manual DB cluster snapshot. The only valid value for * AttributeName for the attribute map is restore *

* * @param attributes * The names and values of manual DB cluster snapshot attributes. Manual DB cluster snapshot attributes are * used to authorize other Amazon Web Services accounts to restore a manual DB cluster snapshot. The only * valid value for AttributeName for the attribute map is restore * @return Returns a reference to this object so that method calls can be chained together. */ public RdsDbClusterSnapshotConfiguration withAttributes(java.util.Map attributes) { setAttributes(attributes); return this; } /** * Add a single Attributes entry * * @see RdsDbClusterSnapshotConfiguration#withAttributes * @returns a reference to this object so that method calls can be chained together. */ public RdsDbClusterSnapshotConfiguration addAttributesEntry(String key, RdsDbClusterSnapshotAttributeValue value) { if (null == this.attributes) { this.attributes = new java.util.HashMap(); } if (this.attributes.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.attributes.put(key, value); return this; } /** * Removes all the entries added into Attributes. * * @return Returns a reference to this object so that method calls can be chained together. */ public RdsDbClusterSnapshotConfiguration clearAttributesEntries() { this.attributes = null; return this; } /** *

* The KMS key identifier for an encrypted Amazon RDS DB cluster snapshot. The KMS key identifier is the key ARN, * key ID, alias ARN, or alias name for the KMS key. *

*
    *
  • *

    * If the configuration is for an existing Amazon RDS DB cluster snapshot and you do not specify the * kmsKeyId, or you specify an empty string, then the access preview uses the existing * kmsKeyId of the snapshot. *

    *
  • *
  • *

    * If the access preview is for a new resource and you do not specify the specify the kmsKeyId, then * the access preview considers the snapshot as unencrypted. *

    *
  • *
* * @param kmsKeyId * The KMS key identifier for an encrypted Amazon RDS DB cluster snapshot. The KMS key identifier is the key * ARN, key ID, alias ARN, or alias name for the KMS key.

*
    *
  • *

    * If the configuration is for an existing Amazon RDS DB cluster snapshot and you do not specify the * kmsKeyId, or you specify an empty string, then the access preview uses the existing * kmsKeyId of the snapshot. *

    *
  • *
  • *

    * If the access preview is for a new resource and you do not specify the specify the kmsKeyId, * then the access preview considers the snapshot as unencrypted. *

    *
  • */ public void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } /** *

    * The KMS key identifier for an encrypted Amazon RDS DB cluster snapshot. The KMS key identifier is the key ARN, * key ID, alias ARN, or alias name for the KMS key. *

    *
      *
    • *

      * If the configuration is for an existing Amazon RDS DB cluster snapshot and you do not specify the * kmsKeyId, or you specify an empty string, then the access preview uses the existing * kmsKeyId of the snapshot. *

      *
    • *
    • *

      * If the access preview is for a new resource and you do not specify the specify the kmsKeyId, then * the access preview considers the snapshot as unencrypted. *

      *
    • *
    * * @return The KMS key identifier for an encrypted Amazon RDS DB cluster snapshot. The KMS key identifier is the key * ARN, key ID, alias ARN, or alias name for the KMS key.

    *
      *
    • *

      * If the configuration is for an existing Amazon RDS DB cluster snapshot and you do not specify the * kmsKeyId, or you specify an empty string, then the access preview uses the existing * kmsKeyId of the snapshot. *

      *
    • *
    • *

      * If the access preview is for a new resource and you do not specify the specify the kmsKeyId, * then the access preview considers the snapshot as unencrypted. *

      *
    • */ public String getKmsKeyId() { return this.kmsKeyId; } /** *

      * The KMS key identifier for an encrypted Amazon RDS DB cluster snapshot. The KMS key identifier is the key ARN, * key ID, alias ARN, or alias name for the KMS key. *

      *
        *
      • *

        * If the configuration is for an existing Amazon RDS DB cluster snapshot and you do not specify the * kmsKeyId, or you specify an empty string, then the access preview uses the existing * kmsKeyId of the snapshot. *

        *
      • *
      • *

        * If the access preview is for a new resource and you do not specify the specify the kmsKeyId, then * the access preview considers the snapshot as unencrypted. *

        *
      • *
      * * @param kmsKeyId * The KMS key identifier for an encrypted Amazon RDS DB cluster snapshot. The KMS key identifier is the key * ARN, key ID, alias ARN, or alias name for the KMS key.

      *
        *
      • *

        * If the configuration is for an existing Amazon RDS DB cluster snapshot and you do not specify the * kmsKeyId, or you specify an empty string, then the access preview uses the existing * kmsKeyId of the snapshot. *

        *
      • *
      • *

        * If the access preview is for a new resource and you do not specify the specify the kmsKeyId, * then the access preview considers the snapshot as unencrypted. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. */ public RdsDbClusterSnapshotConfiguration withKmsKeyId(String kmsKeyId) { setKmsKeyId(kmsKeyId); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()).append(","); if (getKmsKeyId() != null) sb.append("KmsKeyId: ").append(getKmsKeyId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RdsDbClusterSnapshotConfiguration == false) return false; RdsDbClusterSnapshotConfiguration other = (RdsDbClusterSnapshotConfiguration) obj; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null) return false; if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); return hashCode; } @Override public RdsDbClusterSnapshotConfiguration clone() { try { return (RdsDbClusterSnapshotConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.accessanalyzer.model.transform.RdsDbClusterSnapshotConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }