zernio-sdk 0.0.649 → 0.0.650
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/BoostPostRequest.md +1 -1
- data/docs/CreateStandaloneAdRequest.md +2 -2
- data/docs/CreateStandaloneAdRequestDynamicCreative.md +4 -2
- data/lib/zernio-sdk/models/boost_post_request.rb +1 -1
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +2 -2
- data/lib/zernio-sdk/models/create_standalone_ad_request_dynamic_creative.rb +50 -19
- data/lib/zernio-sdk/version.rb +1 -1
- data/openapi.yaml +43 -21
- data/spec/models/create_standalone_ad_request_dynamic_creative_spec.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc4393c63e123bb33b59d5138399189fe21a29f576b033e72f92ace867fe94cb
|
|
4
|
+
data.tar.gz: ff0d9f1ac94917a2e1841661307b5307f33c1c796df4f77d610c19a8e4ba2357
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dde32803fc7df3c1003c65ad39993063f8978452f187db2ff4d57dac83589ab8210476ac3e8bcfbbf1db0fa8afbec385861e82c7b02198f3423ed7923a277b7f
|
|
7
|
+
data.tar.gz: 07c56193e97bbeefac0c6808d6575f7b40ae71f6c558d0e4723b479117f2926ccb8db2c5fd805ecbc8f6425da2302d4a0b37facfd62e7000da036d0b76de25f4
|
data/docs/BoostPostRequest.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
| **currency** | **String** | | [optional] |
|
|
15
15
|
| **schedule** | [**BoostPostRequestSchedule**](BoostPostRequestSchedule.md) | | [optional] |
|
|
16
16
|
| **targeting** | [**BoostPostRequestTargeting**](BoostPostRequestTargeting.md) | | [optional] |
|
|
17
|
-
| **raw_targeting** | **Hash<String, Object>** | Meta only. A
|
|
17
|
+
| **raw_targeting** | **Hash<String, Object>** | Meta only. A Meta-native targeting spec (e.g. `{ \"geo_locations\": { \"cities\": [{ \"key\": \"...\", \"radius\": 15, \"distance_unit\": \"kilometer\" }] } }`). Sent alone it is forwarded unchanged. Use for advanced fields the structured object does not expose (flexible_spec, excluded audiences, business places, user_os, wireless_carrier). Can be combined with `targeting`: rawTargeting is the BASE layer and the built camelCase spec is merged on top, key by key (camelCase wins on collision). The merge goes one level deep inside `geo_locations` and `excluded_geo_locations` (built sub-keys win; raw-only sub-keys such as `location_types` survive). Array values (`flexible_spec`, ...) are replaced as a whole key, never element-merged. | [optional] |
|
|
18
18
|
| **bid_strategy** | [**BidStrategy**](BidStrategy.md) | Meta bid strategy applied to the ad set. On TikTok, mapped to `bid_type` / `bid_price` / `deep_bid_type` automatically. | [optional] |
|
|
19
19
|
| **bid_amount** | **Float** | Bid cap in WHOLE currency units (USD: 5 = $5.00; JPY: 100 = ¥100). Required when `bidStrategy` is `LOWEST_COST_WITH_BID_CAP` or `COST_CAP`. Backward-compat: providing `bidAmount` without `bidStrategy` is treated as `LOWEST_COST_WITH_BID_CAP`. | [optional] |
|
|
20
20
|
| **roas_average_floor** | **Float** | Minimum ROAS as a decimal multiplier (e.g. 2.0 = 2.0x ROAS). Required when `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`. Sent to Meta as `bid_constraints.roas_average_floor` × 10000 (Meta uses fixed-point integers). | [optional] |
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
| **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 dynamicCreative.descriptions instead. | [optional] |
|
|
30
30
|
| **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/Twitter. | [optional] |
|
|
31
31
|
| **link_url** | **String** | Required on legacy + attach shapes (skip for multi-creative). On LinkedIn it's the ad's destination URL; required for `traffic` ads, optional for `engagement` / `awareness`. NOT required when `goal` is `lead_generation` (the ad opens a Lead Gen form instead of a destination). On LinkedIn, `imageUrl` + `linkUrl` publishes an ARTICLE-content creative; this is LinkedIn's article ad format, with the image as thumbnail and `longHeadline` as description. Required for OpenAI Ads (the chat card's target_url). | [optional] |
|
|
32
|
-
| **lead_gen_form_id** | **String** | Meta Lead Gen forms only (facebook/instagram). The leadgen_forms ID to attach to the ad's creative — create one via POST /v1/ads/lead-forms. REQUIRED when `goal` is `lead_generation`, and on every ATTACH (`adSetId`) call that targets a lead ad set (the form attaches per-ad; Meta rejects a formless ad in a lead ad set). Ignored otherwise. The ad set's promoted_object.page_id + LEAD_GENERATION optimization + destination_type ON_AD are derived automatically from the goal. Both `placementAssets` (per-placement creative) and `dynamicCreative` (multi-text / multi-asset pool, e.g. multiple headlines and primary texts) ARE supported on instant-form lead ads — the form is attached for you, and for `dynamicCreative` the ad set is created as a Dynamic Creative ad set automatically (Meta requires that for any multi-text feed; there is no non-DCO multi-text path). Send a single `imageUrls` entry plus your text variations to get Meta's \"Multiple Text Options\" behavior on a lead ad. | [optional] |
|
|
32
|
+
| **lead_gen_form_id** | **String** | Meta Lead Gen forms only (facebook/instagram). The leadgen_forms ID to attach to the ad's creative — create one via POST /v1/ads/lead-forms. REQUIRED when `goal` is `lead_generation`, and on every ATTACH (`adSetId`) call that targets a lead ad set (the form attaches per-ad; Meta rejects a formless ad in a lead ad set). Ignored otherwise. The ad set's promoted_object.page_id + LEAD_GENERATION optimization + destination_type ON_AD are derived automatically from the goal. Both `placementAssets` (per-placement creative) and `dynamicCreative` (multi-text / multi-asset pool, e.g. multiple headlines and primary texts) ARE supported on instant-form lead ads — the form is attached for you, and for `dynamicCreative` the ad set is created as a Dynamic Creative ad set automatically (Meta requires that for any multi-text feed; there is no non-DCO multi-text path). Send a single `imageUrls` (or `videoUrls`) entry plus your text variations to get Meta's \"Multiple Text Options\" behavior on a lead ad. | [optional] |
|
|
33
33
|
| **image_url** | **String** | Image creative for Meta/Google/Pinterest/LinkedIn on legacy + attach shapes (mutually exclusive with `video`). Required for LinkedIn ads unless `video` is set. Not required for Google Search campaigns. For TikTok, this field carries the VIDEO URL (the TikTok ads endpoint is video-only; the field retains the `imageUrl` name for cross-platform consistency). Ignored for X/Twitter. For Google Display, treated as the landscape image (alias of `images.landscape`); supply `images.square` alongside or the request is rejected. For LinkedIn the image is uploaded to LinkedIn under the authoring Company Page (see `organizationId`); recommended ratio 1.91:1 (e.g. 1200×627). Required for OpenAI Ads (uploaded as the chat card's image; OpenAI has no video ad format). | [optional] |
|
|
34
34
|
| **images** | [**CreateStandaloneAdRequestImages**](CreateStandaloneAdRequestImages.md) | | [optional] |
|
|
35
35
|
| **video** | [**CreateStandaloneAdRequestVideo**](CreateStandaloneAdRequestVideo.md) | | [optional] |
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
| **languages** | **Array<String>** | Language codes restricting the audience by language. On Meta, ISO 639-1 codes (e.g. ['en'], ['de']); a bare code targets all regional variants (\"en\" = all English), or use a region-qualified code for a specific one (\"en_GB\", \"pt_BR\", \"zh_TW\"). Unknown codes are rejected. Other ad platforms use their own language-code systems. | [optional] |
|
|
56
56
|
| **placements** | [**CreateStandaloneAdRequestPlacements**](CreateStandaloneAdRequestPlacements.md) | | [optional] |
|
|
57
57
|
| **saved_targeting_id** | **String** | ID of a `saved_targeting` audience (created via POST /v1/ads/audiences). When set, its stored TargetingSpec is expanded as the base targeting; inline fields on this body merge on top. Lets you reuse a named targeting preset without re-sending every field. | [optional] |
|
|
58
|
-
| **raw_targeting** | **Hash<String, Object>** | Meta only. A raw Meta-native targeting spec
|
|
58
|
+
| **raw_targeting** | **Hash<String, Object>** | Meta only. A raw Meta-native targeting spec (snake_case: `geo_locations`, `age_min`, `excluded_custom_audiences`, `flexible_spec`, `targeting_automation`, `user_os`, `wireless_carrier`, business places, etc.) — exactly the shape `GET /v1/ads/{adId}` returns for external ads. Sent alone it reaches the ad set VERBATIM (the clone-a-campaign's-targeting-exactly path). Meta validates and surfaces any errors. Can be combined with the camelCase targeting fields (countries/regions/cities/interests/ageMin/..., `targeting`, `savedTargetingId`, `audienceId`): rawTargeting is the BASE layer and the built camelCase spec is merged on top, key by key, with the camelCase side winning on collision (the camelCase precedence chain stays `savedTargetingId` < `targeting` < flat fields). The merge goes one level deep inside `geo_locations` and `excluded_geo_locations`: built sub-keys win, raw-only sub-keys such as `location_types` survive alongside built `countries`. Array values (`flexible_spec`, ...) are replaced as a WHOLE key when the camelCase spec builds them, never element-merged. When rawTargeting is present the defaults the camelCase builder normally injects (US geo, `targeting_automation.advantage_audience: 0`) are suppressed, so raw's values are not clobbered — include `targeting_automation` in the raw spec (or send `advantageAudience`) as Meta requires it on create. If cloning an EU campaign, also pass `dsaBeneficiary` / `dsaPayor` (those are separate fields, not part of targeting). | [optional] |
|
|
59
59
|
| **special_ad_categories** | **Array<String>** | Meta only. Declares the ad's special category, required for housing, employment, credit, or political/social-issue ads (Meta enforces restricted targeting for these). Note: setting a special category disables income/zip targeting on Meta. | [optional] |
|
|
60
60
|
| **special_ad_category_country** | **Array<String>** | Meta (metaads) only. 2-letter ISO country codes the special ad category applies to. Requires specialAdCategories to be set (400 otherwise). Ignored when joining an existing campaign via existingCampaignId (the existing campaign's category/country already governs it). | [optional] |
|
|
61
61
|
| **end_date** | **Time** | Required for lifetime budgets | [optional] |
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **image_urls** | **Array<String>** | Pool of image URLs (1-10). Uploaded to the ad account and referenced by hash in the asset feed. |
|
|
7
|
+
| **image_urls** | **Array<String>** | Pool of image URLs (1-10). Uploaded to the ad account and referenced by hash in the asset feed. Mutually exclusive with `videoUrls`. | [optional] |
|
|
8
|
+
| **video_urls** | **Array<String>** | Pool of video URLs (1-10). Uploaded to the ad account and referenced by video id in the asset feed. No thumbnails are needed: Meta auto-generates a poster per video. Mutually exclusive with `imageUrls`; `adFormat` defaults to SINGLE_VIDEO. | [optional] |
|
|
8
9
|
| **bodies** | **Array<String>** | Primary-text variations (the body copy). | [optional] |
|
|
9
10
|
| **titles** | **Array<String>** | Headline variations. | [optional] |
|
|
10
11
|
| **descriptions** | **Array<String>** | Description (link caption) variations. | [optional] |
|
|
11
12
|
| **link_urls** | **Array<String>** | Destination URL variations. At least one is required unless `goal` is `lead_generation`. | [optional] |
|
|
12
13
|
| **call_to_action_types** | **Array<String>** | CTA-button variations. Required. | [optional] |
|
|
13
|
-
| **ad_format** | **String** | Asset-feed ad format. Defaults to SINGLE_IMAGE
|
|
14
|
+
| **ad_format** | **String** | Asset-feed ad format. Must match the pool: SINGLE_IMAGE / CAROUSEL_IMAGE require `imageUrls`, SINGLE_VIDEO requires `videoUrls` (400 otherwise). Defaults to SINGLE_IMAGE with `imageUrls`, SINGLE_VIDEO with `videoUrls`. | [optional] |
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
|
@@ -19,6 +20,7 @@ require 'zernio-sdk'
|
|
|
19
20
|
|
|
20
21
|
instance = Zernio::CreateStandaloneAdRequestDynamicCreative.new(
|
|
21
22
|
image_urls: null,
|
|
23
|
+
video_urls: null,
|
|
22
24
|
bodies: null,
|
|
23
25
|
titles: null,
|
|
24
26
|
descriptions: null,
|
|
@@ -40,7 +40,7 @@ module Zernio
|
|
|
40
40
|
|
|
41
41
|
attr_accessor :targeting
|
|
42
42
|
|
|
43
|
-
# Meta only. A
|
|
43
|
+
# Meta only. A Meta-native targeting spec (e.g. `{ \"geo_locations\": { \"cities\": [{ \"key\": \"...\", \"radius\": 15, \"distance_unit\": \"kilometer\" }] } }`). Sent alone it is forwarded unchanged. Use for advanced fields the structured object does not expose (flexible_spec, excluded audiences, business places, user_os, wireless_carrier). Can be combined with `targeting`: rawTargeting is the BASE layer and the built camelCase spec is merged on top, key by key (camelCase wins on collision). The merge goes one level deep inside `geo_locations` and `excluded_geo_locations` (built sub-keys win; raw-only sub-keys such as `location_types` survive). Array values (`flexible_spec`, ...) are replaced as a whole key, never element-merged.
|
|
44
44
|
attr_accessor :raw_targeting
|
|
45
45
|
|
|
46
46
|
# Meta bid strategy applied to the ad set. On TikTok, mapped to `bid_type` / `bid_price` / `deep_bid_type` automatically.
|
|
@@ -85,7 +85,7 @@ module Zernio
|
|
|
85
85
|
# Required on legacy + attach shapes (skip for multi-creative). On LinkedIn it's the ad's destination URL; required for `traffic` ads, optional for `engagement` / `awareness`. NOT required when `goal` is `lead_generation` (the ad opens a Lead Gen form instead of a destination). On LinkedIn, `imageUrl` + `linkUrl` publishes an ARTICLE-content creative; this is LinkedIn's article ad format, with the image as thumbnail and `longHeadline` as description. Required for OpenAI Ads (the chat card's target_url).
|
|
86
86
|
attr_accessor :link_url
|
|
87
87
|
|
|
88
|
-
# Meta Lead Gen forms only (facebook/instagram). The leadgen_forms ID to attach to the ad's creative — create one via POST /v1/ads/lead-forms. REQUIRED when `goal` is `lead_generation`, and on every ATTACH (`adSetId`) call that targets a lead ad set (the form attaches per-ad; Meta rejects a formless ad in a lead ad set). Ignored otherwise. The ad set's promoted_object.page_id + LEAD_GENERATION optimization + destination_type ON_AD are derived automatically from the goal. Both `placementAssets` (per-placement creative) and `dynamicCreative` (multi-text / multi-asset pool, e.g. multiple headlines and primary texts) ARE supported on instant-form lead ads — the form is attached for you, and for `dynamicCreative` the ad set is created as a Dynamic Creative ad set automatically (Meta requires that for any multi-text feed; there is no non-DCO multi-text path). Send a single `imageUrls` entry plus your text variations to get Meta's \"Multiple Text Options\" behavior on a lead ad.
|
|
88
|
+
# Meta Lead Gen forms only (facebook/instagram). The leadgen_forms ID to attach to the ad's creative — create one via POST /v1/ads/lead-forms. REQUIRED when `goal` is `lead_generation`, and on every ATTACH (`adSetId`) call that targets a lead ad set (the form attaches per-ad; Meta rejects a formless ad in a lead ad set). Ignored otherwise. The ad set's promoted_object.page_id + LEAD_GENERATION optimization + destination_type ON_AD are derived automatically from the goal. Both `placementAssets` (per-placement creative) and `dynamicCreative` (multi-text / multi-asset pool, e.g. multiple headlines and primary texts) ARE supported on instant-form lead ads — the form is attached for you, and for `dynamicCreative` the ad set is created as a Dynamic Creative ad set automatically (Meta requires that for any multi-text feed; there is no non-DCO multi-text path). Send a single `imageUrls` (or `videoUrls`) entry plus your text variations to get Meta's \"Multiple Text Options\" behavior on a lead ad.
|
|
89
89
|
attr_accessor :lead_gen_form_id
|
|
90
90
|
|
|
91
91
|
# Image creative for Meta/Google/Pinterest/LinkedIn on legacy + attach shapes (mutually exclusive with `video`). Required for LinkedIn ads unless `video` is set. Not required for Google Search campaigns. For TikTok, this field carries the VIDEO URL (the TikTok ads endpoint is video-only; the field retains the `imageUrl` name for cross-platform consistency). Ignored for X/Twitter. For Google Display, treated as the landscape image (alias of `images.landscape`); supply `images.square` alongside or the request is rejected. For LinkedIn the image is uploaded to LinkedIn under the authoring Company Page (see `organizationId`); recommended ratio 1.91:1 (e.g. 1200×627). Required for OpenAI Ads (uploaded as the chat card's image; OpenAI has no video ad format).
|
|
@@ -158,7 +158,7 @@ module Zernio
|
|
|
158
158
|
# ID of a `saved_targeting` audience (created via POST /v1/ads/audiences). When set, its stored TargetingSpec is expanded as the base targeting; inline fields on this body merge on top. Lets you reuse a named targeting preset without re-sending every field.
|
|
159
159
|
attr_accessor :saved_targeting_id
|
|
160
160
|
|
|
161
|
-
# Meta only. A raw Meta-native targeting spec
|
|
161
|
+
# Meta only. A raw Meta-native targeting spec (snake_case: `geo_locations`, `age_min`, `excluded_custom_audiences`, `flexible_spec`, `targeting_automation`, `user_os`, `wireless_carrier`, business places, etc.) — exactly the shape `GET /v1/ads/{adId}` returns for external ads. Sent alone it reaches the ad set VERBATIM (the clone-a-campaign's-targeting-exactly path). Meta validates and surfaces any errors. Can be combined with the camelCase targeting fields (countries/regions/cities/interests/ageMin/..., `targeting`, `savedTargetingId`, `audienceId`): rawTargeting is the BASE layer and the built camelCase spec is merged on top, key by key, with the camelCase side winning on collision (the camelCase precedence chain stays `savedTargetingId` < `targeting` < flat fields). The merge goes one level deep inside `geo_locations` and `excluded_geo_locations`: built sub-keys win, raw-only sub-keys such as `location_types` survive alongside built `countries`. Array values (`flexible_spec`, ...) are replaced as a WHOLE key when the camelCase spec builds them, never element-merged. When rawTargeting is present the defaults the camelCase builder normally injects (US geo, `targeting_automation.advantage_audience: 0`) are suppressed, so raw's values are not clobbered — include `targeting_automation` in the raw spec (or send `advantageAudience`) as Meta requires it on create. If cloning an EU campaign, also pass `dsaBeneficiary` / `dsaPayor` (those are separate fields, not part of targeting).
|
|
162
162
|
attr_accessor :raw_targeting
|
|
163
163
|
|
|
164
164
|
# Meta only. Declares the ad's special category, required for housing, employment, credit, or political/social-issue ads (Meta enforces restricted targeting for these). Note: setting a special category disables income/zip targeting on Meta.
|
|
@@ -14,11 +14,14 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# Meta only. Dynamic Creative: supply a POOL of assets and Meta auto-combines and optimises them into the best-performing variations within a single ad (mapped to the creative's `asset_feed_spec`). When set, the top-level single-creative fields (`imageUrl`, `headline`, `body`, `linkUrl`, `callToAction`) are ignored. Mutually exclusive with the `creatives[]` multi-creative shape. Meta limits: ≤10 images, ≤5 bodies / titles / descriptions.
|
|
17
|
+
# Meta only. Dynamic Creative: supply a POOL of assets and Meta auto-combines and optimises them into the best-performing variations within a single ad (mapped to the creative's `asset_feed_spec`). When set, the top-level single-creative fields (`imageUrl`, `headline`, `body`, `linkUrl`, `callToAction`) are ignored. Mutually exclusive with the `creatives[]` multi-creative shape. Exactly ONE of `imageUrls` / `videoUrls` is required (Meta allows one ad format per asset feed; sending both → 400). Meta limits: ≤10 images or ≤10 videos, ≤5 bodies / titles / descriptions.
|
|
18
18
|
class CreateStandaloneAdRequestDynamicCreative < ApiModelBase
|
|
19
|
-
# Pool of image URLs (1-10). Uploaded to the ad account and referenced by hash in the asset feed.
|
|
19
|
+
# Pool of image URLs (1-10). Uploaded to the ad account and referenced by hash in the asset feed. Mutually exclusive with `videoUrls`.
|
|
20
20
|
attr_accessor :image_urls
|
|
21
21
|
|
|
22
|
+
# Pool of video URLs (1-10). Uploaded to the ad account and referenced by video id in the asset feed. No thumbnails are needed: Meta auto-generates a poster per video. Mutually exclusive with `imageUrls`; `adFormat` defaults to SINGLE_VIDEO.
|
|
23
|
+
attr_accessor :video_urls
|
|
24
|
+
|
|
22
25
|
# Primary-text variations (the body copy).
|
|
23
26
|
attr_accessor :bodies
|
|
24
27
|
|
|
@@ -34,7 +37,7 @@ module Zernio
|
|
|
34
37
|
# CTA-button variations. Required.
|
|
35
38
|
attr_accessor :call_to_action_types
|
|
36
39
|
|
|
37
|
-
# Asset-feed ad format. Defaults to SINGLE_IMAGE
|
|
40
|
+
# Asset-feed ad format. Must match the pool: SINGLE_IMAGE / CAROUSEL_IMAGE require `imageUrls`, SINGLE_VIDEO requires `videoUrls` (400 otherwise). Defaults to SINGLE_IMAGE with `imageUrls`, SINGLE_VIDEO with `videoUrls`.
|
|
38
41
|
attr_accessor :ad_format
|
|
39
42
|
|
|
40
43
|
class EnumAttributeValidator
|
|
@@ -63,6 +66,7 @@ module Zernio
|
|
|
63
66
|
def self.attribute_map
|
|
64
67
|
{
|
|
65
68
|
:'image_urls' => :'imageUrls',
|
|
69
|
+
:'video_urls' => :'videoUrls',
|
|
66
70
|
:'bodies' => :'bodies',
|
|
67
71
|
:'titles' => :'titles',
|
|
68
72
|
:'descriptions' => :'descriptions',
|
|
@@ -86,6 +90,7 @@ module Zernio
|
|
|
86
90
|
def self.openapi_types
|
|
87
91
|
{
|
|
88
92
|
:'image_urls' => :'Array<String>',
|
|
93
|
+
:'video_urls' => :'Array<String>',
|
|
89
94
|
:'bodies' => :'Array<String>',
|
|
90
95
|
:'titles' => :'Array<String>',
|
|
91
96
|
:'descriptions' => :'Array<String>',
|
|
@@ -121,8 +126,12 @@ module Zernio
|
|
|
121
126
|
if (value = attributes[:'image_urls']).is_a?(Array)
|
|
122
127
|
self.image_urls = value
|
|
123
128
|
end
|
|
124
|
-
|
|
125
|
-
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'video_urls')
|
|
132
|
+
if (value = attributes[:'video_urls']).is_a?(Array)
|
|
133
|
+
self.video_urls = value
|
|
134
|
+
end
|
|
126
135
|
end
|
|
127
136
|
|
|
128
137
|
if attributes.key?(:'bodies')
|
|
@@ -157,8 +166,6 @@ module Zernio
|
|
|
157
166
|
|
|
158
167
|
if attributes.key?(:'ad_format')
|
|
159
168
|
self.ad_format = attributes[:'ad_format']
|
|
160
|
-
else
|
|
161
|
-
self.ad_format = 'SINGLE_IMAGE'
|
|
162
169
|
end
|
|
163
170
|
end
|
|
164
171
|
|
|
@@ -167,18 +174,22 @@ module Zernio
|
|
|
167
174
|
def list_invalid_properties
|
|
168
175
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
169
176
|
invalid_properties = Array.new
|
|
170
|
-
if
|
|
171
|
-
invalid_properties.push('invalid value for "image_urls", image_urls cannot be nil.')
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
if @image_urls.length > 10
|
|
177
|
+
if !@image_urls.nil? && @image_urls.length > 10
|
|
175
178
|
invalid_properties.push('invalid value for "image_urls", number of items must be less than or equal to 10.')
|
|
176
179
|
end
|
|
177
180
|
|
|
178
|
-
if @image_urls.length < 1
|
|
181
|
+
if !@image_urls.nil? && @image_urls.length < 1
|
|
179
182
|
invalid_properties.push('invalid value for "image_urls", number of items must be greater than or equal to 1.')
|
|
180
183
|
end
|
|
181
184
|
|
|
185
|
+
if !@video_urls.nil? && @video_urls.length > 10
|
|
186
|
+
invalid_properties.push('invalid value for "video_urls", number of items must be less than or equal to 10.')
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if !@video_urls.nil? && @video_urls.length < 1
|
|
190
|
+
invalid_properties.push('invalid value for "video_urls", number of items must be greater than or equal to 1.')
|
|
191
|
+
end
|
|
192
|
+
|
|
182
193
|
if !@bodies.nil? && @bodies.length > 5
|
|
183
194
|
invalid_properties.push('invalid value for "bodies", number of items must be less than or equal to 5.')
|
|
184
195
|
end
|
|
@@ -198,13 +209,14 @@ module Zernio
|
|
|
198
209
|
# @return true if the model is valid
|
|
199
210
|
def valid?
|
|
200
211
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
201
|
-
return false if
|
|
202
|
-
return false if @image_urls.length
|
|
203
|
-
return false if @
|
|
212
|
+
return false if !@image_urls.nil? && @image_urls.length > 10
|
|
213
|
+
return false if !@image_urls.nil? && @image_urls.length < 1
|
|
214
|
+
return false if !@video_urls.nil? && @video_urls.length > 10
|
|
215
|
+
return false if !@video_urls.nil? && @video_urls.length < 1
|
|
204
216
|
return false if !@bodies.nil? && @bodies.length > 5
|
|
205
217
|
return false if !@titles.nil? && @titles.length > 5
|
|
206
218
|
return false if !@descriptions.nil? && @descriptions.length > 5
|
|
207
|
-
ad_format_validator = EnumAttributeValidator.new('String', ["SINGLE_IMAGE", "CAROUSEL_IMAGE"])
|
|
219
|
+
ad_format_validator = EnumAttributeValidator.new('String', ["SINGLE_IMAGE", "CAROUSEL_IMAGE", "SINGLE_VIDEO"])
|
|
208
220
|
return false unless ad_format_validator.valid?(@ad_format)
|
|
209
221
|
true
|
|
210
222
|
end
|
|
@@ -227,6 +239,24 @@ module Zernio
|
|
|
227
239
|
@image_urls = image_urls
|
|
228
240
|
end
|
|
229
241
|
|
|
242
|
+
# Custom attribute writer method with validation
|
|
243
|
+
# @param [Object] video_urls Value to be assigned
|
|
244
|
+
def video_urls=(video_urls)
|
|
245
|
+
if video_urls.nil?
|
|
246
|
+
fail ArgumentError, 'video_urls cannot be nil'
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if video_urls.length > 10
|
|
250
|
+
fail ArgumentError, 'invalid value for "video_urls", number of items must be less than or equal to 10.'
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
if video_urls.length < 1
|
|
254
|
+
fail ArgumentError, 'invalid value for "video_urls", number of items must be greater than or equal to 1.'
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
@video_urls = video_urls
|
|
258
|
+
end
|
|
259
|
+
|
|
230
260
|
# Custom attribute writer method with validation
|
|
231
261
|
# @param [Object] bodies Value to be assigned
|
|
232
262
|
def bodies=(bodies)
|
|
@@ -272,7 +302,7 @@ module Zernio
|
|
|
272
302
|
# Custom attribute writer method checking allowed values (enum).
|
|
273
303
|
# @param [Object] ad_format Object to be assigned
|
|
274
304
|
def ad_format=(ad_format)
|
|
275
|
-
validator = EnumAttributeValidator.new('String', ["SINGLE_IMAGE", "CAROUSEL_IMAGE"])
|
|
305
|
+
validator = EnumAttributeValidator.new('String', ["SINGLE_IMAGE", "CAROUSEL_IMAGE", "SINGLE_VIDEO"])
|
|
276
306
|
unless validator.valid?(ad_format)
|
|
277
307
|
fail ArgumentError, "invalid value for \"ad_format\", must be one of #{validator.allowable_values}."
|
|
278
308
|
end
|
|
@@ -285,6 +315,7 @@ module Zernio
|
|
|
285
315
|
return true if self.equal?(o)
|
|
286
316
|
self.class == o.class &&
|
|
287
317
|
image_urls == o.image_urls &&
|
|
318
|
+
video_urls == o.video_urls &&
|
|
288
319
|
bodies == o.bodies &&
|
|
289
320
|
titles == o.titles &&
|
|
290
321
|
descriptions == o.descriptions &&
|
|
@@ -302,7 +333,7 @@ module Zernio
|
|
|
302
333
|
# Calculates hash code according to all attributes.
|
|
303
334
|
# @return [Integer] Hash code
|
|
304
335
|
def hash
|
|
305
|
-
[image_urls, bodies, titles, descriptions, link_urls, call_to_action_types, ad_format].hash
|
|
336
|
+
[image_urls, video_urls, bodies, titles, descriptions, link_urls, call_to_action_types, ad_format].hash
|
|
306
337
|
end
|
|
307
338
|
|
|
308
339
|
# Builds the object from hash
|
data/lib/zernio-sdk/version.rb
CHANGED
data/openapi.yaml
CHANGED
|
@@ -37842,11 +37842,18 @@ paths:
|
|
|
37842
37842
|
type: object
|
|
37843
37843
|
additionalProperties: true
|
|
37844
37844
|
description: |
|
|
37845
|
-
Meta only. A
|
|
37846
|
-
`{ "geo_locations": { "cities": [{ "key": "...", "radius": 15, "distance_unit": "kilometer" }] } }`)
|
|
37847
|
-
forwarded unchanged.
|
|
37848
|
-
|
|
37849
|
-
|
|
37845
|
+
Meta only. A Meta-native targeting spec (e.g.
|
|
37846
|
+
`{ "geo_locations": { "cities": [{ "key": "...", "radius": 15, "distance_unit": "kilometer" }] } }`).
|
|
37847
|
+
Sent alone it is forwarded unchanged. Use for advanced fields the structured
|
|
37848
|
+
object does not expose (flexible_spec, excluded audiences, business places,
|
|
37849
|
+
user_os, wireless_carrier).
|
|
37850
|
+
|
|
37851
|
+
Can be combined with `targeting`: rawTargeting is the BASE layer and the
|
|
37852
|
+
built camelCase spec is merged on top, key by key (camelCase wins on
|
|
37853
|
+
collision). The merge goes one level deep inside `geo_locations` and
|
|
37854
|
+
`excluded_geo_locations` (built sub-keys win; raw-only sub-keys such as
|
|
37855
|
+
`location_types` survive). Array values (`flexible_spec`, ...) are replaced
|
|
37856
|
+
as a whole key, never element-merged.
|
|
37850
37857
|
bidStrategy:
|
|
37851
37858
|
allOf: [{ $ref: '#/components/schemas/BidStrategy' }]
|
|
37852
37859
|
description: |
|
|
@@ -38084,7 +38091,7 @@ paths:
|
|
|
38084
38091
|
description: { type: string, maxLength: 255, description: "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 dynamicCreative.descriptions instead." }
|
|
38085
38092
|
callToAction: { type: string, enum: [LEARN_MORE, SHOP_NOW, SIGN_UP, BOOK_TRAVEL, CONTACT_US, DOWNLOAD, GET_OFFER, GET_QUOTE, SUBSCRIBE, WATCH_MORE, ADD_TO_CART, APPLY_NOW, BOOK_NOW, BUY_TICKETS, DONATE, DONATE_NOW, GET_DIRECTIONS, GET_SHOWTIMES, LISTEN_NOW, ORDER_NOW, PLAY_GAME, REQUEST_TIME, SEE_MENU, START_ORDER, INSTALL_MOBILE_APP, USE_APP, REGISTER, JOIN, ATTEND, REQUEST_DEMO, VIEW_QUOTE, APPLY, SEE_MORE, BUY_NOW], description: "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/Twitter." }
|
|
38086
38093
|
linkUrl: { type: string, format: uri, description: "Required on legacy + attach shapes (skip for multi-creative). On LinkedIn it's the ad's destination URL; required for `traffic` ads, optional for `engagement` / `awareness`. NOT required when `goal` is `lead_generation` (the ad opens a Lead Gen form instead of a destination). On LinkedIn, `imageUrl` + `linkUrl` publishes an ARTICLE-content creative; this is LinkedIn's article ad format, with the image as thumbnail and `longHeadline` as description. Required for OpenAI Ads (the chat card's target_url)." }
|
|
38087
|
-
leadGenFormId: { type: string, description: "Meta Lead Gen forms only (facebook/instagram). The leadgen_forms ID to attach to the ad's creative — create one via POST /v1/ads/lead-forms. REQUIRED when `goal` is `lead_generation`, and on every ATTACH (`adSetId`) call that targets a lead ad set (the form attaches per-ad; Meta rejects a formless ad in a lead ad set). Ignored otherwise. The ad set's promoted_object.page_id + LEAD_GENERATION optimization + destination_type ON_AD are derived automatically from the goal. Both `placementAssets` (per-placement creative) and `dynamicCreative` (multi-text / multi-asset pool, e.g. multiple headlines and primary texts) ARE supported on instant-form lead ads — the form is attached for you, and for `dynamicCreative` the ad set is created as a Dynamic Creative ad set automatically (Meta requires that for any multi-text feed; there is no non-DCO multi-text path). Send a single `imageUrls` entry plus your text variations to get Meta's \"Multiple Text Options\" behavior on a lead ad." }
|
|
38094
|
+
leadGenFormId: { type: string, description: "Meta Lead Gen forms only (facebook/instagram). The leadgen_forms ID to attach to the ad's creative — create one via POST /v1/ads/lead-forms. REQUIRED when `goal` is `lead_generation`, and on every ATTACH (`adSetId`) call that targets a lead ad set (the form attaches per-ad; Meta rejects a formless ad in a lead ad set). Ignored otherwise. The ad set's promoted_object.page_id + LEAD_GENERATION optimization + destination_type ON_AD are derived automatically from the goal. Both `placementAssets` (per-placement creative) and `dynamicCreative` (multi-text / multi-asset pool, e.g. multiple headlines and primary texts) ARE supported on instant-form lead ads — the form is attached for you, and for `dynamicCreative` the ad set is created as a Dynamic Creative ad set automatically (Meta requires that for any multi-text feed; there is no non-DCO multi-text path). Send a single `imageUrls` (or `videoUrls`) entry plus your text variations to get Meta's \"Multiple Text Options\" behavior on a lead ad." }
|
|
38088
38095
|
imageUrl: { type: string, format: uri, description: "Image creative for Meta/Google/Pinterest/LinkedIn on legacy + attach shapes (mutually exclusive with `video`). Required for LinkedIn ads unless `video` is set. Not required for Google Search campaigns. For TikTok, this field carries the VIDEO URL (the TikTok ads endpoint is video-only; the field retains the `imageUrl` name for cross-platform consistency). Ignored for X/Twitter. For Google Display, treated as the landscape image (alias of `images.landscape`); supply `images.square` alongside or the request is rejected. For LinkedIn the image is uploaded to LinkedIn under the authoring Company Page (see `organizationId`); recommended ratio 1.91:1 (e.g. 1200×627). Required for OpenAI Ads (uploaded as the chat card's image; OpenAI has no video ad format)." }
|
|
38089
38096
|
images:
|
|
38090
38097
|
type: object
|
|
@@ -38324,14 +38331,24 @@ paths:
|
|
|
38324
38331
|
type: object
|
|
38325
38332
|
additionalProperties: true
|
|
38326
38333
|
description: |
|
|
38327
|
-
Meta only. A raw Meta-native targeting spec
|
|
38328
|
-
`
|
|
38329
|
-
business places, etc.) — exactly the shape `GET /v1/ads/{adId}` returns for
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
|
|
38334
|
+
Meta only. A raw Meta-native targeting spec (snake_case: `geo_locations`, `age_min`,
|
|
38335
|
+
`excluded_custom_audiences`, `flexible_spec`, `targeting_automation`, `user_os`,
|
|
38336
|
+
`wireless_carrier`, business places, etc.) — exactly the shape `GET /v1/ads/{adId}` returns for
|
|
38337
|
+
external ads. Sent alone it reaches the ad set VERBATIM (the clone-a-campaign's-targeting-exactly
|
|
38338
|
+
path). Meta validates and surfaces any errors.
|
|
38339
|
+
|
|
38340
|
+
Can be combined with the camelCase targeting fields (countries/regions/cities/interests/ageMin/...,
|
|
38341
|
+
`targeting`, `savedTargetingId`, `audienceId`): rawTargeting is the BASE layer and the built
|
|
38342
|
+
camelCase spec is merged on top, key by key, with the camelCase side winning on collision (the
|
|
38343
|
+
camelCase precedence chain stays `savedTargetingId` < `targeting` < flat fields). The merge goes
|
|
38344
|
+
one level deep inside `geo_locations` and `excluded_geo_locations`: built sub-keys win, raw-only
|
|
38345
|
+
sub-keys such as `location_types` survive alongside built `countries`. Array values
|
|
38346
|
+
(`flexible_spec`, ...) are replaced as a WHOLE key when the camelCase spec builds them, never
|
|
38347
|
+
element-merged. When rawTargeting is present the defaults the camelCase builder normally injects
|
|
38348
|
+
(US geo, `targeting_automation.advantage_audience: 0`) are suppressed, so raw's values are not
|
|
38349
|
+
clobbered — include `targeting_automation` in the raw spec (or send `advantageAudience`) as Meta
|
|
38350
|
+
requires it on create. If cloning an EU campaign, also pass `dsaBeneficiary` / `dsaPayor` (those
|
|
38351
|
+
are separate fields, not part of targeting).
|
|
38335
38352
|
specialAdCategories:
|
|
38336
38353
|
type: array
|
|
38337
38354
|
description: |
|
|
@@ -38369,16 +38386,22 @@ paths:
|
|
|
38369
38386
|
optimises them into the best-performing variations within a single ad (mapped to the
|
|
38370
38387
|
creative's `asset_feed_spec`). When set, the top-level single-creative fields
|
|
38371
38388
|
(`imageUrl`, `headline`, `body`, `linkUrl`, `callToAction`) are ignored. Mutually
|
|
38372
|
-
exclusive with the `creatives[]` multi-creative shape.
|
|
38373
|
-
|
|
38374
|
-
|
|
38389
|
+
exclusive with the `creatives[]` multi-creative shape. Exactly ONE of `imageUrls` /
|
|
38390
|
+
`videoUrls` is required (Meta allows one ad format per asset feed; sending both →
|
|
38391
|
+
400). Meta limits: ≤10 images or ≤10 videos, ≤5 bodies / titles / descriptions.
|
|
38375
38392
|
properties:
|
|
38376
38393
|
imageUrls:
|
|
38377
38394
|
type: array
|
|
38378
38395
|
minItems: 1
|
|
38379
38396
|
maxItems: 10
|
|
38380
38397
|
items: { type: string, format: uri }
|
|
38381
|
-
description: "Pool of image URLs (1-10). Uploaded to the ad account and referenced by hash in the asset feed."
|
|
38398
|
+
description: "Pool of image URLs (1-10). Uploaded to the ad account and referenced by hash in the asset feed. Mutually exclusive with `videoUrls`."
|
|
38399
|
+
videoUrls:
|
|
38400
|
+
type: array
|
|
38401
|
+
minItems: 1
|
|
38402
|
+
maxItems: 10
|
|
38403
|
+
items: { type: string, format: uri }
|
|
38404
|
+
description: "Pool of video URLs (1-10). Uploaded to the ad account and referenced by video id in the asset feed. No thumbnails are needed: Meta auto-generates a poster per video. Mutually exclusive with `imageUrls`; `adFormat` defaults to SINGLE_VIDEO."
|
|
38382
38405
|
bodies:
|
|
38383
38406
|
type: array
|
|
38384
38407
|
maxItems: 5
|
|
@@ -38404,9 +38427,8 @@ paths:
|
|
|
38404
38427
|
description: "CTA-button variations. Required."
|
|
38405
38428
|
adFormat:
|
|
38406
38429
|
type: string
|
|
38407
|
-
enum: [SINGLE_IMAGE, CAROUSEL_IMAGE]
|
|
38408
|
-
|
|
38409
|
-
description: "Asset-feed ad format. Defaults to SINGLE_IMAGE."
|
|
38430
|
+
enum: [SINGLE_IMAGE, CAROUSEL_IMAGE, SINGLE_VIDEO]
|
|
38431
|
+
description: "Asset-feed ad format. Must match the pool: SINGLE_IMAGE / CAROUSEL_IMAGE require `imageUrls`, SINGLE_VIDEO requires `videoUrls` (400 otherwise). Defaults to SINGLE_IMAGE with `imageUrls`, SINGLE_VIDEO with `videoUrls`."
|
|
38410
38432
|
carouselCards:
|
|
38411
38433
|
type: array
|
|
38412
38434
|
minItems: 2
|
|
@@ -33,6 +33,12 @@ describe Zernio::CreateStandaloneAdRequestDynamicCreative do
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
describe 'test attribute "video_urls"' 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
|
+
|
|
36
42
|
describe 'test attribute "bodies"' do
|
|
37
43
|
it 'should work' do
|
|
38
44
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -70,7 +76,7 @@ describe Zernio::CreateStandaloneAdRequestDynamicCreative do
|
|
|
70
76
|
describe 'test attribute "ad_format"' do
|
|
71
77
|
it 'should work' do
|
|
72
78
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
73
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["SINGLE_IMAGE", "CAROUSEL_IMAGE"])
|
|
79
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["SINGLE_IMAGE", "CAROUSEL_IMAGE", "SINGLE_VIDEO"])
|
|
74
80
|
# validator.allowable_values.each do |value|
|
|
75
81
|
# expect { instance.ad_format = value }.not_to raise_error
|
|
76
82
|
# end
|