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 CreateSourceUploadOutput {
    /// <p>The ID of the source upload.</p>
    pub source_upload_id: ::std::string::String,
    /// <p>The upload details, including the presigned URL for uploading the .zip file.</p>
    pub zip_upload: ::std::option::Option<crate::types::ZipUpload>,
    /// <p>The time at which the upload expires. The value is in ISO-8601 format.</p>
    pub upload_expires_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl CreateSourceUploadOutput {
    /// <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 upload details, including the presigned URL for uploading the .zip file.</p>
    pub fn zip_upload(&self) -> ::std::option::Option<&crate::types::ZipUpload> {
        self.zip_upload.as_ref()
    }
    /// <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
    }
}
impl ::aws_types::request_id::RequestId for CreateSourceUploadOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateSourceUploadOutput {
    /// Creates a new builder-style object to manufacture [`CreateSourceUploadOutput`](crate::operation::create_source_upload::CreateSourceUploadOutput).
    pub fn builder() -> crate::operation::create_source_upload::builders::CreateSourceUploadOutputBuilder {
        crate::operation::create_source_upload::builders::CreateSourceUploadOutputBuilder::default()
    }
}

/// A builder for [`CreateSourceUploadOutput`](crate::operation::create_source_upload::CreateSourceUploadOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateSourceUploadOutputBuilder {
    pub(crate) source_upload_id: ::std::option::Option<::std::string::String>,
    pub(crate) zip_upload: ::std::option::Option<crate::types::ZipUpload>,
    pub(crate) upload_expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateSourceUploadOutputBuilder {
    /// <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 upload details, including the presigned URL for uploading the .zip file.</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 upload details, including the presigned URL for uploading the .zip file.</p>
    pub fn set_zip_upload(mut self, input: ::std::option::Option<crate::types::ZipUpload>) -> Self {
        self.zip_upload = input;
        self
    }
    /// <p>The upload details, including the presigned URL for uploading the .zip file.</p>
    pub fn get_zip_upload(&self) -> &::std::option::Option<crate::types::ZipUpload> {
        &self.zip_upload
    }
    /// <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
    }
    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 [`CreateSourceUploadOutput`](crate::operation::create_source_upload::CreateSourceUploadOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`source_upload_id`](crate::operation::create_source_upload::builders::CreateSourceUploadOutputBuilder::source_upload_id)
    /// - [`upload_expires_at`](crate::operation::create_source_upload::builders::CreateSourceUploadOutputBuilder::upload_expires_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_source_upload::CreateSourceUploadOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_source_upload::CreateSourceUploadOutput {
            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 CreateSourceUploadOutput",
                )
            })?,
            zip_upload: self.zip_upload,
            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 CreateSourceUploadOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}