pipedrive-rs 0.1.0

Rust PipedriveClient
Documentation
/*
 * Pipedrive API v1
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetproductResponse200Data {
    /// The ID of the product
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<f32>,
    /// The name of the product
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The product code
    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
    pub code: Option<String>,
    /// The unit in which this product is sold
    #[serde(rename = "unit", skip_serializing_if = "Option::is_none")]
    pub unit: Option<String>,
    /// The ax percentage
    #[serde(rename = "tax", skip_serializing_if = "Option::is_none")]
    pub tax: Option<f32>,
    /// Whether this product is active or not
    #[serde(rename = "active_flag", skip_serializing_if = "Option::is_none")]
    pub active_flag: Option<bool>,
    /// Whether this product is selected in deals or not
    #[serde(rename = "selectable", skip_serializing_if = "Option::is_none")]
    pub selectable: Option<bool>,
    #[serde(rename = "visible_to", skip_serializing_if = "Option::is_none")]
    pub visible_to: Option<VisibleTo>,
    /// Information about the Pipedrive user who owns the product
    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<serde_json::Value>,
    /// Array of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional)
    #[serde(rename = "prices", skip_serializing_if = "Option::is_none")]
    pub prices: Option<Vec<serde_json::Value>>,
}

impl GetproductResponse200Data {
    pub fn new() -> GetproductResponse200Data {
        GetproductResponse200Data {
            id: None,
            name: None,
            code: None,
            unit: None,
            tax: None,
            active_flag: None,
            selectable: None,
            visible_to: None,
            owner_id: None,
            prices: None,
        }
    }
}

/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum VisibleTo {
    #[serde(rename = "1")]
    Variant1,
    #[serde(rename = "3")]
    Variant3,
    #[serde(rename = "5")]
    Variant5,
    #[serde(rename = "7")]
    Variant7,
}

impl Default for VisibleTo {
    fn default() -> VisibleTo {
        Self::Variant1
    }
}