jira_api_v2/models/
compound_clause.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/// CompoundClause : A JQL query clause that consists of nested clauses. For example, `(labels in (urgent, blocker) OR lastCommentedBy = currentUser()). Note that, where nesting is not defined, the parser nests JQL clauses based on the operator precedence. For example, \"A OR B AND C\" is parsed as \"(A OR B) AND C\". See Setting the precedence of operators for more information about precedence in JQL queries.`
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CompoundClause {
17    /// The list of nested clauses.
18    #[serde(rename = "clauses")]
19    pub clauses: Vec<models::JqlQueryClause>,
20    /// The operator between the clauses.
21    #[serde(rename = "operator")]
22    pub operator: Operator,
23}
24
25impl CompoundClause {
26    /// A JQL query clause that consists of nested clauses. For example, `(labels in (urgent, blocker) OR lastCommentedBy = currentUser()). Note that, where nesting is not defined, the parser nests JQL clauses based on the operator precedence. For example, \"A OR B AND C\" is parsed as \"(A OR B) AND C\". See Setting the precedence of operators for more information about precedence in JQL queries.`
27    pub fn new(clauses: Vec<models::JqlQueryClause>, operator: Operator) -> CompoundClause {
28        CompoundClause {
29            clauses,
30            operator,
31        }
32    }
33}
34/// The operator between the clauses.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Operator {
37    #[serde(rename = "and")]
38    And,
39    #[serde(rename = "or")]
40    Or,
41    #[serde(rename = "not")]
42    Not,
43}
44
45impl Default for Operator {
46    fn default() -> Operator {
47        Self::And
48    }
49}
50