late-sdk 0.0.528 → 0.0.530

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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -9
  3. data/docs/AdsApi.md +301 -11
  4. data/docs/CreateAdInsightsReportRequest.md +8 -0
  5. data/docs/CreateCallAdRequest.md +80 -0
  6. data/docs/CreateMessagingAdRequest.md +78 -0
  7. data/docs/CreateStandaloneAdRequest.md +2 -0
  8. data/docs/CreateStandaloneAdRequestCarouselCardsInner.md +26 -0
  9. data/docs/{CreateCtwaAdRequest.md → CtwaAdRequestBody.md} +10 -10
  10. data/docs/{CreateCtwaAdRequestCitiesInner.md → CtwaAdRequestBodyCitiesInner.md} +2 -2
  11. data/docs/{CreateCtwaAdRequestCreativesInner.md → CtwaAdRequestBodyCreativesInner.md} +3 -3
  12. data/docs/{CreateCtwaAdRequestCreativesInnerVideo.md → CtwaAdRequestBodyCreativesInnerVideo.md} +2 -2
  13. data/docs/{CreateCtwaAdRequestPlacements.md → CtwaAdRequestBodyPlacements.md} +2 -2
  14. data/docs/{CreateCtwaAdRequestRegionsInner.md → CtwaAdRequestBodyRegionsInner.md} +2 -2
  15. data/docs/{CreateCtwaAdRequestVideo.md → CtwaAdRequestBodyVideo.md} +2 -2
  16. data/docs/{CreateCtwaAdRequestZipsInner.md → CtwaAdRequestBodyZipsInner.md} +2 -2
  17. data/docs/GenerateAdPreviews200Response.md +18 -0
  18. data/docs/GenerateAdPreviews200ResponsePreviewsInner.md +20 -0
  19. data/docs/GenerateAdPreviewsRequest.md +26 -0
  20. data/docs/GetAdPreviews200Response.md +20 -0
  21. data/lib/zernio-sdk/api/ads_api.rb +295 -13
  22. data/lib/zernio-sdk/models/create_ad_insights_report_request.rb +43 -1
  23. data/lib/zernio-sdk/models/create_call_ad_request.rb +869 -0
  24. data/lib/zernio-sdk/models/create_messaging_ad_request.rb +844 -0
  25. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +41 -1
  26. data/lib/zernio-sdk/models/create_standalone_ad_request_carousel_cards_inner.rb +243 -0
  27. data/lib/zernio-sdk/models/{create_ctwa_ad_request.rb → ctwa_ad_request_body.rb} +12 -12
  28. data/lib/zernio-sdk/models/{create_ctwa_ad_request_cities_inner.rb → ctwa_ad_request_body_cities_inner.rb} +3 -3
  29. data/lib/zernio-sdk/models/{create_ctwa_ad_request_creatives_inner.rb → ctwa_ad_request_body_creatives_inner.rb} +4 -4
  30. data/lib/zernio-sdk/models/{create_ctwa_ad_request_creatives_inner_video.rb → ctwa_ad_request_body_creatives_inner_video.rb} +3 -3
  31. data/lib/zernio-sdk/models/{create_ctwa_ad_request_placements.rb → ctwa_ad_request_body_placements.rb} +3 -3
  32. data/lib/zernio-sdk/models/{create_ctwa_ad_request_regions_inner.rb → ctwa_ad_request_body_regions_inner.rb} +3 -3
  33. data/lib/zernio-sdk/models/{create_ctwa_ad_request_video.rb → ctwa_ad_request_body_video.rb} +3 -3
  34. data/lib/zernio-sdk/models/{create_ctwa_ad_request_zips_inner.rb → ctwa_ad_request_body_zips_inner.rb} +3 -3
  35. data/lib/zernio-sdk/models/generate_ad_previews200_response.rb +149 -0
  36. data/lib/zernio-sdk/models/generate_ad_previews200_response_previews_inner.rb +158 -0
  37. data/lib/zernio-sdk/models/generate_ad_previews_request.rb +254 -0
  38. data/lib/zernio-sdk/models/get_ad_previews200_response.rb +158 -0
  39. data/lib/zernio-sdk/version.rb +1 -1
  40. data/lib/zernio-sdk.rb +15 -8
  41. data/openapi.yaml +516 -320
  42. data/spec/api/ads_api_spec.rb +56 -3
  43. data/spec/models/create_ad_insights_report_request_spec.rb +24 -0
  44. data/spec/models/create_call_ad_request_spec.rb +238 -0
  45. data/spec/models/create_messaging_ad_request_spec.rb +236 -0
  46. data/spec/models/create_standalone_ad_request_carousel_cards_inner_spec.rb +60 -0
  47. data/spec/models/create_standalone_ad_request_spec.rb +6 -0
  48. data/spec/models/{create_ctwa_ad_request_cities_inner_spec.rb → ctwa_ad_request_body_cities_inner_spec.rb} +6 -6
  49. data/spec/models/{create_ctwa_ad_request_creatives_inner_spec.rb → ctwa_ad_request_body_creatives_inner_spec.rb} +6 -6
  50. data/spec/models/{create_ctwa_ad_request_creatives_inner_video_spec.rb → ctwa_ad_request_body_creatives_inner_video_spec.rb} +6 -6
  51. data/spec/models/{create_ctwa_ad_request_placements_spec.rb → ctwa_ad_request_body_placements_spec.rb} +6 -6
  52. data/spec/models/{create_ctwa_ad_request_regions_inner_spec.rb → ctwa_ad_request_body_regions_inner_spec.rb} +6 -6
  53. data/spec/models/{create_ctwa_ad_request_spec.rb → ctwa_ad_request_body_spec.rb} +6 -6
  54. data/spec/models/{create_ctwa_ad_request_video_spec.rb → ctwa_ad_request_body_video_spec.rb} +6 -6
  55. data/spec/models/{create_ctwa_ad_request_zips_inner_spec.rb → ctwa_ad_request_body_zips_inner_spec.rb} +6 -6
  56. data/spec/models/generate_ad_previews200_response_previews_inner_spec.rb +42 -0
  57. data/spec/models/generate_ad_previews200_response_spec.rb +36 -0
  58. data/spec/models/generate_ad_previews_request_spec.rb +60 -0
  59. data/spec/models/get_ad_previews200_response_spec.rb +42 -0
  60. data/zernio-sdk-0.0.530.gem +0 -0
  61. metadata +62 -34
  62. data/zernio-sdk-0.0.528.gem +0 -0
