/// All dataset granularities must match.
#[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 BatchGranularityMismatch {
    #[builder(
        default,
        map(
            key(type = super::super::super::super::objects::api::Granularity),
            value(
                custom(
                    type = impl
                    IntoIterator<Item = conjure_object::ResourceIdentifier>,
                    convert = |v|v.into_iter().collect()
                )
            )
        )
    )]
    #[serde(
        rename = "datasetRids",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    dataset_rids: std::collections::BTreeMap<
        super::super::super::super::objects::api::Granularity,
        std::collections::BTreeSet<conjure_object::ResourceIdentifier>,
    >,
}
impl BatchGranularityMismatch {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    #[inline]
    pub fn dataset_rids(
        &self,
    ) -> &std::collections::BTreeMap<
        super::super::super::super::objects::api::Granularity,
        std::collections::BTreeSet<conjure_object::ResourceIdentifier>,
    > {
        &self.dataset_rids
    }
}
impl conjure_error::ErrorType for BatchGranularityMismatch {
    #[inline]
    fn code() -> conjure_error::ErrorCode {
        conjure_error::ErrorCode::InvalidArgument
    }
    #[inline]
    fn name() -> &'static str {
        "IngestService:BatchGranularityMismatch"
    }
    #[inline]
    fn safe_args() -> &'static [&'static str] {
        &["datasetRids"]
    }
}
