aws_sdk_personalize/operation/create_schema/
_create_schema_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateSchemaInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub schema: ::std::option::Option<::std::string::String>,
10 pub domain: ::std::option::Option<crate::types::Domain>,
12}
13impl CreateSchemaInput {
14 pub fn name(&self) -> ::std::option::Option<&str> {
16 self.name.as_deref()
17 }
18 pub fn schema(&self) -> ::std::option::Option<&str> {
20 self.schema.as_deref()
21 }
22 pub fn domain(&self) -> ::std::option::Option<&crate::types::Domain> {
24 self.domain.as_ref()
25 }
26}
27impl CreateSchemaInput {
28 pub fn builder() -> crate::operation::create_schema::builders::CreateSchemaInputBuilder {
30 crate::operation::create_schema::builders::CreateSchemaInputBuilder::default()
31 }
32}
33
34#[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 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.name = input;
52 self
53 }
54 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
56 &self.name
57 }
58 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 pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.schema = input;
67 self
68 }
69 pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
71 &self.schema
72 }
73 pub fn domain(mut self, input: crate::types::Domain) -> Self {
75 self.domain = ::std::option::Option::Some(input);
76 self
77 }
78 pub fn set_domain(mut self, input: ::std::option::Option<crate::types::Domain>) -> Self {
80 self.domain = input;
81 self
82 }
83 pub fn get_domain(&self) -> &::std::option::Option<crate::types::Domain> {
85 &self.domain
86 }
87 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}