late-sdk 0.0.894 → 0.0.896

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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -3
  3. data/docs/AdAccountsApi.md +446 -0
  4. data/docs/AdAnalyticsResponse.md +1 -1
  5. data/docs/AdAnalyticsResponseAnalytics.md +22 -0
  6. data/docs/AdCampaign.md +1 -1
  7. data/docs/AdCampaignBudget.md +11 -3
  8. data/docs/AdCampaignsApi.md +149 -3
  9. data/docs/AdInsightsApi.md +1 -1
  10. data/docs/AdNegativeKeywordList.md +26 -0
  11. data/docs/AdNegativeKeywordListKeyword.md +22 -0
  12. data/docs/BoostPostRequest.md +6 -4
  13. data/docs/CampaignAnalyticsResponseAnalytics.md +3 -1
  14. data/docs/CampaignAnalyticsResponseAnalyticsImpressionShareCache.md +20 -0
  15. data/docs/CampaignAnalyticsResponseAnalyticsSummary.md +96 -0
  16. data/docs/CampaignAnalyticsResponseCampaign.md +2 -0
  17. data/docs/CreateAdNegativeKeywordList201Response.md +24 -0
  18. data/docs/CreateAdNegativeKeywordListRequest.md +26 -0
  19. data/docs/CreateCallAdRequest.md +8 -2
  20. data/docs/CreateMessagingAdRequest.md +8 -2
  21. data/docs/CtwaAdRequestBody.md +8 -2
  22. data/docs/CtwaAdRequestBodyCreativesInner.md +7 -3
  23. data/docs/DeleteAdNegativeKeywordList200Response.md +20 -0
  24. data/docs/GetAdAnalytics202Response.md +1 -1
  25. data/docs/GetAdNegativeKeywordList200Response.md +24 -0
  26. data/docs/GetAdNegativeKeywordList200ResponseList.md +28 -0
  27. data/docs/ListAdNegativeKeywordLists200Response.md +24 -0
  28. data/docs/MediaItem.md +1 -1
  29. data/docs/MessagingAdsApi.md +10 -10
  30. data/docs/ReplaceAdNegativeKeywordListKeywords200Response.md +22 -0
  31. data/docs/ReplaceAdNegativeKeywordListKeywordsRequest.md +24 -0
  32. data/docs/ReplaceCampaignNegativeKeywordListsRequest.md +20 -0
  33. data/docs/UpdateAdCampaign200Response.md +1 -1
  34. data/docs/UpdateAdCampaignRequest.md +2 -0
  35. data/docs/UpdateAdNegativeKeywordList200Response.md +20 -0
  36. data/docs/UpdateAdNegativeKeywordListRequest.md +24 -0
  37. data/lib/zernio-sdk/api/ad_accounts_api.rb +500 -0
  38. data/lib/zernio-sdk/api/ad_campaigns_api.rb +160 -6
  39. data/lib/zernio-sdk/api/ad_insights_api.rb +2 -2
  40. data/lib/zernio-sdk/api/messaging_ads_api.rb +8 -8
  41. data/lib/zernio-sdk/models/ad_analytics_response.rb +1 -1
  42. data/lib/zernio-sdk/models/ad_analytics_response_analytics.rb +169 -0
  43. data/lib/zernio-sdk/models/ad_campaign.rb +3 -1
  44. data/lib/zernio-sdk/models/ad_campaign_budget.rb +99 -5
  45. data/lib/zernio-sdk/models/ad_negative_keyword_list.rb +209 -0
  46. data/lib/zernio-sdk/models/ad_negative_keyword_list_keyword.rb +222 -0
  47. data/lib/zernio-sdk/models/boost_post_request.rb +38 -7
  48. data/lib/zernio-sdk/models/campaign_analytics_response_analytics.rb +11 -2
  49. data/lib/zernio-sdk/models/campaign_analytics_response_analytics_impression_share_cache.rb +158 -0
  50. data/lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb +550 -0
  51. data/lib/zernio-sdk/models/campaign_analytics_response_campaign.rb +11 -1
  52. data/lib/zernio-sdk/models/create_ad_negative_keyword_list201_response.rb +220 -0
  53. data/lib/zernio-sdk/models/create_ad_negative_keyword_list_request.rb +327 -0
  54. data/lib/zernio-sdk/models/create_call_ad_request.rb +94 -3
  55. data/lib/zernio-sdk/models/create_messaging_ad_request.rb +94 -3
  56. data/lib/zernio-sdk/models/ctwa_ad_request_body.rb +95 -4
  57. data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner.rb +67 -21
  58. data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner_video.rb +1 -1
  59. data/lib/zernio-sdk/models/ctwa_ad_request_body_video.rb +1 -1
  60. data/lib/zernio-sdk/models/{ad_campaign_campaign_budget.rb → delete_ad_negative_keyword_list200_response.rb} +35 -48
  61. data/lib/zernio-sdk/models/get_ad_analytics202_response.rb +1 -1
  62. data/lib/zernio-sdk/models/get_ad_negative_keyword_list200_response.rb +199 -0
  63. data/lib/zernio-sdk/models/get_ad_negative_keyword_list200_response_list.rb +227 -0
  64. data/lib/zernio-sdk/models/list_ad_negative_keyword_lists200_response.rb +201 -0
  65. data/lib/zernio-sdk/models/media_item.rb +1 -0
  66. data/lib/zernio-sdk/models/replace_ad_negative_keyword_list_keywords200_response.rb +189 -0
  67. data/lib/zernio-sdk/models/replace_ad_negative_keyword_list_keywords_request.rb +289 -0
  68. data/lib/zernio-sdk/models/replace_campaign_negative_keyword_lists_request.rb +219 -0
  69. data/lib/zernio-sdk/models/update_ad_campaign200_response.rb +1 -1
  70. data/lib/zernio-sdk/models/update_ad_campaign_request.rb +13 -1
  71. data/lib/zernio-sdk/models/update_ad_campaign_request_budget.rb +1 -1
  72. data/lib/zernio-sdk/models/update_ad_negative_keyword_list200_response.rb +178 -0
  73. data/lib/zernio-sdk/models/update_ad_negative_keyword_list_request.rb +296 -0
  74. data/lib/zernio-sdk/version.rb +1 -1
  75. data/lib/zernio-sdk.rb +16 -1
  76. data/openapi.yaml +981 -43
  77. data/spec/api/ad_accounts_api_spec.rb +82 -0
  78. data/spec/api/ad_campaigns_api_spec.rb +29 -3
  79. data/spec/api/ad_insights_api_spec.rb +1 -1
  80. data/spec/api/messaging_ads_api_spec.rb +4 -4
  81. data/spec/models/ad_analytics_response_analytics_spec.rb +48 -0
  82. data/spec/models/ad_campaign_budget_spec.rb +24 -0
  83. data/spec/models/ad_negative_keyword_list_keyword_spec.rb +52 -0
  84. data/spec/models/ad_negative_keyword_list_spec.rb +60 -0
  85. data/spec/models/boost_post_request_spec.rb +7 -1
  86. data/spec/models/campaign_analytics_response_analytics_impression_share_cache_spec.rb +42 -0
  87. data/spec/models/campaign_analytics_response_analytics_spec.rb +6 -0
  88. data/spec/models/campaign_analytics_response_analytics_summary_spec.rb +270 -0
  89. data/spec/models/campaign_analytics_response_campaign_spec.rb +6 -0
  90. data/spec/models/create_ad_negative_keyword_list201_response_spec.rb +54 -0
  91. data/spec/models/create_ad_negative_keyword_list_request_spec.rb +64 -0
  92. data/spec/models/create_call_ad_request_spec.rb +18 -0
  93. data/spec/models/create_messaging_ad_request_spec.rb +18 -0
  94. data/spec/models/ctwa_ad_request_body_creatives_inner_spec.rb +12 -0
  95. data/spec/models/ctwa_ad_request_body_spec.rb +18 -0
  96. data/spec/models/delete_ad_negative_keyword_list200_response_spec.rb +42 -0
  97. data/spec/models/get_ad_negative_keyword_list200_response_list_spec.rb +66 -0
  98. data/spec/models/get_ad_negative_keyword_list200_response_spec.rb +54 -0
  99. data/spec/models/list_ad_negative_keyword_lists200_response_spec.rb +54 -0
  100. data/spec/models/replace_ad_negative_keyword_list_keywords200_response_spec.rb +48 -0
  101. data/spec/models/replace_ad_negative_keyword_list_keywords_request_spec.rb +58 -0
  102. data/spec/models/{ad_campaign_campaign_budget_spec.rb → replace_campaign_negative_keyword_lists_request_spec.rb} +12 -12
  103. data/spec/models/update_ad_campaign_request_spec.rb +6 -0
  104. data/spec/models/update_ad_negative_keyword_list200_response_spec.rb +42 -0
  105. data/spec/models/update_ad_negative_keyword_list_request_spec.rb +58 -0
  106. data/zernio-sdk-0.0.896.gem +0 -0
  107. metadata +66 -6
  108. data/docs/AdCampaignCampaignBudget.md +0 -20
  109. data/zernio-sdk-0.0.894.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` and `adSetId` are Meta-only and return 400 on other platforms. **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 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).
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` and `adSetId` are Meta-only and return 400 on other platforms. **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 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).
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.
@@ -1552,7 +1552,7 @@ module Zernio
1552
1552
  end