@@ -373,6 +373,74 @@ module Zernio
373
373
  return data, status_code, headers
374
374
  end
375
375
 
376
+ # Create Click-to-Call ad
377
+ # Same shape and flow as POST /v1/ads/ctwa, but the CTA is CALL_NOW dialing `phoneNumber` via a tel: link. The ad set is destination_type PHONE_CALL optimizing QUALITY_CALL and the campaign objective defaults to OUTCOME_LEADS. Supports the same single-creative and multi-creative shapes as CTWA.
378
+ # @param create_call_ad_request [CreateCallAdRequest]
379
+ # @param [Hash] opts the optional parameters
380
+ # @return [nil]
381
+ def create_call_ad(create_call_ad_request, opts = {})
382
+ create_call_ad_with_http_info(create_call_ad_request, opts)
383
+ nil
384
+ end
385
+
386
+ # Create Click-to-Call ad
387
+ # Same shape and flow as POST /v1/ads/ctwa, but the CTA is CALL_NOW dialing `phoneNumber` via a tel: link. The ad set is destination_type PHONE_CALL optimizing QUALITY_CALL and the campaign objective defaults to OUTCOME_LEADS. Supports the same single-creative and multi-creative shapes as CTWA.
388
+ # @param create_call_ad_request [CreateCallAdRequest]
389
+ # @param [Hash] opts the optional parameters
390
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
391
+ def create_call_ad_with_http_info(create_call_ad_request, opts = {})
392
+ if @api_client.config.debugging
393
+ @api_client.config.logger.debug 'Calling API: AdsApi.create_call_ad ...'
394
+ end
395
+ # verify the required parameter 'create_call_ad_request' is set
396
+ if @api_client.config.client_side_validation && create_call_ad_request.nil?
397
+ fail ArgumentError, "Missing the required parameter 'create_call_ad_request' when calling AdsApi.create_call_ad"
398
+ end
399
+ # resource path
400
+ local_var_path = '/v1/ads/call'
401
+
402
+ # query parameters
403
+ query_params = opts[:query_params] || {}
404
+
405
+ # header parameters
406
+ header_params = opts[:header_params] || {}
407
+ # HTTP header 'Accept' (if needed)
408
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
409
+ # HTTP header 'Content-Type'
410
+ content_type = @api_client.select_header_content_type(['application/json'])
411
+ if !content_type.nil?
412
+ header_params['Content-Type'] = content_type
413
+ end
414
+
415
+ # form parameters
416
+ form_params = opts[:form_params] || {}
417
+
418
+ # http body (model)
419
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_call_ad_request)
420
+
421
+ # return_type
422
+ return_type = opts[:debug_return_type]
423
+
424
+ # auth_names
425
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
426
+
427
+ new_options = opts.merge(
428
+ :operation => :"AdsApi.create_call_ad",
429
+ :header_params => header_params,
430
+ :query_params => query_params,
431
+ :form_params => form_params,
432
+ :body => post_body,
433
+ :auth_names => auth_names,
434
+ :return_type => return_type
435
+ )
436
+
437
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
438
+ if @api_client.config.debugging
439
+ @api_client.config.logger.debug "API called: AdsApi#create_call_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
440
+ end
441
+ return data, status_code, headers
442
+ end
443
+
376
444
  # Create a conversion destination
