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 GetLeadsResponse200DataInner {
    /// The unique ID of the lead in the UUID format
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    /// The title of the lead
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// The ID of the user who owns the lead
    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<i32>,
    /// The ID of the user who created the lead
    #[serde(rename = "creator_id", skip_serializing_if = "Option::is_none")]
    pub creator_id: Option<i32>,
    /// The IDs of the lead labels which are associated with the lead
    #[serde(rename = "label_ids", skip_serializing_if = "Option::is_none")]
    pub label_ids: Option<Vec<uuid::Uuid>>,
    /// The ID of a person which this lead is linked to
    #[serde(rename = "person_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub person_id: Option<Option<i32>>,
    /// The ID of an organization which this lead is linked to
    #[serde(rename = "organization_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub organization_id: Option<Option<i32>>,
    /// Defines where the lead comes from. Will be `API` if the lead was created through the Public API and will be `Manually created` if the lead was created manually through the UI. 
    #[serde(rename = "source_name", skip_serializing_if = "Option::is_none")]
    pub source_name: Option<String>,
    /// A flag indicating whether the lead is archived or not
    #[serde(rename = "is_archived", skip_serializing_if = "Option::is_none")]
    pub is_archived: Option<bool>,
    /// A flag indicating whether the lead was seen by someone in the Pipedrive UI
    #[serde(rename = "was_seen", skip_serializing_if = "Option::is_none")]
    pub was_seen: Option<bool>,
    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
    pub value: Option<Box<crate::models::GetLeadsResponse200DataInnerValue>>,
    /// The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD.
    #[serde(rename = "expected_close_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub expected_close_date: Option<Option<String>>,
    /// The ID of the next activity associated with the lead
    #[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 date and time of when the lead was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
    #[serde(rename = "add_time", skip_serializing_if = "Option::is_none")]
    pub add_time: Option<String>,
    /// The date and time of when the lead was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
    #[serde(rename = "update_time", skip_serializing_if = "Option::is_none")]
    pub update_time: Option<String>,
    #[serde(rename = "visible_to", skip_serializing_if = "Option::is_none")]
    pub visible_to: Option<VisibleTo>,
    /// The BCC email of the lead
    #[serde(rename = "cc_email", skip_serializing_if = "Option::is_none")]
    pub cc_email: Option<String>,
}

impl GetLeadsResponse200DataInner {
    pub fn new() -> GetLeadsResponse200DataInner {
        GetLeadsResponse200DataInner {
            id: None,
            title: None,
            owner_id: None,
            creator_id: None,
            label_ids: None,
            person_id: None,
            organization_id: None,
            source_name: None,
            is_archived: None,
            was_seen: None,
            value: None,
            expected_close_date: None,
            next_activity_id: None,
            add_time: None,
            update_time: None,
            visible_to: None,
            cc_email: None,
        }
    }
}

/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum VisibleTo {
    #[serde(rename = "1")]
    Variant1,
    #[serde(rename = "3")]
    Variant3,
    #[serde(rename = "5")]
    Variant5,
    #[serde(rename = "7")]
    Variant7,
}

impl Default for VisibleTo {
    fn default() -> VisibleTo {
        Self::Variant1
    }
}