aws_sdk_amplifyuibuilder/types/
_component_event.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ComponentEvent {
7 pub action: ::std::option::Option<::std::string::String>,
9 pub parameters: ::std::option::Option<crate::types::ActionParameters>,
11 pub binding_event: ::std::option::Option<::std::string::String>,
13}
14impl ComponentEvent {
15 pub fn action(&self) -> ::std::option::Option<&str> {
17 self.action.as_deref()
18 }
19 pub fn parameters(&self) -> ::std::option::Option<&crate::types::ActionParameters> {
21 self.parameters.as_ref()
22 }
23 pub fn binding_event(&self) -> ::std::option::Option<&str> {
25 self.binding_event.as_deref()
26 }
27}
28impl ComponentEvent {
29 pub fn builder() -> crate::types::builders::ComponentEventBuilder {
31 crate::types::builders::ComponentEventBuilder::default()
32 }
33}
34
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct ComponentEventBuilder {
39 pub(crate) action: ::std::option::Option<::std::string::String>,
40 pub(crate) parameters: ::std::option::Option<crate::types::ActionParameters>,
41 pub(crate) binding_event: ::std::option::Option<::std::string::String>,
42}
43impl ComponentEventBuilder {
44 pub fn action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.action = ::std::option::Option::Some(input.into());
47 self
48 }
49 pub fn set_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.action = input;
52 self
53 }
54 pub fn get_action(&self) -> &::std::option::Option<::std::string::String> {
56 &self.action
57 }
58 pub fn parameters(mut self, input: crate::types::ActionParameters) -> Self {
60 self.parameters = ::std::option::Option::Some(input);
61 self
62 }
63 pub fn set_parameters(mut self, input: ::std::option::Option<crate::types::ActionParameters>) -> Self {
65 self.parameters = input;
66 self
67 }
68 pub fn get_parameters(&self) -> &::std::option::Option<crate::types::ActionParameters> {
70 &self.parameters
71 }
72 pub fn binding_event(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74 self.binding_event = ::std::option::Option::Some(input.into());
75 self
76 }
77 pub fn set_binding_event(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79 self.binding_event = input;
80 self
81 }
82 pub fn get_binding_event(&self) -> &::std::option::Option<::std::string::String> {
84 &self.binding_event
85 }
86 pub fn build(self) -> crate::types::ComponentEvent {
88 crate::types::ComponentEvent {
89 action: self.action,
90 parameters: self.parameters,
91 binding_event: self.binding_event,
92 }
93 }
94}