377
445
  # Create a new conversion destination on the platform. Supported for LinkedIn (conversion rule) and Google Ads (conversion action). Meta manages destinations in its own UI and returns 405. **LinkedIn:** creation is NOT idempotent. A retry creates a second destination. Deduplicate before retrying. **Google Ads:** calling with a name that already exists reuses the existing conversion action transparently (the response is identical to a fresh create). Calling with the same name but a different category returns a typed `IDEMPOTENCY_CONFLICT` (409) rather than silently returning the mismatched action. **LinkedIn:** the rule is created with `conversionMethod=CONVERSIONS_API` and (by default) auto-associated with all of the ad account's campaigns via `autoAssociationType=ALL_CAMPAIGNS`. Pass `autoAssociationType: NONE` to opt out and manage associations explicitly via the associations endpoints below. 365-day attribution windows are only valid for `SUBMIT_APPLICATION`, `PURCHASE`, `ADD_TO_CART`, `QUALIFIED_LEAD`, and `LEAD` rule types; the API rejects other combinations locally. **Google Ads:** the conversion action is created with `type=UPLOAD_CLICKS` (required for API-uploaded offline conversions, immutable after creation). The `type` field carries the Google `ConversionActionCategory` enum value, e.g. `PURCHASE`, `SUBSCRIBE_PAID`, `SIGNUP`, `IMPORTED_LEAD`, `BOOK_APPOINTMENT`. Unified standard event names (e.g. `Purchase`, `Subscribe`, `CompleteRegistration`, `Lead`, `Schedule`) are resolved to their Google category equivalents automatically. The action defaults to secondary (non-primary) to avoid immediately steering Smart Bidding; pass `primaryForGoal: true` to opt in.
378
446
  # @param account_id [String] SocialAccount ID (linkedinads or googleads).
@@ -447,28 +515,28 @@ module Zernio
447
515
  return data, status_code, headers
448
516
  end
449
517
 
450
- # Create Click-to-WhatsApp ad
451
- # Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. Supports two mutually-exclusive shapes: - **Single-creative**: supply top-level `headline`, `body`, and one of `imageUrl` / `video`. Creates 1 campaign + 1 ad set + 1 ad. - **Multi-creative**: supply a `creatives[]` array with N entries (each carrying its own headline, body, and image/video). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign. Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management.
452
- # @param create_ctwa_ad_request [CreateCtwaAdRequest]
518
+ # Create Click-to-WhatsApp ad (deprecated)
519
+ # Deprecated: use POST /v1/ads/messaging with `destination: whatsapp`. This endpoint stays available for back-compat; no removal planned. Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. Supports two mutually-exclusive shapes: - **Single-creative**: supply top-level `headline`, `body`, and one of `imageUrl` / `video`. Creates 1 campaign + 1 ad set + 1 ad. - **Multi-creative**: supply a `creatives[]` array with N entries (each carrying its own headline, body, and image/video). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign. Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management.
520
+ # @param ctwa_ad_request_body [CtwaAdRequestBody]
453
521
  # @param [Hash] opts the optional parameters
454
522
  # @return [CreateCtwaAd201Response]
455
- def create_ctwa_ad(create_ctwa_ad_request, opts = {})
456
- data, _status_code, _headers = create_ctwa_ad_with_http_info(create_ctwa_ad_request, opts)
523
+ def create_ctwa_ad(ctwa_ad_request_body, opts = {})
524
+ data, _status_code, _headers = create_ctwa_ad_with_http_info(ctwa_ad_request_body, opts)
457
525
  data
458
526
  end
459
527
 
