/
attributewithstringvalidators.go
84 lines (68 loc) · 2.6 KB
/
attributewithstringvalidators.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
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.AttributeWithStringValidators = AttributeWithStringValidators{}
type AttributeWithStringValidators struct {
Computed bool
DeprecationMessage string
Description string
MarkdownDescription string
Optional bool
Required bool
Sensitive bool
Validators []validator.String
}
// ApplyTerraform5AttributePathStep satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (any, error) {
return a.GetType().ApplyTerraform5AttributePathStep(step)
}
// Equal satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) Equal(o fwschema.Attribute) bool {
_, ok := o.(AttributeWithStringValidators)
if !ok {
return false
}
return fwschema.AttributesEqual(a, o)
}
// GetDeprecationMessage satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) GetDeprecationMessage() string {
return a.DeprecationMessage
}
// GetDescription satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) GetDescription() string {
return a.Description
}
// GetMarkdownDescription satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) GetMarkdownDescription() string {
return a.MarkdownDescription
}
// GetType satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) GetType() attr.Type {
return types.StringType
}
// IsComputed satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) IsComputed() bool {
return a.Computed
}
// IsOptional satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) IsOptional() bool {
return a.Optional
}
// IsRequired satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) IsRequired() bool {
return a.Required
}
// IsSensitive satisfies the fwschema.Attribute interface.
func (a AttributeWithStringValidators) IsSensitive() bool {
return a.Sensitive
}
// StringValidators satisfies the fwxschema.AttributeWithStringValidators interface.
func (a AttributeWithStringValidators) StringValidators() []validator.String {
return a.Validators
}