public class CreateTagsRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest<CreateTagsRequest>
CreateTags operation
.
Adds or overwrites one or more tags for the specified Amazon 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 . For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide .
NOOP
Constructor and Description |
---|
CreateTagsRequest()
Default constructor for a new CreateTagsRequest object.
|
CreateTagsRequest(List<String> resources,
List<Tag> tags)
Constructs a new CreateTagsRequest object.
|
Modifier and Type | Method and Description |
---|---|
CreateTagsRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
Request<CreateTagsRequest> |
getDryRunRequest()
This method is intended for internal use only.
|
List<String> |
getResources()
The IDs of one or more resources to tag.
|
List<Tag> |
getTags()
One or more tags.
|
int |
hashCode() |
void |
setResources(Collection<String> resources)
The IDs of one or more resources to tag.
|
void |
setTags(Collection<Tag> tags)
One or more tags.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
CreateTagsRequest |
withResources(Collection<String> resources)
The IDs of one or more resources to tag.
|
CreateTagsRequest |
withResources(String... resources)
The IDs of one or more resources to tag.
|
CreateTagsRequest |
withTags(Collection<Tag> tags)
One or more tags.
|
CreateTagsRequest |
withTags(Tag... tags)
One or more tags.
|
getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
public CreateTagsRequest()
public CreateTagsRequest(List<String> resources, List<Tag> tags)
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.public List<String> getResources()
public void setResources(Collection<String> resources)
resources
- The IDs of one or more resources to tag. For example, ami-1a2b3c4d.public CreateTagsRequest withResources(String... resources)
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.
resources
- The IDs of one or more resources to tag. For example, ami-1a2b3c4d.public CreateTagsRequest withResources(Collection<String> resources)
Returns a reference to this object so that method calls can be chained together.
resources
- The IDs of one or more resources to tag. For example, ami-1a2b3c4d.public List<Tag> getTags()
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.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.public void setTags(Collection<Tag> tags)
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.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.public CreateTagsRequest withTags(Tag... tags)
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.
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.
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.public CreateTagsRequest withTags(Collection<Tag> tags)
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.
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.public Request<CreateTagsRequest> getDryRunRequest()
getDryRunRequest
in interface DryRunSupportedRequest<CreateTagsRequest>
public String toString()
toString
in class Object
Object.toString()
public CreateTagsRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.