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_ontology_induction::_start_ontology_induction_input::StartOntologyInductionInputBuilder;

pub use crate::operation::start_ontology_induction::_start_ontology_induction_output::StartOntologyInductionOutputBuilder;

impl crate::operation::start_ontology_induction::builders::StartOntologyInductionInputBuilder {
    /// 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_ontology_induction::StartOntologyInductionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_ontology_induction::StartOntologyInductionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.start_ontology_induction();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `StartOntologyInduction`.
///
/// <p>Starts an ontology induction, which induces a draft ontology from the documents that you provide. The induction runs asynchronously. To get its status, call GetOntologyInduction. When the induction's status is <code>DRAFT</code>, AWS Context has created the ontology as a <code>DRAFT</code>: GetOntologyInduction returns the ontology's ID, and GetOntology returns the draft. To publish the draft, use the AWS Context console. Because AWS Context creates the ontology on your behalf, you need <code>context:CreateOntology</code> permission in addition to <code>context:StartOntologyInduction</code>. If you specify tags, you also need <code>context:TagResource</code> permission.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartOntologyInductionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::start_ontology_induction::builders::StartOntologyInductionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::start_ontology_induction::StartOntologyInductionOutput,
        crate::operation::start_ontology_induction::StartOntologyInductionError,
    > for StartOntologyInductionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::start_ontology_induction::StartOntologyInductionOutput,
            crate::operation::start_ontology_induction::StartOntologyInductionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl StartOntologyInductionFluentBuilder {
    /// Creates a new `StartOntologyInductionFluentBuilder`.
    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 StartOntologyInduction as a reference.
    pub fn as_input(&self) -> &crate::operation::start_ontology_induction::builders::StartOntologyInductionInputBuilder {
        &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_ontology_induction::StartOntologyInductionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_ontology_induction::StartOntologyInductionError,
            ::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_ontology_induction::StartOntologyInduction::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::start_ontology_induction::StartOntologyInduction::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_ontology_induction::StartOntologyInductionOutput,
        crate::operation::start_ontology_induction::StartOntologyInductionError,
        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>A unique, case-sensitive identifier that you provide to make the request idempotent. A retry of the same request with the same token returns the induction that the first request created, and the same token used with a different request returns a <code>ValidationException</code>. If that induction, or the ontology it created, was deleted since, a retry with the token fails with <code>ConflictException</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 make the request idempotent. A retry of the same request with the same token returns the induction that the first request created, and the same token used with a different request returns a <code>ValidationException</code>. If that induction, or the ontology it created, was deleted since, a retry with the token fails with <code>ConflictException</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 make the request idempotent. A retry of the same request with the same token returns the induction that the first request created, and the same token used with a different request returns a <code>ValidationException</code>. If that induction, or the ontology it created, was deleted since, a retry with the token fails with <code>ConflictException</code>.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>The new ontology's display name.</p>
    pub fn ontology_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.ontology_name(input.into());
        self
    }
    /// <p>The new ontology's display name.</p>
    pub fn set_ontology_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_ontology_name(input);
        self
    }
    /// <p>The new ontology's display name.</p>
    pub fn get_ontology_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_ontology_name()
    }
    /// <p>Optional. The new ontology's description. An empty string is the same as none.</p>
    pub fn ontology_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.ontology_description(input.into());
        self
    }
    /// <p>Optional. The new ontology's description. An empty string is the same as none.</p>
    pub fn set_ontology_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_ontology_description(input);
        self
    }
    /// <p>Optional. The new ontology's description. An empty string is the same as none.</p>
    pub fn get_ontology_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_ontology_description()
    }
    /// <p>The input to induce the ontology from. Set exactly one member.</p>
    pub fn input_config(mut self, input: crate::types::OntologyInductionInputConfig) -> Self {
        self.inner = self.inner.input_config(input);
        self
    }
    /// <p>The input to induce the ontology from. Set exactly one member.</p>
    pub fn set_input_config(mut self, input: ::std::option::Option<crate::types::OntologyInductionInputConfig>) -> Self {
        self.inner = self.inner.set_input_config(input);
        self
    }
    /// <p>The input to induce the ontology from. Set exactly one member.</p>
    pub fn get_input_config(&self) -> &::std::option::Option<crate::types::OntologyInductionInputConfig> {
        self.inner.get_input_config()
    }
    /// <p>Optional. An existing ontology to start from, by ID or ARN. If you omit it, AWS Context induces the ontology from the documents alone. The seed must be an ontology that you own, it must be <code>PUBLISHED</code>, and its current version must be derived from a Turtle source document. You also need <code>context:GetOntology</code> permission on the seed. If the seed doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If it can't be used, the request fails with <code>ValidationException</code>. If the seed's source document is deleted while the induction runs, is larger than 400,000 bytes, or doesn't parse, the induction fails with <code>SEED_INVALID</code>.</p>
    pub fn seed_ontology_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.seed_ontology_id(input.into());
        self
    }
    /// <p>Optional. An existing ontology to start from, by ID or ARN. If you omit it, AWS Context induces the ontology from the documents alone. The seed must be an ontology that you own, it must be <code>PUBLISHED</code>, and its current version must be derived from a Turtle source document. You also need <code>context:GetOntology</code> permission on the seed. If the seed doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If it can't be used, the request fails with <code>ValidationException</code>. If the seed's source document is deleted while the induction runs, is larger than 400,000 bytes, or doesn't parse, the induction fails with <code>SEED_INVALID</code>.</p>
    pub fn set_seed_ontology_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_seed_ontology_id(input);
        self
    }
    /// <p>Optional. An existing ontology to start from, by ID or ARN. If you omit it, AWS Context induces the ontology from the documents alone. The seed must be an ontology that you own, it must be <code>PUBLISHED</code>, and its current version must be derived from a Turtle source document. You also need <code>context:GetOntology</code> permission on the seed. If the seed doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If it can't be used, the request fails with <code>ValidationException</code>. If the seed's source document is deleted while the induction runs, is larger than 400,000 bytes, or doesn't parse, the induction fails with <code>SEED_INVALID</code>.</p>
    pub fn get_seed_ontology_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_seed_ontology_id()
    }
    /// <p>Optional. Instructions for the induction.</p>
    pub fn prompt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.prompt(input.into());
        self
    }
    /// <p>Optional. Instructions for the induction.</p>
    pub fn set_prompt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_prompt(input);
        self
    }
    /// <p>Optional. Instructions for the induction.</p>
    pub fn get_prompt(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_prompt()
    }
    ///
    /// 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 induction 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 induction. 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>. These tags go on the induction only. <code>ontologyTags</code> go on the ontology.</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 induction 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 induction. 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>. These tags go on the induction only. <code>ontologyTags</code> go on the ontology.</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 induction 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 induction. 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>. These tags go on the induction only. <code>ontologyTags</code> go on the ontology.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
    ///
    /// Adds a key-value pair to `ontologyTags`.
    ///
    /// To override the contents of this collection use [`set_ontology_tags`](Self::set_ontology_tags).
    ///
    /// <p>Tags to add to the ontology the induction creates at DRAFT, with the same limits and rules as <code>tags</code>. They are checked here, and supplying them also requires <code>context:TagResource</code> on the new ontology. These tags go on the ontology only. <code>tags</code> go on the induction.</p>
    pub fn ontology_tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.ontology_tags(k.into(), v.into());
        self
    }
    /// <p>Tags to add to the ontology the induction creates at DRAFT, with the same limits and rules as <code>tags</code>. They are checked here, and supplying them also requires <code>context:TagResource</code> on the new ontology. These tags go on the ontology only. <code>tags</code> go on the induction.</p>
    pub fn set_ontology_tags(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.inner = self.inner.set_ontology_tags(input);
        self
    }
    /// <p>Tags to add to the ontology the induction creates at DRAFT, with the same limits and rules as <code>tags</code>. They are checked here, and supplying them also requires <code>context:TagResource</code> on the new ontology. These tags go on the ontology only. <code>tags</code> go on the induction.</p>
    pub fn get_ontology_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_ontology_tags()
    }
}