@@ -85,6 +85,67 @@ func TestSetSDK_APIGWv2_Route_Create(t *testing.T) {
85
85
)
86
86
}
87
87
88
+ func TestSetSDK_MemoryDB_User_Create (t * testing.T ) {
89
+ assert := assert .New (t )
90
+ require := require .New (t )
91
+
92
+ g := testutil .NewModelForService (t , "memorydb" )
93
+
94
+ crd := testutil .GetCRDByName (t , g , "User" )
95
+ require .NotNil (crd )
96
+
97
+ expected := `
98
+ if r.ko.Spec.AccessString != nil {
99
+ res.AccessString = r.ko.Spec.AccessString
100
+ }
101
+ if r.ko.Spec.AuthenticationMode != nil {
102
+ f1 := &svcsdktypes.AuthenticationMode{}
103
+ if r.ko.Spec.AuthenticationMode.Passwords != nil {
104
+ f1f0 := []string{}
105
+ for _, f1f0iter := range r.ko.Spec.AuthenticationMode.Passwords {
106
+ var f1f0elem string
107
+ if f1f0iter != nil {
108
+ tmpSecret, err := rm.rr.SecretValueFromReference(ctx, f1f0iter)
109
+ if err != nil {
110
+ return nil, ackrequeue.Needed(err)
111
+ }
112
+ if tmpSecret != "" {
113
+ f1f0elem = tmpSecret
114
+ }
115
+ }
116
+ f1f0 = append(f1f0, f1f0elem)
117
+ }
118
+ f1.Passwords = f1f0
119
+ }
120
+ if r.ko.Spec.AuthenticationMode.Type != nil {
121
+ f1.Type = svcsdktypes.InputAuthenticationType(*r.ko.Spec.AuthenticationMode.Type)
122
+ }
123
+ res.AuthenticationMode = f1
124
+ }
125
+ if r.ko.Spec.Tags != nil {
126
+ f2 := []svcsdktypes.Tag{}
127
+ for _, f2iter := range r.ko.Spec.Tags {
128
+ f2elem := &svcsdktypes.Tag{}
129
+ if f2iter.Key != nil {
130
+ f2elem.Key = f2iter.Key
131
+ }
132
+ if f2iter.Value != nil {
133
+ f2elem.Value = f2iter.Value
134
+ }
135
+ f2 = append(f2, *f2elem)
136
+ }
137
+ res.Tags = f2
138
+ }
139
+ if r.ko.Spec.Name != nil {
140
+ res.UserName = r.ko.Spec.Name
141
+ }
142
+ `
143
+ assert .Equal (
144
+ expected ,
145
+ code .SetSDK (crd .Config (), crd , model .OpTypeCreate , "r.ko" , "res" , 1 ),
146
+ )
147
+ }
148
+
88
149
func TestSetSDK_OpenSearch_Domain_Create (t * testing.T ) {
89
150
assert := assert .New (t )
90
151
require := require .New (t )
0 commit comments