com.amazonaws.services.ec2.model
Class CreateTagsRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.CreateTagsRequest
All Implemented Interfaces:
DryRunSupportedRequest<CreateTagsRequest>, java.io.Serializable

public class CreateTagsRequest
extends AmazonWebServiceRequest
implements java.io.Serializable, DryRunSupportedRequest<CreateTagsRequest>

Container for the parameters to the CreateTags operation.

Adds or overwrites one or more tags for the specified EC2 resource or resources. Each resource can have a maximum of 10 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.

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

See Also:
AmazonEC2.createTags(CreateTagsRequest), Serialized Form

Constructor Summary
CreateTagsRequest()
          Default constructor for a new CreateTagsRequest object.
CreateTagsRequest(java.util.List<java.lang.String> resources, java.util.List<Tag> tags)
          Constructs a new CreateTagsRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Request<CreateTagsRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.util.List<java.lang.String> getResources()
          The IDs of one or more resources to tag.
 java.util.List<Tag> getTags()
          One or more tags.
 int hashCode()
           
 void setResources(java.util.Collection<java.lang.String> resources)
          The IDs of one or more resources to tag.
 void setTags(java.util.Collection<Tag> tags)
          One or more tags.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 CreateTagsRequest withResources(java.util.Collection<java.lang.String> resources)
          The IDs of one or more resources to tag.
 CreateTagsRequest withResources(java.lang.String... resources)
          The IDs of one or more resources to tag.
 CreateTagsRequest withTags(java.util.Collection<Tag> tags)
          One or more tags.
 CreateTagsRequest withTags(Tag... tags)
          One or more tags.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
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(java.util.List<java.lang.String> resources,
                         java.util.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 - The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
tags - One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Method Detail

getResources

public java.util.List<java.lang.String> getResources()
The IDs of one or more resources to tag. For example, ami-1a2b3c4d.

Returns:
The IDs of one or more resources to tag. For example, ami-1a2b3c4d.

setResources

public void setResources(java.util.Collection<java.lang.String> resources)
The IDs of one or more resources to tag. For example, ami-1a2b3c4d.

Parameters:
resources - The IDs of one or more resources to tag. For example, ami-1a2b3c4d.

withResources

public CreateTagsRequest withResources(java.lang.String... resources)
The IDs of one or more resources to tag. For example, ami-1a2b3c4d.

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

Parameters:
resources - The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
Returns:
A reference to this updated object so that method calls can be chained together.

withResources

public CreateTagsRequest withResources(java.util.Collection<java.lang.String> resources)
The IDs of one or more resources to tag. For example, ami-1a2b3c4d.

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

Parameters:
resources - The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
Returns:
A reference to this updated object so that method calls can be chained together.

getTags

public java.util.List<Tag> getTags()
One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

Returns:
One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

setTags

public void setTags(java.util.Collection<Tag> tags)
One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

Parameters:
tags - One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

withTags

public CreateTagsRequest withTags(Tag... tags)
One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

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

Parameters:
tags - One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Returns:
A reference to this updated object so that method calls can be chained together.

withTags

public CreateTagsRequest withTags(java.util.Collection<Tag> tags)
One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

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

Parameters:
tags - One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.
Returns:
A reference to this updated object so that method calls can be chained together.

getDryRunRequest

public Request<CreateTagsRequest> getDryRunRequest()
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.

Specified by:
getDryRunRequest in interface DryRunSupportedRequest<CreateTagsRequest>

toString

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

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


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