1553
1553
 
1554
1554
  # List campaigns
1555
- # Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID. Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign. Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected).
1555
+ # Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID. Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign. Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected). Google campaign budgets include amountMicros, explicitlyShared, resourceName and deliveryMethod after the next successful sync. This endpoint does not fetch Google live.
1556
1556
  # @param [Hash] opts the optional parameters
1557
1557
  # @option opts [Boolean] :include_empty Meta only. Campaign reads aggregate over ad documents, so a campaign with ZERO ads is normally invisible here, the state the two-step create (campaign, then ads via `existingCampaignId`) leaves behind whenever Meta rejects the ad step. Set true to list those too, with `adCount: 0` and zeroed metrics. Requires `accountId` and `adAccountId`, since an empty campaign has no ad row to resolve a token or ad account from.
1558
1558
  # @option opts [Integer] :page Page number (1-based) (default to 1)
@@ -1575,7 +1575,7 @@ module Zernio
1575
1575
  end
1576
1576
 
1577
1577
  # List campaigns
1578
- # Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID. Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign. Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected).
1578
+ # Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID. Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign. Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected). Google campaign budgets include amountMicros, explicitlyShared, resourceName and deliveryMethod after the next successful sync. This endpoint does not fetch Google live.
1579
1579
  # @param [Hash] opts the optional parameters
