aws_sdk_globalaccelerator/operation/list_custom_routing_port_mappings_by_destination/
_list_custom_routing_port_mappings_by_destination_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 ListCustomRoutingPortMappingsByDestinationOutput {
6    /// <p>The port mappings for the endpoint IP address that you specified in the request.</p>
7    pub destination_port_mappings: ::std::option::Option<::std::vec::Vec<crate::types::DestinationPortMapping>>,
8    /// <p>The token for the next set of results. You receive this token from a previous call.</p>
9    pub next_token: ::std::option::Option<::std::string::String>,
10    _request_id: Option<String>,
11}
12impl ListCustomRoutingPortMappingsByDestinationOutput {
13    /// <p>The port mappings for the endpoint IP address that you specified in the request.</p>
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.destination_port_mappings.is_none()`.
16    pub fn destination_port_mappings(&self) -> &[crate::types::DestinationPortMapping] {
17        self.destination_port_mappings.as_deref().unwrap_or_default()
18    }
19    /// <p>The token for the next set of results. You receive this token from a previous call.</p>
20    pub fn next_token(&self) -> ::std::option::Option<&str> {
21        self.next_token.as_deref()
22    }
23}
24impl ::aws_types::request_id::RequestId for ListCustomRoutingPortMappingsByDestinationOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl ListCustomRoutingPortMappingsByDestinationOutput {
30    /// Creates a new builder-style object to manufacture [`ListCustomRoutingPortMappingsByDestinationOutput`](crate::operation::list_custom_routing_port_mappings_by_destination::ListCustomRoutingPortMappingsByDestinationOutput).
31    pub fn builder(
32    ) -> crate::operation::list_custom_routing_port_mappings_by_destination::builders::ListCustomRoutingPortMappingsByDestinationOutputBuilder {
33        crate::operation::list_custom_routing_port_mappings_by_destination::builders::ListCustomRoutingPortMappingsByDestinationOutputBuilder::default(
34        )
35    }
36}
37
38/// A builder for [`ListCustomRoutingPortMappingsByDestinationOutput`](crate::operation::list_custom_routing_port_mappings_by_destination::ListCustomRoutingPortMappingsByDestinationOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct ListCustomRoutingPortMappingsByDestinationOutputBuilder {
42    pub(crate) destination_port_mappings: ::std::option::Option<::std::vec::Vec<crate::types::DestinationPortMapping>>,
43    pub(crate) next_token: ::std::option::Option<::std::string::String>,
44    _request_id: Option<String>,
45}
46impl ListCustomRoutingPortMappingsByDestinationOutputBuilder {
47    /// Appends an item to `destination_port_mappings`.
48    ///
49    /// To override the contents of this collection use [`set_destination_port_mappings`](Self::set_destination_port_mappings).
50    ///
51    /// <p>The port mappings for the endpoint IP address that you specified in the request.</p>
52    pub fn destination_port_mappings(mut self, input: crate::types::DestinationPortMapping) -> Self {
53        let mut v = self.destination_port_mappings.unwrap_or_default();
54        v.push(input);
55        self.destination_port_mappings = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>The port mappings for the endpoint IP address that you specified in the request.</p>
59    pub fn set_destination_port_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DestinationPortMapping>>) -> Self {
60        self.destination_port_mappings = input;
61        self
62    }
63    /// <p>The port mappings for the endpoint IP address that you specified in the request.</p>
64    pub fn get_destination_port_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DestinationPortMapping>> {
65        &self.destination_port_mappings
66    }
67    /// <p>The token for the next set of results. You receive this token from a previous call.</p>
68    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.next_token = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The token for the next set of results. You receive this token from a previous call.</p>
73    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.next_token = input;
75        self
76    }
77    /// <p>The token for the next set of results. You receive this token from a previous call.</p>
78    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
79        &self.next_token
80    }
81    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
82        self._request_id = Some(request_id.into());
83        self
84    }
85
86    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
87        self._request_id = request_id;
88        self
89    }
90    /// Consumes the builder and constructs a [`ListCustomRoutingPortMappingsByDestinationOutput`](crate::operation::list_custom_routing_port_mappings_by_destination::ListCustomRoutingPortMappingsByDestinationOutput).
91    pub fn build(self) -> crate::operation::list_custom_routing_port_mappings_by_destination::ListCustomRoutingPortMappingsByDestinationOutput {
92        crate::operation::list_custom_routing_port_mappings_by_destination::ListCustomRoutingPortMappingsByDestinationOutput {
93            destination_port_mappings: self.destination_port_mappings,
94            next_token: self.next_token,
95            _request_id: self._request_id,
96        }
97    }
98}