Skip to main content

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