aws_sdk_securityir/operation/create_case/
_create_case_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateCaseInput {
6    /// <note>
7    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
8    /// </note>
9    pub client_token: ::std::option::Option<::std::string::String>,
10    /// <p>Required element used in combination with CreateCase to identify the resolver type.</p>
11    pub resolver_type: ::std::option::Option<crate::types::ResolverType>,
12    /// <p>Required element used in combination with CreateCase to provide a title for the new case.</p>
13    pub title: ::std::option::Option<::std::string::String>,
14    /// <p>Required element used in combination with CreateCase</p>
15    /// <p>to provide a description for the new case.</p>
16    pub description: ::std::option::Option<::std::string::String>,
17    /// <p>Required element used in combination with CreateCase to provide an engagement type for the new cases. Available engagement types include Security Incident | Investigation</p>
18    pub engagement_type: ::std::option::Option<crate::types::EngagementType>,
19    /// <p>Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.</p>
20    pub reported_incident_start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
21    /// <p>Required element used in combination with CreateCase to provide a list of impacted accounts.</p><note>
22    /// <p>AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be <code>123123123</code> which is nine digits, and with zero-prepend would be <code>000123123123</code>. Not zero-prepending to 12 digits could result in errors.</p>
23    /// </note>
24    pub impacted_accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
25    /// <p>Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.</p>
26    pub watchers: ::std::option::Option<::std::vec::Vec<crate::types::Watcher>>,
27    /// <p>An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.</p>
28    pub threat_actor_ip_addresses: ::std::option::Option<::std::vec::Vec<crate::types::ThreatActorIp>>,
29    /// <p>An optional element used in combination with CreateCase to provide a list of services impacted.</p>
30    pub impacted_services: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
31    /// <p>An optional element used in combination with CreateCase to provide a list of impacted regions.</p>
32    pub impacted_aws_regions: ::std::option::Option<::std::vec::Vec<crate::types::ImpactedAwsRegion>>,
33    /// <p>An optional element used in combination with CreateCase to add customer specified tags to a case.</p>
34    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
35}
36impl CreateCaseInput {
37    /// <note>
38    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
39    /// </note>
40    pub fn client_token(&self) -> ::std::option::Option<&str> {
41        self.client_token.as_deref()
42    }
43    /// <p>Required element used in combination with CreateCase to identify the resolver type.</p>
44    pub fn resolver_type(&self) -> ::std::option::Option<&crate::types::ResolverType> {
45        self.resolver_type.as_ref()
46    }
47    /// <p>Required element used in combination with CreateCase to provide a title for the new case.</p>
48    pub fn title(&self) -> ::std::option::Option<&str> {
49        self.title.as_deref()
50    }
51    /// <p>Required element used in combination with CreateCase</p>
52    /// <p>to provide a description for the new case.</p>
53    pub fn description(&self) -> ::std::option::Option<&str> {
54        self.description.as_deref()
55    }
56    /// <p>Required element used in combination with CreateCase to provide an engagement type for the new cases. Available engagement types include Security Incident | Investigation</p>
57    pub fn engagement_type(&self) -> ::std::option::Option<&crate::types::EngagementType> {
58        self.engagement_type.as_ref()
59    }
60    /// <p>Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.</p>
61    pub fn reported_incident_start_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
62        self.reported_incident_start_date.as_ref()
63    }
64    /// <p>Required element used in combination with CreateCase to provide a list of impacted accounts.</p><note>
65    /// <p>AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be <code>123123123</code> which is nine digits, and with zero-prepend would be <code>000123123123</code>. Not zero-prepending to 12 digits could result in errors.</p>
66    /// </note>
67    ///
68    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.impacted_accounts.is_none()`.
69    pub fn impacted_accounts(&self) -> &[::std::string::String] {
70        self.impacted_accounts.as_deref().unwrap_or_default()
71    }
72    /// <p>Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.</p>
73    ///
74    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.watchers.is_none()`.
75    pub fn watchers(&self) -> &[crate::types::Watcher] {
76        self.watchers.as_deref().unwrap_or_default()
77    }
78    /// <p>An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.</p>
79    ///
80    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.threat_actor_ip_addresses.is_none()`.
81    pub fn threat_actor_ip_addresses(&self) -> &[crate::types::ThreatActorIp] {
82        self.threat_actor_ip_addresses.as_deref().unwrap_or_default()
83    }
84    /// <p>An optional element used in combination with CreateCase to provide a list of services impacted.</p>
85    ///
86    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.impacted_services.is_none()`.
87    pub fn impacted_services(&self) -> &[::std::string::String] {
88        self.impacted_services.as_deref().unwrap_or_default()
89    }
90    /// <p>An optional element used in combination with CreateCase to provide a list of impacted regions.</p>
91    ///
92    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.impacted_aws_regions.is_none()`.
93    pub fn impacted_aws_regions(&self) -> &[crate::types::ImpactedAwsRegion] {
94        self.impacted_aws_regions.as_deref().unwrap_or_default()
95    }
96    /// <p>An optional element used in combination with CreateCase to add customer specified tags to a case.</p>
97    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
98        self.tags.as_ref()
99    }
100}
101impl ::std::fmt::Debug for CreateCaseInput {
102    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
103        let mut formatter = f.debug_struct("CreateCaseInput");
104        formatter.field("client_token", &self.client_token);
105        formatter.field("resolver_type", &self.resolver_type);
106        formatter.field("title", &"*** Sensitive Data Redacted ***");
107        formatter.field("description", &"*** Sensitive Data Redacted ***");
108        formatter.field("engagement_type", &self.engagement_type);
109        formatter.field("reported_incident_start_date", &self.reported_incident_start_date);
110        formatter.field("impacted_accounts", &self.impacted_accounts);
111        formatter.field("watchers", &self.watchers);
112        formatter.field("threat_actor_ip_addresses", &self.threat_actor_ip_addresses);
113        formatter.field("impacted_services", &self.impacted_services);
114        formatter.field("impacted_aws_regions", &self.impacted_aws_regions);
115        formatter.field("tags", &self.tags);
116        formatter.finish()
117    }
118}
119impl CreateCaseInput {
120    /// Creates a new builder-style object to manufacture [`CreateCaseInput`](crate::operation::create_case::CreateCaseInput).
121    pub fn builder() -> crate::operation::create_case::builders::CreateCaseInputBuilder {
122        crate::operation::create_case::builders::CreateCaseInputBuilder::default()
123    }
124}
125
126/// A builder for [`CreateCaseInput`](crate::operation::create_case::CreateCaseInput).
127#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
128#[non_exhaustive]
129pub struct CreateCaseInputBuilder {
130    pub(crate) client_token: ::std::option::Option<::std::string::String>,
131    pub(crate) resolver_type: ::std::option::Option<crate::types::ResolverType>,
132    pub(crate) title: ::std::option::Option<::std::string::String>,
133    pub(crate) description: ::std::option::Option<::std::string::String>,
134    pub(crate) engagement_type: ::std::option::Option<crate::types::EngagementType>,
135    pub(crate) reported_incident_start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
136    pub(crate) impacted_accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
137    pub(crate) watchers: ::std::option::Option<::std::vec::Vec<crate::types::Watcher>>,
138    pub(crate) threat_actor_ip_addresses: ::std::option::Option<::std::vec::Vec<crate::types::ThreatActorIp>>,
139    pub(crate) impacted_services: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
140    pub(crate) impacted_aws_regions: ::std::option::Option<::std::vec::Vec<crate::types::ImpactedAwsRegion>>,
141    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
142}
143impl CreateCaseInputBuilder {
144    /// <note>
145    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
146    /// </note>
147    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.client_token = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <note>
152    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
153    /// </note>
154    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.client_token = input;
156        self
157    }
158    /// <note>
159    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
160    /// </note>
161    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
162        &self.client_token
163    }
164    /// <p>Required element used in combination with CreateCase to identify the resolver type.</p>
165    /// This field is required.
166    pub fn resolver_type(mut self, input: crate::types::ResolverType) -> Self {
167        self.resolver_type = ::std::option::Option::Some(input);
168        self
169    }
170    /// <p>Required element used in combination with CreateCase to identify the resolver type.</p>
171    pub fn set_resolver_type(mut self, input: ::std::option::Option<crate::types::ResolverType>) -> Self {
172        self.resolver_type = input;
173        self
174    }
175    /// <p>Required element used in combination with CreateCase to identify the resolver type.</p>
176    pub fn get_resolver_type(&self) -> &::std::option::Option<crate::types::ResolverType> {
177        &self.resolver_type
178    }
179    /// <p>Required element used in combination with CreateCase to provide a title for the new case.</p>
180    /// This field is required.
181    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.title = ::std::option::Option::Some(input.into());
183        self
184    }
185    /// <p>Required element used in combination with CreateCase to provide a title for the new case.</p>
186    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.title = input;
188        self
189    }
190    /// <p>Required element used in combination with CreateCase to provide a title for the new case.</p>
191    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
192        &self.title
193    }
194    /// <p>Required element used in combination with CreateCase</p>
195    /// <p>to provide a description for the new case.</p>
196    /// This field is required.
197    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.description = ::std::option::Option::Some(input.into());
199        self
200    }
201    /// <p>Required element used in combination with CreateCase</p>
202    /// <p>to provide a description for the new case.</p>
203    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.description = input;
205        self
206    }
207    /// <p>Required element used in combination with CreateCase</p>
208    /// <p>to provide a description for the new case.</p>
209    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
210        &self.description
211    }
212    /// <p>Required element used in combination with CreateCase to provide an engagement type for the new cases. Available engagement types include Security Incident | Investigation</p>
213    /// This field is required.
214    pub fn engagement_type(mut self, input: crate::types::EngagementType) -> Self {
215        self.engagement_type = ::std::option::Option::Some(input);
216        self
217    }
218    /// <p>Required element used in combination with CreateCase to provide an engagement type for the new cases. Available engagement types include Security Incident | Investigation</p>
219    pub fn set_engagement_type(mut self, input: ::std::option::Option<crate::types::EngagementType>) -> Self {
220        self.engagement_type = input;
221        self
222    }
223    /// <p>Required element used in combination with CreateCase to provide an engagement type for the new cases. Available engagement types include Security Incident | Investigation</p>
224    pub fn get_engagement_type(&self) -> &::std::option::Option<crate::types::EngagementType> {
225        &self.engagement_type
226    }
227    /// <p>Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.</p>
228    /// This field is required.
229    pub fn reported_incident_start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
230        self.reported_incident_start_date = ::std::option::Option::Some(input);
231        self
232    }
233    /// <p>Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.</p>
234    pub fn set_reported_incident_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
235        self.reported_incident_start_date = input;
236        self
237    }
238    /// <p>Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.</p>
239    pub fn get_reported_incident_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
240        &self.reported_incident_start_date
241    }
242    /// Appends an item to `impacted_accounts`.
243    ///
244    /// To override the contents of this collection use [`set_impacted_accounts`](Self::set_impacted_accounts).
245    ///
246    /// <p>Required element used in combination with CreateCase to provide a list of impacted accounts.</p><note>
247    /// <p>AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be <code>123123123</code> which is nine digits, and with zero-prepend would be <code>000123123123</code>. Not zero-prepending to 12 digits could result in errors.</p>
248    /// </note>
249    pub fn impacted_accounts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
250        let mut v = self.impacted_accounts.unwrap_or_default();
251        v.push(input.into());
252        self.impacted_accounts = ::std::option::Option::Some(v);
253        self
254    }
255    /// <p>Required element used in combination with CreateCase to provide a list of impacted accounts.</p><note>
256    /// <p>AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be <code>123123123</code> which is nine digits, and with zero-prepend would be <code>000123123123</code>. Not zero-prepending to 12 digits could result in errors.</p>
257    /// </note>
258    pub fn set_impacted_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
259        self.impacted_accounts = input;
260        self
261    }
262    /// <p>Required element used in combination with CreateCase to provide a list of impacted accounts.</p><note>
263    /// <p>AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be <code>123123123</code> which is nine digits, and with zero-prepend would be <code>000123123123</code>. Not zero-prepending to 12 digits could result in errors.</p>
264    /// </note>
265    pub fn get_impacted_accounts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
266        &self.impacted_accounts
267    }
268    /// Appends an item to `watchers`.
269    ///
270    /// To override the contents of this collection use [`set_watchers`](Self::set_watchers).
271    ///
272    /// <p>Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.</p>
273    pub fn watchers(mut self, input: crate::types::Watcher) -> Self {
274        let mut v = self.watchers.unwrap_or_default();
275        v.push(input);
276        self.watchers = ::std::option::Option::Some(v);
277        self
278    }
279    /// <p>Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.</p>
280    pub fn set_watchers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Watcher>>) -> Self {
281        self.watchers = input;
282        self
283    }
284    /// <p>Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.</p>
285    pub fn get_watchers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Watcher>> {
286        &self.watchers
287    }
288    /// Appends an item to `threat_actor_ip_addresses`.
289    ///
290    /// To override the contents of this collection use [`set_threat_actor_ip_addresses`](Self::set_threat_actor_ip_addresses).
291    ///
292    /// <p>An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.</p>
293    pub fn threat_actor_ip_addresses(mut self, input: crate::types::ThreatActorIp) -> Self {
294        let mut v = self.threat_actor_ip_addresses.unwrap_or_default();
295        v.push(input);
296        self.threat_actor_ip_addresses = ::std::option::Option::Some(v);
297        self
298    }
299    /// <p>An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.</p>
300    pub fn set_threat_actor_ip_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ThreatActorIp>>) -> Self {
301        self.threat_actor_ip_addresses = input;
302        self
303    }
304    /// <p>An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.</p>
305    pub fn get_threat_actor_ip_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ThreatActorIp>> {
306        &self.threat_actor_ip_addresses
307    }
308    /// Appends an item to `impacted_services`.
309    ///
310    /// To override the contents of this collection use [`set_impacted_services`](Self::set_impacted_services).
311    ///
312    /// <p>An optional element used in combination with CreateCase to provide a list of services impacted.</p>
313    pub fn impacted_services(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
314        let mut v = self.impacted_services.unwrap_or_default();
315        v.push(input.into());
316        self.impacted_services = ::std::option::Option::Some(v);
317        self
318    }
319    /// <p>An optional element used in combination with CreateCase to provide a list of services impacted.</p>
320    pub fn set_impacted_services(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
321        self.impacted_services = input;
322        self
323    }
324    /// <p>An optional element used in combination with CreateCase to provide a list of services impacted.</p>
325    pub fn get_impacted_services(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
326        &self.impacted_services
327    }
328    /// Appends an item to `impacted_aws_regions`.
329    ///
330    /// To override the contents of this collection use [`set_impacted_aws_regions`](Self::set_impacted_aws_regions).
331    ///
332    /// <p>An optional element used in combination with CreateCase to provide a list of impacted regions.</p>
333    pub fn impacted_aws_regions(mut self, input: crate::types::ImpactedAwsRegion) -> Self {
334        let mut v = self.impacted_aws_regions.unwrap_or_default();
335        v.push(input);
336        self.impacted_aws_regions = ::std::option::Option::Some(v);
337        self
338    }
339    /// <p>An optional element used in combination with CreateCase to provide a list of impacted regions.</p>
340    pub fn set_impacted_aws_regions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImpactedAwsRegion>>) -> Self {
341        self.impacted_aws_regions = input;
342        self
343    }
344    /// <p>An optional element used in combination with CreateCase to provide a list of impacted regions.</p>
345    pub fn get_impacted_aws_regions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImpactedAwsRegion>> {
346        &self.impacted_aws_regions
347    }
348    /// Adds a key-value pair to `tags`.
349    ///
350    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
351    ///
352    /// <p>An optional element used in combination with CreateCase to add customer specified tags to a case.</p>
353    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
354        let mut hash_map = self.tags.unwrap_or_default();
355        hash_map.insert(k.into(), v.into());
356        self.tags = ::std::option::Option::Some(hash_map);
357        self
358    }
359    /// <p>An optional element used in combination with CreateCase to add customer specified tags to a case.</p>
360    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
361        self.tags = input;
362        self
363    }
364    /// <p>An optional element used in combination with CreateCase to add customer specified tags to a case.</p>
365    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
366        &self.tags
367    }
368    /// Consumes the builder and constructs a [`CreateCaseInput`](crate::operation::create_case::CreateCaseInput).
369    pub fn build(self) -> ::std::result::Result<crate::operation::create_case::CreateCaseInput, ::aws_smithy_types::error::operation::BuildError> {
370        ::std::result::Result::Ok(crate::operation::create_case::CreateCaseInput {
371            client_token: self.client_token,
372            resolver_type: self.resolver_type,
373            title: self.title,
374            description: self.description,
375            engagement_type: self.engagement_type,
376            reported_incident_start_date: self.reported_incident_start_date,
377            impacted_accounts: self.impacted_accounts,
378            watchers: self.watchers,
379            threat_actor_ip_addresses: self.threat_actor_ip_addresses,
380            impacted_services: self.impacted_services,
381            impacted_aws_regions: self.impacted_aws_regions,
382            tags: self.tags,
383        })
384    }
385}
386impl ::std::fmt::Debug for CreateCaseInputBuilder {
387    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
388        let mut formatter = f.debug_struct("CreateCaseInputBuilder");
389        formatter.field("client_token", &self.client_token);
390        formatter.field("resolver_type", &self.resolver_type);
391        formatter.field("title", &"*** Sensitive Data Redacted ***");
392        formatter.field("description", &"*** Sensitive Data Redacted ***");
393        formatter.field("engagement_type", &self.engagement_type);
394        formatter.field("reported_incident_start_date", &self.reported_incident_start_date);
395        formatter.field("impacted_accounts", &self.impacted_accounts);
396        formatter.field("watchers", &self.watchers);
397        formatter.field("threat_actor_ip_addresses", &self.threat_actor_ip_addresses);
398        formatter.field("impacted_services", &self.impacted_services);
399        formatter.field("impacted_aws_regions", &self.impacted_aws_regions);
400        formatter.field("tags", &self.tags);
401        formatter.finish()
402    }
403}