aws_sdk_lookoutvision/operation/create_model/_create_model_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 CreateModelInput {
6 /// <p>The name of the project in which you want to create a model version.</p>
7 pub project_name: ::std::option::Option<::std::string::String>,
8 /// <p>A description for the version of the model.</p>
9 pub description: ::std::option::Option<::std::string::String>,
10 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateModel</code>. In this case, safely retry your call to <code>CreateModel</code> by using the same <code>ClientToken</code> parameter value.</p>
11 /// <p>If you don't supply a value for <code>ClientToken</code>, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from starting multiple training jobs. You'll need to provide your own value for other use cases.</p>
12 /// <p>An error occurs if the other input parameters are not the same as in the first request. Using a different value for <code>ClientToken</code> is considered a new call to <code>CreateModel</code>. An idempotency token is active for 8 hours.</p>
13 pub client_token: ::std::option::Option<::std::string::String>,
14 /// <p>The location where Amazon Lookout for Vision saves the training results.</p>
15 pub output_config: ::std::option::Option<crate::types::OutputConfig>,
16 /// <p>The identifier for your AWS KMS key. The key is used to encrypt training and test images copied into the service for model training. Your source images are unaffected. If this parameter is not specified, the copied images are encrypted by a key that AWS owns and manages.</p>
17 pub kms_key_id: ::std::option::Option<::std::string::String>,
18 /// <p>A set of tags (key-value pairs) that you want to attach to the model.</p>
19 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
20}
21impl CreateModelInput {
22 /// <p>The name of the project in which you want to create a model version.</p>
23 pub fn project_name(&self) -> ::std::option::Option<&str> {
24 self.project_name.as_deref()
25 }
26 /// <p>A description for the version of the model.</p>
27 pub fn description(&self) -> ::std::option::Option<&str> {
28 self.description.as_deref()
29 }
30 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateModel</code>. In this case, safely retry your call to <code>CreateModel</code> by using the same <code>ClientToken</code> parameter value.</p>
31 /// <p>If you don't supply a value for <code>ClientToken</code>, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from starting multiple training jobs. You'll need to provide your own value for other use cases.</p>
32 /// <p>An error occurs if the other input parameters are not the same as in the first request. Using a different value for <code>ClientToken</code> is considered a new call to <code>CreateModel</code>. An idempotency token is active for 8 hours.</p>
33 pub fn client_token(&self) -> ::std::option::Option<&str> {
34 self.client_token.as_deref()
35 }
36 /// <p>The location where Amazon Lookout for Vision saves the training results.</p>
37 pub fn output_config(&self) -> ::std::option::Option<&crate::types::OutputConfig> {
38 self.output_config.as_ref()
39 }
40 /// <p>The identifier for your AWS KMS key. The key is used to encrypt training and test images copied into the service for model training. Your source images are unaffected. If this parameter is not specified, the copied images are encrypted by a key that AWS owns and manages.</p>
41 pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
42 self.kms_key_id.as_deref()
43 }
44 /// <p>A set of tags (key-value pairs) that you want to attach to the model.</p>
45 ///
46 /// 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()`.
47 pub fn tags(&self) -> &[crate::types::Tag] {
48 self.tags.as_deref().unwrap_or_default()
49 }
50}
51impl CreateModelInput {
52 /// Creates a new builder-style object to manufacture [`CreateModelInput`](crate::operation::create_model::CreateModelInput).
53 pub fn builder() -> crate::operation::create_model::builders::CreateModelInputBuilder {
54 crate::operation::create_model::builders::CreateModelInputBuilder::default()
55 }
56}
57
58/// A builder for [`CreateModelInput`](crate::operation::create_model::CreateModelInput).
59#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
60#[non_exhaustive]
61pub struct CreateModelInputBuilder {
62 pub(crate) project_name: ::std::option::Option<::std::string::String>,
63 pub(crate) description: ::std::option::Option<::std::string::String>,
64 pub(crate) client_token: ::std::option::Option<::std::string::String>,
65 pub(crate) output_config: ::std::option::Option<crate::types::OutputConfig>,
66 pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
67 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
68}
69impl CreateModelInputBuilder {
70 /// <p>The name of the project in which you want to create a model version.</p>
71 /// This field is required.
72 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 self.project_name = ::std::option::Option::Some(input.into());
74 self
75 }
76 /// <p>The name of the project in which you want to create a model version.</p>
77 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78 self.project_name = input;
79 self
80 }
81 /// <p>The name of the project in which you want to create a model version.</p>
82 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
83 &self.project_name
84 }
85 /// <p>A description for the version of the model.</p>
86 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.description = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>A description for the version of the model.</p>
91 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.description = input;
93 self
94 }
95 /// <p>A description for the version of the model.</p>
96 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
97 &self.description
98 }
99 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateModel</code>. In this case, safely retry your call to <code>CreateModel</code> by using the same <code>ClientToken</code> parameter value.</p>
100 /// <p>If you don't supply a value for <code>ClientToken</code>, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from starting multiple training jobs. You'll need to provide your own value for other use cases.</p>
101 /// <p>An error occurs if the other input parameters are not the same as in the first request. Using a different value for <code>ClientToken</code> is considered a new call to <code>CreateModel</code>. An idempotency token is active for 8 hours.</p>
102 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.client_token = ::std::option::Option::Some(input.into());
104 self
105 }
106 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateModel</code>. In this case, safely retry your call to <code>CreateModel</code> by using the same <code>ClientToken</code> parameter value.</p>
107 /// <p>If you don't supply a value for <code>ClientToken</code>, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from starting multiple training jobs. You'll need to provide your own value for other use cases.</p>
108 /// <p>An error occurs if the other input parameters are not the same as in the first request. Using a different value for <code>ClientToken</code> is considered a new call to <code>CreateModel</code>. An idempotency token is active for 8 hours.</p>
109 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.client_token = input;
111 self
112 }
113 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateModel</code>. In this case, safely retry your call to <code>CreateModel</code> by using the same <code>ClientToken</code> parameter value.</p>
114 /// <p>If you don't supply a value for <code>ClientToken</code>, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from starting multiple training jobs. You'll need to provide your own value for other use cases.</p>
115 /// <p>An error occurs if the other input parameters are not the same as in the first request. Using a different value for <code>ClientToken</code> is considered a new call to <code>CreateModel</code>. An idempotency token is active for 8 hours.</p>
116 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
117 &self.client_token
118 }
119 /// <p>The location where Amazon Lookout for Vision saves the training results.</p>
120 /// This field is required.
121 pub fn output_config(mut self, input: crate::types::OutputConfig) -> Self {
122 self.output_config = ::std::option::Option::Some(input);
123 self
124 }
125 /// <p>The location where Amazon Lookout for Vision saves the training results.</p>
126 pub fn set_output_config(mut self, input: ::std::option::Option<crate::types::OutputConfig>) -> Self {
127 self.output_config = input;
128 self
129 }
130 /// <p>The location where Amazon Lookout for Vision saves the training results.</p>
131 pub fn get_output_config(&self) -> &::std::option::Option<crate::types::OutputConfig> {
132 &self.output_config
133 }
134 /// <p>The identifier for your AWS KMS key. The key is used to encrypt training and test images copied into the service for model training. Your source images are unaffected. If this parameter is not specified, the copied images are encrypted by a key that AWS owns and manages.</p>
135 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.kms_key_id = ::std::option::Option::Some(input.into());
137 self
138 }
139 /// <p>The identifier for your AWS KMS key. The key is used to encrypt training and test images copied into the service for model training. Your source images are unaffected. If this parameter is not specified, the copied images are encrypted by a key that AWS owns and manages.</p>
140 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.kms_key_id = input;
142 self
143 }
144 /// <p>The identifier for your AWS KMS key. The key is used to encrypt training and test images copied into the service for model training. Your source images are unaffected. If this parameter is not specified, the copied images are encrypted by a key that AWS owns and manages.</p>
145 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
146 &self.kms_key_id
147 }
148 /// Appends an item to `tags`.
149 ///
150 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
151 ///
152 /// <p>A set of tags (key-value pairs) that you want to attach to the model.</p>
153 pub fn tags(mut self, input: crate::types::Tag) -> Self {
154 let mut v = self.tags.unwrap_or_default();
155 v.push(input);
156 self.tags = ::std::option::Option::Some(v);
157 self
158 }
159 /// <p>A set of tags (key-value pairs) that you want to attach to the model.</p>
160 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
161 self.tags = input;
162 self
163 }
164 /// <p>A set of tags (key-value pairs) that you want to attach to the model.</p>
165 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
166 &self.tags
167 }
168 /// Consumes the builder and constructs a [`CreateModelInput`](crate::operation::create_model::CreateModelInput).
169 pub fn build(self) -> ::std::result::Result<crate::operation::create_model::CreateModelInput, ::aws_smithy_types::error::operation::BuildError> {
170 ::std::result::Result::Ok(crate::operation::create_model::CreateModelInput {
171 project_name: self.project_name,
172 description: self.description,
173 client_token: self.client_token,
174 output_config: self.output_config,
175 kms_key_id: self.kms_key_id,
176 tags: self.tags,
177 })
178 }
179}