#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ChannelHasWrongType {
    #[serde(rename = "seriesType")]
    series_type: super::super::super::super::super::objects::storage::series::api::NominalDataType,
    #[builder(
        default,
        set(
            item(
                type = super::super::super::super::super::objects::storage::series::api::NominalDataType
            )
        )
    )]
    #[serde(
        rename = "validTypes",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    valid_types: std::collections::BTreeSet<
        super::super::super::super::super::objects::storage::series::api::NominalDataType,
    >,
    #[builder(
        custom(
            type = super::super::super::super::super::objects::scout::compute::api::DataSourceAndChannel,
            convert = Box::new
        )
    )]
    #[serde(rename = "channel")]
    channel: Box<
        super::super::super::super::super::objects::scout::compute::api::DataSourceAndChannel,
    >,
}
impl ChannelHasWrongType {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        series_type: super::super::super::super::super::objects::storage::series::api::NominalDataType,
        channel: super::super::super::super::super::objects::scout::compute::api::DataSourceAndChannel,
    ) -> Self {
        Self::builder().series_type(series_type).channel(channel).build()
    }
    #[inline]
    pub fn series_type(
        &self,
    ) -> &super::super::super::super::super::objects::storage::series::api::NominalDataType {
        &self.series_type
    }
    /// The set of types that would have been compatible with the rest of the compute graph.
    #[inline]
    pub fn valid_types(
        &self,
    ) -> &std::collections::BTreeSet<
        super::super::super::super::super::objects::storage::series::api::NominalDataType,
    > {
        &self.valid_types
    }
    #[inline]
    pub fn channel(
        &self,
    ) -> &super::super::super::super::super::objects::scout::compute::api::DataSourceAndChannel {
        &*self.channel
    }
}
impl conjure_error::ErrorType for ChannelHasWrongType {
    #[inline]
    fn code() -> conjure_error::ErrorCode {
        conjure_error::ErrorCode::InvalidArgument
    }
    #[inline]
    fn name() -> &'static str {
        "Compute:ChannelHasWrongType"
    }
    #[inline]
    fn safe_args() -> &'static [&'static str] {
        &["seriesType", "validTypes"]
    }
}
