jira_api_v2/models/
filter.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/// Filter : Details about a filter.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Filter {
17    /// The URL of the filter.
18    #[serde(rename = "self", skip_serializing_if = "Option::is_none")]
19    pub param_self: Option<String>,
20    /// The unique identifier for the filter.
21    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
22    pub id: Option<String>,
23    /// The name of the filter. Must be unique.
24    #[serde(rename = "name")]
25    pub name: String,
26    /// A description of the filter.
27    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
28    pub description: Option<String>,
29    /// The user who owns the filter. This is defaulted to the creator of the filter, however Jira administrators can change the owner of a shared filter in the admin settings.
30    #[serde(rename = "owner", skip_serializing_if = "Option::is_none")]
31    pub owner: Option<Box<models::User>>,
32    /// The JQL query for the filter. For example, *project = SSP AND issuetype = Bug*.
33    #[serde(rename = "jql", skip_serializing_if = "Option::is_none")]
34    pub jql: Option<String>,
35    /// A URL to view the filter results in Jira, using the ID of the filter. For example, *https://your-domain.atlassian.net/issues/?filter=10100*.
36    #[serde(rename = "viewUrl", skip_serializing_if = "Option::is_none")]
37    pub view_url: Option<String>,
38    /// A URL to view the filter results in Jira, using the [Search for issues using JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For example, *https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug*.
39    #[serde(rename = "searchUrl", skip_serializing_if = "Option::is_none")]
40    pub search_url: Option<String>,
41    /// Whether the filter is selected as a favorite.
42    #[serde(rename = "favourite", skip_serializing_if = "Option::is_none")]
43    pub favourite: Option<bool>,
44    /// The count of how many users have selected this filter as a favorite, including the filter owner.
45    #[serde(rename = "favouritedCount", skip_serializing_if = "Option::is_none")]
46    pub favourited_count: Option<i64>,
47    /// The groups and projects that the filter is shared with.
48    #[serde(rename = "sharePermissions", skip_serializing_if = "Option::is_none")]
49    pub share_permissions: Option<Vec<models::SharePermission>>,
50    /// A paginated list of the users that the filter is shared with. This includes users that are members of the groups or can browse the projects that the filter is shared with.
51    #[serde(rename = "sharedUsers", skip_serializing_if = "Option::is_none")]
52    pub shared_users: Option<Box<models::UserList>>,
53    /// A paginated list of the users that are subscribed to the filter.
54    #[serde(rename = "subscriptions", skip_serializing_if = "Option::is_none")]
55    pub subscriptions: Option<Box<models::FilterSubscriptionsList>>,
56}
57
58impl Filter {
59    /// Details about a filter.
60    pub fn new(name: String) -> Filter {
61        Filter {
62            param_self: None,
63            id: None,
64            name,
65            description: None,
66            owner: None,
67            jql: None,
68            view_url: None,
69            search_url: None,
70            favourite: None,
71            favourited_count: None,
72            share_permissions: None,
73            shared_users: None,
74            subscriptions: None,
75        }
76    }
77}
78