aws_sdk_sagemaker/operation/create_artifact/
_create_artifact_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateArtifactInput {
6 pub artifact_name: ::std::option::Option<::std::string::String>,
8 pub source: ::std::option::Option<crate::types::ArtifactSource>,
10 pub artifact_type: ::std::option::Option<::std::string::String>,
12 pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14 pub metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
16 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18}
19impl CreateArtifactInput {
20 pub fn artifact_name(&self) -> ::std::option::Option<&str> {
22 self.artifact_name.as_deref()
23 }
24 pub fn source(&self) -> ::std::option::Option<&crate::types::ArtifactSource> {
26 self.source.as_ref()
27 }
28 pub fn artifact_type(&self) -> ::std::option::Option<&str> {
30 self.artifact_type.as_deref()
31 }
32 pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
34 self.properties.as_ref()
35 }
36 pub fn metadata_properties(&self) -> ::std::option::Option<&crate::types::MetadataProperties> {
38 self.metadata_properties.as_ref()
39 }
40 pub fn tags(&self) -> &[crate::types::Tag] {
44 self.tags.as_deref().unwrap_or_default()
45 }
46}
47impl CreateArtifactInput {
48 pub fn builder() -> crate::operation::create_artifact::builders::CreateArtifactInputBuilder {
50 crate::operation::create_artifact::builders::CreateArtifactInputBuilder::default()
51 }
52}
53
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateArtifactInputBuilder {
58 pub(crate) artifact_name: ::std::option::Option<::std::string::String>,
59 pub(crate) source: ::std::option::Option<crate::types::ArtifactSource>,
60 pub(crate) artifact_type: ::std::option::Option<::std::string::String>,
61 pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
62 pub(crate) metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
63 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
64}
65impl CreateArtifactInputBuilder {
66 pub fn artifact_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68 self.artifact_name = ::std::option::Option::Some(input.into());
69 self
70 }
71 pub fn set_artifact_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.artifact_name = input;
74 self
75 }
76 pub fn get_artifact_name(&self) -> &::std::option::Option<::std::string::String> {
78 &self.artifact_name
79 }
80 pub fn source(mut self, input: crate::types::ArtifactSource) -> Self {
83 self.source = ::std::option::Option::Some(input);
84 self
85 }
86 pub fn set_source(mut self, input: ::std::option::Option<crate::types::ArtifactSource>) -> Self {
88 self.source = input;
89 self
90 }
91 pub fn get_source(&self) -> &::std::option::Option<crate::types::ArtifactSource> {
93 &self.source
94 }
95 pub fn artifact_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98 self.artifact_type = ::std::option::Option::Some(input.into());
99 self
100 }
101 pub fn set_artifact_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.artifact_type = input;
104 self
105 }
106 pub fn get_artifact_type(&self) -> &::std::option::Option<::std::string::String> {
108 &self.artifact_type
109 }
110 pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
116 let mut hash_map = self.properties.unwrap_or_default();
117 hash_map.insert(k.into(), v.into());
118 self.properties = ::std::option::Option::Some(hash_map);
119 self
120 }
121 pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
123 self.properties = input;
124 self
125 }
126 pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
128 &self.properties
129 }
130 pub fn metadata_properties(mut self, input: crate::types::MetadataProperties) -> Self {
132 self.metadata_properties = ::std::option::Option::Some(input);
133 self
134 }
135 pub fn set_metadata_properties(mut self, input: ::std::option::Option<crate::types::MetadataProperties>) -> Self {
137 self.metadata_properties = input;
138 self
139 }
140 pub fn get_metadata_properties(&self) -> &::std::option::Option<crate::types::MetadataProperties> {
142 &self.metadata_properties
143 }
144 pub fn tags(mut self, input: crate::types::Tag) -> Self {
150 let mut v = self.tags.unwrap_or_default();
151 v.push(input);
152 self.tags = ::std::option::Option::Some(v);
153 self
154 }
155 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
157 self.tags = input;
158 self
159 }
160 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
162 &self.tags
163 }
164 pub fn build(
166 self,
167 ) -> ::std::result::Result<crate::operation::create_artifact::CreateArtifactInput, ::aws_smithy_types::error::operation::BuildError> {
168 ::std::result::Result::Ok(crate::operation::create_artifact::CreateArtifactInput {
169 artifact_name: self.artifact_name,
170 source: self.source,
171 artifact_type: self.artifact_type,
172 properties: self.properties,
173 metadata_properties: self.metadata_properties,
174 tags: self.tags,
175 })
176 }
177}