aws_sdk_connectcases/operation/create_field/
_create_field_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 CreateFieldInput {
6    /// <p>The unique identifier of the Cases domain.</p>
7    pub domain_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the field.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>Defines the data type, some system constraints, and default display of the field.</p>
11    pub r#type: ::std::option::Option<crate::types::FieldType>,
12    /// <p>The description of the field.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14}
15impl CreateFieldInput {
16    /// <p>The unique identifier of the Cases domain.</p>
17    pub fn domain_id(&self) -> ::std::option::Option<&str> {
18        self.domain_id.as_deref()
19    }
20    /// <p>The name of the field.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>Defines the data type, some system constraints, and default display of the field.</p>
25    pub fn r#type(&self) -> ::std::option::Option<&crate::types::FieldType> {
26        self.r#type.as_ref()
27    }
28    /// <p>The description of the field.</p>
29    pub fn description(&self) -> ::std::option::Option<&str> {
30        self.description.as_deref()
31    }
32}
33impl CreateFieldInput {
34    /// Creates a new builder-style object to manufacture [`CreateFieldInput`](crate::operation::create_field::CreateFieldInput).
35    pub fn builder() -> crate::operation::create_field::builders::CreateFieldInputBuilder {
36        crate::operation::create_field::builders::CreateFieldInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateFieldInput`](crate::operation::create_field::CreateFieldInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateFieldInputBuilder {
44    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
45    pub(crate) name: ::std::option::Option<::std::string::String>,
46    pub(crate) r#type: ::std::option::Option<crate::types::FieldType>,
47    pub(crate) description: ::std::option::Option<::std::string::String>,
48}
49impl CreateFieldInputBuilder {
50    /// <p>The unique identifier of the Cases domain.</p>
51    /// This field is required.
52    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.domain_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The unique identifier of the Cases domain.</p>
57    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.domain_id = input;
59        self
60    }
61    /// <p>The unique identifier of the Cases domain.</p>
62    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.domain_id
64    }
65    /// <p>The name of the field.</p>
66    /// This field is required.
67    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.name = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The name of the field.</p>
72    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.name = input;
74        self
75    }
76    /// <p>The name of the field.</p>
77    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
78        &self.name
79    }
80    /// <p>Defines the data type, some system constraints, and default display of the field.</p>
81    /// This field is required.
82    pub fn r#type(mut self, input: crate::types::FieldType) -> Self {
83        self.r#type = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>Defines the data type, some system constraints, and default display of the field.</p>
87    pub fn set_type(mut self, input: ::std::option::Option<crate::types::FieldType>) -> Self {
88        self.r#type = input;
89        self
90    }
91    /// <p>Defines the data type, some system constraints, and default display of the field.</p>
92    pub fn get_type(&self) -> &::std::option::Option<crate::types::FieldType> {
93        &self.r#type
94    }
95    /// <p>The description of the field.</p>
96    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.description = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The description of the field.</p>
101    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.description = input;
103        self
104    }
105    /// <p>The description of the field.</p>
106    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
107        &self.description
108    }
109    /// Consumes the builder and constructs a [`CreateFieldInput`](crate::operation::create_field::CreateFieldInput).
110    pub fn build(self) -> ::std::result::Result<crate::operation::create_field::CreateFieldInput, ::aws_smithy_types::error::operation::BuildError> {
111        ::std::result::Result::Ok(crate::operation::create_field::CreateFieldInput {
112            domain_id: self.domain_id,
113            name: self.name,
114            r#type: self.r#type,
115            description: self.description,
116        })
117    }
118}