#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DialRequest {
pub client_token: ::std::string::String,
pub phone_number: ::std::string::String,
pub expiration_time: ::aws_smithy_types::DateTime,
pub attributes: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
}
impl DialRequest {
pub fn client_token(&self) -> &str {
use std::ops::Deref;
self.client_token.deref()
}
pub fn phone_number(&self) -> &str {
use std::ops::Deref;
self.phone_number.deref()
}
pub fn expiration_time(&self) -> &::aws_smithy_types::DateTime {
&self.expiration_time
}
pub fn attributes(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
&self.attributes
}
}
impl ::std::fmt::Debug for DialRequest {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DialRequest");
formatter.field("client_token", &self.client_token);
formatter.field("phone_number", &"*** Sensitive Data Redacted ***");
formatter.field("expiration_time", &self.expiration_time);
formatter.field("attributes", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
impl DialRequest {
pub fn builder() -> crate::types::builders::DialRequestBuilder {
crate::types::builders::DialRequestBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct DialRequestBuilder {
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) phone_number: ::std::option::Option<::std::string::String>,
pub(crate) expiration_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl DialRequestBuilder {
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
pub fn phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.phone_number = ::std::option::Option::Some(input.into());
self
}
pub fn set_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.phone_number = input;
self
}
pub fn get_phone_number(&self) -> &::std::option::Option<::std::string::String> {
&self.phone_number
}
pub fn expiration_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.expiration_time = ::std::option::Option::Some(input);
self
}
pub fn set_expiration_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.expiration_time = input;
self
}
pub fn get_expiration_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.expiration_time
}
pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.attributes.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.attributes = ::std::option::Option::Some(hash_map);
self
}
pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.attributes = input;
self
}
pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.attributes
}
pub fn build(self) -> ::std::result::Result<crate::types::DialRequest, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::DialRequest {
client_token: self.client_token.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"client_token",
"client_token was not specified but it is required when building DialRequest",
)
})?,
phone_number: self.phone_number.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"phone_number",
"phone_number was not specified but it is required when building DialRequest",
)
})?,
expiration_time: self.expiration_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"expiration_time",
"expiration_time was not specified but it is required when building DialRequest",
)
})?,
attributes: self.attributes.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"attributes",
"attributes was not specified but it is required when building DialRequest",
)
})?,
})
}
}
impl ::std::fmt::Debug for DialRequestBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DialRequestBuilder");
formatter.field("client_token", &self.client_token);
formatter.field("phone_number", &"*** Sensitive Data Redacted ***");
formatter.field("expiration_time", &self.expiration_time);
formatter.field("attributes", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}