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