#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateArtifactInput {
#[doc(hidden)]
pub artifact_name: ::std::option::Option<::std::string::String>,
#[doc(hidden)]
pub source: ::std::option::Option<crate::types::ArtifactSource>,
#[doc(hidden)]
pub artifact_type: ::std::option::Option<::std::string::String>,
#[doc(hidden)]
pub properties: ::std::option::Option<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
#[doc(hidden)]
pub metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
#[doc(hidden)]
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateArtifactInput {
pub fn artifact_name(&self) -> ::std::option::Option<&str> {
self.artifact_name.as_deref()
}
pub fn source(&self) -> ::std::option::Option<&crate::types::ArtifactSource> {
self.source.as_ref()
}
pub fn artifact_type(&self) -> ::std::option::Option<&str> {
self.artifact_type.as_deref()
}
pub fn properties(
&self,
) -> ::std::option::Option<
&::std::collections::HashMap<::std::string::String, ::std::string::String>,
> {
self.properties.as_ref()
}
pub fn metadata_properties(&self) -> ::std::option::Option<&crate::types::MetadataProperties> {
self.metadata_properties.as_ref()
}
pub fn tags(&self) -> ::std::option::Option<&[crate::types::Tag]> {
self.tags.as_deref()
}
}
impl CreateArtifactInput {
pub fn builder() -> crate::operation::create_artifact::builders::CreateArtifactInputBuilder {
crate::operation::create_artifact::builders::CreateArtifactInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(
::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug,
)]
pub struct CreateArtifactInputBuilder {
pub(crate) artifact_name: ::std::option::Option<::std::string::String>,
pub(crate) source: ::std::option::Option<crate::types::ArtifactSource>,
pub(crate) artifact_type: ::std::option::Option<::std::string::String>,
pub(crate) properties: ::std::option::Option<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
pub(crate) metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateArtifactInputBuilder {
pub fn artifact_name(
mut self,
input: impl ::std::convert::Into<::std::string::String>,
) -> Self {
self.artifact_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_artifact_name(
mut self,
input: ::std::option::Option<::std::string::String>,
) -> Self {
self.artifact_name = input;
self
}
pub fn source(mut self, input: crate::types::ArtifactSource) -> Self {
self.source = ::std::option::Option::Some(input);
self
}
pub fn set_source(
mut self,
input: ::std::option::Option<crate::types::ArtifactSource>,
) -> Self {
self.source = input;
self
}
pub fn artifact_type(
mut self,
input: impl ::std::convert::Into<::std::string::String>,
) -> Self {
self.artifact_type = ::std::option::Option::Some(input.into());
self
}
pub fn set_artifact_type(
mut self,
input: ::std::option::Option<::std::string::String>,
) -> Self {
self.artifact_type = input;
self
}
pub fn properties(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.properties.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.properties = ::std::option::Option::Some(hash_map);
self
}
pub fn set_properties(
mut self,
input: ::std::option::Option<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
) -> Self {
self.properties = input;
self
}
pub fn metadata_properties(mut self, input: crate::types::MetadataProperties) -> Self {
self.metadata_properties = ::std::option::Option::Some(input);
self
}
pub fn set_metadata_properties(
mut self,
input: ::std::option::Option<crate::types::MetadataProperties>,
) -> Self {
self.metadata_properties = input;
self
}
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
pub fn set_tags(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::create_artifact::CreateArtifactInput,
::aws_smithy_http::operation::error::BuildError,
> {
::std::result::Result::Ok(crate::operation::create_artifact::CreateArtifactInput {
artifact_name: self.artifact_name,
source: self.source,
artifact_type: self.artifact_type,
properties: self.properties,
metadata_properties: self.metadata_properties,
tags: self.tags,
})
}
}