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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CancelQueryOutput {
    /// <p>The ID of the canceled query.</p>
    pub query_id: ::std::string::String,
    /// <p>Shows the status of a query after a <code>CancelQuery</code> request. Typically, the values shown are either <code>RUNNING</code> or <code>CANCELLED</code>.</p>
    pub query_status: crate::types::QueryStatus,
    /// <p>The account ID of the event data store owner.</p>
    pub event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CancelQueryOutput {
    /// <p>The ID of the canceled query.</p>
    pub fn query_id(&self) -> &str {
        use std::ops::Deref;
        self.query_id.deref()
    }
    /// <p>Shows the status of a query after a <code>CancelQuery</code> request. Typically, the values shown are either <code>RUNNING</code> or <code>CANCELLED</code>.</p>
    pub fn query_status(&self) -> &crate::types::QueryStatus {
        &self.query_status
    }
    /// <p>The account ID of the event data store owner.</p>
    pub fn event_data_store_owner_account_id(&self) -> ::std::option::Option<&str> {
        self.event_data_store_owner_account_id.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for CancelQueryOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CancelQueryOutput {
    /// Creates a new builder-style object to manufacture [`CancelQueryOutput`](crate::operation::cancel_query::CancelQueryOutput).
    pub fn builder() -> crate::operation::cancel_query::builders::CancelQueryOutputBuilder {
        crate::operation::cancel_query::builders::CancelQueryOutputBuilder::default()
    }
}

/// A builder for [`CancelQueryOutput`](crate::operation::cancel_query::CancelQueryOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CancelQueryOutputBuilder {
    pub(crate) query_id: ::std::option::Option<::std::string::String>,
    pub(crate) query_status: ::std::option::Option<crate::types::QueryStatus>,
    pub(crate) event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CancelQueryOutputBuilder {
    /// <p>The ID of the canceled query.</p>
    /// This field is required.
    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 the canceled 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 the canceled query.</p>
    pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_id
    }
    /// <p>Shows the status of a query after a <code>CancelQuery</code> request. Typically, the values shown are either <code>RUNNING</code> or <code>CANCELLED</code>.</p>
    /// This field is required.
    pub fn query_status(mut self, input: crate::types::QueryStatus) -> Self {
        self.query_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Shows the status of a query after a <code>CancelQuery</code> request. Typically, the values shown are either <code>RUNNING</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>Shows the status of a query after a <code>CancelQuery</code> request. Typically, the values shown are either <code>RUNNING</code> or <code>CANCELLED</code>.</p>
    pub fn get_query_status(&self) -> &::std::option::Option<crate::types::QueryStatus> {
        &self.query_status
    }
    /// <p>The account ID of the event data store owner.</p>
    pub fn event_data_store_owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.event_data_store_owner_account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The account ID of the event data store owner.</p>
    pub fn set_event_data_store_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.event_data_store_owner_account_id = input;
        self
    }
    /// <p>The account ID of the event data store owner.</p>
    pub fn get_event_data_store_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.event_data_store_owner_account_id
    }
    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 [`CancelQueryOutput`](crate::operation::cancel_query::CancelQueryOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`query_id`](crate::operation::cancel_query::builders::CancelQueryOutputBuilder::query_id)
    /// - [`query_status`](crate::operation::cancel_query::builders::CancelQueryOutputBuilder::query_status)
    pub fn build(self) -> ::std::result::Result<crate::operation::cancel_query::CancelQueryOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::cancel_query::CancelQueryOutput {
            query_id: self.query_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "query_id",
                    "query_id was not specified but it is required when building CancelQueryOutput",
                )
            })?,
            query_status: self.query_status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "query_status",
                    "query_status was not specified but it is required when building CancelQueryOutput",
                )
            })?,
            event_data_store_owner_account_id: self.event_data_store_owner_account_id,
            _request_id: self._request_id,
        })
    }
}