aws_sdk_connectcampaigns/types/
_dial_request.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct DialRequest {
7 pub client_token: ::std::string::String,
9 pub phone_number: ::std::string::String,
11 pub expiration_time: ::aws_smithy_types::DateTime,
13 pub attributes: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
15}
16impl DialRequest {
17 pub fn client_token(&self) -> &str {
19 use std::ops::Deref;
20 self.client_token.deref()
21 }
22 pub fn phone_number(&self) -> &str {
24 use std::ops::Deref;
25 self.phone_number.deref()
26 }
27 pub fn expiration_time(&self) -> &::aws_smithy_types::DateTime {
29 &self.expiration_time
30 }
31 pub fn attributes(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
33 &self.attributes
34 }
35}
36impl ::std::fmt::Debug for DialRequest {
37 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
38 let mut formatter = f.debug_struct("DialRequest");
39 formatter.field("client_token", &self.client_token);
40 formatter.field("phone_number", &"*** Sensitive Data Redacted ***");
41 formatter.field("expiration_time", &self.expiration_time);
42 formatter.field("attributes", &"*** Sensitive Data Redacted ***");
43 formatter.finish()
44 }
45}
46impl DialRequest {
47 pub fn builder() -> crate::types::builders::DialRequestBuilder {
49 crate::types::builders::DialRequestBuilder::default()
50 }
51}
52
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
55#[non_exhaustive]
56pub struct DialRequestBuilder {
57 pub(crate) client_token: ::std::option::Option<::std::string::String>,
58 pub(crate) phone_number: ::std::option::Option<::std::string::String>,
59 pub(crate) expiration_time: ::std::option::Option<::aws_smithy_types::DateTime>,
60 pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
61}
62impl DialRequestBuilder {
63 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.client_token = ::std::option::Option::Some(input.into());
67 self
68 }
69 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.client_token = input;
72 self
73 }
74 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
76 &self.client_token
77 }
78 pub fn phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.phone_number = ::std::option::Option::Some(input.into());
82 self
83 }
84 pub fn set_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.phone_number = input;
87 self
88 }
89 pub fn get_phone_number(&self) -> &::std::option::Option<::std::string::String> {
91 &self.phone_number
92 }
93 pub fn expiration_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
96 self.expiration_time = ::std::option::Option::Some(input);
97 self
98 }
99 pub fn set_expiration_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
101 self.expiration_time = input;
102 self
103 }
104 pub fn get_expiration_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
106 &self.expiration_time
107 }
108 pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
114 let mut hash_map = self.attributes.unwrap_or_default();
115 hash_map.insert(k.into(), v.into());
116 self.attributes = ::std::option::Option::Some(hash_map);
117 self
118 }
119 pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
121 self.attributes = input;
122 self
123 }
124 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
126 &self.attributes
127 }
128 pub fn build(self) -> ::std::result::Result<crate::types::DialRequest, ::aws_smithy_types::error::operation::BuildError> {
135 ::std::result::Result::Ok(crate::types::DialRequest {
136 client_token: self.client_token.ok_or_else(|| {
137 ::aws_smithy_types::error::operation::BuildError::missing_field(
138 "client_token",
139 "client_token was not specified but it is required when building DialRequest",
140 )
141 })?,
142 phone_number: self.phone_number.ok_or_else(|| {
143 ::aws_smithy_types::error::operation::BuildError::missing_field(
144 "phone_number",
145 "phone_number was not specified but it is required when building DialRequest",
146 )
147 })?,
148 expiration_time: self.expiration_time.ok_or_else(|| {
149 ::aws_smithy_types::error::operation::BuildError::missing_field(
150 "expiration_time",
151 "expiration_time was not specified but it is required when building DialRequest",
152 )
153 })?,
154 attributes: self.attributes.ok_or_else(|| {
155 ::aws_smithy_types::error::operation::BuildError::missing_field(
156 "attributes",
157 "attributes was not specified but it is required when building DialRequest",
158 )
159 })?,
160 })
161 }
162}
163impl ::std::fmt::Debug for DialRequestBuilder {
164 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
165 let mut formatter = f.debug_struct("DialRequestBuilder");
166 formatter.field("client_token", &self.client_token);
167 formatter.field("phone_number", &"*** Sensitive Data Redacted ***");
168 formatter.field("expiration_time", &self.expiration_time);
169 formatter.field("attributes", &"*** Sensitive Data Redacted ***");
170 formatter.finish()
171 }
172}