aws_sdk_iotwireless/types/
_cdma_local_id.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>CDMA local ID information, which corresponds to the local identification parameters of a CDMA cell.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CdmaLocalId {
7    /// <p>Pseudo-noise offset, which is a characteristic of the signal from a cell on a radio tower.</p>
8    pub pn_offset: i32,
9    /// <p>CDMA channel information.</p>
10    pub cdma_channel: i32,
11}
12impl CdmaLocalId {
13    /// <p>Pseudo-noise offset, which is a characteristic of the signal from a cell on a radio tower.</p>
14    pub fn pn_offset(&self) -> i32 {
15        self.pn_offset
16    }
17    /// <p>CDMA channel information.</p>
18    pub fn cdma_channel(&self) -> i32 {
19        self.cdma_channel
20    }
21}
22impl CdmaLocalId {
23    /// Creates a new builder-style object to manufacture [`CdmaLocalId`](crate::types::CdmaLocalId).
24    pub fn builder() -> crate::types::builders::CdmaLocalIdBuilder {
25        crate::types::builders::CdmaLocalIdBuilder::default()
26    }
27}
28
29/// A builder for [`CdmaLocalId`](crate::types::CdmaLocalId).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct CdmaLocalIdBuilder {
33    pub(crate) pn_offset: ::std::option::Option<i32>,
34    pub(crate) cdma_channel: ::std::option::Option<i32>,
35}
36impl CdmaLocalIdBuilder {
37    /// <p>Pseudo-noise offset, which is a characteristic of the signal from a cell on a radio tower.</p>
38    /// This field is required.
39    pub fn pn_offset(mut self, input: i32) -> Self {
40        self.pn_offset = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>Pseudo-noise offset, which is a characteristic of the signal from a cell on a radio tower.</p>
44    pub fn set_pn_offset(mut self, input: ::std::option::Option<i32>) -> Self {
45        self.pn_offset = input;
46        self
47    }
48    /// <p>Pseudo-noise offset, which is a characteristic of the signal from a cell on a radio tower.</p>
49    pub fn get_pn_offset(&self) -> &::std::option::Option<i32> {
50        &self.pn_offset
51    }
52    /// <p>CDMA channel information.</p>
53    /// This field is required.
54    pub fn cdma_channel(mut self, input: i32) -> Self {
55        self.cdma_channel = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>CDMA channel information.</p>
59    pub fn set_cdma_channel(mut self, input: ::std::option::Option<i32>) -> Self {
60        self.cdma_channel = input;
61        self
62    }
63    /// <p>CDMA channel information.</p>
64    pub fn get_cdma_channel(&self) -> &::std::option::Option<i32> {
65        &self.cdma_channel
66    }
67    /// Consumes the builder and constructs a [`CdmaLocalId`](crate::types::CdmaLocalId).
68    /// This method will fail if any of the following fields are not set:
69    /// - [`pn_offset`](crate::types::builders::CdmaLocalIdBuilder::pn_offset)
70    /// - [`cdma_channel`](crate::types::builders::CdmaLocalIdBuilder::cdma_channel)
71    pub fn build(self) -> ::std::result::Result<crate::types::CdmaLocalId, ::aws_smithy_types::error::operation::BuildError> {
72        ::std::result::Result::Ok(crate::types::CdmaLocalId {
73            pn_offset: self.pn_offset.ok_or_else(|| {
74                ::aws_smithy_types::error::operation::BuildError::missing_field(
75                    "pn_offset",
76                    "pn_offset was not specified but it is required when building CdmaLocalId",
77                )
78            })?,
79            cdma_channel: self.cdma_channel.ok_or_else(|| {
80                ::aws_smithy_types::error::operation::BuildError::missing_field(
81                    "cdma_channel",
82                    "cdma_channel was not specified but it is required when building CdmaLocalId",
83                )
84            })?,
85        })
86    }
87}