aws_sdk_dynamodb/operation/describe_endpoints/
_describe_endpoints_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeEndpointsOutput {
6    /// <p>List of endpoints.</p>
7    pub endpoints: ::std::vec::Vec<crate::types::Endpoint>,
8    _request_id: Option<String>,
9}
10impl DescribeEndpointsOutput {
11    /// <p>List of endpoints.</p>
12    pub fn endpoints(&self) -> &[crate::types::Endpoint] {
13        use std::ops::Deref;
14        self.endpoints.deref()
15    }
16}
17impl ::aws_types::request_id::RequestId for DescribeEndpointsOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl DescribeEndpointsOutput {
23    /// Creates a new builder-style object to manufacture [`DescribeEndpointsOutput`](crate::operation::describe_endpoints::DescribeEndpointsOutput).
24    pub fn builder() -> crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder {
25        crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder::default()
26    }
27}
28
29/// A builder for [`DescribeEndpointsOutput`](crate::operation::describe_endpoints::DescribeEndpointsOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct DescribeEndpointsOutputBuilder {
33    pub(crate) endpoints: ::std::option::Option<::std::vec::Vec<crate::types::Endpoint>>,
34    _request_id: Option<String>,
35}
36impl DescribeEndpointsOutputBuilder {
37    /// Appends an item to `endpoints`.
38    ///
39    /// To override the contents of this collection use [`set_endpoints`](Self::set_endpoints).
40    ///
41    /// <p>List of endpoints.</p>
42    pub fn endpoints(mut self, input: crate::types::Endpoint) -> Self {
43        let mut v = self.endpoints.unwrap_or_default();
44        v.push(input);
45        self.endpoints = ::std::option::Option::Some(v);
46        self
47    }
48    /// <p>List of endpoints.</p>
49    pub fn set_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Endpoint>>) -> Self {
50        self.endpoints = input;
51        self
52    }
53    /// <p>List of endpoints.</p>
54    pub fn get_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Endpoint>> {
55        &self.endpoints
56    }
57    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
58        self._request_id = Some(request_id.into());
59        self
60    }
61
62    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
63        self._request_id = request_id;
64        self
65    }
66    /// Consumes the builder and constructs a [`DescribeEndpointsOutput`](crate::operation::describe_endpoints::DescribeEndpointsOutput).
67    /// This method will fail if any of the following fields are not set:
68    /// - [`endpoints`](crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder::endpoints)
69    pub fn build(
70        self,
71    ) -> ::std::result::Result<crate::operation::describe_endpoints::DescribeEndpointsOutput, ::aws_smithy_types::error::operation::BuildError> {
72        ::std::result::Result::Ok(crate::operation::describe_endpoints::DescribeEndpointsOutput {
73            endpoints: self.endpoints.ok_or_else(|| {
74                ::aws_smithy_types::error::operation::BuildError::missing_field(
75                    "endpoints",
76                    "endpoints was not specified but it is required when building DescribeEndpointsOutput",
77                )
78            })?,
79            _request_id: self._request_id,
80        })
81    }
82}