460
- # Create Click-to-WhatsApp ad
461
- # Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. Supports two mutually-exclusive shapes: - **Single-creative**: supply top-level &#x60;headline&#x60;, &#x60;body&#x60;, and one of &#x60;imageUrl&#x60; / &#x60;video&#x60;. Creates 1 campaign + 1 ad set + 1 ad. - **Multi-creative**: supply a &#x60;creatives[]&#x60; array with N entries (each carrying its own headline, body, and image/video). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign. Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management.
462
- # @param create_ctwa_ad_request [CreateCtwaAdRequest]
528
+ # Create Click-to-WhatsApp ad (deprecated)
529
+ # Deprecated: use POST /v1/ads/messaging with &#x60;destination: whatsapp&#x60;. This endpoint stays available for back-compat; no removal planned. Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. Supports two mutually-exclusive shapes: - **Single-creative**: supply top-level &#x60;headline&#x60;, &#x60;body&#x60;, and one of &#x60;imageUrl&#x60; / &#x60;video&#x60;. Creates 1 campaign + 1 ad set + 1 ad. - **Multi-creative**: supply a &#x60;creatives[]&#x60; array with N entries (each carrying its own headline, body, and image/video). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign. Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management.
530
+ # @param ctwa_ad_request_body [CtwaAdRequestBody]
463
531
  # @param [Hash] opts the optional parameters
464
532
  # @return [Array<(CreateCtwaAd201Response, Integer, Hash)>] CreateCtwaAd201Response data, response status code and response headers
465
- def create_ctwa_ad_with_http_info(create_ctwa_ad_request, opts = {})
533
+ def create_ctwa_ad_with_http_info(ctwa_ad_request_body, opts = {})
466
534
  if @api_client.config.debugging
467
535
  @api_client.config.logger.debug 'Calling API: AdsApi.create_ctwa_ad ...'
468
536
  end
469
- # verify the required parameter 'create_ctwa_ad_request' is set
470
- if @api_client.config.client_side_validation && create_ctwa_ad_request.nil?
471
- fail ArgumentError, "Missing the required parameter 'create_ctwa_ad_request' when calling AdsApi.create_ctwa_ad"
537
+ # verify the required parameter 'ctwa_ad_request_body' is set
538
+ if @api_client.config.client_side_validation && ctwa_ad_request_body.nil?
539
+ fail ArgumentError, "Missing the required parameter 'ctwa_ad_request_body' when calling AdsApi.create_ctwa_ad"
472
540
  end
473
541
  # resource path
474
542
  local_var_path = '/v1/ads/ctwa'
@@ -490,7 +558,7 @@ module Zernio
490
558
  form_params = opts[:form_params] || {}
491
559
 
492
560
  # http body (model)
493
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ctwa_ad_request)
561
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(ctwa_ad_request_body)
494
562
 
495
563
  # return_type
496
564
  return_type = opts[:debug_return_type] || 'CreateCtwaAd201Response'
@@ -583,6 +651,74 @@ module Zernio
583
651
  return data, status_code, headers
584
652
  end
585
653
 
654
+ # Create click-to-message ad (WhatsApp / Messenger / Instagram Direct)
655
+ # Creates a click-to-message ad; `destination` selects where the tapped ad opens a conversation: WhatsApp, the Page's Messenger inbox or the linked Instagram account's Direct inbox. The ad set is created with the matching destination_type and CONVERSATIONS optimization; the campaign objective defaults to OUTCOME_ENGAGEMENT. Supports single-creative and multi-creative shapes. Supersedes POST /v1/ads/ctwa (deprecated, equivalent to `destination: whatsapp`).
656
+ # @param create_messaging_ad_request [CreateMessagingAdRequest]
657
+ # @param [Hash] opts the optional parameters
658
+ # @return [nil]
659
+ def create_messaging_ad(create_messaging_ad_request, opts = {})
660
+ create_messaging_ad_with_http_info(create_messaging_ad_request, opts)
661
+ nil
662
+ end
663
+
664
+ # Create click-to-message ad (WhatsApp / Messenger / Instagram Direct)
665
+ # Creates a click-to-message ad; &#x60;destination&#x60; selects where the tapped ad opens a conversation: WhatsApp, the Page&#39;s Messenger inbox or the linked Instagram account&#39;s Direct inbox. The ad set is created with the matching destination_type and CONVERSATIONS optimization; the campaign objective defaults to OUTCOME_ENGAGEMENT. Supports single-creative and multi-creative shapes. Supersedes POST /v1/ads/ctwa (deprecated, equivalent to &#x60;destination: whatsapp&#x60;).
666
+ # @param create_messaging_ad_request [CreateMessagingAdRequest]
667
+ # @param [Hash] opts the optional parameters
668
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
669
+ def create_messaging_ad_with_http_info(create_messaging_ad_request, opts = {})
670
+ if @api_client.config.debugging
671
+ @api_client.config.logger.debug 'Calling API: AdsApi.create_messaging_ad ...'
672
+ end
673
+ # verify the required parameter 'create_messaging_ad_request' is set
674
+ if @api_client.config.client_side_validation && create_messaging_ad_request.nil?
675
+ fail ArgumentError, "Missing the required parameter 'create_messaging_ad_request' when calling AdsApi.create_messaging_ad"
676
+ end
677
+ # resource path
678
+ local_var_path = '/v1/ads/messaging'
679
+
680
+ # query parameters
681
+ query_params = opts[:query_params] || {}
682
+
683
+ # header parameters
684
+ header_params = opts[:header_params] || {}
685
+ # HTTP header 'Accept' (if needed)
686
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
687
+ # HTTP header 'Content-Type'
688
+ content_type = @api_client.select_header_content_type(['application/json'])
689
+ if !content_type.nil?
690
+ header_params['Content-Type'] = content_type
691
+ end
692
+
693
+ # form parameters
694
+ form_params = opts[:form_params] || {}
695
+
696
+ # http body (model)
697
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_messaging_ad_request)
698
+
699
+ # return_type
700
+ return_type = opts[:debug_return_type]
701
+
702
+ # auth_names
703
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
704
+
705
+ new_options = opts.merge(
706
+ :operation => :"AdsApi.create_messaging_ad",
707
+ :header_params => header_params,
708
+ :query_params => query_params,
709
+ :form_params => form_params,
710
+ :body => post_body,
711
+ :auth_names => auth_names,
712
+ :return_type => return_type
713
+ )
714
+
715
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
716
+ if @api_client.config.debugging
717
+ @api_client.config.logger.debug "API called: AdsApi#create_messaging_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
718
+ end
719
+ return data, status_code, headers
720
+ end
721
+
586
722
  # Create standalone ad
