pipedrive_rs/models/
update_deal_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 UpdateDealRequest {
16    /// The title of the deal
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
18    pub title: Option<String>,
19    /// The value of the deal.
20    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
21    pub value: Option<String>,
22    /// The currency of the deal. Accepts a 3-character currency code.
23    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
24    pub currency: Option<String>,
25    /// The ID of the user which will be the new owner of the deal.
26    #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
27    pub user_id: Option<i32>,
28    /// The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first.
29    #[serde(rename = "person_id", skip_serializing_if = "Option::is_none")]
30    pub person_id: Option<i32>,
31    /// The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first.
32    #[serde(rename = "org_id", skip_serializing_if = "Option::is_none")]
33    pub org_id: Option<i32>,
34    /// The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored.
35    #[serde(rename = "pipeline_id", skip_serializing_if = "Option::is_none")]
36    pub pipeline_id: Option<i32>,
37    /// The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`.
38    #[serde(rename = "stage_id", skip_serializing_if = "Option::is_none")]
39    pub stage_id: Option<i32>,
40    /// open = Open, won = Won, lost = Lost, deleted = Deleted.
41    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
42    pub status: Option<Status>,
43    /// The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD.
44    #[serde(rename = "expected_close_date", skip_serializing_if = "Option::is_none")]
45    pub expected_close_date: Option<String>,
46    /// The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled.
47    #[serde(rename = "probability", skip_serializing_if = "Option::is_none")]
48    pub probability: Option<f32>,
49    /// The optional message about why the deal was lost (to be used when status = lost)
50    #[serde(rename = "lost_reason", skip_serializing_if = "Option::is_none")]
51    pub lost_reason: Option<String>,
52    #[serde(rename = "visible_to", skip_serializing_if = "Option::is_none")]
53    pub visible_to: Option<VisibleTo>,
54}
55
56impl UpdateDealRequest {
57    pub fn new() -> UpdateDealRequest {
58        UpdateDealRequest {
59            title: None,
60            value: None,
61            currency: None,
62            user_id: None,
63            person_id: None,
64            org_id: None,
65            pipeline_id: None,
66            stage_id: None,
67            status: None,
68            expected_close_date: None,
69            probability: None,
70            lost_reason: None,
71            visible_to: None,
72        }
73    }
74}
75
76/// open = Open, won = Won, lost = Lost, deleted = Deleted.
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
78pub enum Status {
79    #[serde(rename = "open")]
80    Open,
81    #[serde(rename = "won")]
82    Won,
83    #[serde(rename = "lost")]
84    Lost,
85    #[serde(rename = "deleted")]
86    Deleted,
87}
88
89impl Default for Status {
90    fn default() -> Status {
91        Self::Open
92    }
93}
94/// 
95#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
96pub enum VisibleTo {
97    #[serde(rename = "1")]
98    Variant1,
99    #[serde(rename = "3")]
100    Variant3,
101    #[serde(rename = "5")]
102    Variant5,
103    #[serde(rename = "7")]
104    Variant7,
105}
106
107impl Default for VisibleTo {
108    fn default() -> VisibleTo {
109        Self::Variant1
110    }
111}
112