aws-sdk-devopsguru 1.98.0

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

/// <p>An Amazon Web Services resource event. Amazon Web Services resource events and metrics are analyzed by DevOps Guru to find anomalous behavior and provide recommendations to improve your operational solutions.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Event {
    /// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
    pub resource_collection: ::std::option::Option<crate::types::ResourceCollection>,
    /// <p>The ID of the event.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
    pub time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Amazon Web Services source that emitted the event.</p>
    pub event_source: ::std::option::Option<::std::string::String>,
    /// <p>The name of the event.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
    pub data_source: ::std::option::Option<crate::types::EventDataSource>,
    /// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
    pub event_class: ::std::option::Option<crate::types::EventClass>,
    /// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</p>
    pub resources: ::std::option::Option<::std::vec::Vec<crate::types::EventResource>>,
}
impl Event {
    /// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
    pub fn resource_collection(&self) -> ::std::option::Option<&crate::types::ResourceCollection> {
        self.resource_collection.as_ref()
    }
    /// <p>The ID of the event.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
    pub fn time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.time.as_ref()
    }
    /// <p>The Amazon Web Services source that emitted the event.</p>
    pub fn event_source(&self) -> ::std::option::Option<&str> {
        self.event_source.as_deref()
    }
    /// <p>The name of the event.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
    pub fn data_source(&self) -> ::std::option::Option<&crate::types::EventDataSource> {
        self.data_source.as_ref()
    }
    /// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
    pub fn event_class(&self) -> ::std::option::Option<&crate::types::EventClass> {
        self.event_class.as_ref()
    }
    /// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</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 `.resources.is_none()`.
    pub fn resources(&self) -> &[crate::types::EventResource] {
        self.resources.as_deref().unwrap_or_default()
    }
}
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) resource_collection: ::std::option::Option<crate::types::ResourceCollection>,
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) event_source: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) data_source: ::std::option::Option<crate::types::EventDataSource>,
    pub(crate) event_class: ::std::option::Option<crate::types::EventClass>,
    pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::EventResource>>,
}
impl EventBuilder {
    /// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
    pub fn resource_collection(mut self, input: crate::types::ResourceCollection) -> Self {
        self.resource_collection = ::std::option::Option::Some(input);
        self
    }
    /// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
    pub fn set_resource_collection(mut self, input: ::std::option::Option<crate::types::ResourceCollection>) -> Self {
        self.resource_collection = input;
        self
    }
    /// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
    pub fn get_resource_collection(&self) -> &::std::option::Option<crate::types::ResourceCollection> {
        &self.resource_collection
    }
    /// <p>The ID of the event.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the event.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The ID of the event.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
    pub fn time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.time = ::std::option::Option::Some(input);
        self
    }
    /// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
    pub fn set_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.time = input;
        self
    }
    /// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
    pub fn get_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.time
    }
    /// <p>The Amazon Web Services source that emitted the event.</p>
    pub fn event_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.event_source = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services source that emitted the event.</p>
    pub fn set_event_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.event_source = input;
        self
    }
    /// <p>The Amazon Web Services source that emitted the event.</p>
    pub fn get_event_source(&self) -> &::std::option::Option<::std::string::String> {
        &self.event_source
    }
    /// <p>The name of the event.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the event.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the event.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
    pub fn data_source(mut self, input: crate::types::EventDataSource) -> Self {
        self.data_source = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
    pub fn set_data_source(mut self, input: ::std::option::Option<crate::types::EventDataSource>) -> Self {
        self.data_source = input;
        self
    }
    /// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
    pub fn get_data_source(&self) -> &::std::option::Option<crate::types::EventDataSource> {
        &self.data_source
    }
    /// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
    pub fn event_class(mut self, input: crate::types::EventClass) -> Self {
        self.event_class = ::std::option::Option::Some(input);
        self
    }
    /// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
    pub fn set_event_class(mut self, input: ::std::option::Option<crate::types::EventClass>) -> Self {
        self.event_class = input;
        self
    }
    /// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
    pub fn get_event_class(&self) -> &::std::option::Option<crate::types::EventClass> {
        &self.event_class
    }
    /// Appends an item to `resources`.
    ///
    /// To override the contents of this collection use [`set_resources`](Self::set_resources).
    ///
    /// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</p>
    pub fn resources(mut self, input: crate::types::EventResource) -> Self {
        let mut v = self.resources.unwrap_or_default();
        v.push(input);
        self.resources = ::std::option::Option::Some(v);
        self
    }
    /// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</p>
    pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EventResource>>) -> Self {
        self.resources = input;
        self
    }
    /// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</p>
    pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EventResource>> {
        &self.resources
    }
    /// Consumes the builder and constructs a [`Event`](crate::types::Event).
    pub fn build(self) -> crate::types::Event {
        crate::types::Event {
            resource_collection: self.resource_collection,
            id: self.id,
            time: self.time,
            event_source: self.event_source,
            name: self.name,
            data_source: self.data_source,
            event_class: self.event_class,
            resources: self.resources,
        }
    }
}