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}
16static DESCRIBEENDPOINTSOUTPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#DescribeEndpointsOutput", "com.amazonaws.dynamodb.synthetic", "DescribeEndpointsOutput");
17static DESCRIBEENDPOINTSOUTPUT_MEMBER_ENDPOINTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
18                            ::aws_smithy_schema::ShapeId::from_static(
19                                "com.amazonaws.dynamodb.synthetic#DescribeEndpointsOutput$Endpoints",
20                                "com.amazonaws.dynamodb.synthetic",
21                                "DescribeEndpointsOutput",
22                            ),
23                            ::aws_smithy_schema::ShapeType::List,
24                            "Endpoints",
25                            0,
26                        );
27static DESCRIBEENDPOINTSOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
28                            ::aws_smithy_schema::ShapeId::from_static(
29                                "synthetic#request_id",
30                                "synthetic",
31                                "request_id",
32                            ),
33                            ::aws_smithy_schema::ShapeType::String,
34                            "request_id",
35                            1,
36                        ).with_http_header("x-amzn-requestid");
37static DESCRIBEENDPOINTSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
38                            DESCRIBEENDPOINTSOUTPUT_SCHEMA_ID,
39                            ::aws_smithy_schema::ShapeType::Structure,
40                            &[&DESCRIBEENDPOINTSOUTPUT_MEMBER_ENDPOINTS, &DESCRIBEENDPOINTSOUTPUT_MEMBER__REQUEST_ID],
41                        );
42impl DescribeEndpointsOutput {
43                /// The schema for this shape.
44                pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &DESCRIBEENDPOINTSOUTPUT_SCHEMA;
45            }
46impl ::aws_smithy_schema::serde::SerializableStruct for DescribeEndpointsOutput {
47                #[allow(unused_variables, clippy::diverging_sub_expression)]
48                fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
49                    {
50                                let val = &self.endpoints;
51                                
52                    ser.write_list(&DESCRIBEENDPOINTSOUTPUT_MEMBER_ENDPOINTS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
53                        for item in val {
54                            ser.write_struct(crate::types::Endpoint::SCHEMA, item)?;
55                        }
56                        Ok(())
57                    })?;
58                    
59                            }
60                    Ok(())
61                }
62            }
63impl DescribeEndpointsOutput {
64                /// Deserializes this structure from a [`ShapeDeserializer`].
65                pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
66                    #[allow(unused_variables, unused_mut)]
67                    let mut builder = Self::builder();
68                    #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
69                    deserializer.read_struct(&DESCRIBEENDPOINTSOUTPUT_SCHEMA, &mut |member, deser| {
70                        match member.member_index() {
71                            Some(0) => { builder.endpoints = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::Endpoint::deserialize(deser)?); Ok(()) })?; container }); }
72Some(1) => {
73                                builder._request_id = Some(deser.read_string(member)?);
74                            }
75                            _ => {}
76                        }
77                        Ok(())
78                    })?;
79                    builder.endpoints = builder.endpoints.or(Some(Vec::new()));
80builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
81                }
82            }
83impl DescribeEndpointsOutput {
84                /// Deserializes this structure from a body deserializer and HTTP response headers.
85                /// Header-bound members are read directly from headers, avoiding runtime
86                /// member iteration overhead. Body members are read via the deserializer.
87                pub fn deserialize_with_response(
88                    deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
89                    headers: &::aws_smithy_runtime_api::http::Headers,
90                    _status: u16,
91                    _body: &[u8],
92                ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
93                    #[allow(unused_variables, unused_mut)]
94                    let mut builder = Self::builder();
95if let Some(val) = headers.get("x-amzn-requestid") {
96                    builder._request_id = Some(val.to_string());
97                }
98#[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
99                    deserializer.read_struct(&DESCRIBEENDPOINTSOUTPUT_SCHEMA, &mut |member, deser| {
100                        match member.member_index() {
101                            Some(0) => { builder.endpoints = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::Endpoint::deserialize(deser)?); Ok(()) })?; container }); }
102                            _ => {}
103                        }
104                        Ok(())
105                    })?;
106                    builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
107                    }
108                    }
109impl ::aws_types::request_id::RequestId for DescribeEndpointsOutput {
110                                    fn request_id(&self) -> Option<&str> {
111                                        self._request_id.as_deref()
112                                    }
113                                }
114impl DescribeEndpointsOutput {
115    /// Creates a new builder-style object to manufacture [`DescribeEndpointsOutput`](crate::operation::describe_endpoints::DescribeEndpointsOutput).
116    pub fn builder() -> crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder {
117        crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder::default()
118    }
119}
120
121/// A builder for [`DescribeEndpointsOutput`](crate::operation::describe_endpoints::DescribeEndpointsOutput).
122#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
123#[non_exhaustive]
124pub struct DescribeEndpointsOutputBuilder {
125    pub(crate) endpoints: ::std::option::Option<::std::vec::Vec::<crate::types::Endpoint>>,
126    _request_id: Option<String>,
127}
128impl DescribeEndpointsOutputBuilder {
129    /// Appends an item to `endpoints`.
130    ///
131    /// To override the contents of this collection use [`set_endpoints`](Self::set_endpoints).
132    ///
133    /// <p>List of endpoints.</p>
134    pub fn endpoints(mut self, input: crate::types::Endpoint) -> Self {
135        let mut v = self.endpoints.unwrap_or_default();
136                        v.push(input);
137                        self.endpoints = ::std::option::Option::Some(v);
138                        self
139    }
140    /// <p>List of endpoints.</p>
141    pub fn set_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::Endpoint>>) -> Self {
142        self.endpoints = input; self
143    }
144    /// <p>List of endpoints.</p>
145    pub fn get_endpoints(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::Endpoint>> {
146        &self.endpoints
147    }
148    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
149                                        self._request_id = Some(request_id.into());
150                                        self
151                                    }
152    
153                                    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
154                                        self._request_id = request_id;
155                                        self
156                                    }
157    /// Consumes the builder and constructs a [`DescribeEndpointsOutput`](crate::operation::describe_endpoints::DescribeEndpointsOutput).
158    /// This method will fail if any of the following fields are not set:
159    /// - [`endpoints`](crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder::endpoints)
160    pub fn build(self) -> ::std::result::Result<crate::operation::describe_endpoints::DescribeEndpointsOutput, ::aws_smithy_types::error::operation::BuildError> {
161        ::std::result::Result::Ok(
162            crate::operation::describe_endpoints::DescribeEndpointsOutput {
163                endpoints: self.endpoints
164                    .ok_or_else(||
165                        ::aws_smithy_types::error::operation::BuildError::missing_field("endpoints", "endpoints was not specified but it is required when building DescribeEndpointsOutput")
166                    )?
167                ,
168                _request_id: self._request_id,
169            }
170        )
171    }
172}
173