aws-sdk-iotthingsgraph 1.98.0

AWS SDK for AWS IoT Things Graph
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_flow_template::_create_flow_template_input::CreateFlowTemplateInputBuilder;

pub use crate::operation::create_flow_template::_create_flow_template_output::CreateFlowTemplateOutputBuilder;

impl crate::operation::create_flow_template::builders::CreateFlowTemplateInputBuilder {
    /// 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_flow_template::CreateFlowTemplateOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_flow_template::CreateFlowTemplateError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_flow_template();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateFlowTemplate`.
///
/// <p>Creates a workflow template. Workflows can be created only in the user's namespace. (The public namespace contains only entities.) The workflow can contain only entities in the specified namespace. The workflow is validated against the entities in the latest version of the user's namespace unless another namespace version is specified in the request.</p>
#[deprecated(note = "since: 2022-08-30")]
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateFlowTemplateFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_flow_template::builders::CreateFlowTemplateInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_flow_template::CreateFlowTemplateOutput,
        crate::operation::create_flow_template::CreateFlowTemplateError,
    > for CreateFlowTemplateFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_flow_template::CreateFlowTemplateOutput,
            crate::operation::create_flow_template::CreateFlowTemplateError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateFlowTemplateFluentBuilder {
    /// Creates a new `CreateFlowTemplateFluentBuilder`.
    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 CreateFlowTemplate as a reference.
    pub fn as_input(&self) -> &crate::operation::create_flow_template::builders::CreateFlowTemplateInputBuilder {
        &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_flow_template::CreateFlowTemplateOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_flow_template::CreateFlowTemplateError,
            ::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_flow_template::CreateFlowTemplate::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_flow_template::CreateFlowTemplate::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_flow_template::CreateFlowTemplateOutput,
        crate::operation::create_flow_template::CreateFlowTemplateError,
        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 workflow <code>DefinitionDocument</code>.</p>
    pub fn definition(mut self, input: crate::types::DefinitionDocument) -> Self {
        self.inner = self.inner.definition(input);
        self
    }
    /// <p>The workflow <code>DefinitionDocument</code>.</p>
    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::DefinitionDocument>) -> Self {
        self.inner = self.inner.set_definition(input);
        self
    }
    /// <p>The workflow <code>DefinitionDocument</code>.</p>
    pub fn get_definition(&self) -> &::std::option::Option<crate::types::DefinitionDocument> {
        self.inner.get_definition()
    }
    /// <p>The namespace version in which the workflow is to be created.</p>
    /// <p>If no value is specified, the latest version is used by default.</p>
    pub fn compatible_namespace_version(mut self, input: i64) -> Self {
        self.inner = self.inner.compatible_namespace_version(input);
        self
    }
    /// <p>The namespace version in which the workflow is to be created.</p>
    /// <p>If no value is specified, the latest version is used by default.</p>
    pub fn set_compatible_namespace_version(mut self, input: ::std::option::Option<i64>) -> Self {
        self.inner = self.inner.set_compatible_namespace_version(input);
        self
    }
    /// <p>The namespace version in which the workflow is to be created.</p>
    /// <p>If no value is specified, the latest version is used by default.</p>
    pub fn get_compatible_namespace_version(&self) -> &::std::option::Option<i64> {
        self.inner.get_compatible_namespace_version()
    }
}