aws_sdk_rekognition/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 source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket location of an Amazon Sagemaker format manifest file. If you don't specify <code>datasetSource</code>, an empty dataset is created. To add labeled images to the dataset, You can use the console or call <code>UpdateDatasetEntries</code>.</p>
7    pub dataset_source: ::std::option::Option<crate::types::DatasetSource>,
8    /// <p>The type of the dataset. Specify <code>TRAIN</code> to create a training dataset. Specify <code>TEST</code> to create a test dataset.</p>
9    pub dataset_type: ::std::option::Option<crate::types::DatasetType>,
10    /// <p>The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.</p>
11    pub project_arn: ::std::option::Option<::std::string::String>,
12    /// <p>A set of tags (key-value pairs) that you want to attach to the dataset.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateDatasetInput {
16    /// <p>The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket location of an Amazon Sagemaker format manifest file. If you don't specify <code>datasetSource</code>, an empty dataset is created. To add labeled images to the dataset, You can use the console or call <code>UpdateDatasetEntries</code>.</p>
17    pub fn dataset_source(&self) -> ::std::option::Option<&crate::types::DatasetSource> {
18        self.dataset_source.as_ref()
19    }
20    /// <p>The type of the dataset. Specify <code>TRAIN</code> to create a training dataset. Specify <code>TEST</code> to create a test dataset.</p>
21    pub fn dataset_type(&self) -> ::std::option::Option<&crate::types::DatasetType> {
22        self.dataset_type.as_ref()
23    }
24    /// <p>The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.</p>
25    pub fn project_arn(&self) -> ::std::option::Option<&str> {
26        self.project_arn.as_deref()
27    }
28    /// <p>A set of tags (key-value pairs) that you want to attach to the dataset.</p>
29    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
30        self.tags.as_ref()
31    }
32}
33impl CreateDatasetInput {
34    /// Creates a new builder-style object to manufacture [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
35    pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
36        crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateDatasetInputBuilder {
44    pub(crate) dataset_source: ::std::option::Option<crate::types::DatasetSource>,
45    pub(crate) dataset_type: ::std::option::Option<crate::types::DatasetType>,
46    pub(crate) project_arn: ::std::option::Option<::std::string::String>,
47    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl CreateDatasetInputBuilder {
50    /// <p>The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket location of an Amazon Sagemaker format manifest file. If you don't specify <code>datasetSource</code>, an empty dataset is created. To add labeled images to the dataset, You can use the console or call <code>UpdateDatasetEntries</code>.</p>
51    pub fn dataset_source(mut self, input: crate::types::DatasetSource) -> Self {
52        self.dataset_source = ::std::option::Option::Some(input);
53        self
54    }
55    /// <p>The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket location of an Amazon Sagemaker format manifest file. If you don't specify <code>datasetSource</code>, an empty dataset is created. To add labeled images to the dataset, You can use the console or call <code>UpdateDatasetEntries</code>.</p>
56    pub fn set_dataset_source(mut self, input: ::std::option::Option<crate::types::DatasetSource>) -> Self {
57        self.dataset_source = input;
58        self
59    }
60    /// <p>The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket location of an Amazon Sagemaker format manifest file. If you don't specify <code>datasetSource</code>, an empty dataset is created. To add labeled images to the dataset, You can use the console or call <code>UpdateDatasetEntries</code>.</p>
61    pub fn get_dataset_source(&self) -> &::std::option::Option<crate::types::DatasetSource> {
62        &self.dataset_source
63    }
64    /// <p>The type of the dataset. Specify <code>TRAIN</code> to create a training dataset. Specify <code>TEST</code> to create a test dataset.</p>
65    /// This field is required.
66    pub fn dataset_type(mut self, input: crate::types::DatasetType) -> Self {
67        self.dataset_type = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The type of the dataset. Specify <code>TRAIN</code> to create a training dataset. Specify <code>TEST</code> to create a test dataset.</p>
71    pub fn set_dataset_type(mut self, input: ::std::option::Option<crate::types::DatasetType>) -> Self {
72        self.dataset_type = input;
73        self
74    }
75    /// <p>The type of the dataset. Specify <code>TRAIN</code> to create a training dataset. Specify <code>TEST</code> to create a test dataset.</p>
76    pub fn get_dataset_type(&self) -> &::std::option::Option<crate::types::DatasetType> {
77        &self.dataset_type
78    }
79    /// <p>The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.</p>
80    /// This field is required.
81    pub fn project_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.project_arn = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.</p>
86    pub fn set_project_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.project_arn = input;
88        self
89    }
90    /// <p>The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.</p>
91    pub fn get_project_arn(&self) -> &::std::option::Option<::std::string::String> {
92        &self.project_arn
93    }
94    /// Adds a key-value pair to `tags`.
95    ///
96    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
97    ///
98    /// <p>A set of tags (key-value pairs) that you want to attach to the dataset.</p>
99    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
100        let mut hash_map = self.tags.unwrap_or_default();
101        hash_map.insert(k.into(), v.into());
102        self.tags = ::std::option::Option::Some(hash_map);
103        self
104    }
105    /// <p>A set of tags (key-value pairs) that you want to attach to the dataset.</p>
106    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
107        self.tags = input;
108        self
109    }
110    /// <p>A set of tags (key-value pairs) that you want to attach to the dataset.</p>
111    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
112        &self.tags
113    }
114    /// Consumes the builder and constructs a [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
115    pub fn build(
116        self,
117    ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetInput {
119            dataset_source: self.dataset_source,
120            dataset_type: self.dataset_type,
121            project_arn: self.project_arn,
122            tags: self.tags,
123        })
124    }
125}