jira_api_v2/models/
field_metadata.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/// FieldMetadata : The metadata describing an issue field.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FieldMetadata {
17    /// Whether the field is required.
18    #[serde(rename = "required")]
19    pub required: bool,
20    /// The data type of the field.
21    #[serde(rename = "schema")]
22    pub schema: Box<models::JsonTypeBean>,
23    /// The name of the field.
24    #[serde(rename = "name")]
25    pub name: String,
26    /// The key of the field.
27    #[serde(rename = "key")]
28    pub key: String,
29    /// The URL that can be used to automatically complete the field.
30    #[serde(rename = "autoCompleteUrl", skip_serializing_if = "Option::is_none")]
31    pub auto_complete_url: Option<String>,
32    /// Whether the field has a default value.
33    #[serde(rename = "hasDefaultValue", skip_serializing_if = "Option::is_none")]
34    pub has_default_value: Option<bool>,
35    /// The list of operations that can be performed on the field.
36    #[serde(rename = "operations")]
37    pub operations: Vec<String>,
38    /// The list of values allowed in the field.
39    #[serde(rename = "allowedValues", skip_serializing_if = "Option::is_none")]
40    pub allowed_values: Option<Vec<serde_json::Value>>,
41    /// The default value of the field.
42    #[serde(rename = "defaultValue", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub default_value: Option<Option<serde_json::Value>>,
44}
45
46impl FieldMetadata {
47    /// The metadata describing an issue field.
48    pub fn new(required: bool, schema: models::JsonTypeBean, name: String, key: String, operations: Vec<String>) -> FieldMetadata {
49        FieldMetadata {
50            required,
51            schema: Box::new(schema),
52            name,
53            key,
54            auto_complete_url: None,
55            has_default_value: None,
56            operations,
57            allowed_values: None,
58            default_value: None,
59        }
60    }
61}
62