jira_api_v2/models/
share_permission_input_bean.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SharePermissionInputBean {
16    /// The type of the share permission.Specify the type as follows:   *  `group` Share with a group. Specify `groupname` as well.  *  `project` Share with a project. Specify `projectId` as well.  *  `projectRole` Share with a project role in a project. Specify `projectId` and `projectRoleId` as well.  *  `global` Share globally, including anonymous users. If set, this type overrides all existing share permissions and must be deleted before any non-global share permissions is set.  *  `authenticated` Share with all logged-in users. This shows as `loggedin` in the response. If set, this type overrides all existing share permissions and must be deleted before any non-global share permissions is set.
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    /// The ID of the project to share the filter with. Set `type` to `project`.
20    #[serde(rename = "projectId", skip_serializing_if = "Option::is_none")]
21    pub project_id: Option<String>,
22    /// The name of the group to share the filter with. Set `type` to `group`.
23    #[serde(rename = "groupname", skip_serializing_if = "Option::is_none")]
24    pub groupname: Option<String>,
25    /// The ID of the project role to share the filter with. Set `type` to `projectRole` and the `projectId` for the project that the role is in.
26    #[serde(rename = "projectRoleId", skip_serializing_if = "Option::is_none")]
27    pub project_role_id: Option<String>,
28}
29
30impl SharePermissionInputBean {
31    pub fn new(r#type: Type) -> SharePermissionInputBean {
32        SharePermissionInputBean {
33            r#type,
34            project_id: None,
35            groupname: None,
36            project_role_id: None,
37        }
38    }
39}
40/// The type of the share permission.Specify the type as follows:   *  `group` Share with a group. Specify `groupname` as well.  *  `project` Share with a project. Specify `projectId` as well.  *  `projectRole` Share with a project role in a project. Specify `projectId` and `projectRoleId` as well.  *  `global` Share globally, including anonymous users. If set, this type overrides all existing share permissions and must be deleted before any non-global share permissions is set.  *  `authenticated` Share with all logged-in users. This shows as `loggedin` in the response. If set, this type overrides all existing share permissions and must be deleted before any non-global share permissions is set.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Type {
43    #[serde(rename = "project")]
44    Project,
45    #[serde(rename = "group")]
46    Group,
47    #[serde(rename = "projectRole")]
48    ProjectRole,
49    #[serde(rename = "global")]
50    Global,
51    #[serde(rename = "authenticated")]
52    Authenticated,
53}
54
55impl Default for Type {
56    fn default() -> Type {
57        Self::Project
58    }
59}
60