late-sdk 0.0.919 → 0.0.920
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/PhoneNumbersApi.md +2 -2
- data/docs/PurchasePhoneNumberRequest.md +2 -0
- data/docs/PurchaseWhatsAppPhoneNumberRequest.md +2 -0
- data/docs/SearchAvailablePhoneNumbers200ResponseNumbersInner.md +6 -2
- data/docs/SearchAvailableWhatsAppNumbers200ResponseNumbersInner.md +5 -1
- data/docs/WhatsAppPhoneNumbersApi.md +1 -1
- data/lib/zernio-sdk/api/phone_numbers_api.rb +4 -4
- data/lib/zernio-sdk/api/whats_app_phone_numbers_api.rb +2 -2
- data/lib/zernio-sdk/models/purchase_phone_number409_response.rb +2 -2
- data/lib/zernio-sdk/models/purchase_phone_number_request.rb +32 -1
- data/lib/zernio-sdk/models/purchase_whats_app_phone_number_request.rb +32 -1
- data/lib/zernio-sdk/models/search_available_phone_numbers200_response_numbers_inner.rb +25 -4
- data/lib/zernio-sdk/models/search_available_whats_app_numbers200_response_numbers_inner.rb +22 -4
- data/lib/zernio-sdk/version.rb +1 -1
- data/openapi.yaml +37 -10
- data/spec/api/phone_numbers_api_spec.rb +2 -2
- data/spec/api/whats_app_phone_numbers_api_spec.rb +1 -1
- data/spec/models/purchase_phone_number409_response_spec.rb +1 -1
- data/spec/models/purchase_phone_number_request_spec.rb +6 -0
- data/spec/models/purchase_whats_app_phone_number_request_spec.rb +6 -0
- data/spec/models/search_available_phone_numbers200_response_numbers_inner_spec.rb +12 -0
- data/spec/models/search_available_whats_app_numbers200_response_numbers_inner_spec.rb +12 -0
- data/zernio-sdk-0.0.920.gem +0 -0
- metadata +2 -2
- data/zernio-sdk-0.0.919.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 40e2044e5a7296ed3c98b27ebbe305a8774a0ea47146a6f679d3e31127b2fa11
|
|
4
|
+
data.tar.gz: dad4e1e52cd622362f1409fd7f4cf66923e9e45edfd7140d77d05372df23d33b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96c3456acb147bca85978b4f2ca9ac4d9d6003d57f586ffd75f86ca20ae7e7291af33a688efc45e084a876a26eea3031701db20206d4b6172ce11976da4b544d
|
|
7
|
+
data.tar.gz: 742671702d09b3f84b24be024bd2563289b3ea4c6a6b5951010aa210522882eb50d5dc216c6acc02847f267c3f13ee2447597e052608b548fe3b5de52bd03e86
|
data/docs/PhoneNumbersApi.md
CHANGED
|
@@ -1149,7 +1149,7 @@ end
|
|
|
1149
1149
|
|
|
1150
1150
|
Purchase phone number
|
|
1151
1151
|
|
|
1152
|
-
Payment-first:
|
|
1152
|
+
Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
1153
1153
|
|
|
1154
1154
|
### Examples
|
|
1155
1155
|
|
|
@@ -1569,7 +1569,7 @@ end
|
|
|
1569
1569
|
|
|
1570
1570
|
Search available numbers
|
|
1571
1571
|
|
|
1572
|
-
Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country).
|
|
1572
|
+
Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country). Numbers a purchase would refuse are left out, and any result's `phoneNumber` can be bought exactly by passing it to POST /v1/phone-numbers/purchase.
|
|
1573
1573
|
|
|
1574
1574
|
### Examples
|
|
1575
1575
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
| **country** | **String** | ISO 3166-1 alpha-2 country for the number (default US). International numbers require usage-based billing. Tier 3/4 countries return 202 { status: \"kyc_required\", kycUrl }. The customer must complete KYC at that URL before the number is ordered. See GET /v1/phone-numbers/countries. | [optional][default to 'US'] |
|
|
9
9
|
| **number_type** | **String** | Which of the country's offered number types to order (see `types[]` on GET /v1/phone-numbers/countries). Omitted = the country's default type, which is always the WhatsApp-safe choice. Capabilities, price, and KYC requirements are per (country, type): toll_free can never connect WhatsApp (400 when combined with connectWhatsapp:true), and wantsSms:true requires an SMS-capable type. | [optional] |
|
|
10
10
|
| **area_code** | **String** | Area code (national destination code, e.g. 11 for Sao Paulo) the number must be in. Hard constraint: when the area has no deliverable inventory the purchase fails with 409 code AREA_CODE_UNAVAILABLE instead of assigning a number from another area, and later replacements stay in this area too. Omit for any area. Get live options from GET /v1/phone-numbers/availability (areaOptions). | [optional] |
|
|
11
|
+
| **phone_number** | **String** | One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Hard constraint: when it is no longer available (bought by someone else, or WhatsApp's buy-time check rejects it) the purchase fails with 409 code PHONE_NUMBER_UNAVAILABLE instead of assigning another number; search again and pick another. Only for countries and types that activate instantly: a regulated one (202 kyc_required) returns 400 when phoneNumber is set. | [optional] |
|
|
11
12
|
| **connect_whatsapp** | **Boolean** | A phone number is the unit; WhatsApp is one optional feature. Pass false to buy a STANDALONE number (Calls/SMS only): provisioning skips the Meta pre-verify/OTP steps and the number activates immediately. Omitted defaults to the WhatsApp provisioning path. WhatsApp can be connected to a standalone number later from the connect flow. | [optional][default to true] |
|
|
12
13
|
| **wants_sms** | **Boolean** | SMS capability is per-number, not per-country. Pass true to provision from the SMS-capable inventory pool so the number can actually text (see also GET /v1/phone-numbers/available with sms=true, and smsAvailable on GET /v1/phone-numbers/countries). | [optional][default to false] |
|
|
13
14
|
| **wants_whatsapp** | **Boolean** | Declare WhatsApp intent on a STANDALONE purchase (connectWhatsapp:false). The number still activates and bills immediately, but if WhatsApp's buy-time check rejects the assigned number, it is automatically swapped for a WhatsApp-eligible one during the purchase instead of being delivered with WhatsApp unavailable. Ignored on the WhatsApp provisioning path (connectWhatsapp omitted or true), which always delivers a WhatsApp-verified number. | [optional][default to false] |
|
|
@@ -24,6 +25,7 @@ instance = Zernio::PurchasePhoneNumberRequest.new(
|
|
|
24
25
|
country: null,
|
|
25
26
|
number_type: null,
|
|
26
27
|
area_code: null,
|
|
28
|
+
phone_number: null,
|
|
27
29
|
connect_whatsapp: null,
|
|
28
30
|
wants_sms: null,
|
|
29
31
|
wants_whatsapp: null,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **profile_id** | **String** | Profile to associate the number with | |
|
|
8
8
|
| **country** | **String** | ISO 3166-1 alpha-2 country for the number (default US). International numbers require usage-based billing. Tier 3/4 countries return 202 { status: \"kyc_required\", kycUrl }. The customer must complete KYC at that URL before the number is ordered. See GET /v1/whatsapp/phone-numbers/countries. | [optional][default to 'US'] |
|
|
9
|
+
| **phone_number** | **String** | One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Fails with 409 code PHONE_NUMBER_UNAVAILABLE when it is no longer available. | [optional] |
|
|
9
10
|
| **purchase_intent_id** | **String** | Optional idempotency key. Send the same value when retrying a purchase: if a number was already bought under this key, the API returns { status: \"already_purchased\", numberId, phoneNumber } instead of provisioning a second number. Generate a fresh key for each genuinely new purchase. | [optional] |
|
|
10
11
|
| **allow_multiple** | **Boolean** | Any second purchase within 10 minutes of a previous one is rejected with 409 code PURCHASE_VELOCITY as duplicate protection. Pass true to confirm the additional purchase is intentional (e.g. bulk provisioning). | [optional][default to false] |
|
|
11
12
|
|
|
@@ -17,6 +18,7 @@ require 'zernio-sdk'
|
|
|
17
18
|
instance = Zernio::PurchaseWhatsAppPhoneNumberRequest.new(
|
|
18
19
|
profile_id: null,
|
|
19
20
|
country: null,
|
|
21
|
+
phone_number: null,
|
|
20
22
|
purchase_intent_id: null,
|
|
21
23
|
allow_multiple: null
|
|
22
24
|
)
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **phone_number** | **String** |
|
|
7
|
+
| **phone_number** | **String** | E.164. Pass it as `phoneNumber` on POST /v1/phone-numbers/purchase to buy this exact number. | [optional] |
|
|
8
8
|
| **features** | **Array<String>** | Provider capability list for this number (e.g. voice, sms, mms). | [optional] |
|
|
9
|
+
| **locality** | **String** | Town or rate center the number belongs to, as the carrier names it (e.g. WACO). | [optional] |
|
|
10
|
+
| **best_effort** | **Boolean** | true when the carrier added this number because too few matched your filters, so it may be outside the requested prefix or locality. | [optional] |
|
|
9
11
|
|
|
10
12
|
## Example
|
|
11
13
|
|
|
@@ -14,7 +16,9 @@ require 'zernio-sdk'
|
|
|
14
16
|
|
|
15
17
|
instance = Zernio::SearchAvailablePhoneNumbers200ResponseNumbersInner.new(
|
|
16
18
|
phone_number: null,
|
|
17
|
-
features: null
|
|
19
|
+
features: null,
|
|
20
|
+
locality: null,
|
|
21
|
+
best_effort: null
|
|
18
22
|
)
|
|
19
23
|
```
|
|
20
24
|
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **phone_number** | **String** | | [optional] |
|
|
8
|
+
| **locality** | **String** | | [optional] |
|
|
9
|
+
| **best_effort** | **Boolean** | | [optional] |
|
|
8
10
|
|
|
9
11
|
## Example
|
|
10
12
|
|
|
@@ -12,7 +14,9 @@
|
|
|
12
14
|
require 'zernio-sdk'
|
|
13
15
|
|
|
14
16
|
instance = Zernio::SearchAvailableWhatsAppNumbers200ResponseNumbersInner.new(
|
|
15
|
-
phone_number: null
|
|
17
|
+
phone_number: null,
|
|
18
|
+
locality: null,
|
|
19
|
+
best_effort: null
|
|
16
20
|
)
|
|
17
21
|
```
|
|
18
22
|
|
|
@@ -660,7 +660,7 @@ end
|
|
|
660
660
|
|
|
661
661
|
Purchase phone number
|
|
662
662
|
|
|
663
|
-
Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first:
|
|
663
|
+
Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
664
664
|
|
|
665
665
|
### Examples
|
|
666
666
|
|
|
@@ -1065,7 +1065,7 @@ module Zernio
|
|
|
1065
1065
|
end
|
|
1066
1066
|
|
|
1067
1067
|
# Purchase phone number
|
|
1068
|
-
# Payment-first:
|
|
1068
|
+
# Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
1069
1069
|
# @param purchase_phone_number_request [PurchasePhoneNumberRequest]
|
|
1070
1070
|
# @param [Hash] opts the optional parameters
|
|
1071
1071
|
# @return [PurchasePhoneNumber200Response]
|
|
@@ -1075,7 +1075,7 @@ module Zernio
|
|
|
1075
1075
|
end
|
|
1076
1076
|
|
|
1077
1077
|
# Purchase phone number
|
|
1078
|
-
# Payment-first:
|
|
1078
|
+
# Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
1079
1079
|
# @param purchase_phone_number_request [PurchasePhoneNumberRequest]
|
|
1080
1080
|
# @param [Hash] opts the optional parameters
|
|
1081
1081
|
# @return [Array<(PurchasePhoneNumber200Response, Integer, Hash)>] PurchasePhoneNumber200Response data, response status code and response headers
|
|
@@ -1486,7 +1486,7 @@ module Zernio
|
|
|
1486
1486
|
end
|
|
1487
1487
|
|
|
1488
1488
|
# Search available numbers
|
|
1489
|
-
# Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country).
|
|
1489
|
+
# Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country). Numbers a purchase would refuse are left out, and any result's `phoneNumber` can be bought exactly by passing it to POST /v1/phone-numbers/purchase.
|
|
1490
1490
|
# @param [Hash] opts the optional parameters
|
|
1491
1491
|
# @option opts [String] :country (default to 'US')
|
|
1492
1492
|
# @option opts [String] :type Number type; defaults to the country's WhatsApp-safe type
|
|
@@ -1502,7 +1502,7 @@ module Zernio
|
|
|
1502
1502
|
end
|
|
1503
1503
|
|
|
1504
1504
|
# Search available numbers
|
|
1505
|
-
# Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country).
|
|
1505
|
+
# Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country). Numbers a purchase would refuse are left out, and any result's `phoneNumber` can be bought exactly by passing it to POST /v1/phone-numbers/purchase.
|
|
1506
1506
|
# @param [Hash] opts the optional parameters
|
|
1507
1507
|
# @option opts [String] :country (default to 'US')
|
|
1508
1508
|
# @option opts [String] :type Number type; defaults to the country's WhatsApp-safe type
|
|
@@ -621,7 +621,7 @@ module Zernio
|
|
|
621
621
|
end
|
|
622
622
|
|
|
623
623
|
# Purchase phone number
|
|
624
|
-
# Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first:
|
|
624
|
+
# Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
625
625
|
# @param purchase_whats_app_phone_number_request [PurchaseWhatsAppPhoneNumberRequest]
|
|
626
626
|
# @param [Hash] opts the optional parameters
|
|
627
627
|
# @return [PurchaseWhatsAppPhoneNumber200Response]
|
|
@@ -631,7 +631,7 @@ module Zernio
|
|
|
631
631
|
end
|
|
632
632
|
|
|
633
633
|
# Purchase phone number
|
|
634
|
-
# Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first:
|
|
634
|
+
# Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
635
635
|
# @param purchase_whats_app_phone_number_request [PurchaseWhatsAppPhoneNumberRequest]
|
|
636
636
|
# @param [Hash] opts the optional parameters
|
|
637
637
|
# @return [Array<(PurchaseWhatsAppPhoneNumber200Response, Integer, Hash)>] PurchaseWhatsAppPhoneNumber200Response data, response status code and response headers
|
|
@@ -110,7 +110,7 @@ module Zernio
|
|
|
110
110
|
# @return true if the model is valid
|
|
111
111
|
def valid?
|
|
112
112
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
-
code_validator = EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY", "AREA_CODE_UNAVAILABLE"])
|
|
113
|
+
code_validator = EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY", "AREA_CODE_UNAVAILABLE", "PHONE_NUMBER_UNAVAILABLE"])
|
|
114
114
|
return false unless code_validator.valid?(@code)
|
|
115
115
|
true
|
|
116
116
|
end
|
|
@@ -118,7 +118,7 @@ module Zernio
|
|
|
118
118
|
# Custom attribute writer method checking allowed values (enum).
|
|
119
119
|
# @param [Object] code Object to be assigned
|
|
120
120
|
def code=(code)
|
|
121
|
-
validator = EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY", "AREA_CODE_UNAVAILABLE"])
|
|
121
|
+
validator = EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY", "AREA_CODE_UNAVAILABLE", "PHONE_NUMBER_UNAVAILABLE"])
|
|
122
122
|
unless validator.valid?(code)
|
|
123
123
|
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
124
124
|
end
|
|
@@ -27,6 +27,9 @@ module Zernio
|
|
|
27
27
|
# Area code (national destination code, e.g. 11 for Sao Paulo) the number must be in. Hard constraint: when the area has no deliverable inventory the purchase fails with 409 code AREA_CODE_UNAVAILABLE instead of assigning a number from another area, and later replacements stay in this area too. Omit for any area. Get live options from GET /v1/phone-numbers/availability (areaOptions).
|
|
28
28
|
attr_accessor :area_code
|
|
29
29
|
|
|
30
|
+
# One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Hard constraint: when it is no longer available (bought by someone else, or WhatsApp's buy-time check rejects it) the purchase fails with 409 code PHONE_NUMBER_UNAVAILABLE instead of assigning another number; search again and pick another. Only for countries and types that activate instantly: a regulated one (202 kyc_required) returns 400 when phoneNumber is set.
|
|
31
|
+
attr_accessor :phone_number
|
|
32
|
+
|
|
30
33
|
# A phone number is the unit; WhatsApp is one optional feature. Pass false to buy a STANDALONE number (Calls/SMS only): provisioning skips the Meta pre-verify/OTP steps and the number activates immediately. Omitted defaults to the WhatsApp provisioning path. WhatsApp can be connected to a standalone number later from the connect flow.
|
|
31
34
|
attr_accessor :connect_whatsapp
|
|
32
35
|
|
|
@@ -71,6 +74,7 @@ module Zernio
|
|
|
71
74
|
:'country' => :'country',
|
|
72
75
|
:'number_type' => :'numberType',
|
|
73
76
|
:'area_code' => :'areaCode',
|
|
77
|
+
:'phone_number' => :'phoneNumber',
|
|
74
78
|
:'connect_whatsapp' => :'connectWhatsapp',
|
|
75
79
|
:'wants_sms' => :'wantsSms',
|
|
76
80
|
:'wants_whatsapp' => :'wantsWhatsapp',
|
|
@@ -96,6 +100,7 @@ module Zernio
|
|
|
96
100
|
:'country' => :'String',
|
|
97
101
|
:'number_type' => :'String',
|
|
98
102
|
:'area_code' => :'String',
|
|
103
|
+
:'phone_number' => :'String',
|
|
99
104
|
:'connect_whatsapp' => :'Boolean',
|
|
100
105
|
:'wants_sms' => :'Boolean',
|
|
101
106
|
:'wants_whatsapp' => :'Boolean',
|
|
@@ -146,6 +151,10 @@ module Zernio
|
|
|
146
151
|
self.area_code = attributes[:'area_code']
|
|
147
152
|
end
|
|
148
153
|
|
|
154
|
+
if attributes.key?(:'phone_number')
|
|
155
|
+
self.phone_number = attributes[:'phone_number']
|
|
156
|
+
end
|
|
157
|
+
|
|
149
158
|
if attributes.key?(:'connect_whatsapp')
|
|
150
159
|
self.connect_whatsapp = attributes[:'connect_whatsapp']
|
|
151
160
|
else
|
|
@@ -189,6 +198,11 @@ module Zernio
|
|
|
189
198
|
invalid_properties.push("invalid value for \"area_code\", must conform to the pattern #{pattern}.")
|
|
190
199
|
end
|
|
191
200
|
|
|
201
|
+
pattern = Regexp.new(/^\+[1-9]\d{6,14}$/)
|
|
202
|
+
if !@phone_number.nil? && @phone_number !~ pattern
|
|
203
|
+
invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.")
|
|
204
|
+
end
|
|
205
|
+
|
|
192
206
|
if !@purchase_intent_id.nil? && @purchase_intent_id.to_s.length > 100
|
|
193
207
|
invalid_properties.push('invalid value for "purchase_intent_id", the character length must be smaller than or equal to 100.')
|
|
194
208
|
end
|
|
@@ -204,6 +218,7 @@ module Zernio
|
|
|
204
218
|
number_type_validator = EnumAttributeValidator.new('String', ["local", "mobile", "national", "toll_free"])
|
|
205
219
|
return false unless number_type_validator.valid?(@number_type)
|
|
206
220
|
return false if !@area_code.nil? && @area_code !~ Regexp.new(/^\d{1,4}$/)
|
|
221
|
+
return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^\+[1-9]\d{6,14}$/)
|
|
207
222
|
return false if !@purchase_intent_id.nil? && @purchase_intent_id.to_s.length > 100
|
|
208
223
|
true
|
|
209
224
|
end
|
|
@@ -243,6 +258,21 @@ module Zernio
|
|
|
243
258
|
@area_code = area_code
|
|
244
259
|
end
|
|
245
260
|
|
|
261
|
+
# Custom attribute writer method with validation
|
|
262
|
+
# @param [Object] phone_number Value to be assigned
|
|
263
|
+
def phone_number=(phone_number)
|
|
264
|
+
if phone_number.nil?
|
|
265
|
+
fail ArgumentError, 'phone_number cannot be nil'
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
pattern = Regexp.new(/^\+[1-9]\d{6,14}$/)
|
|
269
|
+
if phone_number !~ pattern
|
|
270
|
+
fail ArgumentError, "invalid value for \"phone_number\", must conform to the pattern #{pattern}."
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
@phone_number = phone_number
|
|
274
|
+
end
|
|
275
|
+
|
|
246
276
|
# Custom attribute writer method with validation
|
|
247
277
|
# @param [Object] purchase_intent_id Value to be assigned
|
|
248
278
|
def purchase_intent_id=(purchase_intent_id)
|
|
@@ -266,6 +296,7 @@ module Zernio
|
|
|
266
296
|
country == o.country &&
|
|
267
297
|
number_type == o.number_type &&
|
|
268
298
|
area_code == o.area_code &&
|
|
299
|
+
phone_number == o.phone_number &&
|
|
269
300
|
connect_whatsapp == o.connect_whatsapp &&
|
|
270
301
|
wants_sms == o.wants_sms &&
|
|
271
302
|
wants_whatsapp == o.wants_whatsapp &&
|
|
@@ -282,7 +313,7 @@ module Zernio
|
|
|
282
313
|
# Calculates hash code according to all attributes.
|
|
283
314
|
# @return [Integer] Hash code
|
|
284
315
|
def hash
|
|
285
|
-
[profile_id, country, number_type, area_code, connect_whatsapp, wants_sms, wants_whatsapp, purchase_intent_id, allow_multiple].hash
|
|
316
|
+
[profile_id, country, number_type, area_code, phone_number, connect_whatsapp, wants_sms, wants_whatsapp, purchase_intent_id, allow_multiple].hash
|
|
286
317
|
end
|
|
287
318
|
|
|
288
319
|
# Builds the object from hash
|
|
@@ -21,6 +21,9 @@ module Zernio
|
|
|
21
21
|
# ISO 3166-1 alpha-2 country for the number (default US). International numbers require usage-based billing. Tier 3/4 countries return 202 { status: \"kyc_required\", kycUrl }. The customer must complete KYC at that URL before the number is ordered. See GET /v1/whatsapp/phone-numbers/countries.
|
|
22
22
|
attr_accessor :country
|
|
23
23
|
|
|
24
|
+
# One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Fails with 409 code PHONE_NUMBER_UNAVAILABLE when it is no longer available.
|
|
25
|
+
attr_accessor :phone_number
|
|
26
|
+
|
|
24
27
|
# Optional idempotency key. Send the same value when retrying a purchase: if a number was already bought under this key, the API returns { status: \"already_purchased\", numberId, phoneNumber } instead of provisioning a second number. Generate a fresh key for each genuinely new purchase.
|
|
25
28
|
attr_accessor :purchase_intent_id
|
|
26
29
|
|
|
@@ -32,6 +35,7 @@ module Zernio
|
|
|
32
35
|
{
|
|
33
36
|
:'profile_id' => :'profileId',
|
|
34
37
|
:'country' => :'country',
|
|
38
|
+
:'phone_number' => :'phoneNumber',
|
|
35
39
|
:'purchase_intent_id' => :'purchaseIntentId',
|
|
36
40
|
:'allow_multiple' => :'allowMultiple'
|
|
37
41
|
}
|
|
@@ -52,6 +56,7 @@ module Zernio
|
|
|
52
56
|
{
|
|
53
57
|
:'profile_id' => :'String',
|
|
54
58
|
:'country' => :'String',
|
|
59
|
+
:'phone_number' => :'String',
|
|
55
60
|
:'purchase_intent_id' => :'String',
|
|
56
61
|
:'allow_multiple' => :'Boolean'
|
|
57
62
|
}
|
|
@@ -91,6 +96,10 @@ module Zernio
|
|
|
91
96
|
self.country = 'US'
|
|
92
97
|
end
|
|
93
98
|
|
|
99
|
+
if attributes.key?(:'phone_number')
|
|
100
|
+
self.phone_number = attributes[:'phone_number']
|
|
101
|
+
end
|
|
102
|
+
|
|
94
103
|
if attributes.key?(:'purchase_intent_id')
|
|
95
104
|
self.purchase_intent_id = attributes[:'purchase_intent_id']
|
|
96
105
|
end
|
|
@@ -111,6 +120,11 @@ module Zernio
|
|
|
111
120
|
invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
|
|
112
121
|
end
|
|
113
122
|
|
|
123
|
+
pattern = Regexp.new(/^\+[1-9]\d{6,14}$/)
|
|
124
|
+
if !@phone_number.nil? && @phone_number !~ pattern
|
|
125
|
+
invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.")
|
|
126
|
+
end
|
|
127
|
+
|
|
114
128
|
if !@purchase_intent_id.nil? && @purchase_intent_id.to_s.length > 100
|
|
115
129
|
invalid_properties.push('invalid value for "purchase_intent_id", the character length must be smaller than or equal to 100.')
|
|
116
130
|
end
|
|
@@ -123,6 +137,7 @@ module Zernio
|
|
|
123
137
|
def valid?
|
|
124
138
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
125
139
|
return false if @profile_id.nil?
|
|
140
|
+
return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^\+[1-9]\d{6,14}$/)
|
|
126
141
|
return false if !@purchase_intent_id.nil? && @purchase_intent_id.to_s.length > 100
|
|
127
142
|
true
|
|
128
143
|
end
|
|
@@ -137,6 +152,21 @@ module Zernio
|
|
|
137
152
|
@profile_id = profile_id
|
|
138
153
|
end
|
|
139
154
|
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] phone_number Value to be assigned
|
|
157
|
+
def phone_number=(phone_number)
|
|
158
|
+
if phone_number.nil?
|
|
159
|
+
fail ArgumentError, 'phone_number cannot be nil'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
pattern = Regexp.new(/^\+[1-9]\d{6,14}$/)
|
|
163
|
+
if phone_number !~ pattern
|
|
164
|
+
fail ArgumentError, "invalid value for \"phone_number\", must conform to the pattern #{pattern}."
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
@phone_number = phone_number
|
|
168
|
+
end
|
|
169
|
+
|
|
140
170
|
# Custom attribute writer method with validation
|
|
141
171
|
# @param [Object] purchase_intent_id Value to be assigned
|
|
142
172
|
def purchase_intent_id=(purchase_intent_id)
|
|
@@ -158,6 +188,7 @@ module Zernio
|
|
|
158
188
|
self.class == o.class &&
|
|
159
189
|
profile_id == o.profile_id &&
|
|
160
190
|
country == o.country &&
|
|
191
|
+
phone_number == o.phone_number &&
|
|
161
192
|
purchase_intent_id == o.purchase_intent_id &&
|
|
162
193
|
allow_multiple == o.allow_multiple
|
|
163
194
|
end
|
|
@@ -171,7 +202,7 @@ module Zernio
|
|
|
171
202
|
# Calculates hash code according to all attributes.
|
|
172
203
|
# @return [Integer] Hash code
|
|
173
204
|
def hash
|
|
174
|
-
[profile_id, country, purchase_intent_id, allow_multiple].hash
|
|
205
|
+
[profile_id, country, phone_number, purchase_intent_id, allow_multiple].hash
|
|
175
206
|
end
|
|
176
207
|
|
|
177
208
|
# Builds the object from hash
|
|
@@ -15,16 +15,25 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
17
|
class SearchAvailablePhoneNumbers200ResponseNumbersInner < ApiModelBase
|
|
18
|
+
# E.164. Pass it as `phoneNumber` on POST /v1/phone-numbers/purchase to buy this exact number.
|
|
18
19
|
attr_accessor :phone_number
|
|
19
20
|
|
|
20
21
|
# Provider capability list for this number (e.g. voice, sms, mms).
|
|
21
22
|
attr_accessor :features
|
|
22
23
|
|
|
24
|
+
# Town or rate center the number belongs to, as the carrier names it (e.g. WACO).
|
|
25
|
+
attr_accessor :locality
|
|
26
|
+
|
|
27
|
+
# true when the carrier added this number because too few matched your filters, so it may be outside the requested prefix or locality.
|
|
28
|
+
attr_accessor :best_effort
|
|
29
|
+
|
|
23
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
31
|
def self.attribute_map
|
|
25
32
|
{
|
|
26
33
|
:'phone_number' => :'phoneNumber',
|
|
27
|
-
:'features' => :'features'
|
|
34
|
+
:'features' => :'features',
|
|
35
|
+
:'locality' => :'locality',
|
|
36
|
+
:'best_effort' => :'bestEffort'
|
|
28
37
|
}
|
|
29
38
|
end
|
|
30
39
|
|
|
@@ -42,7 +51,9 @@ module Zernio
|
|
|
42
51
|
def self.openapi_types
|
|
43
52
|
{
|
|
44
53
|
:'phone_number' => :'String',
|
|
45
|
-
:'features' => :'Array<String>'
|
|
54
|
+
:'features' => :'Array<String>',
|
|
55
|
+
:'locality' => :'String',
|
|
56
|
+
:'best_effort' => :'Boolean'
|
|
46
57
|
}
|
|
47
58
|
end
|
|
48
59
|
|
|
@@ -77,6 +88,14 @@ module Zernio
|
|
|
77
88
|
self.features = value
|
|
78
89
|
end
|
|
79
90
|
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'locality')
|
|
93
|
+
self.locality = attributes[:'locality']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'best_effort')
|
|
97
|
+
self.best_effort = attributes[:'best_effort']
|
|
98
|
+
end
|
|
80
99
|
end
|
|
81
100
|
|
|
82
101
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -100,7 +119,9 @@ module Zernio
|
|
|
100
119
|
return true if self.equal?(o)
|
|
101
120
|
self.class == o.class &&
|
|
102
121
|
phone_number == o.phone_number &&
|
|
103
|
-
features == o.features
|
|
122
|
+
features == o.features &&
|
|
123
|
+
locality == o.locality &&
|
|
124
|
+
best_effort == o.best_effort
|
|
104
125
|
end
|
|
105
126
|
|
|
106
127
|
# @see the `==` method
|
|
@@ -112,7 +133,7 @@ module Zernio
|
|
|
112
133
|
# Calculates hash code according to all attributes.
|
|
113
134
|
# @return [Integer] Hash code
|
|
114
135
|
def hash
|
|
115
|
-
[phone_number, features].hash
|
|
136
|
+
[phone_number, features, locality, best_effort].hash
|
|
116
137
|
end
|
|
117
138
|
|
|
118
139
|
# Builds the object from hash
|
|
@@ -17,10 +17,16 @@ module Zernio
|
|
|
17
17
|
class SearchAvailableWhatsAppNumbers200ResponseNumbersInner < ApiModelBase
|
|
18
18
|
attr_accessor :phone_number
|
|
19
19
|
|
|
20
|
+
attr_accessor :locality
|
|
21
|
+
|
|
22
|
+
attr_accessor :best_effort
|
|
23
|
+
|
|
20
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
25
|
def self.attribute_map
|
|
22
26
|
{
|
|
23
|
-
:'phone_number' => :'phoneNumber'
|
|
27
|
+
:'phone_number' => :'phoneNumber',
|
|
28
|
+
:'locality' => :'locality',
|
|
29
|
+
:'best_effort' => :'bestEffort'
|
|
24
30
|
}
|
|
25
31
|
end
|
|
26
32
|
|
|
@@ -37,7 +43,9 @@ module Zernio
|
|
|
37
43
|
# Attribute type mapping.
|
|
38
44
|
def self.openapi_types
|
|
39
45
|
{
|
|
40
|
-
:'phone_number' => :'String'
|
|
46
|
+
:'phone_number' => :'String',
|
|
47
|
+
:'locality' => :'String',
|
|
48
|
+
:'best_effort' => :'Boolean'
|
|
41
49
|
}
|
|
42
50
|
end
|
|
43
51
|
|
|
@@ -66,6 +74,14 @@ module Zernio
|
|
|
66
74
|
if attributes.key?(:'phone_number')
|
|
67
75
|
self.phone_number = attributes[:'phone_number']
|
|
68
76
|
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'locality')
|
|
79
|
+
self.locality = attributes[:'locality']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'best_effort')
|
|
83
|
+
self.best_effort = attributes[:'best_effort']
|
|
84
|
+
end
|
|
69
85
|
end
|
|
70
86
|
|
|
71
87
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -88,7 +104,9 @@ module Zernio
|
|
|
88
104
|
def ==(o)
|
|
89
105
|
return true if self.equal?(o)
|
|
90
106
|
self.class == o.class &&
|
|
91
|
-
phone_number == o.phone_number
|
|
107
|
+
phone_number == o.phone_number &&
|
|
108
|
+
locality == o.locality &&
|
|
109
|
+
best_effort == o.best_effort
|
|
92
110
|
end
|
|
93
111
|
|
|
94
112
|
# @see the `==` method
|
|
@@ -100,7 +118,7 @@ module Zernio
|
|
|
100
118
|
# Calculates hash code according to all attributes.
|
|
101
119
|
# @return [Integer] Hash code
|
|
102
120
|
def hash
|
|
103
|
-
[phone_number].hash
|
|
121
|
+
[phone_number, locality, best_effort].hash
|
|
104
122
|
end
|
|
105
123
|
|
|
106
124
|
# Builds the object from hash
|
data/lib/zernio-sdk/version.rb
CHANGED
data/openapi.yaml
CHANGED
|
@@ -36379,8 +36379,9 @@ paths:
|
|
|
36379
36379
|
tags: [Phone Numbers]
|
|
36380
36380
|
summary: Purchase phone number
|
|
36381
36381
|
description: |
|
|
36382
|
-
Payment-first:
|
|
36383
|
-
|
|
36382
|
+
Payment-first: the system provisions a number and auto-assigns it, unless you pass
|
|
36383
|
+
`phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With
|
|
36384
|
+
usage-based billing active and a payment method on file, the
|
|
36384
36385
|
number provisions inline and bills per month on your usage-based invoice (there is
|
|
36385
36386
|
no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`;
|
|
36386
36387
|
a regulated country returns `202` with `status: "kyc_required"` and a `kycUrl`.
|
|
@@ -36442,6 +36443,18 @@ paths:
|
|
|
36442
36443
|
number from another area, and later replacements stay in
|
|
36443
36444
|
this area too. Omit for any area. Get live options from
|
|
36444
36445
|
GET /v1/phone-numbers/availability (areaOptions).
|
|
36446
|
+
phoneNumber:
|
|
36447
|
+
type: string
|
|
36448
|
+
pattern: '^\+[1-9]\d{6,14}$'
|
|
36449
|
+
description: >
|
|
36450
|
+
One exact number to buy, in E.164, taken from GET
|
|
36451
|
+
/v1/phone-numbers/available. Hard constraint: when it is no
|
|
36452
|
+
longer available (bought by someone else, or WhatsApp's
|
|
36453
|
+
buy-time check rejects it) the purchase fails with 409 code
|
|
36454
|
+
PHONE_NUMBER_UNAVAILABLE instead of assigning another number;
|
|
36455
|
+
search again and pick another. Only for countries and types
|
|
36456
|
+
that activate instantly: a regulated one (202 kyc_required)
|
|
36457
|
+
returns 400 when phoneNumber is set.
|
|
36445
36458
|
connectWhatsapp:
|
|
36446
36459
|
type: boolean
|
|
36447
36460
|
default: true
|
|
@@ -36540,14 +36553,14 @@ paths:
|
|
|
36540
36553
|
another number was purchased within the last 10 minutes; retry
|
|
36541
36554
|
with allowMultiple: true to confirm), or the requested areaCode
|
|
36542
36555
|
has no deliverable inventory right now (code
|
|
36543
|
-
AREA_CODE_UNAVAILABLE: pick another area or omit areaCode).
|
|
36556
|
+
AREA_CODE_UNAVAILABLE: pick another area or omit areaCode; PHONE_NUMBER_UNAVAILABLE: search again and pick another number).
|
|
36544
36557
|
content:
|
|
36545
36558
|
application/json:
|
|
36546
36559
|
schema:
|
|
36547
36560
|
type: object
|
|
36548
36561
|
properties:
|
|
36549
36562
|
error: { type: string }
|
|
36550
|
-
code: { type: string, enum: [PURCHASE_VELOCITY, AREA_CODE_UNAVAILABLE] }
|
|
36563
|
+
code: { type: string, enum: [PURCHASE_VELOCITY, AREA_CODE_UNAVAILABLE, PHONE_NUMBER_UNAVAILABLE] }
|
|
36551
36564
|
'202':
|
|
36552
36565
|
description: Country requires end-user KYC before the number can be ordered.
|
|
36553
36566
|
content:
|
|
@@ -36633,7 +36646,9 @@ paths:
|
|
|
36633
36646
|
country (default US). Optional filters narrow the results. The country
|
|
36634
36647
|
must be offerable (see GET /v1/phone-numbers/countries). Voice
|
|
36635
36648
|
capability is always required; pass `sms=true` to only see numbers that
|
|
36636
|
-
can also text (SMS support is per-number, not per-country).
|
|
36649
|
+
can also text (SMS support is per-number, not per-country). Numbers a
|
|
36650
|
+
purchase would refuse are left out, and any result's `phoneNumber` can
|
|
36651
|
+
be bought exactly by passing it to POST /v1/phone-numbers/purchase.
|
|
36637
36652
|
security:
|
|
36638
36653
|
- bearerAuth: []
|
|
36639
36654
|
parameters:
|
|
@@ -36660,8 +36675,10 @@ paths:
|
|
|
36660
36675
|
items:
|
|
36661
36676
|
type: object
|
|
36662
36677
|
properties:
|
|
36663
|
-
phoneNumber: { type: string }
|
|
36678
|
+
phoneNumber: { type: string, description: "E.164. Pass it as `phoneNumber` on POST /v1/phone-numbers/purchase to buy this exact number." }
|
|
36664
36679
|
features: { type: array, items: { type: string }, description: "Provider capability list for this number (e.g. voice, sms, mms)." }
|
|
36680
|
+
locality: { type: string, description: "Town or rate center the number belongs to, as the carrier names it (e.g. WACO)." }
|
|
36681
|
+
bestEffort: { type: boolean, description: "true when the carrier added this number because too few matched your filters, so it may be outside the requested prefix or locality." }
|
|
36665
36682
|
'400': { description: Country not available }
|
|
36666
36683
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
36667
36684
|
|
|
@@ -36847,8 +36864,9 @@ paths:
|
|
|
36847
36864
|
Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New
|
|
36848
36865
|
integrations should use that path.
|
|
36849
36866
|
|
|
36850
|
-
Payment-first:
|
|
36851
|
-
|
|
36867
|
+
Payment-first: the system provisions a number and auto-assigns it, unless you pass
|
|
36868
|
+
`phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With
|
|
36869
|
+
usage-based billing active and a payment method on file, the
|
|
36852
36870
|
number provisions inline and bills per month on your usage-based invoice (there is
|
|
36853
36871
|
no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`;
|
|
36854
36872
|
a regulated country returns `202` with `status: "kyc_required"` and a `kycUrl`.
|
|
@@ -36882,6 +36900,13 @@ paths:
|
|
|
36882
36900
|
The customer must complete KYC at that URL before the number
|
|
36883
36901
|
is ordered. See GET /v1/whatsapp/phone-numbers/countries.
|
|
36884
36902
|
default: US
|
|
36903
|
+
phoneNumber:
|
|
36904
|
+
type: string
|
|
36905
|
+
pattern: '^\+[1-9]\d{6,14}$'
|
|
36906
|
+
description: >
|
|
36907
|
+
One exact number to buy, in E.164, taken from GET
|
|
36908
|
+
/v1/phone-numbers/available. Fails with 409 code
|
|
36909
|
+
PHONE_NUMBER_UNAVAILABLE when it is no longer available.
|
|
36885
36910
|
purchaseIntentId:
|
|
36886
36911
|
type: string
|
|
36887
36912
|
maxLength: 100
|
|
@@ -36946,14 +36971,14 @@ paths:
|
|
|
36946
36971
|
another number was purchased within the last 10 minutes; retry
|
|
36947
36972
|
with allowMultiple: true to confirm), or the requested areaCode
|
|
36948
36973
|
has no deliverable inventory right now (code
|
|
36949
|
-
AREA_CODE_UNAVAILABLE: pick another area or omit areaCode).
|
|
36974
|
+
AREA_CODE_UNAVAILABLE: pick another area or omit areaCode; PHONE_NUMBER_UNAVAILABLE: search again and pick another number).
|
|
36950
36975
|
content:
|
|
36951
36976
|
application/json:
|
|
36952
36977
|
schema:
|
|
36953
36978
|
type: object
|
|
36954
36979
|
properties:
|
|
36955
36980
|
error: { type: string }
|
|
36956
|
-
code: { type: string, enum: [PURCHASE_VELOCITY, AREA_CODE_UNAVAILABLE] }
|
|
36981
|
+
code: { type: string, enum: [PURCHASE_VELOCITY, AREA_CODE_UNAVAILABLE, PHONE_NUMBER_UNAVAILABLE] }
|
|
36957
36982
|
'202':
|
|
36958
36983
|
description: Country requires end-user KYC before the number can be ordered.
|
|
36959
36984
|
content:
|
|
@@ -37044,6 +37069,8 @@ paths:
|
|
|
37044
37069
|
type: object
|
|
37045
37070
|
properties:
|
|
37046
37071
|
phoneNumber: { type: string }
|
|
37072
|
+
locality: { type: string }
|
|
37073
|
+
bestEffort: { type: boolean }
|
|
37047
37074
|
'400': { description: Country not available }
|
|
37048
37075
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
37049
37076
|
|
|
@@ -226,7 +226,7 @@ describe 'PhoneNumbersApi' do
|
|
|
226
226
|
|
|
227
227
|
# unit tests for purchase_phone_number
|
|
228
228
|
# Purchase phone number
|
|
229
|
-
# Payment-first:
|
|
229
|
+
# Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
230
230
|
# @param purchase_phone_number_request
|
|
231
231
|
# @param [Hash] opts the optional parameters
|
|
232
232
|
# @return [PurchasePhoneNumber200Response]
|
|
@@ -301,7 +301,7 @@ describe 'PhoneNumbersApi' do
|
|
|
301
301
|
|
|
302
302
|
# unit tests for search_available_phone_numbers
|
|
303
303
|
# Search available numbers
|
|
304
|
-
# Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country).
|
|
304
|
+
# Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country). Numbers a purchase would refuse are left out, and any result's `phoneNumber` can be bought exactly by passing it to POST /v1/phone-numbers/purchase.
|
|
305
305
|
# @param [Hash] opts the optional parameters
|
|
306
306
|
# @option opts [String] :country
|
|
307
307
|
# @option opts [String] :type Number type; defaults to the country's WhatsApp-safe type
|
|
@@ -146,7 +146,7 @@ describe 'WhatsAppPhoneNumbersApi' do
|
|
|
146
146
|
|
|
147
147
|
# unit tests for purchase_whats_app_phone_number
|
|
148
148
|
# Purchase phone number
|
|
149
|
-
# Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first:
|
|
149
|
+
# Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
150
150
|
# @param purchase_whats_app_phone_number_request
|
|
151
151
|
# @param [Hash] opts the optional parameters
|
|
152
152
|
# @return [PurchaseWhatsAppPhoneNumber200Response]
|
|
@@ -36,7 +36,7 @@ describe Zernio::PurchasePhoneNumber409Response do
|
|
|
36
36
|
describe 'test attribute "code"' do
|
|
37
37
|
it 'should work' do
|
|
38
38
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY", "AREA_CODE_UNAVAILABLE"])
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY", "AREA_CODE_UNAVAILABLE", "PHONE_NUMBER_UNAVAILABLE"])
|
|
40
40
|
# validator.allowable_values.each do |value|
|
|
41
41
|
# expect { instance.code = value }.not_to raise_error
|
|
42
42
|
# end
|
|
@@ -55,6 +55,12 @@ describe Zernio::PurchasePhoneNumberRequest do
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
describe 'test attribute "phone_number"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
58
64
|
describe 'test attribute "connect_whatsapp"' do
|
|
59
65
|
it 'should work' do
|
|
60
66
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -39,6 +39,12 @@ describe Zernio::PurchaseWhatsAppPhoneNumberRequest do
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
describe 'test attribute "phone_number"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
42
48
|
describe 'test attribute "purchase_intent_id"' do
|
|
43
49
|
it 'should work' do
|
|
44
50
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -39,4 +39,16 @@ describe Zernio::SearchAvailablePhoneNumbers200ResponseNumbersInner do
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
describe 'test attribute "locality"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "best_effort"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
42
54
|
end
|
|
@@ -33,4 +33,16 @@ describe Zernio::SearchAvailableWhatsAppNumbers200ResponseNumbersInner do
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
describe 'test attribute "locality"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "best_effort"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
36
48
|
end
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: late-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.920
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
@@ -6355,7 +6355,7 @@ files:
|
|
|
6355
6355
|
- spec/models/you_tube_video_retention_response_retention_curve_inner_spec.rb
|
|
6356
6356
|
- spec/models/you_tube_video_retention_response_spec.rb
|
|
6357
6357
|
- spec/spec_helper.rb
|
|
6358
|
-
- zernio-sdk-0.0.
|
|
6358
|
+
- zernio-sdk-0.0.920.gem
|
|
6359
6359
|
- zernio-sdk.gemspec
|
|
6360
6360
|
homepage: https://openapi-generator.tech
|
|
6361
6361
|
licenses:
|
data/zernio-sdk-0.0.919.gem
DELETED
|
Binary file
|