1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* 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 AddSubscriptionInstallmentRequest {
/// The ID of the deal this installment subscription is associated with
#[serde(rename = "deal_id")]
pub deal_id: i32,
/// The currency of the installment subscription. Accepts a 3-character currency code.
#[serde(rename = "currency")]
pub currency: String,
/// Array of payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with an explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD).
#[serde(rename = "payments")]
pub payments: Vec<serde_json::Value>,
/// Indicates that the deal value must be set to the installment subscription's total value
#[serde(rename = "update_deal_value", skip_serializing_if = "Option::is_none")]
pub update_deal_value: Option<bool>,
}
impl AddSubscriptionInstallmentRequest {
pub fn new(deal_id: i32, currency: String, payments: Vec<serde_json::Value>) -> AddSubscriptionInstallmentRequest {
AddSubscriptionInstallmentRequest {
deal_id,
currency,
payments,
update_deal_value: None,
}
}
}