com.amazonaws.services.dynamodbv2.model.SSESpecification Maven / Gradle / Ivy
Show all versions of aws-java-sdk-dynamodb Show documentation
/*
* Copyright 2017-2022 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.dynamodbv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Represents the settings used to enable server-side encryption.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SSESpecification implements Serializable, Cloneable, StructuredPojo {
/**
*
* Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon Web
* Services owned key. If enabled (true), server-side encryption type is set to KMS
and an Amazon Web
* Services managed key is used (KMS charges apply). If disabled (false) or not specified, server-side encryption is
* set to Amazon Web Services owned key.
*
*/
private Boolean enabled;
/**
*
* Server-side encryption type. The only supported value is:
*
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your account and
* is managed by KMS (KMS charges apply).
*
*
*
*/
private String sSEType;
/**
*
* The KMS key that should be used for the KMS encryption. To specify a key, use its key ID, Amazon Resource Name
* (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from
* the default DynamoDB key alias/aws/dynamodb
.
*
*/
private String kMSMasterKeyId;
/**
*
* Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon Web
* Services owned key. If enabled (true), server-side encryption type is set to KMS
and an Amazon Web
* Services managed key is used (KMS charges apply). If disabled (false) or not specified, server-side encryption is
* set to Amazon Web Services owned key.
*
*
* @param enabled
* Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon Web
* Services owned key. If enabled (true), server-side encryption type is set to KMS
and an
* Amazon Web Services managed key is used (KMS charges apply). If disabled (false) or not specified,
* server-side encryption is set to Amazon Web Services owned key.
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
*
* Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon Web
* Services owned key. If enabled (true), server-side encryption type is set to KMS
and an Amazon Web
* Services managed key is used (KMS charges apply). If disabled (false) or not specified, server-side encryption is
* set to Amazon Web Services owned key.
*
*
* @return Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon
* Web Services owned key. If enabled (true), server-side encryption type is set to KMS
and an
* Amazon Web Services managed key is used (KMS charges apply). If disabled (false) or not specified,
* server-side encryption is set to Amazon Web Services owned key.
*/
public Boolean getEnabled() {
return this.enabled;
}
/**
*
* Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon Web
* Services owned key. If enabled (true), server-side encryption type is set to KMS
and an Amazon Web
* Services managed key is used (KMS charges apply). If disabled (false) or not specified, server-side encryption is
* set to Amazon Web Services owned key.
*
*
* @param enabled
* Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon Web
* Services owned key. If enabled (true), server-side encryption type is set to KMS
and an
* Amazon Web Services managed key is used (KMS charges apply). If disabled (false) or not specified,
* server-side encryption is set to Amazon Web Services owned key.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SSESpecification withEnabled(Boolean enabled) {
setEnabled(enabled);
return this;
}
/**
*
* Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon Web
* Services owned key. If enabled (true), server-side encryption type is set to KMS
and an Amazon Web
* Services managed key is used (KMS charges apply). If disabled (false) or not specified, server-side encryption is
* set to Amazon Web Services owned key.
*
*
* @return Indicates whether server-side encryption is done using an Amazon Web Services managed key or an Amazon
* Web Services owned key. If enabled (true), server-side encryption type is set to KMS
and an
* Amazon Web Services managed key is used (KMS charges apply). If disabled (false) or not specified,
* server-side encryption is set to Amazon Web Services owned key.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
*
* Server-side encryption type. The only supported value is:
*
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your account and
* is managed by KMS (KMS charges apply).
*
*
*
*
* @param sSEType
* Server-side encryption type. The only supported value is:
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your
* account and is managed by KMS (KMS charges apply).
*
*
* @see SSEType
*/
public void setSSEType(String sSEType) {
this.sSEType = sSEType;
}
/**
*
* Server-side encryption type. The only supported value is:
*
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your account and
* is managed by KMS (KMS charges apply).
*
*
*
*
* @return Server-side encryption type. The only supported value is:
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your
* account and is managed by KMS (KMS charges apply).
*
*
* @see SSEType
*/
public String getSSEType() {
return this.sSEType;
}
/**
*
* Server-side encryption type. The only supported value is:
*
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your account and
* is managed by KMS (KMS charges apply).
*
*
*
*
* @param sSEType
* Server-side encryption type. The only supported value is:
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your
* account and is managed by KMS (KMS charges apply).
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see SSEType
*/
public SSESpecification withSSEType(String sSEType) {
setSSEType(sSEType);
return this;
}
/**
*
* Server-side encryption type. The only supported value is:
*
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your account and
* is managed by KMS (KMS charges apply).
*
*
*
*
* @param sSEType
* Server-side encryption type. The only supported value is:
*
* -
*
* KMS
- Server-side encryption that uses Key Management Service. The key is stored in your
* account and is managed by KMS (KMS charges apply).
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see SSEType
*/
public SSESpecification withSSEType(SSEType sSEType) {
this.sSEType = sSEType.toString();
return this;
}
/**
*
* The KMS key that should be used for the KMS encryption. To specify a key, use its key ID, Amazon Resource Name
* (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from
* the default DynamoDB key alias/aws/dynamodb
.
*
*
* @param kMSMasterKeyId
* The KMS key that should be used for the KMS encryption. To specify a key, use its key ID, Amazon Resource
* Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is
* different from the default DynamoDB key alias/aws/dynamodb
.
*/
public void setKMSMasterKeyId(String kMSMasterKeyId) {
this.kMSMasterKeyId = kMSMasterKeyId;
}
/**
*
* The KMS key that should be used for the KMS encryption. To specify a key, use its key ID, Amazon Resource Name
* (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from
* the default DynamoDB key alias/aws/dynamodb
.
*
*
* @return The KMS key that should be used for the KMS encryption. To specify a key, use its key ID, Amazon Resource
* Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is
* different from the default DynamoDB key alias/aws/dynamodb
.
*/
public String getKMSMasterKeyId() {
return this.kMSMasterKeyId;
}
/**
*
* The KMS key that should be used for the KMS encryption. To specify a key, use its key ID, Amazon Resource Name
* (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from
* the default DynamoDB key alias/aws/dynamodb
.
*
*
* @param kMSMasterKeyId
* The KMS key that should be used for the KMS encryption. To specify a key, use its key ID, Amazon Resource
* Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is
* different from the default DynamoDB key alias/aws/dynamodb
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SSESpecification withKMSMasterKeyId(String kMSMasterKeyId) {
setKMSMasterKeyId(kMSMasterKeyId);
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 (getEnabled() != null)
sb.append("Enabled: ").append(getEnabled()).append(",");
if (getSSEType() != null)
sb.append("SSEType: ").append(getSSEType()).append(",");
if (getKMSMasterKeyId() != null)
sb.append("KMSMasterKeyId: ").append(getKMSMasterKeyId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SSESpecification == false)
return false;
SSESpecification other = (SSESpecification) obj;
if (other.getEnabled() == null ^ this.getEnabled() == null)
return false;
if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false)
return false;
if (other.getSSEType() == null ^ this.getSSEType() == null)
return false;
if (other.getSSEType() != null && other.getSSEType().equals(this.getSSEType()) == false)
return false;
if (other.getKMSMasterKeyId() == null ^ this.getKMSMasterKeyId() == null)
return false;
if (other.getKMSMasterKeyId() != null && other.getKMSMasterKeyId().equals(this.getKMSMasterKeyId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
hashCode = prime * hashCode + ((getSSEType() == null) ? 0 : getSSEType().hashCode());
hashCode = prime * hashCode + ((getKMSMasterKeyId() == null) ? 0 : getKMSMasterKeyId().hashCode());
return hashCode;
}
@Override
public SSESpecification clone() {
try {
return (SSESpecification) 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.dynamodbv2.model.transform.SSESpecificationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}