late-sdk 0.0.896 → 0.0.898

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 +12 -8
  4. data/docs/AdCreative.md +6 -0
  5. data/docs/AdCreativesApi.md +2 -2
  6. data/docs/BoostPostRequest.md +5 -3
  7. data/docs/CreateAdCreative201Response.md +5 -1
  8. data/docs/CreateAdCreativeRequest.md +4 -2
  9. data/docs/CreateCallAdRequest.md +3 -1
  10. data/docs/CreateMessagingAdRequest.md +3 -1
  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 +3 -1
  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 +11 -8
  20. data/lib/zernio-sdk/api/ad_creatives_api.rb +4 -4
  21. data/lib/zernio-sdk/models/ad_creative.rb +52 -1
  22. data/lib/zernio-sdk/models/boost_post_request.rb +16 -4
  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 +14 -2
  26. data/lib/zernio-sdk/models/create_messaging_ad_request.rb +14 -2
  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 +14 -2
  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 +141 -18
  39. data/spec/api/ad_campaigns_api_spec.rb +5 -4
  40. data/spec/api/ad_creatives_api_spec.rb +2 -2
  41. data/spec/models/ad_creative_spec.rb +18 -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.898.gem +0 -0
  55. metadata +10 -2
  56. data/zernio-sdk-0.0.896.gem +0 -0
@@ -162,7 +162,7 @@ module Zernio
162
162
  end
163
163
 
164
164
  # Boost post as ad
165
- # Creates a paid ad from an existing published post, keeping the post's engagement. By default it provisions the whole hierarchy (campaign, ad set, ad). **Attach shape (Meta).** Send `adSetId` to put the ad under an EXISTING ad set instead, so that ad set keeps its learning phase. It then owns `budget`, `schedule` and `targeting`, and sending any of those alongside `adSetId` is a 400 rather than a silent drop. `budget` is required only without `adSetId`. `instagramAccountId`, `destinationType`, `whatsappPhoneNumber` and `adSetId` are Meta-only and return 400 on other platforms. **Messaging boosts (Meta).** Use `goal: engagement` with `callToAction: WHATSAPP_MESSAGE`, `MESSAGE_PAGE`, or `INSTAGRAM_MESSAGE`. The CTA implies WHATSAPP, MESSENGER, or INSTAGRAM_DIRECT respectively; `destinationType` alone also selects the matching CTA. Omit `linkUrl`. The campaign uses OUTCOME_ENGAGEMENT and the ad set uses CONVERSATIONS with the promoted Page. Optional `whatsappPhoneNumber` selects a number already paired with that Page. Conflicting CTA/destination, instant form, goal, or optimizationGoal inputs return 400. Attach requires the target ad set destination to match. Existing post references preserve social proof; an Instagram reel rejected by Meta is not re-uploaded as a new post for a messaging boost. **Retries.** Boosts are NOT idempotent and can take minutes when Meta requires re-hosting an Instagram video, so do not retry on client timeout. Send an Idempotency-Key header to make retries safe: same key and body replays the original 201, and distinct keys always create distinct ads. Without the header, an identical request is treated as a retry: while one is in flight it returns 409, and within 10 minutes of a completed boost it returns the already-created ad instead of creating another. To intentionally duplicate an ad, send distinct Idempotency-Keys (or vary the body, e.g. the name).
165
+ # Creates a paid ad from an existing published post, keeping the post's engagement. By default it provisions the whole hierarchy (campaign, ad set, ad). **Attach shape (Meta).** Send `adSetId` to put the ad under an EXISTING ad set instead, so that ad set keeps its learning phase. It then owns `budget`, `schedule` and `targeting`, and sending any of those alongside `adSetId` is a 400 rather than a silent drop. `budget` is required only without `adSetId`. `instagramAccountId`, `destinationType`, `whatsappPhoneNumber` and `adSetId` are Meta-only and return 400 on other platforms. **Messaging boosts (Meta).** Use `goal: engagement` with `callToAction: WHATSAPP_MESSAGE`, `MESSAGE_PAGE`, or `INSTAGRAM_MESSAGE`. The CTA implies WHATSAPP, MESSENGER, or INSTAGRAM_DIRECT respectively; `destinationType` alone does not select a messaging CTA. Omit `linkUrl` only for messaging CTAs. Plain link CTAs keep their goal and link behavior when combined with an independent `destinationType`. The campaign uses OUTCOME_ENGAGEMENT and the ad set uses CONVERSATIONS with the promoted Page. Optional `whatsappPhoneNumber` selects a number already paired with that Page. Conflicting CTA/destination, instant form, goal, or optimizationGoal inputs return 400. Attach requires the target ad set destination to match. Existing post references preserve social proof; an Instagram reel rejected by Meta is not re-uploaded as a new post for a messaging boost. **Retries.** Boosts are NOT idempotent and can take minutes when Meta requires re-hosting an Instagram video, so do not retry on client timeout. Send an Idempotency-Key header to make retries safe: same key and body replays the original 201, and distinct keys always create distinct ads. Without the header, an identical request is treated as a retry: while one is in flight it returns 409, and within 10 minutes of a completed boost it returns the already-created ad instead of creating another. To intentionally duplicate an ad, send distinct Idempotency-Keys (or vary the body, e.g. the name).
166
166
  # @param boost_post_request [BoostPostRequest]