587
723
  # Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn. Supports three mutually-exclusive request shapes selected by the body, a legacy single-creative shape (all platforms, default), a Meta-only multi-creative shape via the creatives array (one ad set with N ads sharing budget and targeting), and a Meta-only attach shape via adSetId (adds one new ad to an existing ad set). 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.
588
724
  # @param create_standalone_ad_request [CreateStandaloneAdRequest]
@@ -935,6 +1071,74 @@ module Zernio
935
1071
  return data, status_code, headers
936
1072
  end
937
1073
 
1074
+ # Render pre-create ad previews (Meta)
1075
+ # Renders how a creative would look per placement BEFORE any ad exists, via Meta's `/generatepreviews`. Provide exactly one creative source: `existingCreativeId` or `creativeSpec`. Each preview is an HTML `<iframe>` snippet embeddable directly. Unknown `formats` values return Meta's 400 verbatim. Meta only.
1076
+ # @param generate_ad_previews_request [GenerateAdPreviewsRequest]
1077
+ # @param [Hash] opts the optional parameters
1078
+ # @return [GenerateAdPreviews200Response]
1079
+ def generate_ad_previews(generate_ad_previews_request, opts = {})
1080
+ data, _status_code, _headers = generate_ad_previews_with_http_info(generate_ad_previews_request, opts)
1081
+ data
1082
+ end
1083
+
1084
+ # Render pre-create ad previews (Meta)
1085
+ # Renders how a creative would look per placement BEFORE any ad exists, via Meta&#39;s &#x60;/generatepreviews&#x60;. Provide exactly one creative source: &#x60;existingCreativeId&#x60; or &#x60;creativeSpec&#x60;. Each preview is an HTML &#x60;&lt;iframe&gt;&#x60; snippet embeddable directly. Unknown &#x60;formats&#x60; values return Meta&#39;s 400 verbatim. Meta only.
1086
+ # @param generate_ad_previews_request [GenerateAdPreviewsRequest]
1087
+ # @param [Hash] opts the optional parameters
1088
+ # @return [Array<(GenerateAdPreviews200Response, Integer, Hash)>] GenerateAdPreviews200Response data, response status code and response headers
1089
+ def generate_ad_previews_with_http_info(generate_ad_previews_request, opts = {})
1090
+ if @api_client.config.debugging
1091
+ @api_client.config.logger.debug 'Calling API: AdsApi.generate_ad_previews ...'
1092
+ end
1093
+ # verify the required parameter 'generate_ad_previews_request' is set
1094
+ if @api_client.config.client_side_validation && generate_ad_previews_request.nil?
1095
+ fail ArgumentError, "Missing the required parameter 'generate_ad_previews_request' when calling AdsApi.generate_ad_previews"
1096
+ end
1097
+ # resource path
1098
+ local_var_path = '/v1/ads/preview'
1099
+
1100
+ # query parameters
1101
+ query_params = opts[:query_params] || {}
1102
+
1103
+ # header parameters
1104
+ header_params = opts[:header_params] || {}
1105
+ # HTTP header 'Accept' (if needed)
1106
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1107
+ # HTTP header 'Content-Type'
1108
+ content_type = @api_client.select_header_content_type(['application/json'])
1109
+ if !content_type.nil?
1110
+ header_params['Content-Type'] = content_type
1111
+ end
1112
+
1113
+ # form parameters
1114
+ form_params = opts[:form_params] || {}
1115
+
1116
+ # http body (model)
1117
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_ad_previews_request)
1118
+
1119
+ # return_type
1120
+ return_type = opts[:debug_return_type] || 'GenerateAdPreviews200Response'
1121
+
1122
+ # auth_names
1123
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1124
+
1125
+ new_options = opts.merge(
1126
+ :operation => :"AdsApi.generate_ad_previews",
1127
+ :header_params => header_params,
1128
+ :query_params => query_params,
1129
+ :form_params => form_params,
1130
+ :body => post_body,
1131
+ :auth_names => auth_names,
1132
+ :return_type => return_type
1133
+ )
1134
+
1135
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1136
+ if @api_client.config.debugging
1137
+ @api_client.config.logger.debug "API called: AdsApi#generate_ad_previews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1138
+ end
1139
+ return data, status_code, headers
1140
+ end
1141
+
938
1142
  # Get ad details
