aws-sdk-cloudtrail 1.104.0

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

/// <p>A SQL string of criteria about events that you want to collect in an event data store.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Query {
    /// <p>The ID of a query.</p>
    pub query_id: ::std::option::Option<::std::string::String>,
    /// <p>The status of the query. This can be <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code>.</p>
    pub query_status: ::std::option::Option<crate::types::QueryStatus>,
    /// <p>The creation time of a query.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Query {
    /// <p>The ID of a query.</p>
    pub fn query_id(&self) -> ::std::option::Option<&str> {
        self.query_id.as_deref()
    }
    /// <p>The status of the query. This can be <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code>.</p>
    pub fn query_status(&self) -> ::std::option::Option<&crate::types::QueryStatus> {
        self.query_status.as_ref()
    }
    /// <p>The creation time of a query.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
}
impl Query {
    /// Creates a new builder-style object to manufacture [`Query`](crate::types::Query).
    pub fn builder() -> crate::types::builders::QueryBuilder {
        crate::types::builders::QueryBuilder::default()
    }
}

/// A builder for [`Query`](crate::types::Query).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct QueryBuilder {
    pub(crate) query_id: ::std::option::Option<::std::string::String>,
    pub(crate) query_status: ::std::option::Option<crate::types::QueryStatus>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl QueryBuilder {
    /// <p>The ID of a query.</p>
    pub fn query_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of a query.</p>
    pub fn set_query_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_id = input;
        self
    }
    /// <p>The ID of a query.</p>
    pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_id
    }
    /// <p>The status of the query. This can be <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code>.</p>
    pub fn query_status(mut self, input: crate::types::QueryStatus) -> Self {
        self.query_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the query. This can be <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code>.</p>
    pub fn set_query_status(mut self, input: ::std::option::Option<crate::types::QueryStatus>) -> Self {
        self.query_status = input;
        self
    }
    /// <p>The status of the query. This can be <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code>.</p>
    pub fn get_query_status(&self) -> &::std::option::Option<crate::types::QueryStatus> {
        &self.query_status
    }
    /// <p>The creation time of a query.</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The creation time of a query.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The creation time of a query.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// Consumes the builder and constructs a [`Query`](crate::types::Query).
    pub fn build(self) -> crate::types::Query {
        crate::types::Query {
            query_id: self.query_id,
            query_status: self.query_status,
            creation_time: self.creation_time,
        }
    }
}