167
167
  # @param [Hash] opts the optional parameters
168
168
  # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
@@ -173,7 +173,7 @@ module Zernio
173
173
  end
174
174
 
175
175
  # Boost post as ad
176
- # Creates a paid ad from an existing published post, keeping the post's engagement. By default it provisions the whole hierarchy (campaign, ad set, ad). **Attach shape (Meta).** Send `adSetId` to put the ad under an EXISTING ad set instead, so that ad set keeps its learning phase. It then owns `budget`, `schedule` and `targeting`, and sending any of those alongside `adSetId` is a 400 rather than a silent drop. `budget` is required only without `adSetId`. `instagramAccountId`, `destinationType`, `whatsappPhoneNumber` and `adSetId` are Meta-only and return 400 on other platforms. **Messaging boosts (Meta).** Use `goal: engagement` with `callToAction: WHATSAPP_MESSAGE`, `MESSAGE_PAGE`, or `INSTAGRAM_MESSAGE`. The CTA implies WHATSAPP, MESSENGER, or INSTAGRAM_DIRECT respectively; `destinationType` alone also selects the matching CTA. Omit `linkUrl`. The campaign uses OUTCOME_ENGAGEMENT and the ad set uses CONVERSATIONS with the promoted Page. Optional `whatsappPhoneNumber` selects a number already paired with that Page. Conflicting CTA/destination, instant form, goal, or optimizationGoal inputs return 400. Attach requires the target ad set destination to match. Existing post references preserve social proof; an Instagram reel rejected by Meta is not re-uploaded as a new post for a messaging boost. **Retries.** Boosts are NOT idempotent and can take minutes when Meta requires re-hosting an Instagram video, so do not retry on client timeout. Send an Idempotency-Key header to make retries safe: same key and body replays the original 201, and distinct keys always create distinct ads. Without the header, an identical request is treated as a retry: while one is in flight it returns 409, and within 10 minutes of a completed boost it returns the already-created ad instead of creating another. To intentionally duplicate an ad, send distinct Idempotency-Keys (or vary the body, e.g. the name).
176
+ # Creates a paid ad from an existing published post, keeping the post's engagement. By default it provisions the whole hierarchy (campaign, ad set, ad). **Attach shape (Meta).** Send `adSetId` to put the ad under an EXISTING ad set instead, so that ad set keeps its learning phase. It then owns `budget`, `schedule` and `targeting`, and sending any of those alongside `adSetId` is a 400 rather than a silent drop. `budget` is required only without `adSetId`. `instagramAccountId`, `destinationType`, `whatsappPhoneNumber` and `adSetId` are Meta-only and return 400 on other platforms. **Messaging boosts (Meta).** Use `goal: engagement` with `callToAction: WHATSAPP_MESSAGE`, `MESSAGE_PAGE`, or `INSTAGRAM_MESSAGE`. The CTA implies WHATSAPP, MESSENGER, or INSTAGRAM_DIRECT respectively; `destinationType` alone does not select a messaging CTA. Omit `linkUrl` only for messaging CTAs. Plain link CTAs keep their goal and link behavior when combined with an independent `destinationType`. The campaign uses OUTCOME_ENGAGEMENT and the ad set uses CONVERSATIONS with the promoted Page. Optional `whatsappPhoneNumber` selects a number already paired with that Page. Conflicting CTA/destination, instant form, goal, or optimizationGoal inputs return 400. Attach requires the target ad set destination to match. Existing post references preserve social proof; an Instagram reel rejected by Meta is not re-uploaded as a new post for a messaging boost. **Retries.** Boosts are NOT idempotent and can take minutes when Meta requires re-hosting an Instagram video, so do not retry on client timeout. Send an Idempotency-Key header to make retries safe: same key and body replays the original 201, and distinct keys always create distinct ads. Without the header, an identical request is treated as a retry: while one is in flight it returns 409, and within 10 minutes of a completed boost it returns the already-created ad instead of creating another. To intentionally duplicate an ad, send distinct Idempotency-Keys (or vary the body, e.g. the name).
177
177
  # @param boost_post_request [BoostPostRequest]
