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 AddOrganizationRelationshipRequest {
    /// 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")]
    pub r#type: Type,
    /// The owner of the relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter.
    #[serde(rename = "rel_owner_org_id")]
    pub rel_owner_org_id: i32,
    /// The linked organization in the relationship. If type is `parent`, then the linked organization is the daughter.
    #[serde(rename = "rel_linked_org_id")]
    pub rel_linked_org_id: i32,
}

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

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