nautobot-openapi 0.4.0

low level nautobot bindings (generated by openapi-generator)
Documentation
/*
 * API Documentation
 *
 * Source of truth and network automation platform
 *
 * The version of the OpenAPI document: 3.1.0 (3.1)
 *
 * Generated by: https://openapi-generator.tech
 */

/// LocationRequest : Add a `tree_depth` field to non-nested model serializers based on django-tree-queries.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct LocationRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(
        rename = "time_zone",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub time_zone: Option<Option<String>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Local facility ID or description
    #[serde(rename = "facility", skip_serializing_if = "Option::is_none")]
    pub facility: Option<String>,
    /// 32-bit autonomous system number
    #[serde(
        rename = "asn",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub asn: Option<Option<i64>>,
    #[serde(rename = "physical_address", skip_serializing_if = "Option::is_none")]
    pub physical_address: Option<String>,
    #[serde(rename = "shipping_address", skip_serializing_if = "Option::is_none")]
    pub shipping_address: Option<String>,
    /// GPS coordinate (latitude)
    #[serde(
        rename = "latitude",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub latitude: Option<Option<String>>,
    /// GPS coordinate (longitude)
    #[serde(
        rename = "longitude",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub longitude: Option<Option<String>>,
    #[serde(rename = "contact_name", skip_serializing_if = "Option::is_none")]
    pub contact_name: Option<String>,
    #[serde(rename = "contact_phone", skip_serializing_if = "Option::is_none")]
    pub contact_phone: Option<String>,
    #[serde(rename = "contact_email", skip_serializing_if = "Option::is_none")]
    pub contact_email: Option<String>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<String>,
    #[serde(
        rename = "parent",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub parent: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "location_type")]
    pub location_type: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(rename = "status")]
    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(
        rename = "tenant",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
    pub relationships: Option<
        ::std::collections::HashMap<
            String,
            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
        >,
    >,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
}

impl LocationRequest {
    /// Add a `tree_depth` field to non-nested model serializers based on django-tree-queries.
    pub fn new(
        name: String,
        location_type: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> LocationRequest {
        LocationRequest {
            id: None,
            time_zone: None,
            name,
            description: None,
            facility: None,
            asn: None,
            physical_address: None,
            shipping_address: None,
            latitude: None,
            longitude: None,
            contact_name: None,
            contact_phone: None,
            contact_email: None,
            comments: None,
            parent: None,
            location_type: Box::new(location_type),
            status: Box::new(status),
            tenant: None,
            custom_fields: None,
            relationships: None,
            tags: None,
        }
    }
}