178
178
  # @param [Hash] opts the optional parameters
179
179
  # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
@@ -523,7 +523,7 @@ module Zernio
523
523
  end
524
524
 
525
525
  # Create standalone ad
526
- # Create a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X, LinkedIn, and OpenAI Ads (ChatGPT Ads). Three mutually-exclusive request shapes are selected by the body: - Legacy single-creative shape (all platforms, the default). - Meta-only multi-creative shape via the creatives array: one ad set with N ads sharing budget and targeting. - Attach shape via adSetId: adds one new ad to an existing ad set, inheriting its budget, targeting, and schedule (Meta, Google Ads, TikTok, and LinkedIn). On LinkedIn adSetId is the existing Campaign id, and the budget, schedule, targeting and bidding fields must be omitted. Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content \"dark post\" authored by a Company Page (see `organizationId`). Supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
526
+ # Create a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X, LinkedIn, and OpenAI Ads (ChatGPT Ads). Three mutually-exclusive request shapes are selected by the body: - Legacy single-creative shape (all platforms, the default). - Meta-only multi-creative shape via the creatives array: one ad set with N ads sharing budget and targeting. - Attach shape via adSetId: adds one new ad to an existing ad set, inheriting its budget, targeting, and schedule (Meta, Google Ads, TikTok, and LinkedIn). On LinkedIn adSetId is the existing Campaign id, and the budget, schedule, targeting and bidding fields must be omitted. Meta accepts `promotion` and `creativeFeatures` on the single and attach shapes and as defaults for `creatives[]`. An item replaces the whole feature map; its `promotion` replaces the default offer, and `promotion: null` disables that default for the item. Reusing `existingCreativeId` uses the existing creative settings instead of new settings. Requested settings are persisted for lists, exports, and default ad-detail reads. Only ads supplied a `promotion` receive live readback; multi-create batches those reads in groups of up to 50 IDs without per-ad fallback. Inspect `ad.creative.promotionStatus` (or `ads[].creative.promotionStatus`). `not_returned` means Meta omitted the metadata; successful creation does not by itself prove the offer was applied or will display. Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content \"dark post\" authored by a Company Page (see `organizationId`). Supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
527
527
  # @param create_standalone_ad_request [CreateStandaloneAdRequest]
528
528
  # @param [Hash] opts the optional parameters
529
529
  # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
@@ -534,7 +534,7 @@ module Zernio
534
534
  end
535
535
 
536
536
  # Create standalone ad
