aws_sdk_connectparticipant/operation/get_attachment/_get_attachment_output.rs
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
// 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, ::std::fmt::Debug)]
pub struct GetAttachmentOutput {
/// <p>This is the pre-signed URL that can be used for uploading the file to Amazon S3 when used in response to <a href="https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_StartAttachmentUpload.html">StartAttachmentUpload</a>.</p>
pub url: ::std::option::Option<::std::string::String>,
/// <p>The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.</p>
pub url_expiry: ::std::option::Option<::std::string::String>,
/// <p>The size of the attachment in bytes.</p>
pub attachment_size_in_bytes: i64,
_request_id: Option<String>,
}
impl GetAttachmentOutput {
/// <p>This is the pre-signed URL that can be used for uploading the file to Amazon S3 when used in response to <a href="https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_StartAttachmentUpload.html">StartAttachmentUpload</a>.</p>
pub fn url(&self) -> ::std::option::Option<&str> {
self.url.as_deref()
}
/// <p>The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.</p>
pub fn url_expiry(&self) -> ::std::option::Option<&str> {
self.url_expiry.as_deref()
}
/// <p>The size of the attachment in bytes.</p>
pub fn attachment_size_in_bytes(&self) -> i64 {
self.attachment_size_in_bytes
}
}
impl ::aws_types::request_id::RequestId for GetAttachmentOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetAttachmentOutput {
/// Creates a new builder-style object to manufacture [`GetAttachmentOutput`](crate::operation::get_attachment::GetAttachmentOutput).
pub fn builder() -> crate::operation::get_attachment::builders::GetAttachmentOutputBuilder {
crate::operation::get_attachment::builders::GetAttachmentOutputBuilder::default()
}
}
/// A builder for [`GetAttachmentOutput`](crate::operation::get_attachment::GetAttachmentOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAttachmentOutputBuilder {
pub(crate) url: ::std::option::Option<::std::string::String>,
pub(crate) url_expiry: ::std::option::Option<::std::string::String>,
pub(crate) attachment_size_in_bytes: ::std::option::Option<i64>,
_request_id: Option<String>,
}
impl GetAttachmentOutputBuilder {
/// <p>This is the pre-signed URL that can be used for uploading the file to Amazon S3 when used in response to <a href="https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_StartAttachmentUpload.html">StartAttachmentUpload</a>.</p>
pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.url = ::std::option::Option::Some(input.into());
self
}
/// <p>This is the pre-signed URL that can be used for uploading the file to Amazon S3 when used in response to <a href="https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_StartAttachmentUpload.html">StartAttachmentUpload</a>.</p>
pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.url = input;
self
}
/// <p>This is the pre-signed URL that can be used for uploading the file to Amazon S3 when used in response to <a href="https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_StartAttachmentUpload.html">StartAttachmentUpload</a>.</p>
pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
&self.url
}
/// <p>The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.</p>
pub fn url_expiry(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.url_expiry = ::std::option::Option::Some(input.into());
self
}
/// <p>The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.</p>
pub fn set_url_expiry(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.url_expiry = input;
self
}
/// <p>The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.</p>
pub fn get_url_expiry(&self) -> &::std::option::Option<::std::string::String> {
&self.url_expiry
}
/// <p>The size of the attachment in bytes.</p>
/// This field is required.
pub fn attachment_size_in_bytes(mut self, input: i64) -> Self {
self.attachment_size_in_bytes = ::std::option::Option::Some(input);
self
}
/// <p>The size of the attachment in bytes.</p>
pub fn set_attachment_size_in_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
self.attachment_size_in_bytes = input;
self
}
/// <p>The size of the attachment in bytes.</p>
pub fn get_attachment_size_in_bytes(&self) -> &::std::option::Option<i64> {
&self.attachment_size_in_bytes
}
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 [`GetAttachmentOutput`](crate::operation::get_attachment::GetAttachmentOutput).
/// This method will fail if any of the following fields are not set:
/// - [`attachment_size_in_bytes`](crate::operation::get_attachment::builders::GetAttachmentOutputBuilder::attachment_size_in_bytes)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_attachment::GetAttachmentOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_attachment::GetAttachmentOutput {
url: self.url,
url_expiry: self.url_expiry,
attachment_size_in_bytes: self.attachment_size_in_bytes.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"attachment_size_in_bytes",
"attachment_size_in_bytes was not specified but it is required when building GetAttachmentOutput",
)
})?,
_request_id: self._request_id,
})
}
}