pipedrive_rs/models/add_subscription_installment_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 AddSubscriptionInstallmentRequest {
16 /// The ID of the deal this installment subscription is associated with
17 #[serde(rename = "deal_id")]
18 pub deal_id: i32,
19 /// The currency of the installment subscription. Accepts a 3-character currency code.
20 #[serde(rename = "currency")]
21 pub currency: String,
22 /// 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).
23 #[serde(rename = "payments")]
24 pub payments: Vec<serde_json::Value>,
25 /// Indicates that the deal value must be set to the installment subscription's total value
26 #[serde(rename = "update_deal_value", skip_serializing_if = "Option::is_none")]
27 pub update_deal_value: Option<bool>,
28}
29
30impl AddSubscriptionInstallmentRequest {
31 pub fn new(deal_id: i32, currency: String, payments: Vec<serde_json::Value>) -> AddSubscriptionInstallmentRequest {
32 AddSubscriptionInstallmentRequest {
33 deal_id,
34 currency,
35 payments,
36 update_deal_value: None,
37 }
38 }
39}
40
41