1580
1580
  # @option opts [Boolean] :include_empty Meta only. Campaign reads aggregate over ad documents, so a campaign with ZERO ads is normally invisible here, the state the two-step create (campaign, then ads via `existingCampaignId`) leaves behind whenever Meta rejects the ad step. Set true to list those too, with `adCount: 0` and zeroed metrics. Requires `accountId` and `adAccountId`, since an empty campaign has no ad row to resolve a token or ad account from.
1581
1581
  # @option opts [Integer] :page Page number (1-based) (default to 1)
@@ -2056,6 +2056,81 @@ module Zernio
2056
2056
  return data, status_code, headers
2057
2057
  end
2058
2058
 
2059
+ # List campaign negative lists
2060
+ # Returns shared negative keyword lists attached to the campaign, separate from campaign-level negative keywords. Google Ads shared negative keyword lists (shared_set type NEGATIVE_KEYWORDS). Reads are cached for 10 minutes; quota exhaustion may return the last successful result for up to 7 days with stale=true. Customer selection is limited to this connection and its account scope.
2061
+ # @param campaign_id [String]
2062
+ # @param [Hash] opts the optional parameters
2063
+ # @option opts [String] :platform
2064
+ # @return [ListAdNegativeKeywordLists200Response]
2065
+ def list_campaign_negative_keyword_lists(campaign_id, opts = {})
2066
+ data, _status_code, _headers = list_campaign_negative_keyword_lists_with_http_info(campaign_id, opts)
2067
+ data
2068
+ end
2069
+
2070
+ # List campaign negative lists
2071
+ # Returns shared negative keyword lists attached to the campaign, separate from campaign-level negative keywords. Google Ads shared negative keyword lists (shared_set type NEGATIVE_KEYWORDS). Reads are cached for 10 minutes; quota exhaustion may return the last successful result for up to 7 days with stale=true. Customer selection is limited to this connection and its account scope.
2072
+ # @param campaign_id [String]
2073
+ # @param [Hash] opts the optional parameters
2074
+ # @option opts [String] :platform
2075
+ # @return [Array<(ListAdNegativeKeywordLists200Response, Integer, Hash)>] ListAdNegativeKeywordLists200Response data, response status code and response headers
2076
+ def list_campaign_negative_keyword_lists_with_http_info(campaign_id, opts = {})
2077
+ if @api_client.config.debugging
2078
+ @api_client.config.logger.debug 'Calling API: AdCampaignsApi.list_campaign_negative_keyword_lists ...'
2079
+ end
2080
+ # verify the required parameter 'campaign_id' is set
2081
+ if @api_client.config.client_side_validation && campaign_id.nil?
2082
+ fail ArgumentError, "Missing the required parameter 'campaign_id' when calling AdCampaignsApi.list_campaign_negative_keyword_lists"
2083
+ end
2084
+ pattern = Regexp.new(/^\d+$/)
2085
+ if @api_client.config.client_side_validation && campaign_id !~ pattern
2086
+ fail ArgumentError, "invalid value for 'campaign_id' when calling AdCampaignsApi.list_campaign_negative_keyword_lists, must conform to the pattern #{pattern}."
2087
+ end
2088
+
2089
+ allowable_values = ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter", "openai"]
2090
+ if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform'])
2091
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
2092
+ end
2093
+ # resource path
2094
+ local_var_path = '/v1/ads/campaigns/{campaignId}/negative-keyword-lists'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))
2095
+
2096
+ # query parameters
2097
+ query_params = opts[:query_params] || {}
2098
+ query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
2099
+
2100
+ # header parameters
2101
+ header_params = opts[:header_params] || {}
2102
+ # HTTP header 'Accept' (if needed)
2103
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2104
+
2105
+ # form parameters
2106
+ form_params = opts[:form_params] || {}
2107
+
2108
+ # http body (model)
2109
+ post_body = opts[:debug_body]
2110
+
2111
+ # return_type
2112
+ return_type = opts[:debug_return_type] || 'ListAdNegativeKeywordLists200Response'
2113
+
2114
+ # auth_names
2115
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2116
+
2117
+ new_options = opts.merge(
2118
+ :operation => :"AdCampaignsApi.list_campaign_negative_keyword_lists",
2119
+ :header_params => header_params,
2120
+ :query_params => query_params,
2121
+ :form_params => form_params,
2122
+ :body => post_body,
2123
+ :auth_names => auth_names,
2124
+ :return_type => return_type
2125
+ )
2126
+
2127
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2128
+ if @api_client.config.debugging
2129
+ @api_client.config.logger.debug "API called: AdCampaignsApi#list_campaign_negative_keyword_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2130
+ end
2131
+ return data, status_code, headers
2132
+ end
2133
+
2059
2134
  # List campaign-level negative keywords
