aws-sdk-b2bi 1.69.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_partnership::_create_partnership_output::CreatePartnershipOutputBuilder;

pub use crate::operation::create_partnership::_create_partnership_input::CreatePartnershipInputBuilder;

impl crate::operation::create_partnership::builders::CreatePartnershipInputBuilder {
    /// 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_partnership::CreatePartnershipOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_partnership::CreatePartnershipError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_partnership();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreatePartnership`.
///
/// <p>Creates a partnership between a customer and a trading partner, based on the supplied parameters. A partnership represents the connection between you and your trading partner. It ties together a profile and one or more trading capabilities.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreatePartnershipFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_partnership::builders::CreatePartnershipInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_partnership::CreatePartnershipOutput,
        crate::operation::create_partnership::CreatePartnershipError,
    > for CreatePartnershipFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_partnership::CreatePartnershipOutput,
            crate::operation::create_partnership::CreatePartnershipError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreatePartnershipFluentBuilder {
    /// Creates a new `CreatePartnershipFluentBuilder`.
    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 CreatePartnership as a reference.
    pub fn as_input(&self) -> &crate::operation::create_partnership::builders::CreatePartnershipInputBuilder {
        &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_partnership::CreatePartnershipOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_partnership::CreatePartnershipError,
            ::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_partnership::CreatePartnership::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_partnership::CreatePartnership::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_partnership::CreatePartnershipOutput,
        crate::operation::create_partnership::CreatePartnershipError,
        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 unique, system-generated identifier for the profile connected to this partnership.</p>
    pub fn profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.profile_id(input.into());
        self
    }
    /// <p>Specifies the unique, system-generated identifier for the profile connected to this partnership.</p>
    pub fn set_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_profile_id(input);
        self
    }
    /// <p>Specifies the unique, system-generated identifier for the profile connected to this partnership.</p>
    pub fn get_profile_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_profile_id()
    }
    /// <p>Specifies a descriptive name for the partnership.</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 a descriptive name for the partnership.</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 a descriptive name for the partnership.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>Specifies the email address associated with this trading partner.</p>
    pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.email(input.into());
        self
    }
    /// <p>Specifies the email address associated with this trading partner.</p>
    pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_email(input);
        self
    }
    /// <p>Specifies the email address associated with this trading partner.</p>
    pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_email()
    }
    /// <p>Specifies the phone number associated with the partnership.</p>
    pub fn phone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.phone(input.into());
        self
    }
    /// <p>Specifies the phone number associated with the partnership.</p>
    pub fn set_phone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_phone(input);
        self
    }
    /// <p>Specifies the phone number associated with the partnership.</p>
    pub fn get_phone(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_phone()
    }
    ///
    /// Appends an item to `capabilities`.
    ///
    /// To override the contents of this collection use [`set_capabilities`](Self::set_capabilities).
    ///
    /// <p>Specifies a list of the capabilities associated with this partnership.</p>
    pub fn capabilities(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.capabilities(input.into());
        self
    }
    /// <p>Specifies a list of the capabilities associated with this partnership.</p>
    pub fn set_capabilities(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_capabilities(input);
        self
    }
    /// <p>Specifies a list of the capabilities associated with this partnership.</p>
    pub fn get_capabilities(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_capabilities()
    }
    /// <p>Specify the structure that contains the details for the associated capabilities.</p>
    pub fn capability_options(mut self, input: crate::types::CapabilityOptions) -> Self {
        self.inner = self.inner.capability_options(input);
        self
    }
    /// <p>Specify the structure that contains the details for the associated capabilities.</p>
    pub fn set_capability_options(mut self, input: ::std::option::Option<crate::types::CapabilityOptions>) -> Self {
        self.inner = self.inner.set_capability_options(input);
        self
    }
    /// <p>Specify the structure that contains the details for the associated capabilities.</p>
    pub fn get_capability_options(&self) -> &::std::option::Option<crate::types::CapabilityOptions> {
        self.inner.get_capability_options()
    }
    /// <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()
    }
}