/* * Copyright 2010-2018 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.ec2.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.ModifyImageAttributeRequestMarshaller; /** * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#modifyImageAttribute(ModifyImageAttributeRequest) ModifyImageAttribute operation}. *
* Modifies the specified attribute of the specified AMI. You can specify * only one attribute at a time. *
** NOTE: AWS Marketplace product codes cannot be modified. Images * with an AWS Marketplace product code cannot be made public. *
* * @see com.amazonaws.services.ec2.AmazonEC2#modifyImageAttribute(ModifyImageAttributeRequest) */ public class ModifyImageAttributeRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequest
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* @param imageId The ID of the AMI.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withImageId(String imageId) {
this.imageId = imageId;
return this;
}
/**
* The name of the attribute to modify.
*
* @return The name of the attribute to modify.
*/
public String getAttribute() {
return attribute;
}
/**
* The name of the attribute to modify.
*
* @param attribute The name of the attribute to modify.
*/
public void setAttribute(String attribute) {
this.attribute = attribute;
}
/**
* The name of the attribute to modify.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param attribute The name of the attribute to modify.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withAttribute(String attribute) {
this.attribute = attribute;
return this;
}
/**
* The operation type.
*
* Constraints:
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* @param userIds One or more AWS account IDs. This is only valid when modifying the
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param userIds One or more AWS account IDs. This is only valid when modifying the
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param userGroups One or more user groups. This is only valid when modifying the
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param userGroups One or more user groups. This is only valid when modifying the
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param productCodes One or more product codes. After you add a product code to an AMI, it
* can't be removed. This is only valid when modifying the
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param productCodes One or more product codes. After you add a product code to an AMI, it
* can't be removed. This is only valid when modifying the
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param value The value of the attribute being modified. This is only valid when
* modifying the
* Returns a reference to this object so that method calls can be chained together.
*
* @param launchPermission A launch permission modification.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withLaunchPermission(LaunchPermissionModifications launchPermission) {
this.launchPermission = launchPermission;
return this;
}
/**
* A description for the AMI.
*
* @return A description for the AMI.
*/
public String getDescription() {
return description;
}
/**
* A description for the AMI.
*
* @param description A description for the AMI.
*/
public void setDescription(String description) {
this.description = description;
}
/**
* A description for the AMI.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param description A description for the AMI.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withDescription(String description) {
this.description = description;
return this;
}
/**
* This method is intended for internal use only.
* Returns the marshaled request configured with additional parameters to
* enable operation dry-run.
*/
@Override
public Request
* Allowed Values: add, remove
*/
private String operationType;
/**
* One or more AWS account IDs. This is only valid when modifying the
* launchPermission
attribute.
*/
private com.amazonaws.internal.ListWithAutoConstructFlaglaunchPermission
attribute.
*/
private com.amazonaws.internal.ListWithAutoConstructFlagproductCodes
attribute.
*/
private com.amazonaws.internal.ListWithAutoConstructFlagdescription
attribute.
*/
private String value;
/**
* A launch permission modification.
*/
private LaunchPermissionModifications launchPermission;
/**
* A description for the AMI.
*/
private String description;
/**
* Default constructor for a new ModifyImageAttributeRequest object. Callers should use the
* setter or fluent setter (with...) methods to initialize this object after creating it.
*/
public ModifyImageAttributeRequest() {}
/**
* Constructs a new ModifyImageAttributeRequest object.
* Callers should use the setter or fluent setter (with...) methods to
* initialize any additional object members.
*
* @param imageId The ID of the AMI.
* @param attribute The name of the attribute to modify.
*/
public ModifyImageAttributeRequest(String imageId, String attribute) {
setImageId(imageId);
setAttribute(attribute);
}
/**
* The ID of the AMI.
*
* @return The ID of the AMI.
*/
public String getImageId() {
return imageId;
}
/**
* The ID of the AMI.
*
* @param imageId The ID of the AMI.
*/
public void setImageId(String imageId) {
this.imageId = imageId;
}
/**
* The ID of the AMI.
*
* Allowed Values: add, remove
*
* @return The operation type.
*
* @see OperationType
*/
public String getOperationType() {
return operationType;
}
/**
* The operation type.
*
* Allowed Values: add, remove
*
* @param operationType The operation type.
*
* @see OperationType
*/
public void setOperationType(String operationType) {
this.operationType = operationType;
}
/**
* The operation type.
*
* Allowed Values: add, remove
*
* @param operationType The operation type.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see OperationType
*/
public ModifyImageAttributeRequest withOperationType(String operationType) {
this.operationType = operationType;
return this;
}
/**
* The operation type.
*
* Allowed Values: add, remove
*
* @param operationType The operation type.
*
* @see OperationType
*/
public void setOperationType(OperationType operationType) {
this.operationType = operationType.toString();
}
/**
* The operation type.
*
* Allowed Values: add, remove
*
* @param operationType The operation type.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see OperationType
*/
public ModifyImageAttributeRequest withOperationType(OperationType operationType) {
this.operationType = operationType.toString();
return this;
}
/**
* One or more AWS account IDs. This is only valid when modifying the
* launchPermission
attribute.
*
* @return One or more AWS account IDs. This is only valid when modifying the
* launchPermission
attribute.
*/
public java.util.ListlaunchPermission
attribute.
*
* @param userIds One or more AWS account IDs. This is only valid when modifying the
* launchPermission
attribute.
*/
public void setUserIds(java.util.CollectionlaunchPermission
attribute.
* launchPermission
attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withUserIds(String... userIds) {
if (getUserIds() == null) setUserIds(new java.util.ArrayListlaunchPermission
attribute.
* launchPermission
attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withUserIds(java.util.CollectionlaunchPermission
attribute.
*
* @return One or more user groups. This is only valid when modifying the
* launchPermission
attribute.
*/
public java.util.ListlaunchPermission
attribute.
*
* @param userGroups One or more user groups. This is only valid when modifying the
* launchPermission
attribute.
*/
public void setUserGroups(java.util.CollectionlaunchPermission
attribute.
* launchPermission
attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withUserGroups(String... userGroups) {
if (getUserGroups() == null) setUserGroups(new java.util.ArrayListlaunchPermission
attribute.
* launchPermission
attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withUserGroups(java.util.CollectionproductCodes
attribute.
*
* @return One or more product codes. After you add a product code to an AMI, it
* can't be removed. This is only valid when modifying the
* productCodes
attribute.
*/
public java.util.ListproductCodes
attribute.
*
* @param productCodes One or more product codes. After you add a product code to an AMI, it
* can't be removed. This is only valid when modifying the
* productCodes
attribute.
*/
public void setProductCodes(java.util.CollectionproductCodes
attribute.
* productCodes
attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withProductCodes(String... productCodes) {
if (getProductCodes() == null) setProductCodes(new java.util.ArrayListproductCodes
attribute.
* productCodes
attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withProductCodes(java.util.Collectiondescription
attribute.
*
* @return The value of the attribute being modified. This is only valid when
* modifying the description
attribute.
*/
public String getValue() {
return value;
}
/**
* The value of the attribute being modified. This is only valid when
* modifying the description
attribute.
*
* @param value The value of the attribute being modified. This is only valid when
* modifying the description
attribute.
*/
public void setValue(String value) {
this.value = value;
}
/**
* The value of the attribute being modified. This is only valid when
* modifying the description
attribute.
* description
attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifyImageAttributeRequest withValue(String value) {
this.value = value;
return this;
}
/**
* A launch permission modification.
*
* @return A launch permission modification.
*/
public LaunchPermissionModifications getLaunchPermission() {
return launchPermission;
}
/**
* A launch permission modification.
*
* @param launchPermission A launch permission modification.
*/
public void setLaunchPermission(LaunchPermissionModifications launchPermission) {
this.launchPermission = launchPermission;
}
/**
* A launch permission modification.
*