aws_sdk_chime/types/
_telephony_settings.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Settings that allow management of telephony permissions for an Amazon Chime user, such as inbound and outbound calling and text messaging.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TelephonySettings {
7    /// <p>Allows or denies inbound calling.</p>
8    pub inbound_calling: bool,
9    /// <p>Allows or denies outbound calling.</p>
10    pub outbound_calling: bool,
11    /// <p>Allows or denies SMS messaging.</p>
12    pub sms: bool,
13}
14impl TelephonySettings {
15    /// <p>Allows or denies inbound calling.</p>
16    pub fn inbound_calling(&self) -> bool {
17        self.inbound_calling
18    }
19    /// <p>Allows or denies outbound calling.</p>
20    pub fn outbound_calling(&self) -> bool {
21        self.outbound_calling
22    }
23    /// <p>Allows or denies SMS messaging.</p>
24    pub fn sms(&self) -> bool {
25        self.sms
26    }
27}
28impl TelephonySettings {
29    /// Creates a new builder-style object to manufacture [`TelephonySettings`](crate::types::TelephonySettings).
30    pub fn builder() -> crate::types::builders::TelephonySettingsBuilder {
31        crate::types::builders::TelephonySettingsBuilder::default()
32    }
33}
34
35/// A builder for [`TelephonySettings`](crate::types::TelephonySettings).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct TelephonySettingsBuilder {
39    pub(crate) inbound_calling: ::std::option::Option<bool>,
40    pub(crate) outbound_calling: ::std::option::Option<bool>,
41    pub(crate) sms: ::std::option::Option<bool>,
42}
43impl TelephonySettingsBuilder {
44    /// <p>Allows or denies inbound calling.</p>
45    /// This field is required.
46    pub fn inbound_calling(mut self, input: bool) -> Self {
47        self.inbound_calling = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>Allows or denies inbound calling.</p>
51    pub fn set_inbound_calling(mut self, input: ::std::option::Option<bool>) -> Self {
52        self.inbound_calling = input;
53        self
54    }
55    /// <p>Allows or denies inbound calling.</p>
56    pub fn get_inbound_calling(&self) -> &::std::option::Option<bool> {
57        &self.inbound_calling
58    }
59    /// <p>Allows or denies outbound calling.</p>
60    /// This field is required.
61    pub fn outbound_calling(mut self, input: bool) -> Self {
62        self.outbound_calling = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>Allows or denies outbound calling.</p>
66    pub fn set_outbound_calling(mut self, input: ::std::option::Option<bool>) -> Self {
67        self.outbound_calling = input;
68        self
69    }
70    /// <p>Allows or denies outbound calling.</p>
71    pub fn get_outbound_calling(&self) -> &::std::option::Option<bool> {
72        &self.outbound_calling
73    }
74    /// <p>Allows or denies SMS messaging.</p>
75    /// This field is required.
76    pub fn sms(mut self, input: bool) -> Self {
77        self.sms = ::std::option::Option::Some(input);
78        self
79    }
80    /// <p>Allows or denies SMS messaging.</p>
81    pub fn set_sms(mut self, input: ::std::option::Option<bool>) -> Self {
82        self.sms = input;
83        self
84    }
85    /// <p>Allows or denies SMS messaging.</p>
86    pub fn get_sms(&self) -> &::std::option::Option<bool> {
87        &self.sms
88    }
89    /// Consumes the builder and constructs a [`TelephonySettings`](crate::types::TelephonySettings).
90    /// This method will fail if any of the following fields are not set:
91    /// - [`inbound_calling`](crate::types::builders::TelephonySettingsBuilder::inbound_calling)
92    /// - [`outbound_calling`](crate::types::builders::TelephonySettingsBuilder::outbound_calling)
93    /// - [`sms`](crate::types::builders::TelephonySettingsBuilder::sms)
94    pub fn build(self) -> ::std::result::Result<crate::types::TelephonySettings, ::aws_smithy_types::error::operation::BuildError> {
95        ::std::result::Result::Ok(crate::types::TelephonySettings {
96            inbound_calling: self.inbound_calling.ok_or_else(|| {
97                ::aws_smithy_types::error::operation::BuildError::missing_field(
98                    "inbound_calling",
99                    "inbound_calling was not specified but it is required when building TelephonySettings",
100                )
101            })?,
102            outbound_calling: self.outbound_calling.ok_or_else(|| {
103                ::aws_smithy_types::error::operation::BuildError::missing_field(
104                    "outbound_calling",
105                    "outbound_calling was not specified but it is required when building TelephonySettings",
106                )
107            })?,
108            sms: self.sms.ok_or_else(|| {
109                ::aws_smithy_types::error::operation::BuildError::missing_field(
110                    "sms",
111                    "sms was not specified but it is required when building TelephonySettings",
112                )
113            })?,
114        })
115    }
116}