dodopayments_rust 2.2.1

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.87.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PatchProductRequest {
    /// Available Addons for subscription products
    #[serde(rename = "addons", skip_serializing_if = "Option::is_none")]
    pub addons: Option<Vec<String>>,
    #[serde(rename = "brand_id", skip_serializing_if = "Option::is_none")]
    pub brand_id: Option<String>,
    /// Credit entitlements to update (replaces all existing when present) Send empty array to remove all, omit field to leave unchanged
    #[serde(rename = "credit_entitlements", skip_serializing_if = "Option::is_none")]
    pub credit_entitlements: Option<Vec<models::AttachCreditEntitlementRequest>>,
    /// Description of the product, optional and must be at most 1000 characters.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Choose how you would like you digital product delivered
    #[serde(rename = "digital_product_delivery", skip_serializing_if = "Option::is_none")]
    pub digital_product_delivery: Option<Box<models::PatchDigitalProductDeliveryRequest>>,
    /// Product image id after its uploaded to S3
    #[serde(rename = "image_id", skip_serializing_if = "Option::is_none")]
    pub image_id: Option<uuid::Uuid>,
    /// Message sent to the customer upon license key activation.  Only applicable if `license_key_enabled` is `true`. This message contains instructions for activating the license key.
    #[serde(rename = "license_key_activation_message", skip_serializing_if = "Option::is_none")]
    pub license_key_activation_message: Option<String>,
    /// Limit for the number of activations for the license key.  Only applicable if `license_key_enabled` is `true`. Represents the maximum number of times the license key can be activated.
    #[serde(rename = "license_key_activations_limit", skip_serializing_if = "Option::is_none")]
    pub license_key_activations_limit: Option<i32>,
    /// Duration of the license key if enabled.  Only applicable if `license_key_enabled` is `true`. Represents the duration in days for which the license key is valid.
    #[serde(rename = "license_key_duration", skip_serializing_if = "Option::is_none")]
    pub license_key_duration: Option<Box<models::LicenseKeyDuration>>,
    /// Whether the product requires a license key.  If `true`, additional fields related to license key (duration, activations limit, activation message) become applicable.
    #[serde(rename = "license_key_enabled", skip_serializing_if = "Option::is_none")]
    pub license_key_enabled: Option<bool>,
    /// Additional metadata for the product
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<std::collections::HashMap<String, String>>,
    /// Name of the product, optional and must be at most 100 characters.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Price details of the product.
    #[serde(rename = "price", skip_serializing_if = "Option::is_none")]
    pub price: Option<Box<models::Price>>,
    /// Tax category of the product.
    #[serde(rename = "tax_category", skip_serializing_if = "Option::is_none")]
    pub tax_category: Option<models::TaxCategory>,
}

impl PatchProductRequest {
    pub fn new() -> PatchProductRequest {
        PatchProductRequest {
            addons: None,
            brand_id: None,
            credit_entitlements: None,
            description: None,
            digital_product_delivery: None,
            image_id: None,
            license_key_activation_message: None,
            license_key_activations_limit: None,
            license_key_duration: None,
            license_key_enabled: None,
            metadata: None,
            name: None,
            price: None,
            tax_category: None,
        }
    }
}