/* * 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 PutAccountPolicyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* A name for the policy. This must be unique within the account. *
*/ private String policyName; /** ** 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 different than the
* operation's policyName
parameter, and 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.
*
* Currently the only valid value for this parameter is DATA_PROTECTION_POLICY
.
*
* Currently the only valid value for this parameter is ALL
, which specifies that the data protection
* policy applies to all log groups in the account. If you omit this parameter, the default of ALL
is
* used.
*
* A name for the policy. This must be unique within the account. *
* * @param policyName * A name for the policy. This must be unique within the account. */ public void setPolicyName(String policyName) { this.policyName = policyName; } /** ** A name for the policy. This must be unique within the account. *
* * @return A name for the policy. This must be unique within the account. */ public String getPolicyName() { return this.policyName; } /** ** A name for the policy. This must be unique within the account. *
* * @param policyName * A name for the policy. This must be unique within the account. * @return Returns a reference to this object so that method calls can be chained together. */ public PutAccountPolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); 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 different than the
* operation's policyName
parameter, and 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 different than the
* operation's policyName
parameter, and 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 different than the
* operation's policyName
parameter, and 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 different than the
* operation's policyName
parameter, and 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 different than the
* operation's policyName
parameter, and 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 different than the
* operation's policyName
parameter, and 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 PutAccountPolicyRequest withPolicyDocument(String policyDocument) {
setPolicyDocument(policyDocument);
return this;
}
/**
*
* Currently the only valid value for this parameter is DATA_PROTECTION_POLICY
.
*
DATA_PROTECTION_POLICY
.
* @see PolicyType
*/
public void setPolicyType(String policyType) {
this.policyType = policyType;
}
/**
*
* Currently the only valid value for this parameter is DATA_PROTECTION_POLICY
.
*
DATA_PROTECTION_POLICY
.
* @see PolicyType
*/
public String getPolicyType() {
return this.policyType;
}
/**
*
* Currently the only valid value for this parameter is DATA_PROTECTION_POLICY
.
*
DATA_PROTECTION_POLICY
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PolicyType
*/
public PutAccountPolicyRequest withPolicyType(String policyType) {
setPolicyType(policyType);
return this;
}
/**
*
* Currently the only valid value for this parameter is DATA_PROTECTION_POLICY
.
*
DATA_PROTECTION_POLICY
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PolicyType
*/
public PutAccountPolicyRequest withPolicyType(PolicyType policyType) {
this.policyType = policyType.toString();
return this;
}
/**
*
* Currently the only valid value for this parameter is ALL
, which specifies that the data protection
* policy applies to all log groups in the account. If you omit this parameter, the default of ALL
is
* used.
*
ALL
, which specifies that the data
* protection policy applies to all log groups in the account. If you omit this parameter, the default of
* ALL
is used.
* @see Scope
*/
public void setScope(String scope) {
this.scope = scope;
}
/**
*
* Currently the only valid value for this parameter is ALL
, which specifies that the data protection
* policy applies to all log groups in the account. If you omit this parameter, the default of ALL
is
* used.
*
ALL
, which specifies that the data
* protection policy applies to all log groups in the account. If you omit this parameter, the default of
* ALL
is used.
* @see Scope
*/
public String getScope() {
return this.scope;
}
/**
*
* Currently the only valid value for this parameter is ALL
, which specifies that the data protection
* policy applies to all log groups in the account. If you omit this parameter, the default of ALL
is
* used.
*
ALL
, which specifies that the data
* protection policy applies to all log groups in the account. If you omit this parameter, the default of
* ALL
is used.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Scope
*/
public PutAccountPolicyRequest withScope(String scope) {
setScope(scope);
return this;
}
/**
*
* Currently the only valid value for this parameter is ALL
, which specifies that the data protection
* policy applies to all log groups in the account. If you omit this parameter, the default of ALL
is
* used.
*
ALL
, which specifies that the data
* protection policy applies to all log groups in the account. If you omit this parameter, the default of
* ALL
is used.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Scope
*/
public PutAccountPolicyRequest withScope(Scope scope) {
this.scope = scope.toString();
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 (getPolicyName() != null)
sb.append("PolicyName: ").append(getPolicyName()).append(",");
if (getPolicyDocument() != null)
sb.append("PolicyDocument: ").append(getPolicyDocument()).append(",");
if (getPolicyType() != null)
sb.append("PolicyType: ").append(getPolicyType()).append(",");
if (getScope() != null)
sb.append("Scope: ").append(getScope());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PutAccountPolicyRequest == false)
return false;
PutAccountPolicyRequest other = (PutAccountPolicyRequest) obj;
if (other.getPolicyName() == null ^ this.getPolicyName() == null)
return false;
if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false)
return false;
if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == null)
return false;
if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == false)
return false;
if (other.getPolicyType() == null ^ this.getPolicyType() == null)
return false;
if (other.getPolicyType() != null && other.getPolicyType().equals(this.getPolicyType()) == false)
return false;
if (other.getScope() == null ^ this.getScope() == null)
return false;
if (other.getScope() != null && other.getScope().equals(this.getScope()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode());
hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode());
hashCode = prime * hashCode + ((getPolicyType() == null) ? 0 : getPolicyType().hashCode());
hashCode = prime * hashCode + ((getScope() == null) ? 0 : getScope().hashCode());
return hashCode;
}
@Override
public PutAccountPolicyRequest clone() {
return (PutAccountPolicyRequest) super.clone();
}
}