jira_api_v2/models/
jira_expression_validation_error.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/// JiraExpressionValidationError : Details about syntax and type errors. The error details apply to the entire expression, unless the object includes:   *  `line` and `column`  *  `expression`
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct JiraExpressionValidationError {
17    /// The text line in which the error occurred.
18    #[serde(rename = "line", skip_serializing_if = "Option::is_none")]
19    pub line: Option<i32>,
20    /// The text column in which the error occurred.
21    #[serde(rename = "column", skip_serializing_if = "Option::is_none")]
22    pub column: Option<i32>,
23    /// The part of the expression in which the error occurred.
24    #[serde(rename = "expression", skip_serializing_if = "Option::is_none")]
25    pub expression: Option<String>,
26    /// Details about the error.
27    #[serde(rename = "message")]
28    pub message: String,
29    /// The error type.
30    #[serde(rename = "type")]
31    pub r#type: Type,
32}
33
34impl JiraExpressionValidationError {
35    /// Details about syntax and type errors. The error details apply to the entire expression, unless the object includes:   *  `line` and `column`  *  `expression`
36    pub fn new(message: String, r#type: Type) -> JiraExpressionValidationError {
37        JiraExpressionValidationError {
38            line: None,
39            column: None,
40            expression: None,
41            message,
42            r#type,
43        }
44    }
45}
46/// The error type.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Type {
49    #[serde(rename = "syntax")]
50    Syntax,
51    #[serde(rename = "type")]
52    Type,
53    #[serde(rename = "other")]
54    Other,
55}
56
57impl Default for Type {
58    fn default() -> Type {
59        Self::Syntax
60    }
61}
62