aws_sdk_securityir/operation/create_case/
_create_case_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateCaseInput {
6 pub client_token: ::std::option::Option<::std::string::String>,
8 pub resolver_type: ::std::option::Option<crate::types::ResolverType>,
10 pub title: ::std::option::Option<::std::string::String>,
12 pub description: ::std::option::Option<::std::string::String>,
14 pub engagement_type: ::std::option::Option<crate::types::EngagementType>,
16 pub reported_incident_start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
18 pub impacted_accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
20 pub watchers: ::std::option::Option<::std::vec::Vec<crate::types::Watcher>>,
22 pub threat_actor_ip_addresses: ::std::option::Option<::std::vec::Vec<crate::types::ThreatActorIp>>,
24 pub impacted_services: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
26 pub impacted_aws_regions: ::std::option::Option<::std::vec::Vec<crate::types::ImpactedAwsRegion>>,
28 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
30}
31impl CreateCaseInput {
32 pub fn client_token(&self) -> ::std::option::Option<&str> {
34 self.client_token.as_deref()
35 }
36 pub fn resolver_type(&self) -> ::std::option::Option<&crate::types::ResolverType> {
38 self.resolver_type.as_ref()
39 }
40 pub fn title(&self) -> ::std::option::Option<&str> {
42 self.title.as_deref()
43 }
44 pub fn description(&self) -> ::std::option::Option<&str> {
46 self.description.as_deref()
47 }
48 pub fn engagement_type(&self) -> ::std::option::Option<&crate::types::EngagementType> {
50 self.engagement_type.as_ref()
51 }
52 pub fn reported_incident_start_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
54 self.reported_incident_start_date.as_ref()
55 }
56 pub fn impacted_accounts(&self) -> &[::std::string::String] {
60 self.impacted_accounts.as_deref().unwrap_or_default()
61 }
62 pub fn watchers(&self) -> &[crate::types::Watcher] {
66 self.watchers.as_deref().unwrap_or_default()
67 }
68 pub fn threat_actor_ip_addresses(&self) -> &[crate::types::ThreatActorIp] {
72 self.threat_actor_ip_addresses.as_deref().unwrap_or_default()
73 }
74 pub fn impacted_services(&self) -> &[::std::string::String] {
78 self.impacted_services.as_deref().unwrap_or_default()
79 }
80 pub fn impacted_aws_regions(&self) -> &[crate::types::ImpactedAwsRegion] {
84 self.impacted_aws_regions.as_deref().unwrap_or_default()
85 }
86 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 pub fn builder() -> crate::operation::create_case::builders::CreateCaseInputBuilder {
112 crate::operation::create_case::builders::CreateCaseInputBuilder::default()
113 }
114}
115
116#[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 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 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.client_token = input;
142 self
143 }
144 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
146 &self.client_token
147 }
148 pub fn resolver_type(mut self, input: crate::types::ResolverType) -> Self {
151 self.resolver_type = ::std::option::Option::Some(input);
152 self
153 }
154 pub fn set_resolver_type(mut self, input: ::std::option::Option<crate::types::ResolverType>) -> Self {
156 self.resolver_type = input;
157 self
158 }
159 pub fn get_resolver_type(&self) -> &::std::option::Option<crate::types::ResolverType> {
161 &self.resolver_type
162 }
163 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 pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171 self.title = input;
172 self
173 }
174 pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
176 &self.title
177 }
178 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186 self.description = input;
187 self
188 }
189 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
191 &self.description
192 }
193 pub fn engagement_type(mut self, input: crate::types::EngagementType) -> Self {
196 self.engagement_type = ::std::option::Option::Some(input);
197 self
198 }
199 pub fn set_engagement_type(mut self, input: ::std::option::Option<crate::types::EngagementType>) -> Self {
201 self.engagement_type = input;
202 self
203 }
204 pub fn get_engagement_type(&self) -> &::std::option::Option<crate::types::EngagementType> {
206 &self.engagement_type
207 }
208 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 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 pub fn get_reported_incident_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
221 &self.reported_incident_start_date
222 }
223 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 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 pub fn get_impacted_accounts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
241 &self.impacted_accounts
242 }
243 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 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 pub fn get_watchers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Watcher>> {
261 &self.watchers
262 }
263 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 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 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 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 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 pub fn get_impacted_services(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
301 &self.impacted_services
302 }
303 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 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 pub fn get_impacted_aws_regions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImpactedAwsRegion>> {
321 &self.impacted_aws_regions
322 }
323 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
341 &self.tags
342 }
343 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}