2060
2135
  # Returns the campaign-level negative keywords (`campaign_criterion.negative`), distinct from the ad-group-level negatives under `GET /v1/ads/keywords`. Cached for the quota window (not synced to Postgres), and gated by the shared Google Ads operations budget like every other on-demand Google surface. The response carries `cachedAt` and `stale`, set when a quota-exhausted call falls back to the last-good copy instead of a live read. The platform is always discovered from the campaign itself; a non-Google campaign returns 501 rather than 404, whether or not `platform` was passed.
2061
2136
  # @param campaign_id [String] Platform campaign ID
@@ -2189,6 +2264,85 @@ module Zernio
2189
2264
  return data, status_code, headers
2190
2265
  end
2191
2266
 
2267
+ # Replace campaign negative lists
2268
+ # Sets the full desired set of shared negative keyword list associations on this campaign. Send listIds=[] to detach all negative keyword lists. Only campaign_shared_set links are changed; the lists and their keywords are preserved. Every list must belong to the campaign customer and have type NEGATIVE_KEYWORDS.
2269
+ # @param campaign_id [String]
2270
+ # @param replace_campaign_negative_keyword_lists_request [ReplaceCampaignNegativeKeywordListsRequest]
2271
+ # @param [Hash] opts the optional parameters
2272
+ # @return [ReplaceAdNegativeKeywordListKeywords200Response]
2273
+ def replace_campaign_negative_keyword_lists(campaign_id, replace_campaign_negative_keyword_lists_request, opts = {})
2274
+ data, _status_code, _headers = replace_campaign_negative_keyword_lists_with_http_info(campaign_id, replace_campaign_negative_keyword_lists_request, opts)
2275
+ data
2276
+ end
2277
+
2278
+ # Replace campaign negative lists
2279
+ # Sets the full desired set of shared negative keyword list associations on this campaign. Send listIds&#x3D;[] to detach all negative keyword lists. Only campaign_shared_set links are changed; the lists and their keywords are preserved. Every list must belong to the campaign customer and have type NEGATIVE_KEYWORDS.
2280
+ # @param campaign_id [String]
2281
+ # @param replace_campaign_negative_keyword_lists_request [ReplaceCampaignNegativeKeywordListsRequest]
2282
+ # @param [Hash] opts the optional parameters
2283
+ # @return [Array<(ReplaceAdNegativeKeywordListKeywords200Response, Integer, Hash)>] ReplaceAdNegativeKeywordListKeywords200Response data, response status code and response headers
2284
+ def replace_campaign_negative_keyword_lists_with_http_info(campaign_id, replace_campaign_negative_keyword_lists_request, opts = {})
2285
+ if @api_client.config.debugging
2286
+ @api_client.config.logger.debug 'Calling API: AdCampaignsApi.replace_campaign_negative_keyword_lists ...'
2287
+ end
2288
+ # verify the required parameter 'campaign_id' is set
2289
+ if @api_client.config.client_side_validation && campaign_id.nil?
2290
+ fail ArgumentError, "Missing the required parameter 'campaign_id' when calling AdCampaignsApi.replace_campaign_negative_keyword_lists"
2291
+ end
2292
+ pattern = Regexp.new(/^\d+$/)
2293
+ if @api_client.config.client_side_validation && campaign_id !~ pattern
2294
+ fail ArgumentError, "invalid value for 'campaign_id' when calling AdCampaignsApi.replace_campaign_negative_keyword_lists, must conform to the pattern #{pattern}."
2295
+ end
2296
+
2297
+ # verify the required parameter 'replace_campaign_negative_keyword_lists_request' is set
2298
+ if @api_client.config.client_side_validation && replace_campaign_negative_keyword_lists_request.nil?
2299
+ fail ArgumentError, "Missing the required parameter 'replace_campaign_negative_keyword_lists_request' when calling AdCampaignsApi.replace_campaign_negative_keyword_lists"
2300
+ end
2301
+ # resource path
2302
+ local_var_path = '/v1/ads/campaigns/{campaignId}/negative-keyword-lists'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))
2303
+
2304
+ # query parameters
2305
+ query_params = opts[:query_params] || {}
2306
+
2307
+ # header parameters
2308
+ header_params = opts[:header_params] || {}
2309
+ # HTTP header 'Accept' (if needed)
2310
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2311
+ # HTTP header 'Content-Type'
2312
+ content_type = @api_client.select_header_content_type(['application/json'])
2313
+ if !content_type.nil?
2314
+ header_params['Content-Type'] = content_type
2315
+ end
2316
+
2317
+ # form parameters
2318
+ form_params = opts[:form_params] || {}
2319
+
2320
+ # http body (model)
2321
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(replace_campaign_negative_keyword_lists_request)
2322
+
2323
+ # return_type
2324
+ return_type = opts[:debug_return_type] || 'ReplaceAdNegativeKeywordListKeywords200Response'
2325
+
2326
+ # auth_names
2327
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2328
+
2329
+ new_options = opts.merge(
2330
+ :operation => :"AdCampaignsApi.replace_campaign_negative_keyword_lists",
2331
+ :header_params => header_params,
2332
+ :query_params => query_params,
2333
+ :form_params => form_params,
2334
+ :body => post_body,
2335
+ :auth_names => auth_names,
2336
+ :return_type => return_type
2337
+ )
2338
+
2339
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2340
+ if @api_client.config.debugging
2341
+ @api_client.config.logger.debug "API called: AdCampaignsApi#replace_campaign_negative_keyword_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2342
+ end
2343
+ return data, status_code, headers
2344
+ end
2345
+
2192
2346
  # Replace campaign-level negative keywords
