aws_sdk_personalize/operation/create_dataset_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_dataset_group::_create_dataset_group_output::CreateDatasetGroupOutputBuilder;
3
4pub use crate::operation::create_dataset_group::_create_dataset_group_input::CreateDatasetGroupInputBuilder;
5
6impl crate::operation::create_dataset_group::builders::CreateDatasetGroupInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_dataset_group::CreateDatasetGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_dataset_group::CreateDatasetGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_dataset_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDatasetGroup`.
24///
25/// <p>Creates an empty dataset group. A dataset group is a container for Amazon Personalize resources. A dataset group can contain at most three datasets, one for each type of dataset:</p>
26/// <ul>
27/// <li>
28/// <p>Item interactions</p></li>
29/// <li>
30/// <p>Items</p></li>
31/// <li>
32/// <p>Users</p></li>
33/// <li>
34/// <p>Actions</p></li>
35/// <li>
36/// <p>Action interactions</p></li>
37/// </ul>
38/// <p>A dataset group can be a Domain dataset group, where you specify a domain and use pre-configured resources like recommenders, or a Custom dataset group, where you use custom resources, such as a solution with a solution version, that you deploy with a campaign. If you start with a Domain dataset group, you can still add custom resources such as solutions and solution versions trained with recipes for custom use cases and deployed with campaigns.</p>
39/// <p>A dataset group can be in one of the following states:</p>
40/// <ul>
41/// <li>
42/// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
43/// <li>
44/// <p>DELETE PENDING</p></li>
45/// </ul>
46/// <p>To get the status of the dataset group, call <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeDatasetGroup.html">DescribeDatasetGroup</a>. If the status shows as CREATE FAILED, the response includes a <code>failureReason</code> key, which describes why the creation failed.</p><note>
47/// <p>You must wait until the <code>status</code> of the dataset group is <code>ACTIVE</code> before adding a dataset to the group.</p>
48/// </note>
49/// <p>You can specify an Key Management Service (KMS) key to encrypt the datasets in the group. If you specify a KMS key, you must also include an Identity and Access Management (IAM) role that has permission to access the key.</p>
50/// <p class="title"><b>APIs that require a dataset group ARN in the request</b></p>
51/// <ul>
52/// <li>
53/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateDataset.html">CreateDataset</a></p></li>
54/// <li>
55/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a></p></li>
56/// <li>
57/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolution.html">CreateSolution</a></p></li>
58/// </ul>
59/// <p class="title"><b>Related APIs</b></p>
60/// <ul>
61/// <li>
62/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListDatasetGroups.html">ListDatasetGroups</a></p></li>
63/// <li>
64/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeDatasetGroup.html">DescribeDatasetGroup</a></p></li>
65/// <li>
66/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DeleteDatasetGroup.html">DeleteDatasetGroup</a></p></li>
67/// </ul>
68#[derive(::std::clone::Clone, ::std::fmt::Debug)]
69pub struct CreateDatasetGroupFluentBuilder {
70    handle: ::std::sync::Arc<crate::client::Handle>,
71    inner: crate::operation::create_dataset_group::builders::CreateDatasetGroupInputBuilder,
72    config_override: ::std::option::Option<crate::config::Builder>,
73}
74impl
75    crate::client::customize::internal::CustomizableSend<
76        crate::operation::create_dataset_group::CreateDatasetGroupOutput,
77        crate::operation::create_dataset_group::CreateDatasetGroupError,
78    > for CreateDatasetGroupFluentBuilder
79{
80    fn send(
81        self,
82        config_override: crate::config::Builder,
83    ) -> crate::client::customize::internal::BoxFuture<
84        crate::client::customize::internal::SendResult<
85            crate::operation::create_dataset_group::CreateDatasetGroupOutput,
86            crate::operation::create_dataset_group::CreateDatasetGroupError,
87        >,
88    > {
89        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
90    }
91}
92impl CreateDatasetGroupFluentBuilder {
93    /// Creates a new `CreateDatasetGroupFluentBuilder`.
94    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
95        Self {
96            handle,
97            inner: ::std::default::Default::default(),
98            config_override: ::std::option::Option::None,
99        }
100    }
101    /// Access the CreateDatasetGroup as a reference.
102    pub fn as_input(&self) -> &crate::operation::create_dataset_group::builders::CreateDatasetGroupInputBuilder {
103        &self.inner
104    }
105    /// Sends the request and returns the response.
106    ///
107    /// If an error occurs, an `SdkError` will be returned with additional details that
108    /// can be matched against.
109    ///
110    /// By default, any retryable failures will be retried twice. Retry behavior
111    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
112    /// set when configuring the client.
113    pub async fn send(
114        self,
115    ) -> ::std::result::Result<
116        crate::operation::create_dataset_group::CreateDatasetGroupOutput,
117        ::aws_smithy_runtime_api::client::result::SdkError<
118            crate::operation::create_dataset_group::CreateDatasetGroupError,
119            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
120        >,
121    > {
122        let input = self
123            .inner
124            .build()
125            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
126        let runtime_plugins = crate::operation::create_dataset_group::CreateDatasetGroup::operation_runtime_plugins(
127            self.handle.runtime_plugins.clone(),
128            &self.handle.conf,
129            self.config_override,
130        );
131        crate::operation::create_dataset_group::CreateDatasetGroup::orchestrate(&runtime_plugins, input).await
132    }
133
134    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
135    pub fn customize(
136        self,
137    ) -> crate::client::customize::CustomizableOperation<
138        crate::operation::create_dataset_group::CreateDatasetGroupOutput,
139        crate::operation::create_dataset_group::CreateDatasetGroupError,
140        Self,
141    > {
142        crate::client::customize::CustomizableOperation::new(self)
143    }
144    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
145        self.set_config_override(::std::option::Option::Some(config_override.into()));
146        self
147    }
148
149    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
150        self.config_override = config_override;
151        self
152    }
153    /// <p>The name for the new dataset group.</p>
154    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.name(input.into());
156        self
157    }
158    /// <p>The name for the new dataset group.</p>
159    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_name(input);
161        self
162    }
163    /// <p>The name for the new dataset group.</p>
164    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_name()
166    }
167    /// <p>The ARN of the Identity and Access Management (IAM) role that has permissions to access the Key Management Service (KMS) key. Supplying an IAM role is only valid when also specifying a KMS key.</p>
168    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.role_arn(input.into());
170        self
171    }
172    /// <p>The ARN of the Identity and Access Management (IAM) role that has permissions to access the Key Management Service (KMS) key. Supplying an IAM role is only valid when also specifying a KMS key.</p>
173    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_role_arn(input);
175        self
176    }
177    /// <p>The ARN of the Identity and Access Management (IAM) role that has permissions to access the Key Management Service (KMS) key. Supplying an IAM role is only valid when also specifying a KMS key.</p>
178    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_role_arn()
180    }
181    /// <p>The Amazon Resource Name (ARN) of a Key Management Service (KMS) key used to encrypt the datasets.</p>
182    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.kms_key_arn(input.into());
184        self
185    }
186    /// <p>The Amazon Resource Name (ARN) of a Key Management Service (KMS) key used to encrypt the datasets.</p>
187    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_kms_key_arn(input);
189        self
190    }
191    /// <p>The Amazon Resource Name (ARN) of a Key Management Service (KMS) key used to encrypt the datasets.</p>
192    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_kms_key_arn()
194    }
195    /// <p>The domain of the dataset group. Specify a domain to create a Domain dataset group. The domain you specify determines the default schemas for datasets and the use cases available for recommenders. If you don't specify a domain, you create a Custom dataset group with solution versions that you deploy with a campaign.</p>
196    pub fn domain(mut self, input: crate::types::Domain) -> Self {
197        self.inner = self.inner.domain(input);
198        self
199    }
200    /// <p>The domain of the dataset group. Specify a domain to create a Domain dataset group. The domain you specify determines the default schemas for datasets and the use cases available for recommenders. If you don't specify a domain, you create a Custom dataset group with solution versions that you deploy with a campaign.</p>
201    pub fn set_domain(mut self, input: ::std::option::Option<crate::types::Domain>) -> Self {
202        self.inner = self.inner.set_domain(input);
203        self
204    }
205    /// <p>The domain of the dataset group. Specify a domain to create a Domain dataset group. The domain you specify determines the default schemas for datasets and the use cases available for recommenders. If you don't specify a domain, you create a Custom dataset group with solution versions that you deploy with a campaign.</p>
206    pub fn get_domain(&self) -> &::std::option::Option<crate::types::Domain> {
207        self.inner.get_domain()
208    }
209    ///
210    /// Appends an item to `tags`.
211    ///
212    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
213    ///
214    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset group.</p>
215    pub fn tags(mut self, input: crate::types::Tag) -> Self {
216        self.inner = self.inner.tags(input);
217        self
218    }
219    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset group.</p>
220    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
221        self.inner = self.inner.set_tags(input);
222        self
223    }
224    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset group.</p>
225    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
226        self.inner.get_tags()
227    }
228}