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