aws_sdk_lookoutvision/operation/update_dataset_entries/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_dataset_entries::_update_dataset_entries_output::UpdateDatasetEntriesOutputBuilder;
3
4pub use crate::operation::update_dataset_entries::_update_dataset_entries_input::UpdateDatasetEntriesInputBuilder;
5
6impl crate::operation::update_dataset_entries::builders::UpdateDatasetEntriesInputBuilder {
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::update_dataset_entries::UpdateDatasetEntriesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_dataset_entries::UpdateDatasetEntriesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_dataset_entries();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateDatasetEntries`.
24///
25/// <p>Adds or updates one or more JSON Line entries in a dataset. A JSON Line includes information about an image used for training or testing an Amazon Lookout for Vision model.</p>
26/// <p>To update an existing JSON Line, use the <code>source-ref</code> field to identify the JSON Line. The JSON line that you supply replaces the existing JSON line. Any existing annotations that are not in the new JSON line are removed from the dataset.</p>
27/// <p>For more information, see <i>Defining JSON lines for anomaly classification</i> in the Amazon Lookout for Vision Developer Guide.</p><note>
28/// <p>The images you reference in the <code>source-ref</code> field of a JSON line, must be in the same S3 bucket as the existing images in the dataset.</p>
29/// </note>
30/// <p>Updating a dataset might take a while to complete. To check the current status, call <code>DescribeDataset</code> and check the <code>Status</code> field in the response.</p>
31/// <p>This operation requires permissions to perform the <code>lookoutvision:UpdateDatasetEntries</code> operation.</p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct UpdateDatasetEntriesFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::update_dataset_entries::builders::UpdateDatasetEntriesInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::update_dataset_entries::UpdateDatasetEntriesOutput,
41        crate::operation::update_dataset_entries::UpdateDatasetEntriesError,
42    > for UpdateDatasetEntriesFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::update_dataset_entries::UpdateDatasetEntriesOutput,
50            crate::operation::update_dataset_entries::UpdateDatasetEntriesError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl UpdateDatasetEntriesFluentBuilder {
57    /// Creates a new `UpdateDatasetEntriesFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the UpdateDatasetEntries as a reference.
66    pub fn as_input(&self) -> &crate::operation::update_dataset_entries::builders::UpdateDatasetEntriesInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::update_dataset_entries::UpdateDatasetEntriesOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::update_dataset_entries::UpdateDatasetEntriesError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::update_dataset_entries::UpdateDatasetEntries::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::update_dataset_entries::UpdateDatasetEntries::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::update_dataset_entries::UpdateDatasetEntriesOutput,
103        crate::operation::update_dataset_entries::UpdateDatasetEntriesError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>The name of the project that contains the dataset that you want to update.</p>
118    pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.project_name(input.into());
120        self
121    }
122    /// <p>The name of the project that contains the dataset that you want to update.</p>
123    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_project_name(input);
125        self
126    }
127    /// <p>The name of the project that contains the dataset that you want to update.</p>
128    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_project_name()
130    }
131    /// <p>The type of the dataset that you want to update. Specify <code>train</code> to update the training dataset. Specify <code>test</code> to update the test dataset. If you have a single dataset project, specify <code>train</code>.</p>
132    pub fn dataset_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.dataset_type(input.into());
134        self
135    }
136    /// <p>The type of the dataset that you want to update. Specify <code>train</code> to update the training dataset. Specify <code>test</code> to update the test dataset. If you have a single dataset project, specify <code>train</code>.</p>
137    pub fn set_dataset_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_dataset_type(input);
139        self
140    }
141    /// <p>The type of the dataset that you want to update. Specify <code>train</code> to update the training dataset. Specify <code>test</code> to update the test dataset. If you have a single dataset project, specify <code>train</code>.</p>
142    pub fn get_dataset_type(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_dataset_type()
144    }
145    /// <p>The entries to add to the dataset.</p>
146    pub fn changes(mut self, input: ::aws_smithy_types::Blob) -> Self {
147        self.inner = self.inner.changes(input);
148        self
149    }
150    /// <p>The entries to add to the dataset.</p>
151    pub fn set_changes(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
152        self.inner = self.inner.set_changes(input);
153        self
154    }
155    /// <p>The entries to add to the dataset.</p>
156    pub fn get_changes(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
157        self.inner.get_changes()
158    }
159    /// <p>ClientToken is an idempotency token that ensures a call to <code>UpdateDatasetEntries</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>UpdateDatasetEntries</code>. In this case, safely retry your call to <code>UpdateDatasetEntries</code> by using the same <code>ClientToken</code> parameter value.</p>
160    /// <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 updates with the same dataset entries. You'll need to provide your own value for other use cases.</p>
161    /// <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>UpdateDatasetEntries</code>. An idempotency token is active for 8 hours.</p>
162    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.client_token(input.into());
164        self
165    }
166    /// <p>ClientToken is an idempotency token that ensures a call to <code>UpdateDatasetEntries</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>UpdateDatasetEntries</code>. In this case, safely retry your call to <code>UpdateDatasetEntries</code> by using the same <code>ClientToken</code> parameter value.</p>
167    /// <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 updates with the same dataset entries. You'll need to provide your own value for other use cases.</p>
168    /// <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>UpdateDatasetEntries</code>. An idempotency token is active for 8 hours.</p>
169    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_client_token(input);
171        self
172    }
173    /// <p>ClientToken is an idempotency token that ensures a call to <code>UpdateDatasetEntries</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>UpdateDatasetEntries</code>. In this case, safely retry your call to <code>UpdateDatasetEntries</code> by using the same <code>ClientToken</code> parameter value.</p>
174    /// <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 updates with the same dataset entries. You'll need to provide your own value for other use cases.</p>
175    /// <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>UpdateDatasetEntries</code>. An idempotency token is active for 8 hours.</p>
176    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_client_token()
178    }
179}