/* * 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.config.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* organization managed rule metadata such as resource type and ID of Amazon Web Services resource along with the rule * identifier. It also provides the frequency with which you want Config to run evaluations for the rule if the trigger * type is periodic. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class OrganizationManagedRuleMetadata implements Serializable, Cloneable, StructuredPojo { /** *

* The description that you provide for your organization Config rule. *

*/ private String description; /** *

* For organization config managed rules, a predefined identifier from a list. For example, * IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using * Config managed rules. *

*/ private String ruleIdentifier; /** *

* A string, in JSON format, that is passed to your organization Config rule Lambda function. *

*/ private String inputParameters; /** *

* The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule that is * triggered at a periodic frequency. *

* *

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid * value for the MaximumExecutionFrequency parameter. *

*
*/ private String maximumExecutionFrequency; /** *

* The type of the Amazon Web Services resource that was evaluated. *

*/ private com.amazonaws.internal.SdkInternalList resourceTypesScope; /** *

* The ID of the Amazon Web Services resource that was evaluated. *

*/ private String resourceIdScope; /** *

* One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more * specific tag values. *

*/ private String tagKeyScope; /** *

* The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category * (key). *

*/ private String tagValueScope; /** *

* The description that you provide for your organization Config rule. *

* * @param description * The description that you provide for your organization Config rule. */ public void setDescription(String description) { this.description = description; } /** *

* The description that you provide for your organization Config rule. *

* * @return The description that you provide for your organization Config rule. */ public String getDescription() { return this.description; } /** *

* The description that you provide for your organization Config rule. *

* * @param description * The description that you provide for your organization Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationManagedRuleMetadata withDescription(String description) { setDescription(description); return this; } /** *

* For organization config managed rules, a predefined identifier from a list. For example, * IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using * Config managed rules. *

* * @param ruleIdentifier * For organization config managed rules, a predefined identifier from a list. For example, * IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using Config managed rules. */ public void setRuleIdentifier(String ruleIdentifier) { this.ruleIdentifier = ruleIdentifier; } /** *

* For organization config managed rules, a predefined identifier from a list. For example, * IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using * Config managed rules. *

* * @return For organization config managed rules, a predefined identifier from a list. For example, * IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using Config managed rules. */ public String getRuleIdentifier() { return this.ruleIdentifier; } /** *

* For organization config managed rules, a predefined identifier from a list. For example, * IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using * Config managed rules. *

* * @param ruleIdentifier * For organization config managed rules, a predefined identifier from a list. For example, * IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see Using Config managed rules. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationManagedRuleMetadata withRuleIdentifier(String ruleIdentifier) { setRuleIdentifier(ruleIdentifier); return this; } /** *

* A string, in JSON format, that is passed to your organization Config rule Lambda function. *

* * @param inputParameters * A string, in JSON format, that is passed to your organization Config rule Lambda function. */ public void setInputParameters(String inputParameters) { this.inputParameters = inputParameters; } /** *

* A string, in JSON format, that is passed to your organization Config rule Lambda function. *

* * @return A string, in JSON format, that is passed to your organization Config rule Lambda function. */ public String getInputParameters() { return this.inputParameters; } /** *

* A string, in JSON format, that is passed to your organization Config rule Lambda function. *

* * @param inputParameters * A string, in JSON format, that is passed to your organization Config rule Lambda function. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationManagedRuleMetadata withInputParameters(String inputParameters) { setInputParameters(inputParameters); return this; } /** *

* The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule that is * triggered at a periodic frequency. *

* *

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid * value for the MaximumExecutionFrequency parameter. *

*
* * @param maximumExecutionFrequency * The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule * that is triggered at a periodic frequency.

*

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a * valid value for the MaximumExecutionFrequency parameter. *

* @see MaximumExecutionFrequency */ public void setMaximumExecutionFrequency(String maximumExecutionFrequency) { this.maximumExecutionFrequency = maximumExecutionFrequency; } /** *

* The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule that is * triggered at a periodic frequency. *

* *

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid * value for the MaximumExecutionFrequency parameter. *

*
* * @return The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule * that is triggered at a periodic frequency.

*

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify * a valid value for the MaximumExecutionFrequency parameter. *

* @see MaximumExecutionFrequency */ public String getMaximumExecutionFrequency() { return this.maximumExecutionFrequency; } /** *

* The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule that is * triggered at a periodic frequency. *

* *

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid * value for the MaximumExecutionFrequency parameter. *

*
* * @param maximumExecutionFrequency * The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule * that is triggered at a periodic frequency.

*

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a * valid value for the MaximumExecutionFrequency parameter. *

* @return Returns a reference to this object so that method calls can be chained together. * @see MaximumExecutionFrequency */ public OrganizationManagedRuleMetadata withMaximumExecutionFrequency(String maximumExecutionFrequency) { setMaximumExecutionFrequency(maximumExecutionFrequency); return this; } /** *

* The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule that is * triggered at a periodic frequency. *

* *

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid * value for the MaximumExecutionFrequency parameter. *

*
* * @param maximumExecutionFrequency * The maximum frequency with which Config runs evaluations for a rule. This is for an Config managed rule * that is triggered at a periodic frequency.

*

* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a * valid value for the MaximumExecutionFrequency parameter. *

* @return Returns a reference to this object so that method calls can be chained together. * @see MaximumExecutionFrequency */ public OrganizationManagedRuleMetadata withMaximumExecutionFrequency(MaximumExecutionFrequency maximumExecutionFrequency) { this.maximumExecutionFrequency = maximumExecutionFrequency.toString(); return this; } /** *

* The type of the Amazon Web Services resource that was evaluated. *

* * @return The type of the Amazon Web Services resource that was evaluated. */ public java.util.List getResourceTypesScope() { if (resourceTypesScope == null) { resourceTypesScope = new com.amazonaws.internal.SdkInternalList(); } return resourceTypesScope; } /** *

* The type of the Amazon Web Services resource that was evaluated. *

* * @param resourceTypesScope * The type of the Amazon Web Services resource that was evaluated. */ public void setResourceTypesScope(java.util.Collection resourceTypesScope) { if (resourceTypesScope == null) { this.resourceTypesScope = null; return; } this.resourceTypesScope = new com.amazonaws.internal.SdkInternalList(resourceTypesScope); } /** *

* The type of the Amazon Web Services resource that was evaluated. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setResourceTypesScope(java.util.Collection)} or {@link #withResourceTypesScope(java.util.Collection)} if * you want to override the existing values. *

* * @param resourceTypesScope * The type of the Amazon Web Services resource that was evaluated. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationManagedRuleMetadata withResourceTypesScope(String... resourceTypesScope) { if (this.resourceTypesScope == null) { setResourceTypesScope(new com.amazonaws.internal.SdkInternalList(resourceTypesScope.length)); } for (String ele : resourceTypesScope) { this.resourceTypesScope.add(ele); } return this; } /** *

* The type of the Amazon Web Services resource that was evaluated. *

* * @param resourceTypesScope * The type of the Amazon Web Services resource that was evaluated. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationManagedRuleMetadata withResourceTypesScope(java.util.Collection resourceTypesScope) { setResourceTypesScope(resourceTypesScope); return this; } /** *

* The ID of the Amazon Web Services resource that was evaluated. *

* * @param resourceIdScope * The ID of the Amazon Web Services resource that was evaluated. */ public void setResourceIdScope(String resourceIdScope) { this.resourceIdScope = resourceIdScope; } /** *

* The ID of the Amazon Web Services resource that was evaluated. *

* * @return The ID of the Amazon Web Services resource that was evaluated. */ public String getResourceIdScope() { return this.resourceIdScope; } /** *

* The ID of the Amazon Web Services resource that was evaluated. *

* * @param resourceIdScope * The ID of the Amazon Web Services resource that was evaluated. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationManagedRuleMetadata withResourceIdScope(String resourceIdScope) { setResourceIdScope(resourceIdScope); return this; } /** *

* One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more * specific tag values. *

* * @param tagKeyScope * One part of a key-value pair that make up a tag. A key is a general label that acts like a category for * more specific tag values. */ public void setTagKeyScope(String tagKeyScope) { this.tagKeyScope = tagKeyScope; } /** *

* One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more * specific tag values. *

* * @return One part of a key-value pair that make up a tag. A key is a general label that acts like a category for * more specific tag values. */ public String getTagKeyScope() { return this.tagKeyScope; } /** *

* One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more * specific tag values. *

* * @param tagKeyScope * One part of a key-value pair that make up a tag. A key is a general label that acts like a category for * more specific tag values. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationManagedRuleMetadata withTagKeyScope(String tagKeyScope) { setTagKeyScope(tagKeyScope); return this; } /** *

* The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category * (key). *

* * @param tagValueScope * The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag * category (key). */ public void setTagValueScope(String tagValueScope) { this.tagValueScope = tagValueScope; } /** *

* The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category * (key). *

* * @return The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag * category (key). */ public String getTagValueScope() { return this.tagValueScope; } /** *

* The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category * (key). *

* * @param tagValueScope * The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag * category (key). * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationManagedRuleMetadata withTagValueScope(String tagValueScope) { setTagValueScope(tagValueScope); 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 (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getRuleIdentifier() != null) sb.append("RuleIdentifier: ").append(getRuleIdentifier()).append(","); if (getInputParameters() != null) sb.append("InputParameters: ").append(getInputParameters()).append(","); if (getMaximumExecutionFrequency() != null) sb.append("MaximumExecutionFrequency: ").append(getMaximumExecutionFrequency()).append(","); if (getResourceTypesScope() != null) sb.append("ResourceTypesScope: ").append(getResourceTypesScope()).append(","); if (getResourceIdScope() != null) sb.append("ResourceIdScope: ").append(getResourceIdScope()).append(","); if (getTagKeyScope() != null) sb.append("TagKeyScope: ").append(getTagKeyScope()).append(","); if (getTagValueScope() != null) sb.append("TagValueScope: ").append(getTagValueScope()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof OrganizationManagedRuleMetadata == false) return false; OrganizationManagedRuleMetadata other = (OrganizationManagedRuleMetadata) obj; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getRuleIdentifier() == null ^ this.getRuleIdentifier() == null) return false; if (other.getRuleIdentifier() != null && other.getRuleIdentifier().equals(this.getRuleIdentifier()) == false) return false; if (other.getInputParameters() == null ^ this.getInputParameters() == null) return false; if (other.getInputParameters() != null && other.getInputParameters().equals(this.getInputParameters()) == false) return false; if (other.getMaximumExecutionFrequency() == null ^ this.getMaximumExecutionFrequency() == null) return false; if (other.getMaximumExecutionFrequency() != null && other.getMaximumExecutionFrequency().equals(this.getMaximumExecutionFrequency()) == false) return false; if (other.getResourceTypesScope() == null ^ this.getResourceTypesScope() == null) return false; if (other.getResourceTypesScope() != null && other.getResourceTypesScope().equals(this.getResourceTypesScope()) == false) return false; if (other.getResourceIdScope() == null ^ this.getResourceIdScope() == null) return false; if (other.getResourceIdScope() != null && other.getResourceIdScope().equals(this.getResourceIdScope()) == false) return false; if (other.getTagKeyScope() == null ^ this.getTagKeyScope() == null) return false; if (other.getTagKeyScope() != null && other.getTagKeyScope().equals(this.getTagKeyScope()) == false) return false; if (other.getTagValueScope() == null ^ this.getTagValueScope() == null) return false; if (other.getTagValueScope() != null && other.getTagValueScope().equals(this.getTagValueScope()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getRuleIdentifier() == null) ? 0 : getRuleIdentifier().hashCode()); hashCode = prime * hashCode + ((getInputParameters() == null) ? 0 : getInputParameters().hashCode()); hashCode = prime * hashCode + ((getMaximumExecutionFrequency() == null) ? 0 : getMaximumExecutionFrequency().hashCode()); hashCode = prime * hashCode + ((getResourceTypesScope() == null) ? 0 : getResourceTypesScope().hashCode()); hashCode = prime * hashCode + ((getResourceIdScope() == null) ? 0 : getResourceIdScope().hashCode()); hashCode = prime * hashCode + ((getTagKeyScope() == null) ? 0 : getTagKeyScope().hashCode()); hashCode = prime * hashCode + ((getTagValueScope() == null) ? 0 : getTagValueScope().hashCode()); return hashCode; } @Override public OrganizationManagedRuleMetadata clone() { try { return (OrganizationManagedRuleMetadata) 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.config.model.transform.OrganizationManagedRuleMetadataMarshaller.getInstance().marshall(this, protocolMarshaller); } }