Skip to main content

aws_sdk_frauddetector/operation/create_model/
_create_model_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 CreateModelInput {
6    /// <p>The model ID.</p>
7    pub model_id: ::std::option::Option<::std::string::String>,
8    /// <p>The model type.</p>
9    pub model_type: ::std::option::Option<crate::types::ModelTypeEnum>,
10    /// <p>The model description.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The name of the event type.</p>
13    pub event_type_name: ::std::option::Option<::std::string::String>,
14    /// <p>A collection of key and value pairs.</p>
15    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateModelInput {
18    /// <p>The model ID.</p>
19    pub fn model_id(&self) -> ::std::option::Option<&str> {
20        self.model_id.as_deref()
21    }
22    /// <p>The model type.</p>
23    pub fn model_type(&self) -> ::std::option::Option<&crate::types::ModelTypeEnum> {
24        self.model_type.as_ref()
25    }
26    /// <p>The model description.</p>
27    pub fn description(&self) -> ::std::option::Option<&str> {
28        self.description.as_deref()
29    }
30    /// <p>The name of the event type.</p>
31    pub fn event_type_name(&self) -> ::std::option::Option<&str> {
32        self.event_type_name.as_deref()
33    }
34    /// <p>A collection of key and value pairs.</p>
35    ///
36    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
37    pub fn tags(&self) -> &[crate::types::Tag] {
38        self.tags.as_deref().unwrap_or_default()
39    }
40}
41impl CreateModelInput {
42    /// Creates a new builder-style object to manufacture [`CreateModelInput`](crate::operation::create_model::CreateModelInput).
43    pub fn builder() -> crate::operation::create_model::builders::CreateModelInputBuilder {
44        crate::operation::create_model::builders::CreateModelInputBuilder::default()
45    }
46}
47
48/// A builder for [`CreateModelInput`](crate::operation::create_model::CreateModelInput).
49#[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    /// <p>The model ID.</p>
60    /// This field is required.
61    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    /// <p>The model ID.</p>
66    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.model_id = input;
68        self
69    }
70    /// <p>The model ID.</p>
71    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.model_id
73    }
74    /// <p>The model type.</p>
75    /// This field is required.
76    pub fn model_type(mut self, input: crate::types::ModelTypeEnum) -> Self {
77        self.model_type = ::std::option::Option::Some(input);
78        self
79    }
80    /// <p>The model type.</p>
81    pub fn set_model_type(mut self, input: ::std::option::Option<crate::types::ModelTypeEnum>) -> Self {
82        self.model_type = input;
83        self
84    }
85    /// <p>The model type.</p>
86    pub fn get_model_type(&self) -> &::std::option::Option<crate::types::ModelTypeEnum> {
87        &self.model_type
88    }
89    /// <p>The model description.</p>
90    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    /// <p>The model description.</p>
95    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.description = input;
97        self
98    }
99    /// <p>The model description.</p>
100    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
101        &self.description
102    }
103    /// <p>The name of the event type.</p>
104    /// This field is required.
105    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    /// <p>The name of the event type.</p>
110    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    /// <p>The name of the event type.</p>
115    pub fn get_event_type_name(&self) -> &::std::option::Option<::std::string::String> {
116        &self.event_type_name
117    }
118    /// Appends an item to `tags`.
119    ///
120    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
121    ///
122    /// <p>A collection of key and value pairs.</p>
123    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    /// <p>A collection of key and value pairs.</p>
130    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    /// <p>A collection of key and value pairs.</p>
135    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
136        &self.tags
137    }
138    /// Consumes the builder and constructs a [`CreateModelInput`](crate::operation::create_model::CreateModelInput).
139    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}