aws_sdk_databrew/operation/batch_delete_recipe_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::batch_delete_recipe_version::_batch_delete_recipe_version_output::BatchDeleteRecipeVersionOutputBuilder;
3
4pub use crate::operation::batch_delete_recipe_version::_batch_delete_recipe_version_input::BatchDeleteRecipeVersionInputBuilder;
5
6impl crate::operation::batch_delete_recipe_version::builders::BatchDeleteRecipeVersionInputBuilder {
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::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.batch_delete_recipe_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `BatchDeleteRecipeVersion`.
24///
25/// <p>Deletes one or more versions of a recipe at a time.</p>
26/// <p>The entire request will be rejected if:</p>
27/// <ul>
28/// <li>
29/// <p>The recipe does not exist.</p></li>
30/// <li>
31/// <p>There is an invalid version identifier in the list of versions.</p></li>
32/// <li>
33/// <p>The version list is empty.</p></li>
34/// <li>
35/// <p>The version list size exceeds 50.</p></li>
36/// <li>
37/// <p>The version list contains duplicate entries.</p></li>
38/// </ul>
39/// <p>The request will complete successfully, but with partial failures, if:</p>
40/// <ul>
41/// <li>
42/// <p>A version does not exist.</p></li>
43/// <li>
44/// <p>A version is being used by a job.</p></li>
45/// <li>
46/// <p>You specify <code>LATEST_WORKING</code>, but it's being used by a project.</p></li>
47/// <li>
48/// <p>The version fails to be deleted.</p></li>
49/// </ul>
50/// <p>The <code>LATEST_WORKING</code> version will only be deleted if the recipe has no other versions. If you try to delete <code>LATEST_WORKING</code> while other versions exist (or if they can't be deleted), then <code>LATEST_WORKING</code> will be listed as partial failure in the response.</p>
51#[derive(::std::clone::Clone, ::std::fmt::Debug)]
52pub struct BatchDeleteRecipeVersionFluentBuilder {
53    handle: ::std::sync::Arc<crate::client::Handle>,
54    inner: crate::operation::batch_delete_recipe_version::builders::BatchDeleteRecipeVersionInputBuilder,
55    config_override: ::std::option::Option<crate::config::Builder>,
56}
57impl
58    crate::client::customize::internal::CustomizableSend<
59        crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput,
60        crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionError,
61    > for BatchDeleteRecipeVersionFluentBuilder
62{
63    fn send(
64        self,
65        config_override: crate::config::Builder,
66    ) -> crate::client::customize::internal::BoxFuture<
67        crate::client::customize::internal::SendResult<
68            crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput,
69            crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionError,
70        >,
71    > {
72        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
73    }
74}
75impl BatchDeleteRecipeVersionFluentBuilder {
76    /// Creates a new `BatchDeleteRecipeVersionFluentBuilder`.
77    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
78        Self {
79            handle,
80            inner: ::std::default::Default::default(),
81            config_override: ::std::option::Option::None,
82        }
83    }
84    /// Access the BatchDeleteRecipeVersion as a reference.
85    pub fn as_input(&self) -> &crate::operation::batch_delete_recipe_version::builders::BatchDeleteRecipeVersionInputBuilder {
86        &self.inner
87    }
88    /// Sends the request and returns the response.
89    ///
90    /// If an error occurs, an `SdkError` will be returned with additional details that
91    /// can be matched against.
92    ///
93    /// By default, any retryable failures will be retried twice. Retry behavior
94    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
95    /// set when configuring the client.
96    pub async fn send(
97        self,
98    ) -> ::std::result::Result<
99        crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput,
100        ::aws_smithy_runtime_api::client::result::SdkError<
101            crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionError,
102            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
103        >,
104    > {
105        let input = self
106            .inner
107            .build()
108            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
109        let runtime_plugins = crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersion::operation_runtime_plugins(
110            self.handle.runtime_plugins.clone(),
111            &self.handle.conf,
112            self.config_override,
113        );
114        crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersion::orchestrate(&runtime_plugins, input).await
115    }
116
117    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
118    pub fn customize(
119        self,
120    ) -> crate::client::customize::CustomizableOperation<
121        crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionOutput,
122        crate::operation::batch_delete_recipe_version::BatchDeleteRecipeVersionError,
123        Self,
124    > {
125        crate::client::customize::CustomizableOperation::new(self)
126    }
127    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
128        self.set_config_override(::std::option::Option::Some(config_override.into()));
129        self
130    }
131
132    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
133        self.config_override = config_override;
134        self
135    }
136    /// <p>The name of the recipe whose versions are to be deleted.</p>
137    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.name(input.into());
139        self
140    }
141    /// <p>The name of the recipe whose versions are to be deleted.</p>
142    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_name(input);
144        self
145    }
146    /// <p>The name of the recipe whose versions are to be deleted.</p>
147    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_name()
149    }
150    ///
151    /// Appends an item to `RecipeVersions`.
152    ///
153    /// To override the contents of this collection use [`set_recipe_versions`](Self::set_recipe_versions).
154    ///
155    /// <p>An array of version identifiers, for the recipe versions to be deleted. You can specify numeric versions (<code>X.Y</code>) or <code>LATEST_WORKING</code>. <code>LATEST_PUBLISHED</code> is not supported.</p>
156    pub fn recipe_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.recipe_versions(input.into());
158        self
159    }
160    /// <p>An array of version identifiers, for the recipe versions to be deleted. You can specify numeric versions (<code>X.Y</code>) or <code>LATEST_WORKING</code>. <code>LATEST_PUBLISHED</code> is not supported.</p>
161    pub fn set_recipe_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
162        self.inner = self.inner.set_recipe_versions(input);
163        self
164    }
165    /// <p>An array of version identifiers, for the recipe versions to be deleted. You can specify numeric versions (<code>X.Y</code>) or <code>LATEST_WORKING</code>. <code>LATEST_PUBLISHED</code> is not supported.</p>
166    pub fn get_recipe_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
167        self.inner.get_recipe_versions()
168    }
169}