@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getResourceName() == null) ? 0 : getResourceName().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
/** * <p> * The Amazon Resource Name (ARN) of the resource to which the tags are to be added, for example * <code>arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster</code> or * <code>arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot</code>. ElastiCache resources are * <i>cluster</i> and <i>snapshot</i>. * </p> * <p> * For more information about ARNs, see <a * href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and * AWS Service Namespaces</a>. * </p> * * @param resourceName * The Amazon Resource Name (ARN) of the resource to which the tags are to be added, for example * <code>arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster</code> or * <code>arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot</code>. ElastiCache resources are * <i>cluster</i> and <i>snapshot</i>.</p> * <p> * For more information about ARNs, see <a * href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names * (ARNs) and AWS Service Namespaces</a>. * @return Returns a reference to this object so that method calls can be chained together. */ public AddTagsToResourceRequest withResourceName(String resourceName) { setResourceName(resourceName); return this; }
/** * <p> * A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be * accompanied by a tag value. * </p> * * @param tags * A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be * accompanied by a tag value. * @return Returns a reference to this object so that method calls can be chained together. */ public AddTagsToResourceRequest withTags(java.util.Collection<Tag> tags) { setTags(tags); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AddTagsToResourceRequest == false) return false; AddTagsToResourceRequest other = (AddTagsToResourceRequest) obj; if (other.getResourceName() == null ^ this.getResourceName() == null) return false; if (other.getResourceName() != null && other.getResourceName().equals(this.getResourceName()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; }
/** * <p> * A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be * accompanied by a tag value. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. * </p> * * @param tags * A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be * accompanied by a tag value. * @return Returns a reference to this object so that method calls can be chained together. */ public AddTagsToResourceRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList<Tag>(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; }
/** * <p> * The Amazon Resource Name (ARN) of the resource to which the tags are to be added, for example * <code>arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster</code> or * <code>arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot</code>. ElastiCache resources are * <i>cluster</i> and <i>snapshot</i>. * </p> * <p> * For more information about ARNs, see <a * href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and * AWS Service Namespaces</a>. * </p> * * @param resourceName * The Amazon Resource Name (ARN) of the resource to which the tags are to be added, for example * <code>arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster</code> or * <code>arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot</code>. ElastiCache resources are * <i>cluster</i> and <i>snapshot</i>.</p> * <p> * For more information about ARNs, see <a * href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names * (ARNs) and AWS Service Namespaces</a>. * @return Returns a reference to this object so that method calls can be chained together. */ public AddTagsToResourceRequest withResourceName(String resourceName) { setResourceName(resourceName); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getResourceName() != null) sb.append("ResourceName: ").append(getResourceName()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); }
/** * <p> * A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be * accompanied by a tag value. * </p> * * @param tags * A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be * accompanied by a tag value. * @return Returns a reference to this object so that method calls can be chained together. */ public AddTagsToResourceRequest withTags(java.util.Collection<Tag> tags) { setTags(tags); return this; }
public Request<AddTagsToResourceRequest> marshall(AddTagsToResourceRequest addTagsToResourceRequest) { if (addTagsToResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<AddTagsToResourceRequest> request = new DefaultRequest<AddTagsToResourceRequest>(addTagsToResourceRequest, "AmazonElastiCache"); request.addParameter("Action", "AddTagsToResource"); request.addParameter("Version", "2015-02-02"); request.setHttpMethod(HttpMethodName.POST); if (addTagsToResourceRequest.getResourceName() != null) { request.addParameter("ResourceName", StringUtils.fromString(addTagsToResourceRequest.getResourceName())); } if (!addTagsToResourceRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) addTagsToResourceRequest.getTags()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<Tag>) addTagsToResourceRequest.getTags(); int tagsListIndex = 1; for (Tag tagsListValue : tagsList) { if (tagsListValue.getKey() != null) { request.addParameter("Tags.Tag." + tagsListIndex + ".Key", StringUtils.fromString(tagsListValue.getKey())); } if (tagsListValue.getValue() != null) { request.addParameter("Tags.Tag." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue())); } tagsListIndex++; } } return request; }
/** * <p> * A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be * accompanied by a tag value. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. * </p> * * @param tags * A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be * accompanied by a tag value. * @return Returns a reference to this object so that method calls can be chained together. */ public AddTagsToResourceRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList<Tag>(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getResourceName() == null) ? 0 : getResourceName().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AddTagsToResourceRequest == false) return false; AddTagsToResourceRequest other = (AddTagsToResourceRequest) obj; if (other.getResourceName() == null ^ this.getResourceName() == null) return false; if (other.getResourceName() != null && other.getResourceName().equals(this.getResourceName()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getResourceName() != null) sb.append("ResourceName: ").append(getResourceName()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); }
public Request<AddTagsToResourceRequest> marshall(AddTagsToResourceRequest addTagsToResourceRequest) { if (addTagsToResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<AddTagsToResourceRequest> request = new DefaultRequest<AddTagsToResourceRequest>(addTagsToResourceRequest, "AmazonElastiCache"); request.addParameter("Action", "AddTagsToResource"); request.addParameter("Version", "2015-02-02"); request.setHttpMethod(HttpMethodName.POST); if (addTagsToResourceRequest.getResourceName() != null) { request.addParameter("ResourceName", StringUtils.fromString(addTagsToResourceRequest.getResourceName())); } if (!addTagsToResourceRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) addTagsToResourceRequest.getTags()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<Tag>) addTagsToResourceRequest.getTags(); int tagsListIndex = 1; for (Tag tagsListValue : tagsList) { if (tagsListValue.getKey() != null) { request.addParameter("Tags.Tag." + tagsListIndex + ".Key", StringUtils.fromString(tagsListValue.getKey())); } if (tagsListValue.getValue() != null) { request.addParameter("Tags.Tag." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue())); } tagsListIndex++; } } return request; }