Skip to main content

netbox_openapi/models/
bulk_data_source_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.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// BulkDataSourceRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkDataSourceRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name")]
18    pub name: String,
19    /// * `None` - --------- * `local` - Local * `git` - Git * `amazon-s3` - Amazon S3
20    #[serde(rename = "type")]
21    pub r#type: RHashType,
22    #[serde(rename = "source_url")]
23    pub source_url: String,
24    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
25    pub enabled: Option<bool>,
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    /// * `1` - Minutely * `60` - Hourly * `720` - 12 hours * `1440` - Daily * `10080` - Weekly * `43200` - 30 days
29    #[serde(
30        rename = "sync_interval",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub sync_interval: Option<Option<SyncInterval>>,
36    #[serde(
37        rename = "parameters",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub parameters: Option<Option<serde_json::Value>>,
43    /// Patterns (one per line) matching files or paths to ignore when syncing
44    #[serde(rename = "ignore_rules", skip_serializing_if = "Option::is_none")]
45    pub ignore_rules: Option<String>,
46    #[serde(
47        rename = "owner",
48        default,
49        with = "::serde_with::rust::double_option",
50        skip_serializing_if = "Option::is_none"
51    )]
52    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
53    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
54    pub comments: Option<String>,
55    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
56    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
57}
58
59impl BulkDataSourceRequest {
60    /// Base serializer class for models inheriting from PrimaryModel.
61    pub fn new(
62        id: i32,
63        name: String,
64        r#type: RHashType,
65        source_url: String,
66    ) -> BulkDataSourceRequest {
67        BulkDataSourceRequest {
68            id,
69            name,
70            r#type,
71            source_url,
72            enabled: None,
73            description: None,
74            sync_interval: None,
75            parameters: None,
76            ignore_rules: None,
77            owner: None,
78            comments: None,
79            custom_fields: None,
80        }
81    }
82}
83
84/// * `None` - --------- * `local` - Local * `git` - Git * `amazon-s3` - Amazon S3
85#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
86pub enum RHashType {
87    #[serde(rename = "null")]
88    Null,
89    #[serde(rename = "local")]
90    Local,
91    #[serde(rename = "git")]
92    Git,
93    #[serde(rename = "amazon-s3")]
94    AmazonS3,
95}
96
97impl Default for RHashType {
98    fn default() -> RHashType {
99        Self::Null
100    }
101}
102/// * `1` - Minutely * `60` - Hourly * `720` - 12 hours * `1440` - Daily * `10080` - Weekly * `43200` - 30 days
103#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
104pub enum SyncInterval {
105    #[serde(rename = "1")]
106    Variant1,
107    #[serde(rename = "60")]
108    Variant60,
109    #[serde(rename = "720")]
110    Variant720,
111    #[serde(rename = "1440")]
112    Variant1440,
113    #[serde(rename = "10080")]
114    Variant10080,
115    #[serde(rename = "43200")]
116    Variant43200,
117    #[serde(rename = "null")]
118    Null,
119}
120
121impl Default for SyncInterval {
122    fn default() -> SyncInterval {
123        Self::Variant1
124    }
125}