Class PropertyBindingIndex

java.lang.Object
software.amazon.smithy.model.knowledge.PropertyBindingIndex
All Implemented Interfaces:
KnowledgeIndex

public final class PropertyBindingIndex extends Object implements KnowledgeIndex
Index of member shape to associated resource property information.
  • Method Details

    • of

      public static PropertyBindingIndex of(Model model)
    • getPropertyName

      public Optional<String> getPropertyName(ShapeId memberShapeId)
      Gets the property name for a given member shape. Returns empty optional if the member shape does not correspond to a property.
      Parameters:
      memberShapeId - the ShapeId of the member shape to get the property name for.
      Returns:
      the property name for a given member shape if there is one.
    • isMemberShapeProperty

      public boolean isMemberShapeProperty(MemberShape memberShape)
      Returns true if a member shape positively maps to a property. will return a non-empty Optional if this method returns true.
      Parameters:
      memberShape - the member shape to check
      Returns:
      true if member shape maps to a property on the given resource
    • getOutputPropertiesShape

      public StructureShape getOutputPropertiesShape(OperationShape operation)
      Resolves and returns the output shape of an operation that contains the top-level resource bound properties. Handles adjustments made with
      Parameters:
      operation - operation to retrieve output properties shape for.
      Returns:
      the output shape of an operation that contains top-level resource properties.
    • getInputPropertiesShape

      public StructureShape getInputPropertiesShape(OperationShape operation)
      Resolves and returns the input shape of an operation that contains the top-level resource bound properties. Handles adjustments made with
      Parameters:
      operation - operation to retrieve output properties shape for
      Returns:
      the input shape of an operation that contains top-level resource properties.
    • doesMemberShapeRequireProperty

      public boolean doesMemberShapeRequireProperty(MemberShape memberShape)
      Returns true if member is required to have an associated property mapping.
      Parameters:
      memberShape - the member shape to check
      Returns:
      True if input/output member is required to have a property mapping.