aws_sdk_cloudtrail/operation/cancel_query/
_cancel_query_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CancelQueryOutput {
6    /// <p>The ID of the canceled query.</p>
7    pub query_id: ::std::string::String,
8    /// <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>
9    pub query_status: crate::types::QueryStatus,
10    /// <p>The account ID of the event data store owner.</p>
11    pub event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl CancelQueryOutput {
15    /// <p>The ID of the canceled query.</p>
16    pub fn query_id(&self) -> &str {
17        use std::ops::Deref;
18        self.query_id.deref()
19    }
20    /// <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>
21    pub fn query_status(&self) -> &crate::types::QueryStatus {
22        &self.query_status
23    }
24    /// <p>The account ID of the event data store owner.</p>
25    pub fn event_data_store_owner_account_id(&self) -> ::std::option::Option<&str> {
26        self.event_data_store_owner_account_id.as_deref()
27    }
28}
29impl ::aws_types::request_id::RequestId for CancelQueryOutput {
30    fn request_id(&self) -> Option<&str> {
31        self._request_id.as_deref()
32    }
33}
34impl CancelQueryOutput {
35    /// Creates a new builder-style object to manufacture [`CancelQueryOutput`](crate::operation::cancel_query::CancelQueryOutput).
36    pub fn builder() -> crate::operation::cancel_query::builders::CancelQueryOutputBuilder {
37        crate::operation::cancel_query::builders::CancelQueryOutputBuilder::default()
38    }
39}
40
41/// A builder for [`CancelQueryOutput`](crate::operation::cancel_query::CancelQueryOutput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct CancelQueryOutputBuilder {
45    pub(crate) query_id: ::std::option::Option<::std::string::String>,
46    pub(crate) query_status: ::std::option::Option<crate::types::QueryStatus>,
47    pub(crate) event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
48    _request_id: Option<String>,
49}
50impl CancelQueryOutputBuilder {
51    /// <p>The ID of the canceled query.</p>
52    /// This field is required.
53    pub fn query_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.query_id = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The ID of the canceled query.</p>
58    pub fn set_query_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.query_id = input;
60        self
61    }
62    /// <p>The ID of the canceled query.</p>
63    pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
64        &self.query_id
65    }
66    /// <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>
67    /// This field is required.
68    pub fn query_status(mut self, input: crate::types::QueryStatus) -> Self {
69        self.query_status = ::std::option::Option::Some(input);
70        self
71    }
72    /// <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>
73    pub fn set_query_status(mut self, input: ::std::option::Option<crate::types::QueryStatus>) -> Self {
74        self.query_status = input;
75        self
76    }
77    /// <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>
78    pub fn get_query_status(&self) -> &::std::option::Option<crate::types::QueryStatus> {
79        &self.query_status
80    }
81    /// <p>The account ID of the event data store owner.</p>
82    pub fn event_data_store_owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.event_data_store_owner_account_id = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The account ID of the event data store owner.</p>
87    pub fn set_event_data_store_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.event_data_store_owner_account_id = input;
89        self
90    }
91    /// <p>The account ID of the event data store owner.</p>
92    pub fn get_event_data_store_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
93        &self.event_data_store_owner_account_id
94    }
95    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
96        self._request_id = Some(request_id.into());
97        self
98    }
99
100    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
101        self._request_id = request_id;
102        self
103    }
104    /// Consumes the builder and constructs a [`CancelQueryOutput`](crate::operation::cancel_query::CancelQueryOutput).
105    /// This method will fail if any of the following fields are not set:
106    /// - [`query_id`](crate::operation::cancel_query::builders::CancelQueryOutputBuilder::query_id)
107    /// - [`query_status`](crate::operation::cancel_query::builders::CancelQueryOutputBuilder::query_status)
108    pub fn build(self) -> ::std::result::Result<crate::operation::cancel_query::CancelQueryOutput, ::aws_smithy_types::error::operation::BuildError> {
109        ::std::result::Result::Ok(crate::operation::cancel_query::CancelQueryOutput {
110            query_id: self.query_id.ok_or_else(|| {
111                ::aws_smithy_types::error::operation::BuildError::missing_field(
112                    "query_id",
113                    "query_id was not specified but it is required when building CancelQueryOutput",
114                )
115            })?,
116            query_status: self.query_status.ok_or_else(|| {
117                ::aws_smithy_types::error::operation::BuildError::missing_field(
118                    "query_status",
119                    "query_status was not specified but it is required when building CancelQueryOutput",
120                )
121            })?,
122            event_data_store_owner_account_id: self.event_data_store_owner_account_id,
123            _request_id: self._request_id,
124        })
125    }
126}