late-sdk 0.0.919 → 0.0.921
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/CreateStandaloneAdRequest.md +2 -2
- data/docs/CreateStandaloneAdRequestPlacementAssetsRulesInner.md +6 -0
- 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/create_standalone_ad_request.rb +2 -2
- data/lib/zernio-sdk/models/create_standalone_ad_request_placement_assets.rb +1 -1
- data/lib/zernio-sdk/models/create_standalone_ad_request_placement_assets_rules_inner.rb +106 -1
- 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 +76 -19
- 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/create_standalone_ad_request_placement_assets_rules_inner_spec.rb +18 -0
- 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.921.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: c2aaedfa75a4c777d9f738f8214bb3a852fe60b62381d90f472c94ac56b9682d
|
|
4
|
+
data.tar.gz: 0cc02bb3b55e4270ccace14ead86a773152db32e9bc107e5a03ad477a369a8b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10bfc0b0fe29d20fc5c61ead22103f23b978ae65afa4707494d2bb31ed77e484c570542a7c4b67c0e76e01b67d872b05093ced1c1a709229c7e73371e06012ac
|
|
7
|
+
data.tar.gz: ae57e75a81673466581c38ca7a6357673d1e1af810c22e243ac1a156a9fd76c0baec8fce4a75a723d1b3854de3a7b3b7462a261d482b6f80d2400d6611a0603e
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
| **promotion** | [**MetaPromotion**](MetaPromotion.md) | | [optional] |
|
|
20
20
|
| **creative_features** | **Hash<String, String>** | Meta only. Applied to each new creative, including standalone and attach shapes. With creatives[], these are defaults; an item replaces the whole feature map, including an empty map. auto_promotion_tag is an enhancement; an explicit offer uses promotion. | [optional] |
|
|
21
21
|
| **multi_advertiser** | **String** | Meta only. Multi-advertiser ads: whether Meta may show this ad alongside other advertisers' in one unit. Meta auto-enrols since Aug 2024, so send OPT_OUT to leave. It is a top-level creative field, NOT a `creativeFeatures` key, and Meta rejects it there. | [optional] |
|
|
22
|
-
| **validate_only** | **Boolean** | Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence. Google validation still downloads image URLs and consumes quota. On Meta, validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, existing video.id or existingCreativeId; media pools, new video uploads, creatives[], adSetId and RESERVED buying return 400. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error. | [optional] |
|
|
22
|
+
| **validate_only** | **Boolean** | Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence. Google validation still downloads image URLs and consumes quota. On Meta, validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, all-image placementAssets with per-rule copy, existing video.id or existingCreativeId; other media pools, new video uploads, creatives[], adSetId and RESERVED buying return 400. Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error. | [optional] |
|
|
23
23
|
| **budget_amount** | **Float** | Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents. Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy, multi-creative and Performance Max shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType). | [optional] |
|
|
24
24
|
| **budget_type** | **String** | Required on legacy, multi-creative and Performance Max shapes. Inherited on attach. OpenAI Ads accepts lifetime only (no daily-budget concept on the platform); sending daily returns 422. OpenAI Ads lifetime budgets require `endDate` to give the lifetime cap a spend window. | [optional] |
|
|
25
25
|
| **status** | **String** | Google Performance Max accepts PAUSED only and always creates a paused campaign. Meta, TikTok, and LinkedIn: publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/{campaignId}/status with `active` brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: `existingCampaignId` (that campaign may be running and is never touched) or `campaignStatus: ACTIVE`. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each). | [optional] |
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
| **long_headline** | **String** | Google Display only. Defaults to `headline` if omitted. On LinkedIn, reused as the optional secondary description text on traffic (link) ads; omitted if not provided. | [optional] |
|
|
31
31
|
| **body** | **String** | Required on legacy + attach shapes. For X this is the tweet text (max 280 chars including a ~24-char URL when `linkUrl` is set). On LinkedIn this is the post commentary (the intro text shown above the ad). On OpenAI Ads this is the chat card's body text. Max: Google=90, Pinterest=500, OpenAI=100. | [optional] |
|
|
32
32
|
| **description** | **String** | Meta only (facebook/instagram). Link description: the secondary text shown below the headline (Meta's link_data.description; on video creatives mapped to video_data.link_description). When omitted, Meta auto-pulls the destination URL's OpenGraph description. Applies on legacy, attach, and placementAssets shapes; for multi-creative use creatives[].description (this field is the shared fallback). For multi-text variations use `descriptions` (array) instead. | [optional] |
|
|
33
|
-
| **bodies** | **Array<String>** | Meta only. Multiple Text Options (Advantage+ Flexible Format): supply 1-5 primary-text variations and Meta optimises delivery across them, WITHOUT enabling full Dynamic Creative (`dynamicCreative`). Uses `optimization_type: DEGREES_OF_FREEDOM` on the asset feed, so multiple ads per ad set are allowed (unlike `dynamicCreative` which is limited to one). Requires `imageUrl` or `video`, `linkUrl`, and `callToAction`. When set, the top-level `body` field is used as the `object_story_spec.link_data.message` (the preview text) and `headlines` must also be present. On a video creative the copy lands in `video_data.message` / `video_data.title` instead of `link_data`. Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards`, and `creatives[]`. | [optional] |
|
|
33
|
+
| **bodies** | **Array<String>** | Meta only. Multiple Text Options (Advantage+ Flexible Format): supply 1-5 primary-text variations and Meta optimises delivery across them, WITHOUT enabling full Dynamic Creative (`dynamicCreative`). Uses `optimization_type: DEGREES_OF_FREEDOM` on the asset feed, so multiple ads per ad set are allowed (unlike `dynamicCreative` which is limited to one). Requires `imageUrl` or `video`, `linkUrl`, and `callToAction`. When set, the top-level `body` field is used as the `object_story_spec.link_data.message` (the preview text) and `headlines` must also be present. On a video creative the copy lands in `video_data.message` / `video_data.title` instead of `link_data`. Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards`, and `creatives[]`. For placement-specific copy, use the singular `placementAssets.rules[].body` and `headline` fields instead. | [optional] |
|
|
34
34
|
| **headlines** | **Array<String>** | Meta only. Headline variations for Multiple Text Options. Must be sent alongside `bodies`. The top-level `headline` field is used as the `object_story_spec.link_data.name` (`video_data.title` on a video creative). | [optional] |
|
|
35
35
|
| **descriptions** | **Array<String>** | Meta only. Optional description variations for Multiple Text Options. Sent alongside `bodies` and `headlines`. | [optional] |
|
|
36
36
|
| **call_to_action** | **String** | Required on legacy + attach shapes for Meta. Honoured on TikTok (passes through to the Spark Ad creative's `call_to_action`) and on LinkedIn (the CTA button on the ad; defaults to LEARN_MORE when `linkUrl` is set). LinkedIn accepts: LEARN_MORE, SIGN_UP, DOWNLOAD, SUBSCRIBE, REGISTER, JOIN, ATTEND, REQUEST_DEMO, VIEW_QUOTE, APPLY, SEE_MORE, SHOP_NOW, BUY_NOW. Ignored by Google, Pinterest, and X. | [optional] |
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
| **image_url** | **String** | Image mode. The image to deliver for this rule's placements. | [optional] |
|
|
8
8
|
| **video_url** | **String** | Video mode. The video to deliver for this rule's placements. | [optional] |
|
|
9
9
|
| **thumbnail_url** | **String** | Video mode (optional). Poster image for this rule's video; auto-generated when omitted. | [optional] |
|
|
10
|
+
| **headline** | **String** | One headline pinned to this rule. Omit to inherit the top-level headline. | [optional] |
|
|
11
|
+
| **body** | **String** | One primary text pinned to this rule. Omit to inherit the top-level body. | [optional] |
|
|
12
|
+
| **description** | **String** | One link description pinned to this rule. Omit to inherit the top-level description. | [optional] |
|
|
10
13
|
| **placements** | [**CreateStandaloneAdRequestPlacementAssetsRulesInnerPlacements**](CreateStandaloneAdRequestPlacementAssetsRulesInnerPlacements.md) | | |
|
|
11
14
|
|
|
12
15
|
## Example
|
|
@@ -18,6 +21,9 @@ instance = Zernio::CreateStandaloneAdRequestPlacementAssetsRulesInner.new(
|
|
|
18
21
|
image_url: null,
|
|
19
22
|
video_url: null,
|
|
20
23
|
thumbnail_url: null,
|
|
24
|
+
headline: null,
|
|
25
|
+
body: null,
|
|
26
|
+
description: null,
|
|
21
27
|
placements: null
|
|
22
28
|
)
|
|
23
29
|
```
|
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
|
|
@@ -55,7 +55,7 @@ module Zernio
|
|
|
55
55
|
# Meta only. Multi-advertiser ads: whether Meta may show this ad alongside other advertisers' in one unit. Meta auto-enrols since Aug 2024, so send OPT_OUT to leave. It is a top-level creative field, NOT a `creativeFeatures` key, and Meta rejects it there.
|
|
56
56
|
attr_accessor :multi_advertiser
|
|
57
57
|
|
|
58
|
-
# Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence. Google validation still downloads image URLs and consumes quota. On Meta, validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, existing video.id or existingCreativeId; media pools, new video uploads, creatives[], adSetId and RESERVED buying return 400. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error.
|
|
58
|
+
# Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence. Google validation still downloads image URLs and consumes quota. On Meta, validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, all-image placementAssets with per-rule copy, existing video.id or existingCreativeId; other media pools, new video uploads, creatives[], adSetId and RESERVED buying return 400. Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error.
|
|
59
59
|
attr_accessor :validate_only
|
|
60
60
|
|
|
61
61
|
# Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents. Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy, multi-creative and Performance Max shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
|
|
@@ -88,7 +88,7 @@ module Zernio
|
|
|
88
88
|
# Meta only (facebook/instagram). Link description: the secondary text shown below the headline (Meta's link_data.description; on video creatives mapped to video_data.link_description). When omitted, Meta auto-pulls the destination URL's OpenGraph description. Applies on legacy, attach, and placementAssets shapes; for multi-creative use creatives[].description (this field is the shared fallback). For multi-text variations use `descriptions` (array) instead.
|
|
89
89
|
attr_accessor :description
|
|
90
90
|
|
|
91
|
-
# Meta only. Multiple Text Options (Advantage+ Flexible Format): supply 1-5 primary-text variations and Meta optimises delivery across them, WITHOUT enabling full Dynamic Creative (`dynamicCreative`). Uses `optimization_type: DEGREES_OF_FREEDOM` on the asset feed, so multiple ads per ad set are allowed (unlike `dynamicCreative` which is limited to one). Requires `imageUrl` or `video`, `linkUrl`, and `callToAction`. When set, the top-level `body` field is used as the `object_story_spec.link_data.message` (the preview text) and `headlines` must also be present. On a video creative the copy lands in `video_data.message` / `video_data.title` instead of `link_data`. Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards`, and `creatives[]`.
|
|
91
|
+
# Meta only. Multiple Text Options (Advantage+ Flexible Format): supply 1-5 primary-text variations and Meta optimises delivery across them, WITHOUT enabling full Dynamic Creative (`dynamicCreative`). Uses `optimization_type: DEGREES_OF_FREEDOM` on the asset feed, so multiple ads per ad set are allowed (unlike `dynamicCreative` which is limited to one). Requires `imageUrl` or `video`, `linkUrl`, and `callToAction`. When set, the top-level `body` field is used as the `object_story_spec.link_data.message` (the preview text) and `headlines` must also be present. On a video creative the copy lands in `video_data.message` / `video_data.title` instead of `link_data`. Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards`, and `creatives[]`. For placement-specific copy, use the singular `placementAssets.rules[].body` and `headline` fields instead.
|
|
92
92
|
attr_accessor :bodies
|
|
93
93
|
|
|
94
94
|
# Meta only. Headline variations for Multiple Text Options. Must be sent alongside `bodies`. The top-level `headline` field is used as the `object_story_spec.link_data.name` (`video_data.title` on a video creative).
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# Meta only. Placement asset customization: pin a SPECIFIC asset (image OR video) to each placement group on a SINGLE ad (e.g. a 9:16 on Stories/Reels and a 4:5 on Feed). The same thing Meta Ads Manager produces with \"different creative per placement\", mapped to the creative's `asset_feed_spec` + `asset_customization_rules`. Deterministic pinning, NOT the auto-optimizing pool of `dynamicCreative` (mutually exclusive). Works on the legacy single shape AND the attach shape (`adSetId` + placementAssets adds one placement-customized ad to an existing ad set, the way to build N per-placement ads sharing one ad set: create the first normally, attach the rest). Cannot be combined with `creatives[]
|
|
17
|
+
# Meta only. Placement asset customization: pin a SPECIFIC asset (image OR video) to each placement group on a SINGLE ad (e.g. a 9:16 on Stories/Reels and a 4:5 on Feed). The same thing Meta Ads Manager produces with \"different creative per placement\", mapped to the creative's `asset_feed_spec` + `asset_customization_rules`. Deterministic pinning, NOT the auto-optimizing pool of `dynamicCreative` (mutually exclusive). Works on the legacy single shape AND the attach shape (`adSetId` + placementAssets adds one placement-customized ad to an existing ad set, the way to build N per-placement ads sharing one ad set: create the first normally, attach the rest). Cannot be combined with `creatives[]` or top-level `bodies`/`headlines`/`descriptions` arrays. Each rule can override `headline`, `body` and `description` with one string per field. Omitted fields and unmatched placements use the top-level copy; `linkUrl` and `callToAction` remain shared. Zernio emits labelled text with `optimization_type: PLACEMENT`. Multiple text options rotating within a placement are not supported by this input. Each rule's `placements` accepts the same fields as the top-level `placements` object; Meta enforces co-selection rules and returns an actionable error. Meta controls text rendering by placement and format. Validation accepts these fields but does not prove that every field appears in delivery. Preview the ad; put copy that must always be visible into the image or video itself. `validateOnly: true` supports all-image placementAssets without uploading or creating anything. Video placement validation remains unsupported because it requires uploads. A block is all-image OR all-video, never mixed (Meta's asset_feed_spec carries one ad format). Image mode: `defaultImageUrl` + `rules[].imageUrl`. Video mode: `defaultVideoUrl` + `rules[].videoUrl` (optional `thumbnailUrl`/`defaultThumbnailUrl` posters; Meta auto-generates when omitted). Exactly one catch-all default is required.
|
|
18
18
|
class CreateStandaloneAdRequestPlacementAssets < ApiModelBase
|
|
19
19
|
# Image mode. Catch-all image for any placement no rule matches. Required in image mode (Meta mandates a default rule).
|
|
20
20
|
attr_accessor :default_image_url
|
|
@@ -24,6 +24,15 @@ module Zernio
|
|
|
24
24
|
# Video mode (optional). Poster image for this rule's video; auto-generated when omitted.
|
|
25
25
|
attr_accessor :thumbnail_url
|
|
26
26
|
|
|
27
|
+
# One headline pinned to this rule. Omit to inherit the top-level headline.
|
|
28
|
+
attr_accessor :headline
|
|
29
|
+
|
|
30
|
+
# One primary text pinned to this rule. Omit to inherit the top-level body.
|
|
31
|
+
attr_accessor :body
|
|
32
|
+
|
|
33
|
+
# One link description pinned to this rule. Omit to inherit the top-level description.
|
|
34
|
+
attr_accessor :description
|
|
35
|
+
|
|
27
36
|
attr_accessor :placements
|
|
28
37
|
|
|
29
38
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -32,6 +41,9 @@ module Zernio
|
|
|
32
41
|
:'image_url' => :'imageUrl',
|
|
33
42
|
:'video_url' => :'videoUrl',
|
|
34
43
|
:'thumbnail_url' => :'thumbnailUrl',
|
|
44
|
+
:'headline' => :'headline',
|
|
45
|
+
:'body' => :'body',
|
|
46
|
+
:'description' => :'description',
|
|
35
47
|
:'placements' => :'placements'
|
|
36
48
|
}
|
|
37
49
|
end
|
|
@@ -52,6 +64,9 @@ module Zernio
|
|
|
52
64
|
:'image_url' => :'String',
|
|
53
65
|
:'video_url' => :'String',
|
|
54
66
|
:'thumbnail_url' => :'String',
|
|
67
|
+
:'headline' => :'String',
|
|
68
|
+
:'body' => :'String',
|
|
69
|
+
:'description' => :'String',
|
|
55
70
|
:'placements' => :'CreateStandaloneAdRequestPlacementAssetsRulesInnerPlacements'
|
|
56
71
|
}
|
|
57
72
|
end
|
|
@@ -90,6 +105,18 @@ module Zernio
|
|
|
90
105
|
self.thumbnail_url = attributes[:'thumbnail_url']
|
|
91
106
|
end
|
|
92
107
|
|
|
108
|
+
if attributes.key?(:'headline')
|
|
109
|
+
self.headline = attributes[:'headline']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'body')
|
|
113
|
+
self.body = attributes[:'body']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'description')
|
|
117
|
+
self.description = attributes[:'description']
|
|
118
|
+
end
|
|
119
|
+
|
|
93
120
|
if attributes.key?(:'placements')
|
|
94
121
|
self.placements = attributes[:'placements']
|
|
95
122
|
else
|
|
@@ -102,6 +129,26 @@ module Zernio
|
|
|
102
129
|
def list_invalid_properties
|
|
103
130
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
104
131
|
invalid_properties = Array.new
|
|
132
|
+
if !@headline.nil? && @headline.to_s.length > 255
|
|
133
|
+
invalid_properties.push('invalid value for "headline", the character length must be smaller than or equal to 255.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if !@headline.nil? && @headline.to_s.length < 1
|
|
137
|
+
invalid_properties.push('invalid value for "headline", the character length must be greater than or equal to 1.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if !@body.nil? && @body.to_s.length < 1
|
|
141
|
+
invalid_properties.push('invalid value for "body", the character length must be greater than or equal to 1.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if !@description.nil? && @description.to_s.length > 255
|
|
145
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if !@description.nil? && @description.to_s.length < 1
|
|
149
|
+
invalid_properties.push('invalid value for "description", the character length must be greater than or equal to 1.')
|
|
150
|
+
end
|
|
151
|
+
|
|
105
152
|
if @placements.nil?
|
|
106
153
|
invalid_properties.push('invalid value for "placements", placements cannot be nil.')
|
|
107
154
|
end
|
|
@@ -113,10 +160,65 @@ module Zernio
|
|
|
113
160
|
# @return true if the model is valid
|
|
114
161
|
def valid?
|
|
115
162
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
163
|
+
return false if !@headline.nil? && @headline.to_s.length > 255
|
|
164
|
+
return false if !@headline.nil? && @headline.to_s.length < 1
|
|
165
|
+
return false if !@body.nil? && @body.to_s.length < 1
|
|
166
|
+
return false if !@description.nil? && @description.to_s.length > 255
|
|
167
|
+
return false if !@description.nil? && @description.to_s.length < 1
|
|
116
168
|
return false if @placements.nil?
|
|
117
169
|
true
|
|
118
170
|
end
|
|
119
171
|
|
|
172
|
+
# Custom attribute writer method with validation
|
|
173
|
+
# @param [Object] headline Value to be assigned
|
|
174
|
+
def headline=(headline)
|
|
175
|
+
if headline.nil?
|
|
176
|
+
fail ArgumentError, 'headline cannot be nil'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if headline.to_s.length > 255
|
|
180
|
+
fail ArgumentError, 'invalid value for "headline", the character length must be smaller than or equal to 255.'
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if headline.to_s.length < 1
|
|
184
|
+
fail ArgumentError, 'invalid value for "headline", the character length must be greater than or equal to 1.'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
@headline = headline
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Custom attribute writer method with validation
|
|
191
|
+
# @param [Object] body Value to be assigned
|
|
192
|
+
def body=(body)
|
|
193
|
+
if body.nil?
|
|
194
|
+
fail ArgumentError, 'body cannot be nil'
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if body.to_s.length < 1
|
|
198
|
+
fail ArgumentError, 'invalid value for "body", the character length must be greater than or equal to 1.'
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
@body = body
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Custom attribute writer method with validation
|
|
205
|
+
# @param [Object] description Value to be assigned
|
|
206
|
+
def description=(description)
|
|
207
|
+
if description.nil?
|
|
208
|
+
fail ArgumentError, 'description cannot be nil'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if description.to_s.length > 255
|
|
212
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 255.'
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if description.to_s.length < 1
|
|
216
|
+
fail ArgumentError, 'invalid value for "description", the character length must be greater than or equal to 1.'
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
@description = description
|
|
220
|
+
end
|
|
221
|
+
|
|
120
222
|
# Custom attribute writer method with validation
|
|
121
223
|
# @param [Object] placements Value to be assigned
|
|
122
224
|
def placements=(placements)
|
|
@@ -135,6 +237,9 @@ module Zernio
|
|
|
135
237
|
image_url == o.image_url &&
|
|
136
238
|
video_url == o.video_url &&
|
|
137
239
|
thumbnail_url == o.thumbnail_url &&
|
|
240
|
+
headline == o.headline &&
|
|
241
|
+
body == o.body &&
|
|
242
|
+
description == o.description &&
|
|
138
243
|
placements == o.placements
|
|
139
244
|
end
|
|
140
245
|
|
|
@@ -147,7 +252,7 @@ module Zernio
|
|
|
147
252
|
# Calculates hash code according to all attributes.
|
|
148
253
|
# @return [Integer] Hash code
|
|
149
254
|
def hash
|
|
150
|
-
[image_url, video_url, thumbnail_url, placements].hash
|
|
255
|
+
[image_url, video_url, thumbnail_url, headline, body, description, placements].hash
|
|
151
256
|
end
|
|
152
257
|
|
|
153
258
|
# Builds the object from hash
|
|
@@ -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
|
|
|
@@ -51010,7 +51037,7 @@ paths:
|
|
|
51010
51037
|
description: "Meta only. Multi-advertiser ads: whether Meta may show this ad alongside other advertisers' in one unit. Meta auto-enrols since Aug 2024, so send OPT_OUT to leave. It is a top-level creative field, NOT a `creativeFeatures` key, and Meta rejects it there."
|
|
51011
51038
|
validateOnly:
|
|
51012
51039
|
type: boolean
|
|
51013
|
-
description: 'Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence. Google validation still downloads image URLs and consumes quota. On Meta, validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, existing video.id or existingCreativeId; media pools, new video uploads, creatives[], adSetId and RESERVED buying return 400. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error.'
|
|
51040
|
+
description: 'Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence. Google validation still downloads image URLs and consumes quota. On Meta, validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, all-image placementAssets with per-rule copy, existing video.id or existingCreativeId; other media pools, new video uploads, creatives[], adSetId and RESERVED buying return 400. Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error.'
|
|
51014
51041
|
budgetAmount: { type: number, description: "Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents. Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy, multi-creative and Performance Max shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType)." }
|
|
51015
51042
|
budgetType: { type: string, enum: [daily, lifetime], description: "Required on legacy, multi-creative and Performance Max shapes. Inherited on attach. OpenAI Ads accepts lifetime only (no daily-budget concept on the platform); sending daily returns 422. OpenAI Ads lifetime budgets require `endDate` to give the lifetime cap a spend window." }
|
|
51016
51043
|
status:
|
|
@@ -51053,7 +51080,7 @@ paths:
|
|
|
51053
51080
|
`body` field is used as the `object_story_spec.link_data.message` (the preview text) and
|
|
51054
51081
|
`headlines` must also be present. On a video creative the copy lands in
|
|
51055
51082
|
`video_data.message` / `video_data.title` instead of `link_data`. Mutually exclusive
|
|
51056
|
-
with `dynamicCreative`, `placementAssets`, `carouselCards`, and `creatives[]`.
|
|
51083
|
+
with `dynamicCreative`, `placementAssets`, `carouselCards`, and `creatives[]`. For placement-specific copy, use the singular `placementAssets.rules[].body` and `headline` fields instead.
|
|
51057
51084
|
headlines:
|
|
51058
51085
|
type: array
|
|
51059
51086
|
minItems: 1
|
|
@@ -51569,20 +51596,36 @@ paths:
|
|
|
51569
51596
|
on the legacy single shape AND the attach shape (`adSetId` + placementAssets adds one
|
|
51570
51597
|
placement-customized ad to an existing ad set, the way to build N per-placement ads
|
|
51571
51598
|
sharing one ad set: create the first normally, attach the rest). Cannot be combined
|
|
51572
|
-
with `creatives[]
|
|
51573
|
-
|
|
51574
|
-
|
|
51599
|
+
with `creatives[]` or top-level `bodies`/`headlines`/`descriptions` arrays. Each rule
|
|
51600
|
+
can override `headline`, `body` and `description` with one string per field. Omitted
|
|
51601
|
+
fields and unmatched placements use the top-level copy; `linkUrl` and `callToAction`
|
|
51602
|
+
remain shared. Zernio emits labelled text with `optimization_type: PLACEMENT`.
|
|
51603
|
+
Multiple text options rotating within a placement are not supported by this input. Each rule's `placements` accepts the same fields as the top-level
|
|
51575
51604
|
`placements` object; Meta enforces co-selection rules and returns an actionable error.
|
|
51576
51605
|
|
|
51577
|
-
|
|
51578
|
-
|
|
51579
|
-
|
|
51580
|
-
|
|
51606
|
+
Meta controls text rendering by placement and format. Validation accepts these fields
|
|
51607
|
+
but does not prove that every field appears in delivery. Preview the ad; put copy that
|
|
51608
|
+
must always be visible into the image or video itself.
|
|
51609
|
+
|
|
51610
|
+
`validateOnly: true` supports all-image placementAssets without uploading or creating
|
|
51611
|
+
anything. Video placement validation remains unsupported because it requires uploads.
|
|
51581
51612
|
|
|
51582
51613
|
A block is all-image OR all-video, never mixed (Meta's asset_feed_spec carries one ad
|
|
51583
51614
|
format). Image mode: `defaultImageUrl` + `rules[].imageUrl`. Video mode:
|
|
51584
51615
|
`defaultVideoUrl` + `rules[].videoUrl` (optional `thumbnailUrl`/`defaultThumbnailUrl`
|
|
51585
51616
|
posters; Meta auto-generates when omitted). Exactly one catch-all default is required.
|
|
51617
|
+
example:
|
|
51618
|
+
defaultImageUrl: 'https://example.com/feed-4x5.jpg'
|
|
51619
|
+
rules:
|
|
51620
|
+
- imageUrl: 'https://example.com/feed-4x5.jpg'
|
|
51621
|
+
headline: 'Build with Zernio'
|
|
51622
|
+
body: 'Schedule social posts from your app.'
|
|
51623
|
+
description: 'One API for your social content.'
|
|
51624
|
+
placements: { publisherPlatforms: [facebook], facebookPositions: [feed] }
|
|
51625
|
+
- imageUrl: 'https://example.com/story-9x16.jpg'
|
|
51626
|
+
headline: 'Your next story'
|
|
51627
|
+
body: 'Bring your social workflow to Zernio.'
|
|
51628
|
+
placements: { publisherPlatforms: [facebook], facebookPositions: [story, facebook_reels] }
|
|
51586
51629
|
required: [rules]
|
|
51587
51630
|
properties:
|
|
51588
51631
|
defaultImageUrl:
|
|
@@ -51618,6 +51661,20 @@ paths:
|
|
|
51618
51661
|
type: string
|
|
51619
51662
|
format: uri
|
|
51620
51663
|
description: "Video mode (optional). Poster image for this rule's video; auto-generated when omitted."
|
|
51664
|
+
headline:
|
|
51665
|
+
type: string
|
|
51666
|
+
minLength: 1
|
|
51667
|
+
maxLength: 255
|
|
51668
|
+
description: "One headline pinned to this rule. Omit to inherit the top-level headline."
|
|
51669
|
+
body:
|
|
51670
|
+
type: string
|
|
51671
|
+
minLength: 1
|
|
51672
|
+
description: "One primary text pinned to this rule. Omit to inherit the top-level body."
|
|
51673
|
+
description:
|
|
51674
|
+
type: string
|
|
51675
|
+
minLength: 1
|
|
51676
|
+
maxLength: 255
|
|
51677
|
+
description: "One link description pinned to this rule. Omit to inherit the top-level description."
|
|
51621
51678
|
placements:
|
|
51622
51679
|
type: object
|
|
51623
51680
|
description: "Placements this asset is pinned to. At least one field must be set (an empty rule is invalid; that role is served by the default asset). Same enums as the top-level `placements` object."
|
|
@@ -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]
|
|
@@ -45,6 +45,24 @@ describe Zernio::CreateStandaloneAdRequestPlacementAssetsRulesInner do
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
describe 'test attribute "headline"' 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
|
+
|
|
54
|
+
describe 'test attribute "body"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe 'test attribute "description"' do
|
|
61
|
+
it 'should work' do
|
|
62
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
48
66
|
describe 'test attribute "placements"' do
|
|
49
67
|
it 'should work' do
|
|
50
68
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -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.921
|
|
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.921.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
|