aws-sdk-globalaccelerator 1.102.0

AWS SDK for AWS Global Accelerator
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AddEndpointsInput {
    /// <p>The list of endpoint objects.</p>
    pub endpoint_configurations: ::std::option::Option<::std::vec::Vec<crate::types::EndpointConfiguration>>,
    /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
    pub endpoint_group_arn: ::std::option::Option<::std::string::String>,
}
impl AddEndpointsInput {
    /// <p>The list of endpoint objects.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.endpoint_configurations.is_none()`.
    pub fn endpoint_configurations(&self) -> &[crate::types::EndpointConfiguration] {
        self.endpoint_configurations.as_deref().unwrap_or_default()
    }
    /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
    pub fn endpoint_group_arn(&self) -> ::std::option::Option<&str> {
        self.endpoint_group_arn.as_deref()
    }
}
impl AddEndpointsInput {
    /// Creates a new builder-style object to manufacture [`AddEndpointsInput`](crate::operation::add_endpoints::AddEndpointsInput).
    pub fn builder() -> crate::operation::add_endpoints::builders::AddEndpointsInputBuilder {
        crate::operation::add_endpoints::builders::AddEndpointsInputBuilder::default()
    }
}

/// A builder for [`AddEndpointsInput`](crate::operation::add_endpoints::AddEndpointsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AddEndpointsInputBuilder {
    pub(crate) endpoint_configurations: ::std::option::Option<::std::vec::Vec<crate::types::EndpointConfiguration>>,
    pub(crate) endpoint_group_arn: ::std::option::Option<::std::string::String>,
}
impl AddEndpointsInputBuilder {
    /// Appends an item to `endpoint_configurations`.
    ///
    /// To override the contents of this collection use [`set_endpoint_configurations`](Self::set_endpoint_configurations).
    ///
    /// <p>The list of endpoint objects.</p>
    pub fn endpoint_configurations(mut self, input: crate::types::EndpointConfiguration) -> Self {
        let mut v = self.endpoint_configurations.unwrap_or_default();
        v.push(input);
        self.endpoint_configurations = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of endpoint objects.</p>
    pub fn set_endpoint_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EndpointConfiguration>>) -> Self {
        self.endpoint_configurations = input;
        self
    }
    /// <p>The list of endpoint objects.</p>
    pub fn get_endpoint_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EndpointConfiguration>> {
        &self.endpoint_configurations
    }
    /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
    /// This field is required.
    pub fn endpoint_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.endpoint_group_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
    pub fn set_endpoint_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.endpoint_group_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
    pub fn get_endpoint_group_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.endpoint_group_arn
    }
    /// Consumes the builder and constructs a [`AddEndpointsInput`](crate::operation::add_endpoints::AddEndpointsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::add_endpoints::AddEndpointsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::add_endpoints::AddEndpointsInput {
            endpoint_configurations: self.endpoint_configurations,
            endpoint_group_arn: self.endpoint_group_arn,
        })
    }
}