@@ -2,6 +2,7 @@ package action
2
2
3
3
import (
4
4
"github.com/hashicorp/terraform-plugin-framework/types"
5
+ "github.com/hashicorp/terraform-plugin-go/tftypes"
5
6
)
6
7
7
8
type WebhookMethodModel struct {
@@ -70,6 +71,141 @@ type StringPropModel struct {
70
71
Encryption types.String `tfsdk:"encryption"`
71
72
}
72
73
74
+ // StringPropValidationModel is a model used for the validation of StringPropModel resources
75
+ type StringPropValidationModel struct {
76
+ Title string
77
+ Required * bool
78
+ }
79
+
80
+ func (e * StringPropValidationModel ) FromTerraform5Value (val tftypes.Value ) error {
81
+ v := map [string ]tftypes.Value {}
82
+
83
+ err := val .As (& v )
84
+ if err != nil {
85
+ return err
86
+ }
87
+
88
+ err = v ["title" ].As (& e .Title )
89
+ if err != nil {
90
+ return err
91
+ }
92
+
93
+ err = v ["required" ].As (& e .Required )
94
+ if err != nil {
95
+ return err
96
+ }
97
+
98
+ return nil
99
+ }
100
+
101
+ // NumberPropValidationModel is a model used for the validation of StringPropModel resources
102
+ type NumberPropValidationModel struct {
103
+ Title string
104
+ Required * bool
105
+ }
106
+
107
+ func (e * NumberPropValidationModel ) FromTerraform5Value (val tftypes.Value ) error {
108
+ v := map [string ]tftypes.Value {}
109
+
110
+ err := val .As (& v )
111
+ if err != nil {
112
+ return err
113
+ }
114
+
115
+ err = v ["title" ].As (& e .Title )
116
+ if err != nil {
117
+ return err
118
+ }
119
+
120
+ err = v ["required" ].As (& e .Required )
121
+ if err != nil {
122
+ return err
123
+ }
124
+
125
+ return nil
126
+ }
127
+
128
+ // BooleanPropValidationModel is a model used for the validation of StringPropModel resources
129
+ type BooleanPropValidationModel struct {
130
+ Title string
131
+ Required * bool
132
+ }
133
+
134
+ func (e * BooleanPropValidationModel ) FromTerraform5Value (val tftypes.Value ) error {
135
+ v := map [string ]tftypes.Value {}
136
+
137
+ err := val .As (& v )
138
+ if err != nil {
139
+ return err
140
+ }
141
+
142
+ err = v ["title" ].As (& e .Title )
143
+ if err != nil {
144
+ return err
145
+ }
146
+
147
+ err = v ["required" ].As (& e .Required )
148
+ if err != nil {
149
+ return err
150
+ }
151
+
152
+ return nil
153
+ }
154
+
155
+ // ObjectPropValidationModel is a model used for the validation of StringPropModel resources
156
+ type ObjectPropValidationModel struct {
157
+ Title string
158
+ Required * bool
159
+ }
160
+
161
+ func (e * ObjectPropValidationModel ) FromTerraform5Value (val tftypes.Value ) error {
162
+ v := map [string ]tftypes.Value {}
163
+
164
+ err := val .As (& v )
165
+ if err != nil {
166
+ return err
167
+ }
168
+
169
+ err = v ["title" ].As (& e .Title )
170
+ if err != nil {
171
+ return err
172
+ }
173
+
174
+ err = v ["required" ].As (& e .Required )
175
+ if err != nil {
176
+ return err
177
+ }
178
+
179
+ return nil
180
+ }
181
+
182
+ // ArrayPropValidationModel is a model used for the validation of StringPropModel resources
183
+ type ArrayPropValidationModel struct {
184
+ Title string
185
+ Required * bool
186
+ }
187
+
188
+ func (e * ArrayPropValidationModel ) FromTerraform5Value (val tftypes.Value ) error {
189
+ v := map [string ]tftypes.Value {}
190
+
191
+ err := val .As (& v )
192
+ if err != nil {
193
+ return err
194
+ }
195
+
196
+ err = v ["title" ].As (& e .Title )
197
+ if err != nil {
198
+ return err
199
+ }
200
+
201
+ err = v ["required" ].As (& e .Required )
202
+ if err != nil {
203
+ return err
204
+ }
205
+
206
+ return nil
207
+ }
208
+
73
209
type NumberPropModel struct {
74
210
Title types.String `tfsdk:"title"`
75
211
Icon types.String `tfsdk:"icon"`
@@ -188,3 +324,25 @@ type ActionModel struct {
188
324
OrderProperties types.List `tfsdk:"order_properties"`
189
325
RequiredJqQuery types.String `tfsdk:"required_jq_query"`
190
326
}
327
+
328
+ // ActionValidationModel is a model used for the validation of ActionModel resources
329
+ type ActionValidationModel struct {
330
+ ID types.String `tfsdk:"id"`
331
+ Identifier types.String `tfsdk:"identifier"`
332
+ Blueprint types.String `tfsdk:"blueprint"`
333
+ Title types.String `tfsdk:"title"`
334
+ Icon types.String `tfsdk:"icon"`
335
+ Description types.String `tfsdk:"description"`
336
+ RequiredApproval types.Bool `tfsdk:"required_approval"`
337
+ Trigger types.String `tfsdk:"trigger"`
338
+ KafkaMethod types.Object `tfsdk:"kafka_method"`
339
+ WebhookMethod types.Object `tfsdk:"webhook_method"`
340
+ GithubMethod types.Object `tfsdk:"github_method"`
341
+ AzureMethod types.Object `tfsdk:"azure_method"`
342
+ GitlabMethod types.Object `tfsdk:"gitlab_method"`
343
+ UserProperties types.Object `tfsdk:"user_properties"`
344
+ ApprovalWebhookNotification types.Object `tfsdk:"approval_webhook_notification"`
345
+ ApprovalEmailNotification types.Object `tfsdk:"approval_email_notification"`
346
+ OrderProperties types.List `tfsdk:"order_properties"`
347
+ RequiredJqQuery types.String `tfsdk:"required_jq_query"`
348
+ }
0 commit comments