superposition_sdk 0.100.2

Rust SDK to work with Superposition
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetWebhookOutput  {
    #[allow(missing_docs)] // documentation missing in model
    pub name: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub description: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub enabled: bool,
    #[allow(missing_docs)] // documentation missing in model
    pub url: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub method: crate::types::HttpMethod,
    #[allow(missing_docs)] // documentation missing in model
    pub version: crate::types::Version,
    /// Generic key-value object structure used for flexible data representation throughout the API.
    pub custom_headers: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>,
    #[allow(missing_docs)] // documentation missing in model
    pub events: ::std::vec::Vec::<::std::string::String>,
    #[allow(missing_docs)] // documentation missing in model
    pub max_retries: i32,
    #[allow(missing_docs)] // documentation missing in model
    pub last_triggered_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    #[allow(missing_docs)] // documentation missing in model
    pub change_reason: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub created_by: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub created_at: ::aws_smithy_types::DateTime,
    #[allow(missing_docs)] // documentation missing in model
    pub last_modified_by: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub last_modified_at: ::aws_smithy_types::DateTime,
}
impl  GetWebhookOutput  {
    #[allow(missing_docs)] // documentation missing in model
    pub fn name(&self) -> &str {
        use std::ops::Deref; self.name.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn description(&self) -> &str {
        use std::ops::Deref; self.description.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn enabled(&self) -> bool {
        self.enabled
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn url(&self) -> &str {
        use std::ops::Deref; self.url.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn method(&self) -> &crate::types::HttpMethod {
        &self.method
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn version(&self) -> &crate::types::Version {
        &self.version
    }
    /// Generic key-value object structure used for flexible data representation throughout the API.
    pub fn custom_headers(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> {
        self.custom_headers.as_ref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn events(&self) -> &[::std::string::String] {
        use std::ops::Deref; self.events.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn max_retries(&self) -> i32 {
        self.max_retries
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn last_triggered_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_triggered_at.as_ref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn change_reason(&self) -> &str {
        use std::ops::Deref; self.change_reason.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn created_by(&self) -> &str {
        use std::ops::Deref; self.created_by.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn last_modified_by(&self) -> &str {
        use std::ops::Deref; self.last_modified_by.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn last_modified_at(&self) -> &::aws_smithy_types::DateTime {
        &self.last_modified_at
    }
}
impl GetWebhookOutput {
    /// Creates a new builder-style object to manufacture [`GetWebhookOutput`](crate::operation::get_webhook::GetWebhookOutput).
    pub fn builder() -> crate::operation::get_webhook::builders::GetWebhookOutputBuilder {
        crate::operation::get_webhook::builders::GetWebhookOutputBuilder::default()
    }
}

/// A builder for [`GetWebhookOutput`](crate::operation::get_webhook::GetWebhookOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetWebhookOutputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) enabled: ::std::option::Option<bool>,
    pub(crate) url: ::std::option::Option<::std::string::String>,
    pub(crate) method: ::std::option::Option<crate::types::HttpMethod>,
    pub(crate) version: ::std::option::Option<crate::types::Version>,
    pub(crate) custom_headers: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>,
    pub(crate) events: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
    pub(crate) max_retries: ::std::option::Option<i32>,
    pub(crate) last_triggered_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) change_reason: ::std::option::Option<::std::string::String>,
    pub(crate) created_by: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
    pub(crate) last_modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl GetWebhookOutputBuilder {
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn enabled(mut self, input: bool) -> Self {
        self.enabled = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.enabled = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
        &self.enabled
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.url = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.url = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.url
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn method(mut self, input: crate::types::HttpMethod) -> Self {
        self.method = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_method(mut self, input: ::std::option::Option<crate::types::HttpMethod>) -> Self {
        self.method = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_method(&self) -> &::std::option::Option<crate::types::HttpMethod> {
        &self.method
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn version(mut self, input: crate::types::Version) -> Self {
        self.version = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_version(mut self, input: ::std::option::Option<crate::types::Version>) -> Self {
        self.version = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_version(&self) -> &::std::option::Option<crate::types::Version> {
        &self.version
    }
    /// Adds a key-value pair to `custom_headers`.
    ///
    /// To override the contents of this collection use [`set_custom_headers`](Self::set_custom_headers).
    ///
    /// Generic key-value object structure used for flexible data representation throughout the API.
    pub fn custom_headers(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self {
        let mut hash_map = self.custom_headers.unwrap_or_default();
                        hash_map.insert(k.into(), v);
                        self.custom_headers = ::std::option::Option::Some(hash_map);
                        self
    }
    /// Generic key-value object structure used for flexible data representation throughout the API.
    pub fn set_custom_headers(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>) -> Self {
        self.custom_headers = input; self
    }
    /// Generic key-value object structure used for flexible data representation throughout the API.
    pub fn get_custom_headers(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> {
        &self.custom_headers
    }
    /// Appends an item to `events`.
    ///
    /// To override the contents of this collection use [`set_events`](Self::set_events).
    ///
    pub fn events(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.events.unwrap_or_default();
                        v.push(input.into());
                        self.events = ::std::option::Option::Some(v);
                        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_events(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
        self.events = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_events(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
        &self.events
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn max_retries(mut self, input: i32) -> Self {
        self.max_retries = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_max_retries(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_retries = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_max_retries(&self) -> &::std::option::Option<i32> {
        &self.max_retries
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn last_triggered_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_triggered_at = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_last_triggered_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_triggered_at = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_last_triggered_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_triggered_at
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn change_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.change_reason = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_change_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.change_reason = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_change_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.change_reason
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.created_by = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.created_by = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.created_by
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_modified_by = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_modified_by = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_modified_by
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn last_modified_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_at = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_last_modified_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_at = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_last_modified_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_at
    }
    /// Consumes the builder and constructs a [`GetWebhookOutput`](crate::operation::get_webhook::GetWebhookOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::name)
    /// - [`description`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::description)
    /// - [`enabled`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::enabled)
    /// - [`url`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::url)
    /// - [`method`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::method)
    /// - [`version`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::version)
    /// - [`events`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::events)
    /// - [`max_retries`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::max_retries)
    /// - [`change_reason`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::change_reason)
    /// - [`created_by`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::created_by)
    /// - [`created_at`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::created_at)
    /// - [`last_modified_by`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::last_modified_by)
    /// - [`last_modified_at`](crate::operation::get_webhook::builders::GetWebhookOutputBuilder::last_modified_at)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_webhook::GetWebhookOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(
            crate::operation::get_webhook::GetWebhookOutput {
                name: self.name
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("name", "name was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                description: self.description
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("description", "description was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                enabled: self.enabled
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("enabled", "enabled was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                url: self.url
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("url", "url was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                method: self.method
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("method", "method was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                version: self.version
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("version", "version was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                custom_headers: self.custom_headers
                ,
                events: self.events
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("events", "events was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                max_retries: self.max_retries
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("max_retries", "max_retries was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                last_triggered_at: self.last_triggered_at
                ,
                change_reason: self.change_reason
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("change_reason", "change_reason was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                created_by: self.created_by
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("created_by", "created_by was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                created_at: self.created_at
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("created_at", "created_at was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                last_modified_by: self.last_modified_by
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("last_modified_by", "last_modified_by was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
                last_modified_at: self.last_modified_at
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("last_modified_at", "last_modified_at was not specified but it is required when building GetWebhookOutput")
                    )?
                ,
            }
        )
    }
}