openapi_github/models/
webhooks_marketplace_purchase_plan.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 WebhooksMarketplacePurchasePlan {
16    #[serde(rename = "bullets")]
17    pub bullets: Vec<String>,
18    #[serde(rename = "description")]
19    pub description: String,
20    #[serde(rename = "has_free_trial")]
21    pub has_free_trial: bool,
22    #[serde(rename = "id")]
23    pub id: i32,
24    #[serde(rename = "monthly_price_in_cents")]
25    pub monthly_price_in_cents: i32,
26    #[serde(rename = "name")]
27    pub name: String,
28    #[serde(rename = "price_model")]
29    pub price_model: PriceModel,
30    #[serde(rename = "unit_name", deserialize_with = "Option::deserialize")]
31    pub unit_name: Option<String>,
32    #[serde(rename = "yearly_price_in_cents")]
33    pub yearly_price_in_cents: i32,
34}
35
36impl WebhooksMarketplacePurchasePlan {
37    pub fn new(bullets: Vec<String>, description: String, has_free_trial: bool, id: i32, monthly_price_in_cents: i32, name: String, price_model: PriceModel, unit_name: Option<String>, yearly_price_in_cents: i32) -> WebhooksMarketplacePurchasePlan {
38        WebhooksMarketplacePurchasePlan {
39            bullets,
40            description,
41            has_free_trial,
42            id,
43            monthly_price_in_cents,
44            name,
45            price_model,
46            unit_name,
47            yearly_price_in_cents,
48        }
49    }
50}
51/// 
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum PriceModel {
54    #[serde(rename = "FREE")]
55    Free,
56    #[serde(rename = "FLAT_RATE")]
57    FlatRate,
58    #[serde(rename = "PER_UNIT")]
59    PerUnit,
60}
61
62impl Default for PriceModel {
63    fn default() -> PriceModel {
64        Self::Free
65    }
66}
67