jira_api_v2/models/
field.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/// Field : Details of a field.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Field {
17    /// The ID of the field.
18    #[serde(rename = "id")]
19    pub id: String,
20    /// The name of the field.
21    #[serde(rename = "name")]
22    pub name: String,
23    #[serde(rename = "schema")]
24    pub schema: Box<models::JsonTypeBean>,
25    /// The description of the field.
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    /// The key of the field.
29    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
30    pub key: Option<String>,
31    /// Whether the field is locked.
32    #[serde(rename = "isLocked", skip_serializing_if = "Option::is_none")]
33    pub is_locked: Option<bool>,
34    /// The searcher key of the field. Returned for custom fields.
35    #[serde(rename = "searcherKey", skip_serializing_if = "Option::is_none")]
36    pub searcher_key: Option<String>,
37    /// Number of screens where the field is used.
38    #[serde(rename = "screensCount", skip_serializing_if = "Option::is_none")]
39    pub screens_count: Option<i64>,
40    /// Number of contexts where the field is used.
41    #[serde(rename = "contextsCount", skip_serializing_if = "Option::is_none")]
42    pub contexts_count: Option<i64>,
43    #[serde(rename = "lastUsed", skip_serializing_if = "Option::is_none")]
44    pub last_used: Option<Box<models::FieldLastUsed>>,
45}
46
47impl Field {
48    /// Details of a field.
49    pub fn new(id: String, name: String, schema: models::JsonTypeBean) -> Field {
50        Field {
51            id,
52            name,
53            schema: Box::new(schema),
54            description: None,
55            key: None,
56            is_locked: None,
57            searcher_key: None,
58            screens_count: None,
59            contexts_count: None,
60            last_used: None,
61        }
62    }
63}
64