#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreatePresignedUrlOutput {
pub file_id: ::std::string::String,
pub presigned_url: ::std::string::String,
pub presigned_url_fields: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub presigned_url_expiration: ::aws_smithy_types::DateTime,
_request_id: Option<String>,
}
impl CreatePresignedUrlOutput {
pub fn file_id(&self) -> &str {
use std::ops::Deref;
self.file_id.deref()
}
pub fn presigned_url(&self) -> &str {
use std::ops::Deref;
self.presigned_url.deref()
}
pub fn presigned_url_fields(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
&self.presigned_url_fields
}
pub fn presigned_url_expiration(&self) -> &::aws_smithy_types::DateTime {
&self.presigned_url_expiration
}
}
impl ::aws_types::request_id::RequestId for CreatePresignedUrlOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreatePresignedUrlOutput {
pub fn builder() -> crate::operation::create_presigned_url::builders::CreatePresignedUrlOutputBuilder {
crate::operation::create_presigned_url::builders::CreatePresignedUrlOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreatePresignedUrlOutputBuilder {
pub(crate) file_id: ::std::option::Option<::std::string::String>,
pub(crate) presigned_url: ::std::option::Option<::std::string::String>,
pub(crate) presigned_url_fields: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) presigned_url_expiration: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl CreatePresignedUrlOutputBuilder {
pub fn file_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.file_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_file_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.file_id = input;
self
}
pub fn get_file_id(&self) -> &::std::option::Option<::std::string::String> {
&self.file_id
}
pub fn presigned_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.presigned_url = ::std::option::Option::Some(input.into());
self
}
pub fn set_presigned_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.presigned_url = input;
self
}
pub fn get_presigned_url(&self) -> &::std::option::Option<::std::string::String> {
&self.presigned_url
}
pub fn presigned_url_fields(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.presigned_url_fields.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.presigned_url_fields = ::std::option::Option::Some(hash_map);
self
}
pub fn set_presigned_url_fields(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.presigned_url_fields = input;
self
}
pub fn get_presigned_url_fields(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.presigned_url_fields
}
pub fn presigned_url_expiration(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.presigned_url_expiration = ::std::option::Option::Some(input);
self
}
pub fn set_presigned_url_expiration(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.presigned_url_expiration = input;
self
}
pub fn get_presigned_url_expiration(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.presigned_url_expiration
}
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::create_presigned_url::CreatePresignedUrlOutput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::create_presigned_url::CreatePresignedUrlOutput {
file_id: self.file_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"file_id",
"file_id was not specified but it is required when building CreatePresignedUrlOutput",
)
})?,
presigned_url: self.presigned_url.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"presigned_url",
"presigned_url was not specified but it is required when building CreatePresignedUrlOutput",
)
})?,
presigned_url_fields: self.presigned_url_fields.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"presigned_url_fields",
"presigned_url_fields was not specified but it is required when building CreatePresignedUrlOutput",
)
})?,
presigned_url_expiration: self.presigned_url_expiration.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"presigned_url_expiration",
"presigned_url_expiration was not specified but it is required when building CreatePresignedUrlOutput",
)
})?,
_request_id: self._request_id,
})
}
}