/* * 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; /** *
* An organization Config rule that has information about Config rules that Config creates in member accounts. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class OrganizationConfigRule implements Serializable, Cloneable, StructuredPojo { /** ** The name that you assign to organization Config rule. *
*/ private String organizationConfigRuleName; /** ** Amazon Resource Name (ARN) of organization Config rule. *
*/ private String organizationConfigRuleArn; /** *
* An OrganizationManagedRuleMetadata
object.
*
* An OrganizationCustomRuleMetadata
object.
*
* A comma-separated list of accounts excluded from organization Config rule. *
*/ private com.amazonaws.internal.SdkInternalList* The timestamp of the last update. *
*/ private java.util.Date lastUpdateTime; /** ** An object that specifies metadata for your organization's Config Custom Policy rule. The metadata includes the * runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such as * resource type, resource ID of Amazon Web Services resource, and organization trigger types that initiate Config * to evaluate Amazon Web Services resources against a rule. *
*/ private OrganizationCustomPolicyRuleMetadataNoPolicy organizationCustomPolicyRuleMetadata; /** ** The name that you assign to organization Config rule. *
* * @param organizationConfigRuleName * The name that you assign to organization Config rule. */ public void setOrganizationConfigRuleName(String organizationConfigRuleName) { this.organizationConfigRuleName = organizationConfigRuleName; } /** ** The name that you assign to organization Config rule. *
* * @return The name that you assign to organization Config rule. */ public String getOrganizationConfigRuleName() { return this.organizationConfigRuleName; } /** ** The name that you assign to organization Config rule. *
* * @param organizationConfigRuleName * The name that you assign to organization Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationConfigRule withOrganizationConfigRuleName(String organizationConfigRuleName) { setOrganizationConfigRuleName(organizationConfigRuleName); return this; } /** ** Amazon Resource Name (ARN) of organization Config rule. *
* * @param organizationConfigRuleArn * Amazon Resource Name (ARN) of organization Config rule. */ public void setOrganizationConfigRuleArn(String organizationConfigRuleArn) { this.organizationConfigRuleArn = organizationConfigRuleArn; } /** ** Amazon Resource Name (ARN) of organization Config rule. *
* * @return Amazon Resource Name (ARN) of organization Config rule. */ public String getOrganizationConfigRuleArn() { return this.organizationConfigRuleArn; } /** ** Amazon Resource Name (ARN) of organization Config rule. *
* * @param organizationConfigRuleArn * Amazon Resource Name (ARN) of organization Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationConfigRule withOrganizationConfigRuleArn(String organizationConfigRuleArn) { setOrganizationConfigRuleArn(organizationConfigRuleArn); return this; } /** *
* An OrganizationManagedRuleMetadata
object.
*
OrganizationManagedRuleMetadata
object.
*/
public void setOrganizationManagedRuleMetadata(OrganizationManagedRuleMetadata organizationManagedRuleMetadata) {
this.organizationManagedRuleMetadata = organizationManagedRuleMetadata;
}
/**
*
* An OrganizationManagedRuleMetadata
object.
*
OrganizationManagedRuleMetadata
object.
*/
public OrganizationManagedRuleMetadata getOrganizationManagedRuleMetadata() {
return this.organizationManagedRuleMetadata;
}
/**
*
* An OrganizationManagedRuleMetadata
object.
*
OrganizationManagedRuleMetadata
object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OrganizationConfigRule withOrganizationManagedRuleMetadata(OrganizationManagedRuleMetadata organizationManagedRuleMetadata) {
setOrganizationManagedRuleMetadata(organizationManagedRuleMetadata);
return this;
}
/**
*
* An OrganizationCustomRuleMetadata
object.
*
OrganizationCustomRuleMetadata
object.
*/
public void setOrganizationCustomRuleMetadata(OrganizationCustomRuleMetadata organizationCustomRuleMetadata) {
this.organizationCustomRuleMetadata = organizationCustomRuleMetadata;
}
/**
*
* An OrganizationCustomRuleMetadata
object.
*
OrganizationCustomRuleMetadata
object.
*/
public OrganizationCustomRuleMetadata getOrganizationCustomRuleMetadata() {
return this.organizationCustomRuleMetadata;
}
/**
*
* An OrganizationCustomRuleMetadata
object.
*
OrganizationCustomRuleMetadata
object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OrganizationConfigRule withOrganizationCustomRuleMetadata(OrganizationCustomRuleMetadata organizationCustomRuleMetadata) {
setOrganizationCustomRuleMetadata(organizationCustomRuleMetadata);
return this;
}
/**
* * A comma-separated list of accounts excluded from organization Config rule. *
* * @return A comma-separated list of accounts excluded from organization Config rule. */ public java.util.List* A comma-separated list of accounts excluded from organization Config rule. *
* * @param excludedAccounts * A comma-separated list of accounts excluded from organization Config rule. */ public void setExcludedAccounts(java.util.Collection* A comma-separated list of accounts excluded from organization Config rule. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setExcludedAccounts(java.util.Collection)} or {@link #withExcludedAccounts(java.util.Collection)} if you * want to override the existing values. *
* * @param excludedAccounts * A comma-separated list of accounts excluded from organization Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationConfigRule withExcludedAccounts(String... excludedAccounts) { if (this.excludedAccounts == null) { setExcludedAccounts(new com.amazonaws.internal.SdkInternalList* A comma-separated list of accounts excluded from organization Config rule. *
* * @param excludedAccounts * A comma-separated list of accounts excluded from organization Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationConfigRule withExcludedAccounts(java.util.Collection* The timestamp of the last update. *
* * @param lastUpdateTime * The timestamp of the last update. */ public void setLastUpdateTime(java.util.Date lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; } /** ** The timestamp of the last update. *
* * @return The timestamp of the last update. */ public java.util.Date getLastUpdateTime() { return this.lastUpdateTime; } /** ** The timestamp of the last update. *
* * @param lastUpdateTime * The timestamp of the last update. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationConfigRule withLastUpdateTime(java.util.Date lastUpdateTime) { setLastUpdateTime(lastUpdateTime); return this; } /** ** An object that specifies metadata for your organization's Config Custom Policy rule. The metadata includes the * runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such as * resource type, resource ID of Amazon Web Services resource, and organization trigger types that initiate Config * to evaluate Amazon Web Services resources against a rule. *
* * @param organizationCustomPolicyRuleMetadata * An object that specifies metadata for your organization's Config Custom Policy rule. The metadata includes * the runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such * as resource type, resource ID of Amazon Web Services resource, and organization trigger types that * initiate Config to evaluate Amazon Web Services resources against a rule. */ public void setOrganizationCustomPolicyRuleMetadata(OrganizationCustomPolicyRuleMetadataNoPolicy organizationCustomPolicyRuleMetadata) { this.organizationCustomPolicyRuleMetadata = organizationCustomPolicyRuleMetadata; } /** ** An object that specifies metadata for your organization's Config Custom Policy rule. The metadata includes the * runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such as * resource type, resource ID of Amazon Web Services resource, and organization trigger types that initiate Config * to evaluate Amazon Web Services resources against a rule. *
* * @return An object that specifies metadata for your organization's Config Custom Policy rule. The metadata * includes the runtime system in use, which accounts have debug logging enabled, and other custom rule * metadata, such as resource type, resource ID of Amazon Web Services resource, and organization trigger * types that initiate Config to evaluate Amazon Web Services resources against a rule. */ public OrganizationCustomPolicyRuleMetadataNoPolicy getOrganizationCustomPolicyRuleMetadata() { return this.organizationCustomPolicyRuleMetadata; } /** ** An object that specifies metadata for your organization's Config Custom Policy rule. The metadata includes the * runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such as * resource type, resource ID of Amazon Web Services resource, and organization trigger types that initiate Config * to evaluate Amazon Web Services resources against a rule. *
* * @param organizationCustomPolicyRuleMetadata * An object that specifies metadata for your organization's Config Custom Policy rule. The metadata includes * the runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such * as resource type, resource ID of Amazon Web Services resource, and organization trigger types that * initiate Config to evaluate Amazon Web Services resources against a rule. * @return Returns a reference to this object so that method calls can be chained together. */ public OrganizationConfigRule withOrganizationCustomPolicyRuleMetadata(OrganizationCustomPolicyRuleMetadataNoPolicy organizationCustomPolicyRuleMetadata) { setOrganizationCustomPolicyRuleMetadata(organizationCustomPolicyRuleMetadata); 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 (getOrganizationConfigRuleName() != null) sb.append("OrganizationConfigRuleName: ").append(getOrganizationConfigRuleName()).append(","); if (getOrganizationConfigRuleArn() != null) sb.append("OrganizationConfigRuleArn: ").append(getOrganizationConfigRuleArn()).append(","); if (getOrganizationManagedRuleMetadata() != null) sb.append("OrganizationManagedRuleMetadata: ").append(getOrganizationManagedRuleMetadata()).append(","); if (getOrganizationCustomRuleMetadata() != null) sb.append("OrganizationCustomRuleMetadata: ").append(getOrganizationCustomRuleMetadata()).append(","); if (getExcludedAccounts() != null) sb.append("ExcludedAccounts: ").append(getExcludedAccounts()).append(","); if (getLastUpdateTime() != null) sb.append("LastUpdateTime: ").append(getLastUpdateTime()).append(","); if (getOrganizationCustomPolicyRuleMetadata() != null) sb.append("OrganizationCustomPolicyRuleMetadata: ").append(getOrganizationCustomPolicyRuleMetadata()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof OrganizationConfigRule == false) return false; OrganizationConfigRule other = (OrganizationConfigRule) obj; if (other.getOrganizationConfigRuleName() == null ^ this.getOrganizationConfigRuleName() == null) return false; if (other.getOrganizationConfigRuleName() != null && other.getOrganizationConfigRuleName().equals(this.getOrganizationConfigRuleName()) == false) return false; if (other.getOrganizationConfigRuleArn() == null ^ this.getOrganizationConfigRuleArn() == null) return false; if (other.getOrganizationConfigRuleArn() != null && other.getOrganizationConfigRuleArn().equals(this.getOrganizationConfigRuleArn()) == false) return false; if (other.getOrganizationManagedRuleMetadata() == null ^ this.getOrganizationManagedRuleMetadata() == null) return false; if (other.getOrganizationManagedRuleMetadata() != null && other.getOrganizationManagedRuleMetadata().equals(this.getOrganizationManagedRuleMetadata()) == false) return false; if (other.getOrganizationCustomRuleMetadata() == null ^ this.getOrganizationCustomRuleMetadata() == null) return false; if (other.getOrganizationCustomRuleMetadata() != null && other.getOrganizationCustomRuleMetadata().equals(this.getOrganizationCustomRuleMetadata()) == false) return false; if (other.getExcludedAccounts() == null ^ this.getExcludedAccounts() == null) return false; if (other.getExcludedAccounts() != null && other.getExcludedAccounts().equals(this.getExcludedAccounts()) == false) return false; if (other.getLastUpdateTime() == null ^ this.getLastUpdateTime() == null) return false; if (other.getLastUpdateTime() != null && other.getLastUpdateTime().equals(this.getLastUpdateTime()) == false) return false; if (other.getOrganizationCustomPolicyRuleMetadata() == null ^ this.getOrganizationCustomPolicyRuleMetadata() == null) return false; if (other.getOrganizationCustomPolicyRuleMetadata() != null && other.getOrganizationCustomPolicyRuleMetadata().equals(this.getOrganizationCustomPolicyRuleMetadata()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getOrganizationConfigRuleName() == null) ? 0 : getOrganizationConfigRuleName().hashCode()); hashCode = prime * hashCode + ((getOrganizationConfigRuleArn() == null) ? 0 : getOrganizationConfigRuleArn().hashCode()); hashCode = prime * hashCode + ((getOrganizationManagedRuleMetadata() == null) ? 0 : getOrganizationManagedRuleMetadata().hashCode()); hashCode = prime * hashCode + ((getOrganizationCustomRuleMetadata() == null) ? 0 : getOrganizationCustomRuleMetadata().hashCode()); hashCode = prime * hashCode + ((getExcludedAccounts() == null) ? 0 : getExcludedAccounts().hashCode()); hashCode = prime * hashCode + ((getLastUpdateTime() == null) ? 0 : getLastUpdateTime().hashCode()); hashCode = prime * hashCode + ((getOrganizationCustomPolicyRuleMetadata() == null) ? 0 : getOrganizationCustomPolicyRuleMetadata().hashCode()); return hashCode; } @Override public OrganizationConfigRule clone() { try { return (OrganizationConfigRule) 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.OrganizationConfigRuleMarshaller.getInstance().marshall(this, protocolMarshaller); } }