2193
2347
  # Replaces the FULL set of campaign-level negative keywords (C.270): the desired list is diffed against what Google already has, and the difference is applied as one `create`/`remove` mutate. Send an empty array to clear every campaign negative. The platform is always discovered from the campaign itself; a non-Google campaign returns 501 rather than 404, whether or not `platform` was sent.
2194
2348
  # @param campaign_id [String] Platform campaign ID
@@ -2338,7 +2492,7 @@ module Zernio
2338
2492
  end
2339
2493
 
2340
2494
  # Update a campaign
2341
- # Campaign-level edits. Send at least one of `budget`, `bidStrategy`, `portfolioBidStrategyId`, `name` or `platformSpecificData`. An unsupported field is always an error, never a silent drop. | Body field | Meta | Google | Others | |---|---|---|---| | `bidStrategy` | Yes | Yes | 501 | | `bidAmount`, `roasAverageFloor` | 400 (ad-set level) | Yes | 400 | | `portfolioBidStrategyId` | 400 | Yes | 400 | | `budget` (CBO; ABO returns 409) | Yes | 501 | 501 | | `name` | Yes | 501 | 501 | | `platformSpecificData.spendCap` | Yes | 400 | 400 | | `accountId` (empty campaigns) | Yes | - | - | On Google: `LOWEST_COST_WITHOUT_CAP` = Maximize Conversions, `COST_CAP` + `bidAmount` = Target CPA, `LOWEST_COST_WITH_MIN_ROAS` + `roasAverageFloor` = Target ROAS, `LOWEST_COST_WITH_BID_CAP` + `bidAmount` = Maximize Clicks with a CPC ceiling; `portfolioBidStrategyId` attaches a portfolio strategy instead (exclusive with `bidStrategy`). Setting the standard triplet on a campaign that is currently on a PORTFOLIO strategy is rejected: detach it in Google Ads first, since it is shared across campaigns. `accountId` forwards the update straight to Meta for a campaign with zero ads, which would otherwise 404; the response then carries `updated: 0`.
2495
+ # Campaign-level edits. Send at least one of `budget`, `bidStrategy`, `portfolioBidStrategyId`, `name` or `platformSpecificData`. An unsupported field is always an error, never a silent drop. | Body field | Meta | Google | Others | |---|---|---|---| | `bidStrategy` | Yes | Yes | 501 | | `bidAmount`, `roasAverageFloor` | 400 (ad-set level) | Yes | 400 | | `portfolioBidStrategyId` | 400 | Yes | 400 | | `budget` (CBO; ABO returns 409) | Yes | Daily only | 501 | | `name` | Yes | 501 | 501 | | `platformSpecificData.spendCap` | Yes | 400 | 400 | | `accountId` (empty campaigns) | Yes | - | - | On Google: `LOWEST_COST_WITHOUT_CAP` = Maximize Conversions, `COST_CAP` + `bidAmount` = Target CPA, `LOWEST_COST_WITH_MIN_ROAS` + `roasAverageFloor` = Target ROAS, `LOWEST_COST_WITH_BID_CAP` + `bidAmount` = Maximize Clicks with a CPC ceiling; `portfolioBidStrategyId` attaches a portfolio strategy instead (exclusive with `bidStrategy`). Setting the standard triplet on a campaign that is currently on a PORTFOLIO strategy is rejected: detach it in Google Ads first, since it is shared across campaigns. Google budget updates read the current budget before mutation. Shared budgets return 409 unless allowSharedBudgetUpdate=true is explicitly supplied, because the change affects every campaign using that budget. Unknown sharing state also returns 409. `accountId` forwards the update straight to Meta for a campaign with zero ads, which would otherwise 404; the response then carries `updated: 0`.
2342
2496
  # @param campaign_id [String] Platform campaign ID
2343
2497
  # @param update_ad_campaign_request [UpdateAdCampaignRequest]
2344
2498
  # @param [Hash] opts the optional parameters
@@ -2349,7 +2503,7 @@ module Zernio
2349
2503
  end
2350
2504
 
2351
2505
  # Update a campaign
