jira_api_v2/models/
share_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/// SharePermission : Details of a share permission for the filter.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SharePermission {
17    /// The unique identifier of the share permission.
18    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19    pub id: Option<i64>,
20    /// The type of share permission:   *  `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well.  *  `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well.  *  `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in requests, where it needs to be specify with `projectId` and `projectRoleId`.  *  `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified.  *  `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as the `type`.  *  `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request.
21    #[serde(rename = "type")]
22    pub r#type: Type,
23    /// The project that the filter is shared with. This is similar to the project object returned by [Get project](#api-rest-api-2-project-projectIdOrKey-get) but it contains a subset of the properties, which are: `self`, `id`, `key`, `assigneeType`, `name`, `roles`, `avatarUrls`, `projectType`, `simplified`.   For a request, specify the `id` for the project.
24    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
25    pub project: Option<Box<models::Project>>,
26    /// The project role that the filter is shared with.   For a request, specify the `id` for the role. You must also specify the `project` object and `id` for the project that the role is in.
27    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
28    pub role: Option<Box<models::ProjectRole>>,
29    /// The group that the filter is shared with. For a request, specify the `name` property for the group.
30    #[serde(rename = "group", skip_serializing_if = "Option::is_none")]
31    pub group: Option<Box<models::GroupName>>,
32}
33
34impl SharePermission {
35    /// Details of a share permission for the filter.
36    pub fn new(r#type: Type) -> SharePermission {
37        SharePermission {
38            id: None,
39            r#type,
40            project: None,
41            role: None,
42            group: None,
43        }
44    }
45}
46/// The type of share permission:   *  `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well.  *  `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well.  *  `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in requests, where it needs to be specify with `projectId` and `projectRoleId`.  *  `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified.  *  `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as the `type`.  *  `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Type {
49    #[serde(rename = "group")]
50    Group,
51    #[serde(rename = "project")]
52    Project,
53    #[serde(rename = "projectRole")]
54    ProjectRole,
55    #[serde(rename = "global")]
56    Global,
57    #[serde(rename = "loggedin")]
58    Loggedin,
59    #[serde(rename = "authenticated")]
60    Authenticated,
61    #[serde(rename = "project-unknown")]
62    ProjectUnknown,
63}
64
65impl Default for Type {
66    fn default() -> Type {
67        Self::Group
68    }
69}
70