1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents a single occurrence of something interesting within the system. Some examples of events are creating a DAX cluster, adding or removing a node, or rebooting a node.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Event {
/// <p>The source of the event. For example, if the event occurred at the node level, the source would be the node ID.</p>
pub source_name: ::std::option::Option<::std::string::String>,
/// <p>Specifies the origin of this event - a cluster, a parameter group, a node ID, etc.</p>
pub source_type: ::std::option::Option<crate::types::SourceType>,
/// <p>A user-defined message associated with the event.</p>
pub message: ::std::option::Option<::std::string::String>,
/// <p>The date and time when the event occurred.</p>
pub date: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Event {
/// <p>The source of the event. For example, if the event occurred at the node level, the source would be the node ID.</p>
pub fn source_name(&self) -> ::std::option::Option<&str> {
self.source_name.as_deref()
}
/// <p>Specifies the origin of this event - a cluster, a parameter group, a node ID, etc.</p>
pub fn source_type(&self) -> ::std::option::Option<&crate::types::SourceType> {
self.source_type.as_ref()
}
/// <p>A user-defined message associated with the event.</p>
pub fn message(&self) -> ::std::option::Option<&str> {
self.message.as_deref()
}
/// <p>The date and time when the event occurred.</p>
pub fn date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.date.as_ref()
}
}
impl Event {
/// Creates a new builder-style object to manufacture [`Event`](crate::types::Event).
pub fn builder() -> crate::types::builders::EventBuilder {
crate::types::builders::EventBuilder::default()
}
}
/// A builder for [`Event`](crate::types::Event).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EventBuilder {
pub(crate) source_name: ::std::option::Option<::std::string::String>,
pub(crate) source_type: ::std::option::Option<crate::types::SourceType>,
pub(crate) message: ::std::option::Option<::std::string::String>,
pub(crate) date: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl EventBuilder {
/// <p>The source of the event. For example, if the event occurred at the node level, the source would be the node ID.</p>
pub fn source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The source of the event. For example, if the event occurred at the node level, the source would be the node ID.</p>
pub fn set_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_name = input;
self
}
/// <p>The source of the event. For example, if the event occurred at the node level, the source would be the node ID.</p>
pub fn get_source_name(&self) -> &::std::option::Option<::std::string::String> {
&self.source_name
}
/// <p>Specifies the origin of this event - a cluster, a parameter group, a node ID, etc.</p>
pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
self.source_type = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the origin of this event - a cluster, a parameter group, a node ID, etc.</p>
pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
self.source_type = input;
self
}
/// <p>Specifies the origin of this event - a cluster, a parameter group, a node ID, etc.</p>
pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
&self.source_type
}
/// <p>A user-defined message associated with the event.</p>
pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.message = ::std::option::Option::Some(input.into());
self
}
/// <p>A user-defined message associated with the event.</p>
pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.message = input;
self
}
/// <p>A user-defined message associated with the event.</p>
pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
&self.message
}
/// <p>The date and time when the event occurred.</p>
pub fn date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.date = ::std::option::Option::Some(input);
self
}
/// <p>The date and time when the event occurred.</p>
pub fn set_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.date = input;
self
}
/// <p>The date and time when the event occurred.</p>
pub fn get_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.date
}
/// Consumes the builder and constructs a [`Event`](crate::types::Event).
pub fn build(self) -> crate::types::Event {
crate::types::Event {
source_name: self.source_name,
source_type: self.source_type,
message: self.message,
date: self.date,
}
}
}