2352
- # Campaign-level edits. Send at least one of &#x60;budget&#x60;, &#x60;bidStrategy&#x60;, &#x60;portfolioBidStrategyId&#x60;, &#x60;name&#x60; or &#x60;platformSpecificData&#x60;. An unsupported field is always an error, never a silent drop. | Body field | Meta | Google | Others | |---|---|---|---| | &#x60;bidStrategy&#x60; | Yes | Yes | 501 | | &#x60;bidAmount&#x60;, &#x60;roasAverageFloor&#x60; | 400 (ad-set level) | Yes | 400 | | &#x60;portfolioBidStrategyId&#x60; | 400 | Yes | 400 | | &#x60;budget&#x60; (CBO; ABO returns 409) | Yes | 501 | 501 | | &#x60;name&#x60; | Yes | 501 | 501 | | &#x60;platformSpecificData.spendCap&#x60; | Yes | 400 | 400 | | &#x60;accountId&#x60; (empty campaigns) | Yes | - | - | On Google: &#x60;LOWEST_COST_WITHOUT_CAP&#x60; &#x3D; Maximize Conversions, &#x60;COST_CAP&#x60; + &#x60;bidAmount&#x60; &#x3D; Target CPA, &#x60;LOWEST_COST_WITH_MIN_ROAS&#x60; + &#x60;roasAverageFloor&#x60; &#x3D; Target ROAS, &#x60;LOWEST_COST_WITH_BID_CAP&#x60; + &#x60;bidAmount&#x60; &#x3D; Maximize Clicks with a CPC ceiling; &#x60;portfolioBidStrategyId&#x60; attaches a portfolio strategy instead (exclusive with &#x60;bidStrategy&#x60;). Setting the standard triplet on a campaign that is currently on a PORTFOLIO strategy is rejected: detach it in Google Ads first, since it is shared across campaigns. &#x60;accountId&#x60; forwards the update straight to Meta for a campaign with zero ads, which would otherwise 404; the response then carries &#x60;updated: 0&#x60;.
2506
+ # Campaign-level edits. Send at least one of &#x60;budget&#x60;, &#x60;bidStrategy&#x60;, &#x60;portfolioBidStrategyId&#x60;, &#x60;name&#x60; or &#x60;platformSpecificData&#x60;. An unsupported field is always an error, never a silent drop. | Body field | Meta | Google | Others | |---|---|---|---| | &#x60;bidStrategy&#x60; | Yes | Yes | 501 | | &#x60;bidAmount&#x60;, &#x60;roasAverageFloor&#x60; | 400 (ad-set level) | Yes | 400 | | &#x60;portfolioBidStrategyId&#x60; | 400 | Yes | 400 | | &#x60;budget&#x60; (CBO; ABO returns 409) | Yes | Daily only | 501 | | &#x60;name&#x60; | Yes | 501 | 501 | | &#x60;platformSpecificData.spendCap&#x60; | Yes | 400 | 400 | | &#x60;accountId&#x60; (empty campaigns) | Yes | - | - | On Google: &#x60;LOWEST_COST_WITHOUT_CAP&#x60; &#x3D; Maximize Conversions, &#x60;COST_CAP&#x60; + &#x60;bidAmount&#x60; &#x3D; Target CPA, &#x60;LOWEST_COST_WITH_MIN_ROAS&#x60; + &#x60;roasAverageFloor&#x60; &#x3D; Target ROAS, &#x60;LOWEST_COST_WITH_BID_CAP&#x60; + &#x60;bidAmount&#x60; &#x3D; Maximize Clicks with a CPC ceiling; &#x60;portfolioBidStrategyId&#x60; attaches a portfolio strategy instead (exclusive with &#x60;bidStrategy&#x60;). Setting the standard triplet on a campaign that is currently on a PORTFOLIO strategy is rejected: detach it in Google Ads first, since it is shared across campaigns. Google budget updates read the current budget before mutation. Shared budgets return 409 unless allowSharedBudgetUpdate&#x3D;true is explicitly supplied, because the change affects every campaign using that budget. Unknown sharing state also returns 409. &#x60;accountId&#x60; forwards the update straight to Meta for a campaign with zero ads, which would otherwise 404; the response then carries &#x60;updated: 0&#x60;.
2353
2507
  # @param campaign_id [String] Platform campaign ID
2354
2508
  # @param update_ad_campaign_request [UpdateAdCampaignRequest]
2355
2509
  # @param [Hash] opts the optional parameters
@@ -462,7 +462,7 @@ module Zernio
462
462
  end
463
463
 
464
464
  # Get campaign analytics
465
- # Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign's ads), and optional demographic breakdowns. Breakdowns are fetched live from Meta at the campaign level (one call per dimension, no per-ad fan-out), so an agency dashboard gets campaign-level age/gender/etc. without summing thousands of per-ad reads. `campaignId` is the platform campaign id; pass `platform` when a campaign id could be ambiguous across platforms. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
465
+ # Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign's ads), and optional demographic breakdowns. Breakdowns are fetched live from Meta at the campaign level (one call per dimension, no per-ad fan-out), so an agency dashboard gets campaign-level age/gender/etc. without summing thousands of per-ad reads. `campaignId` is the platform campaign id; pass `platform` when a campaign id could be ambiguous across platforms. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. Google adds searchImpressionShare, searchBudgetLostImpressionShare, searchRankLostImpressionShare, searchTopImpressionShare and searchAbsoluteTopImpressionShare under analytics.summary for the requested inclusive range. These ratios are queried together without daily segmentation and cached for 10 minutes. Unavailable values are null. analytics.impressionShareCache reports cachedAt and stale independently of synced metrics.
466
466
  # @param campaign_id [String] Platform campaign id (platformCampaignId).
467
467
  # @param [Hash] opts the optional parameters
468
468
  # @option opts [String] :platform Disambiguate when the campaign id exists across platforms (e.g. facebook, instagram).
@@ -476,7 +476,7 @@ module Zernio
476
476
  end
477
477
 
478
478
  # Get campaign analytics
