aws-sdk-cloudwatchlogs 0.25.1

AWS SDK for Amazon CloudWatch Logs
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetQueryResultsOutput {
    /// <p>The log events that matched the query criteria during the most recent time it ran.</p>
    /// <p>The <code>results</code> value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array of <code>field</code>/<code>value</code> pairs.</p>
    #[doc(hidden)]
    pub results: std::option::Option<std::vec::Vec<std::vec::Vec<crate::types::ResultField>>>,
    /// <p>Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the log events that were scanned. These values reflect the full raw results of the query.</p>
    #[doc(hidden)]
    pub statistics: std::option::Option<crate::types::QueryStatistics>,
    /// <p>The status of the most recent running of the query. Possible values are <code>Cancelled</code>, <code>Complete</code>, <code>Failed</code>, <code>Running</code>, <code>Scheduled</code>, <code>Timeout</code>, and <code>Unknown</code>.</p>
    /// <p>Queries time out after 15 minutes of runtime. To avoid having your queries time out, reduce the time range being searched or partition your query into a number of queries.</p>
    #[doc(hidden)]
    pub status: std::option::Option<crate::types::QueryStatus>,
    _request_id: Option<String>,
}
impl GetQueryResultsOutput {
    /// <p>The log events that matched the query criteria during the most recent time it ran.</p>
    /// <p>The <code>results</code> value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array of <code>field</code>/<code>value</code> pairs.</p>
    pub fn results(&self) -> std::option::Option<&[std::vec::Vec<crate::types::ResultField>]> {
        self.results.as_deref()
    }
    /// <p>Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the log events that were scanned. These values reflect the full raw results of the query.</p>
    pub fn statistics(&self) -> std::option::Option<&crate::types::QueryStatistics> {
        self.statistics.as_ref()
    }
    /// <p>The status of the most recent running of the query. Possible values are <code>Cancelled</code>, <code>Complete</code>, <code>Failed</code>, <code>Running</code>, <code>Scheduled</code>, <code>Timeout</code>, and <code>Unknown</code>.</p>
    /// <p>Queries time out after 15 minutes of runtime. To avoid having your queries time out, reduce the time range being searched or partition your query into a number of queries.</p>
    pub fn status(&self) -> std::option::Option<&crate::types::QueryStatus> {
        self.status.as_ref()
    }
}
impl aws_http::request_id::RequestId for GetQueryResultsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetQueryResultsOutput {
    /// Creates a new builder-style object to manufacture [`GetQueryResultsOutput`](crate::operation::get_query_results::GetQueryResultsOutput).
    pub fn builder() -> crate::operation::get_query_results::builders::GetQueryResultsOutputBuilder
    {
        crate::operation::get_query_results::builders::GetQueryResultsOutputBuilder::default()
    }
}

/// A builder for [`GetQueryResultsOutput`](crate::operation::get_query_results::GetQueryResultsOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct GetQueryResultsOutputBuilder {
    pub(crate) results:
        std::option::Option<std::vec::Vec<std::vec::Vec<crate::types::ResultField>>>,
    pub(crate) statistics: std::option::Option<crate::types::QueryStatistics>,
    pub(crate) status: std::option::Option<crate::types::QueryStatus>,
    _request_id: Option<String>,
}
impl GetQueryResultsOutputBuilder {
    /// Appends an item to `results`.
    ///
    /// To override the contents of this collection use [`set_results`](Self::set_results).
    ///
    /// <p>The log events that matched the query criteria during the most recent time it ran.</p>
    /// <p>The <code>results</code> value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array of <code>field</code>/<code>value</code> pairs.</p>
    pub fn results(mut self, input: std::vec::Vec<crate::types::ResultField>) -> Self {
        let mut v = self.results.unwrap_or_default();
        v.push(input);
        self.results = Some(v);
        self
    }
    /// <p>The log events that matched the query criteria during the most recent time it ran.</p>
    /// <p>The <code>results</code> value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array of <code>field</code>/<code>value</code> pairs.</p>
    pub fn set_results(
        mut self,
        input: std::option::Option<std::vec::Vec<std::vec::Vec<crate::types::ResultField>>>,
    ) -> Self {
        self.results = input;
        self
    }
    /// <p>Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the log events that were scanned. These values reflect the full raw results of the query.</p>
    pub fn statistics(mut self, input: crate::types::QueryStatistics) -> Self {
        self.statistics = Some(input);
        self
    }
    /// <p>Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the log events that were scanned. These values reflect the full raw results of the query.</p>
    pub fn set_statistics(
        mut self,
        input: std::option::Option<crate::types::QueryStatistics>,
    ) -> Self {
        self.statistics = input;
        self
    }
    /// <p>The status of the most recent running of the query. Possible values are <code>Cancelled</code>, <code>Complete</code>, <code>Failed</code>, <code>Running</code>, <code>Scheduled</code>, <code>Timeout</code>, and <code>Unknown</code>.</p>
    /// <p>Queries time out after 15 minutes of runtime. To avoid having your queries time out, reduce the time range being searched or partition your query into a number of queries.</p>
    pub fn status(mut self, input: crate::types::QueryStatus) -> Self {
        self.status = Some(input);
        self
    }
    /// <p>The status of the most recent running of the query. Possible values are <code>Cancelled</code>, <code>Complete</code>, <code>Failed</code>, <code>Running</code>, <code>Scheduled</code>, <code>Timeout</code>, and <code>Unknown</code>.</p>
    /// <p>Queries time out after 15 minutes of runtime. To avoid having your queries time out, reduce the time range being searched or partition your query into a number of queries.</p>
    pub fn set_status(mut self, input: std::option::Option<crate::types::QueryStatus>) -> Self {
        self.status = input;
        self
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetQueryResultsOutput`](crate::operation::get_query_results::GetQueryResultsOutput).
    pub fn build(self) -> crate::operation::get_query_results::GetQueryResultsOutput {
        crate::operation::get_query_results::GetQueryResultsOutput {
            results: self.results,
            statistics: self.statistics,
            status: self.status,
            _request_id: self._request_id,
        }
    }
}