pipedrive_rs/models/
add_activity_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 AddActivityRequest {
16    /// The due date of the activity. Format: YYYY-MM-DD
17    #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")]
18    pub due_date: Option<String>,
19    /// The due time of the activity in UTC. Format: HH:MM
20    #[serde(rename = "due_time", skip_serializing_if = "Option::is_none")]
21    pub due_time: Option<String>,
22    /// The duration of the activity. Format: HH:MM
23    #[serde(rename = "duration", skip_serializing_if = "Option::is_none")]
24    pub duration: Option<String>,
25    /// The ID of the deal this activity is associated with
26    #[serde(rename = "deal_id", skip_serializing_if = "Option::is_none")]
27    pub deal_id: Option<i32>,
28    /// The ID of the lead in the UUID format this activity is associated with
29    #[serde(rename = "lead_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub lead_id: Option<Option<uuid::Uuid>>,
31    /// The ID of the person this activity is associated with
32    #[serde(rename = "person_id", skip_serializing_if = "Option::is_none")]
33    pub person_id: Option<i32>,
34    /// The ID of the project this activity is associated with
35    #[serde(rename = "project_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub project_id: Option<Option<i32>>,
37    /// The ID of the organization this activity is associated with
38    #[serde(rename = "org_id", skip_serializing_if = "Option::is_none")]
39    pub org_id: Option<i32>,
40    /// The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps.
41    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
42    pub location: Option<String>,
43    /// Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity.
44    #[serde(rename = "public_description", skip_serializing_if = "Option::is_none")]
45    pub public_description: Option<String>,
46    /// The note of the activity (HTML format)
47    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
48    pub note: Option<String>,
49    /// The subject of the activity. When value for subject is not set, it will be given a default value `Call`.
50    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
51    pub subject: Option<String>,
52    /// The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. When value for type is not set, it will be given a default value `Call`.
53    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
54    pub r#type: Option<String>,
55    /// The ID of the user whom the activity is assigned to. If omitted, the activity is assigned to the authorized user.
56    #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
57    pub user_id: Option<i32>,
58    /// List of multiple persons (participants) this activity is associated with. If omitted, single participant from `person_id` field is used. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]`
59    #[serde(rename = "participants", skip_serializing_if = "Option::is_none")]
60    pub participants: Option<Vec<serde_json::Value>>,
61    /// Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time.
62    #[serde(rename = "busy_flag", skip_serializing_if = "Option::is_none")]
63    pub busy_flag: Option<bool>,
64    /// The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]`
65    #[serde(rename = "attendees", skip_serializing_if = "Option::is_none")]
66    pub attendees: Option<Vec<serde_json::Value>>,
67    #[serde(rename = "done", skip_serializing_if = "Option::is_none")]
68    pub done: Option<Done>,
69}
70
71impl AddActivityRequest {
72    pub fn new() -> AddActivityRequest {
73        AddActivityRequest {
74            due_date: None,
75            due_time: None,
76            duration: None,
77            deal_id: None,
78            lead_id: None,
79            person_id: None,
80            project_id: None,
81            org_id: None,
82            location: None,
83            public_description: None,
84            note: None,
85            subject: None,
86            r#type: None,
87            user_id: None,
88            participants: None,
89            busy_flag: None,
90            attendees: None,
91            done: None,
92        }
93    }
94}
95
96/// 
97#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
98pub enum Done {
99    #[serde(rename = "0")]
100    Variant0,
101    #[serde(rename = "1")]
102    Variant1,
103}
104
105impl Default for Done {
106    fn default() -> Done {
107        Self::Variant0
108    }
109}
110