479
- # Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign&#39;s ads), and optional demographic breakdowns. Breakdowns are fetched live from Meta at the campaign level (one call per dimension, no per-ad fan-out), so an agency dashboard gets campaign-level age/gender/etc. without summing thousands of per-ad reads. &#x60;campaignId&#x60; is the platform campaign id; pass &#x60;platform&#x60; when a campaign id could be ambiguous across platforms. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
479
+ # Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign&#39;s ads), and optional demographic breakdowns. Breakdowns are fetched live from Meta at the campaign level (one call per dimension, no per-ad fan-out), so an agency dashboard gets campaign-level age/gender/etc. without summing thousands of per-ad reads. &#x60;campaignId&#x60; is the platform campaign id; pass &#x60;platform&#x60; when a campaign id could be ambiguous across platforms. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. Google adds searchImpressionShare, searchBudgetLostImpressionShare, searchRankLostImpressionShare, searchTopImpressionShare and searchAbsoluteTopImpressionShare under analytics.summary for the requested inclusive range. These ratios are queried together without daily segmentation and cached for 10 minutes. Unavailable values are null. analytics.impressionShareCache reports cachedAt and stale independently of synced metrics.
480
480
  # @param campaign_id [String] Platform campaign id (platformCampaignId).
481
481
  # @param [Hash] opts the optional parameters
482
482
  # @option opts [String] :platform Disambiguate when the campaign id exists across platforms (e.g. facebook, instagram).
@@ -87,8 +87,8 @@ module Zernio
87
87
  return data, status_code, headers
88
88
  end
89
89
 
90
- # Create Click-to-WhatsApp ad (deprecated)
91
- # 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. **Attach shape.** Send `adSetId` (with either creative shape) to add the ads to an EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase, the way to refresh a CTWA creative without resetting delivery. The ad set then owns budget, targeting and schedule, so `budgetAmount`, `budgetType`, `endDate`, `objective`, `countries`, `interests` and `audienceId` are rejected with a 400 alongside it rather than silently dropped. The target ad set's `destination_type` must match the ad's destination (a WhatsApp ad needs a `WHATSAPP` ad set), otherwise Meta would accept an ad that never delivers. 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.
90
+ # Create CTWA ad (deprecated)
91
+ # 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`, or an `existingPostId` / `objectStoryId` reference. Creates 1 campaign + 1 ad set + 1 ad. - **Multi-creative**: supply a `creatives[]` array with N entries (each carrying fresh media and copy or an existing post reference). 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. **Attach shape.** Send `adSetId` (with either creative shape) to add the ads to an EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase, the way to refresh a CTWA creative without resetting delivery. The ad set then owns budget, targeting and schedule, so `budgetAmount`, `budgetType`, `endDate`, `objective`, `countries`, `interests` and `audienceId` are rejected with a 400 alongside it rather than silently dropped. The target ad set's `destination_type` must match the ad's destination (a WhatsApp ad needs a `WHATSAPP` ad set), otherwise Meta would accept an ad that never delivers. 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. Existing posts and reels are supported through `existingPostId` or `objectStoryId`, either per creative or at the top level. Omit fresh media and copy for that creative. Optional `whatsappPhoneNumber` selects a number already paired with the Page (WhatsApp destination only).
92
92
  # @param ctwa_ad_request_body [CtwaAdRequestBody]
93
93
  # @param [Hash] opts the optional parameters
94
94
  # @return [CreateMessagingAd201Response]
@@ -97,8 +97,8 @@ module Zernio
97
97
  data
98
98
  end
99
99
 
100
- # Create Click-to-WhatsApp ad (deprecated)
101
- # 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. **Attach shape.** Send &#x60;adSetId&#x60; (with either creative shape) to add the ads to an EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase, the way to refresh a CTWA creative without resetting delivery. The ad set then owns budget, targeting and schedule, so &#x60;budgetAmount&#x60;, &#x60;budgetType&#x60;, &#x60;endDate&#x60;, &#x60;objective&#x60;, &#x60;countries&#x60;, &#x60;interests&#x60; and &#x60;audienceId&#x60; are rejected with a 400 alongside it rather than silently dropped. The target ad set&#39;s &#x60;destination_type&#x60; must match the ad&#39;s destination (a WhatsApp ad needs a &#x60;WHATSAPP&#x60; ad set), otherwise Meta would accept an ad that never delivers. 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.
100
+ # Create CTWA ad (deprecated)
101
+ # 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;, or an &#x60;existingPostId&#x60; / &#x60;objectStoryId&#x60; reference. Creates 1 campaign + 1 ad set + 1 ad. - **Multi-creative**: supply a &#x60;creatives[]&#x60; array with N entries (each carrying fresh media and copy or an existing post reference). 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. **Attach shape.** Send &#x60;adSetId&#x60; (with either creative shape) to add the ads to an EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase, the way to refresh a CTWA creative without resetting delivery. The ad set then owns budget, targeting and schedule, so &#x60;budgetAmount&#x60;, &#x60;budgetType&#x60;, &#x60;endDate&#x60;, &#x60;objective&#x60;, &#x60;countries&#x60;, &#x60;interests&#x60; and &#x60;audienceId&#x60; are rejected with a 400 alongside it rather than silently dropped. The target ad set&#39;s &#x60;destination_type&#x60; must match the ad&#39;s destination (a WhatsApp ad needs a &#x60;WHATSAPP&#x60; ad set), otherwise Meta would accept an ad that never delivers. 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. Existing posts and reels are supported through &#x60;existingPostId&#x60; or &#x60;objectStoryId&#x60;, either per creative or at the top level. Omit fresh media and copy for that creative. Optional &#x60;whatsappPhoneNumber&#x60; selects a number already paired with the Page (WhatsApp destination only).
102
102
  # @param ctwa_ad_request_body [CtwaAdRequestBody]
