/* * 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.ec2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.ModifyImageAttributeRequestMarshaller; /** *
* Contains the parameters for ModifyImageAttribute. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ModifyImageAttributeRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest* The name of the attribute to modify. *
*
* Valid values: description
| imdsSupport
| launchPermission
*
* A new description for the AMI. *
*/ private String description; /** ** The ID of the AMI. *
*/ private String imageId; /** ** A new launch permission for the AMI. *
*/ private LaunchPermissionModifications launchPermission; /** *
* The operation type. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
* Not supported. *
*/ private com.amazonaws.internal.SdkInternalList
* The user groups. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
* The Amazon Web Services account IDs. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
* The value of the attribute being modified. This parameter can be used only when the Attribute
* parameter is description
or imdsSupport
.
*
* The Amazon Resource Name (ARN) of an organization. This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
* The Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
* Set to v2.0
to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will
* have HttpTokens
automatically set to required
so that, by default, the instance
* requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit
* is set to 2
. For more information, see Configure the AMI in the Amazon EC2 User Guide.
*
* Do not use this parameter unless your AMI software supports IMDSv2. After you set the value to v2.0
,
* you can't undo it. The only way to “reset” your AMI is to create a new AMI from the underlying snapshot.
*
* Valid values: description
| imdsSupport
| launchPermission
*/
public ModifyImageAttributeRequest(String imageId, String attribute) {
setImageId(imageId);
setAttribute(attribute);
}
/**
*
* The name of the attribute to modify. *
*
* Valid values: description
| imdsSupport
| launchPermission
*
* Valid values: description
| imdsSupport
| launchPermission
*/
public void setAttribute(String attribute) {
this.attribute = attribute;
}
/**
*
* The name of the attribute to modify. *
*
* Valid values: description
| imdsSupport
| launchPermission
*
* Valid values: description
| imdsSupport
| launchPermission
*/
public String getAttribute() {
return this.attribute;
}
/**
*
* The name of the attribute to modify. *
*
* Valid values: description
| imdsSupport
| launchPermission
*
* Valid values: description
| imdsSupport
| launchPermission
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withAttribute(String attribute) {
setAttribute(attribute);
return this;
}
/**
*
* A new description for the AMI. *
* * @param description * A new description for the AMI. */ public void setDescription(String description) { this.description = description; } /** ** A new description for the AMI. *
* * @return A new description for the AMI. */ public String getDescription() { return this.description; } /** ** A new description for the AMI. *
* * @param description * A new description for the AMI. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyImageAttributeRequest withDescription(String description) { setDescription(description); return this; } /** ** 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. *
* * @return The ID of the AMI. */ public String getImageId() { return this.imageId; } /** ** The ID of the AMI. *
* * @param imageId * The ID of the AMI. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyImageAttributeRequest withImageId(String imageId) { setImageId(imageId); return this; } /** ** A new launch permission for the AMI. *
* * @param launchPermission * A new launch permission for the AMI. */ public void setLaunchPermission(LaunchPermissionModifications launchPermission) { this.launchPermission = launchPermission; } /** ** A new launch permission for the AMI. *
* * @return A new launch permission for the AMI. */ public LaunchPermissionModifications getLaunchPermission() { return this.launchPermission; } /** ** A new launch permission for the AMI. *
* * @param launchPermission * A new launch permission for the AMI. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyImageAttributeRequest withLaunchPermission(LaunchPermissionModifications launchPermission) { setLaunchPermission(launchPermission); return this; } /** *
* The operation type. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
parameter is
* launchPermission
.
* @see OperationType
*/
public void setOperationType(String operationType) {
this.operationType = operationType;
}
/**
*
* The operation type. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
parameter is
* launchPermission
.
* @see OperationType
*/
public String getOperationType() {
return this.operationType;
}
/**
*
* The operation type. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
parameter is
* launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OperationType
*/
public ModifyImageAttributeRequest withOperationType(String operationType) {
setOperationType(operationType);
return this;
}
/**
*
* The operation type. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
parameter is
* launchPermission
.
* @see OperationType
*/
public void setOperationType(OperationType operationType) {
withOperationType(operationType);
}
/**
*
* The operation type. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
parameter is
* launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OperationType
*/
public ModifyImageAttributeRequest withOperationType(OperationType operationType) {
this.operationType = operationType.toString();
return this;
}
/**
* * Not supported. *
* * @return Not supported. */ public java.util.List* Not supported. *
* * @param productCodes * Not supported. */ public void setProductCodes(java.util.Collection* Not supported. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setProductCodes(java.util.Collection)} or {@link #withProductCodes(java.util.Collection)} if you want to * override the existing values. *
* * @param productCodes * Not supported. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyImageAttributeRequest withProductCodes(String... productCodes) { if (this.productCodes == null) { setProductCodes(new com.amazonaws.internal.SdkInternalList* Not supported. *
* * @param productCodes * Not supported. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyImageAttributeRequest withProductCodes(java.util.Collection
* The user groups. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
parameter is
* launchPermission
.
*/
public java.util.List
* The user groups. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
parameter is
* launchPermission
.
*/
public void setUserGroups(java.util.Collection
* The user groups. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
* 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 user groups. This parameter can be used only when theAttribute
parameter is
* launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withUserGroups(String... userGroups) {
if (this.userGroups == null) {
setUserGroups(new com.amazonaws.internal.SdkInternalList
* The user groups. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
parameter is
* launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withUserGroups(java.util.Collection
* The Amazon Web Services account IDs. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
* parameter is launchPermission
.
*/
public java.util.List
* The Amazon Web Services account IDs. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
* parameter is launchPermission
.
*/
public void setUserIds(java.util.Collection
* The Amazon Web Services account IDs. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
* 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 IDs. This parameter can be used only when theAttribute
* parameter is launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withUserIds(String... userIds) {
if (this.userIds == null) {
setUserIds(new com.amazonaws.internal.SdkInternalList
* The Amazon Web Services account IDs. This parameter can be used only when the Attribute
parameter is
* launchPermission
.
*
Attribute
* parameter is launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withUserIds(java.util.Collection
* The value of the attribute being modified. This parameter can be used only when the Attribute
* parameter is description
or imdsSupport
.
*
Attribute
* parameter is description
or imdsSupport
.
*/
public void setValue(String value) {
this.value = value;
}
/**
*
* The value of the attribute being modified. This parameter can be used only when the Attribute
* parameter is description
or imdsSupport
.
*
Attribute
parameter is description
or imdsSupport
.
*/
public String getValue() {
return this.value;
}
/**
*
* The value of the attribute being modified. This parameter can be used only when the Attribute
* parameter is description
or imdsSupport
.
*
Attribute
* parameter is description
or imdsSupport
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withValue(String value) {
setValue(value);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of an organization. This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
Attribute
parameter is launchPermission
.
*/
public java.util.List
* The Amazon Resource Name (ARN) of an organization. This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
Attribute
parameter is launchPermission
.
*/
public void setOrganizationArns(java.util.Collection
* The Amazon Resource Name (ARN) of an organization. This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
* 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 Amazon Resource Name (ARN) of an organization. This parameter can be used only when the *Attribute
parameter is launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withOrganizationArns(String... organizationArns) {
if (this.organizationArns == null) {
setOrganizationArns(new com.amazonaws.internal.SdkInternalList
* The Amazon Resource Name (ARN) of an organization. This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
Attribute
parameter is launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withOrganizationArns(java.util.Collection
* The Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
Attribute
parameter is launchPermission
.
*/
public java.util.List
* The Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
Attribute
parameter is launchPermission
.
*/
public void setOrganizationalUnitArns(java.util.Collection
* The Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
* 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 Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can be used only when the *Attribute
parameter is launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withOrganizationalUnitArns(String... organizationalUnitArns) {
if (this.organizationalUnitArns == null) {
setOrganizationalUnitArns(new com.amazonaws.internal.SdkInternalList
* The Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can be used only when the
* Attribute
parameter is launchPermission
.
*
Attribute
parameter is launchPermission
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyImageAttributeRequest withOrganizationalUnitArns(java.util.Collection
* Set to v2.0
to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will
* have HttpTokens
automatically set to required
so that, by default, the instance
* requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit
* is set to 2
. For more information, see Configure the AMI in the Amazon EC2 User Guide.
*
* Do not use this parameter unless your AMI software supports IMDSv2. After you set the value to v2.0
,
* you can't undo it. The only way to “reset” your AMI is to create a new AMI from the underlying snapshot.
*
v2.0
to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI
* will have HttpTokens
automatically set to required
so that, by default, the
* instance requires that IMDSv2 is used when requesting instance metadata. In addition,
* HttpPutResponseHopLimit
is set to 2
. For more information, see Configure the AMI in the Amazon EC2 User Guide.
* Do not use this parameter unless your AMI software supports IMDSv2. After you set the value to
* v2.0
, you can't undo it. The only way to “reset” your AMI is to create a new AMI from the
* underlying snapshot.
*
* Set to v2.0
to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will
* have HttpTokens
automatically set to required
so that, by default, the instance
* requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit
* is set to 2
. For more information, see Configure the AMI in the Amazon EC2 User Guide.
*
* Do not use this parameter unless your AMI software supports IMDSv2. After you set the value to v2.0
,
* you can't undo it. The only way to “reset” your AMI is to create a new AMI from the underlying snapshot.
*
v2.0
to indicate that IMDSv2 is specified in the AMI. Instances launched from this
* AMI will have HttpTokens
automatically set to required
so that, by default, the
* instance requires that IMDSv2 is used when requesting instance metadata. In addition,
* HttpPutResponseHopLimit
is set to 2
. For more information, see Configure the AMI in the Amazon EC2 User Guide.
* Do not use this parameter unless your AMI software supports IMDSv2. After you set the value to
* v2.0
, you can't undo it. The only way to “reset” your AMI is to create a new AMI from the
* underlying snapshot.
*
* Set to v2.0
to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will
* have HttpTokens
automatically set to required
so that, by default, the instance
* requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit
* is set to 2
. For more information, see Configure the AMI in the Amazon EC2 User Guide.
*
* Do not use this parameter unless your AMI software supports IMDSv2. After you set the value to v2.0
,
* you can't undo it. The only way to “reset” your AMI is to create a new AMI from the underlying snapshot.
*
v2.0
to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI
* will have HttpTokens
automatically set to required
so that, by default, the
* instance requires that IMDSv2 is used when requesting instance metadata. In addition,
* HttpPutResponseHopLimit
is set to 2
. For more information, see Configure the AMI in the Amazon EC2 User Guide.
* Do not use this parameter unless your AMI software supports IMDSv2. After you set the value to
* v2.0
, you can't undo it. The only way to “reset” your AMI is to create a new AMI from the
* underlying snapshot.
*