#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct StartContentUploadOutput {
pub upload_id: ::std::string::String,
pub url: ::std::string::String,
pub url_expiry: ::aws_smithy_types::DateTime,
pub headers_to_include: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
_request_id: Option<String>,
}
impl StartContentUploadOutput {
pub fn upload_id(&self) -> &str {
use std::ops::Deref;
self.upload_id.deref()
}
pub fn url(&self) -> &str {
use std::ops::Deref;
self.url.deref()
}
pub fn url_expiry(&self) -> &::aws_smithy_types::DateTime {
&self.url_expiry
}
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 {
pub fn builder() -> crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder {
crate::operation::start_content_upload::builders::StartContentUploadOutputBuilder::default()
}
}
#[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 {
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
}
pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.upload_id = input;
self
}
pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
&self.upload_id
}
pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.url = ::std::option::Option::Some(input.into());
self
}
pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.url = input;
self
}
pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
&self.url
}
pub fn url_expiry(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.url_expiry = ::std::option::Option::Some(input);
self
}
pub fn set_url_expiry(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.url_expiry = input;
self
}
pub fn get_url_expiry(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.url_expiry
}
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
}
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
}
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
}
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()
}
}