/
block_plan_modification.go
47 lines (38 loc) · 1.55 KB
/
block_plan_modification.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package fwxschema
import (
"github.com/hashicorp/terraform-plugin-framework/internal/fwschema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
)
// BlockWithPlanModifiers is an optional interface on Block which enables
// plan modification support.
type BlockWithPlanModifiers interface {
// Implementations should include the fwschema.Block interface methods
// for proper block handling.
fwschema.Block
// GetPlanModifiers should return a list of attribute-based plan modifiers.
// This is named differently than PlanModifiers to prevent a conflict with
// the tfsdk.Block field name.
GetPlanModifiers() tfsdk.AttributePlanModifiers
}
// BlockWithListPlanModifiers is an optional interface on Block which
// enables List plan modifier support.
type BlockWithListPlanModifiers interface {
fwschema.Block
// ListPlanModifiers should return a list of List plan modifiers.
ListPlanModifiers() []planmodifier.List
}
// BlockWithObjectPlanModifiers is an optional interface on Block which
// enables Object plan modifier support.
type BlockWithObjectPlanModifiers interface {
fwschema.Block
// ObjectPlanModifiers should return a list of Object plan modifiers.
ObjectPlanModifiers() []planmodifier.Object
}
// BlockWithSetPlanModifiers is an optional interface on Block which
// enables Set plan modifier support.
type BlockWithSetPlanModifiers interface {
fwschema.Block
// SetPlanModifiers should return a list of Set plan modifiers.
SetPlanModifiers() []planmodifier.Set
}