/
attribute_plan_modification.go
101 lines (80 loc) · 3.41 KB
/
attribute_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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"
)
// AttributeWithPlanModifiers is an optional interface on Attribute which enables
// plan modification support.
type AttributeWithPlanModifiers interface {
// Implementations should include the fwschema.Attribute interface methods
// for proper attribute handling.
fwschema.Attribute
// GetPlanModifiers should return a list of attribute-based plan modifiers.
// This is named differently than PlanModifiers to prevent a conflict with
// the tfsdk.Attribute field name.
GetPlanModifiers() tfsdk.AttributePlanModifiers
}
// AttributeWithBoolPlanModifiers is an optional interface on Attribute which
// enables Bool plan modifier support.
type AttributeWithBoolPlanModifiers interface {
fwschema.Attribute
// BoolPlanModifiers should return a list of Bool plan modifiers.
BoolPlanModifiers() []planmodifier.Bool
}
// AttributeWithFloat64PlanModifiers is an optional interface on Attribute which
// enables Float64 plan modifier support.
type AttributeWithFloat64PlanModifiers interface {
fwschema.Attribute
// Float64PlanModifiers should return a list of Float64 plan modifiers.
Float64PlanModifiers() []planmodifier.Float64
}
// AttributeWithInt64PlanModifiers is an optional interface on Attribute which
// enables Int64 plan modifier support.
type AttributeWithInt64PlanModifiers interface {
fwschema.Attribute
// Int64PlanModifiers should return a list of Int64 plan modifiers.
Int64PlanModifiers() []planmodifier.Int64
}
// AttributeWithListPlanModifiers is an optional interface on Attribute which
// enables List plan modifier support.
type AttributeWithListPlanModifiers interface {
fwschema.Attribute
// ListPlanModifiers should return a list of List plan modifiers.
ListPlanModifiers() []planmodifier.List
}
// AttributeWithMapPlanModifiers is an optional interface on Attribute which
// enables Map plan modifier support.
type AttributeWithMapPlanModifiers interface {
fwschema.Attribute
// MapPlanModifiers should return a list of Map plan modifiers.
MapPlanModifiers() []planmodifier.Map
}
// AttributeWithNumberPlanModifiers is an optional interface on Attribute which
// enables Number plan modifier support.
type AttributeWithNumberPlanModifiers interface {
fwschema.Attribute
// NumberPlanModifiers should return a list of Number plan modifiers.
NumberPlanModifiers() []planmodifier.Number
}
// AttributeWithObjectPlanModifiers is an optional interface on Attribute which
// enables Object plan modifier support.
type AttributeWithObjectPlanModifiers interface {
fwschema.Attribute
// ObjectPlanModifiers should return a list of Object plan modifiers.
ObjectPlanModifiers() []planmodifier.Object
}
// AttributeWithSetPlanModifiers is an optional interface on Attribute which
// enables Set plan modifier support.
type AttributeWithSetPlanModifiers interface {
fwschema.Attribute
// SetPlanModifiers should return a list of Set plan modifiers.
SetPlanModifiers() []planmodifier.Set
}
// AttributeWithStringPlanModifiers is an optional interface on Attribute which
// enables String plan modifier support.
type AttributeWithStringPlanModifiers interface {
fwschema.Attribute
// StringPlanModifiers should return a list of String plan modifiers.
StringPlanModifiers() []planmodifier.String
}