|
1
|
|
|
package ssm |
|
2
|
|
|
|
|
3
|
|
|
import ( |
|
4
|
|
|
"time" |
|
5
|
|
|
|
|
6
|
|
|
SDK "github.com/aws/aws-sdk-go-v2/service/ssm" |
|
7
|
|
|
"github.com/evalphobia/aws-sdk-go-v2-wrapper/private/pointers" |
|
8
|
|
|
) |
|
9
|
|
|
|
|
10
|
|
|
type Parameter struct { |
|
|
|
|
|
|
11
|
|
|
ARN string |
|
12
|
|
|
DataType string |
|
13
|
|
|
LastModifiedDate time.Time |
|
14
|
|
|
Name string |
|
15
|
|
|
Selector string |
|
16
|
|
|
SourceResult string |
|
17
|
|
|
Type ParameterType |
|
18
|
|
|
Value string |
|
19
|
|
|
Version int64 |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
func newParameter(o *SDK.Parameter) Parameter { |
|
23
|
|
|
result := Parameter{} |
|
24
|
|
|
if o == nil { |
|
25
|
|
|
return result |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
if o.ARN != nil { |
|
29
|
|
|
result.ARN = *o.ARN |
|
30
|
|
|
} |
|
31
|
|
|
if o.DataType != nil { |
|
32
|
|
|
result.DataType = *o.DataType |
|
33
|
|
|
} |
|
34
|
|
|
if o.LastModifiedDate != nil { |
|
35
|
|
|
result.LastModifiedDate = *o.LastModifiedDate |
|
36
|
|
|
} |
|
37
|
|
|
if o.Name != nil { |
|
38
|
|
|
result.Name = *o.Name |
|
39
|
|
|
} |
|
40
|
|
|
if o.Selector != nil { |
|
41
|
|
|
result.Selector = *o.Selector |
|
42
|
|
|
} |
|
43
|
|
|
if o.SourceResult != nil { |
|
44
|
|
|
result.SourceResult = *o.SourceResult |
|
45
|
|
|
} |
|
46
|
|
|
result.Type = ParameterType(o.Type) |
|
47
|
|
|
if o.Value != nil { |
|
48
|
|
|
result.Value = *o.Value |
|
49
|
|
|
} |
|
50
|
|
|
if o.Version != nil { |
|
51
|
|
|
result.Version = *o.Version |
|
52
|
|
|
} |
|
53
|
|
|
return result |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
type ParameterHistory struct { |
|
|
|
|
|
|
57
|
|
|
AllowedPattern string |
|
58
|
|
|
DataType string |
|
59
|
|
|
Description string |
|
60
|
|
|
KeyID string |
|
61
|
|
|
Labels []string |
|
62
|
|
|
LastModifiedDate time.Time |
|
63
|
|
|
LastModifiedUser string |
|
64
|
|
|
Name string |
|
65
|
|
|
Policies []ParameterInlinePolicy |
|
66
|
|
|
Tier ParameterTier |
|
67
|
|
|
Type ParameterType |
|
68
|
|
|
Value string |
|
69
|
|
|
Version int64 |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
func newParameterHistory(o *SDK.ParameterHistory) ParameterHistory { |
|
73
|
|
|
result := ParameterHistory{} |
|
74
|
|
|
if o == nil { |
|
75
|
|
|
return result |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
if o.AllowedPattern != nil { |
|
79
|
|
|
result.AllowedPattern = *o.AllowedPattern |
|
80
|
|
|
} |
|
81
|
|
|
if o.DataType != nil { |
|
82
|
|
|
result.DataType = *o.DataType |
|
83
|
|
|
} |
|
84
|
|
|
if o.Description != nil { |
|
85
|
|
|
result.Description = *o.Description |
|
86
|
|
|
} |
|
87
|
|
|
if o.KeyId != nil { |
|
88
|
|
|
result.KeyID = *o.KeyId |
|
89
|
|
|
} |
|
90
|
|
|
if o.LastModifiedDate != nil { |
|
91
|
|
|
result.LastModifiedDate = *o.LastModifiedDate |
|
92
|
|
|
} |
|
93
|
|
|
if o.LastModifiedUser != nil { |
|
94
|
|
|
result.LastModifiedUser = *o.LastModifiedUser |
|
95
|
|
|
} |
|
96
|
|
|
if o.Name != nil { |
|
97
|
|
|
result.Name = *o.Name |
|
98
|
|
|
} |
|
99
|
|
|
if o.Value != nil { |
|
100
|
|
|
result.Value = *o.Value |
|
101
|
|
|
} |
|
102
|
|
|
if o.Version != nil { |
|
103
|
|
|
result.Version = *o.Version |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
result.Labels = o.Labels |
|
107
|
|
|
result.Policies = newParameterInlinePolicyList(o.Policies) |
|
108
|
|
|
result.Tier = ParameterTier(o.Tier) |
|
109
|
|
|
result.Type = ParameterType(o.Type) |
|
110
|
|
|
return result |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
type ParameterInlinePolicy struct { |
|
|
|
|
|
|
114
|
|
|
PolicyStatus string |
|
115
|
|
|
PolicyText string |
|
116
|
|
|
PolicyType string |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
func newParameterInlinePolicyList(list []SDK.ParameterInlinePolicy) []ParameterInlinePolicy { |
|
120
|
|
|
if len(list) == 0 { |
|
121
|
|
|
return nil |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
results := make([]ParameterInlinePolicy, len(list)) |
|
125
|
|
|
for i := range list { |
|
126
|
|
|
results[i] = newParameterInlinePolicy(&list[i]) |
|
127
|
|
|
} |
|
128
|
|
|
return results |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
func newParameterInlinePolicy(o *SDK.ParameterInlinePolicy) ParameterInlinePolicy { |
|
132
|
|
|
result := ParameterInlinePolicy{} |
|
133
|
|
|
if o == nil { |
|
134
|
|
|
return result |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
if o.PolicyStatus != nil { |
|
138
|
|
|
result.PolicyStatus = *o.PolicyStatus |
|
139
|
|
|
} |
|
140
|
|
|
if o.PolicyText != nil { |
|
141
|
|
|
result.PolicyText = *o.PolicyText |
|
142
|
|
|
} |
|
143
|
|
|
if o.PolicyType != nil { |
|
144
|
|
|
result.PolicyType = *o.PolicyType |
|
145
|
|
|
} |
|
146
|
|
|
return result |
|
147
|
|
|
} |
|
148
|
|
|
|
|
149
|
|
|
type ParameterMetadata struct { |
|
|
|
|
|
|
150
|
|
|
AllowedPattern string |
|
151
|
|
|
DataType string |
|
152
|
|
|
Description string |
|
153
|
|
|
KeyID string |
|
154
|
|
|
LastModifiedDate time.Time |
|
155
|
|
|
LastModifiedUser string |
|
156
|
|
|
Name string |
|
157
|
|
|
Policies []ParameterInlinePolicy |
|
158
|
|
|
Tier ParameterTier |
|
159
|
|
|
Type ParameterType |
|
160
|
|
|
Version int64 |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
func newParameterMetadata(o SDK.ParameterMetadata) ParameterMetadata { |
|
164
|
|
|
result := ParameterMetadata{} |
|
165
|
|
|
|
|
166
|
|
|
if o.AllowedPattern != nil { |
|
167
|
|
|
result.AllowedPattern = *o.AllowedPattern |
|
168
|
|
|
} |
|
169
|
|
|
if o.DataType != nil { |
|
170
|
|
|
result.DataType = *o.DataType |
|
171
|
|
|
} |
|
172
|
|
|
if o.Description != nil { |
|
173
|
|
|
result.Description = *o.Description |
|
174
|
|
|
} |
|
175
|
|
|
if o.KeyId != nil { |
|
176
|
|
|
result.KeyID = *o.KeyId |
|
177
|
|
|
} |
|
178
|
|
|
if o.LastModifiedDate != nil { |
|
179
|
|
|
result.LastModifiedDate = *o.LastModifiedDate |
|
180
|
|
|
} |
|
181
|
|
|
if o.LastModifiedUser != nil { |
|
182
|
|
|
result.LastModifiedUser = *o.LastModifiedUser |
|
183
|
|
|
} |
|
184
|
|
|
if o.Name != nil { |
|
185
|
|
|
result.Name = *o.Name |
|
186
|
|
|
} |
|
187
|
|
|
if o.Version != nil { |
|
188
|
|
|
result.Version = *o.Version |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
result.Policies = newParameterInlinePolicyList(o.Policies) |
|
192
|
|
|
result.Tier = ParameterTier(o.Tier) |
|
193
|
|
|
result.Type = ParameterType(o.Type) |
|
194
|
|
|
return result |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
type ParameterStringFilter struct { |
|
|
|
|
|
|
198
|
|
|
Key string |
|
199
|
|
|
Option string |
|
200
|
|
|
Values []string |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
func (v ParameterStringFilter) ToSDK() SDK.ParameterStringFilter { |
|
|
|
|
|
|
204
|
|
|
o := SDK.ParameterStringFilter{} |
|
205
|
|
|
if v.Key != "" { |
|
206
|
|
|
o.Key = pointers.String(v.Key) |
|
207
|
|
|
} |
|
208
|
|
|
if v.Option != "" { |
|
209
|
|
|
o.Option = pointers.String(v.Option) |
|
210
|
|
|
} |
|
211
|
|
|
o.Values = v.Values |
|
212
|
|
|
return o |
|
213
|
|
|
} |
|
214
|
|
|
|
|
215
|
|
|
type Tag struct { |
|
|
|
|
|
|
216
|
|
|
Key string |
|
217
|
|
|
Value string |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
func (r Tag) ToSDK() SDK.Tag { |
|
|
|
|
|
|
221
|
|
|
o := SDK.Tag{} |
|
222
|
|
|
|
|
223
|
|
|
if r.Key != "" { |
|
224
|
|
|
o.Key = pointers.String(r.Key) |
|
225
|
|
|
} |
|
226
|
|
|
if r.Value != "" { |
|
227
|
|
|
o.Value = pointers.String(r.Value) |
|
228
|
|
|
} |
|
229
|
|
|
return o |
|
230
|
|
|
} |
|
231
|
|
|
|