aws-sdk-personalize 1.103.0

AWS SDK for Amazon Personalize
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateSchemaInput {
    /// <p>The name for the schema.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A schema in Avro JSON format.</p>
    pub schema: ::std::option::Option<::std::string::String>,
    /// <p>The domain for the schema. If you are creating a schema for a dataset in a Domain dataset group, specify the domain you chose when you created the Domain dataset group.</p>
    pub domain: ::std::option::Option<crate::types::Domain>,
}
impl CreateSchemaInput {
    /// <p>The name for the schema.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A schema in Avro JSON format.</p>
    pub fn schema(&self) -> ::std::option::Option<&str> {
        self.schema.as_deref()
    }
    /// <p>The domain for the schema. If you are creating a schema for a dataset in a Domain dataset group, specify the domain you chose when you created the Domain dataset group.</p>
    pub fn domain(&self) -> ::std::option::Option<&crate::types::Domain> {
        self.domain.as_ref()
    }
}
impl CreateSchemaInput {
    /// Creates a new builder-style object to manufacture [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
    pub fn builder() -> crate::operation::create_schema::builders::CreateSchemaInputBuilder {
        crate::operation::create_schema::builders::CreateSchemaInputBuilder::default()
    }
}

/// A builder for [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateSchemaInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) schema: ::std::option::Option<::std::string::String>,
    pub(crate) domain: ::std::option::Option<crate::types::Domain>,
}
impl CreateSchemaInputBuilder {
    /// <p>The name for the schema.</p>
    /// This field is required.
    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 name for the schema.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name for the schema.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A schema in Avro JSON format.</p>
    /// This field is required.
    pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.schema = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A schema in Avro JSON format.</p>
    pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.schema = input;
        self
    }
    /// <p>A schema in Avro JSON format.</p>
    pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
        &self.schema
    }
    /// <p>The domain for the schema. If you are creating a schema for a dataset in a Domain dataset group, specify the domain you chose when you created the Domain dataset group.</p>
    pub fn domain(mut self, input: crate::types::Domain) -> Self {
        self.domain = ::std::option::Option::Some(input);
        self
    }
    /// <p>The domain for the schema. If you are creating a schema for a dataset in a Domain dataset group, specify the domain you chose when you created the Domain dataset group.</p>
    pub fn set_domain(mut self, input: ::std::option::Option<crate::types::Domain>) -> Self {
        self.domain = input;
        self
    }
    /// <p>The domain for the schema. If you are creating a schema for a dataset in a Domain dataset group, specify the domain you chose when you created the Domain dataset group.</p>
    pub fn get_domain(&self) -> &::std::option::Option<crate::types::Domain> {
        &self.domain
    }
    /// Consumes the builder and constructs a [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_schema::CreateSchemaInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_schema::CreateSchemaInput {
            name: self.name,
            schema: self.schema,
            domain: self.domain,
        })
    }
}