late/models/inbox_webhook_message_attachments_inner.rs
1/*
2 * Zernio API
3 *
4 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5 *
6 * The version of the OpenAPI document: 1.0.4
7 * Contact: support@zernio.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct InboxWebhookMessageAttachmentsInner {
16 /// Attachment type (image, video, file, sticker, audio)
17 #[serde(rename = "type")]
18 pub r#type: String,
19 /// Where to fetch the attachment. The contract depends on direction and platform: inbound WhatsApp media points at the authenticated `GET /v1/whatsapp/media/{mediaId}` and requires `Authorization: Bearer <your API key>`, while outgoing media carries the URL originally supplied and Instagram / Facebook / Telegram carry direct platform CDN links that need no authentication.
20 #[serde(rename = "url")]
21 pub url: String,
22 /// Additional attachment metadata
23 #[serde(rename = "payload", skip_serializing_if = "Option::is_none")]
24 pub payload: Option<serde_json::Value>,
25}
26
27impl InboxWebhookMessageAttachmentsInner {
28 pub fn new(r#type: String, url: String) -> InboxWebhookMessageAttachmentsInner {
29 InboxWebhookMessageAttachmentsInner {
30 r#type,
31 url,
32 payload: None,
33 }
34 }
35}