Skip to main content

netbox_openapi/models/
patched_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/// PatchedBulkDataSourceRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkDataSourceRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// * `None` - --------- * `local` - Local * `git` - Git * `amazon-s3` - Amazon S3
20    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
21    pub r#type: Option<RHashType>,
22    #[serde(rename = "source_url", skip_serializing_if = "Option::is_none")]
23    pub source_url: Option<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 PatchedBulkDataSourceRequest {
60    /// Base serializer class for models inheriting from PrimaryModel.
61    pub fn new(id: i32) -> PatchedBulkDataSourceRequest {
62        PatchedBulkDataSourceRequest {
63            id,
64            name: None,
65            r#type: None,
66            source_url: None,
67            enabled: None,
68            description: None,
69            sync_interval: None,
70            parameters: None,
71            ignore_rules: None,
72            owner: None,
73            comments: None,
74            custom_fields: None,
75        }
76    }
77}
78
79/// * `None` - --------- * `local` - Local * `git` - Git * `amazon-s3` - Amazon S3
80#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
81pub enum RHashType {
82    #[serde(rename = "null")]
83    Null,
84    #[serde(rename = "local")]
85    Local,
86    #[serde(rename = "git")]
87    Git,
88    #[serde(rename = "amazon-s3")]
89    AmazonS3,
90}
91
92impl Default for RHashType {
93    fn default() -> RHashType {
94        Self::Null
95    }
96}
97/// * `1` - Minutely * `60` - Hourly * `720` - 12 hours * `1440` - Daily * `10080` - Weekly * `43200` - 30 days
98#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
99pub enum SyncInterval {
100    #[serde(rename = "1")]
101    Variant1,
102    #[serde(rename = "60")]
103    Variant60,
104    #[serde(rename = "720")]
105    Variant720,
106    #[serde(rename = "1440")]
107    Variant1440,
108    #[serde(rename = "10080")]
109    Variant10080,
110    #[serde(rename = "43200")]
111    Variant43200,
112    #[serde(rename = "null")]
113    Null,
114}
115
116impl Default for SyncInterval {
117    fn default() -> SyncInterval {
118        Self::Variant1
119    }
120}