@@ -54,39 +54,50 @@ func expandAdvancedSecurityOptions(m []any) *awstypes.AdvancedSecurityOptionsInp
54
54
return & config
55
55
}
56
56
57
- func expandAIMLOptions (a []any ) * awstypes.AIMLOptionsInput {
58
- config := awstypes.AIMLOptionsInput {}
59
- group := a [0 ].(map [string ]any )
60
-
61
- if v , ok := group ["natural_language_query_generation_options" ].([]any ); ok {
62
- if len (v ) > 0 && v [0 ] != nil {
63
- nlqgo := awstypes.NaturalLanguageQueryGenerationOptionsInput {}
64
- nlqgoGroup := v [0 ].(map [string ]any )
65
-
66
- if v , ok := nlqgoGroup ["desired_state" ].(string ); ok && v != "" {
67
- if v == "DISABLED" {
68
- nlqgo .DesiredState = awstypes .NaturalLanguageQueryGenerationDesiredStateDisabled
69
- } else if v == "ENABLED" {
70
- nlqgo .DesiredState = awstypes .NaturalLanguageQueryGenerationDesiredStateEnabled
71
- }
72
- }
73
- }
57
+ func expandAIMLOptionsInput (tfMap map [string ]any ) * awstypes.AIMLOptionsInput {
58
+ if tfMap == nil {
59
+ return nil
74
60
}
75
61
76
- if v , ok := group ["s3_vectors_engine" ].([]any ); ok {
77
- if len (v ) > 0 && v [0 ] != nil {
78
- ve := awstypes.S3VectorsEngine {}
79
- veGroup := v [0 ].(map [string ]any )
62
+ apiObject := & awstypes.AIMLOptionsInput {}
80
63
81
- if veEnabled , ok := veGroup [ names . AttrEnabled ] ; ok {
82
- ve . Enabled = aws . Bool ( veEnabled .( bool ))
83
- }
64
+ if v , ok := tfMap [ "natural_language_query_generation_options" ].([] any ) ; ok && len ( v ) > 0 && v [ 0 ] != nil {
65
+ apiObject . NaturalLanguageQueryGenerationOptions = expandNaturalLanguageQueryGenerationOptionsInput ( v [ 0 ].( map [ string ] any ))
66
+ }
84
67
85
- config . S3VectorsEngine = & ve
86
- }
68
+ if v , ok := tfMap [ "s3_vectors_engine" ].([] any ); ok && len ( v ) > 0 && v [ 0 ] != nil {
69
+ apiObject . S3VectorsEngine = expandS3VectorsEngine ( v [ 0 ].( map [ string ] any ))
87
70
}
88
71
89
- return & config
72
+ return apiObject
73
+ }
74
+
75
+ func expandNaturalLanguageQueryGenerationOptionsInput (tfMap map [string ]any ) * awstypes.NaturalLanguageQueryGenerationOptionsInput {
76
+ if tfMap == nil {
77
+ return nil
78
+ }
79
+
80
+ apiObject := & awstypes.NaturalLanguageQueryGenerationOptionsInput {}
81
+
82
+ if v , ok := tfMap ["desired_state" ].(string ); ok && v != "" {
83
+ apiObject .DesiredState = awstypes .NaturalLanguageQueryGenerationDesiredState (v )
84
+ }
85
+
86
+ return apiObject
87
+ }
88
+
89
+ func expandS3VectorsEngine (tfMap map [string ]any ) * awstypes.S3VectorsEngine {
90
+ if tfMap == nil {
91
+ return nil
92
+ }
93
+
94
+ apiObject := & awstypes.S3VectorsEngine {}
95
+
96
+ if v , ok := tfMap [names .AttrEnabled ].(bool ); ok {
97
+ apiObject .Enabled = aws .Bool (v )
98
+ }
99
+
100
+ return apiObject
90
101
}
91
102
92
103
func expandAutoTuneOptions (tfMap map [string ]any ) * awstypes.AutoTuneOptions {
@@ -283,6 +294,48 @@ func flattenAdvancedSecurityOptions(advancedSecurityOptions *awstypes.AdvancedSe
283
294
return []map [string ]any {m }
284
295
}
285
296
297
+ func flattenAIMLOptionsOutput (apiObject * awstypes.AIMLOptionsOutput ) map [string ]any {
298
+ if apiObject == nil {
299
+ return nil
300
+ }
301
+
302
+ tfMap := map [string ]any {}
303
+
304
+ if v := apiObject .NaturalLanguageQueryGenerationOptions ; v != nil {
305
+ tfMap ["natural_language_query_generation_options" ] = []interface {}{flattenNaturalLanguageQueryGenerationOptionsOutput (v )}
306
+ }
307
+
308
+ if v := apiObject .S3VectorsEngine ; v != nil {
309
+ tfMap ["s3_vectors_engine" ] = []interface {}{flattenS3VectorsEngine (v )}
310
+ }
311
+
312
+ return tfMap
313
+ }
314
+
315
+ func flattenNaturalLanguageQueryGenerationOptionsOutput (apiObject * awstypes.NaturalLanguageQueryGenerationOptionsOutput ) map [string ]any {
316
+ if apiObject == nil {
317
+ return nil
318
+ }
319
+
320
+ tfMap := map [string ]any {
321
+ "desired_state" : apiObject .DesiredState ,
322
+ }
323
+
324
+ return tfMap
325
+ }
326
+
327
+ func flattenS3VectorsEngine (apiObject * awstypes.S3VectorsEngine ) map [string ]any {
328
+ if apiObject == nil {
329
+ return nil
330
+ }
331
+
332
+ tfMap := map [string ]any {
333
+ names .AttrEnabled : aws .ToBool (apiObject .Enabled ),
334
+ }
335
+
336
+ return tfMap
337
+ }
338
+
286
339
func flattenAutoTuneOptions (autoTuneOptions * awstypes.AutoTuneOptions ) map [string ]any {
287
340
if autoTuneOptions == nil {
288
341
return nil
0 commit comments