openapi_github/models/
webhooks_previous_marketplace_purchase.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhooksPreviousMarketplacePurchase {
16    #[serde(rename = "account")]
17    pub account: Box<models::WebhooksMarketplacePurchaseAccount>,
18    #[serde(rename = "billing_cycle")]
19    pub billing_cycle: String,
20    #[serde(rename = "free_trial_ends_on", deserialize_with = "Option::deserialize")]
21    pub free_trial_ends_on: Option<serde_json::Value>,
22    #[serde(rename = "next_billing_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub next_billing_date: Option<Option<String>>,
24    #[serde(rename = "on_free_trial")]
25    pub on_free_trial: bool,
26    #[serde(rename = "plan")]
27    pub plan: Box<models::WebhooksPreviousMarketplacePurchasePlan>,
28    #[serde(rename = "unit_count")]
29    pub unit_count: i32,
30}
31
32impl WebhooksPreviousMarketplacePurchase {
33    pub fn new(account: models::WebhooksMarketplacePurchaseAccount, billing_cycle: String, free_trial_ends_on: Option<serde_json::Value>, on_free_trial: bool, plan: models::WebhooksPreviousMarketplacePurchasePlan, unit_count: i32) -> WebhooksPreviousMarketplacePurchase {
34        WebhooksPreviousMarketplacePurchase {
35            account: Box::new(account),
36            billing_cycle,
37            free_trial_ends_on,
38            next_billing_date: None,
39            on_free_trial,
40            plan: Box::new(plan),
41            unit_count,
42        }
43    }
44}
45