aws_sdk_cloudtrail/operation/generate_query/_generate_query_input.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 GenerateQueryInput {
6 /// <p>The ARN (or ID suffix of the ARN) of the event data store that you want to query. You can only specify one event data store.</p>
7 pub event_data_stores: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 /// <p>The prompt that you want to use to generate the query. The prompt must be in English. For example prompts, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html#lake-query-generator-examples">Example prompts</a> in the <i>CloudTrail </i> user guide.</p>
9 pub prompt: ::std::option::Option<::std::string::String>,
10}
11impl GenerateQueryInput {
12 /// <p>The ARN (or ID suffix of the ARN) of the event data store that you want to query. You can only specify one event data store.</p>
13 ///
14 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.event_data_stores.is_none()`.
15 pub fn event_data_stores(&self) -> &[::std::string::String] {
16 self.event_data_stores.as_deref().unwrap_or_default()
17 }
18 /// <p>The prompt that you want to use to generate the query. The prompt must be in English. For example prompts, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html#lake-query-generator-examples">Example prompts</a> in the <i>CloudTrail </i> user guide.</p>
19 pub fn prompt(&self) -> ::std::option::Option<&str> {
20 self.prompt.as_deref()
21 }
22}
23impl GenerateQueryInput {
24 /// Creates a new builder-style object to manufacture [`GenerateQueryInput`](crate::operation::generate_query::GenerateQueryInput).
25 pub fn builder() -> crate::operation::generate_query::builders::GenerateQueryInputBuilder {
26 crate::operation::generate_query::builders::GenerateQueryInputBuilder::default()
27 }
28}
29
30/// A builder for [`GenerateQueryInput`](crate::operation::generate_query::GenerateQueryInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct GenerateQueryInputBuilder {
34 pub(crate) event_data_stores: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
35 pub(crate) prompt: ::std::option::Option<::std::string::String>,
36}
37impl GenerateQueryInputBuilder {
38 /// Appends an item to `event_data_stores`.
39 ///
40 /// To override the contents of this collection use [`set_event_data_stores`](Self::set_event_data_stores).
41 ///
42 /// <p>The ARN (or ID suffix of the ARN) of the event data store that you want to query. You can only specify one event data store.</p>
43 pub fn event_data_stores(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
44 let mut v = self.event_data_stores.unwrap_or_default();
45 v.push(input.into());
46 self.event_data_stores = ::std::option::Option::Some(v);
47 self
48 }
49 /// <p>The ARN (or ID suffix of the ARN) of the event data store that you want to query. You can only specify one event data store.</p>
50 pub fn set_event_data_stores(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
51 self.event_data_stores = input;
52 self
53 }
54 /// <p>The ARN (or ID suffix of the ARN) of the event data store that you want to query. You can only specify one event data store.</p>
55 pub fn get_event_data_stores(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
56 &self.event_data_stores
57 }
58 /// <p>The prompt that you want to use to generate the query. The prompt must be in English. For example prompts, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html#lake-query-generator-examples">Example prompts</a> in the <i>CloudTrail </i> user guide.</p>
59 /// This field is required.
60 pub fn prompt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.prompt = ::std::option::Option::Some(input.into());
62 self
63 }
64 /// <p>The prompt that you want to use to generate the query. The prompt must be in English. For example prompts, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html#lake-query-generator-examples">Example prompts</a> in the <i>CloudTrail </i> user guide.</p>
65 pub fn set_prompt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.prompt = input;
67 self
68 }
69 /// <p>The prompt that you want to use to generate the query. The prompt must be in English. For example prompts, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html#lake-query-generator-examples">Example prompts</a> in the <i>CloudTrail </i> user guide.</p>
70 pub fn get_prompt(&self) -> &::std::option::Option<::std::string::String> {
71 &self.prompt
72 }
73 /// Consumes the builder and constructs a [`GenerateQueryInput`](crate::operation::generate_query::GenerateQueryInput).
74 pub fn build(
75 self,
76 ) -> ::std::result::Result<crate::operation::generate_query::GenerateQueryInput, ::aws_smithy_types::error::operation::BuildError> {
77 ::std::result::Result::Ok(crate::operation::generate_query::GenerateQueryInput {
78 event_data_stores: self.event_data_stores,
79 prompt: self.prompt,
80 })
81 }
82}