late-sdk 0.0.897 → 0.0.899

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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/docs/AdCampaignsApi.md +11 -7
  4. data/docs/AdCreative.md +4 -0
  5. data/docs/AdCreativesApi.md +2 -2
  6. data/docs/BoostPostRequest.md +2 -0
  7. data/docs/CreateAdCreative201Response.md +5 -1
  8. data/docs/CreateAdCreativeRequest.md +4 -2
  9. data/docs/CreateCallAdRequest.md +2 -0
  10. data/docs/CreateMessagingAdRequest.md +2 -0
  11. data/docs/CreateStandaloneAdRequest.md +5 -3
  12. data/docs/CreateStandaloneAdRequestCreativesInner.md +4 -0
  13. data/docs/CreateStandaloneAdRequestPromotedObject.md +2 -2
  14. data/docs/CtwaAdRequestBody.md +2 -0
  15. data/docs/CtwaAdRequestBodyCreativesInner.md +2 -0
  16. data/docs/MetaPromotion.md +26 -0
  17. data/docs/MetaPromotionStatus.md +15 -0
  18. data/docs/UpdateAdRequestCreative.md +4 -0
  19. data/lib/zernio-sdk/api/ad_campaigns_api.rb +9 -6
  20. data/lib/zernio-sdk/api/ad_creatives_api.rb +4 -4
  21. data/lib/zernio-sdk/models/ad_creative.rb +42 -1
  22. data/lib/zernio-sdk/models/boost_post_request.rb +13 -1
  23. data/lib/zernio-sdk/models/create_ad_creative201_response.rb +44 -4
  24. data/lib/zernio-sdk/models/create_ad_creative_request.rb +11 -2
  25. data/lib/zernio-sdk/models/create_call_ad_request.rb +13 -1
  26. data/lib/zernio-sdk/models/create_messaging_ad_request.rb +13 -1
  27. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +12 -3
  28. data/lib/zernio-sdk/models/create_standalone_ad_request_creatives_inner.rb +23 -1
  29. data/lib/zernio-sdk/models/create_standalone_ad_request_dynamic_creative.rb +1 -1
  30. data/lib/zernio-sdk/models/create_standalone_ad_request_promoted_object.rb +2 -2
  31. data/lib/zernio-sdk/models/ctwa_ad_request_body.rb +13 -1
  32. data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner.rb +35 -1
  33. data/lib/zernio-sdk/models/meta_promotion.rb +275 -0
  34. data/lib/zernio-sdk/models/meta_promotion_status.rb +41 -0
  35. data/lib/zernio-sdk/models/update_ad_request_creative.rb +45 -2
  36. data/lib/zernio-sdk/version.rb +1 -1
  37. data/lib/zernio-sdk.rb +2 -0
  38. data/openapi.yaml +132 -13
  39. data/spec/api/ad_campaigns_api_spec.rb +4 -3
  40. data/spec/api/ad_creatives_api_spec.rb +2 -2
  41. data/spec/models/ad_creative_spec.rb +12 -0
  42. data/spec/models/boost_post_request_spec.rb +10 -0
  43. data/spec/models/create_ad_creative201_response_spec.rb +12 -0
  44. data/spec/models/create_ad_creative_request_spec.rb +6 -0
  45. data/spec/models/create_call_ad_request_spec.rb +10 -0
  46. data/spec/models/create_messaging_ad_request_spec.rb +10 -0
  47. data/spec/models/create_standalone_ad_request_creatives_inner_spec.rb +16 -0
  48. data/spec/models/create_standalone_ad_request_spec.rb +6 -0
  49. data/spec/models/ctwa_ad_request_body_creatives_inner_spec.rb +10 -0
  50. data/spec/models/ctwa_ad_request_body_spec.rb +10 -0
  51. data/spec/models/meta_promotion_spec.rb +64 -0
  52. data/spec/models/meta_promotion_status_spec.rb +30 -0
  53. data/spec/models/update_ad_request_creative_spec.rb +16 -0
  54. data/zernio-sdk-0.0.899.gem +0 -0
  55. metadata +10 -2
  56. data/zernio-sdk-0.0.897.gem +0 -0
@@ -28,6 +28,11 @@ module Zernio
28
28
  # Public Facebook watch URL for VIDEO-type ads (https://www.facebook.com/watch/?v={videoId}). Null for non-video ads.
29
29
  attr_accessor :video_url
30
30
 
31
+ # Meta offer read from the live creative on creation or GET /v1/ads/{adId}. Null when metadata is not returned or cannot be read. Requested values are never echoed as applied.
32
+ attr_accessor :promotion
33
+
34
+ attr_accessor :promotion_status
35
+
31
36
  # Meta ad creative id backing this ad. Reusable via existingCreativeId on POST /v1/ads/create.
32
37
  attr_accessor :creative_id
33
38
 
