Skip to main content

pipedrive_rs/models/
getproduct_response200_data.rs

1/*
2 * Pipedrive API v1
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct GetproductResponse200Data {
16    /// The ID of the product
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<f32>,
19    /// The name of the product
20    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
21    pub name: Option<String>,
22    /// The product code
23    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
24    pub code: Option<String>,
25    /// The unit in which this product is sold
26    #[serde(rename = "unit", skip_serializing_if = "Option::is_none")]
27    pub unit: Option<String>,
28    /// The ax percentage
29    #[serde(rename = "tax", skip_serializing_if = "Option::is_none")]
30    pub tax: Option<f32>,
31    /// Whether this product is active or not
32    #[serde(rename = "active_flag", skip_serializing_if = "Option::is_none")]
33    pub active_flag: Option<bool>,
34    /// Whether this product is selected in deals or not
35    #[serde(rename = "selectable", skip_serializing_if = "Option::is_none")]
36    pub selectable: Option<bool>,
37    #[serde(rename = "visible_to", skip_serializing_if = "Option::is_none")]
38    pub visible_to: Option<VisibleTo>,
39    /// Information about the Pipedrive user who owns the product
40    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
41    pub owner_id: Option<serde_json::Value>,
42    /// Array of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional)
43    #[serde(rename = "prices", skip_serializing_if = "Option::is_none")]
44    pub prices: Option<Vec<serde_json::Value>>,
45}
46
47impl GetproductResponse200Data {
48    pub fn new() -> GetproductResponse200Data {
49        GetproductResponse200Data {
50            id: None,
51            name: None,
52            code: None,
53            unit: None,
54            tax: None,
55            active_flag: None,
56            selectable: None,
57            visible_to: None,
58            owner_id: None,
59            prices: None,
60        }
61    }
62}
63
64/// 
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum VisibleTo {
67    #[serde(rename = "1")]
68    Variant1,
69    #[serde(rename = "3")]
70    Variant3,
71    #[serde(rename = "5")]
72    Variant5,
73    #[serde(rename = "7")]
74    Variant7,
75}
76
77impl Default for VisibleTo {
78    fn default() -> VisibleTo {
79        Self::Variant1
80    }
81}
82