webhook-line 1.0.1

Webhook event definition of the LINE Messaging API
Documentation
/*
 * Webhook Type Definition
 *
 * Webhook event definition of the LINE Messaging API
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// ContentProvider : Provider of the media file.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ContentProvider {
    /// Provider of the image file.
    #[serde(rename = "type")]
    pub r#type: Type,
    /// URL of the image file. Only included when contentProvider.type is external.
    #[serde(rename = "originalContentUrl", skip_serializing_if = "Option::is_none")]
    pub original_content_url: Option<String>,
    /// URL of the preview image. Only included when contentProvider.type is external.
    #[serde(rename = "previewImageUrl", skip_serializing_if = "Option::is_none")]
    pub preview_image_url: Option<String>,
}

impl ContentProvider {
    /// Provider of the media file.
    pub fn new(r#type: Type) -> ContentProvider {
        ContentProvider {
            r#type,
            original_content_url: None,
            preview_image_url: None,
        }
    }
}
/// Provider of the image file.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "line")]
    Line,
    #[serde(rename = "external")]
    External,
}

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