// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_ontology::_get_ontology_input::GetOntologyInputBuilder;
pub use crate::operation::get_ontology::_get_ontology_output::GetOntologyOutputBuilder;
impl crate::operation::get_ontology::builders::GetOntologyInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::get_ontology::GetOntologyOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_ontology::GetOntologyError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.get_ontology();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `GetOntology`.
///
/// <p>Returns an ontology's status and one of its versions.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetOntologyFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::get_ontology::builders::GetOntologyInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::get_ontology::GetOntologyOutput,
crate::operation::get_ontology::GetOntologyError,
> for GetOntologyFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::get_ontology::GetOntologyOutput,
crate::operation::get_ontology::GetOntologyError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl GetOntologyFluentBuilder {
/// Creates a new `GetOntologyFluentBuilder`.
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 GetOntology as a reference.
pub fn as_input(&self) -> &crate::operation::get_ontology::builders::GetOntologyInputBuilder {
&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::get_ontology::GetOntologyOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_ontology::GetOntologyError,
::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::get_ontology::GetOntology::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::get_ontology::GetOntology::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::get_ontology::GetOntologyOutput,
crate::operation::get_ontology::GetOntologyError,
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 ontology to return, by its ID or ARN (see <code>OntologyIdentifier</code>).</p>
pub fn ontology_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.ontology_id(input.into());
self
}
/// <p>The ontology to return, by its ID or ARN (see <code>OntologyIdentifier</code>).</p>
pub fn set_ontology_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_ontology_id(input);
self
}
/// <p>The ontology to return, by its ID or ARN (see <code>OntologyIdentifier</code>).</p>
pub fn get_ontology_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_ontology_id()
}
/// <p>The version to return, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>. If you omit it, GetOntology returns the current default version.</p>
pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.version(input.into());
self
}
/// <p>The version to return, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>. If you omit it, GetOntology returns the current default version.</p>
pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_version(input);
self
}
/// <p>The version to return, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>. If you omit it, GetOntology returns the current default version.</p>
pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_version()
}
/// <p>Return the version's source document in <code>source</code>, in this format, in place of the template. The response then has no <code>template</code>. The format must be the version's <code>sourceFormat</code>. On a <code>DRAFT</code> ontology, GetOntology returns the draft, with or without <code>version</code> (its only version is 1.0.0). If the ontology is AWS managed, whose source is never returned, or the version has no source document, the request fails with <code>ValidationException</code>. If you omit it, the response has the template and no source.</p>
pub fn source_format(mut self, input: crate::types::OntologySourceFormat) -> Self {
self.inner = self.inner.source_format(input);
self
}
/// <p>Return the version's source document in <code>source</code>, in this format, in place of the template. The response then has no <code>template</code>. The format must be the version's <code>sourceFormat</code>. On a <code>DRAFT</code> ontology, GetOntology returns the draft, with or without <code>version</code> (its only version is 1.0.0). If the ontology is AWS managed, whose source is never returned, or the version has no source document, the request fails with <code>ValidationException</code>. If you omit it, the response has the template and no source.</p>
pub fn set_source_format(mut self, input: ::std::option::Option<crate::types::OntologySourceFormat>) -> Self {
self.inner = self.inner.set_source_format(input);
self
}
/// <p>Return the version's source document in <code>source</code>, in this format, in place of the template. The response then has no <code>template</code>. The format must be the version's <code>sourceFormat</code>. On a <code>DRAFT</code> ontology, GetOntology returns the draft, with or without <code>version</code> (its only version is 1.0.0). If the ontology is AWS managed, whose source is never returned, or the version has no source document, the request fails with <code>ValidationException</code>. If you omit it, the response has the template and no source.</p>
pub fn get_source_format(&self) -> &::std::option::Option<crate::types::OntologySourceFormat> {
self.inner.get_source_format()
}
}