public class CreateTagsRequest extends AmazonWebServiceRequest implements java.io.Serializable, 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 .
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public CreateTagsRequest()
public CreateTagsRequest(java.util.List<java.lang.String> resources, java.util.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 java.util.List<java.lang.String> getResources()
public void setResources(java.util.Collection<java.lang.String> resources)
resources
- The IDs of one or more resources to tag. For example, ami-1a2b3c4d.public CreateTagsRequest withResources(java.lang.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 CreateTagsRequest withResources(java.util.Collection<java.lang.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 java.util.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(java.util.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.
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(java.util.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 java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.