/*
 * 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
 */

/// PatchedRelationshipRequest : 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>)

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct PatchedRelationshipRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "source_type", skip_serializing_if = "Option::is_none")]
    pub source_type: Option<String>,
    #[serde(rename = "destination_type", skip_serializing_if = "Option::is_none")]
    pub destination_type: Option<String>,
    /// Label of the relationship as displayed to users
    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    /// Internal relationship key. Please use underscores rather than dashes in this key.
    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<crate::models::RelationshipTypeChoices>,
    #[serde(rename = "required_on", skip_serializing_if = "Option::is_none")]
    pub required_on: Option<Box<crate::models::BulkWritableRelationshipRequestRequiredOn>>,
    /// Label for related destination objects, as displayed on the source object.
    #[serde(rename = "source_label", skip_serializing_if = "Option::is_none")]
    pub source_label: Option<String>,
    /// Hide this relationship on the source object.
    #[serde(rename = "source_hidden", skip_serializing_if = "Option::is_none")]
    pub source_hidden: Option<bool>,
    /// Filterset filter matching the applicable source objects of the selected type
    #[serde(
        rename = "source_filter",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub source_filter: Option<Option<serde_json::Value>>,
    /// Label for related source objects, as displayed on the destination object.
    #[serde(rename = "destination_label", skip_serializing_if = "Option::is_none")]
    pub destination_label: Option<String>,
    /// Hide this relationship on the destination object.
    #[serde(rename = "destination_hidden", skip_serializing_if = "Option::is_none")]
    pub destination_hidden: Option<bool>,
    /// Filterset filter matching the applicable destination objects of the selected type
    #[serde(
        rename = "destination_filter",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub destination_filter: Option<Option<serde_json::Value>>,
    /// Hide this field from the object's primary information tab. It will appear in the \"Advanced\" tab instead.
    #[serde(rename = "advanced_ui", skip_serializing_if = "Option::is_none")]
    pub advanced_ui: Option<bool>,
}

impl PatchedRelationshipRequest {
    /// 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>)
    pub fn new() -> PatchedRelationshipRequest {
        PatchedRelationshipRequest {
            id: None,
            source_type: None,
            destination_type: None,
            label: None,
            key: None,
            description: None,
            r#type: None,
            required_on: None,
            source_label: None,
            source_hidden: None,
            source_filter: None,
            destination_label: None,
            destination_hidden: None,
            destination_filter: None,
            advanced_ui: None,
        }
    }
}
