hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * Hanzo Cloud API
 *
 * 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/.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CartItem {
    /// Free reports a line that costs nothing because a coupon or a promotion made it so, rather than because its price is zero.
    #[serde(rename = "free", skip_serializing_if = "Option::is_none")]
    pub free: Option<bool>,
    /// ID is the line's identity — the variant id when the line is a variant, otherwise the product id. It is what a subsequent set call addresses.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Kind is \"variant\" when this line is a specific sellable variant and \"product\" when it is the product itself.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Name is the item's display name, cached onto the line when it was added so a cart renders without a second read.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// PriceCents is the unit price in whole cents, cached at the moment the line was added. The line's contribution to the cart is this times Quantity.
    #[serde(rename = "priceCents", skip_serializing_if = "Option::is_none")]
    pub price_cents: Option<i32>,
    /// Quantity is how many units of this item the cart holds.
    #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")]
    pub quantity: Option<i32>,
    /// SKU is the line's stock-keeping unit — the variant's when it has one, otherwise the product's. Empty when neither carries one.
    #[serde(rename = "sku", skip_serializing_if = "Option::is_none")]
    pub sku: Option<String>,
}

impl CartItem {
    pub fn new() -> CartItem {
        CartItem {
            free: None,
            id: None,
            kind: None,
            name: None,
            price_cents: None,
            quantity: None,
            sku: None,
        }
    }
}