jira_api_v2/models/
field_was_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/// FieldWasClause : A clause that asserts a previous value of a field. For example, `status WAS \"Resolved\" BY currentUser() BEFORE \"2019/02/02\"`. See [WAS](https://confluence.atlassian.com/x/dgiiLQ#Advancedsearching-operatorsreference-WASWAS) for more information about the WAS operator.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FieldWasClause {
17    #[serde(rename = "field")]
18    pub field: Box<models::JqlQueryField>,
19    /// The operator between the field and operand.
20    #[serde(rename = "operator")]
21    pub operator: Operator,
22    #[serde(rename = "operand")]
23    pub operand: Box<models::JqlQueryClauseOperand>,
24    /// The list of time predicates.
25    #[serde(rename = "predicates")]
26    pub predicates: Vec<models::JqlQueryClauseTimePredicate>,
27}
28
29impl FieldWasClause {
30    /// A clause that asserts a previous value of a field. For example, `status WAS \"Resolved\" BY currentUser() BEFORE \"2019/02/02\"`. See [WAS](https://confluence.atlassian.com/x/dgiiLQ#Advancedsearching-operatorsreference-WASWAS) for more information about the WAS operator.
31    pub fn new(field: models::JqlQueryField, operator: Operator, operand: models::JqlQueryClauseOperand, predicates: Vec<models::JqlQueryClauseTimePredicate>) -> FieldWasClause {
32        FieldWasClause {
33            field: Box::new(field),
34            operator,
35            operand: Box::new(operand),
36            predicates,
37        }
38    }
39}
40/// The operator between the field and operand.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Operator {
43    #[serde(rename = "was")]
44    Was,
45    #[serde(rename = "was in")]
46    WasIn,
47    #[serde(rename = "was not in")]
48    WasNotIn,
49    #[serde(rename = "was not")]
50    WasNot,
51}
52
53impl Default for Operator {
54    fn default() -> Operator {
55        Self::Was
56    }
57}
58