#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct FacetResult {
pub document_attribute_key: ::std::option::Option<::std::string::String>,
pub document_attribute_value_type: ::std::option::Option<crate::types::DocumentAttributeValueType>,
pub document_attribute_value_count_pairs: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttributeValueCountPair>>,
}
impl FacetResult {
pub fn document_attribute_key(&self) -> ::std::option::Option<&str> {
self.document_attribute_key.as_deref()
}
pub fn document_attribute_value_type(&self) -> ::std::option::Option<&crate::types::DocumentAttributeValueType> {
self.document_attribute_value_type.as_ref()
}
pub fn document_attribute_value_count_pairs(&self) -> ::std::option::Option<&[crate::types::DocumentAttributeValueCountPair]> {
self.document_attribute_value_count_pairs.as_deref()
}
}
impl FacetResult {
pub fn builder() -> crate::types::builders::FacetResultBuilder {
crate::types::builders::FacetResultBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct FacetResultBuilder {
pub(crate) document_attribute_key: ::std::option::Option<::std::string::String>,
pub(crate) document_attribute_value_type: ::std::option::Option<crate::types::DocumentAttributeValueType>,
pub(crate) document_attribute_value_count_pairs: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttributeValueCountPair>>,
}
impl FacetResultBuilder {
pub fn document_attribute_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.document_attribute_key = ::std::option::Option::Some(input.into());
self
}
pub fn set_document_attribute_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.document_attribute_key = input;
self
}
pub fn get_document_attribute_key(&self) -> &::std::option::Option<::std::string::String> {
&self.document_attribute_key
}
pub fn document_attribute_value_type(mut self, input: crate::types::DocumentAttributeValueType) -> Self {
self.document_attribute_value_type = ::std::option::Option::Some(input);
self
}
pub fn set_document_attribute_value_type(mut self, input: ::std::option::Option<crate::types::DocumentAttributeValueType>) -> Self {
self.document_attribute_value_type = input;
self
}
pub fn get_document_attribute_value_type(&self) -> &::std::option::Option<crate::types::DocumentAttributeValueType> {
&self.document_attribute_value_type
}
pub fn document_attribute_value_count_pairs(mut self, input: crate::types::DocumentAttributeValueCountPair) -> Self {
let mut v = self.document_attribute_value_count_pairs.unwrap_or_default();
v.push(input);
self.document_attribute_value_count_pairs = ::std::option::Option::Some(v);
self
}
pub fn set_document_attribute_value_count_pairs(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttributeValueCountPair>>,
) -> Self {
self.document_attribute_value_count_pairs = input;
self
}
pub fn get_document_attribute_value_count_pairs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentAttributeValueCountPair>> {
&self.document_attribute_value_count_pairs
}
pub fn build(self) -> crate::types::FacetResult {
crate::types::FacetResult {
document_attribute_key: self.document_attribute_key,
document_attribute_value_type: self.document_attribute_value_type,
document_attribute_value_count_pairs: self.document_attribute_value_count_pairs,
}
}
}