/* * 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.qldb.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateLedgerRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The name of the ledger. *

*/ private String name; /** *

* Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, * this feature is enabled (true) by default. *

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it * by calling the UpdateLedger operation to set this parameter to false. *

*/ private Boolean deletionProtection; /** *

* The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more * information, see Encryption at rest in * the Amazon QLDB Developer Guide. *

*

* Use one of the following options to specify this parameter: *

* *

* To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias * ARN. When using an alias name, prefix it with "alias/". To specify a key in a different Amazon Web * Services account, you must use the key ARN or alias ARN. *

*

* For example: *

* *

* For more information, see Key identifiers (KeyId) in * the Key Management Service Developer Guide. *

*/ private String kmsKey; /** *

* The name of the ledger. *

* * @param name * The name of the ledger. */ public void setName(String name) { this.name = name; } /** *

* The name of the ledger. *

* * @return The name of the ledger. */ public String getName() { return this.name; } /** *

* The name of the ledger. *

* * @param name * The name of the ledger. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateLedgerRequest withName(String name) { setName(name); return this; } /** *

* Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, * this feature is enabled (true) by default. *

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it * by calling the UpdateLedger operation to set this parameter to false. *

* * @param deletionProtection * Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger * creation, this feature is enabled (true) by default.

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can * disable it by calling the UpdateLedger operation to set this parameter to false. */ public void setDeletionProtection(Boolean deletionProtection) { this.deletionProtection = deletionProtection; } /** *

* Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, * this feature is enabled (true) by default. *

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it * by calling the UpdateLedger operation to set this parameter to false. *

* * @return Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger * creation, this feature is enabled (true) by default.

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can * disable it by calling the UpdateLedger operation to set this parameter to false. */ public Boolean getDeletionProtection() { return this.deletionProtection; } /** *

* Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, * this feature is enabled (true) by default. *

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it * by calling the UpdateLedger operation to set this parameter to false. *

* * @param deletionProtection * Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger * creation, this feature is enabled (true) by default.

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can * disable it by calling the UpdateLedger operation to set this parameter to false. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateLedgerRequest withDeletionProtection(Boolean deletionProtection) { setDeletionProtection(deletionProtection); return this; } /** *

* Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, * this feature is enabled (true) by default. *

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it * by calling the UpdateLedger operation to set this parameter to false. *

* * @return Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger * creation, this feature is enabled (true) by default.

*

* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can * disable it by calling the UpdateLedger operation to set this parameter to false. */ public Boolean isDeletionProtection() { return this.deletionProtection; } /** *

* The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more * information, see Encryption at rest in * the Amazon QLDB Developer Guide. *

*

* Use one of the following options to specify this parameter: *

* *

* To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias * ARN. When using an alias name, prefix it with "alias/". To specify a key in a different Amazon Web * Services account, you must use the key ARN or alias ARN. *

*

* For example: *

* *

* For more information, see Key identifiers (KeyId) in * the Key Management Service Developer Guide. *

* * @param kmsKey * The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more * information, see Encryption at * rest in the Amazon QLDB Developer Guide.

*

* Use one of the following options to specify this parameter: *

* *

* To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or * alias ARN. When using an alias name, prefix it with "alias/". To specify a key in a different * Amazon Web Services account, you must use the key ARN or alias ARN. *

*

* For example: *

* *

* For more information, see Key identifiers * (KeyId) in the Key Management Service Developer Guide. */ public void setKmsKey(String kmsKey) { this.kmsKey = kmsKey; } /** *

* The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more * information, see Encryption at rest in * the Amazon QLDB Developer Guide. *

*

* Use one of the following options to specify this parameter: *

* *

* To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias * ARN. When using an alias name, prefix it with "alias/". To specify a key in a different Amazon Web * Services account, you must use the key ARN or alias ARN. *

*

* For example: *

* *

* For more information, see Key identifiers (KeyId) in * the Key Management Service Developer Guide. *

* * @return The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more * information, see Encryption at * rest in the Amazon QLDB Developer Guide.

*

* Use one of the following options to specify this parameter: *

* *

* To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or * alias ARN. When using an alias name, prefix it with "alias/". To specify a key in a * different Amazon Web Services account, you must use the key ARN or alias ARN. *

*

* For example: *

* *

* For more information, see Key identifiers * (KeyId) in the Key Management Service Developer Guide. */ public String getKmsKey() { return this.kmsKey; } /** *

* The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more * information, see Encryption at rest in * the Amazon QLDB Developer Guide. *

*

* Use one of the following options to specify this parameter: *

* *

* To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias * ARN. When using an alias name, prefix it with "alias/". To specify a key in a different Amazon Web * Services account, you must use the key ARN or alias ARN. *

*

* For example: *

* *

* For more information, see Key identifiers (KeyId) in * the Key Management Service Developer Guide. *

* * @param kmsKey * The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more * information, see Encryption at * rest in the Amazon QLDB Developer Guide.

*

* Use one of the following options to specify this parameter: *

* *

* To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or * alias ARN. When using an alias name, prefix it with "alias/". To specify a key in a different * Amazon Web Services account, you must use the key ARN or alias ARN. *

*

* For example: *

* *

* For more information, see Key identifiers * (KeyId) in the Key Management Service Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateLedgerRequest withKmsKey(String kmsKey) { setKmsKey(kmsKey); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getDeletionProtection() != null) sb.append("DeletionProtection: ").append(getDeletionProtection()).append(","); if (getKmsKey() != null) sb.append("KmsKey: ").append(getKmsKey()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateLedgerRequest == false) return false; UpdateLedgerRequest other = (UpdateLedgerRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDeletionProtection() == null ^ this.getDeletionProtection() == null) return false; if (other.getDeletionProtection() != null && other.getDeletionProtection().equals(this.getDeletionProtection()) == false) return false; if (other.getKmsKey() == null ^ this.getKmsKey() == null) return false; if (other.getKmsKey() != null && other.getKmsKey().equals(this.getKmsKey()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDeletionProtection() == null) ? 0 : getDeletionProtection().hashCode()); hashCode = prime * hashCode + ((getKmsKey() == null) ? 0 : getKmsKey().hashCode()); return hashCode; } @Override public UpdateLedgerRequest clone() { return (UpdateLedgerRequest) super.clone(); } }