pipedrive_rs/models/
add_lead_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 AddLeadRequest {
16    /// The name of the lead
17    #[serde(rename = "title")]
18    pub title: String,
19    /// The ID of the user which will be the owner of the created lead. If not provided, the user making the request will be used.
20    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
21    pub owner_id: Option<i32>,
22    /// The IDs of the lead labels which will be associated with the lead
23    #[serde(rename = "label_ids", skip_serializing_if = "Option::is_none")]
24    pub label_ids: Option<Vec<uuid::Uuid>>,
25    /// The ID of a person which this lead will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `organization_id` is specified.
26    #[serde(rename = "person_id", skip_serializing_if = "Option::is_none")]
27    pub person_id: Option<i32>,
28    /// The ID of an organization which this lead will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified.
29    #[serde(rename = "organization_id", skip_serializing_if = "Option::is_none")]
30    pub organization_id: Option<i32>,
31    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
32    pub value: Option<Box<crate::models::GetLeadsResponse200DataInnerValue>>,
33    /// 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.
34    #[serde(rename = "expected_close_date", skip_serializing_if = "Option::is_none")]
35    pub expected_close_date: Option<String>,
36    #[serde(rename = "visible_to", skip_serializing_if = "Option::is_none")]
37    pub visible_to: Option<VisibleTo>,
38    /// A flag indicating whether the lead was seen by someone in the Pipedrive UI
39    #[serde(rename = "was_seen", skip_serializing_if = "Option::is_none")]
40    pub was_seen: Option<bool>,
41}
42
43impl AddLeadRequest {
44    pub fn new(title: String) -> AddLeadRequest {
45        AddLeadRequest {
46            title,
47            owner_id: None,
48            label_ids: None,
49            person_id: None,
50            organization_id: None,
51            value: None,
52            expected_close_date: None,
53            visible_to: None,
54            was_seen: None,
55        }
56    }
57}
58
59/// 
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum VisibleTo {
62    #[serde(rename = "1")]
63    Variant1,
64    #[serde(rename = "3")]
65    Variant3,
66    #[serde(rename = "5")]
67    Variant5,
68    #[serde(rename = "7")]
69    Variant7,
70}
71
72impl Default for VisibleTo {
73    fn default() -> VisibleTo {
74        Self::Variant1
75    }
76}
77