dodopayments_rust 2.2.2

Rust SDK for Dodo Payments API
Documentation
/*
 * public
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.87.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookDetails {
    /// Created at timestamp
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// An example webhook name.
    #[serde(rename = "description")]
    pub description: String,
    /// Status of the webhook.  If true, events are not sent
    #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
    pub disabled: Option<bool>,
    /// Filter events to the webhook.  Webhook event will only be sent for events in the list.
    #[serde(rename = "filter_types", skip_serializing_if = "Option::is_none")]
    pub filter_types: Option<Vec<String>>,
    /// The webhook's ID.
    #[serde(rename = "id")]
    pub id: String,
    /// Metadata of the webhook
    #[serde(rename = "metadata")]
    pub metadata: std::collections::HashMap<String, String>,
    /// Configured rate limit
    #[serde(rename = "rate_limit", skip_serializing_if = "Option::is_none")]
    pub rate_limit: Option<i32>,
    /// Updated at timestamp
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    /// Url endpoint of the webhook
    #[serde(rename = "url")]
    pub url: String,
}

impl WebhookDetails {
    pub fn new(created_at: String, description: String, id: String, metadata: std::collections::HashMap<String, String>, updated_at: String, url: String) -> WebhookDetails {
        WebhookDetails {
            created_at,
            description,
            disabled: None,
            filter_types: None,
            id,
            metadata,
            rate_limit: None,
            updated_at,
            url,
        }
    }
}