aws-sdk-rdsdata 1.100.0

AWS SDK for AWS RDS DataService
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The response elements represent the output of a SQL statement over an array of data.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchExecuteStatementOutput {
    /// <p>The execution results of each batch entry.</p>
    pub update_results: ::std::option::Option<::std::vec::Vec<crate::types::UpdateResult>>,
    _request_id: Option<String>,
}
impl BatchExecuteStatementOutput {
    /// <p>The execution results of each batch entry.</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 `.update_results.is_none()`.
    pub fn update_results(&self) -> &[crate::types::UpdateResult] {
        self.update_results.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for BatchExecuteStatementOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl BatchExecuteStatementOutput {
    /// Creates a new builder-style object to manufacture [`BatchExecuteStatementOutput`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput).
    pub fn builder() -> crate::operation::batch_execute_statement::builders::BatchExecuteStatementOutputBuilder {
        crate::operation::batch_execute_statement::builders::BatchExecuteStatementOutputBuilder::default()
    }
}

/// A builder for [`BatchExecuteStatementOutput`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchExecuteStatementOutputBuilder {
    pub(crate) update_results: ::std::option::Option<::std::vec::Vec<crate::types::UpdateResult>>,
    _request_id: Option<String>,
}
impl BatchExecuteStatementOutputBuilder {
    /// Appends an item to `update_results`.
    ///
    /// To override the contents of this collection use [`set_update_results`](Self::set_update_results).
    ///
    /// <p>The execution results of each batch entry.</p>
    pub fn update_results(mut self, input: crate::types::UpdateResult) -> Self {
        let mut v = self.update_results.unwrap_or_default();
        v.push(input);
        self.update_results = ::std::option::Option::Some(v);
        self
    }
    /// <p>The execution results of each batch entry.</p>
    pub fn set_update_results(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UpdateResult>>) -> Self {
        self.update_results = input;
        self
    }
    /// <p>The execution results of each batch entry.</p>
    pub fn get_update_results(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UpdateResult>> {
        &self.update_results
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`BatchExecuteStatementOutput`](crate::operation::batch_execute_statement::BatchExecuteStatementOutput).
    pub fn build(self) -> crate::operation::batch_execute_statement::BatchExecuteStatementOutput {
        crate::operation::batch_execute_statement::BatchExecuteStatementOutput {
            update_results: self.update_results,
            _request_id: self._request_id,
        }
    }
}