pipedrive_rs/models/
update_person_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 UpdatePersonRequest {
16    /// The name of the person
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used.
20    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
21    pub owner_id: Option<i32>,
22    /// The ID of the organization this person will belong to
23    #[serde(rename = "org_id", skip_serializing_if = "Option::is_none")]
24    pub org_id: Option<i32>,
25    /// 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.
26    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
27    pub email: Option<Vec<crate::models::BasicPersonRequestEmailInner>>,
28    /// 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.
29    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
30    pub phone: Option<Vec<crate::models::PersonItemAllOfPhoneInner>>,
31    #[serde(rename = "visible_to", skip_serializing_if = "Option::is_none")]
32    pub visible_to: Option<VisibleTo>,
33    #[serde(rename = "marketing_status", skip_serializing_if = "Option::is_none")]
34    pub marketing_status: Option<MarketingStatus>,
35    /// The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS
36    #[serde(rename = "add_time", skip_serializing_if = "Option::is_none")]
37    pub add_time: Option<String>,
38}
39
40impl UpdatePersonRequest {
41    pub fn new() -> UpdatePersonRequest {
42        UpdatePersonRequest {
43            name: None,
44            owner_id: None,
45            org_id: None,
46            email: None,
47            phone: None,
48            visible_to: None,
49            marketing_status: None,
50            add_time: None,
51        }
52    }
53}
54
55/// 
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum VisibleTo {
58    #[serde(rename = "1")]
59    Variant1,
60    #[serde(rename = "3")]
61    Variant3,
62    #[serde(rename = "5")]
63    Variant5,
64    #[serde(rename = "7")]
65    Variant7,
66}
67
68impl Default for VisibleTo {
69    fn default() -> VisibleTo {
70        Self::Variant1
71    }
72}
73/// 
74#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
75pub enum MarketingStatus {
76    #[serde(rename = "no_consent")]
77    NoConsent,
78    #[serde(rename = "unsubscribed")]
79    Unsubscribed,
80    #[serde(rename = "subscribed")]
81    Subscribed,
82    #[serde(rename = "archived")]
83    Archived,
84}
85
86impl Default for MarketingStatus {
87    fn default() -> MarketingStatus {
88        Self::NoConsent
89    }
90}
91