pipedrive_rs/models/
get_webhooks_response200_all_of_data_inner.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 GetWebhooksResponse200AllOfDataInner {
16    /// The ID of the Webhook
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<i32>,
19    /// The ID of the company related to the Webhook
20    #[serde(rename = "company_id", skip_serializing_if = "Option::is_none")]
21    pub company_id: Option<i32>,
22    /// The ID of the user who owns the Webhook
23    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
24    pub owner_id: Option<i32>,
25    /// The ID of the user related to the Webhook
26    #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
27    pub user_id: Option<i32>,
28    /// The Webhook action
29    #[serde(rename = "event_action", skip_serializing_if = "Option::is_none")]
30    pub event_action: Option<String>,
31    /// The Webhook object
32    #[serde(rename = "event_object", skip_serializing_if = "Option::is_none")]
33    pub event_object: Option<String>,
34    /// The subscription URL of the Webhook
35    #[serde(rename = "subscription_url", skip_serializing_if = "Option::is_none")]
36    pub subscription_url: Option<String>,
37    #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")]
38    pub is_active: Option<IsActive>,
39    /// The date when the Webhook was added
40    #[serde(rename = "add_time", skip_serializing_if = "Option::is_none")]
41    pub add_time: Option<String>,
42    /// The date when the Webhook was removed (if removed)
43    #[serde(rename = "remove_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub remove_time: Option<Option<String>>,
45    /// The type of the Webhook
46    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
47    pub r#type: Option<Type>,
48    /// The username of the `subscription_url` of the Webhook
49    #[serde(rename = "http_auth_user", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub http_auth_user: Option<Option<String>>,
51    /// The password of the `subscription_url` of the Webhook
52    #[serde(rename = "http_auth_password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
53    pub http_auth_password: Option<Option<String>>,
54    /// Any additional data related to the Webhook
55    #[serde(rename = "additional_data", skip_serializing_if = "Option::is_none")]
56    pub additional_data: Option<serde_json::Value>,
57    /// The removal reason of the Webhook (if removed)
58    #[serde(rename = "remove_reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
59    pub remove_reason: Option<Option<String>>,
60    /// The last delivery time of the Webhook
61    #[serde(rename = "last_delivery_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
62    pub last_delivery_time: Option<Option<String>>,
63    /// The last delivery HTTP status of the Webhook
64    #[serde(rename = "last_http_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
65    pub last_http_status: Option<Option<i32>>,
66    /// The ID of the admin of the Webhook
67    #[serde(rename = "admin_id", skip_serializing_if = "Option::is_none")]
68    pub admin_id: Option<i32>,
69}
70
71impl GetWebhooksResponse200AllOfDataInner {
72    pub fn new() -> GetWebhooksResponse200AllOfDataInner {
73        GetWebhooksResponse200AllOfDataInner {
74            id: None,
75            company_id: None,
76            owner_id: None,
77            user_id: None,
78            event_action: None,
79            event_object: None,
80            subscription_url: None,
81            is_active: None,
82            add_time: None,
83            remove_time: None,
84            r#type: None,
85            http_auth_user: None,
86            http_auth_password: None,
87            additional_data: None,
88            remove_reason: None,
89            last_delivery_time: None,
90            last_http_status: None,
91            admin_id: None,
92        }
93    }
94}
95
96/// 
97#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
98pub enum IsActive {
99    #[serde(rename = "0")]
100    Variant0,
101    #[serde(rename = "1")]
102    Variant1,
103}
104
105impl Default for IsActive {
106    fn default() -> IsActive {
107        Self::Variant0
108    }
109}
110/// The type of the Webhook
111#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
112pub enum Type {
113    #[serde(rename = "general")]
114    General,
115    #[serde(rename = "app")]
116    App,
117}
118
119impl Default for Type {
120    fn default() -> Type {
121        Self::General
122    }
123}
124