1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// A dial request for a campaign.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DialRequest {
    /// Client provided parameter used for idempotency. Its value must be unique for each request.
    pub client_token: ::std::string::String,
    /// The phone number of the customer, in E.164 format.
    pub phone_number: ::std::string::String,
    /// Timestamp with no UTC offset or timezone
    pub expiration_time: ::aws_smithy_types::DateTime,
    /// A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in contact flows just like any other contact attributes.
    pub attributes: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
}
impl DialRequest {
    /// Client provided parameter used for idempotency. Its value must be unique for each request.
    pub fn client_token(&self) -> &str {
        use std::ops::Deref;
        self.client_token.deref()
    }
    /// The phone number of the customer, in E.164 format.
    pub fn phone_number(&self) -> &str {
        use std::ops::Deref;
        self.phone_number.deref()
    }
    /// Timestamp with no UTC offset or timezone
    pub fn expiration_time(&self) -> &::aws_smithy_types::DateTime {
        &self.expiration_time
    }
    /// A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in contact flows just like any other contact attributes.
    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 {
    /// Creates a new builder-style object to manufacture [`DialRequest`](crate::types::DialRequest).
    pub fn builder() -> crate::types::builders::DialRequestBuilder {
        crate::types::builders::DialRequestBuilder::default()
    }
}

/// A builder for [`DialRequest`](crate::types::DialRequest).
#[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 {
    /// Client provided parameter used for idempotency. Its value must be unique for each request.
    /// This field is required.
    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
    }
    /// Client provided parameter used for idempotency. Its value must be unique for each request.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// Client provided parameter used for idempotency. Its value must be unique for each request.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// The phone number of the customer, in E.164 format.
    /// This field is required.
    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
    }
    /// The phone number of the customer, in E.164 format.
    pub fn set_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.phone_number = input;
        self
    }
    /// The phone number of the customer, in E.164 format.
    pub fn get_phone_number(&self) -> &::std::option::Option<::std::string::String> {
        &self.phone_number
    }
    /// Timestamp with no UTC offset or timezone
    /// This field is required.
    pub fn expiration_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.expiration_time = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp with no UTC offset or timezone
    pub fn set_expiration_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.expiration_time = input;
        self
    }
    /// Timestamp with no UTC offset or timezone
    pub fn get_expiration_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.expiration_time
    }
    /// Adds a key-value pair to `attributes`.
    ///
    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
    ///
    /// A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in contact flows just like any other contact attributes.
    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
    }
    /// A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in contact flows just like any other contact attributes.
    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.attributes = input;
        self
    }
    /// A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in contact flows just like any other contact attributes.
    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.attributes
    }
    /// Consumes the builder and constructs a [`DialRequest`](crate::types::DialRequest).
    /// This method will fail if any of the following fields are not set:
    /// - [`client_token`](crate::types::builders::DialRequestBuilder::client_token)
    /// - [`phone_number`](crate::types::builders::DialRequestBuilder::phone_number)
    /// - [`expiration_time`](crate::types::builders::DialRequestBuilder::expiration_time)
    /// - [`attributes`](crate::types::builders::DialRequestBuilder::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()
    }
}