/
attributewithsetvalidators.go
87 lines (71 loc) · 2.6 KB
/
attributewithsetvalidators.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
package testschema
import (
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/internal/fwschema"
"github.com/hashicorp/terraform-plugin-framework/internal/fwschema/fwxschema"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-go/tftypes"
)
var _ fwxschema.AttributeWithSetValidators = AttributeWithSetValidators{}
type AttributeWithSetValidators struct {
Computed bool
DeprecationMessage string
Description string
ElementType attr.Type
MarkdownDescription string
Optional bool
Required bool
Sensitive bool
Validators []validator.Set
}
// ApplyTerraform5AttributePathStep satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (any, error) {
return a.GetType().ApplyTerraform5AttributePathStep(step)
}
// Equal satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) Equal(o fwschema.Attribute) bool {
_, ok := o.(AttributeWithSetValidators)
if !ok {
return false
}
return fwschema.AttributesEqual(a, o)
}
// GetDeprecationMessage satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) GetDeprecationMessage() string {
return a.DeprecationMessage
}
// GetDescription satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) GetDescription() string {
return a.Description
}
// GetMarkdownDescription satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) GetMarkdownDescription() string {
return a.MarkdownDescription
}
// GetType satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) GetType() attr.Type {
return types.SetType{
ElemType: a.ElementType,
}
}
// IsComputed satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) IsComputed() bool {
return a.Computed
}
// IsOptional satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) IsOptional() bool {
return a.Optional
}
// IsRequired satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) IsRequired() bool {
return a.Required
}
// IsSensitive satisfies the fwschema.Attribute interface.
func (a AttributeWithSetValidators) IsSensitive() bool {
return a.Sensitive
}
// SetValidators satisfies the fwxschema.AttributeWithSetValidators interface.
func (a AttributeWithSetValidators) SetValidators() []validator.Set {
return a.Validators
}