openapi_github/models/
sponsorship_tier.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/// SponsorshipTier : The `tier_changed` and `pending_tier_change` will include the original tier before the change or pending change. For more information, see the pending tier change payload.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SponsorshipTier {
17    #[serde(rename = "created_at")]
18    pub created_at: String,
19    #[serde(rename = "description")]
20    pub description: String,
21    #[serde(rename = "is_custom_ammount", skip_serializing_if = "Option::is_none")]
22    pub is_custom_ammount: Option<bool>,
23    #[serde(rename = "is_custom_amount", skip_serializing_if = "Option::is_none")]
24    pub is_custom_amount: Option<bool>,
25    #[serde(rename = "is_one_time")]
26    pub is_one_time: bool,
27    #[serde(rename = "monthly_price_in_cents")]
28    pub monthly_price_in_cents: i32,
29    #[serde(rename = "monthly_price_in_dollars")]
30    pub monthly_price_in_dollars: i32,
31    #[serde(rename = "name")]
32    pub name: String,
33    #[serde(rename = "node_id")]
34    pub node_id: String,
35}
36
37impl SponsorshipTier {
38    /// The `tier_changed` and `pending_tier_change` will include the original tier before the change or pending change. For more information, see the pending tier change payload.
39    pub fn new(created_at: String, description: String, is_one_time: bool, monthly_price_in_cents: i32, monthly_price_in_dollars: i32, name: String, node_id: String) -> SponsorshipTier {
40        SponsorshipTier {
41            created_at,
42            description,
43            is_custom_ammount: None,
44            is_custom_amount: None,
45            is_one_time,
46            monthly_price_in_cents,
47            monthly_price_in_dollars,
48            name,
49            node_id,
50        }
51    }
52}
53