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