aws-sdk-amplifygen3 1.0.0

AWS SDK for AWS Amplify Gen 3
Documentation
// 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 GetSourceUploadOutput {
    /// <p>The ID of the source upload.</p>
    pub source_upload_id: ::std::string::String,
    /// <p>The .zip file upload information.</p>
    pub zip_upload: ::std::option::Option<crate::types::ZipUpload>,
    /// <p>The time at which the source upload was created. The value is in ISO-8601 format.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The time at which the upload expires. The value is in ISO-8601 format.</p>
    pub upload_expires_at: ::aws_smithy_types::DateTime,
    /// <p>The size of the source upload, in bytes.</p>
    pub size_in_bytes: i64,
    _request_id: Option<String>,
}
impl GetSourceUploadOutput {
    /// <p>The ID of the source upload.</p>
    pub fn source_upload_id(&self) -> &str {
        use std::ops::Deref;
        self.source_upload_id.deref()
    }
    /// <p>The .zip file upload information.</p>
    pub fn zip_upload(&self) -> ::std::option::Option<&crate::types::ZipUpload> {
        self.zip_upload.as_ref()
    }
    /// <p>The time at which the source upload was created. The value is in ISO-8601 format.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The time at which the upload expires. The value is in ISO-8601 format.</p>
    pub fn upload_expires_at(&self) -> &::aws_smithy_types::DateTime {
        &self.upload_expires_at
    }
    /// <p>The size of the source upload, in bytes.</p>
    pub fn size_in_bytes(&self) -> i64 {
        self.size_in_bytes
    }
}
impl ::aws_types::request_id::RequestId for GetSourceUploadOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSourceUploadOutput {
    /// Creates a new builder-style object to manufacture [`GetSourceUploadOutput`](crate::operation::get_source_upload::GetSourceUploadOutput).
    pub fn builder() -> crate::operation::get_source_upload::builders::GetSourceUploadOutputBuilder {
        crate::operation::get_source_upload::builders::GetSourceUploadOutputBuilder::default()
    }
}

/// A builder for [`GetSourceUploadOutput`](crate::operation::get_source_upload::GetSourceUploadOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSourceUploadOutputBuilder {
    pub(crate) source_upload_id: ::std::option::Option<::std::string::String>,
    pub(crate) zip_upload: ::std::option::Option<crate::types::ZipUpload>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) upload_expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) size_in_bytes: ::std::option::Option<i64>,
    _request_id: Option<String>,
}
impl GetSourceUploadOutputBuilder {
    /// <p>The ID of the source upload.</p>
    /// This field is required.
    pub fn source_upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_upload_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the source upload.</p>
    pub fn set_source_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_upload_id = input;
        self
    }
    /// <p>The ID of the source upload.</p>
    pub fn get_source_upload_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_upload_id
    }
    /// <p>The .zip file upload information.</p>
    /// This field is required.
    pub fn zip_upload(mut self, input: crate::types::ZipUpload) -> Self {
        self.zip_upload = ::std::option::Option::Some(input);
        self
    }
    /// <p>The .zip file upload information.</p>
    pub fn set_zip_upload(mut self, input: ::std::option::Option<crate::types::ZipUpload>) -> Self {
        self.zip_upload = input;
        self
    }
    /// <p>The .zip file upload information.</p>
    pub fn get_zip_upload(&self) -> &::std::option::Option<crate::types::ZipUpload> {
        &self.zip_upload
    }
    /// <p>The time at which the source upload was created. The value is in ISO-8601 format.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the source upload was created. The value is in ISO-8601 format.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The time at which the source upload was created. The value is in ISO-8601 format.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The time at which the upload expires. The value is in ISO-8601 format.</p>
    /// This field is required.
    pub fn upload_expires_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.upload_expires_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the upload expires. The value is in ISO-8601 format.</p>
    pub fn set_upload_expires_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.upload_expires_at = input;
        self
    }
    /// <p>The time at which the upload expires. The value is in ISO-8601 format.</p>
    pub fn get_upload_expires_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.upload_expires_at
    }
    /// <p>The size of the source upload, in bytes.</p>
    /// This field is required.
    pub fn size_in_bytes(mut self, input: i64) -> Self {
        self.size_in_bytes = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size of the source upload, in bytes.</p>
    pub fn set_size_in_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
        self.size_in_bytes = input;
        self
    }
    /// <p>The size of the source upload, in bytes.</p>
    pub fn get_size_in_bytes(&self) -> &::std::option::Option<i64> {
        &self.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 [`GetSourceUploadOutput`](crate::operation::get_source_upload::GetSourceUploadOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`source_upload_id`](crate::operation::get_source_upload::builders::GetSourceUploadOutputBuilder::source_upload_id)
    /// - [`created_at`](crate::operation::get_source_upload::builders::GetSourceUploadOutputBuilder::created_at)
    /// - [`upload_expires_at`](crate::operation::get_source_upload::builders::GetSourceUploadOutputBuilder::upload_expires_at)
    /// - [`size_in_bytes`](crate::operation::get_source_upload::builders::GetSourceUploadOutputBuilder::size_in_bytes)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_source_upload::GetSourceUploadOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_source_upload::GetSourceUploadOutput {
            source_upload_id: self.source_upload_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "source_upload_id",
                    "source_upload_id was not specified but it is required when building GetSourceUploadOutput",
                )
            })?,
            zip_upload: self.zip_upload,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building GetSourceUploadOutput",
                )
            })?,
            upload_expires_at: self.upload_expires_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "upload_expires_at",
                    "upload_expires_at was not specified but it is required when building GetSourceUploadOutput",
                )
            })?,
            size_in_bytes: self.size_in_bytes.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "size_in_bytes",
                    "size_in_bytes was not specified but it is required when building GetSourceUploadOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}