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 PersonItem {
    /// The ID of the person
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    /// The ID of the company related to the person
    #[serde(rename = "company_id", skip_serializing_if = "Option::is_none")]
    pub company_id: Option<i32>,
    /// Whether the person is active or not
    #[serde(rename = "active_flag", skip_serializing_if = "Option::is_none")]
    pub active_flag: Option<bool>,
    /// A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required.
    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<Vec<crate::models::PersonItemAllOfPhoneInner>>,
    /// An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" } ]`. Please note that only `value` is required.
    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    pub email: Option<Vec<crate::models::PersonItemAllOfEmailInner>>,
    /// The first letter of the name of the person
    #[serde(rename = "first_char", skip_serializing_if = "Option::is_none")]
    pub first_char: Option<String>,
    /// The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS
    #[serde(rename = "add_time", skip_serializing_if = "Option::is_none")]
    pub add_time: Option<String>,
    /// The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS
    #[serde(rename = "update_time", skip_serializing_if = "Option::is_none")]
    pub update_time: Option<String>,
    /// The visibility group ID of who can see the person
    #[serde(rename = "visible_to", skip_serializing_if = "Option::is_none")]
    pub visible_to: Option<String>,
    #[serde(rename = "picture_id", skip_serializing_if = "Option::is_none")]
    pub picture_id: Option<Box<crate::models::PersonItemAllOfPictureId>>,
    /// The label assigned to the person
    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
    pub label: Option<i32>,
    /// The name of the organization associated with the person
    #[serde(rename = "org_name", skip_serializing_if = "Option::is_none")]
    pub org_name: Option<String>,
    /// The name of the owner associated with the person
    #[serde(rename = "owner_name", skip_serializing_if = "Option::is_none")]
    pub owner_name: Option<String>,
    /// The BCC email associated with the person
    #[serde(rename = "cc_email", skip_serializing_if = "Option::is_none")]
    pub cc_email: Option<String>,
    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<Box<crate::models::Owner>>,
    #[serde(rename = "org_id", skip_serializing_if = "Option::is_none")]
    pub org_id: Option<Box<crate::models::RelationshipOrganizationInfoItemWithActiveFlag>>,
    /// The name of the person
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The first name of the person
    #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")]
    pub first_name: Option<String>,
    /// The last name of the person
    #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")]
    pub last_name: Option<String>,
    /// The count of email messages related to the person
    #[serde(rename = "email_messages_count", skip_serializing_if = "Option::is_none")]
    pub email_messages_count: Option<i32>,
    /// The count of activities related to the person
    #[serde(rename = "activities_count", skip_serializing_if = "Option::is_none")]
    pub activities_count: Option<i32>,
    /// The count of done activities related to the person
    #[serde(rename = "done_activities_count", skip_serializing_if = "Option::is_none")]
    pub done_activities_count: Option<i32>,
    /// The count of undone activities related to the person
    #[serde(rename = "undone_activities_count", skip_serializing_if = "Option::is_none")]
    pub undone_activities_count: Option<i32>,
    /// The count of files related to the person
    #[serde(rename = "files_count", skip_serializing_if = "Option::is_none")]
    pub files_count: Option<i32>,
    /// The count of notes related to the person
    #[serde(rename = "notes_count", skip_serializing_if = "Option::is_none")]
    pub notes_count: Option<i32>,
    /// The count of followers related to the person
    #[serde(rename = "followers_count", skip_serializing_if = "Option::is_none")]
    pub followers_count: Option<i32>,
    /// The date and time of the last incoming email associated with the person
    #[serde(rename = "last_incoming_mail_time", skip_serializing_if = "Option::is_none")]
    pub last_incoming_mail_time: Option<String>,
    /// The date and time of the last outgoing email associated with the person
    #[serde(rename = "last_outgoing_mail_time", skip_serializing_if = "Option::is_none")]
    pub last_outgoing_mail_time: Option<String>,
    /// The count of open deals related with the item
    #[serde(rename = "open_deals_count", skip_serializing_if = "Option::is_none")]
    pub open_deals_count: Option<i32>,
    /// The count of related open deals related with the item
    #[serde(rename = "related_open_deals_count", skip_serializing_if = "Option::is_none")]
    pub related_open_deals_count: Option<i32>,
    /// The count of closed deals related with the item
    #[serde(rename = "closed_deals_count", skip_serializing_if = "Option::is_none")]
    pub closed_deals_count: Option<i32>,
    /// The count of related closed deals related with the item
    #[serde(rename = "related_closed_deals_count", skip_serializing_if = "Option::is_none")]
    pub related_closed_deals_count: Option<i32>,
    /// The count of won deals related with the item
    #[serde(rename = "won_deals_count", skip_serializing_if = "Option::is_none")]
    pub won_deals_count: Option<i32>,
    /// The count of related won deals related with the item
    #[serde(rename = "related_won_deals_count", skip_serializing_if = "Option::is_none")]
    pub related_won_deals_count: Option<i32>,
    /// The count of lost deals related with the item
    #[serde(rename = "lost_deals_count", skip_serializing_if = "Option::is_none")]
    pub lost_deals_count: Option<i32>,
    /// The count of related lost deals related with the item
    #[serde(rename = "related_lost_deals_count", skip_serializing_if = "Option::is_none")]
    pub related_lost_deals_count: Option<i32>,
    /// The date of the next activity associated with the deal
    #[serde(rename = "next_activity_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub next_activity_date: Option<Option<String>>,
    /// The time of the next activity associated with the deal
    #[serde(rename = "next_activity_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub next_activity_time: Option<Option<String>>,
    /// The ID of the next activity associated with the deal
    #[serde(rename = "next_activity_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub next_activity_id: Option<Option<i32>>,
    /// The ID of the last activity associated with the deal
    #[serde(rename = "last_activity_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_activity_id: Option<Option<i32>>,
    /// The date of the last activity associated with the deal
    #[serde(rename = "last_activity_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_activity_date: Option<Option<String>>,
}

impl PersonItem {
    pub fn new() -> PersonItem {
        PersonItem {
            id: None,
            company_id: None,
            active_flag: None,
            phone: None,
            email: None,
            first_char: None,
            add_time: None,
            update_time: None,
            visible_to: None,
            picture_id: None,
            label: None,
            org_name: None,
            owner_name: None,
            cc_email: None,
            owner_id: None,
            org_id: None,
            name: None,
            first_name: None,
            last_name: None,
            email_messages_count: None,
            activities_count: None,
            done_activities_count: None,
            undone_activities_count: None,
            files_count: None,
            notes_count: None,
            followers_count: None,
            last_incoming_mail_time: None,
            last_outgoing_mail_time: None,
            open_deals_count: None,
            related_open_deals_count: None,
            closed_deals_count: None,
            related_closed_deals_count: None,
            won_deals_count: None,
            related_won_deals_count: None,
            lost_deals_count: None,
            related_lost_deals_count: None,
            next_activity_date: None,
            next_activity_time: None,
            next_activity_id: None,
            last_activity_id: None,
            last_activity_date: None,
        }
    }
}