Class IntegrationTraitIndex

java.lang.Object
software.amazon.smithy.aws.apigateway.traits.IntegrationTraitIndex
All Implemented Interfaces:
KnowledgeIndex

public final class IntegrationTraitIndex extends Object implements KnowledgeIndex
Computes the API Gateway integration for each operation, resource, and service shape in a model.
  • Constructor Details

    • IntegrationTraitIndex

      public IntegrationTraitIndex(Model model)
  • Method Details

    • of

      public static IntegrationTraitIndex of(Model model)
    • getIntegrationTrait

      public 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> Optional<T> getIntegrationTrait(ToShapeId service, ToShapeId shape, 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.