aws-sdk-redshiftdata 1.102.0

AWS SDK for Redshift Data API Service
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 ExecuteStatementInput {
    /// <p>The SQL statement text to run.</p>
    pub sql: ::std::option::Option<::std::string::String>,
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub cluster_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub secret_arn: ::std::option::Option<::std::string::String>,
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub db_user: ::std::option::Option<::std::string::String>,
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub database: ::std::option::Option<::std::string::String>,
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub with_event: ::std::option::Option<bool>,
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub statement_name: ::std::option::Option<::std::string::String>,
    /// <p>The parameters for the SQL statement.</p>
    pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::SqlParameter>>,
    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p>
    pub workgroup_name: ::std::option::Option<::std::string::String>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub result_format: ::std::option::Option<crate::types::ResultFormatString>,
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub session_keep_alive_seconds: ::std::option::Option<i32>,
    /// <p>The session identifier of the query.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
}
impl ExecuteStatementInput {
    /// <p>The SQL statement text to run.</p>
    pub fn sql(&self) -> ::std::option::Option<&str> {
        self.sql.as_deref()
    }
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
        self.cluster_identifier.as_deref()
    }
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub fn secret_arn(&self) -> ::std::option::Option<&str> {
        self.secret_arn.as_deref()
    }
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub fn db_user(&self) -> ::std::option::Option<&str> {
        self.db_user.as_deref()
    }
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn database(&self) -> ::std::option::Option<&str> {
        self.database.as_deref()
    }
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub fn with_event(&self) -> ::std::option::Option<bool> {
        self.with_event
    }
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub fn statement_name(&self) -> ::std::option::Option<&str> {
        self.statement_name.as_deref()
    }
    /// <p>The parameters for the SQL statement.</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 `.parameters.is_none()`.
    pub fn parameters(&self) -> &[crate::types::SqlParameter] {
        self.parameters.as_deref().unwrap_or_default()
    }
    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn workgroup_name(&self) -> ::std::option::Option<&str> {
        self.workgroup_name.as_deref()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub fn result_format(&self) -> ::std::option::Option<&crate::types::ResultFormatString> {
        self.result_format.as_ref()
    }
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub fn session_keep_alive_seconds(&self) -> ::std::option::Option<i32> {
        self.session_keep_alive_seconds
    }
    /// <p>The session identifier of the query.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
}
impl ExecuteStatementInput {
    /// Creates a new builder-style object to manufacture [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
    pub fn builder() -> crate::operation::execute_statement::builders::ExecuteStatementInputBuilder {
        crate::operation::execute_statement::builders::ExecuteStatementInputBuilder::default()
    }
}

/// A builder for [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ExecuteStatementInputBuilder {
    pub(crate) sql: ::std::option::Option<::std::string::String>,
    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) secret_arn: ::std::option::Option<::std::string::String>,
    pub(crate) db_user: ::std::option::Option<::std::string::String>,
    pub(crate) database: ::std::option::Option<::std::string::String>,
    pub(crate) with_event: ::std::option::Option<bool>,
    pub(crate) statement_name: ::std::option::Option<::std::string::String>,
    pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::SqlParameter>>,
    pub(crate) workgroup_name: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) result_format: ::std::option::Option<crate::types::ResultFormatString>,
    pub(crate) session_keep_alive_seconds: ::std::option::Option<i32>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
}
impl ExecuteStatementInputBuilder {
    /// <p>The SQL statement text to run.</p>
    /// This field is required.
    pub fn sql(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sql = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The SQL statement text to run.</p>
    pub fn set_sql(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sql = input;
        self
    }
    /// <p>The SQL statement text to run.</p>
    pub fn get_sql(&self) -> &::std::option::Option<::std::string::String> {
        &self.sql
    }
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_identifier = input;
        self
    }
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_identifier
    }
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub fn secret_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.secret_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub fn set_secret_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.secret_arn = input;
        self
    }
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.secret_arn
    }
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub fn db_user(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.db_user = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub fn set_db_user(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.db_user = input;
        self
    }
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub fn get_db_user(&self) -> &::std::option::Option<::std::string::String> {
        &self.db_user
    }
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.database = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.database = input;
        self
    }
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
        &self.database
    }
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub fn with_event(mut self, input: bool) -> Self {
        self.with_event = ::std::option::Option::Some(input);
        self
    }
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub fn set_with_event(mut self, input: ::std::option::Option<bool>) -> Self {
        self.with_event = input;
        self
    }
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub fn get_with_event(&self) -> &::std::option::Option<bool> {
        &self.with_event
    }
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub fn statement_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.statement_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub fn set_statement_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.statement_name = input;
        self
    }
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub fn get_statement_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.statement_name
    }
    /// Appends an item to `parameters`.
    ///
    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
    ///
    /// <p>The parameters for the SQL statement.</p>
    pub fn parameters(mut self, input: crate::types::SqlParameter) -> Self {
        let mut v = self.parameters.unwrap_or_default();
        v.push(input);
        self.parameters = ::std::option::Option::Some(v);
        self
    }
    /// <p>The parameters for the SQL statement.</p>
    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SqlParameter>>) -> Self {
        self.parameters = input;
        self
    }
    /// <p>The parameters for the SQL statement.</p>
    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SqlParameter>> {
        &self.parameters
    }
    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.workgroup_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.workgroup_name = input;
        self
    }
    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.workgroup_name
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub fn result_format(mut self, input: crate::types::ResultFormatString) -> Self {
        self.result_format = ::std::option::Option::Some(input);
        self
    }
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub fn set_result_format(mut self, input: ::std::option::Option<crate::types::ResultFormatString>) -> Self {
        self.result_format = input;
        self
    }
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub fn get_result_format(&self) -> &::std::option::Option<crate::types::ResultFormatString> {
        &self.result_format
    }
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub fn session_keep_alive_seconds(mut self, input: i32) -> Self {
        self.session_keep_alive_seconds = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub fn set_session_keep_alive_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
        self.session_keep_alive_seconds = input;
        self
    }
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub fn get_session_keep_alive_seconds(&self) -> &::std::option::Option<i32> {
        &self.session_keep_alive_seconds
    }
    /// <p>The session identifier of the query.</p>
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The session identifier of the query.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The session identifier of the query.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// Consumes the builder and constructs a [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::execute_statement::ExecuteStatementInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::execute_statement::ExecuteStatementInput {
            sql: self.sql,
            cluster_identifier: self.cluster_identifier,
            secret_arn: self.secret_arn,
            db_user: self.db_user,
            database: self.database,
            with_event: self.with_event,
            statement_name: self.statement_name,
            parameters: self.parameters,
            workgroup_name: self.workgroup_name,
            client_token: self.client_token,
            result_format: self.result_format,
            session_keep_alive_seconds: self.session_keep_alive_seconds,
            session_id: self.session_id,
        })
    }
}