1#![forbid(unsafe_code)]
13
14pub const CORE_USER_SCHEMA: &str = "urn:ietf:params:scim:schemas:core:2.0:User";
16
17pub const CORE_GROUP_SCHEMA: &str = "urn:ietf:params:scim:schemas:core:2.0:Group";
19
20pub const ENTERPRISE_USER_SCHEMA: &str =
22 "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User";
23
24#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
26#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
27#[cfg_attr(feature = "serde", serde(rename_all = "lowercase"))]
28pub enum ResourceKind {
29 User,
31 Group,
33}
34
35impl ResourceKind {
36 #[must_use]
38 pub const fn schema_urn(self) -> &'static str {
39 match self {
40 Self::User => CORE_USER_SCHEMA,
41 Self::Group => CORE_GROUP_SCHEMA,
42 }
43 }
44
45 #[must_use]
47 pub const fn endpoint(self) -> &'static str {
48 match self {
49 Self::User => "/Users",
50 Self::Group => "/Groups",
51 }
52 }
53}