/* * 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.ModifySnapshotAttributeRequestMarshaller; /** * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#modifySnapshotAttribute(ModifySnapshotAttributeRequest) ModifySnapshotAttribute operation}. *
* Adds or removes permission settings for the specified snapshot. You * may add or remove specified AWS account IDs from a snapshot's list of * create volume permissions, but you cannot do both in a single API * call. If you need to both add and remove account IDs for a snapshot, * you must use multiple API calls. *
** For more information on modifying snapshot permissions, see * Sharing Snapshots * in the Amazon Elastic Compute Cloud User Guide . *
** NOTE: Snapshots with AWS Marketplace product codes cannot be * made public. *
* * @see com.amazonaws.services.ec2.AmazonEC2#modifySnapshotAttribute(ModifySnapshotAttributeRequest) */ public class ModifySnapshotAttributeRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequestOnly volume creation * permissions may be modified at the customer level.
* Constraints:
* Allowed Values: productCodes, createVolumePermission
*/
private String attribute;
/**
* The type of operation to perform to the attribute.
*
* Constraints: Only
* volume creation permissions may be modified at the customer level.
* Only
* volume creation permissions may be modified at the customer level.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param snapshotId The ID of the snapshot.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifySnapshotAttributeRequest withSnapshotId(String snapshotId) {
this.snapshotId = snapshotId;
return this;
}
/**
* The snapshot attribute to modify. Only volume creation
* permissions may be modified at the customer level.
* Constraints: Only volume creation
* permissions may be modified at the customer level. Only volume creation
* permissions may be modified at the customer level.
* Constraints: Only volume creation
* permissions may be modified at the customer level. Only volume creation
* permissions may be modified at the customer level.
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints: Only volume creation
* permissions may be modified at the customer level. Only volume creation
* permissions may be modified at the customer level.
* Constraints: Only volume creation
* permissions may be modified at the customer level. Only volume creation
* permissions may be modified at the customer level.
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints: Only volume creation
* permissions may be modified at the customer level.
* 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 The account ID to modify for the snapshot.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifySnapshotAttributeRequest withUserIds(String... userIds) {
if (getUserIds() == null) setUserIds(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param userIds The account ID to modify for the snapshot.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifySnapshotAttributeRequest withUserIds(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param groupNames The group to modify for the snapshot.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifySnapshotAttributeRequest withGroupNames(String... groupNames) {
if (getGroupNames() == null) setGroupNames(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param groupNames The group to modify for the snapshot.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifySnapshotAttributeRequest withGroupNames(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param createVolumePermission A JSON representation of the snapshot attribute modification.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ModifySnapshotAttributeRequest withCreateVolumePermission(CreateVolumePermissionModifications createVolumePermission) {
this.createVolumePermission = createVolumePermission;
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;
/**
* The account ID to modify for the snapshot.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag
* Allowed Values: productCodes, createVolumePermission
*
* @return The snapshot attribute to modify.
* Allowed Values: productCodes, createVolumePermission
*
* @param attribute The snapshot attribute to modify.
* Allowed Values: productCodes, createVolumePermission
*
* @param attribute The snapshot attribute to modify.
* Allowed Values: productCodes, createVolumePermission
*
* @param attribute The snapshot attribute to modify.
* Allowed Values: productCodes, createVolumePermission
*
* @param attribute The snapshot attribute to modify.
* Allowed Values: add, remove
*
* @return The type of operation to perform to the attribute.
*
* @see OperationType
*/
public String getOperationType() {
return operationType;
}
/**
* The type of operation to perform to the attribute.
*
* Allowed Values: add, remove
*
* @param operationType The type of operation to perform to the attribute.
*
* @see OperationType
*/
public void setOperationType(String operationType) {
this.operationType = operationType;
}
/**
* The type of operation to perform to the attribute.
*
* Allowed Values: add, remove
*
* @param operationType The type of operation to perform to the attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see OperationType
*/
public ModifySnapshotAttributeRequest withOperationType(String operationType) {
this.operationType = operationType;
return this;
}
/**
* The type of operation to perform to the attribute.
*
* Allowed Values: add, remove
*
* @param operationType The type of operation to perform to the attribute.
*
* @see OperationType
*/
public void setOperationType(OperationType operationType) {
this.operationType = operationType.toString();
}
/**
* The type of operation to perform to the attribute.
*
* Allowed Values: add, remove
*
* @param operationType The type of operation to perform to the attribute.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see OperationType
*/
public ModifySnapshotAttributeRequest withOperationType(OperationType operationType) {
this.operationType = operationType.toString();
return this;
}
/**
* The account ID to modify for the snapshot.
*
* @return The account ID to modify for the snapshot.
*/
public java.util.List