Skip to main content

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