Skip to main content

nautobot_openapi/models/
export_template_request.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// ExportTemplateRequest : Extend ValidatedModelSerializer with a `relationships` field.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct ExportTemplateRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "content_type")]
18    pub content_type: String,
19    #[serde(
20        rename = "owner_content_type",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub owner_content_type: Option<Option<String>>,
26    #[serde(
27        rename = "owner_object_id",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub owner_object_id: Option<Option<uuid::Uuid>>,
33    #[serde(rename = "name")]
34    pub name: String,
35    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
36    pub description: Option<String>,
37    /// The list of objects being exported is passed as a context variable named <code>queryset</code>.
38    #[serde(rename = "template_code")]
39    pub template_code: String,
40    /// Defaults to <code>text/plain</code>
41    #[serde(rename = "mime_type", skip_serializing_if = "Option::is_none")]
42    pub mime_type: Option<String>,
43    /// Extension to append to the rendered filename
44    #[serde(rename = "file_extension", skip_serializing_if = "Option::is_none")]
45    pub file_extension: Option<String>,
46    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
47    pub relationships: Option<
48        ::std::collections::HashMap<
49            String,
50            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
51        >,
52    >,
53}
54
55impl ExportTemplateRequest {
56    /// Extend ValidatedModelSerializer with a `relationships` field.
57    pub fn new(content_type: String, name: String, template_code: String) -> ExportTemplateRequest {
58        ExportTemplateRequest {
59            id: None,
60            content_type,
61            owner_content_type: None,
62            owner_object_id: None,
63            name,
64            description: None,
65            template_code,
66            mime_type: None,
67            file_extension: None,
68            relationships: None,
69        }
70    }
71}