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 GetFolderOutput {
    /// <p>The path of the folder that was listed.</p>
    pub folder_path: ::std::string::String,
    /// <p>The folders directly inside the folder.</p>
    pub sub_folders: ::std::vec::Vec<crate::types::FolderReference>,
    /// <p>The files directly inside the folder.</p>
    pub files: ::std::vec::Vec<crate::types::FileReference>,
    _request_id: Option<String>,
}
impl GetFolderOutput {
    /// <p>The path of the folder that was listed.</p>
    pub fn folder_path(&self) -> &str {
        use std::ops::Deref;
        self.folder_path.deref()
    }
    /// <p>The folders directly inside the folder.</p>
    pub fn sub_folders(&self) -> &[crate::types::FolderReference] {
        use std::ops::Deref;
        self.sub_folders.deref()
    }
    /// <p>The files directly inside the folder.</p>
    pub fn files(&self) -> &[crate::types::FileReference] {
        use std::ops::Deref;
        self.files.deref()
    }
}
impl ::aws_types::request_id::RequestId for GetFolderOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetFolderOutput {
    /// Creates a new builder-style object to manufacture [`GetFolderOutput`](crate::operation::get_folder::GetFolderOutput).
    pub fn builder() -> crate::operation::get_folder::builders::GetFolderOutputBuilder {
        crate::operation::get_folder::builders::GetFolderOutputBuilder::default()
    }
}

/// A builder for [`GetFolderOutput`](crate::operation::get_folder::GetFolderOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetFolderOutputBuilder {
    pub(crate) folder_path: ::std::option::Option<::std::string::String>,
    pub(crate) sub_folders: ::std::option::Option<::std::vec::Vec<crate::types::FolderReference>>,
    pub(crate) files: ::std::option::Option<::std::vec::Vec<crate::types::FileReference>>,
    _request_id: Option<String>,
}
impl GetFolderOutputBuilder {
    /// <p>The path of the folder that was listed.</p>
    /// This field is required.
    pub fn folder_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.folder_path = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The path of the folder that was listed.</p>
    pub fn set_folder_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.folder_path = input;
        self
    }
    /// <p>The path of the folder that was listed.</p>
    pub fn get_folder_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.folder_path
    }
    /// Appends an item to `sub_folders`.
    ///
    /// To override the contents of this collection use [`set_sub_folders`](Self::set_sub_folders).
    ///
    /// <p>The folders directly inside the folder.</p>
    pub fn sub_folders(mut self, input: crate::types::FolderReference) -> Self {
        let mut v = self.sub_folders.unwrap_or_default();
        v.push(input);
        self.sub_folders = ::std::option::Option::Some(v);
        self
    }
    /// <p>The folders directly inside the folder.</p>
    pub fn set_sub_folders(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FolderReference>>) -> Self {
        self.sub_folders = input;
        self
    }
    /// <p>The folders directly inside the folder.</p>
    pub fn get_sub_folders(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FolderReference>> {
        &self.sub_folders
    }
    /// Appends an item to `files`.
    ///
    /// To override the contents of this collection use [`set_files`](Self::set_files).
    ///
    /// <p>The files directly inside the folder.</p>
    pub fn files(mut self, input: crate::types::FileReference) -> Self {
        let mut v = self.files.unwrap_or_default();
        v.push(input);
        self.files = ::std::option::Option::Some(v);
        self
    }
    /// <p>The files directly inside the folder.</p>
    pub fn set_files(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FileReference>>) -> Self {
        self.files = input;
        self
    }
    /// <p>The files directly inside the folder.</p>
    pub fn get_files(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FileReference>> {
        &self.files
    }
    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 [`GetFolderOutput`](crate::operation::get_folder::GetFolderOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`folder_path`](crate::operation::get_folder::builders::GetFolderOutputBuilder::folder_path)
    /// - [`sub_folders`](crate::operation::get_folder::builders::GetFolderOutputBuilder::sub_folders)
    /// - [`files`](crate::operation::get_folder::builders::GetFolderOutputBuilder::files)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_folder::GetFolderOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_folder::GetFolderOutput {
            folder_path: self.folder_path.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "folder_path",
                    "folder_path was not specified but it is required when building GetFolderOutput",
                )
            })?,
            sub_folders: self.sub_folders.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "sub_folders",
                    "sub_folders was not specified but it is required when building GetFolderOutput",
                )
            })?,
            files: self.files.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "files",
                    "files was not specified but it is required when building GetFolderOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}