aws-sdk-context 1.0.0

AWS SDK for AWS Context
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::start_task::_start_task_input::StartTaskInputBuilder;

pub use crate::operation::start_task::_start_task_output::StartTaskOutputBuilder;

impl crate::operation::start_task::builders::StartTaskInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::start_task::StartTaskOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_task::StartTaskError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.start_task();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `StartTask`.
///
/// <p>Starts a task that imports a data dictionary, verified queries, or ontologies into an agent context. The task runs asynchronously and records the changes it makes as change sets. GetTask returns its status.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartTaskFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::start_task::builders::StartTaskInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl crate::client::customize::internal::CustomizableSend<crate::operation::start_task::StartTaskOutput, crate::operation::start_task::StartTaskError>
    for StartTaskFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<crate::operation::start_task::StartTaskOutput, crate::operation::start_task::StartTaskError>,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl StartTaskFluentBuilder {
    /// Creates a new `StartTaskFluentBuilder`.
    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 StartTask as a reference.
    pub fn as_input(&self) -> &crate::operation::start_task::builders::StartTaskInputBuilder {
        &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::start_task::StartTaskOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_task::StartTaskError,
            ::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::start_task::StartTask::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::start_task::StartTask::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::start_task::StartTaskOutput,
        crate::operation::start_task::StartTaskError,
        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 agent context, as an ID or ARN.</p>
    pub fn agent_context_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.agent_context_id(input.into());
        self
    }
    /// <p>The agent context, as an ID or ARN.</p>
    pub fn set_agent_context_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_agent_context_id(input);
        self
    }
    /// <p>The agent context, as an ID or ARN.</p>
    pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_agent_context_id()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure that the request completes no more than one time. The token is scoped to your account and the agent context. If you reuse a token on the same agent context with different parameters, the request fails with <code>ValidationException</code>.</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>A unique, case-sensitive identifier that you provide to ensure that the request completes no more than one time. The token is scoped to your account and the agent context. If you reuse a token on the same agent context with different parameters, the request fails with <code>ValidationException</code>.</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>A unique, case-sensitive identifier that you provide to ensure that the request completes no more than one time. The token is scoped to your account and the agent context. If you reuse a token on the same agent context with different parameters, the request fails with <code>ValidationException</code>.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>A description of the task. Up to 1,024 characters, with no control characters.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A description of the task. Up to 1,024 characters, with no control characters.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A description of the task. Up to 1,024 characters, with no control characters.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>What the task imports. Set exactly one member. The member that you set determines the task's <code>type</code>.</p>
    pub fn input_configuration(mut self, input: crate::types::TaskInputConfiguration) -> Self {
        self.inner = self.inner.input_configuration(input);
        self
    }
    /// <p>What the task imports. Set exactly one member. The member that you set determines the task's <code>type</code>.</p>
    pub fn set_input_configuration(mut self, input: ::std::option::Option<crate::types::TaskInputConfiguration>) -> Self {
        self.inner = self.inner.set_input_configuration(input);
        self
    }
    /// <p>What the task imports. Set exactly one member. The member that you set determines the task's <code>type</code>.</p>
    pub fn get_input_configuration(&self) -> &::std::option::Option<crate::types::TaskInputConfiguration> {
        self.inner.get_input_configuration()
    }
    /// <p>Who can see the content that the task adds to the agent context. AWS Context supports only one entry: <code>ALLOW</code> with <code>principalId</code> <code>*</code>, so that every reader of the agent context can see it. If you omit it or send no entries, AWS Context uses that entry. If you name any other principal, include a <code>DENY</code> entry, or send more than one entry, the request fails with <code>ValidationException</code>, and no task is started.</p>
    pub fn access_control_config(mut self, input: crate::types::AccessControlConfig) -> Self {
        self.inner = self.inner.access_control_config(input);
        self
    }
    /// <p>Who can see the content that the task adds to the agent context. AWS Context supports only one entry: <code>ALLOW</code> with <code>principalId</code> <code>*</code>, so that every reader of the agent context can see it. If you omit it or send no entries, AWS Context uses that entry. If you name any other principal, include a <code>DENY</code> entry, or send more than one entry, the request fails with <code>ValidationException</code>, and no task is started.</p>
    pub fn set_access_control_config(mut self, input: ::std::option::Option<crate::types::AccessControlConfig>) -> Self {
        self.inner = self.inner.set_access_control_config(input);
        self
    }
    /// <p>Who can see the content that the task adds to the agent context. AWS Context supports only one entry: <code>ALLOW</code> with <code>principalId</code> <code>*</code>, so that every reader of the agent context can see it. If you omit it or send no entries, AWS Context uses that entry. If you name any other principal, include a <code>DENY</code> entry, or send more than one entry, the request fails with <code>ValidationException</code>, and no task is started.</p>
    pub fn get_access_control_config(&self) -> &::std::option::Option<crate::types::AccessControlConfig> {
        self.inner.get_access_control_config()
    }
}