Class IntegrationTraitIndex
- java.lang.Object
-
- software.amazon.smithy.aws.traits.apigateway.IntegrationTraitIndex
-
- All Implemented Interfaces:
software.amazon.smithy.model.knowledge.KnowledgeIndex
public class IntegrationTraitIndex extends java.lang.Object implements software.amazon.smithy.model.knowledge.KnowledgeIndex
Computes the API Gateway integration for each operation, resource, and service shape in a model.
-
-
Constructor Summary
Constructors Constructor Description IntegrationTraitIndex(software.amazon.smithy.model.Model model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<software.amazon.smithy.model.traits.Trait>
getIntegrationTrait(software.amazon.smithy.model.shapes.ToShapeId service, software.amazon.smithy.model.shapes.ToShapeId shape)
Get the integration trait for a particular operation, resource, or service bound within a service.<T extends software.amazon.smithy.model.traits.Trait>
java.util.Optional<T>getIntegrationTrait(software.amazon.smithy.model.shapes.ToShapeId service, software.amazon.smithy.model.shapes.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.
-
-
-
Method Detail
-
getIntegrationTrait
public java.util.Optional<software.amazon.smithy.model.traits.Trait> getIntegrationTrait(software.amazon.smithy.model.shapes.ToShapeId service, software.amazon.smithy.model.shapes.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 software.amazon.smithy.model.traits.Trait> java.util.Optional<T> getIntegrationTrait(software.amazon.smithy.model.shapes.ToShapeId service, software.amazon.smithy.model.shapes.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.
-
-