Skip to main content

netbox_openapi/models/
core_data_sources_create_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.6.0 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct CoreDataSourcesCreateRequest {
13    #[serde(rename = "name")]
14    pub name: String,
15    #[serde(rename = "type")]
16    pub r#type: String,
17    #[serde(rename = "source_url")]
18    pub source_url: String,
19    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
20    pub enabled: Option<bool>,
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
22    pub description: Option<String>,
23    /// * `1` - Minutely * `60` - Hourly * `720` - 12 hours * `1440` - Daily * `10080` - Weekly * `43200` - 30 days
24    #[serde(
25        rename = "sync_interval",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub sync_interval: Option<Option<SyncInterval>>,
31    #[serde(
32        rename = "parameters",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub parameters: Option<Option<serde_json::Value>>,
38    /// Patterns (one per line) matching files or paths to ignore when syncing
39    #[serde(rename = "ignore_rules", skip_serializing_if = "Option::is_none")]
40    pub ignore_rules: Option<String>,
41    #[serde(
42        rename = "owner",
43        default,
44        with = "::serde_with::rust::double_option",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
48    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
49    pub comments: Option<String>,
50    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
51    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
52}
53
54impl CoreDataSourcesCreateRequest {
55    pub fn new(name: String, r#type: String, source_url: String) -> CoreDataSourcesCreateRequest {
56        CoreDataSourcesCreateRequest {
57            name,
58            r#type,
59            source_url,
60            enabled: None,
61            description: None,
62            sync_interval: None,
63            parameters: None,
64            ignore_rules: None,
65            owner: None,
66            comments: None,
67            custom_fields: None,
68        }
69    }
70}
71
72/// * `1` - Minutely * `60` - Hourly * `720` - 12 hours * `1440` - Daily * `10080` - Weekly * `43200` - 30 days
73#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
74pub enum SyncInterval {
75    #[serde(rename = "1")]
76    Variant1,
77    #[serde(rename = "60")]
78    Variant60,
79    #[serde(rename = "720")]
80    Variant720,
81    #[serde(rename = "1440")]
82    Variant1440,
83    #[serde(rename = "10080")]
84    Variant10080,
85    #[serde(rename = "43200")]
86    Variant43200,
87    #[serde(rename = "null")]
88    Null,
89}
90
91impl Default for SyncInterval {
92    fn default() -> SyncInterval {
93        Self::Variant1
94    }
95}