aws_sdk_personalize/operation/create_schema/
_create_schema_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateSchemaInput {
6    /// <p>The name for the schema.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A schema in Avro JSON format.</p>
9    pub schema: ::std::option::Option<::std::string::String>,
10    /// <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>
11    pub domain: ::std::option::Option<crate::types::Domain>,
12}
13impl CreateSchemaInput {
14    /// <p>The name for the schema.</p>
15    pub fn name(&self) -> ::std::option::Option<&str> {
16        self.name.as_deref()
17    }
18    /// <p>A schema in Avro JSON format.</p>
19    pub fn schema(&self) -> ::std::option::Option<&str> {
20        self.schema.as_deref()
21    }
22    /// <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>
23    pub fn domain(&self) -> ::std::option::Option<&crate::types::Domain> {
24        self.domain.as_ref()
25    }
26}
27impl CreateSchemaInput {
28    /// Creates a new builder-style object to manufacture [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
29    pub fn builder() -> crate::operation::create_schema::builders::CreateSchemaInputBuilder {
30        crate::operation::create_schema::builders::CreateSchemaInputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateSchemaInputBuilder {
38    pub(crate) name: ::std::option::Option<::std::string::String>,
39    pub(crate) schema: ::std::option::Option<::std::string::String>,
40    pub(crate) domain: ::std::option::Option<crate::types::Domain>,
41}
42impl CreateSchemaInputBuilder {
43    /// <p>The name for the schema.</p>
44    /// This field is required.
45    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.name = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The name for the schema.</p>
50    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.name = input;
52        self
53    }
54    /// <p>The name for the schema.</p>
55    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
56        &self.name
57    }
58    /// <p>A schema in Avro JSON format.</p>
59    /// This field is required.
60    pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.schema = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>A schema in Avro JSON format.</p>
65    pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.schema = input;
67        self
68    }
69    /// <p>A schema in Avro JSON format.</p>
70    pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
71        &self.schema
72    }
73    /// <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>
74    pub fn domain(mut self, input: crate::types::Domain) -> Self {
75        self.domain = ::std::option::Option::Some(input);
76        self
77    }
78    /// <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>
79    pub fn set_domain(mut self, input: ::std::option::Option<crate::types::Domain>) -> Self {
80        self.domain = input;
81        self
82    }
83    /// <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>
84    pub fn get_domain(&self) -> &::std::option::Option<crate::types::Domain> {
85        &self.domain
86    }
87    /// Consumes the builder and constructs a [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::create_schema::CreateSchemaInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::create_schema::CreateSchemaInput {
92            name: self.name,
93            schema: self.schema,
94            domain: self.domain,
95        })
96    }
97}