aws-sdk-glue 1.149.0

AWS SDK for AWS Glue
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::register_schema_version::_register_schema_version_input::RegisterSchemaVersionInputBuilder;

pub use crate::operation::register_schema_version::_register_schema_version_output::RegisterSchemaVersionOutputBuilder;

impl crate::operation::register_schema_version::builders::RegisterSchemaVersionInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::register_schema_version::RegisterSchemaVersionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::register_schema_version::RegisterSchemaVersionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.register_schema_version();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `RegisterSchemaVersion`.
///
/// <p>Adds a new version to the existing schema. Returns an error if new version of schema does not meet the compatibility requirements of the schema set. This API will not create a new schema set and will return a 404 error if the schema set is not already present in the Schema Registry.</p>
/// <p>If this is the first schema definition to be registered in the Schema Registry, this API will store the schema version and return immediately. Otherwise, this call has the potential to run longer than other operations due to compatibility modes. You can call the <code>GetSchemaVersion</code> API with the <code>SchemaVersionId</code> to check compatibility modes.</p>
/// <p>If the same schema definition is already stored in Schema Registry as a version, the schema ID of the existing schema is returned to the caller.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct RegisterSchemaVersionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::register_schema_version::builders::RegisterSchemaVersionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::register_schema_version::RegisterSchemaVersionOutput,
        crate::operation::register_schema_version::RegisterSchemaVersionError,
    > for RegisterSchemaVersionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::register_schema_version::RegisterSchemaVersionOutput,
            crate::operation::register_schema_version::RegisterSchemaVersionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl RegisterSchemaVersionFluentBuilder {
    /// Creates a new `RegisterSchemaVersionFluentBuilder`.
    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 RegisterSchemaVersion as a reference.
    pub fn as_input(&self) -> &crate::operation::register_schema_version::builders::RegisterSchemaVersionInputBuilder {
        &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::register_schema_version::RegisterSchemaVersionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::register_schema_version::RegisterSchemaVersionError,
            ::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::register_schema_version::RegisterSchemaVersion::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::register_schema_version::RegisterSchemaVersion::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::register_schema_version::RegisterSchemaVersionOutput,
        crate::operation::register_schema_version::RegisterSchemaVersionError,
        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>This is a wrapper structure to contain schema identity fields. The structure contains:</p>
    /// <ul>
    /// <li>
    /// <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. Either <code>SchemaArn</code> or <code>SchemaName</code> and <code>RegistryName</code> has to be provided.</p></li>
    /// <li>
    /// <p>SchemaId$SchemaName: The name of the schema. Either <code>SchemaArn</code> or <code>SchemaName</code> and <code>RegistryName</code> has to be provided.</p></li>
    /// </ul>
    pub fn schema_id(mut self, input: crate::types::SchemaId) -> Self {
        self.inner = self.inner.schema_id(input);
        self
    }
    /// <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p>
    /// <ul>
    /// <li>
    /// <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. Either <code>SchemaArn</code> or <code>SchemaName</code> and <code>RegistryName</code> has to be provided.</p></li>
    /// <li>
    /// <p>SchemaId$SchemaName: The name of the schema. Either <code>SchemaArn</code> or <code>SchemaName</code> and <code>RegistryName</code> has to be provided.</p></li>
    /// </ul>
    pub fn set_schema_id(mut self, input: ::std::option::Option<crate::types::SchemaId>) -> Self {
        self.inner = self.inner.set_schema_id(input);
        self
    }
    /// <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p>
    /// <ul>
    /// <li>
    /// <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. Either <code>SchemaArn</code> or <code>SchemaName</code> and <code>RegistryName</code> has to be provided.</p></li>
    /// <li>
    /// <p>SchemaId$SchemaName: The name of the schema. Either <code>SchemaArn</code> or <code>SchemaName</code> and <code>RegistryName</code> has to be provided.</p></li>
    /// </ul>
    pub fn get_schema_id(&self) -> &::std::option::Option<crate::types::SchemaId> {
        self.inner.get_schema_id()
    }
    /// <p>The schema definition using the <code>DataFormat</code> setting for the <code>SchemaName</code>.</p>
    pub fn schema_definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.schema_definition(input.into());
        self
    }
    /// <p>The schema definition using the <code>DataFormat</code> setting for the <code>SchemaName</code>.</p>
    pub fn set_schema_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_schema_definition(input);
        self
    }
    /// <p>The schema definition using the <code>DataFormat</code> setting for the <code>SchemaName</code>.</p>
    pub fn get_schema_definition(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_schema_definition()
    }
}