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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct StartContentUploadOutput {
    /// <p>The identifier of the upload.</p>
    pub upload_id: ::std::string::String,
    /// <p>The URL of the upload.</p>
    pub url: ::std::string::String,
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    pub url_expiry: ::aws_smithy_types::DateTime,
    /// <p>The headers to include in the upload.</p>
    pub headers_to_include: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
    _request_id: Option<String>,
}
impl StartContentUploadOutput {
    /// <p>The identifier of the upload.</p>
    pub fn upload_id(&self) -> &str {
        use std::ops::Deref;
        self.upload_id.deref()
    }
    /// <p>The URL of the upload.</p>
    pub fn url(&self) -> &str {
        use std::ops::Deref;
        self.url.deref()
    }
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    pub fn url_expiry(&self) -> &::aws_smithy_types::DateTime {
        &self.url_expiry
    }
    /// <p>The headers to include in the upload.</p>
    pub fn headers_to_include(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
        &self.headers_to_include
    }
}
impl ::std::fmt::Debug for StartContentUploadOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("StartContentUploadOutput");
        formatter.field("upload_id", &self.upload_id);
        formatter.field("url", &"*** Sensitive Data Redacted ***");
        formatter.field("url_expiry", &self.url_expiry);
        formatter.field("headers_to_include", &self.headers_to_include);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for StartContentUploadOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl StartContentUploadOutput {
    /// Creates a new builder-style object to manufacture [`StartContentUploadOutput`](crate::operation::start_content_upload::StartContentUploadOutput).
    pub fn builder() -> crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder {
        crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::default()
    }
}

/// A builder for [`StartContentUploadOutput`](crate::operation::start_content_upload::StartContentUploadOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct StartContentUploadOutputBuilder {
    pub(crate) upload_id: ::std::option::Option<::std::string::String>,
    pub(crate) url: ::std::option::Option<::std::string::String>,
    pub(crate) url_expiry: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) headers_to_include: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl StartContentUploadOutputBuilder {
    /// <p>The identifier of the upload.</p>
    /// This field is required.
    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.upload_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the upload.</p>
    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.upload_id = input;
        self
    }
    /// <p>The identifier of the upload.</p>
    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.upload_id
    }
    /// <p>The URL of the upload.</p>
    /// This field is required.
    pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL of the upload.</p>
    pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.url = input;
        self
    }
    /// <p>The URL of the upload.</p>
    pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.url
    }
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    /// This field is required.
    pub fn url_expiry(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.url_expiry = ::std::option::Option::Some(input);
        self
    }
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    pub fn set_url_expiry(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.url_expiry = input;
        self
    }
    /// <p>The expiration time of the URL as an epoch timestamp.</p>
    pub fn get_url_expiry(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.url_expiry
    }
    /// Adds a key-value pair to `headers_to_include`.
    ///
    /// To override the contents of this collection use [`set_headers_to_include`](Self::set_headers_to_include).
    ///
    /// <p>The headers to include in the upload.</p>
    pub fn headers_to_include(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.headers_to_include.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.headers_to_include = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The headers to include in the upload.</p>
    pub fn set_headers_to_include(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.headers_to_include = input;
        self
    }
    /// <p>The headers to include in the upload.</p>
    pub fn get_headers_to_include(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.headers_to_include
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`StartContentUploadOutput`](crate::operation::start_content_upload::StartContentUploadOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`upload_id`](crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::upload_id)
    /// - [`url`](crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::url)
    /// - [`url_expiry`](crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::url_expiry)
    /// - [`headers_to_include`](crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::headers_to_include)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_content_upload::StartContentUploadOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::start_content_upload::StartContentUploadOutput {
            upload_id: self.upload_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "upload_id",
                    "upload_id was not specified but it is required when building StartContentUploadOutput",
                )
            })?,
            url: self.url.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "url",
                    "url was not specified but it is required when building StartContentUploadOutput",
                )
            })?,
            url_expiry: self.url_expiry.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "url_expiry",
                    "url_expiry was not specified but it is required when building StartContentUploadOutput",
                )
            })?,
            headers_to_include: self.headers_to_include.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "headers_to_include",
                    "headers_to_include was not specified but it is required when building StartContentUploadOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for StartContentUploadOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("StartContentUploadOutputBuilder");
        formatter.field("upload_id", &self.upload_id);
        formatter.field("url", &"*** Sensitive Data Redacted ***");
        formatter.field("url_expiry", &self.url_expiry);
        formatter.field("headers_to_include", &self.headers_to_include);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}