aws-sdk-opensearch 1.113.0

AWS SDK for Amazon OpenSearch Service
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 DescribeVpcEndpointsOutput {
    /// <p>Information about each requested VPC endpoint.</p>
    pub vpc_endpoints: ::std::vec::Vec<crate::types::VpcEndpoint>,
    /// <p>Any errors associated with the request.</p>
    pub vpc_endpoint_errors: ::std::vec::Vec<crate::types::VpcEndpointError>,
    _request_id: Option<String>,
}
impl DescribeVpcEndpointsOutput {
    /// <p>Information about each requested VPC endpoint.</p>
    pub fn vpc_endpoints(&self) -> &[crate::types::VpcEndpoint] {
        use std::ops::Deref;
        self.vpc_endpoints.deref()
    }
    /// <p>Any errors associated with the request.</p>
    pub fn vpc_endpoint_errors(&self) -> &[crate::types::VpcEndpointError] {
        use std::ops::Deref;
        self.vpc_endpoint_errors.deref()
    }
}
impl ::aws_types::request_id::RequestId for DescribeVpcEndpointsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeVpcEndpointsOutput {
    /// Creates a new builder-style object to manufacture [`DescribeVpcEndpointsOutput`](crate::operation::describe_vpc_endpoints::DescribeVpcEndpointsOutput).
    pub fn builder() -> crate::operation::describe_vpc_endpoints::builders::DescribeVpcEndpointsOutputBuilder {
        crate::operation::describe_vpc_endpoints::builders::DescribeVpcEndpointsOutputBuilder::default()
    }
}

/// A builder for [`DescribeVpcEndpointsOutput`](crate::operation::describe_vpc_endpoints::DescribeVpcEndpointsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeVpcEndpointsOutputBuilder {
    pub(crate) vpc_endpoints: ::std::option::Option<::std::vec::Vec<crate::types::VpcEndpoint>>,
    pub(crate) vpc_endpoint_errors: ::std::option::Option<::std::vec::Vec<crate::types::VpcEndpointError>>,
    _request_id: Option<String>,
}
impl DescribeVpcEndpointsOutputBuilder {
    /// Appends an item to `vpc_endpoints`.
    ///
    /// To override the contents of this collection use [`set_vpc_endpoints`](Self::set_vpc_endpoints).
    ///
    /// <p>Information about each requested VPC endpoint.</p>
    pub fn vpc_endpoints(mut self, input: crate::types::VpcEndpoint) -> Self {
        let mut v = self.vpc_endpoints.unwrap_or_default();
        v.push(input);
        self.vpc_endpoints = ::std::option::Option::Some(v);
        self
    }
    /// <p>Information about each requested VPC endpoint.</p>
    pub fn set_vpc_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VpcEndpoint>>) -> Self {
        self.vpc_endpoints = input;
        self
    }
    /// <p>Information about each requested VPC endpoint.</p>
    pub fn get_vpc_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcEndpoint>> {
        &self.vpc_endpoints
    }
    /// Appends an item to `vpc_endpoint_errors`.
    ///
    /// To override the contents of this collection use [`set_vpc_endpoint_errors`](Self::set_vpc_endpoint_errors).
    ///
    /// <p>Any errors associated with the request.</p>
    pub fn vpc_endpoint_errors(mut self, input: crate::types::VpcEndpointError) -> Self {
        let mut v = self.vpc_endpoint_errors.unwrap_or_default();
        v.push(input);
        self.vpc_endpoint_errors = ::std::option::Option::Some(v);
        self
    }
    /// <p>Any errors associated with the request.</p>
    pub fn set_vpc_endpoint_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VpcEndpointError>>) -> Self {
        self.vpc_endpoint_errors = input;
        self
    }
    /// <p>Any errors associated with the request.</p>
    pub fn get_vpc_endpoint_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcEndpointError>> {
        &self.vpc_endpoint_errors
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeVpcEndpointsOutput`](crate::operation::describe_vpc_endpoints::DescribeVpcEndpointsOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`vpc_endpoints`](crate::operation::describe_vpc_endpoints::builders::DescribeVpcEndpointsOutputBuilder::vpc_endpoints)
    /// - [`vpc_endpoint_errors`](crate::operation::describe_vpc_endpoints::builders::DescribeVpcEndpointsOutputBuilder::vpc_endpoint_errors)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::describe_vpc_endpoints::DescribeVpcEndpointsOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::describe_vpc_endpoints::DescribeVpcEndpointsOutput {
            vpc_endpoints: self.vpc_endpoints.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "vpc_endpoints",
                    "vpc_endpoints was not specified but it is required when building DescribeVpcEndpointsOutput",
                )
            })?,
            vpc_endpoint_errors: self.vpc_endpoint_errors.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "vpc_endpoint_errors",
                    "vpc_endpoint_errors was not specified but it is required when building DescribeVpcEndpointsOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}