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 UpdatePersonRequest {
    /// The name of the person
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used.
    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<i32>,
    /// The ID of the organization this person will belong to
    #[serde(rename = "org_id", skip_serializing_if = "Option::is_none")]
    pub org_id: Option<i32>,
    /// 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::BasicPersonRequestEmailInner>>,
    /// 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>>,
    #[serde(rename = "visible_to", skip_serializing_if = "Option::is_none")]
    pub visible_to: Option<VisibleTo>,
    #[serde(rename = "marketing_status", skip_serializing_if = "Option::is_none")]
    pub marketing_status: Option<MarketingStatus>,
    /// The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS
    #[serde(rename = "add_time", skip_serializing_if = "Option::is_none")]
    pub add_time: Option<String>,
}

impl UpdatePersonRequest {
    pub fn new() -> UpdatePersonRequest {
        UpdatePersonRequest {
            name: None,
            owner_id: None,
            org_id: None,
            email: None,
            phone: None,
            visible_to: None,
            marketing_status: None,
            add_time: 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
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MarketingStatus {
    #[serde(rename = "no_consent")]
    NoConsent,
    #[serde(rename = "unsubscribed")]
    Unsubscribed,
    #[serde(rename = "subscribed")]
    Subscribed,
    #[serde(rename = "archived")]
    Archived,
}

impl Default for MarketingStatus {
    fn default() -> MarketingStatus {
        Self::NoConsent
    }
}