aws-sdk-b2bi 1.48.0

AWS SDK for AWS B2B Data Interchange
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_starter_mapping_template::_create_starter_mapping_template_output::CreateStarterMappingTemplateOutputBuilder;

pub use crate::operation::create_starter_mapping_template::_create_starter_mapping_template_input::CreateStarterMappingTemplateInputBuilder;

impl crate::operation::create_starter_mapping_template::builders::CreateStarterMappingTemplateInputBuilder {
    /// 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_starter_mapping_template::CreateStarterMappingTemplateOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_starter_mapping_template::CreateStarterMappingTemplateError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_starter_mapping_template();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateStarterMappingTemplate`.
///
/// <p>Amazon Web Services B2B Data Interchange uses a mapping template in JSONata or XSLT format to transform a customer input file into a JSON or XML file that can be converted to EDI.</p>
/// <p>If you provide a sample EDI file with the same structure as the EDI files that you wish to generate, then the service can generate a mapping template. The starter template contains placeholder values which you can replace with JSONata or XSLT expressions to take data from your input file and insert it into the JSON or XML file that is used to generate the EDI.</p>
/// <p>If you do not provide a sample EDI file, then the service can generate a mapping template based on the EDI settings in the <code>templateDetails</code> parameter.</p>
/// <p>Currently, we only support generating a template that can generate the input to produce an Outbound X12 EDI file.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateStarterMappingTemplateFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_starter_mapping_template::builders::CreateStarterMappingTemplateInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_starter_mapping_template::CreateStarterMappingTemplateOutput,
        crate::operation::create_starter_mapping_template::CreateStarterMappingTemplateError,
    > for CreateStarterMappingTemplateFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_starter_mapping_template::CreateStarterMappingTemplateOutput,
            crate::operation::create_starter_mapping_template::CreateStarterMappingTemplateError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateStarterMappingTemplateFluentBuilder {
    /// Creates a new `CreateStarterMappingTemplateFluentBuilder`.
    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 CreateStarterMappingTemplate as a reference.
    pub fn as_input(&self) -> &crate::operation::create_starter_mapping_template::builders::CreateStarterMappingTemplateInputBuilder {
        &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_starter_mapping_template::CreateStarterMappingTemplateOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_starter_mapping_template::CreateStarterMappingTemplateError,
            ::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_starter_mapping_template::CreateStarterMappingTemplate::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_starter_mapping_template::CreateStarterMappingTemplate::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_starter_mapping_template::CreateStarterMappingTemplateOutput,
        crate::operation::create_starter_mapping_template::CreateStarterMappingTemplateError,
        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>Specify the location of the sample EDI file that is used to generate the mapping template.</p>
    pub fn output_sample_location(mut self, input: crate::types::S3Location) -> Self {
        self.inner = self.inner.output_sample_location(input);
        self
    }
    /// <p>Specify the location of the sample EDI file that is used to generate the mapping template.</p>
    pub fn set_output_sample_location(mut self, input: ::std::option::Option<crate::types::S3Location>) -> Self {
        self.inner = self.inner.set_output_sample_location(input);
        self
    }
    /// <p>Specify the location of the sample EDI file that is used to generate the mapping template.</p>
    pub fn get_output_sample_location(&self) -> &::std::option::Option<crate::types::S3Location> {
        self.inner.get_output_sample_location()
    }
    /// <p>Specify the format for the mapping template: either JSONATA or XSLT.</p>
    pub fn mapping_type(mut self, input: crate::types::MappingType) -> Self {
        self.inner = self.inner.mapping_type(input);
        self
    }
    /// <p>Specify the format for the mapping template: either JSONATA or XSLT.</p>
    pub fn set_mapping_type(mut self, input: ::std::option::Option<crate::types::MappingType>) -> Self {
        self.inner = self.inner.set_mapping_type(input);
        self
    }
    /// <p>Specify the format for the mapping template: either JSONATA or XSLT.</p>
    pub fn get_mapping_type(&self) -> &::std::option::Option<crate::types::MappingType> {
        self.inner.get_mapping_type()
    }
    /// <p>Describes the details needed for generating the template. Specify the X12 transaction set and version for which the template is used: currently, we only support X12.</p>
    pub fn template_details(mut self, input: crate::types::TemplateDetails) -> Self {
        self.inner = self.inner.template_details(input);
        self
    }
    /// <p>Describes the details needed for generating the template. Specify the X12 transaction set and version for which the template is used: currently, we only support X12.</p>
    pub fn set_template_details(mut self, input: ::std::option::Option<crate::types::TemplateDetails>) -> Self {
        self.inner = self.inner.set_template_details(input);
        self
    }
    /// <p>Describes the details needed for generating the template. Specify the X12 transaction set and version for which the template is used: currently, we only support X12.</p>
    pub fn get_template_details(&self) -> &::std::option::Option<crate::types::TemplateDetails> {
        self.inner.get_template_details()
    }
}