-
Notifications
You must be signed in to change notification settings - Fork 0
/
property_type_additional.go
141 lines (109 loc) · 2.78 KB
/
property_type_additional.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Copyright (c) Topicus Security B.V.
// SPDX-License-Identifier: APSL-2.0
package model
import (
"strings"
)
type restAdditionalType struct {
names []string
}
func NewAdditionalType(names []string) RestPropertyType {
return &restAdditionalType{
names: names,
}
}
func (t *restAdditionalType) MarkReachable() {
}
func (t *restAdditionalType) PropertyNameSuffix() string {
return ""
}
func (t *restAdditionalType) FlattenMode() string {
return "None"
}
func (t *restAdditionalType) OrderMode() string {
return "None"
}
func (t *restAdditionalType) TFName() string {
return "types.List"
}
func (t *restAdditionalType) TFAttrType(inAdditionalObjects bool) string {
return "types.ListType{ElemType: types.StringType}"
}
func (t *restAdditionalType) TFValueType() string {
return "basetypes.ListValue"
}
func (t *restAdditionalType) TFValidatorType() string {
return "validator.List"
}
func (t *restAdditionalType) TFValidators() []string {
var sb strings.Builder
sb.WriteString("listvalidator.ValueStringsAre(stringvalidator.OneOf(\n")
for _, name := range t.names {
sb.WriteString(`"`)
sb.WriteString(name)
sb.WriteString(`",`)
}
sb.WriteString("\n)),")
return []string{sb.String()}
}
func (t *restAdditionalType) Complex() bool {
return false
}
func (t *restAdditionalType) RequiresReplace() bool {
return false
}
func (t *restAdditionalType) NestedType() RestType {
return nil
}
func (t *restAdditionalType) ToTFAttrWithDiag() bool {
return false
}
func (t *restAdditionalType) ToTKHAttrWithDiag() bool {
return false
}
func (t *restAdditionalType) ToTKHCustomCode() string {
return ""
}
func (t *restAdditionalType) TFAttrNeeded() bool {
return false
}
func (t *restAdditionalType) TKHToTF(value string, listItem bool) string {
return "types.ListNull(types.StringType)"
}
func (t *restAdditionalType) TFToTKH(value string, listItem bool) string {
return ""
}
func (t *restAdditionalType) TKHToTFGuard() string {
return ""
}
func (t *restAdditionalType) TFToTKHGuard() string {
return ""
}
func (t *restAdditionalType) TKHGetter(propertyName string) string {
return ""
}
func (t *restAdditionalType) SDKTypeName(listItem bool) string {
return "NONE"
}
func (t *restAdditionalType) SDKTypeConstructor() string {
return "NONE"
}
func (t *restAdditionalType) DSSchemaTemplate() string {
return "data_source_schema_attr_additional.go.tmpl"
}
func (t *restAdditionalType) DSSchemaTemplateData() map[string]any {
return map[string]any{
"Names": t.names,
}
}
func (t *restAdditionalType) RSSchemaTemplate() string {
return "resource_schema_attr_additional.go.tmpl"
}
func (t *restAdditionalType) RSSchemaTemplateData() map[string]any {
return map[string]any{
"Names": t.names,
}
}
func (t *restAdditionalType) DS() RestPropertyType {
return NewAdditionalType(t.names)
}