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 GenerateQueryInput {
    /// <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>
    pub event_data_stores: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <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>
    pub prompt: ::std::option::Option<::std::string::String>,
}
impl GenerateQueryInput {
    /// <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>
    ///
    /// 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()`.
    pub fn event_data_stores(&self) -> &[::std::string::String] {
        self.event_data_stores.as_deref().unwrap_or_default()
    }
    /// <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>
    pub fn prompt(&self) -> ::std::option::Option<&str> {
        self.prompt.as_deref()
    }
}
impl GenerateQueryInput {
    /// Creates a new builder-style object to manufacture [`GenerateQueryInput`](crate::operation::generate_query::GenerateQueryInput).
    pub fn builder() -> crate::operation::generate_query::builders::GenerateQueryInputBuilder {
        crate::operation::generate_query::builders::GenerateQueryInputBuilder::default()
    }
}

/// A builder for [`GenerateQueryInput`](crate::operation::generate_query::GenerateQueryInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GenerateQueryInputBuilder {
    pub(crate) event_data_stores: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) prompt: ::std::option::Option<::std::string::String>,
}
impl GenerateQueryInputBuilder {
    /// Appends an item to `event_data_stores`.
    ///
    /// To override the contents of this collection use [`set_event_data_stores`](Self::set_event_data_stores).
    ///
    /// <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>
    pub fn event_data_stores(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.event_data_stores.unwrap_or_default();
        v.push(input.into());
        self.event_data_stores = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    pub fn set_event_data_stores(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.event_data_stores = input;
        self
    }
    /// <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>
    pub fn get_event_data_stores(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.event_data_stores
    }
    /// <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>
    /// This field is required.
    pub fn prompt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.prompt = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_prompt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.prompt = input;
        self
    }
    /// <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>
    pub fn get_prompt(&self) -> &::std::option::Option<::std::string::String> {
        &self.prompt
    }
    /// Consumes the builder and constructs a [`GenerateQueryInput`](crate::operation::generate_query::GenerateQueryInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::generate_query::GenerateQueryInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::generate_query::GenerateQueryInput {
            event_data_stores: self.event_data_stores,
            prompt: self.prompt,
        })
    }
}