pipedrive-rs 0.1.0

Rust PipedriveClient
Documentation
/*
 * Pipedrive API v1
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrganizationRelationship {
    /// The ID of the base organization for the returned calculated values
    #[serde(rename = "org_id", skip_serializing_if = "Option::is_none")]
    pub org_id: Option<i32>,
    /// The type of organization relationship
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// The owner of this relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter.
    #[serde(rename = "rel_owner_org_id", skip_serializing_if = "Option::is_none")]
    pub rel_owner_org_id: Option<i32>,
    /// The linked organization in this relationship. If type is `parent`, then the linked organization is the daughter.
    #[serde(rename = "rel_linked_org_id", skip_serializing_if = "Option::is_none")]
    pub rel_linked_org_id: Option<i32>,
}

impl OrganizationRelationship {
    pub fn new() -> OrganizationRelationship {
        OrganizationRelationship {
            org_id: None,
            r#type: None,
            rel_owner_org_id: None,
            rel_linked_org_id: None,
        }
    }
}

/// The type of organization relationship
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "parent")]
    Parent,
    #[serde(rename = "related")]
    Related,
}

impl Default for Type {
    fn default() -> Type {
        Self::Parent
    }
}