aws-sdk-route53 1.111.0

AWS SDK for Amazon Route 53
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A complex type that contains information about the traffic policy that you want to create.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTrafficPolicyInput {
    /// <p>The name of the traffic policy.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
    pub document: ::std::option::Option<::std::string::String>,
    /// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
    pub comment: ::std::option::Option<::std::string::String>,
}
impl CreateTrafficPolicyInput {
    /// <p>The name of the traffic policy.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
    pub fn document(&self) -> ::std::option::Option<&str> {
        self.document.as_deref()
    }
    /// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
    pub fn comment(&self) -> ::std::option::Option<&str> {
        self.comment.as_deref()
    }
}
impl CreateTrafficPolicyInput {
    /// Creates a new builder-style object to manufacture [`CreateTrafficPolicyInput`](crate::operation::create_traffic_policy::CreateTrafficPolicyInput).
    pub fn builder() -> crate::operation::create_traffic_policy::builders::CreateTrafficPolicyInputBuilder {
        crate::operation::create_traffic_policy::builders::CreateTrafficPolicyInputBuilder::default()
    }
}

/// A builder for [`CreateTrafficPolicyInput`](crate::operation::create_traffic_policy::CreateTrafficPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTrafficPolicyInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) document: ::std::option::Option<::std::string::String>,
    pub(crate) comment: ::std::option::Option<::std::string::String>,
}
impl CreateTrafficPolicyInputBuilder {
    /// <p>The name of the traffic policy.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the traffic policy.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the traffic policy.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
    /// This field is required.
    pub fn document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.document = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
    pub fn set_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.document = input;
        self
    }
    /// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
    pub fn get_document(&self) -> &::std::option::Option<::std::string::String> {
        &self.document
    }
    /// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
    pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.comment = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
    pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.comment = input;
        self
    }
    /// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
    pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
        &self.comment
    }
    /// Consumes the builder and constructs a [`CreateTrafficPolicyInput`](crate::operation::create_traffic_policy::CreateTrafficPolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_traffic_policy::CreateTrafficPolicyInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_traffic_policy::CreateTrafficPolicyInput {
            name: self.name,
            document: self.document,
            comment: self.comment,
        })
    }
}