com.amazonaws.services.organizations.model.Organization Maven / Gradle / Ivy
Show all versions of aws-java-sdk-organizations Show documentation
/*
* 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.organizations.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains details about an organization. An organization is a collection of accounts that are centrally managed
* together using consolidated billing, organized hierarchically with organizational units (OUs), and controlled with
* policies .
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Organization implements Serializable, Cloneable, StructuredPojo {
/**
*
* The unique identifier (ID) of an organization.
*
*
* The regex pattern for an organization ID string requires "o-"
* followed by from 10 to 32 lowercase letters or digits.
*
*/
private String id;
/**
*
* The Amazon Resource Name (ARN) of an organization.
*
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.
*
*/
private String arn;
/**
*
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all features
* are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then
* only consolidated billing functionality is available. For more information, see Enabling all features in your organization in the Organizations User Guide.
*
*/
private String featureSet;
/**
*
* The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.
*
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.
*
*/
private String masterAccountArn;
/**
*
* The unique identifier (ID) of the management account of an organization.
*
*
* The regex pattern for an account ID string requires exactly 12
* digits.
*
*/
private String masterAccountId;
/**
*
* The email address that is associated with the Amazon Web Services account that is designated as the management
* account for the organization.
*
*/
private String masterAccountEmail;
/**
*
*
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the ListRoots
* operation instead.
*
*/
private java.util.List availablePolicyTypes;
/**
*
* The unique identifier (ID) of an organization.
*
*
* The regex pattern for an organization ID string requires "o-"
* followed by from 10 to 32 lowercase letters or digits.
*
*
* @param id
* The unique identifier (ID) of an organization.
*
* The regex pattern for an organization ID string requires
* "o-" followed by from 10 to 32 lowercase letters or digits.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The unique identifier (ID) of an organization.
*
*
* The regex pattern for an organization ID string requires "o-"
* followed by from 10 to 32 lowercase letters or digits.
*
*
* @return The unique identifier (ID) of an organization.
*
* The regex pattern for an organization ID string requires
* "o-" followed by from 10 to 32 lowercase letters or digits.
*/
public String getId() {
return this.id;
}
/**
*
* The unique identifier (ID) of an organization.
*
*
* The regex pattern for an organization ID string requires "o-"
* followed by from 10 to 32 lowercase letters or digits.
*
*
* @param id
* The unique identifier (ID) of an organization.
*
* The regex pattern for an organization ID string requires
* "o-" followed by from 10 to 32 lowercase letters or digits.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Organization withId(String id) {
setId(id);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of an organization.
*
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.
*
*
* @param arn
* The Amazon Resource Name (ARN) of an organization.
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization
* Reference.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of an organization.
*
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.
*
*
* @return The Amazon Resource Name (ARN) of an organization.
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization
* Reference.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of an organization.
*
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.
*
*
* @param arn
* The Amazon Resource Name (ARN) of an organization.
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization
* Reference.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Organization withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all features
* are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then
* only consolidated billing functionality is available. For more information, see Enabling all features in your organization in the Organizations User Guide.
*
*
* @param featureSet
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all
* features are enabled and policies can be applied to accounts in the organization. If set to
* "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information,
* see Enabling all features in your organization in the Organizations User Guide.
* @see OrganizationFeatureSet
*/
public void setFeatureSet(String featureSet) {
this.featureSet = featureSet;
}
/**
*
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all features
* are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then
* only consolidated billing functionality is available. For more information, see Enabling all features in your organization in the Organizations User Guide.
*
*
* @return Specifies the functionality that currently is available to the organization. If set to "ALL", then all
* features are enabled and policies can be applied to accounts in the organization. If set to
* "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information,
* see Enabling all features in your organization in the Organizations User Guide.
* @see OrganizationFeatureSet
*/
public String getFeatureSet() {
return this.featureSet;
}
/**
*
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all features
* are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then
* only consolidated billing functionality is available. For more information, see Enabling all features in your organization in the Organizations User Guide.
*
*
* @param featureSet
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all
* features are enabled and policies can be applied to accounts in the organization. If set to
* "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information,
* see Enabling all features in your organization in the Organizations User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OrganizationFeatureSet
*/
public Organization withFeatureSet(String featureSet) {
setFeatureSet(featureSet);
return this;
}
/**
*
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all features
* are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then
* only consolidated billing functionality is available. For more information, see Enabling all features in your organization in the Organizations User Guide.
*
*
* @param featureSet
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all
* features are enabled and policies can be applied to accounts in the organization. If set to
* "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information,
* see Enabling all features in your organization in the Organizations User Guide.
* @see OrganizationFeatureSet
*/
public void setFeatureSet(OrganizationFeatureSet featureSet) {
withFeatureSet(featureSet);
}
/**
*
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all features
* are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then
* only consolidated billing functionality is available. For more information, see Enabling all features in your organization in the Organizations User Guide.
*
*
* @param featureSet
* Specifies the functionality that currently is available to the organization. If set to "ALL", then all
* features are enabled and policies can be applied to accounts in the organization. If set to
* "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information,
* see Enabling all features in your organization in the Organizations User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OrganizationFeatureSet
*/
public Organization withFeatureSet(OrganizationFeatureSet featureSet) {
this.featureSet = featureSet.toString();
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.
*
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.
*
*
* @param masterAccountArn
* The Amazon Resource Name (ARN) of the account that is designated as the management account for the
* organization.
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization
* Reference.
*/
public void setMasterAccountArn(String masterAccountArn) {
this.masterAccountArn = masterAccountArn;
}
/**
*
* The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.
*
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.
*
*
* @return The Amazon Resource Name (ARN) of the account that is designated as the management account for the
* organization.
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization
* Reference.
*/
public String getMasterAccountArn() {
return this.masterAccountArn;
}
/**
*
* The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.
*
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference.
*
*
* @param masterAccountArn
* The Amazon Resource Name (ARN) of the account that is designated as the management account for the
* organization.
*
* For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization
* Reference.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Organization withMasterAccountArn(String masterAccountArn) {
setMasterAccountArn(masterAccountArn);
return this;
}
/**
*
* The unique identifier (ID) of the management account of an organization.
*
*
* The regex pattern for an account ID string requires exactly 12
* digits.
*
*
* @param masterAccountId
* The unique identifier (ID) of the management account of an organization.
*
* The regex pattern for an account ID string requires exactly
* 12 digits.
*/
public void setMasterAccountId(String masterAccountId) {
this.masterAccountId = masterAccountId;
}
/**
*
* The unique identifier (ID) of the management account of an organization.
*
*
* The regex pattern for an account ID string requires exactly 12
* digits.
*
*
* @return The unique identifier (ID) of the management account of an organization.
*
* The regex pattern for an account ID string requires exactly
* 12 digits.
*/
public String getMasterAccountId() {
return this.masterAccountId;
}
/**
*
* The unique identifier (ID) of the management account of an organization.
*
*
* The regex pattern for an account ID string requires exactly 12
* digits.
*
*
* @param masterAccountId
* The unique identifier (ID) of the management account of an organization.
*
* The regex pattern for an account ID string requires exactly
* 12 digits.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Organization withMasterAccountId(String masterAccountId) {
setMasterAccountId(masterAccountId);
return this;
}
/**
*
* The email address that is associated with the Amazon Web Services account that is designated as the management
* account for the organization.
*
*
* @param masterAccountEmail
* The email address that is associated with the Amazon Web Services account that is designated as the
* management account for the organization.
*/
public void setMasterAccountEmail(String masterAccountEmail) {
this.masterAccountEmail = masterAccountEmail;
}
/**
*
* The email address that is associated with the Amazon Web Services account that is designated as the management
* account for the organization.
*
*
* @return The email address that is associated with the Amazon Web Services account that is designated as the
* management account for the organization.
*/
public String getMasterAccountEmail() {
return this.masterAccountEmail;
}
/**
*
* The email address that is associated with the Amazon Web Services account that is designated as the management
* account for the organization.
*
*
* @param masterAccountEmail
* The email address that is associated with the Amazon Web Services account that is designated as the
* management account for the organization.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Organization withMasterAccountEmail(String masterAccountEmail) {
setMasterAccountEmail(masterAccountEmail);
return this;
}
/**
*
*
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the ListRoots
* operation instead.
*
*
* @return
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the
* ListRoots operation instead.
*/
public java.util.List getAvailablePolicyTypes() {
return availablePolicyTypes;
}
/**
*
*
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the ListRoots
* operation instead.
*
*
* @param availablePolicyTypes
*
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the
* ListRoots operation instead.
*/
public void setAvailablePolicyTypes(java.util.Collection availablePolicyTypes) {
if (availablePolicyTypes == null) {
this.availablePolicyTypes = null;
return;
}
this.availablePolicyTypes = new java.util.ArrayList(availablePolicyTypes);
}
/**
*
*
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the ListRoots
* operation instead.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAvailablePolicyTypes(java.util.Collection)} or {@link #withAvailablePolicyTypes(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param availablePolicyTypes
*
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the
* ListRoots operation instead.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Organization withAvailablePolicyTypes(PolicyTypeSummary... availablePolicyTypes) {
if (this.availablePolicyTypes == null) {
setAvailablePolicyTypes(new java.util.ArrayList(availablePolicyTypes.length));
}
for (PolicyTypeSummary ele : availablePolicyTypes) {
this.availablePolicyTypes.add(ele);
}
return this;
}
/**
*
*
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the ListRoots
* operation instead.
*
*
* @param availablePolicyTypes
*
* Do not use. This field is deprecated and doesn't provide complete information about the policies in your
* organization.
*
*
*
* To determine the policies that are enabled and available for use in your organization, use the
* ListRoots operation instead.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Organization withAvailablePolicyTypes(java.util.Collection availablePolicyTypes) {
setAvailablePolicyTypes(availablePolicyTypes);
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 (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getFeatureSet() != null)
sb.append("FeatureSet: ").append(getFeatureSet()).append(",");
if (getMasterAccountArn() != null)
sb.append("MasterAccountArn: ").append(getMasterAccountArn()).append(",");
if (getMasterAccountId() != null)
sb.append("MasterAccountId: ").append(getMasterAccountId()).append(",");
if (getMasterAccountEmail() != null)
sb.append("MasterAccountEmail: ").append("***Sensitive Data Redacted***").append(",");
if (getAvailablePolicyTypes() != null)
sb.append("AvailablePolicyTypes: ").append(getAvailablePolicyTypes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Organization == false)
return false;
Organization other = (Organization) obj;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getFeatureSet() == null ^ this.getFeatureSet() == null)
return false;
if (other.getFeatureSet() != null && other.getFeatureSet().equals(this.getFeatureSet()) == false)
return false;
if (other.getMasterAccountArn() == null ^ this.getMasterAccountArn() == null)
return false;
if (other.getMasterAccountArn() != null && other.getMasterAccountArn().equals(this.getMasterAccountArn()) == false)
return false;
if (other.getMasterAccountId() == null ^ this.getMasterAccountId() == null)
return false;
if (other.getMasterAccountId() != null && other.getMasterAccountId().equals(this.getMasterAccountId()) == false)
return false;
if (other.getMasterAccountEmail() == null ^ this.getMasterAccountEmail() == null)
return false;
if (other.getMasterAccountEmail() != null && other.getMasterAccountEmail().equals(this.getMasterAccountEmail()) == false)
return false;
if (other.getAvailablePolicyTypes() == null ^ this.getAvailablePolicyTypes() == null)
return false;
if (other.getAvailablePolicyTypes() != null && other.getAvailablePolicyTypes().equals(this.getAvailablePolicyTypes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getFeatureSet() == null) ? 0 : getFeatureSet().hashCode());
hashCode = prime * hashCode + ((getMasterAccountArn() == null) ? 0 : getMasterAccountArn().hashCode());
hashCode = prime * hashCode + ((getMasterAccountId() == null) ? 0 : getMasterAccountId().hashCode());
hashCode = prime * hashCode + ((getMasterAccountEmail() == null) ? 0 : getMasterAccountEmail().hashCode());
hashCode = prime * hashCode + ((getAvailablePolicyTypes() == null) ? 0 : getAvailablePolicyTypes().hashCode());
return hashCode;
}
@Override
public Organization clone() {
try {
return (Organization) 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.organizations.model.transform.OrganizationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}