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 GetFileOutput {
    /// <p>The path of the file that was returned.</p>
    pub file_path: ::std::string::String,
    /// <p>The contents of the file.</p>
    pub content: ::aws_smithy_types::Blob,
    /// <p>The Git object ID (blob SHA) of the file's contents. It changes whenever the file's contents change.</p>
    pub sha: ::std::string::String,
    /// <p>The size of the file, in bytes.</p>
    pub size: i64,
    _request_id: Option<String>,
}
impl GetFileOutput {
    /// <p>The path of the file that was returned.</p>
    pub fn file_path(&self) -> &str {
        use std::ops::Deref;
        self.file_path.deref()
    }
    /// <p>The contents of the file.</p>
    pub fn content(&self) -> &::aws_smithy_types::Blob {
        &self.content
    }
    /// <p>The Git object ID (blob SHA) of the file's contents. It changes whenever the file's contents change.</p>
    pub fn sha(&self) -> &str {
        use std::ops::Deref;
        self.sha.deref()
    }
    /// <p>The size of the file, in bytes.</p>
    pub fn size(&self) -> i64 {
        self.size
    }
}
impl ::aws_types::request_id::RequestId for GetFileOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetFileOutput {
    /// Creates a new builder-style object to manufacture [`GetFileOutput`](crate::operation::get_file::GetFileOutput).
    pub fn builder() -> crate::operation::get_file::builders::GetFileOutputBuilder {
        crate::operation::get_file::builders::GetFileOutputBuilder::default()
    }
}

/// A builder for [`GetFileOutput`](crate::operation::get_file::GetFileOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetFileOutputBuilder {
    pub(crate) file_path: ::std::option::Option<::std::string::String>,
    pub(crate) content: ::std::option::Option<::aws_smithy_types::Blob>,
    pub(crate) sha: ::std::option::Option<::std::string::String>,
    pub(crate) size: ::std::option::Option<i64>,
    _request_id: Option<String>,
}
impl GetFileOutputBuilder {
    /// <p>The path of the file that was returned.</p>
    /// This field is required.
    pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.file_path = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The path of the file that was returned.</p>
    pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.file_path = input;
        self
    }
    /// <p>The path of the file that was returned.</p>
    pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_path
    }
    /// <p>The contents of the file.</p>
    /// This field is required.
    pub fn content(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.content = ::std::option::Option::Some(input);
        self
    }
    /// <p>The contents of the file.</p>
    pub fn set_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.content = input;
        self
    }
    /// <p>The contents of the file.</p>
    pub fn get_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.content
    }
    /// <p>The Git object ID (blob SHA) of the file's contents. It changes whenever the file's contents change.</p>
    /// This field is required.
    pub fn sha(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sha = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Git object ID (blob SHA) of the file's contents. It changes whenever the file's contents change.</p>
    pub fn set_sha(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sha = input;
        self
    }
    /// <p>The Git object ID (blob SHA) of the file's contents. It changes whenever the file's contents change.</p>
    pub fn get_sha(&self) -> &::std::option::Option<::std::string::String> {
        &self.sha
    }
    /// <p>The size of the file, in bytes.</p>
    /// This field is required.
    pub fn size(mut self, input: i64) -> Self {
        self.size = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size of the file, in bytes.</p>
    pub fn set_size(mut self, input: ::std::option::Option<i64>) -> Self {
        self.size = input;
        self
    }
    /// <p>The size of the file, in bytes.</p>
    pub fn get_size(&self) -> &::std::option::Option<i64> {
        &self.size
    }
    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 [`GetFileOutput`](crate::operation::get_file::GetFileOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`file_path`](crate::operation::get_file::builders::GetFileOutputBuilder::file_path)
    /// - [`content`](crate::operation::get_file::builders::GetFileOutputBuilder::content)
    /// - [`sha`](crate::operation::get_file::builders::GetFileOutputBuilder::sha)
    /// - [`size`](crate::operation::get_file::builders::GetFileOutputBuilder::size)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_file::GetFileOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_file::GetFileOutput {
            file_path: self.file_path.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_path",
                    "file_path was not specified but it is required when building GetFileOutput",
                )
            })?,
            content: self.content.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "content",
                    "content was not specified but it is required when building GetFileOutput",
                )
            })?,
            sha: self.sha.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "sha",
                    "sha was not specified but it is required when building GetFileOutput",
                )
            })?,
            size: self.size.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "size",
                    "size was not specified but it is required when building GetFileOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}