aws_sdk_lookoutvision/operation/start_model/_start_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 StartModelInput {
6 /// <p>The name of the project that contains the model that you want to start.</p>
7 pub project_name: ::std::option::Option<::std::string::String>,
8 /// <p>The version of the model that you want to start.</p>
9 pub model_version: ::std::option::Option<::std::string::String>,
10 /// <p>The minimum number of inference units to use. A single inference unit represents 1 hour of processing. Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.</p>
11 pub min_inference_units: ::std::option::Option<i32>,
12 /// <p>ClientToken is an idempotency token that ensures a call to <code>StartModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StartModel</code>. In this case, safely retry your call to <code>StartModel</code> by using the same <code>ClientToken</code> parameter value.</p>
13 /// <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 making multiple start requests. You'll need to provide your own value for other use cases.</p>
14 /// <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>StartModel</code>. An idempotency token is active for 8 hours.</p>
15 pub client_token: ::std::option::Option<::std::string::String>,
16 /// <p>The maximum number of inference units to use for auto-scaling the model. If you don't specify a value, Amazon Lookout for Vision doesn't auto-scale the model.</p>
17 pub max_inference_units: ::std::option::Option<i32>,
18}
19impl StartModelInput {
20 /// <p>The name of the project that contains the model that you want to start.</p>
21 pub fn project_name(&self) -> ::std::option::Option<&str> {
22 self.project_name.as_deref()
23 }
24 /// <p>The version of the model that you want to start.</p>
25 pub fn model_version(&self) -> ::std::option::Option<&str> {
26 self.model_version.as_deref()
27 }
28 /// <p>The minimum number of inference units to use. A single inference unit represents 1 hour of processing. Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.</p>
29 pub fn min_inference_units(&self) -> ::std::option::Option<i32> {
30 self.min_inference_units
31 }
32 /// <p>ClientToken is an idempotency token that ensures a call to <code>StartModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StartModel</code>. In this case, safely retry your call to <code>StartModel</code> by using the same <code>ClientToken</code> parameter value.</p>
33 /// <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 making multiple start requests. You'll need to provide your own value for other use cases.</p>
34 /// <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>StartModel</code>. An idempotency token is active for 8 hours.</p>
35 pub fn client_token(&self) -> ::std::option::Option<&str> {
36 self.client_token.as_deref()
37 }
38 /// <p>The maximum number of inference units to use for auto-scaling the model. If you don't specify a value, Amazon Lookout for Vision doesn't auto-scale the model.</p>
39 pub fn max_inference_units(&self) -> ::std::option::Option<i32> {
40 self.max_inference_units
41 }
42}
43impl StartModelInput {
44 /// Creates a new builder-style object to manufacture [`StartModelInput`](crate::operation::start_model::StartModelInput).
45 pub fn builder() -> crate::operation::start_model::builders::StartModelInputBuilder {
46 crate::operation::start_model::builders::StartModelInputBuilder::default()
47 }
48}
49
50/// A builder for [`StartModelInput`](crate::operation::start_model::StartModelInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct StartModelInputBuilder {
54 pub(crate) project_name: ::std::option::Option<::std::string::String>,
55 pub(crate) model_version: ::std::option::Option<::std::string::String>,
56 pub(crate) min_inference_units: ::std::option::Option<i32>,
57 pub(crate) client_token: ::std::option::Option<::std::string::String>,
58 pub(crate) max_inference_units: ::std::option::Option<i32>,
59}
60impl StartModelInputBuilder {
61 /// <p>The name of the project that contains the model that you want to start.</p>
62 /// This field is required.
63 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64 self.project_name = ::std::option::Option::Some(input.into());
65 self
66 }
67 /// <p>The name of the project that contains the model that you want to start.</p>
68 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69 self.project_name = input;
70 self
71 }
72 /// <p>The name of the project that contains the model that you want to start.</p>
73 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
74 &self.project_name
75 }
76 /// <p>The version of the model that you want to start.</p>
77 /// This field is required.
78 pub fn model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79 self.model_version = ::std::option::Option::Some(input.into());
80 self
81 }
82 /// <p>The version of the model that you want to start.</p>
83 pub fn set_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84 self.model_version = input;
85 self
86 }
87 /// <p>The version of the model that you want to start.</p>
88 pub fn get_model_version(&self) -> &::std::option::Option<::std::string::String> {
89 &self.model_version
90 }
91 /// <p>The minimum number of inference units to use. A single inference unit represents 1 hour of processing. Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.</p>
92 /// This field is required.
93 pub fn min_inference_units(mut self, input: i32) -> Self {
94 self.min_inference_units = ::std::option::Option::Some(input);
95 self
96 }
97 /// <p>The minimum number of inference units to use. A single inference unit represents 1 hour of processing. Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.</p>
98 pub fn set_min_inference_units(mut self, input: ::std::option::Option<i32>) -> Self {
99 self.min_inference_units = input;
100 self
101 }
102 /// <p>The minimum number of inference units to use. A single inference unit represents 1 hour of processing. Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.</p>
103 pub fn get_min_inference_units(&self) -> &::std::option::Option<i32> {
104 &self.min_inference_units
105 }
106 /// <p>ClientToken is an idempotency token that ensures a call to <code>StartModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StartModel</code>. In this case, safely retry your call to <code>StartModel</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 making multiple start requests. 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>StartModel</code>. An idempotency token is active for 8 hours.</p>
109 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110 self.client_token = ::std::option::Option::Some(input.into());
111 self
112 }
113 /// <p>ClientToken is an idempotency token that ensures a call to <code>StartModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StartModel</code>. In this case, safely retry your call to <code>StartModel</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 making multiple start requests. 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>StartModel</code>. An idempotency token is active for 8 hours.</p>
116 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117 self.client_token = input;
118 self
119 }
120 /// <p>ClientToken is an idempotency token that ensures a call to <code>StartModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StartModel</code>. In this case, safely retry your call to <code>StartModel</code> by using the same <code>ClientToken</code> parameter value.</p>
121 /// <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 making multiple start requests. You'll need to provide your own value for other use cases.</p>
122 /// <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>StartModel</code>. An idempotency token is active for 8 hours.</p>
123 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
124 &self.client_token
125 }
126 /// <p>The maximum number of inference units to use for auto-scaling the model. If you don't specify a value, Amazon Lookout for Vision doesn't auto-scale the model.</p>
127 pub fn max_inference_units(mut self, input: i32) -> Self {
128 self.max_inference_units = ::std::option::Option::Some(input);
129 self
130 }
131 /// <p>The maximum number of inference units to use for auto-scaling the model. If you don't specify a value, Amazon Lookout for Vision doesn't auto-scale the model.</p>
132 pub fn set_max_inference_units(mut self, input: ::std::option::Option<i32>) -> Self {
133 self.max_inference_units = input;
134 self
135 }
136 /// <p>The maximum number of inference units to use for auto-scaling the model. If you don't specify a value, Amazon Lookout for Vision doesn't auto-scale the model.</p>
137 pub fn get_max_inference_units(&self) -> &::std::option::Option<i32> {
138 &self.max_inference_units
139 }
140 /// Consumes the builder and constructs a [`StartModelInput`](crate::operation::start_model::StartModelInput).
141 pub fn build(self) -> ::std::result::Result<crate::operation::start_model::StartModelInput, ::aws_smithy_types::error::operation::BuildError> {
142 ::std::result::Result::Ok(crate::operation::start_model::StartModelInput {
143 project_name: self.project_name,
144 model_version: self.model_version,
145 min_inference_units: self.min_inference_units,
146 client_token: self.client_token,
147 max_inference_units: self.max_inference_units,
148 })
149 }
150}