939
1143
  # 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.
940
1144
  # @param ad_id [String] Zernio &#x60;_id&#x60; (hex), Meta &#x60;platformAdId&#x60; (numeric), or one of the creative&#39;s effective story/media IDs. See description for details.
@@ -1238,6 +1442,72 @@ module Zernio
1238
1442
  return data, status_code, headers
1239
1443
  end
1240
1444
 
1445
+ # Render previews of an existing ad (Meta)
1446
+ # Renders an EXISTING ad per placement via Meta's `/{ad_id}/previews`. Each preview is an HTML `<iframe>` snippet embeddable directly. Unknown `formats` values return Meta's 400 verbatim. Meta only.
1447
+ # @param ad_id [String] Zernio ad id (24-char hex).
1448
+ # @param [Hash] opts the optional parameters
1449
+ # @option opts [String] :formats Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.
1450
+ # @return [GetAdPreviews200Response]
1451
+ def get_ad_previews(ad_id, opts = {})
1452
+ data, _status_code, _headers = get_ad_previews_with_http_info(ad_id, opts)
1453
+ data
1454
+ end
1455
+
1456
+ # Render previews of an existing ad (Meta)
1457
+ # Renders an EXISTING ad per placement via Meta&#39;s &#x60;/{ad_id}/previews&#x60;. Each preview is an HTML &#x60;&lt;iframe&gt;&#x60; snippet embeddable directly. Unknown &#x60;formats&#x60; values return Meta&#39;s 400 verbatim. Meta only.
1458
+ # @param ad_id [String] Zernio ad id (24-char hex).
1459
+ # @param [Hash] opts the optional parameters
1460
+ # @option opts [String] :formats Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.
1461
+ # @return [Array<(GetAdPreviews200Response, Integer, Hash)>] GetAdPreviews200Response data, response status code and response headers
1462
+ def get_ad_previews_with_http_info(ad_id, opts = {})
1463
+ if @api_client.config.debugging
1464
+ @api_client.config.logger.debug 'Calling API: AdsApi.get_ad_previews ...'
1465
+ end
1466
+ # verify the required parameter 'ad_id' is set
1467
+ if @api_client.config.client_side_validation && ad_id.nil?
1468
+ fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.get_ad_previews"
1469
+ end
1470
+ # resource path
1471
+ local_var_path = '/v1/ads/{adId}/preview'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s))
1472
+
1473
+ # query parameters
1474
+ query_params = opts[:query_params] || {}
1475
+ query_params[:'formats'] = opts[:'formats'] if !opts[:'formats'].nil?
1476
+
1477
+ # header parameters
1478
+ header_params = opts[:header_params] || {}
1479
+ # HTTP header 'Accept' (if needed)
1480
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1481
+
1482
+ # form parameters
1483
+ form_params = opts[:form_params] || {}
1484
+
1485
+ # http body (model)
1486
+ post_body = opts[:debug_body]
1487
+
1488
+ # return_type
1489
+ return_type = opts[:debug_return_type] || 'GetAdPreviews200Response'
1490
+
1491
+ # auth_names
1492
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1493
+
1494
+ new_options = opts.merge(
1495
+ :operation => :"AdsApi.get_ad_previews",
1496
+ :header_params => header_params,
1497
+ :query_params => query_params,
1498
+ :form_params => form_params,
1499
+ :body => post_body,
1500
+ :auth_names => auth_names,
1501
+ :return_type => return_type
1502
+ )
1503
+
1504
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1505
+ if @api_client.config.debugging
1506
+ @api_client.config.logger.debug "API called: AdsApi#get_ad_previews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1507
+ end
1508
+ return data, status_code, headers
1509
+ end
1510
+
1241
1511
  # Get ad tracking tags
