late 0.0.1069

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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
/*
 * 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.115.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// OwnedPhoneNumber : A number you bought or ported. Null fields are omitted, except `socialAccountId` and `ownerAccountId`. Credentials stored for the number (such as the SIP digest password) are never returned; `sipAuthUsername` is the only SIP credential field exposed.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OwnedPhoneNumber {
    #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
    pub _id: Option<String>,
    #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
    pub phone_number: Option<String>,
    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    /// For example local, mobile, national or toll_free.
    #[serde(rename = "numberType", skip_serializing_if = "Option::is_none")]
    pub number_type: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    #[serde(rename = "profileId", skip_serializing_if = "Option::is_none")]
    pub profile_id: Option<Box<models::OwnedPhoneNumberProfileId>>,
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// Present once the number order has been placed (i.e. the requirement group was approved). Absent while still in identity review.
    #[serde(
        rename = "telnyxOrderId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub telnyx_order_id: Option<Option<String>>,
    /// Present on a pre-order: the carrier request placed for a number with no stock yet.
    #[serde(
        rename = "telnyxAdvancedOrderId",
        skip_serializing_if = "Option::is_none"
    )]
    pub telnyx_advanced_order_id: Option<String>,
    /// For regulated numbers, who it's registered for (company or person), set from the submitted KYC.
    #[serde(
        rename = "registrantName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub registrant_name: Option<Option<String>>,
    #[serde(
        rename = "endUserFirstName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub end_user_first_name: Option<Option<String>>,
    #[serde(
        rename = "endUserLastName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub end_user_last_name: Option<Option<String>>,
    /// Reviewer rejection reason when status is regulatory_declined.
    #[serde(
        rename = "regulatoryDeclineReason",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub regulatory_decline_reason: Option<Option<String>>,
    /// The latest reviewer comment on a regulated number still in review.
    #[serde(
        rename = "regulatoryReviewComment",
        skip_serializing_if = "Option::is_none"
    )]
    pub regulatory_review_comment: Option<String>,
    /// `action_required` when the reviewer is waiting on you.
    #[serde(
        rename = "regulatoryInfoStatus",
        skip_serializing_if = "Option::is_none"
    )]
    pub regulatory_info_status: Option<String>,
    /// For regulated (Tier 3/4) numbers with an Onfido ID-verification step: the link to forward to the end user. Set once the order is placed; null otherwise. Poll this field after submitting KYC.
    #[serde(
        rename = "onfidoVerificationUrl",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub onfido_verification_url: Option<Option<String>>,
    /// Stable redirect to the live Onfido session. Prefer it over `onfidoVerificationUrl`, since it always resolves to a fresh session.
    #[serde(
        rename = "verifyUrl",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub verify_url: Option<Option<String>>,
    /// True once the verify link has been opened at least once.
    #[serde(rename = "onfidoOpened", skip_serializing_if = "Option::is_none")]
    pub onfido_opened: Option<bool>,
    #[serde(rename = "metaPreverifiedId", skip_serializing_if = "Option::is_none")]
    pub meta_preverified_id: Option<String>,
    #[serde(
        rename = "metaVerificationStatus",
        skip_serializing_if = "Option::is_none"
    )]
    pub meta_verification_status: Option<MetaVerificationStatus>,
    #[serde(rename = "metaVerifiedAt", skip_serializing_if = "Option::is_none")]
    pub meta_verified_at: Option<String>,
    #[serde(
        rename = "metaVerificationExpiresAt",
        skip_serializing_if = "Option::is_none"
    )]
    pub meta_verification_expires_at: Option<String>,
    /// The WhatsApp account the number is linked to; null when WhatsApp is not connected.
    #[serde(
        rename = "socialAccountId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub social_account_id: Option<Option<String>>,
    /// The telephony account that owns Calls and SMS on the number.
    #[serde(
        rename = "ownerAccountId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub owner_account_id: Option<Option<String>>,
    /// SIP trunk the number is attached to; null when not trunked. While attached, enabling Calls or WhatsApp calling, requesting WhatsApp verification, and releasing the number all return 409.
    #[serde(
        rename = "sipTrunkId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sip_trunk_id: Option<Option<String>>,
    /// False for a standalone phone bought for Calls or SMS only.
    #[serde(rename = "whatsAppRequested", skip_serializing_if = "Option::is_none")]
    pub whats_app_requested: Option<bool>,
    #[serde(rename = "smsRequested", skip_serializing_if = "Option::is_none")]
    pub sms_requested: Option<bool>,
    #[serde(rename = "provisionedAt", skip_serializing_if = "Option::is_none")]
    pub provisioned_at: Option<String>,
    #[serde(rename = "activatedAt", skip_serializing_if = "Option::is_none")]
    pub activated_at: Option<String>,
    #[serde(rename = "connectedAt", skip_serializing_if = "Option::is_none")]
    pub connected_at: Option<String>,
    #[serde(rename = "suspendedAt", skip_serializing_if = "Option::is_none")]
    pub suspended_at: Option<String>,
    #[serde(rename = "releasedAt", skip_serializing_if = "Option::is_none")]
    pub released_at: Option<String>,
    /// Meta's Embedded Signup error from the last failed connect attempt (raw text, often localized).
    #[serde(rename = "signupError", skip_serializing_if = "Option::is_none")]
    pub signup_error: Option<String>,
    #[serde(rename = "signupErrorAt", skip_serializing_if = "Option::is_none")]
    pub signup_error_at: Option<String>,
    #[serde(rename = "signupErrorStep", skip_serializing_if = "Option::is_none")]
    pub signup_error_step: Option<String>,
    /// What this number bills each month, in cents. Stamped when the number was bought, so an existing number keeps its price when the rate card changes.
    #[serde(rename = "monthlyCents", skip_serializing_if = "Option::is_none")]
    pub monthly_cents: Option<i32>,
    /// False for numbers you brought yourself (connected via Meta embedded signup). They live on your own carrier, so SMS/Calls can't be enabled on them.
    #[serde(rename = "hostedByZernio", skip_serializing_if = "Option::is_none")]
    pub hosted_by_zernio: Option<bool>,
    /// Whether the number can send SMS. Absent while unknown.
    #[serde(rename = "smsCapable", skip_serializing_if = "Option::is_none")]
    pub sms_capable: Option<bool>,
    /// Whether the number can send MMS. Absent while unknown.
    #[serde(rename = "mmsCapable", skip_serializing_if = "Option::is_none")]
    pub mms_capable: Option<bool>,
    /// True when the number can only text numbers in its own country. Absent while unknown.
    #[serde(rename = "domesticOnly", skip_serializing_if = "Option::is_none")]
    pub domestic_only: Option<bool>,
    /// True while a 10DLC registration covering this number is in review.
    #[serde(
        rename = "smsRegistrationPending",
        skip_serializing_if = "Option::is_none"
    )]
    pub sms_registration_pending: Option<bool>,
    /// True when outbound SMS is unlocked: an approved 10DLC covers the number, or the number is outside the US.
    #[serde(rename = "smsSendApproved", skip_serializing_if = "Option::is_none")]
    pub sms_send_approved: Option<bool>,
    /// Brand of the 10DLC registration covering the number.
    #[serde(
        rename = "smsBrandName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sms_brand_name: Option<Option<String>>,
    #[serde(rename = "features", skip_serializing_if = "Option::is_none")]
    pub features: Option<Box<models::OwnedPhoneNumberFeatures>>,
    /// Whether WhatsApp Business Calling is enabled on this number (manage via /v1/whatsapp/phone-numbers/{id}/calling).
    #[serde(rename = "callingEnabled", skip_serializing_if = "Option::is_none")]
    pub calling_enabled: Option<bool>,
    /// WhatsApp calling forward destination.
    #[serde(rename = "forwardTo", skip_serializing_if = "Option::is_none")]
    pub forward_to: Option<String>,
    /// SIP digest username for a sip: forward destination. The password is never returned.
    #[serde(rename = "sipAuthUsername", skip_serializing_if = "Option::is_none")]
    pub sip_auth_username: Option<String>,
    #[serde(rename = "callerIdVerifiedAt", skip_serializing_if = "Option::is_none")]
    pub caller_id_verified_at: Option<String>,
    #[serde(
        rename = "maxCallDurationSeconds",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_call_duration_seconds: Option<i32>,
    #[serde(rename = "recordingEnabled", skip_serializing_if = "Option::is_none")]
    pub recording_enabled: Option<bool>,
    #[serde(
        rename = "transcriptionEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub transcription_enabled: Option<bool>,
    #[serde(
        rename = "transcriptionLanguage",
        skip_serializing_if = "Option::is_none"
    )]
    pub transcription_language: Option<TranscriptionLanguage>,
    #[serde(rename = "callIconCountries", skip_serializing_if = "Option::is_none")]
    pub call_icon_countries: Option<Vec<String>>,
    #[serde(rename = "forwardCallerId", skip_serializing_if = "Option::is_none")]
    pub forward_caller_id: Option<ForwardCallerId>,
    /// Whether Calls (PSTN voice) is on.
    #[serde(rename = "pstnVoiceEnabled", skip_serializing_if = "Option::is_none")]
    pub pstn_voice_enabled: Option<bool>,
    #[serde(rename = "pstnForwardTo", skip_serializing_if = "Option::is_none")]
    pub pstn_forward_to: Option<String>,
    #[serde(rename = "voicemailEnabled", skip_serializing_if = "Option::is_none")]
    pub voicemail_enabled: Option<bool>,
    #[serde(rename = "voicemailGreeting", skip_serializing_if = "Option::is_none")]
    pub voicemail_greeting: Option<String>,
    #[serde(
        rename = "businessHoursEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub business_hours_enabled: Option<bool>,
    #[serde(
        rename = "businessHoursTimezone",
        skip_serializing_if = "Option::is_none"
    )]
    pub business_hours_timezone: Option<String>,
    #[serde(rename = "businessHours", skip_serializing_if = "Option::is_none")]
    pub business_hours: Option<Vec<models::EnableVoiceOnNumber200ResponseBusinessHoursInner>>,
    #[serde(rename = "blockedCallers", skip_serializing_if = "Option::is_none")]
    pub blocked_callers: Option<Vec<String>>,
    #[serde(rename = "ivrEnabled", skip_serializing_if = "Option::is_none")]
    pub ivr_enabled: Option<bool>,
    #[serde(rename = "ivrPrompt", skip_serializing_if = "Option::is_none")]
    pub ivr_prompt: Option<String>,
    #[serde(rename = "ivrOptions", skip_serializing_if = "Option::is_none")]
    pub ivr_options: Option<Vec<models::EnableVoiceOnNumber200ResponseIvrOptionsInner>>,
}

impl OwnedPhoneNumber {
    /// A number you bought or ported. Null fields are omitted, except `socialAccountId` and `ownerAccountId`. Credentials stored for the number (such as the SIP digest password) are never returned; `sipAuthUsername` is the only SIP credential field exposed.
    pub fn new() -> OwnedPhoneNumber {
        OwnedPhoneNumber {
            _id: None,
            phone_number: None,
            country: None,
            number_type: None,
            status: None,
            profile_id: None,
            created_at: None,
            updated_at: None,
            telnyx_order_id: None,
            telnyx_advanced_order_id: None,
            registrant_name: None,
            end_user_first_name: None,
            end_user_last_name: None,
            regulatory_decline_reason: None,
            regulatory_review_comment: None,
            regulatory_info_status: None,
            onfido_verification_url: None,
            verify_url: None,
            onfido_opened: None,
            meta_preverified_id: None,
            meta_verification_status: None,
            meta_verified_at: None,
            meta_verification_expires_at: None,
            social_account_id: None,
            owner_account_id: None,
            sip_trunk_id: None,
            whats_app_requested: None,
            sms_requested: None,
            provisioned_at: None,
            activated_at: None,
            connected_at: None,
            suspended_at: None,
            released_at: None,
            signup_error: None,
            signup_error_at: None,
            signup_error_step: None,
            monthly_cents: None,
            hosted_by_zernio: None,
            sms_capable: None,
            mms_capable: None,
            domestic_only: None,
            sms_registration_pending: None,
            sms_send_approved: None,
            sms_brand_name: None,
            features: None,
            calling_enabled: None,
            forward_to: None,
            sip_auth_username: None,
            caller_id_verified_at: None,
            max_call_duration_seconds: None,
            recording_enabled: None,
            transcription_enabled: None,
            transcription_language: None,
            call_icon_countries: None,
            forward_caller_id: None,
            pstn_voice_enabled: None,
            pstn_forward_to: None,
            voicemail_enabled: None,
            voicemail_greeting: None,
            business_hours_enabled: None,
            business_hours_timezone: None,
            business_hours: None,
            blocked_callers: None,
            ivr_enabled: None,
            ivr_prompt: None,
            ivr_options: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "pending_payment")]
    PendingPayment,
    #[serde(rename = "pending_regulatory")]
    PendingRegulatory,
    #[serde(rename = "regulatory_declined")]
    RegulatoryDeclined,
    #[serde(rename = "provisioning")]
    Provisioning,
    #[serde(rename = "verifying")]
    Verifying,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "suspended")]
    Suspended,
    #[serde(rename = "releasing")]
    Releasing,
    #[serde(rename = "released")]
    Released,
}

impl Default for Status {
    fn default() -> Status {
        Self::PendingPayment
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MetaVerificationStatus {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "code_requested")]
    CodeRequested,
    #[serde(rename = "verified")]
    Verified,
    #[serde(rename = "expired")]
    Expired,
}

impl Default for MetaVerificationStatus {
    fn default() -> MetaVerificationStatus {
        Self::Pending
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TranscriptionLanguage {
    #[serde(rename = "auto")]
    Auto,
    #[serde(rename = "en")]
    En,
    #[serde(rename = "es")]
    Es,
}

impl Default for TranscriptionLanguage {
    fn default() -> TranscriptionLanguage {
        Self::Auto
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ForwardCallerId {
    #[serde(rename = "business")]
    Business,
    #[serde(rename = "caller")]
    Caller,
}

impl Default for ForwardCallerId {
    fn default() -> ForwardCallerId {
        Self::Business
    }
}