/* * 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 PutDataProtectionPolicyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* Specify either the log group name or log group ARN. *
*/ private String logGroupIdentifier; /** ** Specify the data protection policy, in JSON. *
** This policy must include two JSON blocks: *
*
* The first block must include both a DataIdentifer
array and an Operation
property with
* an Audit
action. The DataIdentifer
array lists the types of sensitive data that you
* want to mask. For more information about the available options, see Types of data
* that you can mask.
*
* The Operation
property with an Audit
action is required to find the sensitive data
* terms. This Audit
action must contain a FindingsDestination
object. You can optionally
* use that FindingsDestination
object to list one or more destinations to send audit findings to. If
* you specify destinations such as log groups, Kinesis Data Firehose streams, and S3 buckets, they must already
* exist.
*
* The second block must include both a DataIdentifer
array and an Operation
property with
* an Deidentify
action. The DataIdentifer
array must exactly match the
* DataIdentifer
array in the first block of the policy.
*
* The Operation
property with the Deidentify
action is what actually masks the data, and
* it must contain the "MaskConfig": {}
object. The "MaskConfig": {}
object must be
* empty.
*
* For an example data protection policy, see the Examples section on this page. *
*
* The contents of the two DataIdentifer
arrays must match exactly.
*
* In addition to the two JSON blocks, the policyDocument
can also include Name
,
* Description
, and Version
fields. The Name
is used as a dimension when
* CloudWatch Logs reports audit findings metrics to CloudWatch.
*
* The JSON specified in policyDocument
can be up to 30,720 characters.
*
* Specify either the log group name or log group ARN. *
* * @param logGroupIdentifier * Specify either the log group name or log group ARN. */ public void setLogGroupIdentifier(String logGroupIdentifier) { this.logGroupIdentifier = logGroupIdentifier; } /** ** Specify either the log group name or log group ARN. *
* * @return Specify either the log group name or log group ARN. */ public String getLogGroupIdentifier() { return this.logGroupIdentifier; } /** ** Specify either the log group name or log group ARN. *
* * @param logGroupIdentifier * Specify either the log group name or log group ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public PutDataProtectionPolicyRequest withLogGroupIdentifier(String logGroupIdentifier) { setLogGroupIdentifier(logGroupIdentifier); return this; } /** ** Specify the data protection policy, in JSON. *
** This policy must include two JSON blocks: *
*
* The first block must include both a DataIdentifer
array and an Operation
property with
* an Audit
action. The DataIdentifer
array lists the types of sensitive data that you
* want to mask. For more information about the available options, see Types of data
* that you can mask.
*
* The Operation
property with an Audit
action is required to find the sensitive data
* terms. This Audit
action must contain a FindingsDestination
object. You can optionally
* use that FindingsDestination
object to list one or more destinations to send audit findings to. If
* you specify destinations such as log groups, Kinesis Data Firehose streams, and S3 buckets, they must already
* exist.
*
* The second block must include both a DataIdentifer
array and an Operation
property with
* an Deidentify
action. The DataIdentifer
array must exactly match the
* DataIdentifer
array in the first block of the policy.
*
* The Operation
property with the Deidentify
action is what actually masks the data, and
* it must contain the "MaskConfig": {}
object. The "MaskConfig": {}
object must be
* empty.
*
* For an example data protection policy, see the Examples section on this page. *
*
* The contents of the two DataIdentifer
arrays must match exactly.
*
* In addition to the two JSON blocks, the policyDocument
can also include Name
,
* Description
, and Version
fields. The Name
is used as a dimension when
* CloudWatch Logs reports audit findings metrics to CloudWatch.
*
* The JSON specified in policyDocument
can be up to 30,720 characters.
*
* This policy must include two JSON blocks: *
*
* The first block must include both a DataIdentifer
array and an Operation
* property with an Audit
action. The DataIdentifer
array lists the types of
* sensitive data that you want to mask. For more information about the available options, see Types
* of data that you can mask.
*
* The Operation
property with an Audit
action is required to find the sensitive
* data terms. This Audit
action must contain a FindingsDestination
object. You can
* optionally use that FindingsDestination
object to list one or more destinations to send audit
* findings to. If you specify destinations such as log groups, Kinesis Data Firehose streams, and S3
* buckets, they must already exist.
*
* The second block must include both a DataIdentifer
array and an Operation
* property with an Deidentify
action. The DataIdentifer
array must exactly match
* the DataIdentifer
array in the first block of the policy.
*
* The Operation
property with the Deidentify
action is what actually masks the
* data, and it must contain the "MaskConfig": {}
object. The "MaskConfig": {}
* object must be empty.
*
* For an example data protection policy, see the Examples section on this page. *
*
* The contents of the two DataIdentifer
arrays must match exactly.
*
* In addition to the two JSON blocks, the policyDocument
can also include Name
,
* Description
, and Version
fields. The Name
is used as a dimension
* when CloudWatch Logs reports audit findings metrics to CloudWatch.
*
* The JSON specified in policyDocument
can be up to 30,720 characters.
*/
public void setPolicyDocument(String policyDocument) {
this.policyDocument = policyDocument;
}
/**
*
* Specify the data protection policy, in JSON. *
** This policy must include two JSON blocks: *
*
* The first block must include both a DataIdentifer
array and an Operation
property with
* an Audit
action. The DataIdentifer
array lists the types of sensitive data that you
* want to mask. For more information about the available options, see Types of data
* that you can mask.
*
* The Operation
property with an Audit
action is required to find the sensitive data
* terms. This Audit
action must contain a FindingsDestination
object. You can optionally
* use that FindingsDestination
object to list one or more destinations to send audit findings to. If
* you specify destinations such as log groups, Kinesis Data Firehose streams, and S3 buckets, they must already
* exist.
*
* The second block must include both a DataIdentifer
array and an Operation
property with
* an Deidentify
action. The DataIdentifer
array must exactly match the
* DataIdentifer
array in the first block of the policy.
*
* The Operation
property with the Deidentify
action is what actually masks the data, and
* it must contain the "MaskConfig": {}
object. The "MaskConfig": {}
object must be
* empty.
*
* For an example data protection policy, see the Examples section on this page. *
*
* The contents of the two DataIdentifer
arrays must match exactly.
*
* In addition to the two JSON blocks, the policyDocument
can also include Name
,
* Description
, and Version
fields. The Name
is used as a dimension when
* CloudWatch Logs reports audit findings metrics to CloudWatch.
*
* The JSON specified in policyDocument
can be up to 30,720 characters.
*
* This policy must include two JSON blocks: *
*
* The first block must include both a DataIdentifer
array and an Operation
* property with an Audit
action. The DataIdentifer
array lists the types of
* sensitive data that you want to mask. For more information about the available options, see Types
* of data that you can mask.
*
* The Operation
property with an Audit
action is required to find the sensitive
* data terms. This Audit
action must contain a FindingsDestination
object. You
* can optionally use that FindingsDestination
object to list one or more destinations to send
* audit findings to. If you specify destinations such as log groups, Kinesis Data Firehose streams, and S3
* buckets, they must already exist.
*
* The second block must include both a DataIdentifer
array and an Operation
* property with an Deidentify
action. The DataIdentifer
array must exactly match
* the DataIdentifer
array in the first block of the policy.
*
* The Operation
property with the Deidentify
action is what actually masks the
* data, and it must contain the "MaskConfig": {}
object. The "MaskConfig": {}
* object must be empty.
*
* For an example data protection policy, see the Examples section on this page. *
*
* The contents of the two DataIdentifer
arrays must match exactly.
*
* In addition to the two JSON blocks, the policyDocument
can also include Name
,
* Description
, and Version
fields. The Name
is used as a dimension
* when CloudWatch Logs reports audit findings metrics to CloudWatch.
*
* The JSON specified in policyDocument
can be up to 30,720 characters.
*/
public String getPolicyDocument() {
return this.policyDocument;
}
/**
*
* Specify the data protection policy, in JSON. *
** This policy must include two JSON blocks: *
*
* The first block must include both a DataIdentifer
array and an Operation
property with
* an Audit
action. The DataIdentifer
array lists the types of sensitive data that you
* want to mask. For more information about the available options, see Types of data
* that you can mask.
*
* The Operation
property with an Audit
action is required to find the sensitive data
* terms. This Audit
action must contain a FindingsDestination
object. You can optionally
* use that FindingsDestination
object to list one or more destinations to send audit findings to. If
* you specify destinations such as log groups, Kinesis Data Firehose streams, and S3 buckets, they must already
* exist.
*
* The second block must include both a DataIdentifer
array and an Operation
property with
* an Deidentify
action. The DataIdentifer
array must exactly match the
* DataIdentifer
array in the first block of the policy.
*
* The Operation
property with the Deidentify
action is what actually masks the data, and
* it must contain the "MaskConfig": {}
object. The "MaskConfig": {}
object must be
* empty.
*
* For an example data protection policy, see the Examples section on this page. *
*
* The contents of the two DataIdentifer
arrays must match exactly.
*
* In addition to the two JSON blocks, the policyDocument
can also include Name
,
* Description
, and Version
fields. The Name
is used as a dimension when
* CloudWatch Logs reports audit findings metrics to CloudWatch.
*
* The JSON specified in policyDocument
can be up to 30,720 characters.
*
* This policy must include two JSON blocks: *
*
* The first block must include both a DataIdentifer
array and an Operation
* property with an Audit
action. The DataIdentifer
array lists the types of
* sensitive data that you want to mask. For more information about the available options, see Types
* of data that you can mask.
*
* The Operation
property with an Audit
action is required to find the sensitive
* data terms. This Audit
action must contain a FindingsDestination
object. You can
* optionally use that FindingsDestination
object to list one or more destinations to send audit
* findings to. If you specify destinations such as log groups, Kinesis Data Firehose streams, and S3
* buckets, they must already exist.
*
* The second block must include both a DataIdentifer
array and an Operation
* property with an Deidentify
action. The DataIdentifer
array must exactly match
* the DataIdentifer
array in the first block of the policy.
*
* The Operation
property with the Deidentify
action is what actually masks the
* data, and it must contain the "MaskConfig": {}
object. The "MaskConfig": {}
* object must be empty.
*
* For an example data protection policy, see the Examples section on this page. *
*
* The contents of the two DataIdentifer
arrays must match exactly.
*
* In addition to the two JSON blocks, the policyDocument
can also include Name
,
* Description
, and Version
fields. The Name
is used as a dimension
* when CloudWatch Logs reports audit findings metrics to CloudWatch.
*
* The JSON specified in policyDocument
can be up to 30,720 characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutDataProtectionPolicyRequest withPolicyDocument(String policyDocument) {
setPolicyDocument(policyDocument);
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 (getLogGroupIdentifier() != null)
sb.append("LogGroupIdentifier: ").append(getLogGroupIdentifier()).append(",");
if (getPolicyDocument() != null)
sb.append("PolicyDocument: ").append(getPolicyDocument());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PutDataProtectionPolicyRequest == false)
return false;
PutDataProtectionPolicyRequest other = (PutDataProtectionPolicyRequest) obj;
if (other.getLogGroupIdentifier() == null ^ this.getLogGroupIdentifier() == null)
return false;
if (other.getLogGroupIdentifier() != null && other.getLogGroupIdentifier().equals(this.getLogGroupIdentifier()) == false)
return false;
if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == null)
return false;
if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLogGroupIdentifier() == null) ? 0 : getLogGroupIdentifier().hashCode());
hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode());
return hashCode;
}
@Override
public PutDataProtectionPolicyRequest clone() {
return (PutDataProtectionPolicyRequest) super.clone();
}
}