jira_api_v2/models/
jira_expression_analysis.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/// JiraExpressionAnalysis : Details about the analysed Jira expression.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct JiraExpressionAnalysis {
17    /// The analysed expression.
18    #[serde(rename = "expression")]
19    pub expression: String,
20    /// A list of validation errors. Not included if the expression is valid.
21    #[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
22    pub errors: Option<Vec<models::JiraExpressionValidationError>>,
23    /// Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime (for example, if it executes too many expensive operations).
24    #[serde(rename = "valid")]
25    pub valid: bool,
26    /// EXPERIMENTAL. The inferred type of the expression.
27    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
28    pub r#type: Option<String>,
29    #[serde(rename = "complexity", skip_serializing_if = "Option::is_none")]
30    pub complexity: Option<Box<models::JiraExpressionComplexity>>,
31}
32
33impl JiraExpressionAnalysis {
34    /// Details about the analysed Jira expression.
35    pub fn new(expression: String, valid: bool) -> JiraExpressionAnalysis {
36        JiraExpressionAnalysis {
37            expression,
38            errors: None,
39            valid,
40            r#type: None,
41            complexity: None,
42        }
43    }
44}
45