Class ContextIndex
- java.lang.Object
-
- software.amazon.smithy.rulesengine.traits.ContextIndex
-
- All Implemented Interfaces:
KnowledgeIndex
public final class ContextIndex extends java.lang.Object implements KnowledgeIndex
Resolves an indexes the context parameters in the model.
-
-
Constructor Summary
Constructors Constructor Description ContextIndex(Model model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ClientContextParamsTrait>
getClientContextParams(Shape service)
Gets the mapping of context parameter names and correspondingClientContextParamDefinition
to be generated on the service client's configuration.java.util.Map<MemberShape,ContextParamTrait>
getContextParams(Shape operation)
Gets the mapping ofMemberShape
toContextParamTrait
for the operation.java.util.Optional<OperationContextParamsTrait>
getOperationContextParams(Shape operation)
Gets the operation context parameter names and theirOperationContextParamDefinition
for the given operation.java.util.Optional<StaticContextParamsTrait>
getStaticContextParams(Shape operation)
Gets the static context parameter names and theirStaticContextParamDefinition
to be set for the given operation.static ContextIndex
of(Model model)
-
-
-
Constructor Detail
-
ContextIndex
public ContextIndex(Model model)
-
-
Method Detail
-
of
public static ContextIndex of(Model model)
-
getClientContextParams
public java.util.Optional<ClientContextParamsTrait> getClientContextParams(Shape service)
Gets the mapping of context parameter names and correspondingClientContextParamDefinition
to be generated on the service client's configuration.- Parameters:
service
- The service shape.- Returns:
- The mapping of context parameter names to
ClientContextParamDefinition
.
-
getStaticContextParams
public java.util.Optional<StaticContextParamsTrait> getStaticContextParams(Shape operation)
Gets the static context parameter names and theirStaticContextParamDefinition
to be set for the given operation.- Parameters:
operation
- The operation shape.- Returns:
- The mapping of context parameter names to the static
Node
value to be set.
-
getOperationContextParams
public java.util.Optional<OperationContextParamsTrait> getOperationContextParams(Shape operation)
Gets the operation context parameter names and theirOperationContextParamDefinition
for the given operation.- Parameters:
operation
- The operation shape.- Returns:
- The mapping of context parameter names to the JMESPath expression to bind to input elements.
-
getContextParams
public java.util.Map<MemberShape,ContextParamTrait> getContextParams(Shape operation)
Gets the mapping ofMemberShape
toContextParamTrait
for the operation.- Parameters:
operation
- The operation shape.- Returns:
- The mapping of operation's
MemberShape
toContextParamTrait
.
-
-