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 GetWebhooksResponse200AllOfDataInner {
    /// The ID of the Webhook
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    /// The ID of the company related to the Webhook
    #[serde(rename = "company_id", skip_serializing_if = "Option::is_none")]
    pub company_id: Option<i32>,
    /// The ID of the user who owns the Webhook
    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<i32>,
    /// The ID of the user related to the Webhook
    #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<i32>,
    /// The Webhook action
    #[serde(rename = "event_action", skip_serializing_if = "Option::is_none")]
    pub event_action: Option<String>,
    /// The Webhook object
    #[serde(rename = "event_object", skip_serializing_if = "Option::is_none")]
    pub event_object: Option<String>,
    /// The subscription URL of the Webhook
    #[serde(rename = "subscription_url", skip_serializing_if = "Option::is_none")]
    pub subscription_url: Option<String>,
    #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")]
    pub is_active: Option<IsActive>,
    /// The date when the Webhook was added
    #[serde(rename = "add_time", skip_serializing_if = "Option::is_none")]
    pub add_time: Option<String>,
    /// The date when the Webhook was removed (if removed)
    #[serde(rename = "remove_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub remove_time: Option<Option<String>>,
    /// The type of the Webhook
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// The username of the `subscription_url` of the Webhook
    #[serde(rename = "http_auth_user", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub http_auth_user: Option<Option<String>>,
    /// The password of the `subscription_url` of the Webhook
    #[serde(rename = "http_auth_password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub http_auth_password: Option<Option<String>>,
    /// Any additional data related to the Webhook
    #[serde(rename = "additional_data", skip_serializing_if = "Option::is_none")]
    pub additional_data: Option<serde_json::Value>,
    /// The removal reason of the Webhook (if removed)
    #[serde(rename = "remove_reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub remove_reason: Option<Option<String>>,
    /// The last delivery time of the Webhook
    #[serde(rename = "last_delivery_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_delivery_time: Option<Option<String>>,
    /// The last delivery HTTP status of the Webhook
    #[serde(rename = "last_http_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_http_status: Option<Option<i32>>,
    /// The ID of the admin of the Webhook
    #[serde(rename = "admin_id", skip_serializing_if = "Option::is_none")]
    pub admin_id: Option<i32>,
}

impl GetWebhooksResponse200AllOfDataInner {
    pub fn new() -> GetWebhooksResponse200AllOfDataInner {
        GetWebhooksResponse200AllOfDataInner {
            id: None,
            company_id: None,
            owner_id: None,
            user_id: None,
            event_action: None,
            event_object: None,
            subscription_url: None,
            is_active: None,
            add_time: None,
            remove_time: None,
            r#type: None,
            http_auth_user: None,
            http_auth_password: None,
            additional_data: None,
            remove_reason: None,
            last_delivery_time: None,
            last_http_status: None,
            admin_id: None,
        }
    }
}

/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum IsActive {
    #[serde(rename = "0")]
    Variant0,
    #[serde(rename = "1")]
    Variant1,
}

impl Default for IsActive {
    fn default() -> IsActive {
        Self::Variant0
    }
}
/// The type of the Webhook
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "general")]
    General,
    #[serde(rename = "app")]
    App,
}

impl Default for Type {
    fn default() -> Type {
        Self::General
    }
}