#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Event {
pub source_identifier: ::std::option::Option<::std::string::String>,
pub source_type: ::std::option::Option<crate::types::SourceType>,
pub message: ::std::option::Option<::std::string::String>,
pub event_categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub severity: ::std::option::Option<::std::string::String>,
pub date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub event_id: ::std::option::Option<::std::string::String>,
}
impl Event {
pub fn source_identifier(&self) -> ::std::option::Option<&str> {
self.source_identifier.as_deref()
}
pub fn source_type(&self) -> ::std::option::Option<&crate::types::SourceType> {
self.source_type.as_ref()
}
pub fn message(&self) -> ::std::option::Option<&str> {
self.message.as_deref()
}
pub fn event_categories(&self) -> &[::std::string::String] {
self.event_categories.as_deref().unwrap_or_default()
}
pub fn severity(&self) -> ::std::option::Option<&str> {
self.severity.as_deref()
}
pub fn date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.date.as_ref()
}
pub fn event_id(&self) -> ::std::option::Option<&str> {
self.event_id.as_deref()
}
}
impl Event {
pub fn builder() -> crate::types::builders::EventBuilder {
crate::types::builders::EventBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EventBuilder {
pub(crate) source_identifier: ::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) event_categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) severity: ::std::option::Option<::std::string::String>,
pub(crate) date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) event_id: ::std::option::Option<::std::string::String>,
}
impl EventBuilder {
pub fn source_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_identifier = ::std::option::Option::Some(input.into());
self
}
pub fn set_source_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_identifier = input;
self
}
pub fn get_source_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.source_identifier
}
pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
self.source_type = ::std::option::Option::Some(input);
self
}
pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
self.source_type = input;
self
}
pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
&self.source_type
}
pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.message = ::std::option::Option::Some(input.into());
self
}
pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.message = input;
self
}
pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
&self.message
}
pub fn event_categories(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.event_categories.unwrap_or_default();
v.push(input.into());
self.event_categories = ::std::option::Option::Some(v);
self
}
pub fn set_event_categories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.event_categories = input;
self
}
pub fn get_event_categories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.event_categories
}
pub fn severity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.severity = ::std::option::Option::Some(input.into());
self
}
pub fn set_severity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.severity = input;
self
}
pub fn get_severity(&self) -> &::std::option::Option<::std::string::String> {
&self.severity
}
pub fn date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.date = ::std::option::Option::Some(input);
self
}
pub fn set_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.date = input;
self
}
pub fn get_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.date
}
pub fn event_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.event_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_event_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.event_id = input;
self
}
pub fn get_event_id(&self) -> &::std::option::Option<::std::string::String> {
&self.event_id
}
pub fn build(self) -> crate::types::Event {
crate::types::Event {
source_identifier: self.source_identifier,
source_type: self.source_type,
message: self.message,
event_categories: self.event_categories,
severity: self.severity,
date: self.date,
event_id: self.event_id,
}
}
}