late 0.0.913

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).
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).
 *
 * 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 ConnectWhatsAppEmbeddedSignupRequest {
    /// Authorization code from the WA_EMBEDDED_SIGNUP postMessage
    #[serde(rename = "code")]
    pub code: String,
    #[serde(rename = "profileId")]
    pub profile_id: String,
    /// WhatsApp Business Account id, when the SDK reported one
    #[serde(rename = "wabaId", skip_serializing_if = "Option::is_none")]
    pub waba_id: Option<String>,
    #[serde(rename = "phoneNumberId", skip_serializing_if = "Option::is_none")]
    pub phone_number_id: Option<String>,
    /// Number is also live in the WhatsApp Business app
    #[serde(rename = "isCoexistence", skip_serializing_if = "Option::is_none")]
    pub is_coexistence: Option<bool>,
    /// Rejects the connect when Meta returns a different number
    #[serde(
        rename = "expectedPhoneNumber",
        skip_serializing_if = "Option::is_none"
    )]
    pub expected_phone_number: Option<String>,
    /// Hosted signup page only. When present, the response also carries `redirectUrl`, the URL the user should land on, with the outcome mapped exactly like the redirect flow (success params, or `error` and `platform` with the same values). Must be an absolute http(s) URL or a custom app scheme.
    #[serde(rename = "redirectUrl", skip_serializing_if = "Option::is_none")]
    pub redirect_url: Option<String>,
    /// Hosted signup page only. Append the connect token to the success redirect, as the redirect flow does for API-key callers.
    #[serde(rename = "echoConnectToken", skip_serializing_if = "Option::is_none")]
    pub echo_connect_token: Option<bool>,
}

impl ConnectWhatsAppEmbeddedSignupRequest {
    pub fn new(code: String, profile_id: String) -> ConnectWhatsAppEmbeddedSignupRequest {
        ConnectWhatsAppEmbeddedSignupRequest {
            code,
            profile_id,
            waba_id: None,
            phone_number_id: None,
            is_coexistence: None,
            expected_phone_number: None,
            redirect_url: None,
            echo_connect_token: None,
        }
    }
}