webhook_line/models/
content_provider.rs

1/*
2 * Webhook Type Definition
3 *
4 * Webhook event definition of the LINE Messaging API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ContentProvider : Provider of the media file.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ContentProvider {
17    /// Provider of the image file.
18    #[serde(rename = "type")]
19    pub r#type: Type,
20    /// URL of the image file. Only included when contentProvider.type is external.
21    #[serde(rename = "originalContentUrl", skip_serializing_if = "Option::is_none")]
22    pub original_content_url: Option<String>,
23    /// URL of the preview image. Only included when contentProvider.type is external.
24    #[serde(rename = "previewImageUrl", skip_serializing_if = "Option::is_none")]
25    pub preview_image_url: Option<String>,
26}
27
28impl ContentProvider {
29    /// Provider of the media file.
30    pub fn new(r#type: Type) -> ContentProvider {
31        ContentProvider {
32            r#type,
33            original_content_url: None,
34            preview_image_url: None,
35        }
36    }
37}
38/// Provider of the image file.
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum Type {
41    #[serde(rename = "line")]
42    Line,
43    #[serde(rename = "external")]
44    External,
45}
46
47impl Default for Type {
48    fn default() -> Type {
49        Self::Line
50    }
51}
52