Class PropertyBindingIndex
java.lang.Object
software.amazon.smithy.model.knowledge.PropertyBindingIndex
- All Implemented Interfaces:
KnowledgeIndex
Index of member shape to associated resource property information.
-
Method Summary
Modifier and TypeMethodDescriptionbooleandoesMemberShapeRequireProperty(MemberShape memberShape) Returns true if member is required to have an associated property mapping.getInputPropertiesShape(OperationShape operation) Resolves and returns the input shape of an operation that contains the top-level resource bound properties.getOperationInputElementProperties(ToShapeId resource, ToShapeId operation) Gets a map of element member names to resource property names for the element structure of a collection-bound operation's input.getOperationInputElementShape(ToShapeId resource, ToShapeId operation) Gets the element structure of a collection-bound operation's input that carries per-instance resource state, resolved through the input member marked with the@nestedPropertiestrait.getOperationOutputElementProperties(ToShapeId resource, ToShapeId operation) Gets a map of element member names to resource property names for the element structure of a collection-bound operation's output.getOperationOutputElementShape(ToShapeId resource, ToShapeId operation) Gets the element structure of a collection-bound operation's output that carries per-instance resource state.getOutputPropertiesShape(OperationShape operation) Resolves and returns the output shape of an operation that contains the top-level resource bound properties.getPropertyName(ShapeId memberShapeId) Gets the property name for a given member shape.booleanisMemberShapeProperty(MemberShape memberShape) Returns true if a member shape positively maps to a property.booleanisNotPropertyMember(MemberShape memberShape) Returns true if the member is excluded from resource property binding by the@notPropertytrait or by a trait marked with it.booleanisOperationOutputElementExplicit(ToShapeId resource, ToShapeId operation) Returns true if the output element structure of the operation was explicitly marked with the@nestedPropertiestrait rather than automatically detected.static PropertyBindingIndex
-
Method Details
-
of
-
getOperationOutputElementShape
Gets the element structure of a collection-bound operation's output that carries per-instance resource state.The element structure is the structure targeted by the members of the list targeted by the output member marked with the
@nestedPropertiestrait, or, for thelistlifecycle without that trait, by a single unambiguous list-of-structures output member.- Parameters:
resource- Shape ID of a resource.operation- Shape ID of an operation.- Returns:
- the element structure ID of the operation's output, if any.
-
getOperationInputElementShape
Gets the element structure of a collection-bound operation's input that carries per-instance resource state, resolved through the input member marked with the@nestedPropertiestrait.- Parameters:
resource- Shape ID of a resource.operation- Shape ID of an operation.- Returns:
- the element structure ID of the operation's input, if any.
-
isOperationOutputElementExplicit
Returns true if the output element structure of the operation was explicitly marked with the@nestedPropertiestrait rather than automatically detected.- Parameters:
resource- Shape ID of a resource.operation- Shape ID of an operation.- Returns:
- true if the output element binding is explicit.
-
getOperationOutputElementProperties
public Map<String,String> getOperationOutputElementProperties(ToShapeId resource, ToShapeId operation) Gets a map of element member names to resource property names for the element structure of a collection-bound operation's output.- Parameters:
resource- Shape ID of a resource.operation- Shape ID of an operation.- Returns:
- the member name to property name map, or an empty map.
-
getOperationInputElementProperties
public Map<String,String> getOperationInputElementProperties(ToShapeId resource, ToShapeId operation) Gets a map of element member names to resource property names for the element structure of a collection-bound operation's input.- Parameters:
resource- Shape ID of a resource.operation- Shape ID of an operation.- Returns:
- the member name to property name map, or an empty map.
-
getPropertyName
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
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
Resolves and returns the output shape of an operation that contains the top-level resource bound properties. Handles adjustments made with@nestedPropertiestrait.- Parameters:
operation- operation to retrieve output properties shape for.- Returns:
- the output shape of an operation that contains top-level resource properties.
-
getInputPropertiesShape
Resolves and returns the input shape of an operation that contains the top-level resource bound properties. Handles adjustments made with@nestedPropertiestrait.- Parameters:
operation- operation to retrieve output properties shape for- Returns:
- the input shape of an operation that contains top-level resource properties.
-
doesMemberShapeRequireProperty
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.
-
isNotPropertyMember
Returns true if the member is excluded from resource property binding by the@notPropertytrait or by a trait marked with it.- Parameters:
memberShape- the member shape to check- Returns:
- true if the member is explicitly excluded from property binding.
-