aws_sdk_lookoutvision/operation/create_dataset/_create_dataset_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 CreateDatasetInput {
6 /// <p>The name of the project in which you want to create a dataset.</p>
7 pub project_name: ::std::option::Option<::std::string::String>,
8 /// <p>The type of the dataset. Specify <code>train</code> for a training dataset. Specify <code>test</code> for a test dataset.</p>
9 pub dataset_type: ::std::option::Option<::std::string::String>,
10 /// <p>The location of the manifest file that Amazon Lookout for Vision uses to create the dataset.</p>
11 /// <p>If you don't specify <code>DatasetSource</code>, an empty dataset is created and the operation synchronously returns. Later, you can add JSON Lines by calling <code>UpdateDatasetEntries</code>.</p>
12 /// <p>If you specify a value for <code>DataSource</code>, the manifest at the S3 location is validated and used to create the dataset. The call to <code>CreateDataset</code> is asynchronous and might take a while to complete. To find out the current status, Check the value of <code>Status</code> returned in a call to <code>DescribeDataset</code>.</p>
13 pub dataset_source: ::std::option::Option<crate::types::DatasetSource>,
14 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateDataset</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateDataset</code>. In this case, safely retry your call to <code>CreateDataset</code> by using the same <code>ClientToken</code> parameter value.</p>
15 /// <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 dataset creation requests. You'll need to provide your own value for other use cases.</p>
16 /// <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>CreateDataset</code>. An idempotency token is active for 8 hours.</p>
17 pub client_token: ::std::option::Option<::std::string::String>,
18}
19impl CreateDatasetInput {
20 /// <p>The name of the project in which you want to create a dataset.</p>
21 pub fn project_name(&self) -> ::std::option::Option<&str> {
22 self.project_name.as_deref()
23 }
24 /// <p>The type of the dataset. Specify <code>train</code> for a training dataset. Specify <code>test</code> for a test dataset.</p>
25 pub fn dataset_type(&self) -> ::std::option::Option<&str> {
26 self.dataset_type.as_deref()
27 }
28 /// <p>The location of the manifest file that Amazon Lookout for Vision uses to create the dataset.</p>
29 /// <p>If you don't specify <code>DatasetSource</code>, an empty dataset is created and the operation synchronously returns. Later, you can add JSON Lines by calling <code>UpdateDatasetEntries</code>.</p>
30 /// <p>If you specify a value for <code>DataSource</code>, the manifest at the S3 location is validated and used to create the dataset. The call to <code>CreateDataset</code> is asynchronous and might take a while to complete. To find out the current status, Check the value of <code>Status</code> returned in a call to <code>DescribeDataset</code>.</p>
31 pub fn dataset_source(&self) -> ::std::option::Option<&crate::types::DatasetSource> {
32 self.dataset_source.as_ref()
33 }
34 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateDataset</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateDataset</code>. In this case, safely retry your call to <code>CreateDataset</code> by using the same <code>ClientToken</code> parameter value.</p>
35 /// <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 dataset creation requests. You'll need to provide your own value for other use cases.</p>
36 /// <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>CreateDataset</code>. An idempotency token is active for 8 hours.</p>
37 pub fn client_token(&self) -> ::std::option::Option<&str> {
38 self.client_token.as_deref()
39 }
40}
41impl CreateDatasetInput {
42 /// Creates a new builder-style object to manufacture [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
43 pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
44 crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
45 }
46}
47
48/// A builder for [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateDatasetInputBuilder {
52 pub(crate) project_name: ::std::option::Option<::std::string::String>,
53 pub(crate) dataset_type: ::std::option::Option<::std::string::String>,
54 pub(crate) dataset_source: ::std::option::Option<crate::types::DatasetSource>,
55 pub(crate) client_token: ::std::option::Option<::std::string::String>,
56}
57impl CreateDatasetInputBuilder {
58 /// <p>The name of the project in which you want to create a dataset.</p>
59 /// This field is required.
60 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.project_name = ::std::option::Option::Some(input.into());
62 self
63 }
64 /// <p>The name of the project in which you want to create a dataset.</p>
65 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.project_name = input;
67 self
68 }
69 /// <p>The name of the project in which you want to create a dataset.</p>
70 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
71 &self.project_name
72 }
73 /// <p>The type of the dataset. Specify <code>train</code> for a training dataset. Specify <code>test</code> for a test dataset.</p>
74 /// This field is required.
75 pub fn dataset_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.dataset_type = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The type of the dataset. Specify <code>train</code> for a training dataset. Specify <code>test</code> for a test dataset.</p>
80 pub fn set_dataset_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.dataset_type = input;
82 self
83 }
84 /// <p>The type of the dataset. Specify <code>train</code> for a training dataset. Specify <code>test</code> for a test dataset.</p>
85 pub fn get_dataset_type(&self) -> &::std::option::Option<::std::string::String> {
86 &self.dataset_type
87 }
88 /// <p>The location of the manifest file that Amazon Lookout for Vision uses to create the dataset.</p>
89 /// <p>If you don't specify <code>DatasetSource</code>, an empty dataset is created and the operation synchronously returns. Later, you can add JSON Lines by calling <code>UpdateDatasetEntries</code>.</p>
90 /// <p>If you specify a value for <code>DataSource</code>, the manifest at the S3 location is validated and used to create the dataset. The call to <code>CreateDataset</code> is asynchronous and might take a while to complete. To find out the current status, Check the value of <code>Status</code> returned in a call to <code>DescribeDataset</code>.</p>
91 pub fn dataset_source(mut self, input: crate::types::DatasetSource) -> Self {
92 self.dataset_source = ::std::option::Option::Some(input);
93 self
94 }
95 /// <p>The location of the manifest file that Amazon Lookout for Vision uses to create the dataset.</p>
96 /// <p>If you don't specify <code>DatasetSource</code>, an empty dataset is created and the operation synchronously returns. Later, you can add JSON Lines by calling <code>UpdateDatasetEntries</code>.</p>
97 /// <p>If you specify a value for <code>DataSource</code>, the manifest at the S3 location is validated and used to create the dataset. The call to <code>CreateDataset</code> is asynchronous and might take a while to complete. To find out the current status, Check the value of <code>Status</code> returned in a call to <code>DescribeDataset</code>.</p>
98 pub fn set_dataset_source(mut self, input: ::std::option::Option<crate::types::DatasetSource>) -> Self {
99 self.dataset_source = input;
100 self
101 }
102 /// <p>The location of the manifest file that Amazon Lookout for Vision uses to create the dataset.</p>
103 /// <p>If you don't specify <code>DatasetSource</code>, an empty dataset is created and the operation synchronously returns. Later, you can add JSON Lines by calling <code>UpdateDatasetEntries</code>.</p>
104 /// <p>If you specify a value for <code>DataSource</code>, the manifest at the S3 location is validated and used to create the dataset. The call to <code>CreateDataset</code> is asynchronous and might take a while to complete. To find out the current status, Check the value of <code>Status</code> returned in a call to <code>DescribeDataset</code>.</p>
105 pub fn get_dataset_source(&self) -> &::std::option::Option<crate::types::DatasetSource> {
106 &self.dataset_source
107 }
108 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateDataset</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateDataset</code>. In this case, safely retry your call to <code>CreateDataset</code> by using the same <code>ClientToken</code> parameter value.</p>
109 /// <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 dataset creation requests. You'll need to provide your own value for other use cases.</p>
110 /// <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>CreateDataset</code>. An idempotency token is active for 8 hours.</p>
111 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112 self.client_token = ::std::option::Option::Some(input.into());
113 self
114 }
115 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateDataset</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateDataset</code>. In this case, safely retry your call to <code>CreateDataset</code> by using the same <code>ClientToken</code> parameter value.</p>
116 /// <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 dataset creation requests. You'll need to provide your own value for other use cases.</p>
117 /// <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>CreateDataset</code>. An idempotency token is active for 8 hours.</p>
118 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.client_token = input;
120 self
121 }
122 /// <p>ClientToken is an idempotency token that ensures a call to <code>CreateDataset</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>CreateDataset</code>. In this case, safely retry your call to <code>CreateDataset</code> by using the same <code>ClientToken</code> parameter value.</p>
123 /// <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 dataset creation requests. You'll need to provide your own value for other use cases.</p>
124 /// <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>CreateDataset</code>. An idempotency token is active for 8 hours.</p>
125 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
126 &self.client_token
127 }
128 /// Consumes the builder and constructs a [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
129 pub fn build(
130 self,
131 ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
132 ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetInput {
133 project_name: self.project_name,
134 dataset_type: self.dataset_type,
135 dataset_source: self.dataset_source,
136 client_token: self.client_token,
137 })
138 }
139}