Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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 DeleteTags operation.

Deletes the specified set of tags from the specified set of resources. This call is designed to follow a DescribeTags request.

For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide .

 
The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.
 
One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.
 
Default constructor for a new DeleteTagsRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public DeleteTagsRequest() {}
    
    
Constructs a new DeleteTagsRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
resources The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.
 
     public DeleteTagsRequest(java.util.List<Stringresources) {
         setResources(resources);
     }

    
The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.

Returns:
The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.
 
     public java.util.List<StringgetResources() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.

Parameters:
resources The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.
 
     public void setResources(java.util.Collection<Stringresources) {
         if (resources == null) {
             this. = null;
             return;
         }
         resourcesCopy.addAll(resources);
        this. = resourcesCopy;
    }
    
    
The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.

NOTE: This method appends the values to the existing list (if any). Use setResources(java.util.Collection) or withResources(java.util.Collection) if you want to override the existing values.

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

Parameters:
resources The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DeleteTagsRequest withResources(String... resources) {
        if (getResources() == nullsetResources(new java.util.ArrayList<String>(resources.length));
        for (String value : resources) {
            getResources().add(value);
        }
        return this;
    }
    
    
The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.

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

Parameters:
resources The ID of the resource. For example, ami-1a2b3c4d. You can specify more than one resource ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DeleteTagsRequest withResources(java.util.Collection<Stringresources) {
        if (resources == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringresourcesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(resources.size());
            resourcesCopy.addAll(resources);
            this. = resourcesCopy;
        }
        return this;
    }

    
One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.

Returns:
One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.
    public java.util.List<TaggetTags() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.

Parameters:
tags One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.
    public void setTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
            return;
        }
        tagsCopy.addAll(tags);
        this. = tagsCopy;
    }
    
    
One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(java.util.Collection) if you want to override the existing values.

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

Parameters:
tags One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DeleteTagsRequest withTags(Tag... tags) {
        if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.

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

Parameters:
tags One or more tags to delete. If you omit the value parameter, we delete the tag regardless of its value. If you specify this parameter with an empty string as the value, we delete the key only if its value is an empty string.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DeleteTagsRequest withTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
        } else {
            tagsCopy.addAll(tags);
            this. = tagsCopy;
        }
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        Request<DeleteTagsRequestrequest = new DeleteTagsRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
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("{");
        if (getResources() != nullsb.append("Resources: " + getResources() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getResources() == null) ? 0 : getResources().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DeleteTagsRequest == falsereturn false;
        DeleteTagsRequest other = (DeleteTagsRequest)obj;
        
        if (other.getResources() == null ^ this.getResources() == nullreturn false;
        if (other.getResources() != null && other.getResources().equals(this.getResources()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        return true;
    }
    
    @Override
    public DeleteTagsRequest clone() {
        
            return (DeleteTagsRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X