pipedrive_rs/models/
add_organization_relationship_request.rs

1/*
2 * Pipedrive API v1
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AddOrganizationRelationshipRequest {
16    /// The ID of the base organization for the returned calculated values
17    #[serde(rename = "org_id", skip_serializing_if = "Option::is_none")]
18    pub org_id: Option<i32>,
19    /// The type of organization relationship
20    #[serde(rename = "type")]
21    pub r#type: Type,
22    /// The owner of the relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter.
23    #[serde(rename = "rel_owner_org_id")]
24    pub rel_owner_org_id: i32,
25    /// The linked organization in the relationship. If type is `parent`, then the linked organization is the daughter.
26    #[serde(rename = "rel_linked_org_id")]
27    pub rel_linked_org_id: i32,
28}
29
30impl AddOrganizationRelationshipRequest {
31    pub fn new(r#type: Type, rel_owner_org_id: i32, rel_linked_org_id: i32) -> AddOrganizationRelationshipRequest {
32        AddOrganizationRelationshipRequest {
33            org_id: None,
34            r#type,
35            rel_owner_org_id,
36            rel_linked_org_id,
37        }
38    }
39}
40
41/// The type of organization relationship
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Type {
44    #[serde(rename = "parent")]
45    Parent,
46    #[serde(rename = "related")]
47    Related,
48}
49
50impl Default for Type {
51    fn default() -> Type {
52        Self::Parent
53    }
54}
55