Class IntegrationTraitIndex
- java.lang.Object
-
- software.amazon.smithy.aws.apigateway.traits.IntegrationTraitIndex
-
- All Implemented Interfaces:
KnowledgeIndex
public final class IntegrationTraitIndex extends java.lang.Object implements KnowledgeIndex
Computes the API Gateway integration for each operation, resource, and service shape in a model.
-
-
Constructor Summary
Constructors Constructor Description IntegrationTraitIndex(Model model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<Trait>
getIntegrationTrait(ToShapeId service, ToShapeId shape)
Get the integration trait for a particular operation, resource, or service bound within a service.<T extends Trait>
java.util.Optional<T>getIntegrationTrait(ToShapeId service, ToShapeId shape, java.lang.Class<T> type)
Get the integration trait for a particular operation, resource, or service bound within a service of a specific type.static IntegrationTraitIndex
of(Model model)
-
-
-
Constructor Detail
-
IntegrationTraitIndex
public IntegrationTraitIndex(Model model)
-
-
Method Detail
-
of
public static IntegrationTraitIndex of(Model model)
-
getIntegrationTrait
public java.util.Optional<Trait> getIntegrationTrait(ToShapeId service, ToShapeId shape)
Get the integration trait for a particular operation, resource, or service bound within a service.- Parameters:
service
- Service shape or ShapeId thereof.shape
- Operation, service, or resource shape in the service. When the service shape ID is provided, the integration trait of the service is returned if present.- Returns:
- The integration trait or an empty optional if none set
-
getIntegrationTrait
public <T extends Trait> java.util.Optional<T> getIntegrationTrait(ToShapeId service, ToShapeId shape, java.lang.Class<T> type)
Get the integration trait for a particular operation, resource, or service bound within a service of a specific type.- Type Parameters:
T
- Type of trait to retrieve.- Parameters:
service
- Service shape or ShapeId thereof.shape
- Operation, service, or resource shape in the service. When the service shape ID is provided, the integration trait of the service is returned if present.type
- Integration trait type.- Returns:
- The integration trait or an empty optional if none set or if not of the expected type.
-
-