Skip to main content

netbox_openapi/models/
bulk_config_template_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/// BulkConfigTemplateRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkConfigTemplateRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
20    pub description: Option<String>,
21    /// Any additional parameters (<https://jinja.palletsprojects.com/en/stable/api/#jinja2.Environment>) to pass when constructing the Jinja environment
22    #[serde(
23        rename = "environment_params",
24        default,
25        with = "::serde_with::rust::double_option",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub environment_params: Option<Option<serde_json::Value>>,
29    /// Jinja template code.
30    #[serde(rename = "template_code")]
31    pub template_code: String,
32    /// Defaults to <code>text/plain; charset=utf-8</code>
33    #[serde(rename = "mime_type", skip_serializing_if = "Option::is_none")]
34    pub mime_type: Option<String>,
35    /// Filename to give to the rendered export file
36    #[serde(rename = "file_name", skip_serializing_if = "Option::is_none")]
37    pub file_name: Option<String>,
38    /// Extension to append to the rendered filename
39    #[serde(rename = "file_extension", skip_serializing_if = "Option::is_none")]
40    pub file_extension: Option<String>,
41    /// Download file as attachment
42    #[serde(rename = "as_attachment", skip_serializing_if = "Option::is_none")]
43    pub as_attachment: Option<bool>,
44    /// Enable verbose error output when rendering this template. Not recommended for production use.
45    #[serde(rename = "debug", skip_serializing_if = "Option::is_none")]
46    pub debug: Option<bool>,
47    #[serde(rename = "data_source", skip_serializing_if = "Option::is_none")]
48    pub data_source: Option<Box<crate::models::BulkConfigContextProfileRequestDataSource>>,
49    /// Enable automatic synchronization of data when the data file is updated
50    #[serde(rename = "auto_sync_enabled", skip_serializing_if = "Option::is_none")]
51    pub auto_sync_enabled: Option<bool>,
52    #[serde(
53        rename = "owner",
54        default,
55        with = "::serde_with::rust::double_option",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
59    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
60    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
61}
62
63impl BulkConfigTemplateRequest {
64    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
65    pub fn new(id: i32, name: String, template_code: String) -> BulkConfigTemplateRequest {
66        BulkConfigTemplateRequest {
67            id,
68            name,
69            description: None,
70            environment_params: None,
71            template_code,
72            mime_type: None,
73            file_name: None,
74            file_extension: None,
75            as_attachment: None,
76            debug: None,
77            data_source: None,
78            auto_sync_enabled: None,
79            owner: None,
80            tags: None,
81        }
82    }
83}