Skip to main content

aws_sdk_iotwireless/types/
_participating_gateways.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specify the list of gateways to which you want to send downlink data traffic when the wireless device is running in class B or class C mode.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ParticipatingGateways {
7    /// <p>Indicates whether to send the downlink message in sequential mode or concurrent mode, or to use only the chosen gateways from the previous uplink message transmission.</p>
8    pub downlink_mode: crate::types::DownlinkMode,
9    /// <p>The list of gateways that you want to use for sending the downlink data traffic.</p>
10    pub gateway_list: ::std::vec::Vec<crate::types::GatewayListItem>,
11    /// <p>The duration of time for which AWS IoT Core for LoRaWAN will wait before transmitting the payload to the next gateway.</p>
12    pub transmission_interval: i32,
13}
14impl ParticipatingGateways {
15    /// <p>Indicates whether to send the downlink message in sequential mode or concurrent mode, or to use only the chosen gateways from the previous uplink message transmission.</p>
16    pub fn downlink_mode(&self) -> &crate::types::DownlinkMode {
17        &self.downlink_mode
18    }
19    /// <p>The list of gateways that you want to use for sending the downlink data traffic.</p>
20    pub fn gateway_list(&self) -> &[crate::types::GatewayListItem] {
21        use std::ops::Deref;
22        self.gateway_list.deref()
23    }
24    /// <p>The duration of time for which AWS IoT Core for LoRaWAN will wait before transmitting the payload to the next gateway.</p>
25    pub fn transmission_interval(&self) -> i32 {
26        self.transmission_interval
27    }
28}
29impl ParticipatingGateways {
30    /// Creates a new builder-style object to manufacture [`ParticipatingGateways`](crate::types::ParticipatingGateways).
31    pub fn builder() -> crate::types::builders::ParticipatingGatewaysBuilder {
32        crate::types::builders::ParticipatingGatewaysBuilder::default()
33    }
34}
35
36/// A builder for [`ParticipatingGateways`](crate::types::ParticipatingGateways).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct ParticipatingGatewaysBuilder {
40    pub(crate) downlink_mode: ::std::option::Option<crate::types::DownlinkMode>,
41    pub(crate) gateway_list: ::std::option::Option<::std::vec::Vec<crate::types::GatewayListItem>>,
42    pub(crate) transmission_interval: ::std::option::Option<i32>,
43}
44impl ParticipatingGatewaysBuilder {
45    /// <p>Indicates whether to send the downlink message in sequential mode or concurrent mode, or to use only the chosen gateways from the previous uplink message transmission.</p>
46    /// This field is required.
47    pub fn downlink_mode(mut self, input: crate::types::DownlinkMode) -> Self {
48        self.downlink_mode = ::std::option::Option::Some(input);
49        self
50    }
51    /// <p>Indicates whether to send the downlink message in sequential mode or concurrent mode, or to use only the chosen gateways from the previous uplink message transmission.</p>
52    pub fn set_downlink_mode(mut self, input: ::std::option::Option<crate::types::DownlinkMode>) -> Self {
53        self.downlink_mode = input;
54        self
55    }
56    /// <p>Indicates whether to send the downlink message in sequential mode or concurrent mode, or to use only the chosen gateways from the previous uplink message transmission.</p>
57    pub fn get_downlink_mode(&self) -> &::std::option::Option<crate::types::DownlinkMode> {
58        &self.downlink_mode
59    }
60    /// Appends an item to `gateway_list`.
61    ///
62    /// To override the contents of this collection use [`set_gateway_list`](Self::set_gateway_list).
63    ///
64    /// <p>The list of gateways that you want to use for sending the downlink data traffic.</p>
65    pub fn gateway_list(mut self, input: crate::types::GatewayListItem) -> Self {
66        let mut v = self.gateway_list.unwrap_or_default();
67        v.push(input);
68        self.gateway_list = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>The list of gateways that you want to use for sending the downlink data traffic.</p>
72    pub fn set_gateway_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GatewayListItem>>) -> Self {
73        self.gateway_list = input;
74        self
75    }
76    /// <p>The list of gateways that you want to use for sending the downlink data traffic.</p>
77    pub fn get_gateway_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GatewayListItem>> {
78        &self.gateway_list
79    }
80    /// <p>The duration of time for which AWS IoT Core for LoRaWAN will wait before transmitting the payload to the next gateway.</p>
81    /// This field is required.
82    pub fn transmission_interval(mut self, input: i32) -> Self {
83        self.transmission_interval = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>The duration of time for which AWS IoT Core for LoRaWAN will wait before transmitting the payload to the next gateway.</p>
87    pub fn set_transmission_interval(mut self, input: ::std::option::Option<i32>) -> Self {
88        self.transmission_interval = input;
89        self
90    }
91    /// <p>The duration of time for which AWS IoT Core for LoRaWAN will wait before transmitting the payload to the next gateway.</p>
92    pub fn get_transmission_interval(&self) -> &::std::option::Option<i32> {
93        &self.transmission_interval
94    }
95    /// Consumes the builder and constructs a [`ParticipatingGateways`](crate::types::ParticipatingGateways).
96    /// This method will fail if any of the following fields are not set:
97    /// - [`downlink_mode`](crate::types::builders::ParticipatingGatewaysBuilder::downlink_mode)
98    /// - [`gateway_list`](crate::types::builders::ParticipatingGatewaysBuilder::gateway_list)
99    /// - [`transmission_interval`](crate::types::builders::ParticipatingGatewaysBuilder::transmission_interval)
100    pub fn build(self) -> ::std::result::Result<crate::types::ParticipatingGateways, ::aws_smithy_types::error::operation::BuildError> {
101        ::std::result::Result::Ok(crate::types::ParticipatingGateways {
102            downlink_mode: self.downlink_mode.ok_or_else(|| {
103                ::aws_smithy_types::error::operation::BuildError::missing_field(
104                    "downlink_mode",
105                    "downlink_mode was not specified but it is required when building ParticipatingGateways",
106                )
107            })?,
108            gateway_list: self.gateway_list.ok_or_else(|| {
109                ::aws_smithy_types::error::operation::BuildError::missing_field(
110                    "gateway_list",
111                    "gateway_list was not specified but it is required when building ParticipatingGateways",
112                )
113            })?,
114            transmission_interval: self.transmission_interval.ok_or_else(|| {
115                ::aws_smithy_types::error::operation::BuildError::missing_field(
116                    "transmission_interval",
117                    "transmission_interval was not specified but it is required when building ParticipatingGateways",
118                )
119            })?,
120        })
121    }
122}