/* * 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.logs.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 DisassociateKmsKeyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The name of the log group. *
*
* In your DisassociateKmsKey
operation, you must specify either the resourceIdentifier
* parameter or the logGroup
parameter, but you can't specify both.
*
* Specifies the target for this operation. You must specify one of the following: *
** Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key to encrypt log events that are * ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts ingested log events * with the default CloudWatch Logs method. The log group ARN must be in the following format. Replace REGION * and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
*
* Specify the following ARN to stop using this key to encrypt the results of future StartQuery * operations in this account. Replace REGION and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
*
* In your DisssociateKmsKey
operation, you must specify either the resourceIdentifier
* parameter or the logGroup
parameter, but you can't specify both.
*
* The name of the log group. *
*
* In your DisassociateKmsKey
operation, you must specify either the resourceIdentifier
* parameter or the logGroup
parameter, but you can't specify both.
*
* In your DisassociateKmsKey
operation, you must specify either the
* resourceIdentifier
parameter or the logGroup
parameter, but you can't specify
* both.
*/
public void setLogGroupName(String logGroupName) {
this.logGroupName = logGroupName;
}
/**
*
* The name of the log group. *
*
* In your DisassociateKmsKey
operation, you must specify either the resourceIdentifier
* parameter or the logGroup
parameter, but you can't specify both.
*
* In your DisassociateKmsKey
operation, you must specify either the
* resourceIdentifier
parameter or the logGroup
parameter, but you can't specify
* both.
*/
public String getLogGroupName() {
return this.logGroupName;
}
/**
*
* The name of the log group. *
*
* In your DisassociateKmsKey
operation, you must specify either the resourceIdentifier
* parameter or the logGroup
parameter, but you can't specify both.
*
* In your DisassociateKmsKey
operation, you must specify either the
* resourceIdentifier
parameter or the logGroup
parameter, but you can't specify
* both.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisassociateKmsKeyRequest withLogGroupName(String logGroupName) {
setLogGroupName(logGroupName);
return this;
}
/**
*
* Specifies the target for this operation. You must specify one of the following: *
** Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key to encrypt log events that are * ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts ingested log events * with the default CloudWatch Logs method. The log group ARN must be in the following format. Replace REGION * and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
*
* Specify the following ARN to stop using this key to encrypt the results of future StartQuery * operations in this account. Replace REGION and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
*
* In your DisssociateKmsKey
operation, you must specify either the resourceIdentifier
* parameter or the logGroup
parameter, but you can't specify both.
*
* Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key to encrypt log events that * are ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts ingested * log events with the default CloudWatch Logs method. The log group ARN must be in the following format. * Replace REGION and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
*
* Specify the following ARN to stop using this key to encrypt the results of future StartQuery operations in this account. Replace REGION and ACCOUNT_ID with your Region * and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
*
* In your DisssociateKmsKey
operation, you must specify either the
* resourceIdentifier
parameter or the logGroup
parameter, but you can't specify
* both.
*/
public void setResourceIdentifier(String resourceIdentifier) {
this.resourceIdentifier = resourceIdentifier;
}
/**
*
* Specifies the target for this operation. You must specify one of the following: *
** Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key to encrypt log events that are * ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts ingested log events * with the default CloudWatch Logs method. The log group ARN must be in the following format. Replace REGION * and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
*
* Specify the following ARN to stop using this key to encrypt the results of future StartQuery * operations in this account. Replace REGION and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
*
* In your DisssociateKmsKey
operation, you must specify either the resourceIdentifier
* parameter or the logGroup
parameter, but you can't specify both.
*
* Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key to encrypt log events that * are ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts * ingested log events with the default CloudWatch Logs method. The log group ARN must be in the following * format. Replace REGION and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
*
* Specify the following ARN to stop using this key to encrypt the results of future StartQuery operations in this account. Replace REGION and ACCOUNT_ID with your Region * and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
*
* In your DisssociateKmsKey
operation, you must specify either the
* resourceIdentifier
parameter or the logGroup
parameter, but you can't specify
* both.
*/
public String getResourceIdentifier() {
return this.resourceIdentifier;
}
/**
*
* Specifies the target for this operation. You must specify one of the following: *
** Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key to encrypt log events that are * ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts ingested log events * with the default CloudWatch Logs method. The log group ARN must be in the following format. Replace REGION * and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
*
* Specify the following ARN to stop using this key to encrypt the results of future StartQuery * operations in this account. Replace REGION and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
*
* In your DisssociateKmsKey
operation, you must specify either the resourceIdentifier
* parameter or the logGroup
parameter, but you can't specify both.
*
* Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key to encrypt log events that * are ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts ingested * log events with the default CloudWatch Logs method. The log group ARN must be in the following format. * Replace REGION and ACCOUNT_ID with your Region and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
*
* Specify the following ARN to stop using this key to encrypt the results of future StartQuery operations in this account. Replace REGION and ACCOUNT_ID with your Region * and account ID. *
*
* arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
*
* In your DisssociateKmsKey
operation, you must specify either the
* resourceIdentifier
parameter or the logGroup
parameter, but you can't specify
* both.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisassociateKmsKeyRequest withResourceIdentifier(String resourceIdentifier) {
setResourceIdentifier(resourceIdentifier);
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 (getLogGroupName() != null)
sb.append("LogGroupName: ").append(getLogGroupName()).append(",");
if (getResourceIdentifier() != null)
sb.append("ResourceIdentifier: ").append(getResourceIdentifier());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DisassociateKmsKeyRequest == false)
return false;
DisassociateKmsKeyRequest other = (DisassociateKmsKeyRequest) obj;
if (other.getLogGroupName() == null ^ this.getLogGroupName() == null)
return false;
if (other.getLogGroupName() != null && other.getLogGroupName().equals(this.getLogGroupName()) == false)
return false;
if (other.getResourceIdentifier() == null ^ this.getResourceIdentifier() == null)
return false;
if (other.getResourceIdentifier() != null && other.getResourceIdentifier().equals(this.getResourceIdentifier()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLogGroupName() == null) ? 0 : getLogGroupName().hashCode());
hashCode = prime * hashCode + ((getResourceIdentifier() == null) ? 0 : getResourceIdentifier().hashCode());
return hashCode;
}
@Override
public DisassociateKmsKeyRequest clone() {
return (DisassociateKmsKeyRequest) super.clone();
}
}