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::create_agent_context::_create_agent_context_input::CreateAgentContextInputBuilder;

pub use crate::operation::create_agent_context::_create_agent_context_output::CreateAgentContextOutputBuilder;

impl crate::operation::create_agent_context::builders::CreateAgentContextInputBuilder {
    /// 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_agent_context::CreateAgentContextOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_agent_context::CreateAgentContextError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_agent_context();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateAgentContext`.
///
/// <p>Creates an agent context over one or more connections. Creation is asynchronous. GetAgentContext returns its status.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateAgentContextFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_agent_context::builders::CreateAgentContextInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_agent_context::CreateAgentContextOutput,
        crate::operation::create_agent_context::CreateAgentContextError,
    > for CreateAgentContextFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_agent_context::CreateAgentContextOutput,
            crate::operation::create_agent_context::CreateAgentContextError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateAgentContextFluentBuilder {
    /// Creates a new `CreateAgentContextFluentBuilder`.
    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 CreateAgentContext as a reference.
    pub fn as_input(&self) -> &crate::operation::create_agent_context::builders::CreateAgentContextInputBuilder {
        &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_agent_context::CreateAgentContextOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_agent_context::CreateAgentContextError,
            ::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_agent_context::CreateAgentContext::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_agent_context::CreateAgentContext::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_agent_context::CreateAgentContextOutput,
        crate::operation::create_agent_context::CreateAgentContextError,
        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>Client idempotency token. The AWS SDKs generate one when it is absent. An identical request with the same token returns the existing agent context. The same token with a different request returns ValidationException. <code>trustedIdentitySources</code> with the same entries in another order is the same request.</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>Client idempotency token. The AWS SDKs generate one when it is absent. An identical request with the same token returns the existing agent context. The same token with a different request returns ValidationException. <code>trustedIdentitySources</code> with the same entries in another order is the same request.</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>Client idempotency token. The AWS SDKs generate one when it is absent. An identical request with the same token returns the existing agent context. The same token with a different request returns ValidationException. <code>trustedIdentitySources</code> with the same entries in another order is the same request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>Optional. The name of the agent context. If you omit it, the name is <code>default</code>. You can change it later with UpdateAgentContext.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>Optional. The name of the agent context. If you omit it, the name is <code>default</code>. You can change it later with UpdateAgentContext.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>Optional. The name of the agent context. If you omit it, the name is <code>default</code>. You can change it later with UpdateAgentContext.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>Optional human-readable description of the agent context. An empty string is the same as none.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>Optional human-readable description of the agent context. An empty string is the same as none.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>Optional human-readable description of the agent context. An empty string is the same as none.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    ///
    /// Appends an item to `connectionMappings`.
    ///
    /// To override the contents of this collection use [`set_connection_mappings`](Self::set_connection_mappings).
    ///
    /// <p>The connection mappings for this agent context, up to 20. CreateAgentContext requires at least one: an empty list returns <code>ValidationException</code>. Each entry binds a connection to one or more ontologies, optionally scoped by a data filter, extraction depth, and path segments. Each referenced connection must exist, be owned by your account, and be <code>ACTIVE</code>. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next.</p>
    pub fn connection_mappings(mut self, input: crate::types::ConnectionMapping) -> Self {
        self.inner = self.inner.connection_mappings(input);
        self
    }
    /// <p>The connection mappings for this agent context, up to 20. CreateAgentContext requires at least one: an empty list returns <code>ValidationException</code>. Each entry binds a connection to one or more ontologies, optionally scoped by a data filter, extraction depth, and path segments. Each referenced connection must exist, be owned by your account, and be <code>ACTIVE</code>. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next.</p>
    pub fn set_connection_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConnectionMapping>>) -> Self {
        self.inner = self.inner.set_connection_mappings(input);
        self
    }
    /// <p>The connection mappings for this agent context, up to 20. CreateAgentContext requires at least one: an empty list returns <code>ValidationException</code>. Each entry binds a connection to one or more ontologies, optionally scoped by a data filter, extraction depth, and path segments. Each referenced connection must exist, be owned by your account, and be <code>ACTIVE</code>. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next.</p>
    pub fn get_connection_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConnectionMapping>> {
        self.inner.get_connection_mappings()
    }
    /// <p>The agent context's trace analysis settings. Optional. You can change it with UpdateAgentContext.</p>
    pub fn trace_analysis_config(mut self, input: crate::types::TraceAnalysisConfig) -> Self {
        self.inner = self.inner.trace_analysis_config(input);
        self
    }
    /// <p>The agent context's trace analysis settings. Optional. You can change it with UpdateAgentContext.</p>
    pub fn set_trace_analysis_config(mut self, input: ::std::option::Option<crate::types::TraceAnalysisConfig>) -> Self {
        self.inner = self.inner.set_trace_analysis_config(input);
        self
    }
    /// <p>The agent context's trace analysis settings. Optional. You can change it with UpdateAgentContext.</p>
    pub fn get_trace_analysis_config(&self) -> &::std::option::Option<crate::types::TraceAnalysisConfig> {
        self.inner.get_trace_analysis_config()
    }
    /// <p>Optional workforce sign-in settings. A config with <code>signInUrl</code> turns sign-in on (<code>status</code> defaults to ENABLED). <code>status</code> ENABLED without <code>signInUrl</code> is a ValidationException. You can change it with UpdateAgentContext.</p>
    pub fn workforce_sign_in_config(mut self, input: crate::types::WorkforceSignInConfig) -> Self {
        self.inner = self.inner.workforce_sign_in_config(input);
        self
    }
    /// <p>Optional workforce sign-in settings. A config with <code>signInUrl</code> turns sign-in on (<code>status</code> defaults to ENABLED). <code>status</code> ENABLED without <code>signInUrl</code> is a ValidationException. You can change it with UpdateAgentContext.</p>
    pub fn set_workforce_sign_in_config(mut self, input: ::std::option::Option<crate::types::WorkforceSignInConfig>) -> Self {
        self.inner = self.inner.set_workforce_sign_in_config(input);
        self
    }
    /// <p>Optional workforce sign-in settings. A config with <code>signInUrl</code> turns sign-in on (<code>status</code> defaults to ENABLED). <code>status</code> ENABLED without <code>signInUrl</code> is a ValidationException. You can change it with UpdateAgentContext.</p>
    pub fn get_workforce_sign_in_config(&self) -> &::std::option::Option<crate::types::WorkforceSignInConfig> {
        self.inner.get_workforce_sign_in_config()
    }
    /// <p>Optional entity resolution settings. When the config or its <code>status</code> is absent, <code>status</code> reads ENABLED. You can change it with UpdateAgentContext.</p>
    pub fn entity_resolution_config(mut self, input: crate::types::EntityResolutionConfig) -> Self {
        self.inner = self.inner.entity_resolution_config(input);
        self
    }
    /// <p>Optional entity resolution settings. When the config or its <code>status</code> is absent, <code>status</code> reads ENABLED. You can change it with UpdateAgentContext.</p>
    pub fn set_entity_resolution_config(mut self, input: ::std::option::Option<crate::types::EntityResolutionConfig>) -> Self {
        self.inner = self.inner.set_entity_resolution_config(input);
        self
    }
    /// <p>Optional entity resolution settings. When the config or its <code>status</code> is absent, <code>status</code> reads ENABLED. You can change it with UpdateAgentContext.</p>
    pub fn get_entity_resolution_config(&self) -> &::std::option::Option<crate::types::EntityResolutionConfig> {
        self.inner.get_entity_resolution_config()
    }
    ///
    /// Appends an item to `trustedIdentitySources`.
    ///
    /// To override the contents of this collection use [`set_trusted_identity_sources`](Self::set_trusted_identity_sources).
    ///
    /// <p>Optional identity sources to trust in addition to your account. At most 100 unique entries, each with exactly one member. Order is not significant. An empty list and an absent member are the same value: only your account is trusted. You can change it with UpdateAgentContext.</p>
    pub fn trusted_identity_sources(mut self, input: crate::types::TrustedIdentitySource) -> Self {
        self.inner = self.inner.trusted_identity_sources(input);
        self
    }
    /// <p>Optional identity sources to trust in addition to your account. At most 100 unique entries, each with exactly one member. Order is not significant. An empty list and an absent member are the same value: only your account is trusted. You can change it with UpdateAgentContext.</p>
    pub fn set_trusted_identity_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TrustedIdentitySource>>) -> Self {
        self.inner = self.inner.set_trusted_identity_sources(input);
        self
    }
    /// <p>Optional identity sources to trust in addition to your account. At most 100 unique entries, each with exactly one member. Order is not significant. An empty list and an absent member are the same value: only your account is trusted. You can change it with UpdateAgentContext.</p>
    pub fn get_trusted_identity_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TrustedIdentitySource>> {
        self.inner.get_trusted_identity_sources()
    }
    ///
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Tags to add to the agent context when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new agent context. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <p>Tags to add to the agent context when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new agent context. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>Tags to add to the agent context when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new agent context. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
    ///
    /// Appends an item to `curationPolicyIds`.
    ///
    /// To override the contents of this collection use [`set_curation_policy_ids`](Self::set_curation_policy_ids).
    ///
    /// <p>Curation policies to associate with the new agent context, as IDs or ARNs, instead of the default curation policies. If you omit it or the list is empty, AWS Context associates the default curation policies. Each policy must be <code>ACTIVE</code> and owned by your account, and you need <code>context:AssociateCurationPolicy</code> permission on each. AWS Context checks both again on a <code>clientToken</code> retry. If a policy doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If one has been deleted, it fails with <code>ConflictException</code>. Change the policies later with AssociateCurationPolicy and DisassociateCurationPolicy.</p>
    pub fn curation_policy_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.curation_policy_ids(input.into());
        self
    }
    /// <p>Curation policies to associate with the new agent context, as IDs or ARNs, instead of the default curation policies. If you omit it or the list is empty, AWS Context associates the default curation policies. Each policy must be <code>ACTIVE</code> and owned by your account, and you need <code>context:AssociateCurationPolicy</code> permission on each. AWS Context checks both again on a <code>clientToken</code> retry. If a policy doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If one has been deleted, it fails with <code>ConflictException</code>. Change the policies later with AssociateCurationPolicy and DisassociateCurationPolicy.</p>
    pub fn set_curation_policy_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_curation_policy_ids(input);
        self
    }
    /// <p>Curation policies to associate with the new agent context, as IDs or ARNs, instead of the default curation policies. If you omit it or the list is empty, AWS Context associates the default curation policies. Each policy must be <code>ACTIVE</code> and owned by your account, and you need <code>context:AssociateCurationPolicy</code> permission on each. AWS Context checks both again on a <code>clientToken</code> retry. If a policy doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If one has been deleted, it fails with <code>ConflictException</code>. Change the policies later with AssociateCurationPolicy and DisassociateCurationPolicy.</p>
    pub fn get_curation_policy_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_curation_policy_ids()
    }
}