aws_sdk_personalize/operation/create_dataset_export_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_dataset_export_job::_create_dataset_export_job_output::CreateDatasetExportJobOutputBuilder;
3
4pub use crate::operation::create_dataset_export_job::_create_dataset_export_job_input::CreateDatasetExportJobInputBuilder;
5
6impl crate::operation::create_dataset_export_job::builders::CreateDatasetExportJobInputBuilder {
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_export_job::CreateDatasetExportJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_dataset_export_job::CreateDatasetExportJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_dataset_export_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDatasetExportJob`.
24///
25/// <p>Creates a job that exports data from your dataset to an Amazon S3 bucket. To allow Amazon Personalize to export the training data, you must specify an service-linked IAM role that gives Amazon Personalize <code>PutObject</code> permissions for your Amazon S3 bucket. For information, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/export-data.html">Exporting a dataset</a> in the Amazon Personalize developer guide.</p>
26/// <p><b>Status</b></p>
27/// <p>A dataset export job can be in one of the following states:</p>
28/// <ul>
29/// <li>
30/// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
31/// </ul>
32/// <p>To get the status of the export job, call <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeDatasetExportJob.html">DescribeDatasetExportJob</a>, and specify the Amazon Resource Name (ARN) of the dataset export job. The dataset export is complete when the status shows as ACTIVE. If the status shows as CREATE FAILED, the response includes a <code>failureReason</code> key, which describes why the job failed.</p>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct CreateDatasetExportJobFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::create_dataset_export_job::builders::CreateDatasetExportJobInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::create_dataset_export_job::CreateDatasetExportJobOutput,
42        crate::operation::create_dataset_export_job::CreateDatasetExportJobError,
43    > for CreateDatasetExportJobFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::create_dataset_export_job::CreateDatasetExportJobOutput,
51            crate::operation::create_dataset_export_job::CreateDatasetExportJobError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl CreateDatasetExportJobFluentBuilder {
58    /// Creates a new `CreateDatasetExportJobFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the CreateDatasetExportJob as a reference.
67    pub fn as_input(&self) -> &crate::operation::create_dataset_export_job::builders::CreateDatasetExportJobInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::create_dataset_export_job::CreateDatasetExportJobOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::create_dataset_export_job::CreateDatasetExportJobError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::create_dataset_export_job::CreateDatasetExportJob::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::create_dataset_export_job::CreateDatasetExportJob::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::create_dataset_export_job::CreateDatasetExportJobOutput,
104        crate::operation::create_dataset_export_job::CreateDatasetExportJobError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The name for the dataset export job.</p>
119    pub fn job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.job_name(input.into());
121        self
122    }
123    /// <p>The name for the dataset export job.</p>
124    pub fn set_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_job_name(input);
126        self
127    }
128    /// <p>The name for the dataset export job.</p>
129    pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_job_name()
131    }
132    /// <p>The Amazon Resource Name (ARN) of the dataset that contains the data to export.</p>
133    pub fn dataset_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.dataset_arn(input.into());
135        self
136    }
137    /// <p>The Amazon Resource Name (ARN) of the dataset that contains the data to export.</p>
138    pub fn set_dataset_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_dataset_arn(input);
140        self
141    }
142    /// <p>The Amazon Resource Name (ARN) of the dataset that contains the data to export.</p>
143    pub fn get_dataset_arn(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_dataset_arn()
145    }
146    /// <p>The data to export, based on how you imported the data. You can choose to export only <code>BULK</code> data that you imported using a dataset import job, only <code>PUT</code> data that you imported incrementally (using the console, PutEvents, PutUsers and PutItems operations), or <code>ALL</code> for both types. The default value is <code>PUT</code>.</p>
147    pub fn ingestion_mode(mut self, input: crate::types::IngestionMode) -> Self {
148        self.inner = self.inner.ingestion_mode(input);
149        self
150    }
151    /// <p>The data to export, based on how you imported the data. You can choose to export only <code>BULK</code> data that you imported using a dataset import job, only <code>PUT</code> data that you imported incrementally (using the console, PutEvents, PutUsers and PutItems operations), or <code>ALL</code> for both types. The default value is <code>PUT</code>.</p>
152    pub fn set_ingestion_mode(mut self, input: ::std::option::Option<crate::types::IngestionMode>) -> Self {
153        self.inner = self.inner.set_ingestion_mode(input);
154        self
155    }
156    /// <p>The data to export, based on how you imported the data. You can choose to export only <code>BULK</code> data that you imported using a dataset import job, only <code>PUT</code> data that you imported incrementally (using the console, PutEvents, PutUsers and PutItems operations), or <code>ALL</code> for both types. The default value is <code>PUT</code>.</p>
157    pub fn get_ingestion_mode(&self) -> &::std::option::Option<crate::types::IngestionMode> {
158        self.inner.get_ingestion_mode()
159    }
160    /// <p>The Amazon Resource Name (ARN) of the IAM service role that has permissions to add data to your output Amazon S3 bucket.</p>
161    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.role_arn(input.into());
163        self
164    }
165    /// <p>The Amazon Resource Name (ARN) of the IAM service role that has permissions to add data to your output Amazon S3 bucket.</p>
166    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_role_arn(input);
168        self
169    }
170    /// <p>The Amazon Resource Name (ARN) of the IAM service role that has permissions to add data to your output Amazon S3 bucket.</p>
171    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_role_arn()
173    }
174    /// <p>The path to the Amazon S3 bucket where the job's output is stored.</p>
175    pub fn job_output(mut self, input: crate::types::DatasetExportJobOutput) -> Self {
176        self.inner = self.inner.job_output(input);
177        self
178    }
179    /// <p>The path to the Amazon S3 bucket where the job's output is stored.</p>
180    pub fn set_job_output(mut self, input: ::std::option::Option<crate::types::DatasetExportJobOutput>) -> Self {
181        self.inner = self.inner.set_job_output(input);
182        self
183    }
184    /// <p>The path to the Amazon S3 bucket where the job's output is stored.</p>
185    pub fn get_job_output(&self) -> &::std::option::Option<crate::types::DatasetExportJobOutput> {
186        self.inner.get_job_output()
187    }
188    ///
189    /// Appends an item to `tags`.
190    ///
191    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
192    ///
193    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset export job.</p>
194    pub fn tags(mut self, input: crate::types::Tag) -> Self {
195        self.inner = self.inner.tags(input);
196        self
197    }
198    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset export job.</p>
199    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
200        self.inner = self.inner.set_tags(input);
201        self
202    }
203    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset export job.</p>
204    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
205        self.inner.get_tags()
206    }
207}