
com.amazonaws.services.imagebuilder.model.LaunchPermissionConfiguration 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.imagebuilder.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes the configuration for a launch permission. The launch permission modification request is sent to the Amazon EC2
* ModifyImageAttribute API on behalf of the user for each Region they have selected to distribute the AMI. To make
* an AMI public, set the launch permission authorized accounts to all
. See the examples for making an AMI
* public at Amazon EC2
* ModifyImageAttribute.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LaunchPermissionConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Web Services account ID.
*
*/
private java.util.List userIds;
/**
*
* The name of the group.
*
*/
private java.util.List userGroups;
/**
*
* The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more information, see
* What is
* Organizations?.
*
*/
private java.util.List organizationArns;
/**
*
* The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more information
* about key concepts for Organizations, see Organizations terminology and concepts.
*
*/
private java.util.List organizationalUnitArns;
/**
*
* The Amazon Web Services account ID.
*
*
* @return The Amazon Web Services account ID.
*/
public java.util.List getUserIds() {
return userIds;
}
/**
*
* The Amazon Web Services account ID.
*
*
* @param userIds
* The Amazon Web Services account ID.
*/
public void setUserIds(java.util.Collection userIds) {
if (userIds == null) {
this.userIds = null;
return;
}
this.userIds = new java.util.ArrayList(userIds);
}
/**
*
* The Amazon Web Services account ID.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setUserIds(java.util.Collection)} or {@link #withUserIds(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param userIds
* The Amazon Web Services account ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchPermissionConfiguration withUserIds(String... userIds) {
if (this.userIds == null) {
setUserIds(new java.util.ArrayList(userIds.length));
}
for (String ele : userIds) {
this.userIds.add(ele);
}
return this;
}
/**
*
* The Amazon Web Services account ID.
*
*
* @param userIds
* The Amazon Web Services account ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchPermissionConfiguration withUserIds(java.util.Collection userIds) {
setUserIds(userIds);
return this;
}
/**
*
* The name of the group.
*
*
* @return The name of the group.
*/
public java.util.List getUserGroups() {
return userGroups;
}
/**
*
* The name of the group.
*
*
* @param userGroups
* The name of the group.
*/
public void setUserGroups(java.util.Collection userGroups) {
if (userGroups == null) {
this.userGroups = null;
return;
}
this.userGroups = new java.util.ArrayList(userGroups);
}
/**
*
* The name of the group.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setUserGroups(java.util.Collection)} or {@link #withUserGroups(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param userGroups
* The name of the group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchPermissionConfiguration withUserGroups(String... userGroups) {
if (this.userGroups == null) {
setUserGroups(new java.util.ArrayList(userGroups.length));
}
for (String ele : userGroups) {
this.userGroups.add(ele);
}
return this;
}
/**
*
* The name of the group.
*
*
* @param userGroups
* The name of the group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchPermissionConfiguration withUserGroups(java.util.Collection userGroups) {
setUserGroups(userGroups);
return this;
}
/**
*
* The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more information, see
* What is
* Organizations?.
*
*
* @return The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more
* information, see What is
* Organizations?.
*/
public java.util.List getOrganizationArns() {
return organizationArns;
}
/**
*
* The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more information, see
* What is
* Organizations?.
*
*
* @param organizationArns
* The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more
* information, see What is
* Organizations?.
*/
public void setOrganizationArns(java.util.Collection organizationArns) {
if (organizationArns == null) {
this.organizationArns = null;
return;
}
this.organizationArns = new java.util.ArrayList(organizationArns);
}
/**
*
* The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more information, see
* What is
* Organizations?.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setOrganizationArns(java.util.Collection)} or {@link #withOrganizationArns(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param organizationArns
* The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more
* information, see What is
* Organizations?.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchPermissionConfiguration withOrganizationArns(String... organizationArns) {
if (this.organizationArns == null) {
setOrganizationArns(new java.util.ArrayList(organizationArns.length));
}
for (String ele : organizationArns) {
this.organizationArns.add(ele);
}
return this;
}
/**
*
* The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more information, see
* What is
* Organizations?.
*
*
* @param organizationArns
* The ARN for an Amazon Web Services Organization that you want to share your AMI with. For more
* information, see What is
* Organizations?.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchPermissionConfiguration withOrganizationArns(java.util.Collection organizationArns) {
setOrganizationArns(organizationArns);
return this;
}
/**
*
* The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more information
* about key concepts for Organizations, see Organizations terminology and concepts.
*
*
* @return The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more
* information about key concepts for Organizations, see Organizations terminology and concepts.
*/
public java.util.List getOrganizationalUnitArns() {
return organizationalUnitArns;
}
/**
*
* The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more information
* about key concepts for Organizations, see Organizations terminology and concepts.
*
*
* @param organizationalUnitArns
* The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more
* information about key concepts for Organizations, see Organizations terminology and concepts.
*/
public void setOrganizationalUnitArns(java.util.Collection organizationalUnitArns) {
if (organizationalUnitArns == null) {
this.organizationalUnitArns = null;
return;
}
this.organizationalUnitArns = new java.util.ArrayList(organizationalUnitArns);
}
/**
*
* The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more information
* about key concepts for Organizations, see Organizations terminology and concepts.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setOrganizationalUnitArns(java.util.Collection)} or
* {@link #withOrganizationalUnitArns(java.util.Collection)} if you want to override the existing values.
*
*
* @param organizationalUnitArns
* The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more
* information about key concepts for Organizations, see Organizations terminology and concepts.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchPermissionConfiguration withOrganizationalUnitArns(String... organizationalUnitArns) {
if (this.organizationalUnitArns == null) {
setOrganizationalUnitArns(new java.util.ArrayList(organizationalUnitArns.length));
}
for (String ele : organizationalUnitArns) {
this.organizationalUnitArns.add(ele);
}
return this;
}
/**
*
* The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more information
* about key concepts for Organizations, see Organizations terminology and concepts.
*
*
* @param organizationalUnitArns
* The ARN for an Organizations organizational unit (OU) that you want to share your AMI with. For more
* information about key concepts for Organizations, see Organizations terminology and concepts.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchPermissionConfiguration withOrganizationalUnitArns(java.util.Collection organizationalUnitArns) {
setOrganizationalUnitArns(organizationalUnitArns);
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 (getUserIds() != null)
sb.append("UserIds: ").append(getUserIds()).append(",");
if (getUserGroups() != null)
sb.append("UserGroups: ").append(getUserGroups()).append(",");
if (getOrganizationArns() != null)
sb.append("OrganizationArns: ").append(getOrganizationArns()).append(",");
if (getOrganizationalUnitArns() != null)
sb.append("OrganizationalUnitArns: ").append(getOrganizationalUnitArns());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LaunchPermissionConfiguration == false)
return false;
LaunchPermissionConfiguration other = (LaunchPermissionConfiguration) obj;
if (other.getUserIds() == null ^ this.getUserIds() == null)
return false;
if (other.getUserIds() != null && other.getUserIds().equals(this.getUserIds()) == false)
return false;
if (other.getUserGroups() == null ^ this.getUserGroups() == null)
return false;
if (other.getUserGroups() != null && other.getUserGroups().equals(this.getUserGroups()) == false)
return false;
if (other.getOrganizationArns() == null ^ this.getOrganizationArns() == null)
return false;
if (other.getOrganizationArns() != null && other.getOrganizationArns().equals(this.getOrganizationArns()) == false)
return false;
if (other.getOrganizationalUnitArns() == null ^ this.getOrganizationalUnitArns() == null)
return false;
if (other.getOrganizationalUnitArns() != null && other.getOrganizationalUnitArns().equals(this.getOrganizationalUnitArns()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getUserIds() == null) ? 0 : getUserIds().hashCode());
hashCode = prime * hashCode + ((getUserGroups() == null) ? 0 : getUserGroups().hashCode());
hashCode = prime * hashCode + ((getOrganizationArns() == null) ? 0 : getOrganizationArns().hashCode());
hashCode = prime * hashCode + ((getOrganizationalUnitArns() == null) ? 0 : getOrganizationalUnitArns().hashCode());
return hashCode;
}
@Override
public LaunchPermissionConfiguration clone() {
try {
return (LaunchPermissionConfiguration) 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.imagebuilder.model.transform.LaunchPermissionConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}