aws-sdk-codecommit 1.99.0

AWS SDK for AWS CodeCommit
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 full commit ID used as a reference for the returned version of the folder content.</p>
    pub commit_id: ::std::string::String,
    /// <p>The fully qualified path of the folder whose contents are returned.</p>
    pub folder_path: ::std::string::String,
    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the folder.</p>
    pub tree_id: ::std::option::Option<::std::string::String>,
    /// <p>The list of folders that exist under the specified folder, if any.</p>
    pub sub_folders: ::std::option::Option<::std::vec::Vec<crate::types::Folder>>,
    /// <p>The list of files in the specified folder, if any.</p>
    pub files: ::std::option::Option<::std::vec::Vec<crate::types::File>>,
    /// <p>The list of symbolic links to other files and folders in the specified folder, if any.</p>
    pub symbolic_links: ::std::option::Option<::std::vec::Vec<crate::types::SymbolicLink>>,
    /// <p>The list of submodules in the specified folder, if any.</p>
    pub sub_modules: ::std::option::Option<::std::vec::Vec<crate::types::SubModule>>,
    _request_id: Option<String>,
}
impl GetFolderOutput {
    /// <p>The full commit ID used as a reference for the returned version of the folder content.</p>
    pub fn commit_id(&self) -> &str {
        use std::ops::Deref;
        self.commit_id.deref()
    }
    /// <p>The fully qualified path of the folder whose contents are returned.</p>
    pub fn folder_path(&self) -> &str {
        use std::ops::Deref;
        self.folder_path.deref()
    }
    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the folder.</p>
    pub fn tree_id(&self) -> ::std::option::Option<&str> {
        self.tree_id.as_deref()
    }
    /// <p>The list of folders that exist under the specified folder, if any.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sub_folders.is_none()`.
    pub fn sub_folders(&self) -> &[crate::types::Folder] {
        self.sub_folders.as_deref().unwrap_or_default()
    }
    /// <p>The list of files in the specified folder, if any.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.files.is_none()`.
    pub fn files(&self) -> &[crate::types::File] {
        self.files.as_deref().unwrap_or_default()
    }
    /// <p>The list of symbolic links to other files and folders in the specified folder, if any.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.symbolic_links.is_none()`.
    pub fn symbolic_links(&self) -> &[crate::types::SymbolicLink] {
        self.symbolic_links.as_deref().unwrap_or_default()
    }
    /// <p>The list of submodules in the specified folder, if any.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sub_modules.is_none()`.
    pub fn sub_modules(&self) -> &[crate::types::SubModule] {
        self.sub_modules.as_deref().unwrap_or_default()
    }
}
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) commit_id: ::std::option::Option<::std::string::String>,
    pub(crate) folder_path: ::std::option::Option<::std::string::String>,
    pub(crate) tree_id: ::std::option::Option<::std::string::String>,
    pub(crate) sub_folders: ::std::option::Option<::std::vec::Vec<crate::types::Folder>>,
    pub(crate) files: ::std::option::Option<::std::vec::Vec<crate::types::File>>,
    pub(crate) symbolic_links: ::std::option::Option<::std::vec::Vec<crate::types::SymbolicLink>>,
    pub(crate) sub_modules: ::std::option::Option<::std::vec::Vec<crate::types::SubModule>>,
    _request_id: Option<String>,
}
impl GetFolderOutputBuilder {
    /// <p>The full commit ID used as a reference for the returned version of the folder content.</p>
    /// This field is required.
    pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.commit_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The full commit ID used as a reference for the returned version of the folder content.</p>
    pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.commit_id = input;
        self
    }
    /// <p>The full commit ID used as a reference for the returned version of the folder content.</p>
    pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.commit_id
    }
    /// <p>The fully qualified path of the folder whose contents are returned.</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 fully qualified path of the folder whose contents are returned.</p>
    pub fn set_folder_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.folder_path = input;
        self
    }
    /// <p>The fully qualified path of the folder whose contents are returned.</p>
    pub fn get_folder_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.folder_path
    }
    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the folder.</p>
    pub fn tree_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.tree_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the folder.</p>
    pub fn set_tree_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.tree_id = input;
        self
    }
    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the folder.</p>
    pub fn get_tree_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.tree_id
    }
    /// Appends an item to `sub_folders`.
    ///
    /// To override the contents of this collection use [`set_sub_folders`](Self::set_sub_folders).
    ///
    /// <p>The list of folders that exist under the specified folder, if any.</p>
    pub fn sub_folders(mut self, input: crate::types::Folder) -> Self {
        let mut v = self.sub_folders.unwrap_or_default();
        v.push(input);
        self.sub_folders = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of folders that exist under the specified folder, if any.</p>
    pub fn set_sub_folders(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Folder>>) -> Self {
        self.sub_folders = input;
        self
    }
    /// <p>The list of folders that exist under the specified folder, if any.</p>
    pub fn get_sub_folders(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Folder>> {
        &self.sub_folders
    }
    /// Appends an item to `files`.
    ///
    /// To override the contents of this collection use [`set_files`](Self::set_files).
    ///
    /// <p>The list of files in the specified folder, if any.</p>
    pub fn files(mut self, input: crate::types::File) -> Self {
        let mut v = self.files.unwrap_or_default();
        v.push(input);
        self.files = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of files in the specified folder, if any.</p>
    pub fn set_files(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::File>>) -> Self {
        self.files = input;
        self
    }
    /// <p>The list of files in the specified folder, if any.</p>
    pub fn get_files(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::File>> {
        &self.files
    }
    /// Appends an item to `symbolic_links`.
    ///
    /// To override the contents of this collection use [`set_symbolic_links`](Self::set_symbolic_links).
    ///
    /// <p>The list of symbolic links to other files and folders in the specified folder, if any.</p>
    pub fn symbolic_links(mut self, input: crate::types::SymbolicLink) -> Self {
        let mut v = self.symbolic_links.unwrap_or_default();
        v.push(input);
        self.symbolic_links = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of symbolic links to other files and folders in the specified folder, if any.</p>
    pub fn set_symbolic_links(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SymbolicLink>>) -> Self {
        self.symbolic_links = input;
        self
    }
    /// <p>The list of symbolic links to other files and folders in the specified folder, if any.</p>
    pub fn get_symbolic_links(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SymbolicLink>> {
        &self.symbolic_links
    }
    /// Appends an item to `sub_modules`.
    ///
    /// To override the contents of this collection use [`set_sub_modules`](Self::set_sub_modules).
    ///
    /// <p>The list of submodules in the specified folder, if any.</p>
    pub fn sub_modules(mut self, input: crate::types::SubModule) -> Self {
        let mut v = self.sub_modules.unwrap_or_default();
        v.push(input);
        self.sub_modules = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of submodules in the specified folder, if any.</p>
    pub fn set_sub_modules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SubModule>>) -> Self {
        self.sub_modules = input;
        self
    }
    /// <p>The list of submodules in the specified folder, if any.</p>
    pub fn get_sub_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubModule>> {
        &self.sub_modules
    }
    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:
    /// - [`commit_id`](crate::operation::get_folder::builders::GetFolderOutputBuilder::commit_id)
    /// - [`folder_path`](crate::operation::get_folder::builders::GetFolderOutputBuilder::folder_path)
    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 {
            commit_id: self.commit_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "commit_id",
                    "commit_id was not specified but it is required when building 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",
                )
            })?,
            tree_id: self.tree_id,
            sub_folders: self.sub_folders,
            files: self.files,
            symbolic_links: self.symbolic_links,
            sub_modules: self.sub_modules,
            _request_id: self._request_id,
        })
    }
}