1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* 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 SubmitPhoneNumberKycRequest {
#[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 reusable verification to use (GET reusable.options[].id). The unambiguous selection key. Omitted = the approved default. No match = 409.
#[serde(rename = "reuseOptionId", skip_serializing_if = "Option::is_none")]
pub reuse_option_id: Option<String>,
/// Legacy fallback for `reuseOptionId`: the source phone number (GET reusable.options[].fromPhoneNumber). Ambiguous when a number labels two verifications — prefer `reuseOptionId`. Omitted = the approved default. No match = 409.
#[serde(rename = "reuseFrom", skip_serializing_if = "Option::is_none")]
pub reuse_from: Option<String>,
/// Area code (NDC) the number must be in. Hard constraint: an empty area pool fails with 409 code AREA_CODE_UNAVAILABLE instead of ordering from another area. Omit for any area. Options come from GET /v1/phone-numbers/availability (areaOptions); the purchase 202 kycUrl echoes the areaCode picked at purchase time so it can be passed here.
#[serde(rename = "areaCode", skip_serializing_if = "Option::is_none")]
pub area_code: 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/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::SubmitPhoneNumberKycRequestDocumentsInner>>,
#[serde(rename = "address", skip_serializing_if = "Option::is_none")]
pub address: Option<Box<models::SubmitPhoneNumberKycRequestAddress>>,
}
impl SubmitPhoneNumberKycRequest {
pub fn new(profile_id: String, country: String) -> SubmitPhoneNumberKycRequest {
SubmitPhoneNumberKycRequest {
profile_id,
country,
submission_id: None,
quantity: None,
reuse: None,
reuse_option_id: None,
reuse_from: None,
area_code: None,
end_user_first_name: None,
end_user_last_name: None,
values: None,
documents: None,
address: None,
}
}
}