#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Revision {
pub branch: ::std::string::String,
pub directory: ::std::string::String,
pub owner_id: ::std::string::String,
pub repository_name: ::std::string::String,
pub provider_type: crate::types::ProviderType,
pub sha: ::std::string::String,
}
impl Revision {
pub fn branch(&self) -> &str {
use std::ops::Deref;
self.branch.deref()
}
pub fn directory(&self) -> &str {
use std::ops::Deref;
self.directory.deref()
}
pub fn owner_id(&self) -> &str {
use std::ops::Deref;
self.owner_id.deref()
}
pub fn repository_name(&self) -> &str {
use std::ops::Deref;
self.repository_name.deref()
}
pub fn provider_type(&self) -> &crate::types::ProviderType {
&self.provider_type
}
pub fn sha(&self) -> &str {
use std::ops::Deref;
self.sha.deref()
}
}
impl Revision {
pub fn builder() -> crate::types::builders::RevisionBuilder {
crate::types::builders::RevisionBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RevisionBuilder {
pub(crate) branch: ::std::option::Option<::std::string::String>,
pub(crate) directory: ::std::option::Option<::std::string::String>,
pub(crate) owner_id: ::std::option::Option<::std::string::String>,
pub(crate) repository_name: ::std::option::Option<::std::string::String>,
pub(crate) provider_type: ::std::option::Option<crate::types::ProviderType>,
pub(crate) sha: ::std::option::Option<::std::string::String>,
}
impl RevisionBuilder {
pub fn branch(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.branch = ::std::option::Option::Some(input.into());
self
}
pub fn set_branch(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.branch = input;
self
}
pub fn get_branch(&self) -> &::std::option::Option<::std::string::String> {
&self.branch
}
pub fn directory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.directory = ::std::option::Option::Some(input.into());
self
}
pub fn set_directory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.directory = input;
self
}
pub fn get_directory(&self) -> &::std::option::Option<::std::string::String> {
&self.directory
}
pub fn owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owner_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owner_id = input;
self
}
pub fn get_owner_id(&self) -> &::std::option::Option<::std::string::String> {
&self.owner_id
}
pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.repository_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.repository_name = input;
self
}
pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
&self.repository_name
}
pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
self.provider_type = ::std::option::Option::Some(input);
self
}
pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
self.provider_type = input;
self
}
pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
&self.provider_type
}
pub fn sha(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.sha = ::std::option::Option::Some(input.into());
self
}
pub fn set_sha(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sha = input;
self
}
pub fn get_sha(&self) -> &::std::option::Option<::std::string::String> {
&self.sha
}
pub fn build(self) -> ::std::result::Result<crate::types::Revision, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Revision {
branch: self.branch.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"branch",
"branch was not specified but it is required when building Revision",
)
})?,
directory: self.directory.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"directory",
"directory was not specified but it is required when building Revision",
)
})?,
owner_id: self.owner_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"owner_id",
"owner_id was not specified but it is required when building Revision",
)
})?,
repository_name: self.repository_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"repository_name",
"repository_name was not specified but it is required when building Revision",
)
})?,
provider_type: self.provider_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"provider_type",
"provider_type was not specified but it is required when building Revision",
)
})?,
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 Revision",
)
})?,
})
}
}