rustack_ssm_model/input.rs
1//! SSM input types for Phase 0, Phase 1, and Phase 2 operations.
2//!
3//! All input structs use `PascalCase` JSON field naming to match the SSM
4//! wire protocol (`awsJson1_1`). Optional fields are omitted when `None`.
5
6use serde::{Deserialize, Serialize};
7
8use crate::types::{ParameterStringFilter, Tag};
9
10// ---------------------------------------------------------------------------
11// PutParameter
12// ---------------------------------------------------------------------------
13
14/// Input for the `PutParameter` operation.
15#[derive(Debug, Clone, Default, Serialize, Deserialize)]
16#[serde(rename_all = "PascalCase")]
17pub struct PutParameterInput {
18 /// The fully qualified name of the parameter.
19 pub name: String,
20
21 /// The parameter value.
22 pub value: String,
23
24 /// The type of parameter (`String`, `StringList`, or `SecureString`).
25 #[serde(rename = "Type", skip_serializing_if = "Option::is_none")]
26 pub parameter_type: Option<String>,
27
28 /// A description of the parameter.
29 #[serde(skip_serializing_if = "Option::is_none")]
30 pub description: Option<String>,
31
32 /// The KMS key ID for `SecureString` parameters.
33 #[serde(skip_serializing_if = "Option::is_none")]
34 pub key_id: Option<String>,
35
36 /// Whether to overwrite an existing parameter.
37 #[serde(skip_serializing_if = "Option::is_none")]
38 pub overwrite: Option<bool>,
39
40 /// A regular expression used to validate the parameter value.
41 #[serde(skip_serializing_if = "Option::is_none")]
42 pub allowed_pattern: Option<String>,
43
44 /// Tags to associate with the parameter (only on create).
45 #[serde(default, skip_serializing_if = "Vec::is_empty")]
46 pub tags: Vec<Tag>,
47
48 /// The parameter tier (`Standard`, `Advanced`, or `Intelligent-Tiering`).
49 #[serde(skip_serializing_if = "Option::is_none")]
50 pub tier: Option<String>,
51
52 /// The data type of the parameter (default `"text"`).
53 #[serde(skip_serializing_if = "Option::is_none")]
54 pub data_type: Option<String>,
55
56 /// Parameter policies in JSON format.
57 #[serde(skip_serializing_if = "Option::is_none")]
58 pub policies: Option<String>,
59}
60
61// ---------------------------------------------------------------------------
62// GetParameter
63// ---------------------------------------------------------------------------
64
65/// Input for the `GetParameter` operation.
66#[derive(Debug, Clone, Default, Serialize, Deserialize)]
67#[serde(rename_all = "PascalCase")]
68pub struct GetParameterInput {
69 /// The name of the parameter (supports `:version` and `:label` selectors).
70 pub name: String,
71
72 /// Whether to decrypt `SecureString` values.
73 #[serde(skip_serializing_if = "Option::is_none")]
74 pub with_decryption: Option<bool>,
75}
76
77// ---------------------------------------------------------------------------
78// GetParameters
79// ---------------------------------------------------------------------------
80
81/// Input for the `GetParameters` operation.
82#[derive(Debug, Clone, Default, Serialize, Deserialize)]
83#[serde(rename_all = "PascalCase")]
84pub struct GetParametersInput {
85 /// The names of the parameters to retrieve (max 10).
86 #[serde(default)]
87 pub names: Vec<String>,
88
89 /// Whether to decrypt `SecureString` values.
90 #[serde(skip_serializing_if = "Option::is_none")]
91 pub with_decryption: Option<bool>,
92}
93
94// ---------------------------------------------------------------------------
95// GetParametersByPath
96// ---------------------------------------------------------------------------
97
98/// Input for the `GetParametersByPath` operation.
99#[derive(Debug, Clone, Default, Serialize, Deserialize)]
100#[serde(rename_all = "PascalCase")]
101pub struct GetParametersByPathInput {
102 /// The hierarchy path prefix.
103 pub path: String,
104
105 /// Whether to retrieve all parameters under the path recursively.
106 #[serde(skip_serializing_if = "Option::is_none")]
107 pub recursive: Option<bool>,
108
109 /// Whether to decrypt `SecureString` values.
110 #[serde(skip_serializing_if = "Option::is_none")]
111 pub with_decryption: Option<bool>,
112
113 /// Filters for the results.
114 #[serde(default, skip_serializing_if = "Vec::is_empty")]
115 pub parameter_filters: Vec<ParameterStringFilter>,
116
117 /// The maximum number of results per page (default 10, max 10).
118 #[serde(skip_serializing_if = "Option::is_none")]
119 pub max_results: Option<i32>,
120
121 /// The token for the next set of results.
122 #[serde(skip_serializing_if = "Option::is_none")]
123 pub next_token: Option<String>,
124}
125
126// ---------------------------------------------------------------------------
127// DeleteParameter
128// ---------------------------------------------------------------------------
129
130/// Input for the `DeleteParameter` operation.
131#[derive(Debug, Clone, Default, Serialize, Deserialize)]
132#[serde(rename_all = "PascalCase")]
133pub struct DeleteParameterInput {
134 /// The name of the parameter to delete.
135 pub name: String,
136}
137
138// ---------------------------------------------------------------------------
139// DeleteParameters
140// ---------------------------------------------------------------------------
141
142/// Input for the `DeleteParameters` operation.
143#[derive(Debug, Clone, Default, Serialize, Deserialize)]
144#[serde(rename_all = "PascalCase")]
145pub struct DeleteParametersInput {
146 /// The names of the parameters to delete (max 10).
147 #[serde(default)]
148 pub names: Vec<String>,
149}
150
151// ---------------------------------------------------------------------------
152// Phase 1: DescribeParameters
153// ---------------------------------------------------------------------------
154
155/// Input for the `DescribeParameters` operation.
156#[derive(Debug, Clone, Default, Serialize, Deserialize)]
157#[serde(rename_all = "PascalCase")]
158pub struct DescribeParametersInput {
159 /// Filters for the results.
160 #[serde(default, skip_serializing_if = "Vec::is_empty")]
161 pub parameter_filters: Vec<ParameterStringFilter>,
162
163 /// The maximum number of results per page (1-50, default 50).
164 #[serde(skip_serializing_if = "Option::is_none")]
165 pub max_results: Option<i32>,
166
167 /// The token for the next set of results.
168 #[serde(skip_serializing_if = "Option::is_none")]
169 pub next_token: Option<String>,
170}
171
172// ---------------------------------------------------------------------------
173// Phase 1: GetParameterHistory
174// ---------------------------------------------------------------------------
175
176/// Input for the `GetParameterHistory` operation.
177#[derive(Debug, Clone, Default, Serialize, Deserialize)]
178#[serde(rename_all = "PascalCase")]
179pub struct GetParameterHistoryInput {
180 /// The name of the parameter.
181 pub name: String,
182
183 /// Whether to decrypt `SecureString` values.
184 #[serde(skip_serializing_if = "Option::is_none")]
185 pub with_decryption: Option<bool>,
186
187 /// The maximum number of results per page (1-50, default 50).
188 #[serde(skip_serializing_if = "Option::is_none")]
189 pub max_results: Option<i32>,
190
191 /// The token for the next set of results.
192 #[serde(skip_serializing_if = "Option::is_none")]
193 pub next_token: Option<String>,
194}
195
196// ---------------------------------------------------------------------------
197// Phase 1: AddTagsToResource
198// ---------------------------------------------------------------------------
199
200/// Input for the `AddTagsToResource` operation.
201#[derive(Debug, Clone, Default, Serialize, Deserialize)]
202#[serde(rename_all = "PascalCase")]
203pub struct AddTagsToResourceInput {
204 /// The type of resource (must be `"Parameter"`).
205 pub resource_type: String,
206
207 /// The resource ID (parameter name).
208 pub resource_id: String,
209
210 /// The tags to add.
211 #[serde(default)]
212 pub tags: Vec<Tag>,
213}
214
215// ---------------------------------------------------------------------------
216// Phase 1: RemoveTagsFromResource
217// ---------------------------------------------------------------------------
218
219/// Input for the `RemoveTagsFromResource` operation.
220#[derive(Debug, Clone, Default, Serialize, Deserialize)]
221#[serde(rename_all = "PascalCase")]
222pub struct RemoveTagsFromResourceInput {
223 /// The type of resource (must be `"Parameter"`).
224 pub resource_type: String,
225
226 /// The resource ID (parameter name).
227 pub resource_id: String,
228
229 /// The tag keys to remove.
230 #[serde(default)]
231 pub tag_keys: Vec<String>,
232}
233
234// ---------------------------------------------------------------------------
235// Phase 1: ListTagsForResource
236// ---------------------------------------------------------------------------
237
238/// Input for the `ListTagsForResource` operation.
239#[derive(Debug, Clone, Default, Serialize, Deserialize)]
240#[serde(rename_all = "PascalCase")]
241pub struct ListTagsForResourceInput {
242 /// The type of resource (must be `"Parameter"`).
243 pub resource_type: String,
244
245 /// The resource ID (parameter name).
246 pub resource_id: String,
247}
248
249// ---------------------------------------------------------------------------
250// Phase 2: LabelParameterVersion
251// ---------------------------------------------------------------------------
252
253/// Input for the `LabelParameterVersion` operation.
254#[derive(Debug, Clone, Default, Serialize, Deserialize)]
255#[serde(rename_all = "PascalCase")]
256pub struct LabelParameterVersionInput {
257 /// The parameter name.
258 pub name: String,
259
260 /// The specific version to label. If omitted, the latest version is used.
261 #[serde(skip_serializing_if = "Option::is_none")]
262 pub parameter_version: Option<i64>,
263
264 /// The labels to attach.
265 #[serde(default)]
266 pub labels: Vec<String>,
267}
268
269// ---------------------------------------------------------------------------
270// Phase 2: UnlabelParameterVersion
271// ---------------------------------------------------------------------------
272
273/// Input for the `UnlabelParameterVersion` operation.
274#[derive(Debug, Clone, Default, Serialize, Deserialize)]
275#[serde(rename_all = "PascalCase")]
276pub struct UnlabelParameterVersionInput {
277 /// The parameter name.
278 pub name: String,
279
280 /// The specific version to unlabel.
281 pub parameter_version: i64,
282
283 /// The labels to remove.
284 #[serde(default)]
285 pub labels: Vec<String>,
286}