com.amazonaws.services.ec2.model
Class CreateTagsRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.CreateTagsRequest

public class CreateTagsRequest
extends AmazonWebServiceRequest

Container for the parameters to the CreateTags operation.

Adds or overwrites tags for the specified resources. Each resource can have a maximum of 10 tags. Each tag consists of a key-value pair. Tag keys must be unique per resource.

See Also:
AmazonEC2.createTags(CreateTagsRequest)

Constructor Summary
CreateTagsRequest()
          Default constructor for a new CreateTagsRequest object.
CreateTagsRequest(List<String> resources, List<Tag> tags)
          Constructs a new CreateTagsRequest object.
 
Method Summary
 boolean equals(Object obj)
           
 List<String> getResources()
          One or more IDs of resources to tag.
 List<Tag> getTags()
          The tags to add or overwrite for the specified resources.
 int hashCode()
           
 void setResources(Collection<String> resources)
          One or more IDs of resources to tag.
 void setTags(Collection<Tag> tags)
          The tags to add or overwrite for the specified resources.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 CreateTagsRequest withResources(Collection<String> resources)
          One or more IDs of resources to tag.
 CreateTagsRequest withResources(String... resources)
          One or more IDs of resources to tag.
 CreateTagsRequest withTags(Collection<Tag> tags)
          The tags to add or overwrite for the specified resources.
 CreateTagsRequest withTags(Tag... tags)
          The tags to add or overwrite for the specified resources.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, setDelegationToken, setRequestCredentials
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateTagsRequest

public CreateTagsRequest()
Default constructor for a new CreateTagsRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


CreateTagsRequest

public CreateTagsRequest(List<String> resources,
                         List<Tag> tags)
Constructs a new CreateTagsRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
resources - One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.
tags - The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.
Method Detail

getResources

public List<String> getResources()
One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.

Returns:
One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.

setResources

public void setResources(Collection<String> resources)
One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.

Parameters:
resources - One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.

withResources

public CreateTagsRequest withResources(String... resources)
One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.

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

Parameters:
resources - One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.
Returns:
A reference to this updated object so that method calls can be chained together.

withResources

public CreateTagsRequest withResources(Collection<String> resources)
One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.

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

Parameters:
resources - One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc.
Returns:
A reference to this updated object so that method calls can be chained together.

getTags

public List<Tag> getTags()
The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.

Returns:
The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.

setTags

public void setTags(Collection<Tag> tags)
The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.

Parameters:
tags - The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.

withTags

public CreateTagsRequest withTags(Tag... tags)
The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.

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

Parameters:
tags - The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.
Returns:
A reference to this updated object so that method calls can be chained together.

withTags

public CreateTagsRequest withTags(Collection<Tag> tags)
The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.

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

Parameters:
tags - The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.
Returns:
A reference to this updated object so that method calls can be chained together.

toString

public String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.