dodopayments_rust 2.2.2

Rust SDK for Dodo Payments API
Documentation
/*
 * public
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.105.3
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// FulfillLicenseKeyRequest : Request body for manually fulfilling a pending license-key grant.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FulfillLicenseKeyRequest {
    /// Per-key activation limit. Defaults to the entitlement's license-key configuration.
    #[serde(
        rename = "activations_limit",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub activations_limit: Option<Option<i32>>,
    /// When the key expires. Defaults to the duration in the entitlement's license-key configuration.
    #[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>>>,
    /// The license key value to deliver to the customer.
    #[serde(rename = "key")]
    pub key: String,
}

impl FulfillLicenseKeyRequest {
    /// Request body for manually fulfilling a pending license-key grant.
    pub fn new(key: String) -> FulfillLicenseKeyRequest {
        FulfillLicenseKeyRequest {
            activations_limit: None,
            expires_at: None,
            key,
        }
    }
}