aws_sdk_sagemaker/operation/create_model_card/_create_model_card_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)]
5pub struct CreateModelCardInput {
6 /// <p>The unique name of the model card.</p>
7 pub model_card_name: ::std::option::Option<::std::string::String>,
8 /// <p>An optional Key Management Service key to encrypt, decrypt, and re-encrypt model card content for regulated workloads with highly sensitive data.</p>
9 pub security_config: ::std::option::Option<crate::types::ModelCardSecurityConfig>,
10 /// <p>The content of the model card. Content must be in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html#model-cards-json-schema">model card JSON schema</a> and provided as a string.</p>
11 pub content: ::std::option::Option<::std::string::String>,
12 /// <p>The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.</p>
13 /// <ul>
14 /// <li>
15 /// <p><code>Draft</code>: The model card is a work in progress.</p></li>
16 /// <li>
17 /// <p><code>PendingReview</code>: The model card is pending review.</p></li>
18 /// <li>
19 /// <p><code>Approved</code>: The model card is approved.</p></li>
20 /// <li>
21 /// <p><code>Archived</code>: The model card is archived. No more updates should be made to the model card, but it can still be exported.</p></li>
22 /// </ul>
23 pub model_card_status: ::std::option::Option<crate::types::ModelCardStatus>,
24 /// <p>Key-value pairs used to manage metadata for model cards.</p>
25 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
26}
27impl CreateModelCardInput {
28 /// <p>The unique name of the model card.</p>
29 pub fn model_card_name(&self) -> ::std::option::Option<&str> {
30 self.model_card_name.as_deref()
31 }
32 /// <p>An optional Key Management Service key to encrypt, decrypt, and re-encrypt model card content for regulated workloads with highly sensitive data.</p>
33 pub fn security_config(&self) -> ::std::option::Option<&crate::types::ModelCardSecurityConfig> {
34 self.security_config.as_ref()
35 }
36 /// <p>The content of the model card. Content must be in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html#model-cards-json-schema">model card JSON schema</a> and provided as a string.</p>
37 pub fn content(&self) -> ::std::option::Option<&str> {
38 self.content.as_deref()
39 }
40 /// <p>The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.</p>
41 /// <ul>
42 /// <li>
43 /// <p><code>Draft</code>: The model card is a work in progress.</p></li>
44 /// <li>
45 /// <p><code>PendingReview</code>: The model card is pending review.</p></li>
46 /// <li>
47 /// <p><code>Approved</code>: The model card is approved.</p></li>
48 /// <li>
49 /// <p><code>Archived</code>: The model card is archived. No more updates should be made to the model card, but it can still be exported.</p></li>
50 /// </ul>
51 pub fn model_card_status(&self) -> ::std::option::Option<&crate::types::ModelCardStatus> {
52 self.model_card_status.as_ref()
53 }
54 /// <p>Key-value pairs used to manage metadata for model cards.</p>
55 ///
56 /// 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()`.
57 pub fn tags(&self) -> &[crate::types::Tag] {
58 self.tags.as_deref().unwrap_or_default()
59 }
60}
61impl ::std::fmt::Debug for CreateModelCardInput {
62 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
63 let mut formatter = f.debug_struct("CreateModelCardInput");
64 formatter.field("model_card_name", &self.model_card_name);
65 formatter.field("security_config", &self.security_config);
66 formatter.field("content", &"*** Sensitive Data Redacted ***");
67 formatter.field("model_card_status", &self.model_card_status);
68 formatter.field("tags", &self.tags);
69 formatter.finish()
70 }
71}
72impl CreateModelCardInput {
73 /// Creates a new builder-style object to manufacture [`CreateModelCardInput`](crate::operation::create_model_card::CreateModelCardInput).
74 pub fn builder() -> crate::operation::create_model_card::builders::CreateModelCardInputBuilder {
75 crate::operation::create_model_card::builders::CreateModelCardInputBuilder::default()
76 }
77}
78
79/// A builder for [`CreateModelCardInput`](crate::operation::create_model_card::CreateModelCardInput).
80#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
81#[non_exhaustive]
82pub struct CreateModelCardInputBuilder {
83 pub(crate) model_card_name: ::std::option::Option<::std::string::String>,
84 pub(crate) security_config: ::std::option::Option<crate::types::ModelCardSecurityConfig>,
85 pub(crate) content: ::std::option::Option<::std::string::String>,
86 pub(crate) model_card_status: ::std::option::Option<crate::types::ModelCardStatus>,
87 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
88}
89impl CreateModelCardInputBuilder {
90 /// <p>The unique name of the model card.</p>
91 /// This field is required.
92 pub fn model_card_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93 self.model_card_name = ::std::option::Option::Some(input.into());
94 self
95 }
96 /// <p>The unique name of the model card.</p>
97 pub fn set_model_card_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98 self.model_card_name = input;
99 self
100 }
101 /// <p>The unique name of the model card.</p>
102 pub fn get_model_card_name(&self) -> &::std::option::Option<::std::string::String> {
103 &self.model_card_name
104 }
105 /// <p>An optional Key Management Service key to encrypt, decrypt, and re-encrypt model card content for regulated workloads with highly sensitive data.</p>
106 pub fn security_config(mut self, input: crate::types::ModelCardSecurityConfig) -> Self {
107 self.security_config = ::std::option::Option::Some(input);
108 self
109 }
110 /// <p>An optional Key Management Service key to encrypt, decrypt, and re-encrypt model card content for regulated workloads with highly sensitive data.</p>
111 pub fn set_security_config(mut self, input: ::std::option::Option<crate::types::ModelCardSecurityConfig>) -> Self {
112 self.security_config = input;
113 self
114 }
115 /// <p>An optional Key Management Service key to encrypt, decrypt, and re-encrypt model card content for regulated workloads with highly sensitive data.</p>
116 pub fn get_security_config(&self) -> &::std::option::Option<crate::types::ModelCardSecurityConfig> {
117 &self.security_config
118 }
119 /// <p>The content of the model card. Content must be in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html#model-cards-json-schema">model card JSON schema</a> and provided as a string.</p>
120 /// This field is required.
121 pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.content = ::std::option::Option::Some(input.into());
123 self
124 }
125 /// <p>The content of the model card. Content must be in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html#model-cards-json-schema">model card JSON schema</a> and provided as a string.</p>
126 pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.content = input;
128 self
129 }
130 /// <p>The content of the model card. Content must be in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html#model-cards-json-schema">model card JSON schema</a> and provided as a string.</p>
131 pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
132 &self.content
133 }
134 /// <p>The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.</p>
135 /// <ul>
136 /// <li>
137 /// <p><code>Draft</code>: The model card is a work in progress.</p></li>
138 /// <li>
139 /// <p><code>PendingReview</code>: The model card is pending review.</p></li>
140 /// <li>
141 /// <p><code>Approved</code>: The model card is approved.</p></li>
142 /// <li>
143 /// <p><code>Archived</code>: The model card is archived. No more updates should be made to the model card, but it can still be exported.</p></li>
144 /// </ul>
145 /// This field is required.
146 pub fn model_card_status(mut self, input: crate::types::ModelCardStatus) -> Self {
147 self.model_card_status = ::std::option::Option::Some(input);
148 self
149 }
150 /// <p>The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.</p>
151 /// <ul>
152 /// <li>
153 /// <p><code>Draft</code>: The model card is a work in progress.</p></li>
154 /// <li>
155 /// <p><code>PendingReview</code>: The model card is pending review.</p></li>
156 /// <li>
157 /// <p><code>Approved</code>: The model card is approved.</p></li>
158 /// <li>
159 /// <p><code>Archived</code>: The model card is archived. No more updates should be made to the model card, but it can still be exported.</p></li>
160 /// </ul>
161 pub fn set_model_card_status(mut self, input: ::std::option::Option<crate::types::ModelCardStatus>) -> Self {
162 self.model_card_status = input;
163 self
164 }
165 /// <p>The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.</p>
166 /// <ul>
167 /// <li>
168 /// <p><code>Draft</code>: The model card is a work in progress.</p></li>
169 /// <li>
170 /// <p><code>PendingReview</code>: The model card is pending review.</p></li>
171 /// <li>
172 /// <p><code>Approved</code>: The model card is approved.</p></li>
173 /// <li>
174 /// <p><code>Archived</code>: The model card is archived. No more updates should be made to the model card, but it can still be exported.</p></li>
175 /// </ul>
176 pub fn get_model_card_status(&self) -> &::std::option::Option<crate::types::ModelCardStatus> {
177 &self.model_card_status
178 }
179 /// Appends an item to `tags`.
180 ///
181 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
182 ///
183 /// <p>Key-value pairs used to manage metadata for model cards.</p>
184 pub fn tags(mut self, input: crate::types::Tag) -> Self {
185 let mut v = self.tags.unwrap_or_default();
186 v.push(input);
187 self.tags = ::std::option::Option::Some(v);
188 self
189 }
190 /// <p>Key-value pairs used to manage metadata for model cards.</p>
191 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
192 self.tags = input;
193 self
194 }
195 /// <p>Key-value pairs used to manage metadata for model cards.</p>
196 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
197 &self.tags
198 }
199 /// Consumes the builder and constructs a [`CreateModelCardInput`](crate::operation::create_model_card::CreateModelCardInput).
200 pub fn build(
201 self,
202 ) -> ::std::result::Result<crate::operation::create_model_card::CreateModelCardInput, ::aws_smithy_types::error::operation::BuildError> {
203 ::std::result::Result::Ok(crate::operation::create_model_card::CreateModelCardInput {
204 model_card_name: self.model_card_name,
205 security_config: self.security_config,
206 content: self.content,
207 model_card_status: self.model_card_status,
208 tags: self.tags,
209 })
210 }
211}
212impl ::std::fmt::Debug for CreateModelCardInputBuilder {
213 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
214 let mut formatter = f.debug_struct("CreateModelCardInputBuilder");
215 formatter.field("model_card_name", &self.model_card_name);
216 formatter.field("security_config", &self.security_config);
217 formatter.field("content", &"*** Sensitive Data Redacted ***");
218 formatter.field("model_card_status", &self.model_card_status);
219 formatter.field("tags", &self.tags);
220 formatter.finish()
221 }
222}