use conjure_object::serde::{ser, de};
use conjure_object::serde::ser::SerializeMap as SerializeMap_;
use conjure_object::private::{UnionField_, UnionTypeField_};
use std::fmt;
#[derive(Debug, Clone, conjure_object::private::DeriveWith)]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum ComputeNodeResponse {
    Range(Vec<super::Range>),
    RangesSummary(super::RangesSummary),
    RangeValue(Option<super::Range>),
    Numeric(super::NumericPlot),
    BucketedNumeric(super::BucketedNumericPlot),
    NumericPoint(Option<super::NumericPoint>),
    SinglePoint(Option<super::SinglePoint>),
    ArrowNumeric(super::ArrowPlot),
    ArrowBucketedNumeric(super::ArrowPlot),
    Enum(super::EnumPlot),
    EnumPoint(Option<super::EnumPoint>),
    BucketedEnum(super::BucketedEnumPlot),
    ArrowEnum(super::ArrowPlot),
    ArrowBucketedEnum(super::ArrowPlot),
    PagedLog(super::PagedLogPlot),
    LogPoint(Option<super::LogPoint>),
    ArrowLog(super::ArrowPlot),
    Cartesian(super::CartesianPlot),
    BucketedCartesian(super::BucketedCartesianPlot),
    BucketedCartesian3d(super::BucketedCartesian3dPlot),
    FrequencyDomain(super::FrequencyDomainPlot),
    FrequencyDomainV2(Box<super::FrequencyDomainPlotV2>),
    BucketedFrequencyDomain(super::BucketedFrequencyDomainPlot),
    NumericHistogram(super::NumericHistogramPlot),
    EnumHistogram(super::EnumHistogramPlot),
    /// Deprecated: use `curveFitV2` (CurveFitResultV2) instead. Returned only for deprecated CurveFit requests.
    CurveFit(super::CurveFitResult),
    CurveFitV2(super::CurveFitResultV2),
    Grouped(super::GroupedComputeNodeResponses),
    Array(Box<super::ArrowArrayPlot>),
    BucketedStruct(super::ArrowPlot),
    ArrowStruct(super::ArrowPlot),
    FullResolution(super::ArrowPlot),
    ArrowBucketedMultivariate(super::ArrowPlot),
    Multivariate(super::BucketedMultivariatePlot),
    /// An unknown variant.
    Unknown(Unknown),
}
impl ser::Serialize for ComputeNodeResponse {
    fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
    where
        S: ser::Serializer,
    {
        let mut map = s.serialize_map(Some(2))?;
        match self {
            ComputeNodeResponse::Range(value) => {
                map.serialize_entry(&"type", &"range")?;
                map.serialize_entry(&"range", value)?;
            }
            ComputeNodeResponse::RangesSummary(value) => {
                map.serialize_entry(&"type", &"rangesSummary")?;
                map.serialize_entry(&"rangesSummary", value)?;
            }
            ComputeNodeResponse::RangeValue(value) => {
                map.serialize_entry(&"type", &"rangeValue")?;
                map.serialize_entry(&"rangeValue", value)?;
            }
            ComputeNodeResponse::Numeric(value) => {
                map.serialize_entry(&"type", &"numeric")?;
                map.serialize_entry(&"numeric", value)?;
            }
            ComputeNodeResponse::BucketedNumeric(value) => {
                map.serialize_entry(&"type", &"bucketedNumeric")?;
                map.serialize_entry(&"bucketedNumeric", value)?;
            }
            ComputeNodeResponse::NumericPoint(value) => {
                map.serialize_entry(&"type", &"numericPoint")?;
                map.serialize_entry(&"numericPoint", value)?;
            }
            ComputeNodeResponse::SinglePoint(value) => {
                map.serialize_entry(&"type", &"singlePoint")?;
                map.serialize_entry(&"singlePoint", value)?;
            }
            ComputeNodeResponse::ArrowNumeric(value) => {
                map.serialize_entry(&"type", &"arrowNumeric")?;
                map.serialize_entry(&"arrowNumeric", value)?;
            }
            ComputeNodeResponse::ArrowBucketedNumeric(value) => {
                map.serialize_entry(&"type", &"arrowBucketedNumeric")?;
                map.serialize_entry(&"arrowBucketedNumeric", value)?;
            }
            ComputeNodeResponse::Enum(value) => {
                map.serialize_entry(&"type", &"enum")?;
                map.serialize_entry(&"enum", value)?;
            }
            ComputeNodeResponse::EnumPoint(value) => {
                map.serialize_entry(&"type", &"enumPoint")?;
                map.serialize_entry(&"enumPoint", value)?;
            }
            ComputeNodeResponse::BucketedEnum(value) => {
                map.serialize_entry(&"type", &"bucketedEnum")?;
                map.serialize_entry(&"bucketedEnum", value)?;
            }
            ComputeNodeResponse::ArrowEnum(value) => {
                map.serialize_entry(&"type", &"arrowEnum")?;
                map.serialize_entry(&"arrowEnum", value)?;
            }
            ComputeNodeResponse::ArrowBucketedEnum(value) => {
                map.serialize_entry(&"type", &"arrowBucketedEnum")?;
                map.serialize_entry(&"arrowBucketedEnum", value)?;
            }
            ComputeNodeResponse::PagedLog(value) => {
                map.serialize_entry(&"type", &"pagedLog")?;
                map.serialize_entry(&"pagedLog", value)?;
            }
            ComputeNodeResponse::LogPoint(value) => {
                map.serialize_entry(&"type", &"logPoint")?;
                map.serialize_entry(&"logPoint", value)?;
            }
            ComputeNodeResponse::ArrowLog(value) => {
                map.serialize_entry(&"type", &"arrowLog")?;
                map.serialize_entry(&"arrowLog", value)?;
            }
            ComputeNodeResponse::Cartesian(value) => {
                map.serialize_entry(&"type", &"cartesian")?;
                map.serialize_entry(&"cartesian", value)?;
            }
            ComputeNodeResponse::BucketedCartesian(value) => {
                map.serialize_entry(&"type", &"bucketedCartesian")?;
                map.serialize_entry(&"bucketedCartesian", value)?;
            }
            ComputeNodeResponse::BucketedCartesian3d(value) => {
                map.serialize_entry(&"type", &"bucketedCartesian3d")?;
                map.serialize_entry(&"bucketedCartesian3d", value)?;
            }
            ComputeNodeResponse::FrequencyDomain(value) => {
                map.serialize_entry(&"type", &"frequencyDomain")?;
                map.serialize_entry(&"frequencyDomain", value)?;
            }
            ComputeNodeResponse::FrequencyDomainV2(value) => {
                map.serialize_entry(&"type", &"frequencyDomainV2")?;
                map.serialize_entry(&"frequencyDomainV2", value)?;
            }
            ComputeNodeResponse::BucketedFrequencyDomain(value) => {
                map.serialize_entry(&"type", &"bucketedFrequencyDomain")?;
                map.serialize_entry(&"bucketedFrequencyDomain", value)?;
            }
            ComputeNodeResponse::NumericHistogram(value) => {
                map.serialize_entry(&"type", &"numericHistogram")?;
                map.serialize_entry(&"numericHistogram", value)?;
            }
            ComputeNodeResponse::EnumHistogram(value) => {
                map.serialize_entry(&"type", &"enumHistogram")?;
                map.serialize_entry(&"enumHistogram", value)?;
            }
            ComputeNodeResponse::CurveFit(value) => {
                map.serialize_entry(&"type", &"curveFit")?;
                map.serialize_entry(&"curveFit", value)?;
            }
            ComputeNodeResponse::CurveFitV2(value) => {
                map.serialize_entry(&"type", &"curveFitV2")?;
                map.serialize_entry(&"curveFitV2", value)?;
            }
            ComputeNodeResponse::Grouped(value) => {
                map.serialize_entry(&"type", &"grouped")?;
                map.serialize_entry(&"grouped", value)?;
            }
            ComputeNodeResponse::Array(value) => {
                map.serialize_entry(&"type", &"array")?;
                map.serialize_entry(&"array", value)?;
            }
            ComputeNodeResponse::BucketedStruct(value) => {
                map.serialize_entry(&"type", &"bucketedStruct")?;
                map.serialize_entry(&"bucketedStruct", value)?;
            }
            ComputeNodeResponse::ArrowStruct(value) => {
                map.serialize_entry(&"type", &"arrowStruct")?;
                map.serialize_entry(&"arrowStruct", value)?;
            }
            ComputeNodeResponse::FullResolution(value) => {
                map.serialize_entry(&"type", &"fullResolution")?;
                map.serialize_entry(&"fullResolution", value)?;
            }
            ComputeNodeResponse::ArrowBucketedMultivariate(value) => {
                map.serialize_entry(&"type", &"arrowBucketedMultivariate")?;
                map.serialize_entry(&"arrowBucketedMultivariate", value)?;
            }
            ComputeNodeResponse::Multivariate(value) => {
                map.serialize_entry(&"type", &"multivariate")?;
                map.serialize_entry(&"multivariate", value)?;
            }
            ComputeNodeResponse::Unknown(value) => {
                map.serialize_entry(&"type", &value.type_)?;
                map.serialize_entry(&value.type_, &value.value)?;
            }
        }
        map.end()
    }
}
impl<'de> de::Deserialize<'de> for ComputeNodeResponse {
    fn deserialize<D>(d: D) -> Result<ComputeNodeResponse, D::Error>
    where
        D: de::Deserializer<'de>,
    {
        d.deserialize_map(Visitor_)
    }
}
struct Visitor_;
impl<'de> de::Visitor<'de> for Visitor_ {
    type Value = ComputeNodeResponse;
    fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt.write_str("union ComputeNodeResponse")
    }
    fn visit_map<A>(self, mut map: A) -> Result<ComputeNodeResponse, A::Error>
    where
        A: de::MapAccess<'de>,
    {
        let v = match map.next_key::<UnionField_<Variant_>>()? {
            Some(UnionField_::Type) => {
                let variant = map.next_value()?;
                let key = map.next_key()?;
                match (variant, key) {
                    (Variant_::Range, Some(Variant_::Range)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Range(value)
                    }
                    (Variant_::RangesSummary, Some(Variant_::RangesSummary)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::RangesSummary(value)
                    }
                    (Variant_::RangeValue, Some(Variant_::RangeValue)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::RangeValue(value)
                    }
                    (Variant_::Numeric, Some(Variant_::Numeric)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Numeric(value)
                    }
                    (Variant_::BucketedNumeric, Some(Variant_::BucketedNumeric)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedNumeric(value)
                    }
                    (Variant_::NumericPoint, Some(Variant_::NumericPoint)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::NumericPoint(value)
                    }
                    (Variant_::SinglePoint, Some(Variant_::SinglePoint)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::SinglePoint(value)
                    }
                    (Variant_::ArrowNumeric, Some(Variant_::ArrowNumeric)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowNumeric(value)
                    }
                    (
                        Variant_::ArrowBucketedNumeric,
                        Some(Variant_::ArrowBucketedNumeric),
                    ) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowBucketedNumeric(value)
                    }
                    (Variant_::Enum, Some(Variant_::Enum)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Enum(value)
                    }
                    (Variant_::EnumPoint, Some(Variant_::EnumPoint)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::EnumPoint(value)
                    }
                    (Variant_::BucketedEnum, Some(Variant_::BucketedEnum)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedEnum(value)
                    }
                    (Variant_::ArrowEnum, Some(Variant_::ArrowEnum)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowEnum(value)
                    }
                    (Variant_::ArrowBucketedEnum, Some(Variant_::ArrowBucketedEnum)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowBucketedEnum(value)
                    }
                    (Variant_::PagedLog, Some(Variant_::PagedLog)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::PagedLog(value)
                    }
                    (Variant_::LogPoint, Some(Variant_::LogPoint)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::LogPoint(value)
                    }
                    (Variant_::ArrowLog, Some(Variant_::ArrowLog)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowLog(value)
                    }
                    (Variant_::Cartesian, Some(Variant_::Cartesian)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Cartesian(value)
                    }
                    (Variant_::BucketedCartesian, Some(Variant_::BucketedCartesian)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedCartesian(value)
                    }
                    (
                        Variant_::BucketedCartesian3d,
                        Some(Variant_::BucketedCartesian3d),
                    ) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedCartesian3d(value)
                    }
                    (Variant_::FrequencyDomain, Some(Variant_::FrequencyDomain)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::FrequencyDomain(value)
                    }
                    (Variant_::FrequencyDomainV2, Some(Variant_::FrequencyDomainV2)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::FrequencyDomainV2(value)
                    }
                    (
                        Variant_::BucketedFrequencyDomain,
                        Some(Variant_::BucketedFrequencyDomain),
                    ) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedFrequencyDomain(value)
                    }
                    (Variant_::NumericHistogram, Some(Variant_::NumericHistogram)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::NumericHistogram(value)
                    }
                    (Variant_::EnumHistogram, Some(Variant_::EnumHistogram)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::EnumHistogram(value)
                    }
                    (Variant_::CurveFit, Some(Variant_::CurveFit)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::CurveFit(value)
                    }
                    (Variant_::CurveFitV2, Some(Variant_::CurveFitV2)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::CurveFitV2(value)
                    }
                    (Variant_::Grouped, Some(Variant_::Grouped)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Grouped(value)
                    }
                    (Variant_::Array, Some(Variant_::Array)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Array(value)
                    }
                    (Variant_::BucketedStruct, Some(Variant_::BucketedStruct)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedStruct(value)
                    }
                    (Variant_::ArrowStruct, Some(Variant_::ArrowStruct)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowStruct(value)
                    }
                    (Variant_::FullResolution, Some(Variant_::FullResolution)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::FullResolution(value)
                    }
                    (
                        Variant_::ArrowBucketedMultivariate,
                        Some(Variant_::ArrowBucketedMultivariate),
                    ) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowBucketedMultivariate(value)
                    }
                    (Variant_::Multivariate, Some(Variant_::Multivariate)) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Multivariate(value)
                    }
                    (Variant_::Unknown(type_), Some(Variant_::Unknown(b))) => {
                        if type_ == b {
                            let value = map.next_value()?;
                            ComputeNodeResponse::Unknown(Unknown { type_, value })
                        } else {
                            return Err(
                                de::Error::invalid_value(de::Unexpected::Str(&type_), &&*b),
                            )
                        }
                    }
                    (variant, Some(key)) => {
                        return Err(
                            de::Error::invalid_value(
                                de::Unexpected::Str(key.as_str()),
                                &variant.as_str(),
                            ),
                        );
                    }
                    (variant, None) => {
                        return Err(de::Error::missing_field(variant.as_str()));
                    }
                }
            }
            Some(UnionField_::Value(variant)) => {
                let value = match &variant {
                    Variant_::Range => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Range(value)
                    }
                    Variant_::RangesSummary => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::RangesSummary(value)
                    }
                    Variant_::RangeValue => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::RangeValue(value)
                    }
                    Variant_::Numeric => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Numeric(value)
                    }
                    Variant_::BucketedNumeric => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedNumeric(value)
                    }
                    Variant_::NumericPoint => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::NumericPoint(value)
                    }
                    Variant_::SinglePoint => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::SinglePoint(value)
                    }
                    Variant_::ArrowNumeric => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowNumeric(value)
                    }
                    Variant_::ArrowBucketedNumeric => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowBucketedNumeric(value)
                    }
                    Variant_::Enum => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Enum(value)
                    }
                    Variant_::EnumPoint => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::EnumPoint(value)
                    }
                    Variant_::BucketedEnum => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedEnum(value)
                    }
                    Variant_::ArrowEnum => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowEnum(value)
                    }
                    Variant_::ArrowBucketedEnum => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowBucketedEnum(value)
                    }
                    Variant_::PagedLog => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::PagedLog(value)
                    }
                    Variant_::LogPoint => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::LogPoint(value)
                    }
                    Variant_::ArrowLog => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowLog(value)
                    }
                    Variant_::Cartesian => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Cartesian(value)
                    }
                    Variant_::BucketedCartesian => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedCartesian(value)
                    }
                    Variant_::BucketedCartesian3d => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedCartesian3d(value)
                    }
                    Variant_::FrequencyDomain => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::FrequencyDomain(value)
                    }
                    Variant_::FrequencyDomainV2 => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::FrequencyDomainV2(value)
                    }
                    Variant_::BucketedFrequencyDomain => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedFrequencyDomain(value)
                    }
                    Variant_::NumericHistogram => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::NumericHistogram(value)
                    }
                    Variant_::EnumHistogram => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::EnumHistogram(value)
                    }
                    Variant_::CurveFit => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::CurveFit(value)
                    }
                    Variant_::CurveFitV2 => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::CurveFitV2(value)
                    }
                    Variant_::Grouped => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Grouped(value)
                    }
                    Variant_::Array => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Array(value)
                    }
                    Variant_::BucketedStruct => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::BucketedStruct(value)
                    }
                    Variant_::ArrowStruct => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowStruct(value)
                    }
                    Variant_::FullResolution => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::FullResolution(value)
                    }
                    Variant_::ArrowBucketedMultivariate => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::ArrowBucketedMultivariate(value)
                    }
                    Variant_::Multivariate => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Multivariate(value)
                    }
                    Variant_::Unknown(type_) => {
                        let value = map.next_value()?;
                        ComputeNodeResponse::Unknown(Unknown {
                            type_: type_.clone(),
                            value,
                        })
                    }
                };
                if map.next_key::<UnionTypeField_>()?.is_none() {
                    return Err(de::Error::missing_field("type"));
                }
                let type_variant = map.next_value::<Variant_>()?;
                if variant != type_variant {
                    return Err(
                        de::Error::invalid_value(
                            de::Unexpected::Str(type_variant.as_str()),
                            &variant.as_str(),
                        ),
                    );
                }
                value
            }
            None => return Err(de::Error::missing_field("type")),
        };
        if map.next_key::<UnionField_<Variant_>>()?.is_some() {
            return Err(de::Error::invalid_length(3, &"type and value fields"));
        }
        Ok(v)
    }
}
#[derive(PartialEq)]
enum Variant_ {
    Range,
    RangesSummary,
    RangeValue,
    Numeric,
    BucketedNumeric,
    NumericPoint,
    SinglePoint,
    ArrowNumeric,
    ArrowBucketedNumeric,
    Enum,
    EnumPoint,
    BucketedEnum,
    ArrowEnum,
    ArrowBucketedEnum,
    PagedLog,
    LogPoint,
    ArrowLog,
    Cartesian,
    BucketedCartesian,
    BucketedCartesian3d,
    FrequencyDomain,
    FrequencyDomainV2,
    BucketedFrequencyDomain,
    NumericHistogram,
    EnumHistogram,
    CurveFit,
    CurveFitV2,
    Grouped,
    Array,
    BucketedStruct,
    ArrowStruct,
    FullResolution,
    ArrowBucketedMultivariate,
    Multivariate,
    Unknown(Box<str>),
}
impl Variant_ {
    fn as_str(&self) -> &'static str {
        match *self {
            Variant_::Range => "range",
            Variant_::RangesSummary => "rangesSummary",
            Variant_::RangeValue => "rangeValue",
            Variant_::Numeric => "numeric",
            Variant_::BucketedNumeric => "bucketedNumeric",
            Variant_::NumericPoint => "numericPoint",
            Variant_::SinglePoint => "singlePoint",
            Variant_::ArrowNumeric => "arrowNumeric",
            Variant_::ArrowBucketedNumeric => "arrowBucketedNumeric",
            Variant_::Enum => "enum",
            Variant_::EnumPoint => "enumPoint",
            Variant_::BucketedEnum => "bucketedEnum",
            Variant_::ArrowEnum => "arrowEnum",
            Variant_::ArrowBucketedEnum => "arrowBucketedEnum",
            Variant_::PagedLog => "pagedLog",
            Variant_::LogPoint => "logPoint",
            Variant_::ArrowLog => "arrowLog",
            Variant_::Cartesian => "cartesian",
            Variant_::BucketedCartesian => "bucketedCartesian",
            Variant_::BucketedCartesian3d => "bucketedCartesian3d",
            Variant_::FrequencyDomain => "frequencyDomain",
            Variant_::FrequencyDomainV2 => "frequencyDomainV2",
            Variant_::BucketedFrequencyDomain => "bucketedFrequencyDomain",
            Variant_::NumericHistogram => "numericHistogram",
            Variant_::EnumHistogram => "enumHistogram",
            Variant_::CurveFit => "curveFit",
            Variant_::CurveFitV2 => "curveFitV2",
            Variant_::Grouped => "grouped",
            Variant_::Array => "array",
            Variant_::BucketedStruct => "bucketedStruct",
            Variant_::ArrowStruct => "arrowStruct",
            Variant_::FullResolution => "fullResolution",
            Variant_::ArrowBucketedMultivariate => "arrowBucketedMultivariate",
            Variant_::Multivariate => "multivariate",
            Variant_::Unknown(_) => "unknown variant",
        }
    }
}
impl<'de> de::Deserialize<'de> for Variant_ {
    fn deserialize<D>(d: D) -> Result<Variant_, D::Error>
    where
        D: de::Deserializer<'de>,
    {
        d.deserialize_str(VariantVisitor_)
    }
}
struct VariantVisitor_;
impl<'de> de::Visitor<'de> for VariantVisitor_ {
    type Value = Variant_;
    fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt.write_str("string")
    }
    fn visit_str<E>(self, value: &str) -> Result<Variant_, E>
    where
        E: de::Error,
    {
        let v = match value {
            "range" => Variant_::Range,
            "rangesSummary" => Variant_::RangesSummary,
            "rangeValue" => Variant_::RangeValue,
            "numeric" => Variant_::Numeric,
            "bucketedNumeric" => Variant_::BucketedNumeric,
            "numericPoint" => Variant_::NumericPoint,
            "singlePoint" => Variant_::SinglePoint,
            "arrowNumeric" => Variant_::ArrowNumeric,
            "arrowBucketedNumeric" => Variant_::ArrowBucketedNumeric,
            "enum" => Variant_::Enum,
            "enumPoint" => Variant_::EnumPoint,
            "bucketedEnum" => Variant_::BucketedEnum,
            "arrowEnum" => Variant_::ArrowEnum,
            "arrowBucketedEnum" => Variant_::ArrowBucketedEnum,
            "pagedLog" => Variant_::PagedLog,
            "logPoint" => Variant_::LogPoint,
            "arrowLog" => Variant_::ArrowLog,
            "cartesian" => Variant_::Cartesian,
            "bucketedCartesian" => Variant_::BucketedCartesian,
            "bucketedCartesian3d" => Variant_::BucketedCartesian3d,
            "frequencyDomain" => Variant_::FrequencyDomain,
            "frequencyDomainV2" => Variant_::FrequencyDomainV2,
            "bucketedFrequencyDomain" => Variant_::BucketedFrequencyDomain,
            "numericHistogram" => Variant_::NumericHistogram,
            "enumHistogram" => Variant_::EnumHistogram,
            "curveFit" => Variant_::CurveFit,
            "curveFitV2" => Variant_::CurveFitV2,
            "grouped" => Variant_::Grouped,
            "array" => Variant_::Array,
            "bucketedStruct" => Variant_::BucketedStruct,
            "arrowStruct" => Variant_::ArrowStruct,
            "fullResolution" => Variant_::FullResolution,
            "arrowBucketedMultivariate" => Variant_::ArrowBucketedMultivariate,
            "multivariate" => Variant_::Multivariate,
            value => Variant_::Unknown(value.to_string().into_boxed_str()),
        };
        Ok(v)
    }
}
///An unknown variant of the ComputeNodeResponse union.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Unknown {
    type_: Box<str>,
    value: conjure_object::Any,
}
impl Unknown {
    /// Returns the unknown variant's type name.
    #[inline]
    pub fn type_(&self) -> &str {
        &self.type_
    }
}