1242
1512
  # Unified read of the platform's native click-URL tracking params. - Meta (facebook/instagram): the creative's `url_tags` (and template_url_spec). - Google (googleads): the campaign's `trackingUrlTemplate` + `finalUrlSuffix`. Subject to the Google Ads API access-tier daily quota; bulk audits need Standard access. - LinkedIn (linkedinads): the campaign's Dynamic UTM `dynamicValueParameters` + `customValueParameters`. Returns 405 for platforms without a click-URL tracking surface (TikTok, X, Pinterest).
1243
1513
  # @param ad_id [String] Ad id (hex _id, platformAdId, or effective story/media id).
@@ -2841,6 +3111,10 @@ module Zernio
2841
3111
  # @option opts [String] :level Row granularity
2842
3112
  # @option opts [String] :fields Comma-separated Graph insights fields (e.g. spend,impressions,frequency,website_purchase_roas). Omitted &#x3D; Meta&#39;s default set.
2843
3113
  # @option opts [String] :breakdowns Comma-separated Graph breakdowns (e.g. age,gender or publisher_platform).
3114
+ # @option opts [String] :action_breakdowns Comma-separated Graph action breakdowns. Segments the actions[] arrays in each row.
3115
+ # @option opts [String] :action_attribution_windows Comma-separated Meta attribution windows. Action values are returned keyed per window.
3116
+ # @option opts [String] :action_report_time When actions are counted: impression, conversion or mixed.
3117
+ # @option opts [Boolean] :use_unified_attribution_setting Use the ad sets&#39; own attribution settings for action counting.
2844
3118
  # @option opts [String] :filtering JSON array of Meta filter objects: [{\&quot;field\&quot;, \&quot;operator\&quot;, \&quot;value\&quot;}]. Applied server-side by Meta.
2845
3119
  # @option opts [String] :date_preset Meta date_preset (e.g. last_7d, last_30d, this_month). Mutually exclusive with fromDate/toDate.
2846
3120
  # @option opts [Date] :from_date Start of range (YYYY-MM-DD); requires toDate.
@@ -2862,6 +3136,10 @@ module Zernio
2862
3136
  # @option opts [String] :level Row granularity
2863
3137
  # @option opts [String] :fields Comma-separated Graph insights fields (e.g. spend,impressions,frequency,website_purchase_roas). Omitted &#x3D; Meta&#39;s default set.
2864
3138
  # @option opts [String] :breakdowns Comma-separated Graph breakdowns (e.g. age,gender or publisher_platform).
3139
+ # @option opts [String] :action_breakdowns Comma-separated Graph action breakdowns. Segments the actions[] arrays in each row.
3140
+ # @option opts [String] :action_attribution_windows Comma-separated Meta attribution windows. Action values are returned keyed per window.
3141
+ # @option opts [String] :action_report_time When actions are counted: impression, conversion or mixed.
3142
+ # @option opts [Boolean] :use_unified_attribution_setting Use the ad sets&#39; own attribution settings for action counting.
2865
3143
  # @option opts [String] :filtering JSON array of Meta filter objects: [{\&quot;field\&quot;, \&quot;operator\&quot;, \&quot;value\&quot;}]. Applied server-side by Meta.
2866
3144
  # @option opts [String] :date_preset Meta date_preset (e.g. last_7d, last_30d, this_month). Mutually exclusive with fromDate/toDate.
2867
3145
  # @option opts [Date] :from_date Start of range (YYYY-MM-DD); requires toDate.
@@ -2904,6 +3182,10 @@ module Zernio
2904
3182
  query_params[:'level'] = opts[:'level'] if !opts[:'level'].nil?
2905
3183
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
2906
3184
  query_params[:'breakdowns'] = opts[:'breakdowns'] if !opts[:'breakdowns'].nil?
3185
+ query_params[:'actionBreakdowns'] = opts[:'action_breakdowns'] if !opts[:'action_breakdowns'].nil?
3186
+ query_params[:'actionAttributionWindows'] = opts[:'action_attribution_windows'] if !opts[:'action_attribution_windows'].nil?
3187
+ query_params[:'actionReportTime'] = opts[:'action_report_time'] if !opts[:'action_report_time'].nil?
3188
+ query_params[:'useUnifiedAttributionSetting'] = opts[:'use_unified_attribution_setting'] if !opts[:'use_unified_attribution_setting'].nil?
2907
3189
  query_params[:'filtering'] = opts[:'filtering'] if !opts[:'filtering'].nil?
