Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 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;
Container for the parameters to the ModifySnapshotAttribute operation.

Adds or remove permission settings for the specified snapshot.

 
 public class ModifySnapshotAttributeRequest extends AmazonWebServiceRequest {

    
The ID of the EBS snapshot whose attributes are being modified.
 
     private String snapshotId;

    
The name of the attribute being modified.

Available attribute names: createVolumePermission

 
     private String attribute;

    
The operation to perform on the attribute.

Available operation names: add, remove

 
     private String operationType;

    
The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
 
     private java.util.List<StringuserIds;

    
The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
 
     private java.util.List<StringgroupNames;

    
Default constructor for a new ModifySnapshotAttributeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public ModifySnapshotAttributeRequest() {}
    
    
Constructs a new ModifySnapshotAttributeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
snapshotId The ID of the EBS snapshot whose attributes are being modified.
attribute The name of the attribute being modified.

Available attribute names: createVolumePermission

operationType The operation to perform on the attribute.

Available operation names: add, remove

 
     public ModifySnapshotAttributeRequest(String snapshotIdString attributeString operationType) {
         this. = snapshotId;
         this. = attribute;
         this. = operationType;
     }
    
    
The ID of the EBS snapshot whose attributes are being modified.

Returns:
The ID of the EBS snapshot whose attributes are being modified.
 
     public String getSnapshotId() {
         return ;
     }
    
    
The ID of the EBS snapshot whose attributes are being modified.

Parameters:
snapshotId The ID of the EBS snapshot whose attributes are being modified.
 
    public void setSnapshotId(String snapshotId) {
        this. = snapshotId;
    }
    
    
The ID of the EBS snapshot whose attributes are being modified.

Returns a reference to this object so that method calls can be chained together.

Parameters:
snapshotId The ID of the EBS snapshot whose attributes are being modified.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = snapshotId;
        return this;
    }
    
    
    
The name of the attribute being modified.

Available attribute names: createVolumePermission

Returns:
The name of the attribute being modified.

Available attribute names: createVolumePermission

    public String getAttribute() {
        return ;
    }
    
    
The name of the attribute being modified.

Available attribute names: createVolumePermission

Parameters:
attribute The name of the attribute being modified.

Available attribute names: createVolumePermission

    public void setAttribute(String attribute) {
        this. = attribute;
    }
    
    
The name of the attribute being modified.

Available attribute names: createVolumePermission

Returns a reference to this object so that method calls can be chained together.

Parameters:
attribute The name of the attribute being modified.

Available attribute names: createVolumePermission

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = attribute;
        return this;
    }
    
    
    
The operation to perform on the attribute.

Available operation names: add, remove

Returns:
The operation to perform on the attribute.

Available operation names: add, remove

    public String getOperationType() {
        return ;
    }
    
    
The operation to perform on the attribute.

Available operation names: add, remove

Parameters:
operationType The operation to perform on the attribute.

Available operation names: add, remove

    public void setOperationType(String operationType) {
        this. = operationType;
    }
    
    
The operation to perform on the attribute.

Available operation names: add, remove

Returns a reference to this object so that method calls can be chained together.

Parameters:
operationType The operation to perform on the attribute.

Available operation names: add, remove

Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifySnapshotAttributeRequest withOperationType(String operationType) {
        this. = operationType;
        return this;
    }
    
    
    
The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>

Returns:
The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
    public java.util.List<StringgetUserIds() {
        if ( == null) {
             = new java.util.ArrayList<String>();
        }
        return ;
    }
    
    
The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>

Parameters:
userIds The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
    public void setUserIds(java.util.Collection<StringuserIds) {
        java.util.List<StringuserIdsCopy = new java.util.ArrayList<String>();
        if (userIds != null) {
            userIdsCopy.addAll(userIds);
        }
        this. = userIdsCopy;
    }
    
    
The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>

Returns a reference to this object so that method calls can be chained together.

Parameters:
userIds The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifySnapshotAttributeRequest withUserIds(String... userIds) {
        for (String value : userIds) {
            getUserIds().add(value);
        }
        return this;
    }
    
    
The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>

Returns a reference to this object so that method calls can be chained together.

Parameters:
userIds The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.List<StringuserIdsCopy = new java.util.ArrayList<String>();
        if (userIds != null) {
            userIdsCopy.addAll(userIds);
        }
        this. = userIdsCopy;
        return this;
    }
    
    
The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>

Returns:
The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
    public java.util.List<StringgetGroupNames() {
        if ( == null) {
             = new java.util.ArrayList<String>();
        }
        return ;
    }
    
    
The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>

Parameters:
groupNames The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
    public void setGroupNames(java.util.Collection<StringgroupNames) {
        java.util.List<StringgroupNamesCopy = new java.util.ArrayList<String>();
        if (groupNames != null) {
            groupNamesCopy.addAll(groupNames);
        }
        this. = groupNamesCopy;
    }
    
    
The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>

Returns a reference to this object so that method calls can be chained together.

Parameters:
groupNames The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifySnapshotAttributeRequest withGroupNames(String... groupNames) {
        for (String value : groupNames) {
            getGroupNames().add(value);
        }
        return this;
    }
    
    
The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>

Returns a reference to this object so that method calls can be chained together.

Parameters:
groupNames The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <note> Only valid when the createVolumePermission attribute is being modified. </note>
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.List<StringgroupNamesCopy = new java.util.ArrayList<String>();
        if (groupNames != null) {
            groupNamesCopy.addAll(groupNames);
        }
        this. = groupNamesCopy;
        return this;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("SnapshotId: " +  + ", ");
        sb.append("Attribute: " +  + ", ");
        sb.append("OperationType: " +  + ", ");
        sb.append("UserIds: " +  + ", ");
        sb.append("GroupNames: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X