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.

/// <p>Identifies the ontology to return and, optionally, the version.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetOntologyInput {
    /// <p>The ontology to return, by its ID or ARN (see <code>OntologyIdentifier</code>).</p>
    pub ontology_id: ::std::option::Option<::std::string::String>,
    /// <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 version: ::std::option::Option<::std::string::String>,
    /// <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 source_format: ::std::option::Option<crate::types::OntologySourceFormat>,
}
impl GetOntologyInput {
    /// <p>The ontology to return, by its ID or ARN (see <code>OntologyIdentifier</code>).</p>
    pub fn ontology_id(&self) -> ::std::option::Option<&str> {
        self.ontology_id.as_deref()
    }
    /// <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(&self) -> ::std::option::Option<&str> {
        self.version.as_deref()
    }
    /// <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(&self) -> ::std::option::Option<&crate::types::OntologySourceFormat> {
        self.source_format.as_ref()
    }
}
impl GetOntologyInput {
    /// Creates a new builder-style object to manufacture [`GetOntologyInput`](crate::operation::get_ontology::GetOntologyInput).
    pub fn builder() -> crate::operation::get_ontology::builders::GetOntologyInputBuilder {
        crate::operation::get_ontology::builders::GetOntologyInputBuilder::default()
    }
}

/// A builder for [`GetOntologyInput`](crate::operation::get_ontology::GetOntologyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetOntologyInputBuilder {
    pub(crate) ontology_id: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<::std::string::String>,
    pub(crate) source_format: ::std::option::Option<crate::types::OntologySourceFormat>,
}
impl GetOntologyInputBuilder {
    /// <p>The ontology to return, by its ID or ARN (see <code>OntologyIdentifier</code>).</p>
    /// This field is required.
    pub fn ontology_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ontology_id = ::std::option::Option::Some(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.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.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.version = ::std::option::Option::Some(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.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.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.source_format = ::std::option::Option::Some(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.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.source_format
    }
    /// Consumes the builder and constructs a [`GetOntologyInput`](crate::operation::get_ontology::GetOntologyInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::get_ontology::GetOntologyInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_ontology::GetOntologyInput {
            ontology_id: self.ontology_id,
            version: self.version,
            source_format: self.source_format,
        })
    }
}