537
- # Create a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X, LinkedIn, and OpenAI Ads (ChatGPT Ads). Three mutually-exclusive request shapes are selected by the body: - Legacy single-creative shape (all platforms, the default). - Meta-only multi-creative shape via the creatives array: one ad set with N ads sharing budget and targeting. - Attach shape via adSetId: adds one new ad to an existing ad set, inheriting its budget, targeting, and schedule (Meta, Google Ads, TikTok, and LinkedIn). On LinkedIn adSetId is the existing Campaign id, and the budget, schedule, targeting and bidding fields must be omitted. Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content \"dark post\" authored by a Company Page (see `organizationId`). Supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
537
+ # Create a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X, LinkedIn, and OpenAI Ads (ChatGPT Ads). Three mutually-exclusive request shapes are selected by the body: - Legacy single-creative shape (all platforms, the default). - Meta-only multi-creative shape via the creatives array: one ad set with N ads sharing budget and targeting. - Attach shape via adSetId: adds one new ad to an existing ad set, inheriting its budget, targeting, and schedule (Meta, Google Ads, TikTok, and LinkedIn). On LinkedIn adSetId is the existing Campaign id, and the budget, schedule, targeting and bidding fields must be omitted. Meta accepts `promotion` and `creativeFeatures` on the single and attach shapes and as defaults for `creatives[]`. An item replaces the whole feature map; its `promotion` replaces the default offer, and `promotion: null` disables that default for the item. Reusing `existingCreativeId` uses the existing creative settings instead of new settings. Requested settings are persisted for lists, exports, and default ad-detail reads. Only ads supplied a `promotion` receive live readback; multi-create batches those reads in groups of up to 50 IDs without per-ad fallback. Inspect `ad.creative.promotionStatus` (or `ads[].creative.promotionStatus`). `not_returned` means Meta omitted the metadata; successful creation does not by itself prove the offer was applied or will display. Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content \"dark post\" authored by a Company Page (see `organizationId`). Supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
538
538
  # @param create_standalone_ad_request [CreateStandaloneAdRequest]
539
539
  # @param [Hash] opts the optional parameters
540
540
  # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
@@ -798,7 +798,7 @@ module Zernio
798
798
  end
799
799
 
800
800
  # Duplicate an ad
801
- # Duplicates a single ad via Meta's native `POST /{ad-id}/copies`. The copy is created paused. `adSetId` retargets the copy into another ad set; omitted = the source's own ad set. Accepts the Zernio ad id or the platform ad id. Sync discovery is triggered automatically (`syncAfter: false` to skip).
801
+ # Duplicates a single ad via Meta's native `POST /{ad-id}/copies`. The copy is created paused. `adSetId` retargets the copy into another ad set; omitted = the source's own ad set. Accepts the Zernio ad id or the platform ad id. Sync discovery is triggered automatically (`syncAfter: false` to skip). Creative settings returned by Meta, including explicit promotion metadata and creativeFeatures, are preserved when the native copy requires a creative rebuild. Metadata Meta does not return cannot be recovered.
802
802
  # @param ad_id [String] Zernio ad ID or platform ad ID
803
803
  # @param [Hash] opts the optional parameters
804
804
  # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409. Only 2xx responses are stored, so a request that failed with a 4xx can be retried with a corrected body under the SAME key.
@@ -810,7 +810,7 @@ module Zernio
810
810
  end
811
811
 
812
812
  # Duplicate an ad
813
- # Duplicates a single ad via Meta's native `POST /{ad-id}/copies`. The copy is created paused. `adSetId` retargets the copy into another ad set; omitted = the source's own ad set. Accepts the Zernio ad id or the platform ad id. Sync discovery is triggered automatically (`syncAfter: false` to skip).
813
+ # Duplicates a single ad via Meta's native `POST /{ad-id}/copies`. The copy is created paused. `adSetId` retargets the copy into another ad set; omitted = the source's own ad set. Accepts the Zernio ad id or the platform ad id. Sync discovery is triggered automatically (`syncAfter: false` to skip). Creative settings returned by Meta, including explicit promotion metadata and creativeFeatures, are preserved when the native copy requires a creative rebuild. Metadata Meta does not return cannot be recovered.
814
814
  # @param ad_id [String] Zernio ad ID or platform ad ID
815
815
  # @param [Hash] opts the optional parameters
816
816
  # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409. Only 2xx responses are stored, so a request that failed with a 4xx can be retried with a corrected body under the SAME key.
@@ -1037,9 +1037,10 @@ module Zernio
1037
1037
  end
1038
1038
 
1039
1039
  # Get ad details
