aws_sdk_shield/operation/associate_proactive_engagement_details/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::associate_proactive_engagement_details::_associate_proactive_engagement_details_output::AssociateProactiveEngagementDetailsOutputBuilder;
3
4pub use crate::operation::associate_proactive_engagement_details::_associate_proactive_engagement_details_input::AssociateProactiveEngagementDetailsInputBuilder;
5
6impl crate::operation::associate_proactive_engagement_details::builders::AssociateProactiveEngagementDetailsInputBuilder {
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::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.associate_proactive_engagement_details();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AssociateProactiveEngagementDetails`.
24///
25/// <p>Initializes proactive engagement and sets the list of contacts for the Shield Response Team (SRT) to use. You must provide at least one phone number in the emergency contact list.</p>
26/// <p>After you have initialized proactive engagement using this call, to disable or enable proactive engagement, use the calls <code>DisableProactiveEngagement</code> and <code>EnableProactiveEngagement</code>.</p><note>
27/// <p>This call defines the list of email addresses and phone numbers that the SRT can use to contact you for escalations to the SRT and to initiate proactive customer support.</p>
28/// <p>The contacts that you provide in the request replace any contacts that were already defined. If you already have contacts defined and want to use them, retrieve the list using <code>DescribeEmergencyContactSettings</code> and then provide it to this call.</p>
29/// </note>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct AssociateProactiveEngagementDetailsFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::associate_proactive_engagement_details::builders::AssociateProactiveEngagementDetailsInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsOutput,
39        crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsError,
40    > for AssociateProactiveEngagementDetailsFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsOutput,
48            crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl AssociateProactiveEngagementDetailsFluentBuilder {
55    /// Creates a new `AssociateProactiveEngagementDetailsFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the AssociateProactiveEngagementDetails as a reference.
64    pub fn as_input(&self) -> &crate::operation::associate_proactive_engagement_details::builders::AssociateProactiveEngagementDetailsInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins =
89            crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetails::operation_runtime_plugins(
90                self.handle.runtime_plugins.clone(),
91                &self.handle.conf,
92                self.config_override,
93            );
94        crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetails::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsOutput,
102        crate::operation::associate_proactive_engagement_details::AssociateProactiveEngagementDetailsError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    ///
117    /// Appends an item to `EmergencyContactList`.
118    ///
119    /// To override the contents of this collection use [`set_emergency_contact_list`](Self::set_emergency_contact_list).
120    ///
121    /// <p>A list of email addresses and phone numbers that the Shield Response Team (SRT) can use to contact you for escalations to the SRT and to initiate proactive customer support.</p>
122    /// <p>To enable proactive engagement, the contact list must include at least one phone number.</p><note>
123    /// <p>The contacts that you provide here replace any contacts that were already defined. If you already have contacts defined and want to use them, retrieve the list using <code>DescribeEmergencyContactSettings</code> and then provide it here.</p>
124    /// </note>
125    pub fn emergency_contact_list(mut self, input: crate::types::EmergencyContact) -> Self {
126        self.inner = self.inner.emergency_contact_list(input);
127        self
128    }
129    /// <p>A list of email addresses and phone numbers that the Shield Response Team (SRT) can use to contact you for escalations to the SRT and to initiate proactive customer support.</p>
130    /// <p>To enable proactive engagement, the contact list must include at least one phone number.</p><note>
131    /// <p>The contacts that you provide here replace any contacts that were already defined. If you already have contacts defined and want to use them, retrieve the list using <code>DescribeEmergencyContactSettings</code> and then provide it here.</p>
132    /// </note>
133    pub fn set_emergency_contact_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EmergencyContact>>) -> Self {
134        self.inner = self.inner.set_emergency_contact_list(input);
135        self
136    }
137    /// <p>A list of email addresses and phone numbers that the Shield Response Team (SRT) can use to contact you for escalations to the SRT and to initiate proactive customer support.</p>
138    /// <p>To enable proactive engagement, the contact list must include at least one phone number.</p><note>
139    /// <p>The contacts that you provide here replace any contacts that were already defined. If you already have contacts defined and want to use them, retrieve the list using <code>DescribeEmergencyContactSettings</code> and then provide it here.</p>
140    /// </note>
141    pub fn get_emergency_contact_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EmergencyContact>> {
142        self.inner.get_emergency_contact_list()
143    }
144}