1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* public
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.97.5
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// LicenseKeyGrant : License-key delivery payload, present on grants for `license_key` entitlements. The grant's top-level `status` is the source of truth for the grant's lifecycle.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LicenseKeyGrant {
/// Maximum activations allowed by the entitlement, when set.
#[serde(rename = "activations_limit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub activations_limit: Option<Option<i32>>,
/// Number of activations consumed so far.
#[serde(rename = "activations_used")]
pub activations_used: i32,
/// When the license key expires, when applicable.
#[serde(rename = "expires_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub expires_at: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
/// Issued license key.
#[serde(rename = "key")]
pub key: String,
}
impl LicenseKeyGrant {
/// License-key delivery payload, present on grants for `license_key` entitlements. The grant's top-level `status` is the source of truth for the grant's lifecycle.
pub fn new(activations_used: i32, key: String) -> LicenseKeyGrant {
LicenseKeyGrant {
activations_limit: None,
activations_used,
expires_at: None,
key,
}
}
}