@@ -82,6 +87,28 @@ module Zernio
82
87
 
83
88
  attr_accessor :pinterest_description
84
89
 
90
+ class EnumAttributeValidator
91
+ attr_reader :datatype
92
+ attr_reader :allowable_values
93
+
94
+ def initialize(datatype, allowable_values)
95
+ @allowable_values = allowable_values.map do |value|
96
+ case datatype.to_s
97
+ when /Integer/i
98
+ value.to_i
99
+ when /Float/i
100
+ value.to_f
101
+ else
102
+ value
103
+ end
104
+ end
105
+ end
106
+
107
+ def valid?(value)
108
+ !value || allowable_values.include?(value)
109
+ end
110
+ end
111
+
85
112
  # Attribute mapping from ruby-style variable name to JSON key.
86
113
  def self.attribute_map
87
114
  {
@@ -89,6 +116,8 @@ module Zernio
89
116
  :'image_url' => :'imageUrl',
90
117
  :'video_id' => :'videoId',
91
118
  :'video_url' => :'videoUrl',
119
+ :'promotion' => :'promotion',
120
+ :'promotion_status' => :'promotionStatus',
92
121
  :'creative_id' => :'creativeId',
93
122
  :'object_type' => :'objectType',
94
123
  :'object_story_id' => :'objectStoryId',
@@ -128,6 +157,8 @@ module Zernio
128
157
  :'image_url' => :'String',
129
158
  :'video_id' => :'String',
130
159
  :'video_url' => :'String',
160
+ :'promotion' => :'MetaPromotion',
161
+ :'promotion_status' => :'MetaPromotionStatus',
131
162
  :'creative_id' => :'String',
132
163
  :'object_type' => :'String',
133
164
  :'object_story_id' => :'String',
@@ -199,6 +230,14 @@ module Zernio
199
230
  self.video_url = attributes[:'video_url']
200
231
  end
201
232
 
233
+ if attributes.key?(:'promotion')
234
+ self.promotion = attributes[:'promotion']
235
+ end
236
+
237
+ if attributes.key?(:'promotion_status')
238
+ self.promotion_status = attributes[:'promotion_status']
239
+ end
240
+
202
241
  if attributes.key?(:'creative_id')
203
242
  self.creative_id = attributes[:'creative_id']
204
243
  end
@@ -304,6 +343,8 @@ module Zernio
304
343
  image_url == o.image_url &&
305
344
  video_id == o.video_id &&
306
345
  video_url == o.video_url &&
346
+ promotion == o.promotion &&
347
+ promotion_status == o.promotion_status &&
307
348
  creative_id == o.creative_id &&
308
349
  object_type == o.object_type &&
309
350
  object_story_id == o.object_story_id &&
@@ -334,7 +375,7 @@ module Zernio
334
375
  # Calculates hash code according to all attributes.
335
376
  # @return [Integer] Hash code
336
377
  def hash
337
- [thumbnail_url, image_url, video_id, video_url, creative_id, object_type, object_story_id, effective_object_story_id, page_id, effective_instagram_media_id, instagram_user_id, instagram_permalink_url, media_urls, is_serving, serving_hold_reasons, body, google_headline, google_description, link_url, whatsapp_phone_number, pinterest_image_url, pinterest_title, pinterest_description].hash
378
+ [thumbnail_url, image_url, video_id, video_url, promotion, promotion_status, creative_id, object_type, object_story_id, effective_object_story_id, page_id, effective_instagram_media_id, instagram_user_id, instagram_permalink_url, media_urls, is_serving, serving_hold_reasons, body, google_headline, google_description, link_url, whatsapp_phone_number, pinterest_image_url, pinterest_title, pinterest_description].hash
338
379
  end
339
380
 
340
381
  # Builds the object from hash
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module Zernio
17
17
  class BoostPostRequest < ApiModelBase
18
+ # Meta Advantage+ creative enhancements. Map snake_case feature names to OPT_IN or OPT_OUT; Meta validates supported keys and unspecified features default to OPT_OUT. auto_promotion_tag is an enhancement; use the separate promotion field for an explicit offer. The deprecated standard_enhancements bundle is rejected by Meta.
19
+ attr_accessor :creative_features
20
+
18
21
  # Zernio post ID (provide this or platformPostId)
19
22
  attr_accessor :post_id
20
23
 
@@ -130,6 +133,7 @@ module Zernio
130
133
  # Attribute mapping from ruby-style variable name to JSON key.
131
134
  def self.attribute_map
132
135
  {
136
+ :'creative_features' => :'creativeFeatures',
133
137
  :'post_id' => :'postId',
134
138
  :'platform_post_id' => :'platformPostId',
135
139
  :'account_id' => :'accountId',
@@ -178,6 +182,7 @@ module Zernio
178
182
  # Attribute type mapping.
179
183
  def self.openapi_types
180
184
  {
185
+ :'creative_features' => :'Hash<String, String>',
181
186
  :'post_id' => :'String',
182
187
  :'platform_post_id' => :'String',
183
188
  :'account_id' => :'String',
@@ -235,6 +240,12 @@ module Zernio
235
240
  h[k.to_sym] = v
236
241
  }
237
242
 
243
+ if attributes.key?(:'creative_features')
244
+ if (value = attributes[:'creative_features']).is_a?(Hash)
245
+ self.creative_features = value
246
+ end
247
+ end
248
+
238
249
  if attributes.key?(:'post_id')
239
250
  self.post_id = attributes[:'post_id']
240
251
  end
@@ -584,6 +595,7 @@ module Zernio
584
595
  def ==(o)
585
596
  return true if self.equal?(o)
586
597
  self.class == o.class &&
598
+ creative_features == o.creative_features &&
587
599
  post_id == o.post_id &&
588
600
  platform_post_id == o.platform_post_id &&
589
601
  account_id == o.account_id &&
@@ -627,7 +639,7 @@ module Zernio
627
639
  # Calculates hash code according to all attributes.
628
640
  # @return [Integer] Hash code
629
641
  def hash
630
- [post_id, platform_post_id, account_id, ad_account_id, name, goal, ad_set_id, budget, instagram_account_id, destination_type, whatsapp_phone_number, currency, schedule, targeting, raw_targeting, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, tracking, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, link_url, call_to_action, spark_auth_code, dsa_beneficiary, dsa_payor, lead_gen_form_id, status, optimization_goal].hash
642
+ [creative_features, post_id, platform_post_id, account_id, ad_account_id, name, goal, ad_set_id, budget, instagram_account_id, destination_type, whatsapp_phone_number, currency, schedule, targeting, raw_targeting, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, tracking, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, link_url, call_to_action, spark_auth_code, dsa_beneficiary, dsa_payor, lead_gen_form_id, status, optimization_goal].hash
631
643
  end
632
644
 
633
645
  # Builds the object from hash
@@ -20,11 +20,39 @@ module Zernio
20
20
  # Platform creative id, reusable via existingCreativeId.
21
21
  attr_accessor :creative_id
22
22
 
23
+ attr_accessor :promotion
24
+
25
+ attr_accessor :promotion_status
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
23
49
  # Attribute mapping from ruby-style variable name to JSON key.
24
50
  def self.attribute_map
25
51
  {
26
52
  :'ad_account_id' => :'adAccountId',
27
- :'creative_id' => :'creativeId'
53
+ :'creative_id' => :'creativeId',
54
+ :'promotion' => :'promotion',
55
+ :'promotion_status' => :'promotionStatus'
28
56
  }
29
57
  end
30
58
 
@@ -42,7 +70,9 @@ module Zernio
42
70
  def self.openapi_types
43
71
  {
44
72
  :'ad_account_id' => :'String',
45
- :'creative_id' => :'String'
73
+ :'creative_id' => :'String',
74
+ :'promotion' => :'MetaPromotion',
75
+ :'promotion_status' => :'MetaPromotionStatus'
46
76
  }
47
77
  end
48
78
 
@@ -75,6 +105,14 @@ module Zernio
75
105
  if attributes.key?(:'creative_id')
76
106
  self.creative_id = attributes[:'creative_id']
77
107
  end
108
+
109
+ if attributes.key?(:'promotion')
110
+ self.promotion = attributes[:'promotion']
111
+ end
112
+
113
+ if attributes.key?(:'promotion_status')
114
+ self.promotion_status = attributes[:'promotion_status']
115
+ end
78
116
  end
79
117
 
80
118
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -98,7 +136,9 @@ module Zernio
98
136
  return true if self.equal?(o)
99
137
  self.class == o.class &&
100
138
  ad_account_id == o.ad_account_id &&
101
- creative_id == o.creative_id
139
+ creative_id == o.creative_id &&
140
+ promotion == o.promotion &&
141
+ promotion_status == o.promotion_status
102
142
  end
103
143
 
104
144
  # @see the `==` method
@@ -110,7 +150,7 @@ module Zernio
110
150
  # Calculates hash code according to all attributes.
111
151
  # @return [Integer] Hash code
112
152
  def hash
113
- [ad_account_id, creative_id].hash
153
+ [ad_account_id, creative_id, promotion, promotion_status].hash
114
154
  end
115
155
 
116
156
  # Builds the object from hash
@@ -45,7 +45,9 @@ module Zernio
45
45
  # Appended to every outbound URL (e.g. utm_source=fb).
46
46
  attr_accessor :url_tags
47
47
 
48
- # Advantage+ creative enhancements: partial map of Meta creative feature keys (snake_case) to enroll status, forwarded as degrees_of_freedom_spec.creative_features_spec. Unspecified features default to OPT_OUT.
48
+ attr_accessor :promotion
49
+
50
+ # 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.
49
51
  attr_accessor :creative_features
50
52
 
51
53
  # 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.
@@ -87,6 +89,7 @@ module Zernio
87
89
  :'image_hash' => :'imageHash',
88
90
  :'carousel_cards' => :'carouselCards',
89
91
  :'url_tags' => :'urlTags',
92
+ :'promotion' => :'promotion',
90
93
  :'creative_features' => :'creativeFeatures',
91
94
  :'multi_advertiser' => :'multiAdvertiser'
92
95
  }
@@ -116,6 +119,7 @@ module Zernio
116
119
  :'image_hash' => :'String',
117
120
  :'carousel_cards' => :'Array<CreateAdCreativeRequestCarouselCardsInner>',
118
121
  :'url_tags' => :'String',
122
+ :'promotion' => :'MetaPromotion',
119
123
  :'creative_features' => :'Hash<String, String>',
120
124
  :'multi_advertiser' => :'String'
121
125
  }
