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