aws-sdk-b2bi 1.64.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_capability::_create_capability_output::CreateCapabilityOutputBuilder;

pub use crate::operation::create_capability::_create_capability_input::CreateCapabilityInputBuilder;

impl crate::operation::create_capability::builders::CreateCapabilityInputBuilder {
    /// 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_capability::CreateCapabilityOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_capability::CreateCapabilityError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_capability();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateCapability`.
///
/// <p>Instantiates a capability based on the specified parameters. A trading capability contains the information required to transform incoming EDI documents into JSON or XML outputs.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateCapabilityFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_capability::builders::CreateCapabilityInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_capability::CreateCapabilityOutput,
        crate::operation::create_capability::CreateCapabilityError,
    > for CreateCapabilityFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_capability::CreateCapabilityOutput,
            crate::operation::create_capability::CreateCapabilityError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateCapabilityFluentBuilder {
    /// Creates a new `CreateCapabilityFluentBuilder`.
    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 CreateCapability as a reference.
    pub fn as_input(&self) -> &crate::operation::create_capability::builders::CreateCapabilityInputBuilder {
        &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_capability::CreateCapabilityOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_capability::CreateCapabilityError,
            ::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_capability::CreateCapability::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_capability::CreateCapability::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_capability::CreateCapabilityOutput,
        crate::operation::create_capability::CreateCapabilityError,
        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>Specifies the name of the capability, used to identify it.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>Specifies the name of the capability, used to identify it.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>Specifies the name of the capability, used to identify it.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
    pub fn r#type(mut self, input: crate::types::CapabilityType) -> Self {
        self.inner = self.inner.r#type(input);
        self
    }
    /// <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CapabilityType>) -> Self {
        self.inner = self.inner.set_type(input);
        self
    }
    /// <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::CapabilityType> {
        self.inner.get_type()
    }
    /// <p>Specifies a structure that contains the details for a capability.</p>
    pub fn configuration(mut self, input: crate::types::CapabilityConfiguration) -> Self {
        self.inner = self.inner.configuration(input);
        self
    }
    /// <p>Specifies a structure that contains the details for a capability.</p>
    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::CapabilityConfiguration>) -> Self {
        self.inner = self.inner.set_configuration(input);
        self
    }
    /// <p>Specifies a structure that contains the details for a capability.</p>
    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::CapabilityConfiguration> {
        self.inner.get_configuration()
    }
    ///
    /// Appends an item to `instructionsDocuments`.
    ///
    /// To override the contents of this collection use [`set_instructions_documents`](Self::set_instructions_documents).
    ///
    /// <p>Specifies one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
    pub fn instructions_documents(mut self, input: crate::types::S3Location) -> Self {
        self.inner = self.inner.instructions_documents(input);
        self
    }
    /// <p>Specifies one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
    pub fn set_instructions_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>) -> Self {
        self.inner = self.inner.set_instructions_documents(input);
        self
    }
    /// <p>Specifies one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
    pub fn get_instructions_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::S3Location>> {
        self.inner.get_instructions_documents()
    }
    /// <p>Reserved for future use.</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>Reserved for future use.</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>Reserved for future use.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    ///
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
}