@@ -201,6 +205,10 @@ module Zernio
201
205
  self.url_tags = attributes[:'url_tags']
202
206
  end
203
207
 
208
+ if attributes.key?(:'promotion')
209
+ self.promotion = attributes[:'promotion']
210
+ end
211
+
204
212
  if attributes.key?(:'creative_features')
205
213
  if (value = attributes[:'creative_features']).is_a?(Hash)
206
214
  self.creative_features = value
@@ -386,6 +394,7 @@ module Zernio
386
394
  image_hash == o.image_hash &&
387
395
  carousel_cards == o.carousel_cards &&
388
396
  url_tags == o.url_tags &&
397
+ promotion == o.promotion &&
389
398
  creative_features == o.creative_features &&
390
399
  multi_advertiser == o.multi_advertiser
391
400
  end
@@ -399,7 +408,7 @@ module Zernio
399
408
  # Calculates hash code according to all attributes.
400
409
  # @return [Integer] Hash code
401
410
  def hash
402
- [account_id, ad_account_id, headline, body, description, call_to_action, link_url, image_url, image_hash, carousel_cards, url_tags, creative_features, multi_advertiser].hash
411
+ [account_id, ad_account_id, headline, body, description, call_to_action, link_url, image_url, image_hash, carousel_cards, url_tags, promotion, creative_features, multi_advertiser].hash
403
412
  end
