/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
*
* The version of the OpenAPI document: 1.0.4
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateInboxConversationRequest {
/// The social account ID to send from
#[serde(rename = "accountId")]
pub account_id: String,
/// Recipient identifier. For X this is the numeric user ID; for WhatsApp, the recipient phone number in international format (digits, country code included). Provide either this or participantUsername.
#[serde(rename = "participantId", skip_serializing_if = "Option::is_none")]
pub participant_id: Option<String>,
/// Recipient handle/username — an X or Bluesky handle (with or without @) or a Reddit username (with or without u/). Resolved via lookup. Provide either this or participantId.
#[serde(
rename = "participantUsername",
skip_serializing_if = "Option::is_none"
)]
pub participant_username: Option<String>,
/// Text content of the message. At least one of message, attachment, or (for WhatsApp) templateName is required.
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
/// X/Twitter only. Skip the receives_your_dm eligibility check before sending. Use if you have already verified the recipient accepts DMs.
#[serde(rename = "skipDmCheck", skip_serializing_if = "Option::is_none")]
pub skip_dm_check: Option<bool>,
/// WhatsApp only. Name of the approved template to start the conversation with (required for WhatsApp).
#[serde(rename = "templateName", skip_serializing_if = "Option::is_none")]
pub template_name: Option<String>,
/// WhatsApp only. Template language code (e.g. en_US).
#[serde(rename = "templateLanguage", skip_serializing_if = "Option::is_none")]
pub template_language: Option<String>,
/// WhatsApp only. Template variable values as one flat array, in the order the variables appear across the whole template: text-header variables first, then body variables, then one value per dynamic URL button (in button order). Works with positional placeholders ({{1}}, {{2}}, ...) and with named placeholders ({{name}}, {{company}} - how Meta Business Manager creates templates), where values fill the named slots in order of appearance. Example - a body with {{1}}, {{2}} plus a URL button https://example.com/{{1}} takes three values: [body1, body2, buttonSuffix]. Media headers (image, video, document) are filled automatically from the approved template and take no value here (use headerMedia to override the header asset per send).
#[serde(rename = "templateParams", skip_serializing_if = "Option::is_none")]
pub template_params: Option<Vec<String>>,
#[serde(rename = "headerMedia", skip_serializing_if = "Option::is_none")]
pub header_media: Option<Box<models::CreateInboxConversationRequestHeaderMedia>>,
}
impl CreateInboxConversationRequest {
pub fn new(account_id: String) -> CreateInboxConversationRequest {
CreateInboxConversationRequest {
account_id,
participant_id: None,
participant_username: None,
message: None,
skip_dm_check: None,
template_name: None,
template_language: None,
template_params: None,
header_media: None,
}
}
}