jira_api_v2/models/
user_permission.rs

1/*
2 * The Jira Cloud platform REST API
3 *
4 * Jira Cloud platform REST API documentation
5 *
6 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
7 * Contact: ecosystem@atlassian.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// UserPermission : Details of a permission and its availability to a user.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UserPermission {
17    /// The ID of the permission. Either `id` or `key` must be specified. Use [Get all permissions](#api-rest-api-2-permissions-get) to get the list of permissions.
18    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19    pub id: Option<String>,
20    /// The key of the permission. Either `id` or `key` must be specified. Use [Get all permissions](#api-rest-api-2-permissions-get) to get the list of permissions.
21    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
22    pub key: Option<String>,
23    /// The name of the permission.
24    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
25    pub name: Option<String>,
26    /// The type of the permission.
27    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
28    pub r#type: Option<Type>,
29    /// The description of the permission.
30    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
31    pub description: Option<String>,
32    /// Whether the permission is available to the user in the queried context.
33    #[serde(rename = "havePermission", skip_serializing_if = "Option::is_none")]
34    pub have_permission: Option<bool>,
35    /// Indicate whether the permission key is deprecated. Note that deprecated keys cannot be used in the `permissions parameter of Get my permissions. Deprecated keys are not returned by Get all permissions.`
36    #[serde(rename = "deprecatedKey", skip_serializing_if = "Option::is_none")]
37    pub deprecated_key: Option<bool>,
38}
39
40impl UserPermission {
41    /// Details of a permission and its availability to a user.
42    pub fn new() -> UserPermission {
43        UserPermission {
44            id: None,
45            key: None,
46            name: None,
47            r#type: None,
48            description: None,
49            have_permission: None,
50            deprecated_key: None,
51        }
52    }
53}
54/// The type of the permission.
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
56pub enum Type {
57    #[serde(rename = "GLOBAL")]
58    Global,
59    #[serde(rename = "PROJECT")]
60    Project,
61}
62
63impl Default for Type {
64    fn default() -> Type {
65        Self::Global
66    }
67}
68