404
413
 
405
414
  # Builds the object from hash
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module Zernio
17
17
  class CreateCallAdRequest < ApiModelBase
18
+ # Meta enhancement settings for single or attached ads, and defaults for creatives[]. An item replaces the entire map, including with an empty object.
19
+ attr_accessor :creative_features
20
+
18
21
  # Facebook or Instagram SocialAccount ID.
19
22
  attr_accessor :account_id
20
23
 
@@ -157,6 +160,7 @@ module Zernio
157
160
  # Attribute mapping from ruby-style variable name to JSON key.
158
161
  def self.attribute_map
159
162
  {
163
+ :'creative_features' => :'creativeFeatures',
160
164
  :'account_id' => :'accountId',
161
165
  :'ad_account_id' => :'adAccountId',
162
166
  :'name' => :'name',
@@ -214,6 +218,7 @@ module Zernio
214
218
  # Attribute type mapping.
215
219
  def self.openapi_types
216
220
  {
221
+ :'creative_features' => :'Hash<String, String>',
217
222
  :'account_id' => :'String',
218
223
  :'ad_account_id' => :'String',
219
224
  :'name' => :'String',
@@ -287,6 +292,12 @@ module Zernio
287
292
  h[k.to_sym] = v
288
293
  }
289
294
 
295
+ if attributes.key?(:'creative_features')
296
+ if (value = attributes[:'creative_features']).is_a?(Hash)
297
+ self.creative_features = value
298
+ end
299
+ end
300
+
290
301
  if attributes.key?(:'account_id')
291
302
  self.account_id = attributes[:'account_id']
292
303
  else
@@ -925,6 +936,7 @@ module Zernio
925
936
  def ==(o)
926
937
  return true if self.equal?(o)
927
938
  self.class == o.class &&
939
+ creative_features == o.creative_features &&
928
940
  account_id == o.account_id &&
929
941
  ad_account_id == o.ad_account_id &&
930
942
  name == o.name &&
@@ -977,7 +989,7 @@ module Zernio
977
989
  # Calculates hash code according to all attributes.
978
990
  # @return [Integer] Hash code
979
991
  def hash
980
- [account_id, ad_account_id, name, existing_post_id, object_story_id, whatsapp_phone_number, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, regional_regulated_categories, regional_regulation_identities, phone_number, link_url].hash
992
+ [creative_features, account_id, ad_account_id, name, existing_post_id, object_story_id, whatsapp_phone_number, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, regional_regulated_categories, regional_regulation_identities, phone_number, link_url].hash
981
993
  end
982
994
 
983
995
  # Builds the object from hash
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module Zernio
17
17
  class CreateMessagingAdRequest < ApiModelBase
18
+ # Meta enhancement settings for single or attached ads, and defaults for creatives[]. An item replaces the entire map, including with an empty object.
19
+ attr_accessor :creative_features
20
+
18
21
  # Facebook or Instagram SocialAccount ID.
19
22
  attr_accessor :account_id
20
23
 
@@ -154,6 +157,7 @@ module Zernio
154
157
  # Attribute mapping from ruby-style variable name to JSON key.
155
158
  def self.attribute_map
156
159
  {
160
+ :'creative_features' => :'creativeFeatures',
157
161
  :'account_id' => :'accountId',
158
162
  :'ad_account_id' => :'adAccountId',
159
163
  :'name' => :'name',
@@ -210,6 +214,7 @@ module Zernio
210
214
  # Attribute type mapping.
211
215
  def self.openapi_types
212
216
  {
217
+ :'creative_features' => :'Hash<String, String>',
213
218
  :'account_id' => :'String',
214
219
  :'ad_account_id' => :'String',
215
220
  :'name' => :'String',
@@ -282,6 +287,12 @@ module Zernio
282
287
  h[k.to_sym] = v
283
288
  }
284
289
 
290
+ if attributes.key?(:'creative_features')
291
+ if (value = attributes[:'creative_features']).is_a?(Hash)
292
+ self.creative_features = value
293
+ end
294
+ end
295
+
285
296
  if attributes.key?(:'account_id')
286
297
  self.account_id = attributes[:'account_id']
287
298
  else
@@ -901,6 +912,7 @@ module Zernio
901
912
  def ==(o)
902
913
  return true if self.equal?(o)
903
914
  self.class == o.class &&
915
+ creative_features == o.creative_features &&
904
916
  account_id == o.account_id &&
905
917
  ad_account_id == o.ad_account_id &&
906
918
  name == o.name &&
@@ -952,7 +964,7 @@ module Zernio
952
964
  # Calculates hash code according to all attributes.
953
965
  # @return [Integer] Hash code
954
966
  def hash
955
- [account_id, ad_account_id, name, existing_post_id, object_story_id, whatsapp_phone_number, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, regional_regulated_categories, regional_regulation_identities, destination].hash
967
+ [creative_features, account_id, ad_account_id, name, existing_post_id, object_story_id, whatsapp_phone_number, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, regional_regulated_categories, regional_regulation_identities, destination].hash
956
968
  end
957
969
 
958
970
  # Builds the object from hash
@@ -47,7 +47,9 @@ module Zernio
47
47
  # Meta only. The RESERVED prediction id the R&F ad set runs on (reserving mints a new id, so pass that one). Requires buyingType RESERVED.
48
48
  attr_accessor :rf_prediction_id
49
49
 
50
- # Meta only. Advantage+ creative enhancements: a partial map of Meta creative feature keys (snake_case, e.g. enhance_cta, image_brightness_and_contrast, text_optimizations) to enroll status, forwarded as degrees_of_freedom_spec.creative_features_spec. Meta validates the keys; unspecified features default to OPT_OUT. The legacy standard_enhancements bundle is deprecated by Meta and rejected.
50
+ attr_accessor :promotion
51
+
52
+ # 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.
51
53
  attr_accessor :creative_features
52
54
 
53
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.
@@ -114,7 +116,7 @@ module Zernio
114
116
  # Meta-only. When present, switches to the multi-creative shape: creates 1 campaign + 1 ad set + N ads (one per entry here). Top-level `headline` / `body` / `imageUrl` / `linkUrl` / `callToAction` are ignored in this mode. Mutually exclusive with `adSetId`.
115
117
  attr_accessor :creatives
116
118
 
117
- # When present, switches to the attach shape: adds one new ad to this existing ad set without creating a new campaign. Budget, targeting, goal, schedule, AND bid strategy are inherited from the ad set on Meta, and passing `bidStrategy` in attach mode returns 400. To change an existing ad set's bid, use `PUT /v1/ads/ad-sets/{adSetId}`. Mutually exclusive with `creatives[]`. The attached ad takes the full single-creative surface: `headline`/`body`/`description`/`callToAction` plus either `imageUrl`/`video` OR `placementAssets` (its own per-placement Feed/Story assets) OR `translations`/`defaultLocale` (its own per-locale asset feed, Meta only), and `leadGenFormId` when the target is a lead ad set (the parent must be ON_AD, true for ad sets created via goal `lead_generation`; Meta rejects a formless ad there, so pass the form on EVERY attached ad). This is the way to build N full ads sharing one ad set: create the first ad via the normal shape, then attach the rest one call each. Supported on Meta (facebook, instagram), Google Ads, TikTok, and LinkedIn. On TikTok the `adSetId` is the ad group ID; the new ad inherits the ad group's bid + budget + targeting. On LinkedIn the `adSetId` is the LinkedIn Campaign ID (numeric); we attach a new Creative to that Campaign, so the Campaign's `platformSpecificData` bidding, targeting, budget and schedule are inherited (passing those fields returns 400). On Google Ads the `adSetId` is the AD GROUP id. `goal` is still REQUIRED even though budget and targeting are inherited from the ad group. Send `campaignType: \"search\"` to attach into a Search ad group, including one created by `POST /v1/ads/ad-sets` (always SEARCH_STANDARD): without it the request is treated as Display and requires `images.landscape` + `images.square` + `businessName`, and the resulting display creative does not match a Search ad group. `budgetAmount`/`budgetType` and bidding fields (`bidStrategy`, `bidAmount`, `portfolioBidStrategyId`) return 400 on this shape; the ad group already owns them.
119
+ # When present, switches to the attach shape: adds one new ad to this existing ad set without creating a new campaign. Budget, targeting, goal, schedule, AND bid strategy are inherited from the ad set on Meta, and passing `bidStrategy` in attach mode returns 400. To change an existing ad set's bid, use `PUT /v1/ads/ad-sets/{adSetId}`. Mutually exclusive with `creatives[]`. `dynamicCreative` returns 400 in attach mode: create a new dynamic ad set by omitting `adSetId` instead. The attached ad takes the full single-creative surface: `headline`/`body`/`description`/`callToAction` plus either `imageUrl`/`video` OR `placementAssets` (its own per-placement Feed/Story assets) OR `translations`/`defaultLocale` (its own per-locale asset feed, Meta only), and `leadGenFormId` when the target is a lead ad set (the parent must be ON_AD, true for ad sets created via goal `lead_generation`; Meta rejects a formless ad there, so pass the form on EVERY attached ad). This is the way to build N full ads sharing one ad set: create the first ad via the normal shape, then attach the rest one call each. Supported on Meta (facebook, instagram), Google Ads, TikTok, and LinkedIn. On TikTok the `adSetId` is the ad group ID; the new ad inherits the ad group's bid + budget + targeting. On LinkedIn the `adSetId` is the LinkedIn Campaign ID (numeric); we attach a new Creative to that Campaign, so the Campaign's `platformSpecificData` bidding, targeting, budget and schedule are inherited (passing those fields returns 400). On Google Ads the `adSetId` is the AD GROUP id. `goal` is still REQUIRED even though budget and targeting are inherited from the ad group. Send `campaignType: \"search\"` to attach into a Search ad group, including one created by `POST /v1/ads/ad-sets` (always SEARCH_STANDARD): without it the request is treated as Display and requires `images.landscape` + `images.square` + `businessName`, and the resulting display creative does not match a Search ad group. `budgetAmount`/`budgetType` and bidding fields (`bidStrategy`, `bidAmount`, `portfolioBidStrategyId`) return 400 on this shape; the ad group already owns them.
118
120
  attr_accessor :ad_set_id
119
121
 
120
122
  # Meta, Google Ads, and LinkedIn. On Meta: add the new ad set under this EXISTING campaign instead of creating a new one (multi-ad-set audience testing). The new ad set's budget is matched to the campaign's mode automatically: for a CBO campaign (campaign-level budget) omit `budgetAmount`/`budgetType`, since the campaign owns the budget; for an ABO campaign pass them (they go on the new ad set). On LinkedIn: create a new Campaign (and its Creative) under this EXISTING CampaignGroup. On Google Ads: create a new ad group under this EXISTING campaign; the new ad group inherits the campaign's budget, so omit `budgetAmount`/`budgetType` (and any bidding field), or the request returns 400. On failure only the entities we authored are cleaned up; the pre-existing parent is left untouched and is never (re)activated. Mutually exclusive with `adSetId` and `creatives[]`.
@@ -332,6 +334,7 @@ module Zernio
332
334
  :'billing_event' => :'billingEvent',
333
335
  :'buying_type' => :'buyingType',
334
336
  :'rf_prediction_id' => :'rfPredictionId',
337
+ :'promotion' => :'promotion',
335
338
  :'creative_features' => :'creativeFeatures',
336
339
  :'multi_advertiser' => :'multiAdvertiser',
337
340
  :'validate_only' => :'validateOnly',
@@ -446,6 +449,7 @@ module Zernio
446
449
  :'billing_event' => :'String',
447
450
  :'buying_type' => :'String',
448
451
  :'rf_prediction_id' => :'String',
452
+ :'promotion' => :'MetaPromotion',
449
453
  :'creative_features' => :'Hash<String, String>',
450
454
  :'multi_advertiser' => :'String',
451
455
  :'validate_only' => :'Boolean',
@@ -611,6 +615,10 @@ module Zernio
611
615
  self.rf_prediction_id = attributes[:'rf_prediction_id']
612
616
  end
613
617
 
618
+ if attributes.key?(:'promotion')
619
+ self.promotion = attributes[:'promotion']
620
+ end
621
+
614
622
  if attributes.key?(:'creative_features')
615
623
  if (value = attributes[:'creative_features']).is_a?(Hash)
616
624
  self.creative_features = value
@@ -1876,6 +1884,7 @@ module Zernio
1876
1884
  billing_event == o.billing_event &&
1877
1885
  buying_type == o.buying_type &&
1878
1886
  rf_prediction_id == o.rf_prediction_id &&
1887
+ promotion == o.promotion &&
1879
1888
  creative_features == o.creative_features &&
1880
1889
  multi_advertiser == o.multi_advertiser &&
1881
1890
  validate_only == o.validate_only &&
@@ -1973,7 +1982,7 @@ module Zernio
1973
1982
  # Calculates hash code according to all attributes.
1974
1983
  # @return [Integer] Hash code
1975
1984
  def hash
1976
- [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, multi_advertiser, validate_only, budget_amount, budget_type, status, campaign_status, budget_level, currency, headline, long_headline, body, description, bodies, headlines, descriptions, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, work_positions, work_employers, work_industries, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, negative_keywords, campaign_negative_keywords, additional_headlines, additional_descriptions, sitelinks, callouts, structured_snippets, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, portfolio_bid_strategy_id, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, smart_plus, promoted_object].hash
1985
+ [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, promotion, creative_features, multi_advertiser, validate_only, budget_amount, budget_type, status, campaign_status, budget_level, currency, headline, long_headline, body, description, bodies, headlines, descriptions, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, work_positions, work_employers, work_industries, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, negative_keywords, campaign_negative_keywords, additional_headlines, additional_descriptions, sitelinks, callouts, structured_snippets, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, portfolio_bid_strategy_id, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, smart_plus, promoted_object].hash
1977
1986
  end
1978
1987
 
1979
1988
  # Builds the object from hash
@@ -16,6 +16,12 @@ require 'time'
16
16
  module Zernio
17
17
  # Each creative must supply EXACTLY ONE of `imageUrl` (image creative) or `video` (video creative).
18
18
  class CreateStandaloneAdRequestCreativesInner < ApiModelBase
19
+ # Overrides the top-level offer for this item. Omit to inherit; null disables the inherited offer.
20
+ attr_accessor :promotion
21
+
22
+ # Replaces the entire top-level creativeFeatures map for this item. Omit to inherit; an empty map clears these defaults.
23
+ attr_accessor :creative_features
24
+
19
25
  # Exact name for this ad. Falls back to `<name> #N` (N = 1-based position).
20
26
  attr_accessor :name
21
27
 
@@ -60,6 +66,8 @@ module Zernio
60
66
  # Attribute mapping from ruby-style variable name to JSON key.
61
67
  def self.attribute_map
62
68
  {
69
+ :'promotion' => :'promotion',
70
+ :'creative_features' => :'creativeFeatures',
63
71
  :'name' => :'name',
64
72
  :'headline' => :'headline',
65
73
  :'body' => :'body',
@@ -84,6 +92,8 @@ module Zernio
84
92
  # Attribute type mapping.
85
93
  def self.openapi_types
86
94
  {
95
+ :'promotion' => :'MetaPromotion',
96
+ :'creative_features' => :'Hash<String, String>',
87
97
  :'name' => :'String',
88
98
  :'headline' => :'String',
89
99
  :'body' => :'String',
@@ -117,6 +127,16 @@ module Zernio
117
127
  h[k.to_sym] = v
118
128
  }
119
129
 
130
+ if attributes.key?(:'promotion')
131
+ self.promotion = attributes[:'promotion']
132
+ end
133
+
134
+ if attributes.key?(:'creative_features')
135
+ if (value = attributes[:'creative_features']).is_a?(Hash)
136
+ self.creative_features = value
137
+ end
138
+ end
139
+
120
140
  if attributes.key?(:'name')
121
141
  self.name = attributes[:'name']
122
142
  end
@@ -287,6 +307,8 @@ module Zernio
287
307
  def ==(o)
288
308
  return true if self.equal?(o)
289
309
  self.class == o.class &&
310
+ promotion == o.promotion &&
311
+ creative_features == o.creative_features &&
290
312
  name == o.name &&
291
313
  headline == o.headline &&
292
314
  body == o.body &&
@@ -306,7 +328,7 @@ module Zernio
306
328
  # Calculates hash code according to all attributes.
307
329
  # @return [Integer] Hash code
308
330
  def hash
309
- [name, headline, body, description, image_url, video, link_url, call_to_action].hash
331
+ [promotion, creative_features, name, headline, body, description, image_url, video, link_url, call_to_action].hash
310
332
  end
311
333
 
312
334
  # Builds the object from hash
@@ -14,7 +14,7 @@ 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. 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.
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). Limits remain 10 images or videos and 5 bodies, titles or descriptions. The ad set is created with `is_dynamic_creative: true`. Combining this field with `adSetId` returns 400: omit `adSetId` to create a new dynamic ad set. Multiple headlines go in `titles`; multiple primary texts go in `bodies`.
18
18
  class CreateStandaloneAdRequestDynamicCreative < ApiModelBase
19
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
@@ -37,10 +37,10 @@ module Zernio
37
37
  # Custom Conversion ID, when optimising against one instead of a standard event. Accepted alone by this API, without `pixelId` or `customEventType`. If `pixelId` is also sent, `customEventType` is still required on the promoted_object (Meta rejects `pixel_id` without `custom_event_type`, error_subcode 1885014).
38
38
  attr_accessor :custom_conversion_id
39
39
 
40
- # Catalog ID for catalog/Advantage+ Shopping campaigns.
40
+ # Optional catalog ID. If supplied with productSetId, the set must belong to this catalog. A catalog ID cannot replace productSetId.
41
41
  attr_accessor :product_catalog_id
42
42
 
43
- # Product Set ID inside the catalog.
43
+ # Meta product SET ID from GET /v1/ads/catalogs/{catalogId}/product-sets. Zernio checks that the token can read the set and its product_catalog before creation. A catalog ID or inaccessible set returns a precise 400 naming promotedObject.productSetId. A mismatch with productCatalogId names promotedObject.productCatalogId.
44
44
  attr_accessor :product_set_id
45
45
 
46
46
  # Meta only. Offline event set (dataset) to optimise toward. Post-merger these are datasets: the id is the dataset id (for pixel-backed datasets, the pixel id).
@@ -16,6 +16,9 @@ require 'time'
16
16
  module Zernio
17
17
  # In addition to the `required` list, the request must use EXACTLY ONE of the two shapes: - Single-creative: `headline`, `body`, and one of `imageUrl` / `video`, OR `existingPostId` / `objectStoryId` to reuse an organic post. - Multi-creative: a non-empty `creatives[]` array. Top-level creative fields must NOT be set on this shape. Existing post references work on messaging and CTWA only (not call ads). They cannot be combined with each other or with headline, body, imageUrl, video, or welcomeMessage. No media is uploaded and the organic post is retained. Fresh creatives still require headline, body, and image or video. The route enforces this at the Zod boundary; OpenAPI's `required` cannot express the OR cleanly.
18
18
  class CtwaAdRequestBody < ApiModelBase
19
+ # Meta enhancement settings for single or attached ads, and defaults for creatives[]. An item replaces the entire map, including with an empty object.
20
+ attr_accessor :creative_features
21
+
19
22
  # Facebook or Instagram SocialAccount ID.
20
23
  attr_accessor :account_id
21
24
 
@@ -152,6 +155,7 @@ module Zernio
152
155
  # Attribute mapping from ruby-style variable name to JSON key.
153
156
  def self.attribute_map
154
157
  {
158
+ :'creative_features' => :'creativeFeatures',
155
159
  :'account_id' => :'accountId',
156
160
  :'ad_account_id' => :'adAccountId',
157
161
  :'name' => :'name',
@@ -207,6 +211,7 @@ module Zernio
207
211
  # Attribute type mapping.
208
212
  def self.openapi_types
209
213
  {
214
+ :'creative_features' => :'Hash<String, String>',
210
215
  :'account_id' => :'String',
211
216
  :'ad_account_id' => :'String',
212
217
  :'name' => :'String',
@@ -271,6 +276,12 @@ module Zernio
271
276
  h[k.to_sym] = v
272
277
  }
273
278
 
279
+ if attributes.key?(:'creative_features')
280
+ if (value = attributes[:'creative_features']).is_a?(Hash)
281
+ self.creative_features = value
282
+ end
283
+ end
284
+
274
285
  if attributes.key?(:'account_id')
275
286
  self.account_id = attributes[:'account_id']
276
287
  else
@@ -867,6 +878,7 @@ module Zernio
867
878
  def ==(o)
868
879
  return true if self.equal?(o)
869
880
  self.class == o.class &&
881
+ creative_features == o.creative_features &&
870
882
  account_id == o.account_id &&
871
883
  ad_account_id == o.ad_account_id &&
872
884
  name == o.name &&
@@ -917,7 +929,7 @@ module Zernio
917
929
  # Calculates hash code according to all attributes.
918
930
  # @return [Integer] Hash code
919
931
  def hash
920
- [account_id, ad_account_id, name, existing_post_id, object_story_id, whatsapp_phone_number, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, regional_regulated_categories, regional_regulation_identities].hash
932
+ [creative_features, account_id, ad_account_id, name, existing_post_id, object_story_id, whatsapp_phone_number, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, regional_regulated_categories, regional_regulation_identities].hash
921
933
  end
922
934
 
923
935
  # Builds the object from hash