public UpdateTagDetails build() { UpdateTagDetails __instance__ = new UpdateTagDetails( description, isRetired, freeformTags, definedTags, isCostTracking); __instance__.__explicitlySet__.addAll(__explicitlySet__); return __instance__; }
@com.fasterxml.jackson.annotation.JsonIgnore public Builder copy(UpdateTagDetails o) { Builder copiedBuilder = description(o.getDescription()) .isRetired(o.getIsRetired()) .freeformTags(o.getFreeformTags()) .definedTags(o.getDefinedTags()) .isCostTracking(o.getIsCostTracking()); copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); return copiedBuilder; } }
public static Tag updateTag( Identity client, String tagNamespaceId, String name, String description, boolean isCostTrackingTag) { UpdateTagDetails updateTagDetails = UpdateTagDetails.builder() .isCostTracking(isCostTrackingTag) .description(description) .build(); try { Tag tag = client.updateTag( UpdateTagRequest.builder() .tagName(name) .tagNamespaceId(tagNamespaceId) .updateTagDetails(updateTagDetails) .build()) .getTag(); if (tag == null) { throw new RuntimeException("Tag update fails with " + updateTagDetails.toString()); } System.out.println("Tag" + tag + " updated successfully"); return tag; } catch (Exception ex) { throw new RuntimeException("Tag update fails with error:" + ex.getMessage()); } }
.tagName(tagOneName) .updateTagDetails( UpdateTagDetails.builder().isRetired(true).build()) .build()); System.out.printf("Updated tag (retired): %s\n", updateTagOneResponse.getTag()); .tagName(tagOneName) .updateTagDetails( UpdateTagDetails.builder().isRetired(false).build()) .build()); System.out.println("Updated tag (reactivated): " + updateTagOneResponse.getTag());