aws_sdk_securityir/operation/create_case/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_case::_create_case_output::CreateCaseOutputBuilder;
3
4pub use crate::operation::create_case::_create_case_input::CreateCaseInputBuilder;
5
6impl crate::operation::create_case::builders::CreateCaseInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_case::CreateCaseOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_case::CreateCaseError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_case();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateCase`.
24///
25/// <p>Creates a new case.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateCaseFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_case::builders::CreateCaseInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_case::CreateCaseOutput,
35        crate::operation::create_case::CreateCaseError,
36    > for CreateCaseFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_case::CreateCaseOutput,
44            crate::operation::create_case::CreateCaseError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateCaseFluentBuilder {
51    /// Creates a new `CreateCaseFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateCase as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_case::builders::CreateCaseInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_case::CreateCaseOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_case::CreateCaseError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_case::CreateCase::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_case::CreateCase::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_case::CreateCaseOutput,
97        crate::operation::create_case::CreateCaseError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <note>
112    /// <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>
113    /// </note>
114    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.client_token(input.into());
116        self
117    }
118    /// <note>
119    /// <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>
120    /// </note>
121    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_client_token(input);
123        self
124    }
125    /// <note>
126    /// <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>
127    /// </note>
128    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_client_token()
130    }
131    /// <p>Required element used in combination with CreateCase to identify the resolver type.</p>
132    pub fn resolver_type(mut self, input: crate::types::ResolverType) -> Self {
133        self.inner = self.inner.resolver_type(input);
134        self
135    }
136    /// <p>Required element used in combination with CreateCase to identify the resolver type.</p>
137    pub fn set_resolver_type(mut self, input: ::std::option::Option<crate::types::ResolverType>) -> Self {
138        self.inner = self.inner.set_resolver_type(input);
139        self
140    }
141    /// <p>Required element used in combination with CreateCase to identify the resolver type.</p>
142    pub fn get_resolver_type(&self) -> &::std::option::Option<crate::types::ResolverType> {
143        self.inner.get_resolver_type()
144    }
145    /// <p>Required element used in combination with CreateCase to provide a title for the new case.</p>
146    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.title(input.into());
148        self
149    }
150    /// <p>Required element used in combination with CreateCase to provide a title for the new case.</p>
151    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_title(input);
153        self
154    }
155    /// <p>Required element used in combination with CreateCase to provide a title for the new case.</p>
156    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_title()
158    }
159    /// <p>Required element used in combination with CreateCase</p>
160    /// <p>to provide a description for the new case.</p>
161    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.description(input.into());
163        self
164    }
165    /// <p>Required element used in combination with CreateCase</p>
166    /// <p>to provide a description for the new case.</p>
167    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_description(input);
169        self
170    }
171    /// <p>Required element used in combination with CreateCase</p>
172    /// <p>to provide a description for the new case.</p>
173    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_description()
175    }
176    /// <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>
177    pub fn engagement_type(mut self, input: crate::types::EngagementType) -> Self {
178        self.inner = self.inner.engagement_type(input);
179        self
180    }
181    /// <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>
182    pub fn set_engagement_type(mut self, input: ::std::option::Option<crate::types::EngagementType>) -> Self {
183        self.inner = self.inner.set_engagement_type(input);
184        self
185    }
186    /// <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>
187    pub fn get_engagement_type(&self) -> &::std::option::Option<crate::types::EngagementType> {
188        self.inner.get_engagement_type()
189    }
190    /// <p>Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.</p>
191    pub fn reported_incident_start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
192        self.inner = self.inner.reported_incident_start_date(input);
193        self
194    }
195    /// <p>Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.</p>
196    pub fn set_reported_incident_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
197        self.inner = self.inner.set_reported_incident_start_date(input);
198        self
199    }
200    /// <p>Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.</p>
201    pub fn get_reported_incident_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
202        self.inner.get_reported_incident_start_date()
203    }
204    ///
205    /// Appends an item to `impactedAccounts`.
206    ///
207    /// To override the contents of this collection use [`set_impacted_accounts`](Self::set_impacted_accounts).
208    ///
209    /// <p>Required element used in combination with CreateCase to provide a list of impacted accounts.</p><note>
210    /// <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>
211    /// </note>
212    pub fn impacted_accounts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.impacted_accounts(input.into());
214        self
215    }
216    /// <p>Required element used in combination with CreateCase to provide a list of impacted accounts.</p><note>
217    /// <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>
218    /// </note>
219    pub fn set_impacted_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
220        self.inner = self.inner.set_impacted_accounts(input);
221        self
222    }
223    /// <p>Required element used in combination with CreateCase to provide a list of impacted accounts.</p><note>
224    /// <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>
225    /// </note>
226    pub fn get_impacted_accounts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
227        self.inner.get_impacted_accounts()
228    }
229    ///
230    /// Appends an item to `watchers`.
231    ///
232    /// To override the contents of this collection use [`set_watchers`](Self::set_watchers).
233    ///
234    /// <p>Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.</p>
235    pub fn watchers(mut self, input: crate::types::Watcher) -> Self {
236        self.inner = self.inner.watchers(input);
237        self
238    }
239    /// <p>Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.</p>
240    pub fn set_watchers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Watcher>>) -> Self {
241        self.inner = self.inner.set_watchers(input);
242        self
243    }
244    /// <p>Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.</p>
245    pub fn get_watchers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Watcher>> {
246        self.inner.get_watchers()
247    }
248    ///
249    /// Appends an item to `threatActorIpAddresses`.
250    ///
251    /// To override the contents of this collection use [`set_threat_actor_ip_addresses`](Self::set_threat_actor_ip_addresses).
252    ///
253    /// <p>An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.</p>
254    pub fn threat_actor_ip_addresses(mut self, input: crate::types::ThreatActorIp) -> Self {
255        self.inner = self.inner.threat_actor_ip_addresses(input);
256        self
257    }
258    /// <p>An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.</p>
259    pub fn set_threat_actor_ip_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ThreatActorIp>>) -> Self {
260        self.inner = self.inner.set_threat_actor_ip_addresses(input);
261        self
262    }
263    /// <p>An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.</p>
264    pub fn get_threat_actor_ip_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ThreatActorIp>> {
265        self.inner.get_threat_actor_ip_addresses()
266    }
267    ///
268    /// Appends an item to `impactedServices`.
269    ///
270    /// To override the contents of this collection use [`set_impacted_services`](Self::set_impacted_services).
271    ///
272    /// <p>An optional element used in combination with CreateCase to provide a list of services impacted.</p>
273    pub fn impacted_services(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
274        self.inner = self.inner.impacted_services(input.into());
275        self
276    }
277    /// <p>An optional element used in combination with CreateCase to provide a list of services impacted.</p>
278    pub fn set_impacted_services(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
279        self.inner = self.inner.set_impacted_services(input);
280        self
281    }
282    /// <p>An optional element used in combination with CreateCase to provide a list of services impacted.</p>
283    pub fn get_impacted_services(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
284        self.inner.get_impacted_services()
285    }
286    ///
287    /// Appends an item to `impactedAwsRegions`.
288    ///
289    /// To override the contents of this collection use [`set_impacted_aws_regions`](Self::set_impacted_aws_regions).
290    ///
291    /// <p>An optional element used in combination with CreateCase to provide a list of impacted regions.</p>
292    pub fn impacted_aws_regions(mut self, input: crate::types::ImpactedAwsRegion) -> Self {
293        self.inner = self.inner.impacted_aws_regions(input);
294        self
295    }
296    /// <p>An optional element used in combination with CreateCase to provide a list of impacted regions.</p>
297    pub fn set_impacted_aws_regions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImpactedAwsRegion>>) -> Self {
298        self.inner = self.inner.set_impacted_aws_regions(input);
299        self
300    }
301    /// <p>An optional element used in combination with CreateCase to provide a list of impacted regions.</p>
302    pub fn get_impacted_aws_regions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImpactedAwsRegion>> {
303        self.inner.get_impacted_aws_regions()
304    }
305    ///
306    /// Adds a key-value pair to `tags`.
307    ///
308    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
309    ///
310    /// <p>An optional element used in combination with CreateCase to add customer specified tags to a case.</p>
311    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
312        self.inner = self.inner.tags(k.into(), v.into());
313        self
314    }
315    /// <p>An optional element used in combination with CreateCase to add customer specified tags to a case.</p>
316    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
317        self.inner = self.inner.set_tags(input);
318        self
319    }
320    /// <p>An optional element used in combination with CreateCase to add customer specified tags to a case.</p>
321    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
322        self.inner.get_tags()
323    }
324}