aws_sdk_sagemaker/operation/create_artifact/
_create_artifact_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateArtifactInput {
6    /// <p>The name of the artifact. Must be unique to your account in an Amazon Web Services Region.</p>
7    pub artifact_name: ::std::option::Option<::std::string::String>,
8    /// <p>The ID, ID type, and URI of the source.</p>
9    pub source: ::std::option::Option<crate::types::ArtifactSource>,
10    /// <p>The artifact type.</p>
11    pub artifact_type: ::std::option::Option<::std::string::String>,
12    /// <p>A list of properties to add to the artifact.</p>
13    pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
15    pub metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
16    /// <p>A list of tags to apply to the artifact.</p>
17    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18}
19impl CreateArtifactInput {
20    /// <p>The name of the artifact. Must be unique to your account in an Amazon Web Services Region.</p>
21    pub fn artifact_name(&self) -> ::std::option::Option<&str> {
22        self.artifact_name.as_deref()
23    }
24    /// <p>The ID, ID type, and URI of the source.</p>
25    pub fn source(&self) -> ::std::option::Option<&crate::types::ArtifactSource> {
26        self.source.as_ref()
27    }
28    /// <p>The artifact type.</p>
29    pub fn artifact_type(&self) -> ::std::option::Option<&str> {
30        self.artifact_type.as_deref()
31    }
32    /// <p>A list of properties to add to the artifact.</p>
33    pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
34        self.properties.as_ref()
35    }
36    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
37    pub fn metadata_properties(&self) -> ::std::option::Option<&crate::types::MetadataProperties> {
38        self.metadata_properties.as_ref()
39    }
40    /// <p>A list of tags to apply to the artifact.</p>
41    ///
42    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
43    pub fn tags(&self) -> &[crate::types::Tag] {
44        self.tags.as_deref().unwrap_or_default()
45    }
46}
47impl CreateArtifactInput {
48    /// Creates a new builder-style object to manufacture [`CreateArtifactInput`](crate::operation::create_artifact::CreateArtifactInput).
49    pub fn builder() -> crate::operation::create_artifact::builders::CreateArtifactInputBuilder {
50        crate::operation::create_artifact::builders::CreateArtifactInputBuilder::default()
51    }
52}
53
54/// A builder for [`CreateArtifactInput`](crate::operation::create_artifact::CreateArtifactInput).
55#[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    /// <p>The name of the artifact. Must be unique to your account in an Amazon Web Services Region.</p>
67    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    /// <p>The name of the artifact. Must be unique to your account in an Amazon Web Services Region.</p>
72    pub fn set_artifact_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.artifact_name = input;
74        self
75    }
76    /// <p>The name of the artifact. Must be unique to your account in an Amazon Web Services Region.</p>
77    pub fn get_artifact_name(&self) -> &::std::option::Option<::std::string::String> {
78        &self.artifact_name
79    }
80    /// <p>The ID, ID type, and URI of the source.</p>
81    /// This field is required.
82    pub fn source(mut self, input: crate::types::ArtifactSource) -> Self {
83        self.source = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>The ID, ID type, and URI of the source.</p>
87    pub fn set_source(mut self, input: ::std::option::Option<crate::types::ArtifactSource>) -> Self {
88        self.source = input;
89        self
90    }
91    /// <p>The ID, ID type, and URI of the source.</p>
92    pub fn get_source(&self) -> &::std::option::Option<crate::types::ArtifactSource> {
93        &self.source
94    }
95    /// <p>The artifact type.</p>
96    /// This field is required.
97    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    /// <p>The artifact type.</p>
102    pub fn set_artifact_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.artifact_type = input;
104        self
105    }
106    /// <p>The artifact type.</p>
107    pub fn get_artifact_type(&self) -> &::std::option::Option<::std::string::String> {
108        &self.artifact_type
109    }
110    /// Adds a key-value pair to `properties`.
111    ///
112    /// To override the contents of this collection use [`set_properties`](Self::set_properties).
113    ///
114    /// <p>A list of properties to add to the artifact.</p>
115    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    /// <p>A list of properties to add to the artifact.</p>
122    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    /// <p>A list of properties to add to the artifact.</p>
127    pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
128        &self.properties
129    }
130    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
131    pub fn metadata_properties(mut self, input: crate::types::MetadataProperties) -> Self {
132        self.metadata_properties = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
136    pub fn set_metadata_properties(mut self, input: ::std::option::Option<crate::types::MetadataProperties>) -> Self {
137        self.metadata_properties = input;
138        self
139    }
140    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
141    pub fn get_metadata_properties(&self) -> &::std::option::Option<crate::types::MetadataProperties> {
142        &self.metadata_properties
143    }
144    /// Appends an item to `tags`.
145    ///
146    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
147    ///
148    /// <p>A list of tags to apply to the artifact.</p>
149    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    /// <p>A list of tags to apply to the artifact.</p>
156    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    /// <p>A list of tags to apply to the artifact.</p>
161    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
162        &self.tags
163    }
164    /// Consumes the builder and constructs a [`CreateArtifactInput`](crate::operation::create_artifact::CreateArtifactInput).
165    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}