/*
 * 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 SubmitWhatsAppNumberKycRequest {
    #[serde(rename = "profileId")]
    pub profile_id: String,
    #[serde(rename = "country")]
    pub country: String,
    /// Idempotency token for this submission attempt. A retry/double-submit with the same token returns the same number; omit and each call creates a new number.
    #[serde(rename = "submissionId", skip_serializing_if = "Option::is_none")]
    pub submission_id: Option<String>,
    /// Provision several same-country numbers from one submission (1-5). The single verification covers all of them; each number is billed only when it activates. Numbers that fail to order are skipped (best-effort).
    #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")]
    pub quantity: Option<i32>,
    /// Reuse a prior approved verification for this country (skips document/field collection; places the order immediately).
    #[serde(rename = "reuse", skip_serializing_if = "Option::is_none")]
    pub reuse: Option<bool>,
    /// Which approved verification to reuse when several exist: the phone number it was originally approved for (GET reusable.options[].fromPhoneNumber). Omitted = newest. No match = 409.
    #[serde(rename = "reuseFrom", skip_serializing_if = "Option::is_none")]
    pub reuse_from: Option<String>,
    /// End user's legal first name. Required when the country has an action/ID-verification (Onfido) requirement.
    #[serde(rename = "endUserFirstName", skip_serializing_if = "Option::is_none")]
    pub end_user_first_name: Option<String>,
    /// End user's legal last name. Same condition as endUserFirstName.
    #[serde(rename = "endUserLastName", skip_serializing_if = "Option::is_none")]
    pub end_user_last_name: Option<String>,
    /// requirementId → textual value
    #[serde(rename = "values", skip_serializing_if = "Option::is_none")]
    pub values: Option<std::collections::HashMap<String, String>>,
    /// One per document requirement. Each is EITHER inline base64 OR a `documentId` returned by POST /v1/whatsapp/phone-numbers/kyc/upload-document (use the upload endpoint for large files to stay under the request-size limit).
    #[serde(rename = "documents", skip_serializing_if = "Option::is_none")]
    pub documents: Option<Vec<models::SubmitWhatsAppNumberKycRequestDocumentsInner>>,
    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
    pub address: Option<Box<models::SubmitWhatsAppNumberKycRequestAddress>>,
}

impl SubmitWhatsAppNumberKycRequest {
    pub fn new(profile_id: String, country: String) -> SubmitWhatsAppNumberKycRequest {
        SubmitWhatsAppNumberKycRequest {
            profile_id,
            country,
            submission_id: None,
            quantity: None,
            reuse: None,
            reuse_from: None,
            end_user_first_name: None,
            end_user_last_name: None,
            values: None,
            documents: None,
            address: None,
        }
    }
}
