aws_sdk_lookoutvision/operation/stop_model/
_stop_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 StopModelInput {
6    /// <p>The name of the project that contains the model that you want to stop.</p>
7    pub project_name: ::std::option::Option<::std::string::String>,
8    /// <p>The version of the model that you want to stop.</p>
9    pub model_version: ::std::option::Option<::std::string::String>,
10    /// <p>ClientToken is an idempotency token that ensures a call to <code>StopModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StopModel</code>. In this case, safely retry your call to <code>StopModel</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 making multiple stop requests. 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>StopModel</code>. An idempotency token is active for 8 hours.</p>
13    pub client_token: ::std::option::Option<::std::string::String>,
14}
15impl StopModelInput {
16    /// <p>The name of the project that contains the model that you want to stop.</p>
17    pub fn project_name(&self) -> ::std::option::Option<&str> {
18        self.project_name.as_deref()
19    }
20    /// <p>The version of the model that you want to stop.</p>
21    pub fn model_version(&self) -> ::std::option::Option<&str> {
22        self.model_version.as_deref()
23    }
24    /// <p>ClientToken is an idempotency token that ensures a call to <code>StopModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StopModel</code>. In this case, safely retry your call to <code>StopModel</code> by using the same <code>ClientToken</code> parameter value.</p>
25    /// <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 stop requests. You'll need to provide your own value for other use cases.</p>
26    /// <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>StopModel</code>. An idempotency token is active for 8 hours.</p>
27    pub fn client_token(&self) -> ::std::option::Option<&str> {
28        self.client_token.as_deref()
29    }
30}
31impl StopModelInput {
32    /// Creates a new builder-style object to manufacture [`StopModelInput`](crate::operation::stop_model::StopModelInput).
33    pub fn builder() -> crate::operation::stop_model::builders::StopModelInputBuilder {
34        crate::operation::stop_model::builders::StopModelInputBuilder::default()
35    }
36}
37
38/// A builder for [`StopModelInput`](crate::operation::stop_model::StopModelInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct StopModelInputBuilder {
42    pub(crate) project_name: ::std::option::Option<::std::string::String>,
43    pub(crate) model_version: ::std::option::Option<::std::string::String>,
44    pub(crate) client_token: ::std::option::Option<::std::string::String>,
45}
46impl StopModelInputBuilder {
47    /// <p>The name of the project that contains the model that you want to stop.</p>
48    /// This field is required.
49    pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.project_name = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The name of the project that contains the model that you want to stop.</p>
54    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.project_name = input;
56        self
57    }
58    /// <p>The name of the project that contains the model that you want to stop.</p>
59    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
60        &self.project_name
61    }
62    /// <p>The version of the model that you want to stop.</p>
63    /// This field is required.
64    pub fn model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65        self.model_version = ::std::option::Option::Some(input.into());
66        self
67    }
68    /// <p>The version of the model that you want to stop.</p>
69    pub fn set_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70        self.model_version = input;
71        self
72    }
73    /// <p>The version of the model that you want to stop.</p>
74    pub fn get_model_version(&self) -> &::std::option::Option<::std::string::String> {
75        &self.model_version
76    }
77    /// <p>ClientToken is an idempotency token that ensures a call to <code>StopModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StopModel</code>. In this case, safely retry your call to <code>StopModel</code> by using the same <code>ClientToken</code> parameter value.</p>
78    /// <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 stop requests. You'll need to provide your own value for other use cases.</p>
79    /// <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>StopModel</code>. An idempotency token is active for 8 hours.</p>
80    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.client_token = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>ClientToken is an idempotency token that ensures a call to <code>StopModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StopModel</code>. In this case, safely retry your call to <code>StopModel</code> by using the same <code>ClientToken</code> parameter value.</p>
85    /// <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 stop requests. You'll need to provide your own value for other use cases.</p>
86    /// <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>StopModel</code>. An idempotency token is active for 8 hours.</p>
87    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.client_token = input;
89        self
90    }
91    /// <p>ClientToken is an idempotency token that ensures a call to <code>StopModel</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>StopModel</code>. In this case, safely retry your call to <code>StopModel</code> by using the same <code>ClientToken</code> parameter value.</p>
92    /// <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 stop requests. You'll need to provide your own value for other use cases.</p>
93    /// <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>StopModel</code>. An idempotency token is active for 8 hours.</p>
94    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
95        &self.client_token
96    }
97    /// Consumes the builder and constructs a [`StopModelInput`](crate::operation::stop_model::StopModelInput).
98    pub fn build(self) -> ::std::result::Result<crate::operation::stop_model::StopModelInput, ::aws_smithy_types::error::operation::BuildError> {
99        ::std::result::Result::Ok(crate::operation::stop_model::StopModelInput {
100            project_name: self.project_name,
101            model_version: self.model_version,
102            client_token: self.client_token,
103        })
104    }
105}