#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Datum {
pub scalar_value: ::std::option::Option<::std::string::String>,
pub time_series_value: ::std::option::Option<::std::vec::Vec<crate::types::TimeSeriesDataPoint>>,
pub array_value: ::std::option::Option<::std::vec::Vec<crate::types::Datum>>,
pub row_value: ::std::option::Option<crate::types::Row>,
pub null_value: ::std::option::Option<bool>,
}
impl Datum {
pub fn scalar_value(&self) -> ::std::option::Option<&str> {
self.scalar_value.as_deref()
}
pub fn time_series_value(&self) -> &[crate::types::TimeSeriesDataPoint] {
self.time_series_value.as_deref().unwrap_or_default()
}
pub fn array_value(&self) -> &[crate::types::Datum] {
self.array_value.as_deref().unwrap_or_default()
}
pub fn row_value(&self) -> ::std::option::Option<&crate::types::Row> {
self.row_value.as_ref()
}
pub fn null_value(&self) -> ::std::option::Option<bool> {
self.null_value
}
}
impl Datum {
pub fn builder() -> crate::types::builders::DatumBuilder {
crate::types::builders::DatumBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DatumBuilder {
pub(crate) scalar_value: ::std::option::Option<::std::string::String>,
pub(crate) time_series_value: ::std::option::Option<::std::vec::Vec<crate::types::TimeSeriesDataPoint>>,
pub(crate) array_value: ::std::option::Option<::std::vec::Vec<crate::types::Datum>>,
pub(crate) row_value: ::std::option::Option<crate::types::Row>,
pub(crate) null_value: ::std::option::Option<bool>,
}
impl DatumBuilder {
pub fn scalar_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.scalar_value = ::std::option::Option::Some(input.into());
self
}
pub fn set_scalar_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.scalar_value = input;
self
}
pub fn get_scalar_value(&self) -> &::std::option::Option<::std::string::String> {
&self.scalar_value
}
pub fn time_series_value(mut self, input: crate::types::TimeSeriesDataPoint) -> Self {
let mut v = self.time_series_value.unwrap_or_default();
v.push(input);
self.time_series_value = ::std::option::Option::Some(v);
self
}
pub fn set_time_series_value(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TimeSeriesDataPoint>>) -> Self {
self.time_series_value = input;
self
}
pub fn get_time_series_value(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TimeSeriesDataPoint>> {
&self.time_series_value
}
pub fn array_value(mut self, input: crate::types::Datum) -> Self {
let mut v = self.array_value.unwrap_or_default();
v.push(input);
self.array_value = ::std::option::Option::Some(v);
self
}
pub fn set_array_value(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Datum>>) -> Self {
self.array_value = input;
self
}
pub fn get_array_value(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Datum>> {
&self.array_value
}
pub fn row_value(mut self, input: crate::types::Row) -> Self {
self.row_value = ::std::option::Option::Some(input);
self
}
pub fn set_row_value(mut self, input: ::std::option::Option<crate::types::Row>) -> Self {
self.row_value = input;
self
}
pub fn get_row_value(&self) -> &::std::option::Option<crate::types::Row> {
&self.row_value
}
pub fn null_value(mut self, input: bool) -> Self {
self.null_value = ::std::option::Option::Some(input);
self
}
pub fn set_null_value(mut self, input: ::std::option::Option<bool>) -> Self {
self.null_value = input;
self
}
pub fn get_null_value(&self) -> &::std::option::Option<bool> {
&self.null_value
}
pub fn build(self) -> crate::types::Datum {
crate::types::Datum {
scalar_value: self.scalar_value,
time_series_value: self.time_series_value,
array_value: self.array_value,
row_value: self.row_value,
null_value: self.null_value,
}
}
}