clerk_fapi_rs/models/
client_role.rs

1/*
2 * Clerk Frontend API
3 *
4 * The Clerk REST Frontend API, meant to be accessed from a browser or native environment.  This is a Form Based API and all the data must be sent and formatted according to the `application/x-www-form-urlencoded` content type.  ### Versions  When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/backend-requests/versioning/overview).  ### Using the Try It Console  The `Try It` feature of the docs only works for **Development Instances** when using the `DevBrowser` security scheme. To use it, first generate a dev instance token from the `/v1/dev_browser` endpoint.  Please see https://clerk.com/docs for more information.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: support@clerk.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClientRole {
16    #[serde(rename = "object")]
17    pub object: Object,
18    #[serde(rename = "id")]
19    pub id: String,
20    #[serde(rename = "name")]
21    pub name: String,
22    #[serde(rename = "key")]
23    pub key: String,
24    #[serde(rename = "description")]
25    pub description: String,
26    #[serde(rename = "is_creator_eligible")]
27    pub is_creator_eligible: bool,
28    #[serde(rename = "permissions")]
29    pub permissions: Vec<models::ClientPermission>,
30    /// Unix timestamp of creation.
31    #[serde(rename = "created_at")]
32    pub created_at: i64,
33    /// Unix timestamp of last update.
34    #[serde(rename = "updated_at")]
35    pub updated_at: i64,
36}
37
38impl ClientRole {
39    pub fn new(
40        object: Object,
41        id: String,
42        name: String,
43        key: String,
44        description: String,
45        is_creator_eligible: bool,
46        permissions: Vec<models::ClientPermission>,
47        created_at: i64,
48        updated_at: i64,
49    ) -> ClientRole {
50        ClientRole {
51            object,
52            id,
53            name,
54            key,
55            description,
56            is_creator_eligible,
57            permissions,
58            created_at,
59            updated_at,
60        }
61    }
62}
63
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum Object {
66    #[serde(rename = "role")]
67    Role,
68}
69
70impl Default for Object {
71    fn default() -> Object {
72        Self::Role
73    }
74}