aws_sdk_chime/operation/update_phone_number/
_update_phone_number_input.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)]
5pub struct UpdatePhoneNumberInput {
6    /// <p>The phone number ID.</p>
7    pub phone_number_id: ::std::option::Option<::std::string::String>,
8    /// <p>The product type.</p>
9    pub product_type: ::std::option::Option<crate::types::PhoneNumberProductType>,
10    /// <p>The outbound calling name associated with the phone number.</p>
11    pub calling_name: ::std::option::Option<::std::string::String>,
12}
13impl UpdatePhoneNumberInput {
14    /// <p>The phone number ID.</p>
15    pub fn phone_number_id(&self) -> ::std::option::Option<&str> {
16        self.phone_number_id.as_deref()
17    }
18    /// <p>The product type.</p>
19    pub fn product_type(&self) -> ::std::option::Option<&crate::types::PhoneNumberProductType> {
20        self.product_type.as_ref()
21    }
22    /// <p>The outbound calling name associated with the phone number.</p>
23    pub fn calling_name(&self) -> ::std::option::Option<&str> {
24        self.calling_name.as_deref()
25    }
26}
27impl ::std::fmt::Debug for UpdatePhoneNumberInput {
28    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
29        let mut formatter = f.debug_struct("UpdatePhoneNumberInput");
30        formatter.field("phone_number_id", &self.phone_number_id);
31        formatter.field("product_type", &self.product_type);
32        formatter.field("calling_name", &"*** Sensitive Data Redacted ***");
33        formatter.finish()
34    }
35}
36impl UpdatePhoneNumberInput {
37    /// Creates a new builder-style object to manufacture [`UpdatePhoneNumberInput`](crate::operation::update_phone_number::UpdatePhoneNumberInput).
38    pub fn builder() -> crate::operation::update_phone_number::builders::UpdatePhoneNumberInputBuilder {
39        crate::operation::update_phone_number::builders::UpdatePhoneNumberInputBuilder::default()
40    }
41}
42
43/// A builder for [`UpdatePhoneNumberInput`](crate::operation::update_phone_number::UpdatePhoneNumberInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
45#[non_exhaustive]
46pub struct UpdatePhoneNumberInputBuilder {
47    pub(crate) phone_number_id: ::std::option::Option<::std::string::String>,
48    pub(crate) product_type: ::std::option::Option<crate::types::PhoneNumberProductType>,
49    pub(crate) calling_name: ::std::option::Option<::std::string::String>,
50}
51impl UpdatePhoneNumberInputBuilder {
52    /// <p>The phone number ID.</p>
53    /// This field is required.
54    pub fn phone_number_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.phone_number_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The phone number ID.</p>
59    pub fn set_phone_number_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.phone_number_id = input;
61        self
62    }
63    /// <p>The phone number ID.</p>
64    pub fn get_phone_number_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.phone_number_id
66    }
67    /// <p>The product type.</p>
68    pub fn product_type(mut self, input: crate::types::PhoneNumberProductType) -> Self {
69        self.product_type = ::std::option::Option::Some(input);
70        self
71    }
72    /// <p>The product type.</p>
73    pub fn set_product_type(mut self, input: ::std::option::Option<crate::types::PhoneNumberProductType>) -> Self {
74        self.product_type = input;
75        self
76    }
77    /// <p>The product type.</p>
78    pub fn get_product_type(&self) -> &::std::option::Option<crate::types::PhoneNumberProductType> {
79        &self.product_type
80    }
81    /// <p>The outbound calling name associated with the phone number.</p>
82    pub fn calling_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.calling_name = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The outbound calling name associated with the phone number.</p>
87    pub fn set_calling_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.calling_name = input;
89        self
90    }
91    /// <p>The outbound calling name associated with the phone number.</p>
92    pub fn get_calling_name(&self) -> &::std::option::Option<::std::string::String> {
93        &self.calling_name
94    }
95    /// Consumes the builder and constructs a [`UpdatePhoneNumberInput`](crate::operation::update_phone_number::UpdatePhoneNumberInput).
96    pub fn build(
97        self,
98    ) -> ::std::result::Result<crate::operation::update_phone_number::UpdatePhoneNumberInput, ::aws_smithy_types::error::operation::BuildError> {
99        ::std::result::Result::Ok(crate::operation::update_phone_number::UpdatePhoneNumberInput {
100            phone_number_id: self.phone_number_id,
101            product_type: self.product_type,
102            calling_name: self.calling_name,
103        })
104    }
105}
106impl ::std::fmt::Debug for UpdatePhoneNumberInputBuilder {
107    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
108        let mut formatter = f.debug_struct("UpdatePhoneNumberInputBuilder");
109        formatter.field("phone_number_id", &self.phone_number_id);
110        formatter.field("product_type", &self.product_type);
111        formatter.field("calling_name", &"*** Sensitive Data Redacted ***");
112        formatter.finish()
113    }
114}