Skip to main content

nominal_api/conjure/errors/ingest/api/
batch_granularity_mismatch.rs

1/// All dataset granularities must match.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct BatchGranularityMismatch {
17    #[builder(
18        default,
19        map(
20            key(type = super::super::super::super::objects::api::Granularity),
21            value(
22                custom(
23                    type = impl
24                    IntoIterator<Item = conjure_object::ResourceIdentifier>,
25                    convert = |v|v.into_iter().collect()
26                )
27            )
28        )
29    )]
30    #[serde(
31        rename = "datasetRids",
32        skip_serializing_if = "std::collections::BTreeMap::is_empty",
33        default
34    )]
35    dataset_rids: std::collections::BTreeMap<
36        super::super::super::super::objects::api::Granularity,
37        std::collections::BTreeSet<conjure_object::ResourceIdentifier>,
38    >,
39}
40impl BatchGranularityMismatch {
41    /// Constructs a new instance of the type.
42    #[inline]
43    pub fn new() -> Self {
44        Self::builder().build()
45    }
46    #[inline]
47    pub fn dataset_rids(
48        &self,
49    ) -> &std::collections::BTreeMap<
50        super::super::super::super::objects::api::Granularity,
51        std::collections::BTreeSet<conjure_object::ResourceIdentifier>,
52    > {
53        &self.dataset_rids
54    }
55}
56impl conjure_error::ErrorType for BatchGranularityMismatch {
57    #[inline]
58    fn code() -> conjure_error::ErrorCode {
59        conjure_error::ErrorCode::InvalidArgument
60    }
61    #[inline]
62    fn name() -> &'static str {
63        "IngestService:BatchGranularityMismatch"
64    }
65    #[inline]
66    fn safe_args() -> &'static [&'static str] {
67        &["datasetRids"]
68    }
69}