Skip to main content

aws_sdk_athena/types/
_row.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The rows that make up a query result table.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Row {
7    /// <p>The data that populates a row in a query result table.</p>
8    pub data: ::std::option::Option<::std::vec::Vec<crate::types::Datum>>,
9}
10impl Row {
11    /// <p>The data that populates a row in a query result table.</p>
12    ///
13    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.data.is_none()`.
14    pub fn data(&self) -> &[crate::types::Datum] {
15        self.data.as_deref().unwrap_or_default()
16    }
17}
18impl Row {
19    /// Creates a new builder-style object to manufacture [`Row`](crate::types::Row).
20    pub fn builder() -> crate::types::builders::RowBuilder {
21        crate::types::builders::RowBuilder::default()
22    }
23}
24
25/// A builder for [`Row`](crate::types::Row).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct RowBuilder {
29    pub(crate) data: ::std::option::Option<::std::vec::Vec<crate::types::Datum>>,
30}
31impl RowBuilder {
32    /// Appends an item to `data`.
33    ///
34    /// To override the contents of this collection use [`set_data`](Self::set_data).
35    ///
36    /// <p>The data that populates a row in a query result table.</p>
37    pub fn data(mut self, input: crate::types::Datum) -> Self {
38        let mut v = self.data.unwrap_or_default();
39        v.push(input);
40        self.data = ::std::option::Option::Some(v);
41        self
42    }
43    /// <p>The data that populates a row in a query result table.</p>
44    pub fn set_data(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Datum>>) -> Self {
45        self.data = input;
46        self
47    }
48    /// <p>The data that populates a row in a query result table.</p>
49    pub fn get_data(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Datum>> {
50        &self.data
51    }
52    /// Consumes the builder and constructs a [`Row`](crate::types::Row).
53    pub fn build(self) -> crate::types::Row {
54        crate::types::Row { data: self.data }
55    }
56}