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 StartQueryInput {
    /// <p>The SQL code of your query.</p>
    pub query_statement: ::std::option::Option<::std::string::String>,
    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
    pub delivery_s3_uri: ::std::option::Option<::std::string::String>,
    /// <p>The alias that identifies a query template.</p>
    pub query_alias: ::std::option::Option<::std::string::String>,
    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
    pub query_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The account ID of the event data store owner.</p>
    pub event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
}
impl StartQueryInput {
    /// <p>The SQL code of your query.</p>
    pub fn query_statement(&self) -> ::std::option::Option<&str> {
        self.query_statement.as_deref()
    }
    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
    pub fn delivery_s3_uri(&self) -> ::std::option::Option<&str> {
        self.delivery_s3_uri.as_deref()
    }
    /// <p>The alias that identifies a query template.</p>
    pub fn query_alias(&self) -> ::std::option::Option<&str> {
        self.query_alias.as_deref()
    }
    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
    ///
    /// 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()`.
    pub fn query_parameters(&self) -> &[::std::string::String] {
        self.query_parameters.as_deref().unwrap_or_default()
    }
    /// <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 StartQueryInput {
    /// Creates a new builder-style object to manufacture [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
    pub fn builder() -> crate::operation::start_query::builders::StartQueryInputBuilder {
        crate::operation::start_query::builders::StartQueryInputBuilder::default()
    }
}

/// A builder for [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartQueryInputBuilder {
    pub(crate) query_statement: ::std::option::Option<::std::string::String>,
    pub(crate) delivery_s3_uri: ::std::option::Option<::std::string::String>,
    pub(crate) query_alias: ::std::option::Option<::std::string::String>,
    pub(crate) query_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) event_data_store_owner_account_id: ::std::option::Option<::std::string::String>,
}
impl StartQueryInputBuilder {
    /// <p>The SQL code of your query.</p>
    pub fn query_statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_statement = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The SQL code of your query.</p>
    pub fn set_query_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_statement = input;
        self
    }
    /// <p>The SQL code of your query.</p>
    pub fn get_query_statement(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_statement
    }
    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
    pub fn delivery_s3_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.delivery_s3_uri = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
    pub fn set_delivery_s3_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.delivery_s3_uri = input;
        self
    }
    /// <p>The URI for the S3 bucket where CloudTrail delivers the query results.</p>
    pub fn get_delivery_s3_uri(&self) -> &::std::option::Option<::std::string::String> {
        &self.delivery_s3_uri
    }
    /// <p>The alias that identifies a query template.</p>
    pub fn query_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_alias = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The alias that identifies a query template.</p>
    pub fn set_query_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_alias = input;
        self
    }
    /// <p>The alias that identifies a query template.</p>
    pub fn get_query_alias(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_alias
    }
    /// Appends an item to `query_parameters`.
    ///
    /// To override the contents of this collection use [`set_query_parameters`](Self::set_query_parameters).
    ///
    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
    pub fn query_parameters(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.query_parameters.unwrap_or_default();
        v.push(input.into());
        self.query_parameters = ::std::option::Option::Some(v);
        self
    }
    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
    pub fn set_query_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.query_parameters = input;
        self
    }
    /// <p>The query parameters for the specified <code>QueryAlias</code>.</p>
    pub fn get_query_parameters(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.query_parameters
    }
    /// <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
    }
    /// Consumes the builder and constructs a [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::start_query::StartQueryInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::start_query::StartQueryInput {
            query_statement: self.query_statement,
            delivery_s3_uri: self.delivery_s3_uri,
            query_alias: self.query_alias,
            query_parameters: self.query_parameters,
            event_data_store_owner_account_id: self.event_data_store_owner_account_id,
        })
    }
}