Class CleanEndpointRuleSetParameters
java.lang.Object
software.amazon.smithy.rulesengine.traits.CleanEndpointRuleSetParameters
- All Implemented Interfaces:
ModelTransformerPlugin
Removes orphaned endpoint ruleset parameters and their associated rules from a service's
@endpointRuleSet trait when operations are removed from the model.
When operations are removed via ModelTransformer.filterShapes(software.amazon.smithy.model.Model, java.util.function.Predicate<software.amazon.smithy.model.shapes.Shape>) or
ModelTransformer.removeShapes(software.amazon.smithy.model.Model, java.util.Collection<? extends software.amazon.smithy.model.shapes.Shape>), parameters that were only bound through
the removed operations' @staticContextParams, @operationContextParams,
or @contextParam traits may become orphaned. To prevent validation failures, this plugin
removes those orphaned parameters and prunes any rules that reference them, recompiles the
@endpointBdd trait from the cleaned ruleset, and drops @endpointTests cases that
reference them.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiononRemove(ModelTransformer transformer, Collection<Shape> removed, Model model) The method that is invoked each time shapes are removed from a model.
-
Constructor Details
-
CleanEndpointRuleSetParameters
public CleanEndpointRuleSetParameters()
-
-
Method Details
-
onRemove
Description copied from interface:ModelTransformerPluginThe method that is invoked each time shapes are removed from a model.- Specified by:
onRemovein interfaceModelTransformerPlugin- Parameters:
transformer- Transformer used to replace/remove shapes from the model.removed- The of shapes that were removed from themodel.model- Model that has been altered to removeremoved.- Returns:
- Returns a transformed version of the passed in model.
-