pipedrive-rs 0.1.0

Rust PipedriveClient
Documentation
/*
 * 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 UpdateRecurringSubscriptionRequest {
    /// The description of the recurring subscription
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The amount of each payment
    #[serde(rename = "cycle_amount", skip_serializing_if = "Option::is_none")]
    pub cycle_amount: Option<i32>,
    /// Array of additional 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", skip_serializing_if = "Option::is_none")]
    pub payments: Option<Vec<serde_json::Value>>,
    /// Indicates that the deal value must be set to recurring subscription's MRR value
    #[serde(rename = "update_deal_value", skip_serializing_if = "Option::is_none")]
    pub update_deal_value: Option<bool>,
    /// All payments after that date will be affected. Format: YYYY-MM-DD
    #[serde(rename = "effective_date")]
    pub effective_date: String,
}

impl UpdateRecurringSubscriptionRequest {
    pub fn new(effective_date: String) -> UpdateRecurringSubscriptionRequest {
        UpdateRecurringSubscriptionRequest {
            description: None,
            cycle_amount: None,
            payments: None,
            update_deal_value: None,
            effective_date,
        }
    }
}