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>The created ontology's identity, and any derivation warnings. GetOntology returns the version's details, and ListOntologies (<code>OntologySummary</code>) returns its node and edge type counts.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateOntologyOutput {
    /// <p>The ID of the ontology, assigned by AWS Context.</p>
    pub id: ::std::string::String,
    /// <p>The ARN of the created ontology.</p>
    pub arn: ::std::string::String,
    /// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
    pub updated_at: ::aws_smithy_types::DateTime,
    /// <p>The display name as stored. On a replay, the current one.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
    pub version: ::std::option::Option<::std::string::String>,
    /// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
    pub validation_issues: ::std::option::Option<::std::vec::Vec<crate::types::OntologyValidationIssue>>,
    _request_id: Option<String>,
}
impl CreateOntologyOutput {
    /// <p>The ID of the ontology, assigned by AWS Context.</p>
    pub fn id(&self) -> &str {
        use std::ops::Deref;
        self.id.deref()
    }
    /// <p>The ARN of the created ontology.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// <p>The display name as stored. On a replay, the current one.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
    pub fn version(&self) -> ::std::option::Option<&str> {
        self.version.as_deref()
    }
    /// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.validation_issues.is_none()`.
    pub fn validation_issues(&self) -> &[crate::types::OntologyValidationIssue] {
        self.validation_issues.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for CreateOntologyOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateOntologyOutput {
    /// Creates a new builder-style object to manufacture [`CreateOntologyOutput`](crate::operation::create_ontology::CreateOntologyOutput).
    pub fn builder() -> crate::operation::create_ontology::builders::CreateOntologyOutputBuilder {
        crate::operation::create_ontology::builders::CreateOntologyOutputBuilder::default()
    }
}

/// A builder for [`CreateOntologyOutput`](crate::operation::create_ontology::CreateOntologyOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateOntologyOutputBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<::std::string::String>,
    pub(crate) validation_issues: ::std::option::Option<::std::vec::Vec<crate::types::OntologyValidationIssue>>,
    _request_id: Option<String>,
}
impl CreateOntologyOutputBuilder {
    /// <p>The ID of the ontology, assigned by AWS Context.</p>
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the ontology, assigned by AWS Context.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The ID of the ontology, assigned by AWS Context.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The ARN of the created ontology.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the created ontology.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The ARN of the created ontology.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// <p>The display name as stored. On a replay, the current one.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The display name as stored. On a replay, the current one.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The display name as stored. On a replay, the current one.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</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 initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.version = input;
        self
    }
    /// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.version
    }
    /// Appends an item to `validation_issues`.
    ///
    /// To override the contents of this collection use [`set_validation_issues`](Self::set_validation_issues).
    ///
    /// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
    pub fn validation_issues(mut self, input: crate::types::OntologyValidationIssue) -> Self {
        let mut v = self.validation_issues.unwrap_or_default();
        v.push(input);
        self.validation_issues = ::std::option::Option::Some(v);
        self
    }
    /// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
    pub fn set_validation_issues(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OntologyValidationIssue>>) -> Self {
        self.validation_issues = input;
        self
    }
    /// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
    pub fn get_validation_issues(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OntologyValidationIssue>> {
        &self.validation_issues
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateOntologyOutput`](crate::operation::create_ontology::CreateOntologyOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`id`](crate::operation::create_ontology::builders::CreateOntologyOutputBuilder::id)
    /// - [`arn`](crate::operation::create_ontology::builders::CreateOntologyOutputBuilder::arn)
    /// - [`updated_at`](crate::operation::create_ontology::builders::CreateOntologyOutputBuilder::updated_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_ontology::CreateOntologyOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_ontology::CreateOntologyOutput {
            id: self.id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "id",
                    "id was not specified but it is required when building CreateOntologyOutput",
                )
            })?,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building CreateOntologyOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building CreateOntologyOutput",
                )
            })?,
            name: self.name,
            description: self.description,
            version: self.version,
            validation_issues: self.validation_issues,
            _request_id: self._request_id,
        })
    }
}