aws_sdk_cloudtrail/operation/start_query/
_start_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 StartQueryInput {
6    /// <p>The SQL code of your query.</p>
7    pub query_statement: ::std::option::Option<::std::string::String>,
8    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
9    pub delivery_s3_uri: ::std::option::Option<::std::string::String>,
10    /// <p>The alias that identifies a query template.</p>
11    pub query_alias: ::std::option::Option<::std::string::String>,
12    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
13    pub query_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14    /// <p>The account ID of the event data store owner.</p>
15    pub event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
16}
17impl StartQueryInput {
18    /// <p>The SQL code of your query.</p>
19    pub fn query_statement(&self) -> ::std::option::Option<&str> {
20        self.query_statement.as_deref()
21    }
22    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
23    pub fn delivery_s3_uri(&self) -> ::std::option::Option<&str> {
24        self.delivery_s3_uri.as_deref()
25    }
26    /// <p>The alias that identifies a query template.</p>
27    pub fn query_alias(&self) -> ::std::option::Option<&str> {
28        self.query_alias.as_deref()
29    }
30    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.query_parameters.is_none()`.
33    pub fn query_parameters(&self) -> &[::std::string::String] {
34        self.query_parameters.as_deref().unwrap_or_default()
35    }
36    /// <p>The account ID of the event data store owner.</p>
37    pub fn event_data_store_owner_account_id(&self) -> ::std::option::Option<&str> {
38        self.event_data_store_owner_account_id.as_deref()
39    }
40}
41impl StartQueryInput {
42    /// Creates a new builder-style object to manufacture [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
43    pub fn builder() -> crate::operation::start_query::builders::StartQueryInputBuilder {
44        crate::operation::start_query::builders::StartQueryInputBuilder::default()
45    }
46}
47
48/// A builder for [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct StartQueryInputBuilder {
52    pub(crate) query_statement: ::std::option::Option<::std::string::String>,
53    pub(crate) delivery_s3_uri: ::std::option::Option<::std::string::String>,
54    pub(crate) query_alias: ::std::option::Option<::std::string::String>,
55    pub(crate) query_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
56    pub(crate) event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
57}
58impl StartQueryInputBuilder {
59    /// <p>The SQL code of your query.</p>
60    pub fn query_statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.query_statement = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The SQL code of your query.</p>
65    pub fn set_query_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.query_statement = input;
67        self
68    }
69    /// <p>The SQL code of your query.</p>
70    pub fn get_query_statement(&self) -> &::std::option::Option<::std::string::String> {
71        &self.query_statement
72    }
73    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
74    pub fn delivery_s3_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.delivery_s3_uri = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
79    pub fn set_delivery_s3_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.delivery_s3_uri = input;
81        self
82    }
83    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
84    pub fn get_delivery_s3_uri(&self) -> &::std::option::Option<::std::string::String> {
85        &self.delivery_s3_uri
86    }
87    /// <p>The alias that identifies a query template.</p>
88    pub fn query_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.query_alias = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The alias that identifies a query template.</p>
93    pub fn set_query_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.query_alias = input;
95        self
96    }
97    /// <p>The alias that identifies a query template.</p>
98    pub fn get_query_alias(&self) -> &::std::option::Option<::std::string::String> {
99        &self.query_alias
100    }
101    /// Appends an item to `query_parameters`.
102    ///
103    /// To override the contents of this collection use [`set_query_parameters`](Self::set_query_parameters).
104    ///
105    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
106    pub fn query_parameters(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        let mut v = self.query_parameters.unwrap_or_default();
108        v.push(input.into());
109        self.query_parameters = ::std::option::Option::Some(v);
110        self
111    }
112    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
113    pub fn set_query_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
114        self.query_parameters = input;
115        self
116    }
117    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
118    pub fn get_query_parameters(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
119        &self.query_parameters
120    }
121    /// <p>The account ID of the event data store owner.</p>
122    pub fn event_data_store_owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.event_data_store_owner_account_id = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>The account ID of the event data store owner.</p>
127    pub fn set_event_data_store_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.event_data_store_owner_account_id = input;
129        self
130    }
131    /// <p>The account ID of the event data store owner.</p>
132    pub fn get_event_data_store_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
133        &self.event_data_store_owner_account_id
134    }
135    /// Consumes the builder and constructs a [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
136    pub fn build(self) -> ::std::result::Result<crate::operation::start_query::StartQueryInput, ::aws_smithy_types::error::operation::BuildError> {
137        ::std::result::Result::Ok(crate::operation::start_query::StartQueryInput {
138            query_statement: self.query_statement,
139            delivery_s3_uri: self.delivery_s3_uri,
140            query_alias: self.query_alias,
141            query_parameters: self.query_parameters,
142            event_data_store_owner_account_id: self.event_data_store_owner_account_id,
143        })
144    }
145}