
com.amazonaws.services.config.model.OrganizationAggregationSource Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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;
/**
*
* This object contains regions to set up the aggregator and an IAM role to retrieve organization details.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OrganizationAggregationSource implements Serializable, Cloneable, StructuredPojo {
/**
*
* ARN of the IAM role used to retrieve Amazon Web Services Organization details associated with the aggregator
* account.
*
*/
private String roleArn;
/**
*
* The source regions being aggregated.
*
*/
private com.amazonaws.internal.SdkInternalList awsRegions;
/**
*
* If true, aggregate existing Config regions and future regions.
*
*/
private Boolean allAwsRegions;
/**
*
* ARN of the IAM role used to retrieve Amazon Web Services Organization details associated with the aggregator
* account.
*
*
* @param roleArn
* ARN of the IAM role used to retrieve Amazon Web Services Organization details associated with the
* aggregator account.
*/
public void setRoleArn(String roleArn) {
this.roleArn = roleArn;
}
/**
*
* ARN of the IAM role used to retrieve Amazon Web Services Organization details associated with the aggregator
* account.
*
*
* @return ARN of the IAM role used to retrieve Amazon Web Services Organization details associated with the
* aggregator account.
*/
public String getRoleArn() {
return this.roleArn;
}
/**
*
* ARN of the IAM role used to retrieve Amazon Web Services Organization details associated with the aggregator
* account.
*
*
* @param roleArn
* ARN of the IAM role used to retrieve Amazon Web Services Organization details associated with the
* aggregator account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OrganizationAggregationSource withRoleArn(String roleArn) {
setRoleArn(roleArn);
return this;
}
/**
*
* The source regions being aggregated.
*
*
* @return The source regions being aggregated.
*/
public java.util.List getAwsRegions() {
if (awsRegions == null) {
awsRegions = new com.amazonaws.internal.SdkInternalList();
}
return awsRegions;
}
/**
*
* The source regions being aggregated.
*
*
* @param awsRegions
* The source regions being aggregated.
*/
public void setAwsRegions(java.util.Collection awsRegions) {
if (awsRegions == null) {
this.awsRegions = null;
return;
}
this.awsRegions = new com.amazonaws.internal.SdkInternalList(awsRegions);
}
/**
*
* The source regions being aggregated.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAwsRegions(java.util.Collection)} or {@link #withAwsRegions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param awsRegions
* The source regions being aggregated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OrganizationAggregationSource withAwsRegions(String... awsRegions) {
if (this.awsRegions == null) {
setAwsRegions(new com.amazonaws.internal.SdkInternalList(awsRegions.length));
}
for (String ele : awsRegions) {
this.awsRegions.add(ele);
}
return this;
}
/**
*
* The source regions being aggregated.
*
*
* @param awsRegions
* The source regions being aggregated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OrganizationAggregationSource withAwsRegions(java.util.Collection awsRegions) {
setAwsRegions(awsRegions);
return this;
}
/**
*
* If true, aggregate existing Config regions and future regions.
*
*
* @param allAwsRegions
* If true, aggregate existing Config regions and future regions.
*/
public void setAllAwsRegions(Boolean allAwsRegions) {
this.allAwsRegions = allAwsRegions;
}
/**
*
* If true, aggregate existing Config regions and future regions.
*
*
* @return If true, aggregate existing Config regions and future regions.
*/
public Boolean getAllAwsRegions() {
return this.allAwsRegions;
}
/**
*
* If true, aggregate existing Config regions and future regions.
*
*
* @param allAwsRegions
* If true, aggregate existing Config regions and future regions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OrganizationAggregationSource withAllAwsRegions(Boolean allAwsRegions) {
setAllAwsRegions(allAwsRegions);
return this;
}
/**
*
* If true, aggregate existing Config regions and future regions.
*
*
* @return If true, aggregate existing Config regions and future regions.
*/
public Boolean isAllAwsRegions() {
return this.allAwsRegions;
}
/**
* 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 (getRoleArn() != null)
sb.append("RoleArn: ").append(getRoleArn()).append(",");
if (getAwsRegions() != null)
sb.append("AwsRegions: ").append(getAwsRegions()).append(",");
if (getAllAwsRegions() != null)
sb.append("AllAwsRegions: ").append(getAllAwsRegions());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof OrganizationAggregationSource == false)
return false;
OrganizationAggregationSource other = (OrganizationAggregationSource) obj;
if (other.getRoleArn() == null ^ this.getRoleArn() == null)
return false;
if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false)
return false;
if (other.getAwsRegions() == null ^ this.getAwsRegions() == null)
return false;
if (other.getAwsRegions() != null && other.getAwsRegions().equals(this.getAwsRegions()) == false)
return false;
if (other.getAllAwsRegions() == null ^ this.getAllAwsRegions() == null)
return false;
if (other.getAllAwsRegions() != null && other.getAllAwsRegions().equals(this.getAllAwsRegions()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode());
hashCode = prime * hashCode + ((getAwsRegions() == null) ? 0 : getAwsRegions().hashCode());
hashCode = prime * hashCode + ((getAllAwsRegions() == null) ? 0 : getAllAwsRegions().hashCode());
return hashCode;
}
@Override
public OrganizationAggregationSource clone() {
try {
return (OrganizationAggregationSource) 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.OrganizationAggregationSourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}