Class AwsTagIndex
java.lang.Object
software.amazon.smithy.aws.traits.tagging.AwsTagIndex
- All Implemented Interfaces:
KnowledgeIndex
Index of AWS tagging trait information in a service closure and convenient
access to tag operations by name in service closures.
-
Method Summary
Modifier and TypeMethodDescriptiongetListTagsForResourceOperation
(ShapeId serviceOrResourceId) Gets the ShapeID of the ListTagsForResource operation on the service shape if one is found meeting the criteria.getTagResourceOperation
(ShapeId serviceOrResourceId) Gets the ShapeID of the TagResource operation on the shape if one is found by name.static Optional<MemberShape>
getTagsMember
(Model model, OperationShape tagResourceOperation) Returns the input member that has a name which matches for tags on a TagResource operation.getUntagResourceOperation
(ShapeId serviceOrResourceId) Gets the ShapeID of the UntagResource operation on the shape if one is found meeting the criteria.boolean
isResourceTagOnCreate
(ShapeId resourceId) Checks if the given ShapeID references a resource shape that meets tag on create criteria.boolean
isResourceTagOnUpdate
(ShapeId resourceId) Checks if the given ShapeID references a resource shape that meets tag on update criteria.static AwsTagIndex
boolean
serviceHasTagApis
(ShapeId serviceShapeId) Checks if a given ShapeID references a service shape that meets the criteria for having the three expected service-wide tagging APIs.boolean
Gets the verification result of whether or not the service has a named ListTagsForResource operation that meets the expected critiera for ListTagsForResource.boolean
serviceHasValidTagResourceOperation
(ShapeId serviceId) Gets the verification result of whether or not the service has a named TagResource operation that meets the expected critiera for TagResource.boolean
serviceHasValidUntagResourceOperation
(ShapeId serviceId) Gets the verification result of whether or not the service has a named UntagResource operation that meets the expected critiera for UntagResource.
-
Method Details
-
of
-
isResourceTagOnCreate
Checks if the given ShapeID references a resource shape that meets tag on create criteria. If the given ShapeID does not reference a resource shape, will always return false. Tag on create is satisfied when a resource shape has a property representing tags via the , and that property is an input on the resource's create lifecycle operation.- Parameters:
resourceId
- ShapeID of the resource to check.- Returns:
- true iff the resourceId references a resource shape that has tag-on create behavior.
-
isResourceTagOnUpdate
Checks if the given ShapeID references a resource shape that meets tag on update criteria. If the given ShapeID does not reference to a resource shape, will always return false. Tag on update is satisfied when a resource shape has a property representing tags via the , and that property is an input on the resource's create lifecycle operation.- Parameters:
resourceId
- ShapeID of the resource to check.- Returns:
- true iff the resourceId references a resource shape that has tag-on update behavior.
-
serviceHasTagApis
Checks if a given ShapeID references a service shape that meets the criteria for having the three expected service-wide tagging APIs.- Parameters:
serviceShapeId
- ShapeID of the shape to check.- Returns:
- true iff the serviceShapeId references a service shape that has the necessary tagging APIs.
-
getTagResourceOperation
Gets the ShapeID of the TagResource operation on the shape if one is found by name. If a resource ID is passed in, it will return the qualifiying service wide TagResource operation ID rather than the operation ID specified by the tagApi property.- Parameters:
serviceOrResourceId
- ShapeID of the service shape to retrieve the qualifying TagResource operation for.- Returns:
- The ShapeID of a qualifying TagResource operation if one is found. Returns an empty optional otherwise.
-
getUntagResourceOperation
Gets the ShapeID of the UntagResource operation on the shape if one is found meeting the criteria. If a resource ID is passed in, it will return the qualifiying service wide TagResource operation ID rather than the operation ID specified by the tagApi property.- Parameters:
serviceOrResourceId
- ShapeID of the service shape to retrieve the qualifying UntagResource operation for.- Returns:
- The ShapeID of a qualifying UntagResource operation if one is found. Returns an empty optional otherwise.
-
getListTagsForResourceOperation
Gets the ShapeID of the ListTagsForResource operation on the service shape if one is found meeting the criteria. If a resource ID is passed in, it will return the qualifiying service wide TagResource operation ID rather than the operation ID specified by the tagApi property.- Parameters:
serviceOrResourceId
- ShapeID of the service shape to retrieve the qualifying ListTagsForResource operation for.- Returns:
- The ShapeID of a qualifying ListTagsForResource operation if one is found. Returns an empty optional otherwise.
-
serviceHasValidTagResourceOperation
Gets the verification result of whether or not the service has a named TagResource operation that meets the expected critiera for TagResource.- Parameters:
serviceId
- the ShapeID of the service shape the TagResource operation should be bound to.- Returns:
- True iff the service shape has a service bound operation named 'TagResource' that also satisfies the criteria for a valid TagResource operation.
-
serviceHasValidUntagResourceOperation
Gets the verification result of whether or not the service has a named UntagResource operation that meets the expected critiera for UntagResource.- Parameters:
serviceId
- the ShapeID of the service shape the UntagResource operation should be bound to.- Returns:
- True iff the service shape has a service bound operation named 'UntagResource' that also satisfies the criteria for a valid UntagResource operation.
-
serviceHasValidListTagsForResourceOperation
Gets the verification result of whether or not the service has a named ListTagsForResource operation that meets the expected critiera for ListTagsForResource.- Parameters:
serviceId
- the ShapeID of the service shape the ListTagsForResource operation should be bound to.- Returns:
- True iff the service shape has a service bound operation named 'ListTagsForResource' that also satisfies the criteria for a valid ListTagsForResource operation.
-
getTagsMember
Returns the input member that has a name which matches for tags on a TagResource operation. Note: This is more of a utility method needed to expose limited access to an internal method.- Parameters:
model
- Smithy model to follow member references from the provided operation shape.tagResourceOperation
- TagResource operation object to scan the input members of.- Returns:
- the matching input member if present. otherwise.
-