1040
- # Returns an ad with its creative, targeting, status, and performance metrics. The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal `_id` (24-char hex) - Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`) - the creative's `effective_object_story_id` (`{pageId}_{postId}` shape, Facebook side) - the creative's `effective_instagram_media_id` (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step.
1040
+ # Returns an ad with its creative, targeting, status, and performance metrics. The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal `_id` (24-char hex) - Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`) - the creative's `effective_object_story_id` (`{pageId}_{postId}` shape, Facebook side) - the creative's `effective_instagram_media_id` (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step. By default, creative.promotion and creative.creativeFeatures contain stored requested settings, which do not confirm platform application. With `refreshPromotion=true`, Meta promotion metadata is read live and exposed as `ad.creative.promotion` with `promotionStatus`. Only `applied` confirms an offer; `not_returned` means the creative read succeeded without promotion metadata, and `unavailable` means it failed.
1041
1041
  # @param ad_id [String] Zernio `_id` (hex), Meta `platformAdId` (numeric), or one of the creative's effective story/media IDs. See description for details.
1042
1042
  # @param [Hash] opts the optional parameters
1043
+ # @option opts [Boolean] :refresh_promotion Meta only. Read current promotion metadata from Meta and include promotionStatus. Omit for stored creative settings with no promotion-specific Graph call. (default to false)
1043
1044
  # @return [GetAd200Response]
1044
1045
  def get_ad(ad_id, opts = {})
1045
1046
  data, _status_code, _headers = get_ad_with_http_info(ad_id, opts)
@@ -1047,9 +1048,10 @@ module Zernio
1047
1048
  end
1048
1049
 
1049
1050
  # Get ad details
1050
- # Returns an ad with its creative, targeting, status, and performance metrics. The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal `_id` (24-char hex) - Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`) - the creative's `effective_object_story_id` (`{pageId}_{postId}` shape, Facebook side) - the creative's `effective_instagram_media_id` (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step.
1051
+ # Returns an ad with its creative, targeting, status, and performance metrics. The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal `_id` (24-char hex) - Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`) - the creative's `effective_object_story_id` (`{pageId}_{postId}` shape, Facebook side) - the creative's `effective_instagram_media_id` (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step. By default, creative.promotion and creative.creativeFeatures contain stored requested settings, which do not confirm platform application. With `refreshPromotion=true`, Meta promotion metadata is read live and exposed as `ad.creative.promotion` with `promotionStatus`. Only `applied` confirms an offer; `not_returned` means the creative read succeeded without promotion metadata, and `unavailable` means it failed.
1051
1052
  # @param ad_id [String] Zernio `_id` (hex), Meta `platformAdId` (numeric), or one of the creative's effective story/media IDs. See description for details.
1052
1053
  # @param [Hash] opts the optional parameters
1054
+ # @option opts [Boolean] :refresh_promotion Meta only. Read current promotion metadata from Meta and include promotionStatus. Omit for stored creative settings with no promotion-specific Graph call. (default to false)
1053
1055
  # @return [Array<(GetAd200Response, Integer, Hash)>] GetAd200Response data, response status code and response headers
1054
1056
  def get_ad_with_http_info(ad_id, opts = {})
1055
1057
  if @api_client.config.debugging
@@ -1064,6 +1066,7 @@ module Zernio
1064
1066
 
1065
1067
  # query parameters
1066
1068
  query_params = opts[:query_params] || {}
1069
+ query_params[:'refreshPromotion'] = opts[:'refresh_promotion'] if !opts[:'refresh_promotion'].nil?
1067
1070
 
1068
1071
  # header parameters
1069
1072
  header_params = opts[:header_params] || {}
@@ -20,7 +20,7 @@ module Zernio
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create a standalone creative
23
- # Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via `existingCreativeId`. Provide exactly one of `imageUrl` (uploaded server-side), `imageHash` (from POST /v1/ads/images or the library list), or `carouselCards` (2-10 hand-built cards). The Page (and linked Instagram account, when present) is resolved from `accountId` as the story actor.
23
+ # Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via `existingCreativeId`. Provide exactly one of `imageUrl` (uploaded server-side), `imageHash` (from POST /v1/ads/images or the library list), or `carouselCards` (2-10 hand-built cards). The Page (and linked Instagram account, when present) is resolved from `accountId` as the story actor. `promotion` configures an explicit offer separately from Advantage+ `creativeFeatures`. Only when `promotion` is supplied does the response read the creative back from Meta; `promotionStatus: not_returned` means Meta accepted creation but omitted promotion metadata, so the requested offer is not confirmed as applied.
24
24
  # @param create_ad_creative_request [CreateAdCreativeRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [CreateAdCreative201Response]
@@ -30,7 +30,7 @@ module Zernio
30
30
  end
