hanzo_client/models/redemption.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
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 Redemption {
16 /// Code is the promo redeemed.
17 #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
18 pub code: Option<String>,
19 /// DiscountCents is the month-one discount this redemption CLAIMS, in USD cents. It is a recorded figure, NOT a balance: nothing was credited and no wallet moved. An admin granting against this claim is what would make it money, and that decision happens on the admin surface, not here.
20 #[serde(rename = "discountCents", skip_serializing_if = "Option::is_none")]
21 pub discount_cents: Option<i32>,
22 /// Plan is the tier redeemed against: pro, max or team. It is DERIVED from the org's live ACTIVE/TRIALING subscription, never read from the request, so it is what the org actually holds rather than what it claimed.
23 #[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
24 pub plan: Option<String>,
25 /// RedeemedAt is unix seconds.
26 #[serde(rename = "redeemedAt", skip_serializing_if = "Option::is_none")]
27 pub redeemed_at: Option<i32>,
28 /// Seats is the seat count the claim was priced at, and it is ALWAYS 1. No server-side authority on this surface answers \"how many seats\", and the caller's own number is exactly the input that once inflated these claims, so a redemption records the single-seat floor and an admin resolves the real count against subscription data at grant time.
29 #[serde(rename = "seats", skip_serializing_if = "Option::is_none")]
30 pub seats: Option<i32>,
31}
32
33impl Redemption {
34 pub fn new() -> Redemption {
35 Redemption {
36 code: None,
37 discount_cents: None,
38 plan: None,
39 redeemed_at: None,
40 seats: None,
41 }
42 }
43}
44