jira_api_v2/models/
order_of_custom_field_options.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/// OrderOfCustomFieldOptions : An ordered list of custom field option IDs and information on where to move them.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OrderOfCustomFieldOptions {
17    /// A list of IDs of custom field options to move. The order of the custom field option IDs in the list is the order they are given after the move. The list must contain custom field options or cascading options, but not both.
18    #[serde(rename = "customFieldOptionIds")]
19    pub custom_field_option_ids: Vec<String>,
20    /// The ID of the custom field option or cascading option to place the moved options after. Required if `position` isn't provided.
21    #[serde(rename = "after", skip_serializing_if = "Option::is_none")]
22    pub after: Option<String>,
23    /// The position the custom field options should be moved to. Required if `after` isn't provided.
24    #[serde(rename = "position", skip_serializing_if = "Option::is_none")]
25    pub position: Option<Position>,
26}
27
28impl OrderOfCustomFieldOptions {
29    /// An ordered list of custom field option IDs and information on where to move them.
30    pub fn new(custom_field_option_ids: Vec<String>) -> OrderOfCustomFieldOptions {
31        OrderOfCustomFieldOptions {
32            custom_field_option_ids,
33            after: None,
34            position: None,
35        }
36    }
37}
38/// The position the custom field options should be moved to. Required if `after` isn't provided.
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum Position {
41    #[serde(rename = "First")]
42    First,
43    #[serde(rename = "Last")]
44    Last,
45}
46
47impl Default for Position {
48    fn default() -> Position {
49        Self::First
50    }
51}
52