Skip to main content

nominal_api/conjure/errors/scout/video/api/
not_authorized.rs

1/// User is not authorized to read data from the requested datasources.
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 NotAuthorized {
17    #[builder(
18        default,
19        set(
20            item(
21                type = super::super::super::super::super::objects::api::rids::DataSourceRid
22            )
23        )
24    )]
25    #[serde(
26        rename = "dataSourceRids",
27        skip_serializing_if = "std::collections::BTreeSet::is_empty",
28        default
29    )]
30    data_source_rids: std::collections::BTreeSet<
31        super::super::super::super::super::objects::api::rids::DataSourceRid,
32    >,
33}
34impl NotAuthorized {
35    /// Constructs a new instance of the type.
36    #[inline]
37    pub fn new() -> Self {
38        Self::builder().build()
39    }
40    #[inline]
41    pub fn data_source_rids(
42        &self,
43    ) -> &std::collections::BTreeSet<
44        super::super::super::super::super::objects::api::rids::DataSourceRid,
45    > {
46        &self.data_source_rids
47    }
48}
49impl conjure_error::ErrorType for NotAuthorized {
50    #[inline]
51    fn code() -> conjure_error::ErrorCode {
52        conjure_error::ErrorCode::PermissionDenied
53    }
54    #[inline]
55    fn name() -> &'static str {
56        "Video:NotAuthorized"
57    }
58    #[inline]
59    fn safe_args() -> &'static [&'static str] {
60        &["dataSourceRids"]
61    }
62}