aws-sdk-elasticache 1.110.0

AWS SDK for Amazon ElastiCache
Documentation
// 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 cluster, adding or removing a cache node, or rebooting a node.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Event {
    /// <p>The identifier for the source of the event. For example, if the event occurred at the cluster level, the identifier would be the name of the cluster.</p>
    pub source_identifier: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the origin of this event - a cluster, a parameter group, a security group, etc.</p>
    pub source_type: ::std::option::Option<crate::types::SourceType>,
    /// <p>The text of 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 identifier for the source of the event. For example, if the event occurred at the cluster level, the identifier would be the name of the cluster.</p>
    pub fn source_identifier(&self) -> ::std::option::Option<&str> {
        self.source_identifier.as_deref()
    }
    /// <p>Specifies the origin of this event - a cluster, a parameter group, a security group, etc.</p>
    pub fn source_type(&self) -> ::std::option::Option<&crate::types::SourceType> {
        self.source_type.as_ref()
    }
    /// <p>The text of 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_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) date: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl EventBuilder {
    /// <p>The identifier for the source of the event. For example, if the event occurred at the cluster level, the identifier would be the name of the cluster.</p>
    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
    }
    /// <p>The identifier for the source of the event. For example, if the event occurred at the cluster level, the identifier would be the name of the cluster.</p>
    pub fn set_source_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_identifier = input;
        self
    }
    /// <p>The identifier for the source of the event. For example, if the event occurred at the cluster level, the identifier would be the name of the cluster.</p>
    pub fn get_source_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_identifier
    }
    /// <p>Specifies the origin of this event - a cluster, a parameter group, a security group, 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 security group, 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 security group, etc.</p>
    pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
        &self.source_type
    }
    /// <p>The text of 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>The text of the event.</p>
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.message = input;
        self
    }
    /// <p>The text of 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_identifier: self.source_identifier,
            source_type: self.source_type,
            message: self.message,
            date: self.date,
        }
    }
}