openapi_github/models/
user_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/// UserMarketplacePurchase : User Marketplace Purchase
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UserMarketplacePurchase {
17    #[serde(rename = "billing_cycle")]
18    pub billing_cycle: String,
19    #[serde(rename = "next_billing_date", deserialize_with = "Option::deserialize")]
20    pub next_billing_date: Option<String>,
21    #[serde(rename = "unit_count", deserialize_with = "Option::deserialize")]
22    pub unit_count: Option<i32>,
23    #[serde(rename = "on_free_trial")]
24    pub on_free_trial: bool,
25    #[serde(rename = "free_trial_ends_on", deserialize_with = "Option::deserialize")]
26    pub free_trial_ends_on: Option<String>,
27    #[serde(rename = "updated_at", deserialize_with = "Option::deserialize")]
28    pub updated_at: Option<String>,
29    #[serde(rename = "account")]
30    pub account: Box<models::MarketplaceAccount>,
31    #[serde(rename = "plan")]
32    pub plan: Box<models::MarketplaceListingPlan>,
33}
34
35impl UserMarketplacePurchase {
36    /// User Marketplace Purchase
37    pub fn new(billing_cycle: String, next_billing_date: Option<String>, unit_count: Option<i32>, on_free_trial: bool, free_trial_ends_on: Option<String>, updated_at: Option<String>, account: models::MarketplaceAccount, plan: models::MarketplaceListingPlan) -> UserMarketplacePurchase {
38        UserMarketplacePurchase {
39            billing_cycle,
40            next_billing_date,
41            unit_count,
42            on_free_trial,
43            free_trial_ends_on,
44            updated_at,
45            account: Box::new(account),
46            plan: Box::new(plan),
47        }
48    }
49}
50