// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_dataset_version::_create_dataset_version_input::CreateDatasetVersionInputBuilder;
pub use crate::operation::create_dataset_version::_create_dataset_version_output::CreateDatasetVersionOutputBuilder;
impl crate::operation::create_dataset_version::builders::CreateDatasetVersionInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::create_dataset_version::CreateDatasetVersionOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_dataset_version::CreateDatasetVersionError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_dataset_version();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateDatasetVersion`.
///
/// Publishes the current DRAFT as a new numbered version. Snapshots the DRAFT examples as the next version (1, 2, 3, ...). The DRAFT is preserved and remains editable after publishing. Returns immediately with status UPDATING. Poll GetDataset until status transitions to ACTIVE (draftStatus=UNMODIFIED) or UPDATE_FAILED. **State guard:** Returns ConflictException (DATASET_NOT_READY) if status is in {CREATING, UPDATING, DELETING}, or DATASET_IN_FAILED_STATE if status is in {CREATE_FAILED, DELETE_FAILED}. **Quota:** MAX_VERSIONS_PER_DATASET applies to published versions only (not DRAFT).
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateDatasetVersionFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_dataset_version::builders::CreateDatasetVersionInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_dataset_version::CreateDatasetVersionOutput,
crate::operation::create_dataset_version::CreateDatasetVersionError,
> for CreateDatasetVersionFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_dataset_version::CreateDatasetVersionOutput,
crate::operation::create_dataset_version::CreateDatasetVersionError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateDatasetVersionFluentBuilder {
/// Creates a new `CreateDatasetVersionFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the CreateDatasetVersion as a reference.
pub fn as_input(&self) -> &crate::operation::create_dataset_version::builders::CreateDatasetVersionInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::create_dataset_version::CreateDatasetVersionOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_dataset_version::CreateDatasetVersionError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::create_dataset_version::CreateDatasetVersion::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_dataset_version::CreateDatasetVersion::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::create_dataset_version::CreateDatasetVersionOutput,
crate::operation::create_dataset_version::CreateDatasetVersionError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The unique identifier of the dataset to publish a version for.</p>
pub fn dataset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.dataset_id(input.into());
self
}
/// <p>The unique identifier of the dataset to publish a version for.</p>
pub fn set_dataset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_dataset_id(input);
self
}
/// <p>The unique identifier of the dataset to publish a version for.</p>
pub fn get_dataset_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_dataset_id()
}
/// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.client_token(input.into());
self
}
/// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_client_token(input);
self
}
/// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_client_token()
}
}