31
31
 
32
32
  # Create a standalone creative
33
- # Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via &#x60;existingCreativeId&#x60;. Provide exactly one of &#x60;imageUrl&#x60; (uploaded server-side), &#x60;imageHash&#x60; (from POST /v1/ads/images or the library list), or &#x60;carouselCards&#x60; (2-10 hand-built cards). The Page (and linked Instagram account, when present) is resolved from &#x60;accountId&#x60; as the story actor.
33
+ # Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via &#x60;existingCreativeId&#x60;. Provide exactly one of &#x60;imageUrl&#x60; (uploaded server-side), &#x60;imageHash&#x60; (from POST /v1/ads/images or the library list), or &#x60;carouselCards&#x60; (2-10 hand-built cards). The Page (and linked Instagram account, when present) is resolved from &#x60;accountId&#x60; as the story actor. &#x60;promotion&#x60; configures an explicit offer separately from Advantage+ &#x60;creativeFeatures&#x60;. Only when &#x60;promotion&#x60; is supplied does the response read the creative back from Meta; &#x60;promotionStatus: not_returned&#x60; means Meta accepted creation but omitted promotion metadata, so the requested offer is not confirmed as applied.
34
34
  # @param create_ad_creative_request [CreateAdCreativeRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(CreateAdCreative201Response, Integer, Hash)>] CreateAdCreative201Response data, response status code and response headers
@@ -505,7 +505,7 @@ module Zernio
505
505
  end
506
506
 
507
507
  # List a catalog's product sets
508
- # Lists a Meta product catalog's product sets, the unit a catalog ad promotes. Pass the chosen set as `promotedObject.productSetId` on POST /v1/ads/create with `goal: catalog_sales`.
508
+ # Lists a Meta product catalog's product sets, the unit a catalog ad promotes. Pass the chosen set id, not the parent catalog id, as `promotedObject.productSetId` on POST /v1/ads/create with `goal: catalog_sales`. Creation verifies set visibility and returns 400 for a catalog id or an inaccessible set.
509
509
  # @param catalog_id [String] Meta product catalog ID (from GET /v1/ads/catalogs)
510
510
  # @param account_id [String] A facebook, instagram, or metaads account ID
511
511
  # @param [Hash] opts the optional parameters
@@ -516,7 +516,7 @@ module Zernio
516
516
  end
517
517
 
518
518
  # List a catalog&#39;s product sets
519
- # Lists a Meta product catalog&#39;s product sets, the unit a catalog ad promotes. Pass the chosen set as &#x60;promotedObject.productSetId&#x60; on POST /v1/ads/create with &#x60;goal: catalog_sales&#x60;.
519
+ # Lists a Meta product catalog&#39;s product sets, the unit a catalog ad promotes. Pass the chosen set id, not the parent catalog id, as &#x60;promotedObject.productSetId&#x60; on POST /v1/ads/create with &#x60;goal: catalog_sales&#x60;. Creation verifies set visibility and returns 400 for a catalog id or an inaccessible set.
520
520
  # @param catalog_id [String] Meta product catalog ID (from GET /v1/ads/catalogs)
521
521
  # @param account_id [String] A facebook, instagram, or metaads account ID
522
522
  # @param [Hash] opts the optional parameters
@@ -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
 
@@ -73,12 +78,37 @@ module Zernio
73
78
  # Destination URL
74
79
  attr_accessor :link_url
75
80
 
81
+ # Explicit E.164 WhatsApp number supplied when creating a Meta boost or messaging ad. Absent when omitted by the caller or on older records.
82
+ attr_accessor :whatsapp_phone_number
83
+
76
84
  attr_accessor :pinterest_image_url
77
85
 
78
86
  attr_accessor :pinterest_title
79
87
 
80
88
  attr_accessor :pinterest_description
81
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
+
82
112
  # Attribute mapping from ruby-style variable name to JSON key.
83
113
  def self.attribute_map
