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 GetBranchOutput {
    /// <p>The name of the app.</p>
    pub app_name: ::std::string::String,
    /// <p>The name of the environment.</p>
    pub environment_name: ::std::string::String,
    /// <p>The name of the branch.</p>
    pub branch_name: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the branch.</p>
    pub branch_arn: ::std::string::String,
    /// <p>The name of the Git branch that the branch was created for. Present only for a branch that was created for a Git branch.</p>
    pub git_branch_name: ::std::option::Option<::std::string::String>,
    /// <p>The time at which the branch was created. The value is in ISO-8601 format.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The backend of the branch. If Amplify can't read the state of the backend, the request fails.</p>
    pub backend: ::std::option::Option<crate::types::BranchBackend>,
    /// <p>The branch that this branch was restored from, and the point in time it was restored to. Present only for a branch that was created by RestoreBranch.</p>
    pub source_branch: ::std::option::Option<crate::types::RestoreSourceBranch>,
    _request_id: Option<String>,
}
impl GetBranchOutput {
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> &str {
        use std::ops::Deref;
        self.app_name.deref()
    }
    /// <p>The name of the environment.</p>
    pub fn environment_name(&self) -> &str {
        use std::ops::Deref;
        self.environment_name.deref()
    }
    /// <p>The name of the branch.</p>
    pub fn branch_name(&self) -> &str {
        use std::ops::Deref;
        self.branch_name.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the branch.</p>
    pub fn branch_arn(&self) -> &str {
        use std::ops::Deref;
        self.branch_arn.deref()
    }
    /// <p>The name of the Git branch that the branch was created for. Present only for a branch that was created for a Git branch.</p>
    pub fn git_branch_name(&self) -> ::std::option::Option<&str> {
        self.git_branch_name.as_deref()
    }
    /// <p>The time at which the branch was created. The value is in ISO-8601 format.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The backend of the branch. If Amplify can't read the state of the backend, the request fails.</p>
    pub fn backend(&self) -> ::std::option::Option<&crate::types::BranchBackend> {
        self.backend.as_ref()
    }
    /// <p>The branch that this branch was restored from, and the point in time it was restored to. Present only for a branch that was created by RestoreBranch.</p>
    pub fn source_branch(&self) -> ::std::option::Option<&crate::types::RestoreSourceBranch> {
        self.source_branch.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetBranchOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetBranchOutput {
    /// Creates a new builder-style object to manufacture [`GetBranchOutput`](crate::operation::get_branch::GetBranchOutput).
    pub fn builder() -> crate::operation::get_branch::builders::GetBranchOutputBuilder {
        crate::operation::get_branch::builders::GetBranchOutputBuilder::default()
    }
}

/// A builder for [`GetBranchOutput`](crate::operation::get_branch::GetBranchOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetBranchOutputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
    pub(crate) branch_arn: ::std::option::Option<::std::string::String>,
    pub(crate) git_branch_name: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) backend: ::std::option::Option<crate::types::BranchBackend>,
    pub(crate) source_branch: ::std::option::Option<crate::types::RestoreSourceBranch>,
    _request_id: Option<String>,
}
impl GetBranchOutputBuilder {
    /// <p>The name of the app.</p>
    /// This field is required.
    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the app.</p>
    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_name = input;
        self
    }
    /// <p>The name of the app.</p>
    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_name
    }
    /// <p>The name of the environment.</p>
    /// This field is required.
    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the environment.</p>
    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_name = input;
        self
    }
    /// <p>The name of the environment.</p>
    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_name
    }
    /// <p>The name of the branch.</p>
    /// This field is required.
    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.branch_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the branch.</p>
    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.branch_name = input;
        self
    }
    /// <p>The name of the branch.</p>
    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.branch_name
    }
    /// <p>The Amazon Resource Name (ARN) of the branch.</p>
    /// This field is required.
    pub fn branch_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.branch_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the branch.</p>
    pub fn set_branch_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.branch_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the branch.</p>
    pub fn get_branch_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.branch_arn
    }
    /// <p>The name of the Git branch that the branch was created for. Present only for a branch that was created for a Git branch.</p>
    pub fn git_branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.git_branch_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the Git branch that the branch was created for. Present only for a branch that was created for a Git branch.</p>
    pub fn set_git_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.git_branch_name = input;
        self
    }
    /// <p>The name of the Git branch that the branch was created for. Present only for a branch that was created for a Git branch.</p>
    pub fn get_git_branch_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.git_branch_name
    }
    /// <p>The time at which the branch 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 branch 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 branch 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 backend of the branch. If Amplify can't read the state of the backend, the request fails.</p>
    pub fn backend(mut self, input: crate::types::BranchBackend) -> Self {
        self.backend = ::std::option::Option::Some(input);
        self
    }
    /// <p>The backend of the branch. If Amplify can't read the state of the backend, the request fails.</p>
    pub fn set_backend(mut self, input: ::std::option::Option<crate::types::BranchBackend>) -> Self {
        self.backend = input;
        self
    }
    /// <p>The backend of the branch. If Amplify can't read the state of the backend, the request fails.</p>
    pub fn get_backend(&self) -> &::std::option::Option<crate::types::BranchBackend> {
        &self.backend
    }
    /// <p>The branch that this branch was restored from, and the point in time it was restored to. Present only for a branch that was created by RestoreBranch.</p>
    pub fn source_branch(mut self, input: crate::types::RestoreSourceBranch) -> Self {
        self.source_branch = ::std::option::Option::Some(input);
        self
    }
    /// <p>The branch that this branch was restored from, and the point in time it was restored to. Present only for a branch that was created by RestoreBranch.</p>
    pub fn set_source_branch(mut self, input: ::std::option::Option<crate::types::RestoreSourceBranch>) -> Self {
        self.source_branch = input;
        self
    }
    /// <p>The branch that this branch was restored from, and the point in time it was restored to. Present only for a branch that was created by RestoreBranch.</p>
    pub fn get_source_branch(&self) -> &::std::option::Option<crate::types::RestoreSourceBranch> {
        &self.source_branch
    }
    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 [`GetBranchOutput`](crate::operation::get_branch::GetBranchOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`app_name`](crate::operation::get_branch::builders::GetBranchOutputBuilder::app_name)
    /// - [`environment_name`](crate::operation::get_branch::builders::GetBranchOutputBuilder::environment_name)
    /// - [`branch_name`](crate::operation::get_branch::builders::GetBranchOutputBuilder::branch_name)
    /// - [`branch_arn`](crate::operation::get_branch::builders::GetBranchOutputBuilder::branch_arn)
    /// - [`created_at`](crate::operation::get_branch::builders::GetBranchOutputBuilder::created_at)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_branch::GetBranchOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_branch::GetBranchOutput {
            app_name: self.app_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "app_name",
                    "app_name was not specified but it is required when building GetBranchOutput",
                )
            })?,
            environment_name: self.environment_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_name",
                    "environment_name was not specified but it is required when building GetBranchOutput",
                )
            })?,
            branch_name: self.branch_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "branch_name",
                    "branch_name was not specified but it is required when building GetBranchOutput",
                )
            })?,
            branch_arn: self.branch_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "branch_arn",
                    "branch_arn was not specified but it is required when building GetBranchOutput",
                )
            })?,
            git_branch_name: self.git_branch_name,
            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 GetBranchOutput",
                )
            })?,
            backend: self.backend,
            source_branch: self.source_branch,
            _request_id: self._request_id,
        })
    }
}