late 0.0.1372

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.572.0
 * 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 ConnectWhatsAppCredentialsRequest {
    /// Your Zernio profile ID
    #[serde(rename = "profileId")]
    pub profile_id: String,
    /// Permanent System User access token from Meta Business Suite
    #[serde(rename = "accessToken")]
    pub access_token: String,
    /// WhatsApp Business Account ID from Meta
    #[serde(rename = "wabaId")]
    pub waba_id: String,
    /// Phone Number ID from Meta WhatsApp Manager
    #[serde(rename = "phoneNumberId")]
    pub phone_number_id: String,
    /// The 6-digit two-step verification PIN set on the number. Required if you enabled two-step verification for it, otherwise Meta rejects the Cloud API registration with error 133005 and the number cannot send messages.
    #[serde(rename = "pin", skip_serializing_if = "Option::is_none")]
    pub pin: Option<String>,
    /// Your own WhatsApp OAuth app (see /v1/connect/oauth-apps) holding the Meta app the access token belongs to. The WABA's webhooks then go to that app's own callback URL and every delivery is checked against its app secret. Without it, deliveries come to Zernio's shared Meta webhook.
    #[serde(rename = "oauthAppId", skip_serializing_if = "Option::is_none")]
    pub oauth_app_id: Option<String>,
}

impl ConnectWhatsAppCredentialsRequest {
    pub fn new(
        profile_id: String,
        access_token: String,
        waba_id: String,
        phone_number_id: String,
    ) -> ConnectWhatsAppCredentialsRequest {
        ConnectWhatsAppCredentialsRequest {
            profile_id,
            access_token,
            waba_id,
            phone_number_id,
            pin: None,
            oauth_app_id: None,
        }
    }
}