Skip to main content

netbox_openapi/models/
patched_writable_custom_field_choice_set_request.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.5.9-Docker-4.0.2 (4.5)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedWritableCustomFieldChoiceSetRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableCustomFieldChoiceSetRequest {
15    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
16    pub name: Option<String>,
17    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
18    pub description: Option<String>,
19    /// Base set of predefined choices (optional)  * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
20    #[serde(
21        rename = "base_choices",
22        default,
23        with = "::serde_with::rust::double_option",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub base_choices: Option<Option<BaseChoices>>,
27    #[serde(rename = "extra_choices", skip_serializing_if = "Option::is_none")]
28    pub extra_choices: Option<Vec<Vec<serde_json::Value>>>,
29    /// Choices are automatically ordered alphabetically
30    #[serde(
31        rename = "order_alphabetically",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub order_alphabetically: Option<bool>,
35    #[serde(
36        rename = "owner",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
42}
43
44impl PatchedWritableCustomFieldChoiceSetRequest {
45    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
46    pub fn new() -> PatchedWritableCustomFieldChoiceSetRequest {
47        PatchedWritableCustomFieldChoiceSetRequest {
48            name: None,
49            description: None,
50            base_choices: None,
51            extra_choices: None,
52            order_alphabetically: None,
53            owner: None,
54        }
55    }
56}
57
58/// Base set of predefined choices (optional)  * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum BaseChoices {
61    #[serde(rename = "IATA")]
62    Iata,
63    #[serde(rename = "ISO_3166")]
64    Iso3166,
65    #[serde(rename = "UN_LOCODE")]
66    UnLocode,
67    #[serde(rename = "")]
68    Empty,
69    #[serde(rename = "null")]
70    Null,
71}
72
73impl Default for BaseChoices {
74    fn default() -> BaseChoices {
75        Self::Iata
76    }
77}