2908
3190
  query_params[:'datePreset'] = opts[:'date_preset'] if !opts[:'date_preset'].nil?
2909
3191
  query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
@@ -29,6 +29,18 @@ module Zernio
29
29
  # Comma-separated Graph breakdowns.
30
30
  attr_accessor :breakdowns
31
31
 
32
+ # Comma-separated Graph action breakdowns (e.g. action_type,action_destination).
33
+ attr_accessor :action_breakdowns
34
+
35
+ # Meta attribution windows (e.g. [\"7d_click\", \"1d_view\"]). Action values are returned keyed per window.
36
+ attr_accessor :action_attribution_windows
37
+
38
+ # When actions are counted: impression, conversion or mixed.
39
+ attr_accessor :action_report_time
40
+
41
+ # Use the ad sets' own attribution settings for action counting.
42
+ attr_accessor :use_unified_attribution_setting
43
+
32
44
  # Meta filter objects, applied server-side.
33
45
  attr_accessor :filtering
34
46
 
@@ -71,6 +83,10 @@ module Zernio
71
83
  :'level' => :'level',
72
84
  :'fields' => :'fields',
73
85
  :'breakdowns' => :'breakdowns',
86
+ :'action_breakdowns' => :'actionBreakdowns',
87
+ :'action_attribution_windows' => :'actionAttributionWindows',
88
+ :'action_report_time' => :'actionReportTime',
89
+ :'use_unified_attribution_setting' => :'useUnifiedAttributionSetting',
74
90
  :'filtering' => :'filtering',
75
91
  :'date_preset' => :'datePreset',
76
92
  :'from_date' => :'fromDate',
@@ -97,6 +113,10 @@ module Zernio
97
113
  :'level' => :'String',
98
114
  :'fields' => :'String',
99
115
  :'breakdowns' => :'String',
116
+ :'action_breakdowns' => :'String',
117
+ :'action_attribution_windows' => :'Array<String>',
118
+ :'action_report_time' => :'String',
119
+ :'use_unified_attribution_setting' => :'Boolean',
100
120
  :'filtering' => :'Array<CreateAdInsightsReportRequestFilteringInner>',
101
121
  :'date_preset' => :'String',
102
122
  :'from_date' => :'Date',
@@ -151,6 +171,24 @@ module Zernio
151
171
  self.breakdowns = attributes[:'breakdowns']
152
172
  end
153
173
 
174
+ if attributes.key?(:'action_breakdowns')
175
+ self.action_breakdowns = attributes[:'action_breakdowns']
176
+ end
177
+
178
+ if attributes.key?(:'action_attribution_windows')
179
+ if (value = attributes[:'action_attribution_windows']).is_a?(Array)
180
+ self.action_attribution_windows = value
181
+ end
182
+ end
183
+
184
+ if attributes.key?(:'action_report_time')
185
+ self.action_report_time = attributes[:'action_report_time']
186
+ end
187
+
188
+ if attributes.key?(:'use_unified_attribution_setting')
189
+ self.use_unified_attribution_setting = attributes[:'use_unified_attribution_setting']
190
+ end
191
+
154
192
  if attributes.key?(:'filtering')
155
193
  if (value = attributes[:'filtering']).is_a?(Array)
156
194
  self.filtering = value
@@ -241,6 +279,10 @@ module Zernio
241
279
  level == o.level &&
242
280
  fields == o.fields &&
243
281
  breakdowns == o.breakdowns &&
282
+ action_breakdowns == o.action_breakdowns &&
283
+ action_attribution_windows == o.action_attribution_windows &&
284
+ action_report_time == o.action_report_time &&
285
+ use_unified_attribution_setting == o.use_unified_attribution_setting &&
244
286
  filtering == o.filtering &&
245
287
  date_preset == o.date_preset &&
246
288
  from_date == o.from_date &&
@@ -257,7 +299,7 @@ module Zernio
257
299
  # Calculates hash code according to all attributes.
258
300
  # @return [Integer] Hash code
259
301
  def hash
260
- [account_id, object_id, level, fields, breakdowns, filtering, date_preset, from_date, to_date, time_increment].hash
302
+ [account_id, object_id, level, fields, breakdowns, action_breakdowns, action_attribution_windows, action_report_time, use_unified_attribution_setting, filtering, date_preset, from_date, to_date, time_increment].hash
261
303
  end
262
304
 
263
305
  # Builds the object from hash