aws-sdk-redshift 1.106.0

AWS SDK for Amazon Redshift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes an event.</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.</p>
    pub source_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The source type for this event.</p>
    pub source_type: ::std::option::Option<crate::types::SourceType>,
    /// <p>The text of this event.</p>
    pub message: ::std::option::Option<::std::string::String>,
    /// <p>A list of the event categories.</p>
    /// <p>Values: Configuration, Management, Monitoring, Security, Pending</p>
    pub event_categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The severity of the event.</p>
    /// <p>Values: ERROR, INFO</p>
    pub severity: ::std::option::Option<::std::string::String>,
    /// <p>The date and time of the event.</p>
    pub date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The identifier of the event.</p>
    pub event_id: ::std::option::Option<::std::string::String>,
}
impl Event {
    /// <p>The identifier for the source of the event.</p>
    pub fn source_identifier(&self) -> ::std::option::Option<&str> {
        self.source_identifier.as_deref()
    }
    /// <p>The source type for this event.</p>
    pub fn source_type(&self) -> ::std::option::Option<&crate::types::SourceType> {
        self.source_type.as_ref()
    }
    /// <p>The text of this event.</p>
    pub fn message(&self) -> ::std::option::Option<&str> {
        self.message.as_deref()
    }
    /// <p>A list of the event categories.</p>
    /// <p>Values: Configuration, Management, Monitoring, Security, Pending</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.event_categories.is_none()`.
    pub fn event_categories(&self) -> &[::std::string::String] {
        self.event_categories.as_deref().unwrap_or_default()
    }
    /// <p>The severity of the event.</p>
    /// <p>Values: ERROR, INFO</p>
    pub fn severity(&self) -> ::std::option::Option<&str> {
        self.severity.as_deref()
    }
    /// <p>The date and time of the event.</p>
    pub fn date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.date.as_ref()
    }
    /// <p>The identifier of the event.</p>
    pub fn event_id(&self) -> ::std::option::Option<&str> {
        self.event_id.as_deref()
    }
}
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) 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 {
    /// <p>The identifier for the source of the event.</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.</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.</p>
    pub fn get_source_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_identifier
    }
    /// <p>The source type for this event.</p>
    pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
        self.source_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source type for this event.</p>
    pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
        self.source_type = input;
        self
    }
    /// <p>The source type for this event.</p>
    pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
        &self.source_type
    }
    /// <p>The text of this 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 this event.</p>
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.message = input;
        self
    }
    /// <p>The text of this event.</p>
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.message
    }
    /// Appends an item to `event_categories`.
    ///
    /// To override the contents of this collection use [`set_event_categories`](Self::set_event_categories).
    ///
    /// <p>A list of the event categories.</p>
    /// <p>Values: Configuration, Management, Monitoring, Security, Pending</p>
    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
    }
    /// <p>A list of the event categories.</p>
    /// <p>Values: Configuration, Management, Monitoring, Security, Pending</p>
    pub fn set_event_categories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.event_categories = input;
        self
    }
    /// <p>A list of the event categories.</p>
    /// <p>Values: Configuration, Management, Monitoring, Security, Pending</p>
    pub fn get_event_categories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.event_categories
    }
    /// <p>The severity of the event.</p>
    /// <p>Values: ERROR, INFO</p>
    pub fn severity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.severity = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The severity of the event.</p>
    /// <p>Values: ERROR, INFO</p>
    pub fn set_severity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.severity = input;
        self
    }
    /// <p>The severity of the event.</p>
    /// <p>Values: ERROR, INFO</p>
    pub fn get_severity(&self) -> &::std::option::Option<::std::string::String> {
        &self.severity
    }
    /// <p>The date and time of the event.</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 of the event.</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 of the event.</p>
    pub fn get_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.date
    }
    /// <p>The identifier of the event.</p>
    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
    }
    /// <p>The identifier of the event.</p>
    pub fn set_event_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.event_id = input;
        self
    }
    /// <p>The identifier of the event.</p>
    pub fn get_event_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.event_id
    }
    /// 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,
            event_categories: self.event_categories,
            severity: self.severity,
            date: self.date,
            event_id: self.event_id,
        }
    }
}