aws_sdk_frauddetector/operation/create_model/
_create_model_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateModelInput {
6 pub model_id: ::std::option::Option<::std::string::String>,
8 pub model_type: ::std::option::Option<crate::types::ModelTypeEnum>,
10 pub description: ::std::option::Option<::std::string::String>,
12 pub event_type_name: ::std::option::Option<::std::string::String>,
14 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateModelInput {
18 pub fn model_id(&self) -> ::std::option::Option<&str> {
20 self.model_id.as_deref()
21 }
22 pub fn model_type(&self) -> ::std::option::Option<&crate::types::ModelTypeEnum> {
24 self.model_type.as_ref()
25 }
26 pub fn description(&self) -> ::std::option::Option<&str> {
28 self.description.as_deref()
29 }
30 pub fn event_type_name(&self) -> ::std::option::Option<&str> {
32 self.event_type_name.as_deref()
33 }
34 pub fn tags(&self) -> &[crate::types::Tag] {
38 self.tags.as_deref().unwrap_or_default()
39 }
40}
41impl CreateModelInput {
42 pub fn builder() -> crate::operation::create_model::builders::CreateModelInputBuilder {
44 crate::operation::create_model::builders::CreateModelInputBuilder::default()
45 }
46}
47
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateModelInputBuilder {
52 pub(crate) model_id: ::std::option::Option<::std::string::String>,
53 pub(crate) model_type: ::std::option::Option<crate::types::ModelTypeEnum>,
54 pub(crate) description: ::std::option::Option<::std::string::String>,
55 pub(crate) event_type_name: ::std::option::Option<::std::string::String>,
56 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
57}
58impl CreateModelInputBuilder {
59 pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.model_id = ::std::option::Option::Some(input.into());
63 self
64 }
65 pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.model_id = input;
68 self
69 }
70 pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
72 &self.model_id
73 }
74 pub fn model_type(mut self, input: crate::types::ModelTypeEnum) -> Self {
77 self.model_type = ::std::option::Option::Some(input);
78 self
79 }
80 pub fn set_model_type(mut self, input: ::std::option::Option<crate::types::ModelTypeEnum>) -> Self {
82 self.model_type = input;
83 self
84 }
85 pub fn get_model_type(&self) -> &::std::option::Option<crate::types::ModelTypeEnum> {
87 &self.model_type
88 }
89 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91 self.description = ::std::option::Option::Some(input.into());
92 self
93 }
94 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.description = input;
97 self
98 }
99 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
101 &self.description
102 }
103 pub fn event_type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106 self.event_type_name = ::std::option::Option::Some(input.into());
107 self
108 }
109 pub fn set_event_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.event_type_name = input;
112 self
113 }
114 pub fn get_event_type_name(&self) -> &::std::option::Option<::std::string::String> {
116 &self.event_type_name
117 }
118 pub fn tags(mut self, input: crate::types::Tag) -> Self {
124 let mut v = self.tags.unwrap_or_default();
125 v.push(input);
126 self.tags = ::std::option::Option::Some(v);
127 self
128 }
129 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
131 self.tags = input;
132 self
133 }
134 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
136 &self.tags
137 }
138 pub fn build(self) -> ::std::result::Result<crate::operation::create_model::CreateModelInput, ::aws_smithy_types::error::operation::BuildError> {
140 ::std::result::Result::Ok(crate::operation::create_model::CreateModelInput {
141 model_id: self.model_id,
142 model_type: self.model_type,
143 description: self.description,
144 event_type_name: self.event_type_name,
145 tags: self.tags,
146 })
147 }
148}