Class ResourceLifecycleIndex
java.lang.Object
software.amazon.smithy.model.knowledge.ResourceLifecycleIndex
- All Implemented Interfaces:
KnowledgeIndex
Index that provides efficient lookups for resource lifecycle relationships
declared via
@createsResources, @deletesResources,
@putsResources, @readsResources, and @updatesResources.
This index enables two primary query patterns:
- Given an operation, what resources does it affect (by lifecycle type)?
- Given a resource, what operations affect it (by lifecycle type)?
This index only covers relationships declared via the lifecycle traits.
It does not include the standard 1:1Lifecycle bindings on resource shapes
(create, put, read, update, delete). Use BottomUpIndex or
ResourceShape directly for those.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe lifecycle effect an operation has on a resource. -
Method Summary
Modifier and TypeMethodDescriptiongetOperations(ToShapeId resource) Gets all operations that affect a resource across all lifecycle types.getOperations(ToShapeId resource, ResourceLifecycleIndex.Lifecycle lifecycle) Gets the operations that affect a resource for a specific lifecycle type.getResources(ToShapeId operation) Gets all resources affected by an operation across all lifecycle types.getResources(ToShapeId operation, ResourceLifecycleIndex.Lifecycle lifecycle) Gets the resources affected by an operation for a specific lifecycle type.static ResourceLifecycleIndex
-
Method Details
-
of
-
getResources
Gets the resources affected by an operation for a specific lifecycle type.- Parameters:
operation- The operation to query.lifecycle- The lifecycle type to filter by.- Returns:
- The set of resource shape IDs, or empty if none.
-
getResources
Gets all resources affected by an operation across all lifecycle types.- Parameters:
operation- The operation to query.- Returns:
- A map of lifecycle type to the set of affected resource shape IDs.
-
getOperations
Gets the operations that affect a resource for a specific lifecycle type.- Parameters:
resource- The resource to query.lifecycle- The lifecycle type to filter by.- Returns:
- The set of operation shape IDs, or empty if none.
-
getOperations
Gets all operations that affect a resource across all lifecycle types.- Parameters:
resource- The resource to query.- Returns:
- A map of lifecycle type to the set of operation shape IDs.
-