aws_sdk_cloudtrail/operation/describe_query/
_describe_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 DescribeQueryOutput {
6    /// <p>The ID of the query.</p>
7    pub query_id: ::std::option::Option<::std::string::String>,
8    /// <p>The SQL code of a query.</p>
9    pub query_string: ::std::option::Option<::std::string::String>,
10    /// <p>The status of a query. Values for <code>QueryStatus</code> include <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code></p>
11    pub query_status: ::std::option::Option<crate::types::QueryStatus>,
12    /// <p>Metadata about a query, including the number of events that were matched, the total number of events scanned, the query run time in milliseconds, and the query's creation time.</p>
13    pub query_statistics: ::std::option::Option<crate::types::QueryStatisticsForDescribeQuery>,
14    /// <p>The error message returned if a query failed.</p>
15    pub error_message: ::std::option::Option<::std::string::String>,
16    /// <p>The URI for the S3 bucket where CloudTrail delivered query results, if applicable.</p>
17    pub delivery_s3_uri: ::std::option::Option<::std::string::String>,
18    /// <p>The delivery status.</p>
19    pub delivery_status: ::std::option::Option<crate::types::DeliveryStatus>,
20    /// <p>The prompt used for a generated query. For information about generated queries, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html">Create CloudTrail Lake queries from natural language prompts</a> in the <i>CloudTrail </i> user guide.</p>
21    pub prompt: ::std::option::Option<::std::string::String>,
22    /// <p>The account ID of the event data store owner.</p>
23    pub event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
24    _request_id: Option<String>,
25}
26impl DescribeQueryOutput {
27    /// <p>The ID of the query.</p>
28    pub fn query_id(&self) -> ::std::option::Option<&str> {
29        self.query_id.as_deref()
30    }
31    /// <p>The SQL code of a query.</p>
32    pub fn query_string(&self) -> ::std::option::Option<&str> {
33        self.query_string.as_deref()
34    }
35    /// <p>The status of a query. Values for <code>QueryStatus</code> include <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code></p>
36    pub fn query_status(&self) -> ::std::option::Option<&crate::types::QueryStatus> {
37        self.query_status.as_ref()
38    }
39    /// <p>Metadata about a query, including the number of events that were matched, the total number of events scanned, the query run time in milliseconds, and the query's creation time.</p>
40    pub fn query_statistics(&self) -> ::std::option::Option<&crate::types::QueryStatisticsForDescribeQuery> {
41        self.query_statistics.as_ref()
42    }
43    /// <p>The error message returned if a query failed.</p>
44    pub fn error_message(&self) -> ::std::option::Option<&str> {
45        self.error_message.as_deref()
46    }
47    /// <p>The URI for the S3 bucket where CloudTrail delivered query results, if applicable.</p>
48    pub fn delivery_s3_uri(&self) -> ::std::option::Option<&str> {
49        self.delivery_s3_uri.as_deref()
50    }
51    /// <p>The delivery status.</p>
52    pub fn delivery_status(&self) -> ::std::option::Option<&crate::types::DeliveryStatus> {
53        self.delivery_status.as_ref()
54    }
55    /// <p>The prompt used for a generated query. For information about generated queries, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html">Create CloudTrail Lake queries from natural language prompts</a> in the <i>CloudTrail </i> user guide.</p>
56    pub fn prompt(&self) -> ::std::option::Option<&str> {
57        self.prompt.as_deref()
58    }
59    /// <p>The account ID of the event data store owner.</p>
60    pub fn event_data_store_owner_account_id(&self) -> ::std::option::Option<&str> {
61        self.event_data_store_owner_account_id.as_deref()
62    }
63}
64impl ::aws_types::request_id::RequestId for DescribeQueryOutput {
65    fn request_id(&self) -> Option<&str> {
66        self._request_id.as_deref()
67    }
68}
69impl DescribeQueryOutput {
70    /// Creates a new builder-style object to manufacture [`DescribeQueryOutput`](crate::operation::describe_query::DescribeQueryOutput).
71    pub fn builder() -> crate::operation::describe_query::builders::DescribeQueryOutputBuilder {
72        crate::operation::describe_query::builders::DescribeQueryOutputBuilder::default()
73    }
74}
75
76/// A builder for [`DescribeQueryOutput`](crate::operation::describe_query::DescribeQueryOutput).
77#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
78#[non_exhaustive]
79pub struct DescribeQueryOutputBuilder {
80    pub(crate) query_id: ::std::option::Option<::std::string::String>,
81    pub(crate) query_string: ::std::option::Option<::std::string::String>,
82    pub(crate) query_status: ::std::option::Option<crate::types::QueryStatus>,
83    pub(crate) query_statistics: ::std::option::Option<crate::types::QueryStatisticsForDescribeQuery>,
84    pub(crate) error_message: ::std::option::Option<::std::string::String>,
85    pub(crate) delivery_s3_uri: ::std::option::Option<::std::string::String>,
86    pub(crate) delivery_status: ::std::option::Option<crate::types::DeliveryStatus>,
87    pub(crate) prompt: ::std::option::Option<::std::string::String>,
88    pub(crate) event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
89    _request_id: Option<String>,
90}
91impl DescribeQueryOutputBuilder {
92    /// <p>The ID of the query.</p>
93    pub fn query_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.query_id = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The ID of the query.</p>
98    pub fn set_query_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.query_id = input;
100        self
101    }
102    /// <p>The ID of the query.</p>
103    pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
104        &self.query_id
105    }
106    /// <p>The SQL code of a query.</p>
107    pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.query_string = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>The SQL code of a query.</p>
112    pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.query_string = input;
114        self
115    }
116    /// <p>The SQL code of a query.</p>
117    pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
118        &self.query_string
119    }
120    /// <p>The status of a query. Values for <code>QueryStatus</code> include <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code></p>
121    pub fn query_status(mut self, input: crate::types::QueryStatus) -> Self {
122        self.query_status = ::std::option::Option::Some(input);
123        self
124    }
125    /// <p>The status of a query. Values for <code>QueryStatus</code> include <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code></p>
126    pub fn set_query_status(mut self, input: ::std::option::Option<crate::types::QueryStatus>) -> Self {
127        self.query_status = input;
128        self
129    }
130    /// <p>The status of a query. Values for <code>QueryStatus</code> include <code>QUEUED</code>, <code>RUNNING</code>, <code>FINISHED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>CANCELLED</code></p>
131    pub fn get_query_status(&self) -> &::std::option::Option<crate::types::QueryStatus> {
132        &self.query_status
133    }
134    /// <p>Metadata about a query, including the number of events that were matched, the total number of events scanned, the query run time in milliseconds, and the query's creation time.</p>
135    pub fn query_statistics(mut self, input: crate::types::QueryStatisticsForDescribeQuery) -> Self {
136        self.query_statistics = ::std::option::Option::Some(input);
137        self
138    }
139    /// <p>Metadata about a query, including the number of events that were matched, the total number of events scanned, the query run time in milliseconds, and the query's creation time.</p>
140    pub fn set_query_statistics(mut self, input: ::std::option::Option<crate::types::QueryStatisticsForDescribeQuery>) -> Self {
141        self.query_statistics = input;
142        self
143    }
144    /// <p>Metadata about a query, including the number of events that were matched, the total number of events scanned, the query run time in milliseconds, and the query's creation time.</p>
145    pub fn get_query_statistics(&self) -> &::std::option::Option<crate::types::QueryStatisticsForDescribeQuery> {
146        &self.query_statistics
147    }
148    /// <p>The error message returned if a query failed.</p>
149    pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.error_message = ::std::option::Option::Some(input.into());
151        self
152    }
153    /// <p>The error message returned if a query failed.</p>
154    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.error_message = input;
156        self
157    }
158    /// <p>The error message returned if a query failed.</p>
159    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
160        &self.error_message
161    }
162    /// <p>The URI for the S3 bucket where CloudTrail delivered query results, if applicable.</p>
163    pub fn delivery_s3_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.delivery_s3_uri = ::std::option::Option::Some(input.into());
165        self
166    }
167    /// <p>The URI for the S3 bucket where CloudTrail delivered query results, if applicable.</p>
168    pub fn set_delivery_s3_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.delivery_s3_uri = input;
170        self
171    }
172    /// <p>The URI for the S3 bucket where CloudTrail delivered query results, if applicable.</p>
173    pub fn get_delivery_s3_uri(&self) -> &::std::option::Option<::std::string::String> {
174        &self.delivery_s3_uri
175    }
176    /// <p>The delivery status.</p>
177    pub fn delivery_status(mut self, input: crate::types::DeliveryStatus) -> Self {
178        self.delivery_status = ::std::option::Option::Some(input);
179        self
180    }
181    /// <p>The delivery status.</p>
182    pub fn set_delivery_status(mut self, input: ::std::option::Option<crate::types::DeliveryStatus>) -> Self {
183        self.delivery_status = input;
184        self
185    }
186    /// <p>The delivery status.</p>
187    pub fn get_delivery_status(&self) -> &::std::option::Option<crate::types::DeliveryStatus> {
188        &self.delivery_status
189    }
190    /// <p>The prompt used for a generated query. For information about generated queries, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html">Create CloudTrail Lake queries from natural language prompts</a> in the <i>CloudTrail </i> user guide.</p>
191    pub fn prompt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.prompt = ::std::option::Option::Some(input.into());
193        self
194    }
195    /// <p>The prompt used for a generated query. For information about generated queries, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html">Create CloudTrail Lake queries from natural language prompts</a> in the <i>CloudTrail </i> user guide.</p>
196    pub fn set_prompt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.prompt = input;
198        self
199    }
200    /// <p>The prompt used for a generated query. For information about generated queries, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html">Create CloudTrail Lake queries from natural language prompts</a> in the <i>CloudTrail </i> user guide.</p>
201    pub fn get_prompt(&self) -> &::std::option::Option<::std::string::String> {
202        &self.prompt
203    }
204    /// <p>The account ID of the event data store owner.</p>
205    pub fn event_data_store_owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.event_data_store_owner_account_id = ::std::option::Option::Some(input.into());
207        self
208    }
209    /// <p>The account ID of the event data store owner.</p>
210    pub fn set_event_data_store_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.event_data_store_owner_account_id = input;
212        self
213    }
214    /// <p>The account ID of the event data store owner.</p>
215    pub fn get_event_data_store_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
216        &self.event_data_store_owner_account_id
217    }
218    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
219        self._request_id = Some(request_id.into());
220        self
221    }
222
223    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
224        self._request_id = request_id;
225        self
226    }
227    /// Consumes the builder and constructs a [`DescribeQueryOutput`](crate::operation::describe_query::DescribeQueryOutput).
228    pub fn build(self) -> crate::operation::describe_query::DescribeQueryOutput {
229        crate::operation::describe_query::DescribeQueryOutput {
230            query_id: self.query_id,
231            query_string: self.query_string,
232            query_status: self.query_status,
233            query_statistics: self.query_statistics,
234            error_message: self.error_message,
235            delivery_s3_uri: self.delivery_s3_uri,
236            delivery_status: self.delivery_status,
237            prompt: self.prompt,
238            event_data_store_owner_account_id: self.event_data_store_owner_account_id,
239            _request_id: self._request_id,
240        }
241    }
242}