Skip to main content

nautobot_openapi/models/
controller_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/// ControllerRequest : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct ControllerRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(
18        rename = "capabilities",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub capabilities: Option<Option<Vec<crate::models::CapabilitiesEnum>>>,
24    #[serde(rename = "name")]
25    pub name: String,
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    #[serde(rename = "status")]
29    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
30    #[serde(rename = "location")]
31    pub location: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
32    #[serde(
33        rename = "platform",
34        default,
35        with = "::serde_with::rust::double_option",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub platform: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
39    #[serde(
40        rename = "role",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
46    #[serde(
47        rename = "tenant",
48        default,
49        with = "::serde_with::rust::double_option",
50        skip_serializing_if = "Option::is_none"
51    )]
52    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
53    #[serde(
54        rename = "external_integration",
55        default,
56        with = "::serde_with::rust::double_option",
57        skip_serializing_if = "Option::is_none"
58    )]
59    pub external_integration: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
60    #[serde(
61        rename = "controller_device",
62        default,
63        with = "::serde_with::rust::double_option",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub controller_device: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
67    #[serde(
68        rename = "controller_device_redundancy_group",
69        default,
70        with = "::serde_with::rust::double_option",
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub controller_device_redundancy_group:
74        Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
75    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
76    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
77    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
78    pub relationships: Option<
79        ::std::collections::HashMap<
80            String,
81            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
82        >,
83    >,
84    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
85    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
86}
87
88impl ControllerRequest {
89    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
90    pub fn new(
91        name: String,
92        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
93        location: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
94    ) -> ControllerRequest {
95        ControllerRequest {
96            id: None,
97            capabilities: None,
98            name,
99            description: None,
100            status: Box::new(status),
101            location: Box::new(location),
102            platform: None,
103            role: None,
104            tenant: None,
105            external_integration: None,
106            controller_device: None,
107            controller_device_redundancy_group: None,
108            custom_fields: None,
109            relationships: None,
110            tags: None,
111        }
112    }
113}