103
103
  # @param [Hash] opts the optional parameters
104
104
  # @return [Array<(CreateMessagingAd201Response, Integer, Hash)>] CreateMessagingAd201Response data, response status code and response headers
@@ -155,8 +155,8 @@ module Zernio
155
155
  return data, status_code, headers
156
156
  end
157
157
 
158
- # Create click-to-message ad (WhatsApp / Messenger / Instagram Direct)
159
- # 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`).
158
+ # Create messaging ad
159
+ # 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`). Existing posts and reels are supported through `existingPostId` or `objectStoryId`, either per creative or at the top level. Omit fresh media and copy for that creative. Optional `whatsappPhoneNumber` selects a number already paired with the Page (WhatsApp destination only).
160
160
  # @param create_messaging_ad_request [CreateMessagingAdRequest]
161
161
  # @param [Hash] opts the optional parameters
162
162
  # @return [CreateMessagingAd201Response]
@@ -165,8 +165,8 @@ module Zernio
165
165
  data
166
166
  end
167
167
 
168
- # Create click-to-message ad (WhatsApp / Messenger / Instagram Direct)
169
- # 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;).
168
+ # Create messaging ad
169
+ # 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;). Existing posts and reels are supported through &#x60;existingPostId&#x60; or &#x60;objectStoryId&#x60;, either per creative or at the top level. Omit fresh media and copy for that creative. Optional &#x60;whatsappPhoneNumber&#x60; selects a number already paired with the Page (WhatsApp destination only).
170
170
  # @param create_messaging_ad_request [CreateMessagingAdRequest]
171
171
  # @param [Hash] opts the optional parameters
172
172
  # @return [Array<(CreateMessagingAd201Response, Integer, Hash)>] CreateMessagingAd201Response data, response status code and response headers
@@ -46,7 +46,7 @@ module Zernio
46
46
  {
47
47
  :'backfill_pending' => :'Boolean',
48
48
  :'ad' => :'AdAnalyticsResponseAd',
49
- :'analytics' => :'CampaignAnalyticsResponseAnalytics'
49
+ :'analytics' => :'AdAnalyticsResponseAnalytics'
50
50
  }
51
51
  end
52
52
 
@@ -0,0 +1,169 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class AdAnalyticsResponseAnalytics < ApiModelBase
18
+ attr_accessor :summary
19
+
20
+ attr_accessor :daily
21
+
22
+ attr_accessor :breakdowns
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'summary' => :'summary',
28
+ :'daily' => :'daily',
29
+ :'breakdowns' => :'breakdowns'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'summary' => :'AdMetrics',
47
+ :'daily' => :'Array<CampaignAnalyticsResponseAnalyticsDailyInner>',
48
+ :'breakdowns' => :'Hash<String, Array<Object>>'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AdAnalyticsResponseAnalytics` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AdAnalyticsResponseAnalytics`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'summary')
75
+ self.summary = attributes[:'summary']
76
+ end
77
+
78
+ if attributes.key?(:'daily')
79
+ if (value = attributes[:'daily']).is_a?(Array)
80
+ self.daily = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'breakdowns')
85
+ if (value = attributes[:'breakdowns']).is_a?(Hash)
86
+ self.breakdowns = value
87
+ end
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ summary == o.summary &&
112
+ daily == o.daily &&
113
+ breakdowns == o.breakdowns
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [summary, daily, breakdowns].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Returns the object in the form of hash
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_hash
154
+ hash = {}
155
+ self.class.attribute_map.each_pair do |attr, param|
156
+ value = self.send(attr)
157
+ if value.nil?
158
+ is_nullable = self.class.openapi_nullable.include?(attr)
159
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
160
+ end
161
+
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ end
168
+
169
+ end
@@ -157,7 +157,7 @@ module Zernio
157
157
  :'campaign_issues_info' => :'Array<Object>',
158
158
  :'ad_count' => :'Integer',
159
159
  :'budget' => :'AdCampaignBudget',
160
- :'campaign_budget' => :'AdCampaignCampaignBudget',
160
+ :'campaign_budget' => :'AdCampaignBudget',
161
161
  :'budget_level' => :'String',
162
162
  :'is_budget_schedule_enabled' => :'Boolean',
163
163
  :'currency' => :'String',
@@ -184,6 +184,8 @@ module Zernio
184
184
  :'review_status',
185
185
  :'platform_campaign_status',
186
186
  :'campaign_issues_info',
187
+ :'budget',
188
+ :'campaign_budget',
187
189
  :'budget_level',
188
190
  :'currency',
189
191
  :'platform_ad_account_name',