#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetBranchOutput {
pub app_name: ::std::string::String,
pub environment_name: ::std::string::String,
pub branch_name: ::std::string::String,
pub branch_arn: ::std::string::String,
pub git_branch_name: ::std::option::Option<::std::string::String>,
pub created_at: ::aws_smithy_types::DateTime,
pub backend: ::std::option::Option<crate::types::BranchBackend>,
pub source_branch: ::std::option::Option<crate::types::RestoreSourceBranch>,
_request_id: Option<String>,
}
impl GetBranchOutput {
pub fn app_name(&self) -> &str {
use std::ops::Deref;
self.app_name.deref()
}
pub fn environment_name(&self) -> &str {
use std::ops::Deref;
self.environment_name.deref()
}
pub fn branch_name(&self) -> &str {
use std::ops::Deref;
self.branch_name.deref()
}
pub fn branch_arn(&self) -> &str {
use std::ops::Deref;
self.branch_arn.deref()
}
pub fn git_branch_name(&self) -> ::std::option::Option<&str> {
self.git_branch_name.as_deref()
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
pub fn backend(&self) -> ::std::option::Option<&crate::types::BranchBackend> {
self.backend.as_ref()
}
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 {
pub fn builder() -> crate::operation::get_branch::builders::GetBranchOutputBuilder {
crate::operation::get_branch::builders::GetBranchOutputBuilder::default()
}
}
#[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 {
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
}
pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.app_name = input;
self
}
pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
&self.app_name
}
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
}
pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.environment_name = input;
self
}
pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
&self.environment_name
}
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
}
pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
&self.branch_name
}
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
}
pub fn set_branch_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.branch_arn = input;
self
}
pub fn get_branch_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.branch_arn
}
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
}
pub fn set_git_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.git_branch_name = input;
self
}
pub fn get_git_branch_name(&self) -> &::std::option::Option<::std::string::String> {
&self.git_branch_name
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn backend(mut self, input: crate::types::BranchBackend) -> Self {
self.backend = ::std::option::Option::Some(input);
self
}
pub fn set_backend(mut self, input: ::std::option::Option<crate::types::BranchBackend>) -> Self {
self.backend = input;
self
}
pub fn get_backend(&self) -> &::std::option::Option<crate::types::BranchBackend> {
&self.backend
}
pub fn source_branch(mut self, input: crate::types::RestoreSourceBranch) -> Self {
self.source_branch = ::std::option::Option::Some(input);
self
}
pub fn set_source_branch(mut self, input: ::std::option::Option<crate::types::RestoreSourceBranch>) -> Self {
self.source_branch = input;
self
}
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
}
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,
})
}
}