aws-sdk-lightsail 1.109.0

AWS SDK for Amazon Lightsail
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_contact_method::_create_contact_method_input::CreateContactMethodInputBuilder;

pub use crate::operation::create_contact_method::_create_contact_method_output::CreateContactMethodOutputBuilder;

impl crate::operation::create_contact_method::builders::CreateContactMethodInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_contact_method::CreateContactMethodOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_contact_method::CreateContactMethodError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_contact_method();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateContactMethod`.
///
/// <p>Creates an email or SMS text message contact method.</p>
/// <p>A contact method is used to send you notifications about your Amazon Lightsail resources. You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services Regions, and SMS text messages cannot be sent to some countries/regions. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-notifications">Notifications in Amazon Lightsail</a>.</p>
/// <p>The <code>create contact method</code> operation supports tag-based access control via request tags. For more information, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags">Lightsail Developer Guide</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateContactMethodFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_contact_method::builders::CreateContactMethodInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_contact_method::CreateContactMethodOutput,
        crate::operation::create_contact_method::CreateContactMethodError,
    > for CreateContactMethodFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_contact_method::CreateContactMethodOutput,
            crate::operation::create_contact_method::CreateContactMethodError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateContactMethodFluentBuilder {
    /// Creates a new `CreateContactMethodFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateContactMethod as a reference.
    pub fn as_input(&self) -> &crate::operation::create_contact_method::builders::CreateContactMethodInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_contact_method::CreateContactMethodOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_contact_method::CreateContactMethodError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_contact_method::CreateContactMethod::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_contact_method::CreateContactMethod::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_contact_method::CreateContactMethodOutput,
        crate::operation::create_contact_method::CreateContactMethodError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The protocol of the contact method, such as <code>Email</code> or <code>SMS</code> (text messaging).</p>
    /// <p>The <code>SMS</code> protocol is supported only in the following Amazon Web Services Regions.</p>
    /// <ul>
    /// <li>
    /// <p>US East (N. Virginia) (<code>us-east-1</code>)</p></li>
    /// <li>
    /// <p>US West (Oregon) (<code>us-west-2</code>)</p></li>
    /// <li>
    /// <p>Europe (Ireland) (<code>eu-west-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Tokyo) (<code>ap-northeast-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Singapore) (<code>ap-southeast-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Sydney) (<code>ap-southeast-2</code>)</p></li>
    /// </ul>
    /// <p>For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions where SMS text messaging is supported, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-supported-regions-countries.html">Supported Regions and Countries</a> in the <i>Amazon SNS Developer Guide</i>.</p>
    /// <p>For more information about notifications in Amazon Lightsail, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-notifications">Notifications in Amazon Lightsail</a>.</p>
    pub fn protocol(mut self, input: crate::types::ContactProtocol) -> Self {
        self.inner = self.inner.protocol(input);
        self
    }
    /// <p>The protocol of the contact method, such as <code>Email</code> or <code>SMS</code> (text messaging).</p>
    /// <p>The <code>SMS</code> protocol is supported only in the following Amazon Web Services Regions.</p>
    /// <ul>
    /// <li>
    /// <p>US East (N. Virginia) (<code>us-east-1</code>)</p></li>
    /// <li>
    /// <p>US West (Oregon) (<code>us-west-2</code>)</p></li>
    /// <li>
    /// <p>Europe (Ireland) (<code>eu-west-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Tokyo) (<code>ap-northeast-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Singapore) (<code>ap-southeast-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Sydney) (<code>ap-southeast-2</code>)</p></li>
    /// </ul>
    /// <p>For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions where SMS text messaging is supported, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-supported-regions-countries.html">Supported Regions and Countries</a> in the <i>Amazon SNS Developer Guide</i>.</p>
    /// <p>For more information about notifications in Amazon Lightsail, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-notifications">Notifications in Amazon Lightsail</a>.</p>
    pub fn set_protocol(mut self, input: ::std::option::Option<crate::types::ContactProtocol>) -> Self {
        self.inner = self.inner.set_protocol(input);
        self
    }
    /// <p>The protocol of the contact method, such as <code>Email</code> or <code>SMS</code> (text messaging).</p>
    /// <p>The <code>SMS</code> protocol is supported only in the following Amazon Web Services Regions.</p>
    /// <ul>
    /// <li>
    /// <p>US East (N. Virginia) (<code>us-east-1</code>)</p></li>
    /// <li>
    /// <p>US West (Oregon) (<code>us-west-2</code>)</p></li>
    /// <li>
    /// <p>Europe (Ireland) (<code>eu-west-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Tokyo) (<code>ap-northeast-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Singapore) (<code>ap-southeast-1</code>)</p></li>
    /// <li>
    /// <p>Asia Pacific (Sydney) (<code>ap-southeast-2</code>)</p></li>
    /// </ul>
    /// <p>For a list of countries/regions where SMS text messages can be sent, and the latest Amazon Web Services Regions where SMS text messaging is supported, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-supported-regions-countries.html">Supported Regions and Countries</a> in the <i>Amazon SNS Developer Guide</i>.</p>
    /// <p>For more information about notifications in Amazon Lightsail, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-notifications">Notifications in Amazon Lightsail</a>.</p>
    pub fn get_protocol(&self) -> &::std::option::Option<crate::types::ContactProtocol> {
        self.inner.get_protocol()
    }
    /// <p>The destination of the contact method, such as an email address or a mobile phone number.</p>
    /// <p>Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number structure used for international telecommunication. Phone numbers that follow this format can have a maximum of 15 digits, and they are prefixed with the plus character (+) and the country code. For example, a U.S. phone number in E.164 format would be specified as +1XXX5550100. For more information, see <a href="https://en.wikipedia.org/wiki/E.164">E.164</a> on <i>Wikipedia</i>.</p>
    pub fn contact_endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.contact_endpoint(input.into());
        self
    }
    /// <p>The destination of the contact method, such as an email address or a mobile phone number.</p>
    /// <p>Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number structure used for international telecommunication. Phone numbers that follow this format can have a maximum of 15 digits, and they are prefixed with the plus character (+) and the country code. For example, a U.S. phone number in E.164 format would be specified as +1XXX5550100. For more information, see <a href="https://en.wikipedia.org/wiki/E.164">E.164</a> on <i>Wikipedia</i>.</p>
    pub fn set_contact_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_contact_endpoint(input);
        self
    }
    /// <p>The destination of the contact method, such as an email address or a mobile phone number.</p>
    /// <p>Use the E.164 format when specifying a mobile phone number. E.164 is a standard for the phone number structure used for international telecommunication. Phone numbers that follow this format can have a maximum of 15 digits, and they are prefixed with the plus character (+) and the country code. For example, a U.S. phone number in E.164 format would be specified as +1XXX5550100. For more information, see <a href="https://en.wikipedia.org/wiki/E.164">E.164</a> on <i>Wikipedia</i>.</p>
    pub fn get_contact_endpoint(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_contact_endpoint()
    }
    ///
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tag keys and optional values to add to the contact method during create.</p>
    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>The tag keys and optional values to add to the contact method during create.</p>
    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>The tag keys and optional values to add to the contact method during create.</p>
    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
}