Skip to main content

nautobot_openapi/models/
cloud_service_network_assignment.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/// CloudServiceNetworkAssignment : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct CloudServiceNetworkAssignment {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    /// Human friendly display value
20    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
21    pub display: Option<String>,
22    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
23    pub url: Option<String>,
24    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
25    pub natural_slug: Option<String>,
26    #[serde(rename = "cloud_network")]
27    pub cloud_network: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
28    #[serde(rename = "cloud_service")]
29    pub cloud_service: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
30}
31
32impl CloudServiceNetworkAssignment {
33    /// Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
34    pub fn new(
35        cloud_network: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
36        cloud_service: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
37    ) -> CloudServiceNetworkAssignment {
38        CloudServiceNetworkAssignment {
39            id: None,
40            object_type: None,
41            display: None,
42            url: None,
43            natural_slug: None,
44            cloud_network: Box::new(cloud_network),
45            cloud_service: Box::new(cloud_service),
46        }
47    }
48}