Refine search
public Request<CreateTagsRequest> marshall(CreateTagsRequest createTagsRequest) { throw new SdkClientException("Invalid argument passed to marshall(...)"); request.addParameter("Action", "CreateTags"); request.addParameter("Version", "2016-11-15"); request.setHttpMethod(HttpMethodName.POST); if (!createTagsRequestResourcesList.isEmpty() || !createTagsRequestResourcesList.isAutoConstruct()) { int resourcesListIndex = 1; request.addParameter("ResourceId." + resourcesListIndex, StringUtils.fromString(createTagsRequestResourcesListValue)); if (!createTagsRequestTagsList.isEmpty() || !createTagsRequestTagsList.isAutoConstruct()) { int tagsListIndex = 1; if (createTagsRequestTagsListValue.getKey() != null) { request.addParameter("Tag." + tagsListIndex + ".Key", StringUtils.fromString(createTagsRequestTagsListValue.getKey())); if (createTagsRequestTagsListValue.getValue() != null) { request.addParameter("Tag." + tagsListIndex + ".Value", StringUtils.fromString(createTagsRequestTagsListValue.getValue()));
public Tag unmarshall(StaxUnmarshallerContext context) throws Exception { Tag tag = new Tag(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return tag; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("key", targetDepth)) { tag.setKey(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("value", targetDepth)) { tag.setValue(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return tag; } } } }
/** * Constructs a new Tag object. Callers should use the setter or fluent setter (with...) methods to initialize any * additional object members. * * @param key * The key of the tag.</p> * <p> * Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin * with <code>aws:</code>. * @param value * The value of the tag. * </p> * <p> * Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters. */ public Tag(String key, String value) { setKey(key); setValue(value); }
request.addParameter("Action", "DeleteTags"); request.addParameter("Version", "2015-10-01"); request.addParameter("ResourceId." + resourcesListIndex, StringUtils.fromString(resourcesListValue)); Tag tagMember = tagsListValue; if (tagMember != null) { if (tagMember.getKey() != null) { request.addParameter("Tag." + tagsListIndex + ".Key", StringUtils.fromString(tagMember.getKey())); if (tagMember.getValue() != null) { request.addParameter("Tag." + tagsListIndex + ".Value", StringUtils.fromString(tagMember.getValue()));
protected Optional<Tag> getTag(List<Tag> tags, String key) { for (Tag tag : tags) { if (tag.getKey().equals(key)) { return Optional.of(tag); } } return absent(); }
String name = null; if( instance.getTags().size() > 0 ) name = instance.getTags().get(0).getValue(); if( NAME.equals(name) ) instances.add(instance);
/** * Constructs a new Tag object. Callers should use the setter or fluent setter (with...) methods to initialize any * additional object members. * * @param key * The key of the tag.</p> * <p> * Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin * with <code>aws:</code>. */ public Tag(String key) { setKey(key); }
/** * <p> * The value of the tag. * </p> * <p> * Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters. * </p> * * @param value * The value of the tag.</p> * <p> * Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters. * @return Returns a reference to this object so that method calls can be chained together. */ public Tag withValue(String value) { setValue(value); return this; }
request.addParameter("Action", "CreateTags"); request.addParameter("Version", "2015-10-01"); request.addParameter("ResourceId." + resourcesListIndex, StringUtils.fromString(resourcesListValue)); Tag tagMember = tagsListValue; if (tagMember != null) { if (tagMember.getKey() != null) { request.addParameter("Tag." + tagsListIndex + ".Key", StringUtils.fromString(tagMember.getKey())); if (tagMember.getValue() != null) { request.addParameter("Tag." + tagsListIndex + ".Value", StringUtils.fromString(tagMember.getValue()));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Tag == false) return false; Tag other = (Tag) obj; if (other.getKey() == null ^ this.getKey() == null) return false; if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; if (other.getValue() == null ^ this.getValue() == null) return false; if (other.getValue() != null && other.getValue().equals(this.getValue()) == false) return false; return true; }
public static Tag getAwsTag(Instance awsInstance, String tagName) { List<Tag> tags = awsInstance.getTags(); java.util.Optional<Tag> tag = tags.stream().filter(t -> StringUtils.equals(t.getKey(), tagName)).findFirst(); return tag.isPresent() ? tag.get() : null; } }
/** * Constructs a new Tag object. * Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param key The key of the tag. <p>Constraints: Tag keys are * case-sensitive and accept a maximum of 127 Unicode characters. May not * begin with <code>aws:</code> * @param value The value of the tag. <p>Constraints: Tag values are * case-sensitive and accept a maximum of 255 Unicode characters. */ public Tag(String key, String value) { setKey(key); setValue(value); }
/** * <p> * The key of the tag. * </p> * <p> * Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with * <code>aws:</code>. * </p> * * @param key * The key of the tag.</p> * <p> * Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin * with <code>aws:</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public Tag withKey(String key) { setKey(key); return this; }
/** * <p> * The value of the tag. * </p> * <p> * Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters. * </p> * * @param value * The value of the tag.</p> * <p> * Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters. * @return Returns a reference to this object so that method calls can be chained together. */ public Tag withValue(String value) { setValue(value); return this; }
public Request<DeleteTagsRequest> marshall(DeleteTagsRequest deleteTagsRequest) { throw new SdkClientException("Invalid argument passed to marshall(...)"); request.addParameter("Action", "DeleteTags"); request.addParameter("Version", "2016-11-15"); request.setHttpMethod(HttpMethodName.POST); if (!deleteTagsRequestResourcesList.isEmpty() || !deleteTagsRequestResourcesList.isAutoConstruct()) { int resourcesListIndex = 1; request.addParameter("ResourceId." + resourcesListIndex, StringUtils.fromString(deleteTagsRequestResourcesListValue)); if (!deleteTagsRequestTagsList.isEmpty() || !deleteTagsRequestTagsList.isAutoConstruct()) { int tagsListIndex = 1; if (deleteTagsRequestTagsListValue.getKey() != null) { request.addParameter("Tag." + tagsListIndex + ".Key", StringUtils.fromString(deleteTagsRequestTagsListValue.getKey())); if (deleteTagsRequestTagsListValue.getValue() != null) { request.addParameter("Tag." + tagsListIndex + ".Value", StringUtils.fromString(deleteTagsRequestTagsListValue.getValue()));
/** * 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 (getKey() != null) sb.append("Key: ").append(getKey()).append(","); if (getValue() != null) sb.append("Value: ").append(getValue()); sb.append("}"); return sb.toString(); }
if( !tagsDone ) { CreateTagsRequest createTagsRequest = new CreateTagsRequest(); createTagsRequest.withResources(ids).withTags(new Tag("Name", NAME)); ec2.createTags(createTagsRequest); tagsDone = true;