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>
7pub artifact_name: ::std::option::Option<::std::string::String>,
8/// <p>The ID, ID type, and URI of the source.</p>
9pub source: ::std::option::Option<crate::types::ArtifactSource>,
10/// <p>The artifact type.</p>
11pub artifact_type: ::std::option::Option<::std::string::String>,
12/// <p>A list of properties to add to the artifact.</p>
13pub 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>
15pub metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
16/// <p>A list of tags to apply to the artifact.</p>
17pub 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>
21pub fn artifact_name(&self) -> ::std::option::Option<&str> {
22self.artifact_name.as_deref()
23 }
24/// <p>The ID, ID type, and URI of the source.</p>
25pub fn source(&self) -> ::std::option::Option<&crate::types::ArtifactSource> {
26self.source.as_ref()
27 }
28/// <p>The artifact type.</p>
29pub fn artifact_type(&self) -> ::std::option::Option<&str> {
30self.artifact_type.as_deref()
31 }
32/// <p>A list of properties to add to the artifact.</p>
33pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
34self.properties.as_ref()
35 }
36/// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
37pub fn metadata_properties(&self) -> ::std::option::Option<&crate::types::MetadataProperties> {
38self.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()`.
43pub fn tags(&self) -> &[crate::types::Tag] {
44self.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).
49pub fn builder() -> crate::operation::create_artifact::builders::CreateArtifactInputBuilder {
50crate::operation::create_artifact::builders::CreateArtifactInputBuilder::default()
51 }
52}
5354/// 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 {
58pub(crate) artifact_name: ::std::option::Option<::std::string::String>,
59pub(crate) source: ::std::option::Option<crate::types::ArtifactSource>,
60pub(crate) artifact_type: ::std::option::Option<::std::string::String>,
61pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
62pub(crate) metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
63pub(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>
67pub fn artifact_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68self.artifact_name = ::std::option::Option::Some(input.into());
69self
70}
71/// <p>The name of the artifact. Must be unique to your account in an Amazon Web Services Region.</p>
72pub fn set_artifact_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73self.artifact_name = input;
74self
75}
76/// <p>The name of the artifact. Must be unique to your account in an Amazon Web Services Region.</p>
77pub 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.
82pub fn source(mut self, input: crate::types::ArtifactSource) -> Self {
83self.source = ::std::option::Option::Some(input);
84self
85}
86/// <p>The ID, ID type, and URI of the source.</p>
87pub fn set_source(mut self, input: ::std::option::Option<crate::types::ArtifactSource>) -> Self {
88self.source = input;
89self
90}
91/// <p>The ID, ID type, and URI of the source.</p>
92pub 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.
97pub fn artifact_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98self.artifact_type = ::std::option::Option::Some(input.into());
99self
100}
101/// <p>The artifact type.</p>
102pub fn set_artifact_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103self.artifact_type = input;
104self
105}
106/// <p>The artifact type.</p>
107pub 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>
115pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
116let mut hash_map = self.properties.unwrap_or_default();
117 hash_map.insert(k.into(), v.into());
118self.properties = ::std::option::Option::Some(hash_map);
119self
120}
121/// <p>A list of properties to add to the artifact.</p>
122pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
123self.properties = input;
124self
125}
126/// <p>A list of properties to add to the artifact.</p>
127pub 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>
131pub fn metadata_properties(mut self, input: crate::types::MetadataProperties) -> Self {
132self.metadata_properties = ::std::option::Option::Some(input);
133self
134}
135/// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
136pub fn set_metadata_properties(mut self, input: ::std::option::Option<crate::types::MetadataProperties>) -> Self {
137self.metadata_properties = input;
138self
139}
140/// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
141pub 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>
149pub fn tags(mut self, input: crate::types::Tag) -> Self {
150let mut v = self.tags.unwrap_or_default();
151 v.push(input);
152self.tags = ::std::option::Option::Some(v);
153self
154}
155/// <p>A list of tags to apply to the artifact.</p>
156pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
157self.tags = input;
158self
159}
160/// <p>A list of tags to apply to the artifact.</p>
161pub 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).
165pub fn build(
166self,
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}