84
114
  {
@@ -86,6 +116,8 @@ module Zernio
86
116
  :'image_url' => :'imageUrl',
87
117
  :'video_id' => :'videoId',
88
118
  :'video_url' => :'videoUrl',
119
+ :'promotion' => :'promotion',
120
+ :'promotion_status' => :'promotionStatus',
89
121
  :'creative_id' => :'creativeId',
90
122
  :'object_type' => :'objectType',
91
123
  :'object_story_id' => :'objectStoryId',
@@ -101,6 +133,7 @@ module Zernio
101
133
  :'google_headline' => :'googleHeadline',
102
134
  :'google_description' => :'googleDescription',
103
135
  :'link_url' => :'linkUrl',
136
+ :'whatsapp_phone_number' => :'whatsappPhoneNumber',
104
137
  :'pinterest_image_url' => :'pinterestImageUrl',
105
138
  :'pinterest_title' => :'pinterestTitle',
106
139
  :'pinterest_description' => :'pinterestDescription'
@@ -124,6 +157,8 @@ module Zernio
124
157
  :'image_url' => :'String',
125
158
  :'video_id' => :'String',
126
159
  :'video_url' => :'String',
160
+ :'promotion' => :'MetaPromotion',
161
+ :'promotion_status' => :'MetaPromotionStatus',
127
162
  :'creative_id' => :'String',
128
163
  :'object_type' => :'String',
129
164
  :'object_story_id' => :'String',
@@ -139,6 +174,7 @@ module Zernio
139
174
  :'google_headline' => :'String',
140
175
  :'google_description' => :'String',
141
176
  :'link_url' => :'String',
177
+ :'whatsapp_phone_number' => :'String',
142
178
  :'pinterest_image_url' => :'String',
143
179
  :'pinterest_title' => :'String',
144
180
  :'pinterest_description' => :'String'
@@ -194,6 +230,14 @@ module Zernio
194
230
  self.video_url = attributes[:'video_url']
195
231
  end
196
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
+
197
241
  if attributes.key?(:'creative_id')
198
242
  self.creative_id = attributes[:'creative_id']
199
243
  end
@@ -258,6 +302,10 @@ module Zernio
258
302
  self.link_url = attributes[:'link_url']
259
303
  end
260
304
 
305
+ if attributes.key?(:'whatsapp_phone_number')
306
+ self.whatsapp_phone_number = attributes[:'whatsapp_phone_number']
307
+ end
308
+
261
309
  if attributes.key?(:'pinterest_image_url')
262
310
  self.pinterest_image_url = attributes[:'pinterest_image_url']
263
311
  end
@@ -295,6 +343,8 @@ module Zernio
295
343
  image_url == o.image_url &&
296
344
  video_id == o.video_id &&
297
345
  video_url == o.video_url &&
346
+ promotion == o.promotion &&
347
+ promotion_status == o.promotion_status &&
298
348
  creative_id == o.creative_id &&
299
349
  object_type == o.object_type &&
300
350
  object_story_id == o.object_story_id &&
@@ -310,6 +360,7 @@ module Zernio
310
360
  google_headline == o.google_headline &&
311
361
  google_description == o.google_description &&
312
362
  link_url == o.link_url &&
363
+ whatsapp_phone_number == o.whatsapp_phone_number &&
313
364
  pinterest_image_url == o.pinterest_image_url &&
314
365
  pinterest_title == o.pinterest_title &&
315
366
  pinterest_description == o.pinterest_description
@@ -324,7 +375,7 @@ module Zernio
324
375
  # Calculates hash code according to all attributes.
325
376
  # @return [Integer] Hash code
326
377
  def hash
327
- [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, 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
328
379
  end
329
380
 
330
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
 
@@ -40,10 +43,10 @@ module Zernio
40
43
  # Meta only. Instagram identity the ad runs AS (creative.instagram_user_id), overriding the account linked to the Page. Live-verified against a Page-post creative.
41
44
  attr_accessor :instagram_account_id
42
45
 
43
- # Meta only. Ad-set destination_type: where the click LANDS, as opposed to instagramAccountId which is who the ad runs as. Messaging destinations imply their matching CTA and require goal engagement. Lead ads use ON_AD; combining an instant form with a messaging destination is rejected.
46
+ # Meta only. Ad-set destination_type: where the click LANDS, as opposed to instagramAccountId which is who the ad runs as. Independent of plain link CTAs and their goal. A messaging callToAction selects its destination automatically; an explicit destinationType must then match. Lead ads use ON_AD.
44
47
  attr_accessor :destination_type
45
48
 
46
- # Meta WhatsApp only. E.164 number already paired with the Page. Omit to use the default pairing. Requires WHATSAPP destinationType or WHATSAPP_MESSAGE callToAction.
49
+ # Meta WhatsApp only. E.164 number already paired with the Page. Omit to use the default pairing. Requires WHATSAPP_MESSAGE callToAction. Stored as creative.whatsappPhoneNumber on the ad.
47
50
  attr_accessor :whatsapp_phone_number
48
51
 
49
52
  # ISO 4217 currency code matching the ad account's currency. Meta only. Optional: Zernio resolves it from the ad account when omitted. The value selects the minor-unit exponent Zernio converts budget/bid amounts by before calling Meta (most currencies are cents; zero-decimal currencies like JPY/KRW are sent as-is).
@@ -99,7 +102,7 @@ module Zernio
99
102
  # Lead Gen form ID to attach to the boosted ad's creative. REQUIRED when `goal` is `lead_generation`. On Meta this is the leadgen_forms ID (create one via POST /v1/ads/lead-forms). On LinkedIn this is the adForm ID (create one via POST /v1/ads/lead-forms with a LinkedIn account); the creative's `leadgenCallToAction.destination` is set to `urn:li:adForm:{id}`. Ignored for other goals.
100
103
  attr_accessor :lead_gen_form_id
101
104
 
102
- # Meta, TikTok, and LinkedIn. Publish state of the created entities. Omitted or ACTIVE publishes live (default); PAUSED creates them paused so you can review before they spend. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
105
+ # Meta, TikTok, and LinkedIn. Publish state of the created entities. Omitted or ACTIVE publishes live (default); PAUSED creates them paused so you can review before they spend. On Meta a new campaign stays paused until explicitly activated; an attached ad is itself paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
103
106
  attr_accessor :status
104
107
 
105
108
  # Meta only. Explicit ad-set `optimization_goal` override. When omitted, defaults to the value derived from `goal`. Messaging boosts always use CONVERSATIONS and reject another optimizationGoal. Otherwise the value must be compatible with the objective Meta derives from `goal`, not with the objective used by `POST /v1/ads/create` for the same `goal` name: boost maps `goal: \"engagement\"` to objective `OUTCOME_AWARENESS`, which accepts `REACH`, `IMPRESSIONS`, `AD_RECALL_LIFT`, or THRUPLAY-class values, and rejects `POST_ENGAGEMENT` (that value is only valid under `OUTCOME_ENGAGEMENT`, which create uses for the same goal name).
@@ -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
 
@@ -30,7 +33,7 @@ module Zernio
30
33
  # Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with existingPostId and fresh creative fields.
31
34
  attr_accessor :object_story_id
32
35
 
33
- # WhatsApp only. Optional E.164 number already paired with the Facebook Page. Omit to let Meta select the paired number. Sent to the creative CTA and, when creating a new ad set, its promoted_object. Attach requests do not change the existing ad set.
36
+ # WhatsApp only. Optional E.164 number already paired with the Facebook Page. Omit to let Meta select the paired number. Sent to the creative CTA and, when creating a new ad set, its promoted_object. Attach requests do not change the existing ad set. Stored as creative.whatsappPhoneNumber on every created ad.
34
37
  attr_accessor :whatsapp_phone_number
35
38
 
36
39
  # Single-creative shape only. Mutually exclusive with `creatives[]`.
@@ -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
 
@@ -30,7 +33,7 @@ module Zernio
30
33
  # Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with existingPostId and fresh creative fields.
31
34
  attr_accessor :object_story_id
32
35
 
33
- # WhatsApp only. Optional E.164 number already paired with the Facebook Page. Omit to let Meta select the paired number. Sent to the creative CTA and, when creating a new ad set, its promoted_object. Attach requests do not change the existing ad set.
36
+ # WhatsApp only. Optional E.164 number already paired with the Facebook Page. Omit to let Meta select the paired number. Sent to the creative CTA and, when creating a new ad set, its promoted_object. Attach requests do not change the existing ad set. Stored as creative.whatsappPhoneNumber on every created ad.
34
37
  attr_accessor :whatsapp_phone_number
35
38
 
36
39
  # Single-creative shape only. Mutually exclusive with `creatives[]`.
@@ -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