@@ -49,3 +49,33 @@ type ActionWithModifyPlan interface {
4949 // diagnostics to practitioners, such as validation errors.
5050 ModifyPlan (context.Context , ModifyPlanRequest , * ModifyPlanResponse )
5151}
52+
53+ // ActionWithConfigValidators is an interface type that extends Action to include declarative validations.
54+ //
55+ // Declaring validation using this methodology simplifies implementation of
56+ // reusable functionality. These also include descriptions, which can be used
57+ // for automating documentation.
58+ //
59+ // Validation will include ConfigValidators and ValidateConfig, if both are
60+ // implemented, in addition to any Attribute or Type validation.
61+ type ActionWithConfigValidators interface {
62+ Action
63+
64+ // ConfigValidators returns a list of functions which will all be performed during validation.
65+ ConfigValidators (context.Context ) []ConfigValidator
66+ }
67+
68+ // ActionWithValidateConfig is an interface type that extends Action to include imperative validation.
69+ //
70+ // Declaring validation using this methodology simplifies one-off
71+ // functionality that typically applies to a single action. Any documentation
72+ // of this functionality must be manually added into schema descriptions.
73+ //
74+ // Validation will include ConfigValidators and ValidateConfig, if both are
75+ // implemented, in addition to any Attribute or Type validation.
76+ type ActionWithValidateConfig interface {
77+ Action
78+
79+ // ValidateConfig performs the validation.
80+ ValidateConfig (context.Context , ValidateConfigRequest , * ValidateConfigResponse )
81+ }
0 commit comments