late 0.0.1097

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.168.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// CommerceCapability : An operation a store supports. Calling an operation outside this list answers 400 platform_not_supported.
/// An operation a store supports. Calling an operation outside this list answers 400 platform_not_supported.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CommerceCapability {
    #[serde(rename = "products.read")]
    ProductsRead,
    #[serde(rename = "products.create")]
    ProductsCreate,
    #[serde(rename = "products.update")]
    ProductsUpdate,
    #[serde(rename = "products.status")]
    ProductsStatus,
    #[serde(rename = "products.price")]
    ProductsPrice,
    #[serde(rename = "products.variants")]
    ProductsVariants,
    #[serde(rename = "products.images")]
    ProductsImages,
    #[serde(rename = "products.images_remove")]
    ProductsImagesRemove,
    #[serde(rename = "collections.read")]
    CollectionsRead,
    #[serde(rename = "collections.write")]
    CollectionsWrite,
    #[serde(rename = "collections.metafields")]
    CollectionsMetafields,
    #[serde(rename = "metafields.read")]
    MetafieldsRead,
    #[serde(rename = "metafields.write")]
    MetafieldsWrite,
    #[serde(rename = "pages.read")]
    PagesRead,
    #[serde(rename = "pages.write")]
    PagesWrite,
    #[serde(rename = "inventory.read")]
    InventoryRead,
    #[serde(rename = "inventory.write")]
    InventoryWrite,
    #[serde(rename = "channels.read")]
    ChannelsRead,
    #[serde(rename = "channels.write")]
    ChannelsWrite,
    #[serde(rename = "discounts.read")]
    DiscountsRead,
    #[serde(rename = "discounts.write")]
    DiscountsWrite,
    #[serde(rename = "discounts.codes")]
    DiscountsCodes,
    #[serde(rename = "navigation.read")]
    NavigationRead,
    #[serde(rename = "navigation.write")]
    NavigationWrite,
    #[serde(rename = "metaobjects.read")]
    MetaobjectsRead,
    #[serde(rename = "metaobjects.write")]
    MetaobjectsWrite,
    #[serde(rename = "markets.read")]
    MarketsRead,
    #[serde(rename = "markets.write")]
    MarketsWrite,
    #[serde(rename = "marketing.write")]
    MarketingWrite,
}

impl std::fmt::Display for CommerceCapability {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::ProductsRead => write!(f, "products.read"),
            Self::ProductsCreate => write!(f, "products.create"),
            Self::ProductsUpdate => write!(f, "products.update"),
            Self::ProductsStatus => write!(f, "products.status"),
            Self::ProductsPrice => write!(f, "products.price"),
            Self::ProductsVariants => write!(f, "products.variants"),
            Self::ProductsImages => write!(f, "products.images"),
            Self::ProductsImagesRemove => write!(f, "products.images_remove"),
            Self::CollectionsRead => write!(f, "collections.read"),
            Self::CollectionsWrite => write!(f, "collections.write"),
            Self::CollectionsMetafields => write!(f, "collections.metafields"),
            Self::MetafieldsRead => write!(f, "metafields.read"),
            Self::MetafieldsWrite => write!(f, "metafields.write"),
            Self::PagesRead => write!(f, "pages.read"),
            Self::PagesWrite => write!(f, "pages.write"),
            Self::InventoryRead => write!(f, "inventory.read"),
            Self::InventoryWrite => write!(f, "inventory.write"),
            Self::ChannelsRead => write!(f, "channels.read"),
            Self::ChannelsWrite => write!(f, "channels.write"),
            Self::DiscountsRead => write!(f, "discounts.read"),
            Self::DiscountsWrite => write!(f, "discounts.write"),
            Self::DiscountsCodes => write!(f, "discounts.codes"),
            Self::NavigationRead => write!(f, "navigation.read"),
            Self::NavigationWrite => write!(f, "navigation.write"),
            Self::MetaobjectsRead => write!(f, "metaobjects.read"),
            Self::MetaobjectsWrite => write!(f, "metaobjects.write"),
            Self::MarketsRead => write!(f, "markets.read"),
            Self::MarketsWrite => write!(f, "markets.write"),
            Self::MarketingWrite => write!(f, "marketing.write"),
        }
    }
}

impl Default for CommerceCapability {
    fn default() -> CommerceCapability {
        Self::ProductsRead
    }
}