late-sdk 0.0.950 → 0.0.952

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -0
  3. data/docs/AdCampaignsApi.md +155 -1
  4. data/docs/AdKeyword.md +3 -1
  5. data/docs/AdKeywordQuality.md +24 -0
  6. data/docs/AdScheduleWindow.md +32 -0
  7. data/docs/BoostPostRequest.md +2 -0
  8. data/docs/BoostPostRequestPromotedObject.md +20 -0
  9. data/docs/GetCampaignAdSchedule200Response.md +28 -0
  10. data/docs/GetCampaignAdSchedule200ResponsePerformance.md +22 -0
  11. data/docs/GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner.md +26 -0
  12. data/docs/GetCampaignAdSchedule200ResponsePerformanceByHourInner.md +26 -0
  13. data/docs/UpdateCampaignAdSchedule200Response.md +22 -0
  14. data/docs/UpdateCampaignAdScheduleRequest.md +18 -0
  15. data/docs/UpdateCampaignAdScheduleRequestScheduleInner.md +28 -0
  16. data/lib/zernio-sdk/api/ad_campaigns_api.rb +166 -2
  17. data/lib/zernio-sdk/models/ad_keyword.rb +11 -2
  18. data/lib/zernio-sdk/models/ad_keyword_quality.rb +241 -0
  19. data/lib/zernio-sdk/models/ad_schedule_window.rb +329 -0
  20. data/lib/zernio-sdk/models/boost_post_request.rb +10 -1
  21. data/lib/zernio-sdk/models/boost_post_request_promoted_object.rb +159 -0
  22. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response.rb +197 -0
  23. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance.rb +174 -0
  24. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner.rb +218 -0
  25. data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_hour_inner.rb +212 -0
  26. data/lib/zernio-sdk/models/update_campaign_ad_schedule200_response.rb +167 -0
  27. data/lib/zernio-sdk/models/update_campaign_ad_schedule_request.rb +176 -0
  28. data/lib/zernio-sdk/models/update_campaign_ad_schedule_request_schedule_inner.rb +362 -0
  29. data/lib/zernio-sdk/version.rb +1 -1
  30. data/lib/zernio-sdk.rb +10 -0
  31. data/openapi.yaml +230 -7
  32. data/spec/api/ad_campaigns_api_spec.rb +31 -1
  33. data/spec/models/ad_keyword_quality_spec.rb +66 -0
  34. data/spec/models/ad_keyword_spec.rb +6 -0
  35. data/spec/models/ad_schedule_window_spec.rb +90 -0
  36. data/spec/models/boost_post_request_promoted_object_spec.rb +42 -0
  37. data/spec/models/boost_post_request_spec.rb +6 -0
  38. data/spec/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner_spec.rb +64 -0
  39. data/spec/models/get_campaign_ad_schedule200_response_performance_by_hour_inner_spec.rb +60 -0
  40. data/spec/models/get_campaign_ad_schedule200_response_performance_spec.rb +48 -0
  41. data/spec/models/get_campaign_ad_schedule200_response_spec.rb +66 -0
  42. data/spec/models/update_campaign_ad_schedule200_response_spec.rb +48 -0
  43. data/spec/models/update_campaign_ad_schedule_request_schedule_inner_spec.rb +78 -0
  44. data/spec/models/update_campaign_ad_schedule_request_spec.rb +36 -0
  45. data/zernio-sdk-0.0.952.gem +0 -0
  46. metadata +43 -3
  47. data/zernio-sdk-0.0.950.gem +0 -0
data/openapi.yaml CHANGED
@@ -10202,7 +10202,29 @@ components:
10202
10202
  matchType: { type: string, enum: [exact, phrase, broad, unknown] }
10203
10203
  status: { type: string, enum: [active, paused] }
10204
10204
  negative: { type: boolean }
10205
- qualityScore: { type: [integer, "null"], description: 'Google Quality Score, 1-10. Null when unrated.' }
10205
+ qualityScore: { type: [integer, "null"], description: 'Deprecated, use `quality.score`. Google Quality Score, 1-10. Null when unrated.' }
10206
+ quality:
10207
+ type: object
10208
+ description: |
10209
+ Google Quality Score and the three component ratings behind it
10210
+ (`ad_group_criterion.quality_info`). Every field is null until Google has rated the
10211
+ keyword: a keyword with too little traffic is unrated, and negatives are never rated.
10212
+ Google's own UNKNOWN / UNSPECIFIED buckets are reported as null so "unrated" has a
10213
+ single representation.
10214
+ properties:
10215
+ score: { type: [integer, "null"], description: 'Quality Score, 1-10.' }
10216
+ expectedCtr:
10217
+ type: [string, "null"]
10218
+ enum: [BELOW_AVERAGE, AVERAGE, ABOVE_AVERAGE, null]
10219
+ description: 'How the click-through rate compares with other ads in the same position (`search_predicted_ctr`).'
10220
+ adRelevance:
10221
+ type: [string, "null"]
10222
+ enum: [BELOW_AVERAGE, AVERAGE, ABOVE_AVERAGE, null]
10223
+ description: 'How closely the ad matches the intent behind the search (`creative_quality_score`).'
10224
+ landingPageExperience:
10225
+ type: [string, "null"]
10226
+ enum: [BELOW_AVERAGE, AVERAGE, ABOVE_AVERAGE, null]
10227
+ description: 'How relevant and useful the landing page is to people who click (`post_click_quality_score`).'
10206
10228
  syncedAt: { type: [string, "null"], format: date-time }
10207
10229
  metrics:
10208
10230
  type: [object, "null"]
@@ -10215,6 +10237,18 @@ components:
10215
10237
  conversions: { type: number }
10216
10238
  firstPageCpc: { type: [number, "null"], description: Account currency }
10217
10239
  firstPositionCpc: { type: [number, "null"], description: Account currency }
10240
+ AdScheduleWindow:
10241
+ type: object
10242
+ description: 'One ad schedule window as Google stores it. Half-open: it is exclusive of the end minute, so 09:00-12:00 and 12:00-17:00 are adjacent, not overlapping.'
10243
+ properties:
10244
+ criterionId: { type: string, description: 'Google campaign criterion id. Changes whenever the window is rewritten, because Google cannot edit a schedule in place.' }
10245
+ resourceName: { type: string }
10246
+ dayOfWeek: { type: string, enum: [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY] }
10247
+ startHour: { type: integer, minimum: 0, maximum: 23 }
10248
+ startMinute: { type: integer, enum: [0, 15, 30, 45] }
10249
+ endHour: { type: integer, minimum: 0, maximum: 24, description: '24 means midnight at the end of the day.' }
10250
+ endMinute: { type: integer, enum: [0, 15, 30, 45] }
10251
+ bidModifier: { type: [number, "null"], description: 'Bid adjustment for this window, 0.1-10.0. Null when the window runs at the campaign bid.' }
10218
10252
  KeywordEntry:
10219
10253
  description: 'A Google Search keyword: a bare string (BROAD match), or an object naming the match type.'
10220
10254
  oneOf:
@@ -44412,6 +44446,171 @@ paths:
44412
44446
  '404':
44413
44447
  description: No ads found for this campaign
44414
44448
 
44449
+ /v1/ads/campaigns/{campaignId}/ad-schedule:
44450
+ get:
44451
+ x-resource-group: "ads"
44452
+ operationId: getCampaignAdSchedule
44453
+ tags: ["Ad Campaigns"]
44454
+ x-platforms: ["google"]
44455
+ summary: Read a campaign's ad schedule (dayparting)
44456
+ description: |
44457
+ The windows a Google campaign serves in, with the bid modifier on each, plus the
44458
+ criterion ids Google minted for them.
44459
+
44460
+ An EMPTY `schedule` is meaningful and is not a failed lookup: Google has no
44461
+ "all day" criterion, so a campaign with no ad schedule serves around the clock.
44462
+ `servesAroundTheClock` states that explicitly.
44463
+
44464
+ Set `includePerformance=true` to also get delivery split by day of week and by hour,
44465
+ which is the evidence for deciding what the schedule should be. It is one extra
44466
+ Google call segmented by both dimensions at once, so the two views always agree.
44467
+
44468
+ Google Ads only. The response carries `cachedAt` and `stale`, set when a
44469
+ quota-exhausted call falls back to the last-good copy instead of a live read.
44470
+ security:
44471
+ - bearerAuth: []
44472
+ parameters:
44473
+ - { name: campaignId, in: path, required: true, schema: { type: string }, description: "Numeric Google platform campaign id." }
44474
+ - { name: platform, in: query, required: false, schema: { type: string, enum: [google] }, description: "Disambiguates the campaign id when the connection spans platforms." }
44475
+ - { name: includePerformance, in: query, required: false, schema: { type: boolean }, description: "Also return delivery by day of week and by hour. Costs one extra Google call." }
44476
+ - { name: windowDays, in: query, required: false, schema: { type: integer, minimum: 1, maximum: 90, default: 30 }, description: "Trailing window for the performance split. Ignored when fromDate and toDate are both given." }
44477
+ - { name: fromDate, in: query, required: false, schema: { type: string, format: date }, description: "Start of an explicit performance range (YYYY-MM-DD). Use together with toDate." }
44478
+ - { name: toDate, in: query, required: false, schema: { type: string, format: date }, description: "End of an explicit performance range (YYYY-MM-DD). Must be on or after fromDate." }
44479
+ responses:
44480
+ '200':
44481
+ description: The campaign's ad schedule
44482
+ content:
44483
+ application/json:
44484
+ schema:
44485
+ type: object
44486
+ properties:
44487
+ campaignId: { type: string }
44488
+ schedule:
44489
+ type: array
44490
+ items: { $ref: '#/components/schemas/AdScheduleWindow' }
44491
+ servesAroundTheClock: { type: boolean, description: 'True when the campaign carries no ad schedule at all, so it can serve at any time.' }
44492
+ cachedAt: { type: [string, "null"], format: date-time }
44493
+ stale: { type: boolean, description: 'True when a quota-exhausted read served the last-good copy.' }
44494
+ performance:
44495
+ type: object
44496
+ description: 'Only present when includePerformance=true.'
44497
+ properties:
44498
+ windowDays: { type: [integer, "null"], description: 'The trailing window used, or null when an explicit fromDate/toDate range was given.' }
44499
+ byDayOfWeek:
44500
+ type: array
44501
+ description: 'One entry per day that delivered, Monday first.'
44502
+ items:
44503
+ type: object
44504
+ properties:
44505
+ dayOfWeek: { type: string, enum: [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY] }
44506
+ impressions: { type: integer }
44507
+ clicks: { type: integer }
44508
+ cost: { type: number, description: 'Account currency, not USD-normalized.' }
44509
+ conversions: { type: number }
44510
+ byHour:
44511
+ type: array
44512
+ description: 'One entry per hour that delivered, 0-23 in the account time zone.'
44513
+ items:
44514
+ type: object
44515
+ properties:
44516
+ hour: { type: integer, minimum: 0, maximum: 23 }
44517
+ impressions: { type: integer }
44518
+ clicks: { type: integer }
44519
+ cost: { type: number, description: 'Account currency, not USD-normalized.' }
44520
+ conversions: { type: number }
44521
+ '400': { $ref: '#/components/responses/BadRequest' }
44522
+ '401': { $ref: '#/components/responses/Unauthorized' }
44523
+ '403':
44524
+ description: "Ads access required. Legacy plans need the Ads add-on; included by default on usage-based plans."
44525
+ '404': { $ref: '#/components/responses/AccountUnavailable' }
44526
+ '501':
44527
+ description: "Not a Google Ads campaign: ad schedules are a Google criterion."
44528
+ put:
44529
+ x-resource-group: "ads"
44530
+ operationId: updateCampaignAdSchedule
44531
+ tags: ["Ad Campaigns"]
44532
+ x-platforms: ["google"]
44533
+ summary: Replace a campaign's ad schedule (dayparting)
44534
+ description: |
44535
+ Replaces the campaign's whole ad schedule with the windows you send. This is a
44536
+ REPLACE, not a merge: windows you leave out stop serving.
44537
+
44538
+ Send `schedule: []` to clear dayparting, which returns the campaign to serving around
44539
+ the clock.
44540
+
44541
+ Google rules enforced here, so you get a named field instead of a criterion error:
44542
+ at most 6 windows per day, a window must end after it starts, windows on the same day
44543
+ may not overlap, `endHour` 24 is midnight and cannot carry minutes, and minutes are
44544
+ quarter-hours only (0, 15, 30, 45). `bidModifier` is 0.1-10.0; Google's 0 means
44545
+ "off" for devices only, so a window is switched off by leaving it out.
44546
+
44547
+ Windows are half-open (Google is exclusive of the end minute), so 09:00-12:00 and
44548
+ 12:00-17:00 on the same day are adjacent and both valid.
44549
+
44550
+ Google cannot edit an ad schedule in place (every AdScheduleInfo field is prohibited on
44551
+ update), so this removes the live criteria and creates the new ones in a single atomic
44552
+ mutate. The response is read back from Google and carries the new criterion ids.
44553
+ security:
44554
+ - bearerAuth: []
44555
+ parameters:
44556
+ - { name: campaignId, in: path, required: true, schema: { type: string }, description: "Numeric Google platform campaign id." }
44557
+ requestBody:
44558
+ required: true
44559
+ content:
44560
+ application/json:
44561
+ schema:
44562
+ type: object
44563
+ required: [schedule]
44564
+ properties:
44565
+ schedule:
44566
+ type: array
44567
+ maxItems: 42
44568
+ description: 'The complete set of windows. Required, so clearing the schedule is always deliberate rather than an omission.'
44569
+ items:
44570
+ type: object
44571
+ required: [dayOfWeek, startHour, endHour]
44572
+ properties:
44573
+ dayOfWeek: { type: string, enum: [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY] }
44574
+ startHour: { type: integer, minimum: 0, maximum: 23 }
44575
+ startMinute: { type: integer, enum: [0, 15, 30, 45], default: 0, description: 'Quarter-hours only.' }
44576
+ endHour: { type: integer, minimum: 0, maximum: 24, description: '24 means midnight at the end of the day.' }
44577
+ endMinute: { type: integer, enum: [0, 15, 30, 45], default: 0, description: 'Quarter-hours only. Must be 0 when endHour is 24.' }
44578
+ bidModifier: { type: [number, "null"], minimum: 0.1, maximum: 10, default: null, description: 'Bid adjustment for this window. Null runs it at the campaign bid.' }
44579
+ examples:
44580
+ officeHours:
44581
+ summary: Weekday office hours, bidding up over lunch
44582
+ value:
44583
+ schedule:
44584
+ - { dayOfWeek: MONDAY, startHour: 9, endHour: 17 }
44585
+ - { dayOfWeek: TUESDAY, startHour: 9, endHour: 17 }
44586
+ - { dayOfWeek: WEDNESDAY, startHour: 9, endHour: 12, bidModifier: 1.5 }
44587
+ - { dayOfWeek: WEDNESDAY, startHour: 12, endHour: 17 }
44588
+ clearSchedule:
44589
+ summary: Serve around the clock again
44590
+ value: { schedule: [] }
44591
+ responses:
44592
+ '200':
44593
+ description: The schedule as Google stored it
44594
+ content:
44595
+ application/json:
44596
+ schema:
44597
+ type: object
44598
+ properties:
44599
+ campaignId: { type: string }
44600
+ schedule:
44601
+ type: array
44602
+ items: { $ref: '#/components/schemas/AdScheduleWindow' }
44603
+ servesAroundTheClock: { type: boolean }
44604
+ '400': { $ref: '#/components/responses/BadRequest' }
44605
+ '401': { $ref: '#/components/responses/Unauthorized' }
44606
+ '403':
44607
+ description: "Ads access required. Legacy plans need the Ads add-on; included by default on usage-based plans."
44608
+ '404': { $ref: '#/components/responses/AccountUnavailable' }
44609
+ '422':
44610
+ description: "The schedule breaks a Google rule: too many windows on a day, an overlap, a window that ends before it starts, minutes on hour 24, or a bid modifier outside 0.1-10.0."
44611
+ '501':
44612
+ description: "Not a Google Ads campaign: ad schedules are a Google criterion."
44613
+
44415
44614
  /v1/ads/campaigns/{campaignId}/bidding:
44416
44615
  get:
44417
44616
  x-resource-group: "ads"
@@ -45886,12 +46085,18 @@ paths:
45886
46085
  the campaign's live criteria and sends the removes and the creates in ONE
45887
46086
  `googleAds:mutate`, so the campaign is never left with a half-applied set; criteria
45888
46087
  already in the list keep their criterion ID and history. Excluded (negative)
45889
- locations are left untouched. Two cases are refused rather than applied: an empty
45890
- location list returns 400 (a Google campaign with no location criteria targets every
45891
- country, which is never what "remove my locations" means, so omit the field instead),
45892
- and radius targeting (`customLocations`) returns 422 because it is a separate Google
45893
- criterion type that this replacement neither creates nor removes. Send either
45894
- `targeting.locations` or the top-level geo fields, not both: mixing them returns 400.
46088
+ locations are left untouched. An empty location list returns 400 (a Google campaign
46089
+ with no location criteria targets every country, which is never what "remove my
46090
+ locations" means, so omit the field instead). Send either `targeting.locations` or the
46091
+ top-level geo fields, not both: mixing them returns 400.
46092
+
46093
+ **Google radius targeting:** `customLocations` is editable and is replaced the same
46094
+ way, but as its OWN set. Google models a place (LOCATION) and a point plus radius
46095
+ (PROXIMITY) as different criterion types, so the two are independent: sending
46096
+ `customLocations` replaces every radius and leaves the cities and countries alone,
46097
+ and sending places replaces those and leaves the radius alone. Send
46098
+ `customLocations: []` to drop radius targeting entirely. A circle you re-send
46099
+ unchanged keeps its criterion ID rather than being removed and recreated.
45895
46100
 
45896
46101
  **Google keyword replacement:** These edits affect the ad's entire ad group,
45897
46102
  including sibling ads. Positive (`targeting.keywords`) and negative
@@ -51450,6 +51655,24 @@ paths:
51450
51655
  account running the ads (same-BC creators only). The creator generates the
51451
51656
  code in their TikTok app's Promote settings and shares it with the
51452
51657
  advertiser. Maps to `auth_code` on the creative entry of /v2/ad/create/.
51658
+ promotedObject:
51659
+ type: object
51660
+ description: |
51661
+ TikTok-only on this endpoint. The pixel a Website Conversion ad group
51662
+ optimizes toward, so a Spark Ad built from an existing organic post can
51663
+ optimize for a conversion instead of only engagement or traffic. Required
51664
+ when `goal` is `conversions`; ignored on every other goal, because only a
51665
+ WEB_CONVERSIONS ad group accepts these fields.
51666
+
51667
+ Combine freely with `platformPostId` + `sparkAuthCode`: the pixel lives on
51668
+ the ad group and the Spark item on the creative, so they never conflict.
51669
+ properties:
51670
+ pixelId:
51671
+ type: string
51672
+ description: 'TikTok Pixel. Either the numeric pixel id or the alphanumeric pixel code from Events Manager, which is resolved for you.'
51673
+ customEventType:
51674
+ type: string
51675
+ description: 'Optimization event, as a TikTok optimization_event code (e.g. ON_WEB_ORDER, SHOPPING, FORM) or the exact event name shown in Events Manager, which is resolved to its code. Omit to let TikTok optimize for the ad group default.'
51453
51676
  dsaBeneficiary:
51454
51677
  type: string
51455
51678
  maxLength: 100
@@ -309,6 +309,23 @@ describe 'AdCampaignsApi' do
309
309
  end
310
310
  end
311
311
 
312
+ # unit tests for get_campaign_ad_schedule
313
+ # Read a campaign's ad schedule (dayparting)
314
+ # The windows a Google campaign serves in, with the bid modifier on each, plus the criterion ids Google minted for them. An EMPTY `schedule` is meaningful and is not a failed lookup: Google has no \"all day\" criterion, so a campaign with no ad schedule serves around the clock. `servesAroundTheClock` states that explicitly. Set `includePerformance=true` to also get delivery split by day of week and by hour, which is the evidence for deciding what the schedule should be. It is one extra Google call segmented by both dimensions at once, so the two views always agree. Google Ads only. The response carries `cachedAt` and `stale`, set when a quota-exhausted call falls back to the last-good copy instead of a live read.
315
+ # @param campaign_id Numeric Google platform campaign id.
316
+ # @param [Hash] opts the optional parameters
317
+ # @option opts [String] :platform Disambiguates the campaign id when the connection spans platforms.
318
+ # @option opts [Boolean] :include_performance Also return delivery by day of week and by hour. Costs one extra Google call.
319
+ # @option opts [Integer] :window_days Trailing window for the performance split. Ignored when fromDate and toDate are both given.
320
+ # @option opts [Date] :from_date Start of an explicit performance range (YYYY-MM-DD). Use together with toDate.
321
+ # @option opts [Date] :to_date End of an explicit performance range (YYYY-MM-DD). Must be on or after fromDate.
322
+ # @return [GetCampaignAdSchedule200Response]
323
+ describe 'get_campaign_ad_schedule test' do
324
+ it 'should work' do
325
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
326
+ end
327
+ end
328
+
312
329
  # unit tests for get_campaign_bidding
313
330
  # Read a campaign's current bidding
314
331
  # Read of the campaign's bidding strategy on Google, cached for the quota window, for pre-filling the bid strategy block before a PUT to /v1/ads/campaigns/{campaignId}. Google Ads only; `platform` is required and rejected when it is anything else, since a `campaignId` is not globally unique. The response carries `cachedAt` and `stale`, set when a quota-exhausted call falls back to the last-good copy instead of a live read. Maps Google's bidding strategy onto the same triplet PUT accepts: `LOWEST_COST_WITHOUT_CAP` (Maximize Conversions, no target), `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). A campaign on a portfolio strategy returns `portfolio` (id + name) and `bidSpec.portfolioBidStrategyId` instead of the triplet. Anything else (Manual CPC, Target Impression Share, ...) returns `bidSpec: null`; show `biddingStrategyType` as-is.
@@ -572,7 +589,7 @@ describe 'AdCampaignsApi' do
572
589
 
573
590
  # unit tests for update_ad
574
591
  # Update ad
575
- # Patch one or more fields on an ad. Status, budget, targeting, and creative changes are propagated to the platform. Per-platform support: - **Meta** (Facebook + Instagram): all fields supported. - **TikTok**: status, budget, targeting (via `/v2/adgroup/update/`), and creative (via `/v2/ad/update/` patch-style: `headline` is ignored, `body` becomes `ad_text`). - **Google**: status, budget, KEYWORD edits via `targeting.keywords` / `targeting.negativeKeywords`, DEVICE bid adjustments via `targeting.devices`, LOCATION edits via `targeting.locations` (or the equivalent top-level `targeting.countries` / `regions` / `cities` / `zips` / `metros`), and LANGUAGE edits via `targeting.languages`. Each list you send becomes the FULL new set of its kind (criteria not in the list are removed, except devices, which Google cannot remove and which are switched off with a bid modifier of 0 instead); a kind left out is untouched. Any other `targeting` field returns 400: Google cannot mutate it post-create without recreating the campaign. Creative edits are dispatched on the ad's `advertisingChannelType`, and every supported field replaces a whole set; a field you omit is preserved. - **Search**: top-level `headlines`, `descriptions` and `finalUrls`. Use 3-15 headlines (1-30 characters) and 2-4 descriptions (1-90 characters). Omit an asset to remove it; omit pinnedField on an included asset to unpin it. Updates do not pad or truncate text. The legacy creative fields remain unsupported. - **Display**: top-level `headlines` (1-5, no pinnedField, display ads have no pinned positions), `descriptions` (1-5) and `finalUrls`, plus `creative.longHeadline`, `creative.businessName`, `creative.imageUrl` (the landscape marketing image) and `creative.squareImageUrl`. Each image URL is uploaded as a new Google asset and the ad is pointed at it; Google assets are immutable, so the previous asset stays in the account's asset library. - **Performance Max**: top-level `assetGroup`, which swaps asset roles on the ad's asset group. The other creative fields return 422 for this channel, and `assetGroup` returns 422 on any other channel. - **LinkedIn**: status, budget, targeting (countries or regions, excludedLocations (countries), the B2B facets, and audience segments; applied to the LinkedIn Campaign via PARTIAL_UPDATE, and REPLACES the campaign's entire targetingCriteria, not a merge), and creative (uploads new media, creates a replacement inline creative on the same campaign, pauses the old one). - **Pinterest / X / OpenAI Ads**: status + budget only. Sending `targeting` or `creative` returns 501 with code `unsupported_platform_operation`. OpenAI Ads budget is lifetime-only (see `budget.type` below). **Google location and language replacement:** locations, languages and devices are campaign-level criteria on Google, so these edits apply to every ad group and ad in the ad's campaign. Send the complete list you want to keep. Zernio diffs it against the campaign's live criteria and sends the removes and the creates in ONE `googleAds:mutate`, so the campaign is never left with a half-applied set; criteria already in the list keep their criterion ID and history. Excluded (negative) locations are left untouched. Two cases are refused rather than applied: an empty location list returns 400 (a Google campaign with no location criteria targets every country, which is never what \"remove my locations\" means, so omit the field instead), and radius targeting (`customLocations`) returns 422 because it is a separate Google criterion type that this replacement neither creates nor removes. Send either `targeting.locations` or the top-level geo fields, not both: mixing them returns 400. **Google keyword replacement:** These edits affect the ad's entire ad group, including sibling ads. Positive (`targeting.keywords`) and negative (`targeting.negativeKeywords`) sets are independent: omit a field to leave that set unchanged, or send `[]` to remove every keyword of that kind. Zernio compares each supplied set with Google's live criteria by case-insensitive keyword text and match type. A matching criterion is left untouched, retaining its criterion ID, enabled/paused status, keyword-level bid overrides, labels, and criterion-associated history/statistics. Zernio does not reset its quality score; Google continues to calculate scores and statistics normally. Text comparison does not trim whitespace. A bare string or an object without `matchType` means `broad`, not the existing criterion's match type. For example, resending an existing `{ \"text\": \"plumber\", \"matchType\": \"exact\" }` preserves it; sending `\"plumber\"` instead removes that EXACT criterion and requests a BROAD one. Changing text or match type removes criteria no longer requested and creates any missing criteria. New criteria get new IDs and do not inherit removed criteria's bid overrides, labels, or history. Historical reporting for a removed criterion is not transferred to its replacement. To add keywords without replacing a set, use [POST /v1/ads/keywords](https://docs.zernio.com/ad-campaigns/add-ad-keywords). Use `PATCH /v1/ads/keywords/{keywordId}` to pause/enable one keyword, or `DELETE /v1/ads/keywords/{keywordId}` to remove it.
592
+ # Patch one or more fields on an ad. Status, budget, targeting, and creative changes are propagated to the platform. Per-platform support: - **Meta** (Facebook + Instagram): all fields supported. - **TikTok**: status, budget, targeting (via `/v2/adgroup/update/`), and creative (via `/v2/ad/update/` patch-style: `headline` is ignored, `body` becomes `ad_text`). - **Google**: status, budget, KEYWORD edits via `targeting.keywords` / `targeting.negativeKeywords`, DEVICE bid adjustments via `targeting.devices`, LOCATION edits via `targeting.locations` (or the equivalent top-level `targeting.countries` / `regions` / `cities` / `zips` / `metros`), and LANGUAGE edits via `targeting.languages`. Each list you send becomes the FULL new set of its kind (criteria not in the list are removed, except devices, which Google cannot remove and which are switched off with a bid modifier of 0 instead); a kind left out is untouched. Any other `targeting` field returns 400: Google cannot mutate it post-create without recreating the campaign. Creative edits are dispatched on the ad's `advertisingChannelType`, and every supported field replaces a whole set; a field you omit is preserved. - **Search**: top-level `headlines`, `descriptions` and `finalUrls`. Use 3-15 headlines (1-30 characters) and 2-4 descriptions (1-90 characters). Omit an asset to remove it; omit pinnedField on an included asset to unpin it. Updates do not pad or truncate text. The legacy creative fields remain unsupported. - **Display**: top-level `headlines` (1-5, no pinnedField, display ads have no pinned positions), `descriptions` (1-5) and `finalUrls`, plus `creative.longHeadline`, `creative.businessName`, `creative.imageUrl` (the landscape marketing image) and `creative.squareImageUrl`. Each image URL is uploaded as a new Google asset and the ad is pointed at it; Google assets are immutable, so the previous asset stays in the account's asset library. - **Performance Max**: top-level `assetGroup`, which swaps asset roles on the ad's asset group. The other creative fields return 422 for this channel, and `assetGroup` returns 422 on any other channel. - **LinkedIn**: status, budget, targeting (countries or regions, excludedLocations (countries), the B2B facets, and audience segments; applied to the LinkedIn Campaign via PARTIAL_UPDATE, and REPLACES the campaign's entire targetingCriteria, not a merge), and creative (uploads new media, creates a replacement inline creative on the same campaign, pauses the old one). - **Pinterest / X / OpenAI Ads**: status + budget only. Sending `targeting` or `creative` returns 501 with code `unsupported_platform_operation`. OpenAI Ads budget is lifetime-only (see `budget.type` below). **Google location and language replacement:** locations, languages and devices are campaign-level criteria on Google, so these edits apply to every ad group and ad in the ad's campaign. Send the complete list you want to keep. Zernio diffs it against the campaign's live criteria and sends the removes and the creates in ONE `googleAds:mutate`, so the campaign is never left with a half-applied set; criteria already in the list keep their criterion ID and history. Excluded (negative) locations are left untouched. An empty location list returns 400 (a Google campaign with no location criteria targets every country, which is never what \"remove my locations\" means, so omit the field instead). Send either `targeting.locations` or the top-level geo fields, not both: mixing them returns 400. **Google radius targeting:** `customLocations` is editable and is replaced the same way, but as its OWN set. Google models a place (LOCATION) and a point plus radius (PROXIMITY) as different criterion types, so the two are independent: sending `customLocations` replaces every radius and leaves the cities and countries alone, and sending places replaces those and leaves the radius alone. Send `customLocations: []` to drop radius targeting entirely. A circle you re-send unchanged keeps its criterion ID rather than being removed and recreated. **Google keyword replacement:** These edits affect the ad's entire ad group, including sibling ads. Positive (`targeting.keywords`) and negative (`targeting.negativeKeywords`) sets are independent: omit a field to leave that set unchanged, or send `[]` to remove every keyword of that kind. Zernio compares each supplied set with Google's live criteria by case-insensitive keyword text and match type. A matching criterion is left untouched, retaining its criterion ID, enabled/paused status, keyword-level bid overrides, labels, and criterion-associated history/statistics. Zernio does not reset its quality score; Google continues to calculate scores and statistics normally. Text comparison does not trim whitespace. A bare string or an object without `matchType` means `broad`, not the existing criterion's match type. For example, resending an existing `{ \"text\": \"plumber\", \"matchType\": \"exact\" }` preserves it; sending `\"plumber\"` instead removes that EXACT criterion and requests a BROAD one. Changing text or match type removes criteria no longer requested and creates any missing criteria. New criteria get new IDs and do not inherit removed criteria's bid overrides, labels, or history. Historical reporting for a removed criterion is not transferred to its replacement. To add keywords without replacing a set, use [POST /v1/ads/keywords](https://docs.zernio.com/ad-campaigns/add-ad-keywords). Use `PATCH /v1/ads/keywords/{keywordId}` to pause/enable one keyword, or `DELETE /v1/ads/keywords/{keywordId}` to remove it.
576
593
  # @param ad_id
577
594
  # @param update_ad_request
578
595
  # @param [Hash] opts the optional parameters
@@ -687,6 +704,19 @@ describe 'AdCampaignsApi' do
687
704
  end
688
705
  end
689
706
 
707
+ # unit tests for update_campaign_ad_schedule
708
+ # Replace a campaign's ad schedule (dayparting)
709
+ # Replaces the campaign's whole ad schedule with the windows you send. This is a REPLACE, not a merge: windows you leave out stop serving. Send `schedule: []` to clear dayparting, which returns the campaign to serving around the clock. Google rules enforced here, so you get a named field instead of a criterion error: at most 6 windows per day, a window must end after it starts, windows on the same day may not overlap, `endHour` 24 is midnight and cannot carry minutes, and minutes are quarter-hours only (0, 15, 30, 45). `bidModifier` is 0.1-10.0; Google's 0 means \"off\" for devices only, so a window is switched off by leaving it out. Windows are half-open (Google is exclusive of the end minute), so 09:00-12:00 and 12:00-17:00 on the same day are adjacent and both valid. Google cannot edit an ad schedule in place (every AdScheduleInfo field is prohibited on update), so this removes the live criteria and creates the new ones in a single atomic mutate. The response is read back from Google and carries the new criterion ids.
710
+ # @param campaign_id Numeric Google platform campaign id.
711
+ # @param update_campaign_ad_schedule_request
712
+ # @param [Hash] opts the optional parameters
713
+ # @return [UpdateCampaignAdSchedule200Response]
714
+ describe 'update_campaign_ad_schedule test' do
715
+ it 'should work' do
716
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
717
+ end
718
+ end
719
+
690
720
  # unit tests for update_campaign_assets
691
721
  # Update campaign assets
692
722
  # Edits existing Google assets in place. Send updates with assetResourceName and the fields to change. An asset is shared: changes affect every attachment using it. Omitted fields stay unchanged. The operation consumes the Google operations budget and invalidates affected cached lists.
@@ -0,0 +1,66 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::AdKeywordQuality
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::AdKeywordQuality do
21
+ #let(:instance) { Zernio::AdKeywordQuality.new }
22
+
23
+ describe 'test an instance of AdKeywordQuality' do
24
+ it 'should create an instance of AdKeywordQuality' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::AdKeywordQuality)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "score"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "expected_ctr"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.expected_ctr = value }.not_to raise_error
42
+ # end
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "ad_relevance"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
50
+ # validator.allowable_values.each do |value|
51
+ # expect { instance.ad_relevance = value }.not_to raise_error
52
+ # end
53
+ end
54
+ end
55
+
56
+ describe 'test attribute "landing_page_experience"' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
59
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
60
+ # validator.allowable_values.each do |value|
61
+ # expect { instance.landing_page_experience = value }.not_to raise_error
62
+ # end
63
+ end
64
+ end
65
+
66
+ end
@@ -135,6 +135,12 @@ describe Zernio::AdKeyword do
135
135
  end
136
136
  end
137
137
 
138
+ describe 'test attribute "quality"' do
139
+ it 'should work' do
140
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
141
+ end
142
+ end
143
+
138
144
  describe 'test attribute "synced_at"' do
139
145
  it 'should work' do
140
146
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -0,0 +1,90 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::AdScheduleWindow
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::AdScheduleWindow do
21
+ #let(:instance) { Zernio::AdScheduleWindow.new }
22
+
23
+ describe 'test an instance of AdScheduleWindow' do
24
+ it 'should create an instance of AdScheduleWindow' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::AdScheduleWindow)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "criterion_id"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "resource_name"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "day_of_week"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"])
46
+ # validator.allowable_values.each do |value|
47
+ # expect { instance.day_of_week = value }.not_to raise_error
48
+ # end
49
+ end
50
+ end
51
+
52
+ describe 'test attribute "start_hour"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
55
+ end
56
+ end
57
+
58
+ describe 'test attribute "start_minute"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
61
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [0, 15, 30, 45])
62
+ # validator.allowable_values.each do |value|
63
+ # expect { instance.start_minute = value }.not_to raise_error
64
+ # end
65
+ end
66
+ end
67
+
68
+ describe 'test attribute "end_hour"' do
69
+ it 'should work' do
70
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
71
+ end
72
+ end
73
+
74
+ describe 'test attribute "end_minute"' do
75
+ it 'should work' do
76
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
77
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [0, 15, 30, 45])
78
+ # validator.allowable_values.each do |value|
79
+ # expect { instance.end_minute = value }.not_to raise_error
80
+ # end
81
+ end
82
+ end
83
+
84
+ describe 'test attribute "bid_modifier"' do
85
+ it 'should work' do
86
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
87
+ end
88
+ end
89
+
90
+ end
@@ -0,0 +1,42 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::BoostPostRequestPromotedObject
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::BoostPostRequestPromotedObject do
21
+ #let(:instance) { Zernio::BoostPostRequestPromotedObject.new }
22
+
23
+ describe 'test an instance of BoostPostRequestPromotedObject' do
24
+ it 'should create an instance of BoostPostRequestPromotedObject' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::BoostPostRequestPromotedObject)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "pixel_id"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "custom_event_type"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ end
@@ -211,6 +211,12 @@ describe Zernio::BoostPostRequest do
211
211
  end
212
212
  end
213
213
 
214
+ describe 'test attribute "promoted_object"' do
215
+ it 'should work' do
216
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
217
+ end
218
+ end
219
+
214
220
  describe 'test attribute "dsa_beneficiary"' do
215
221
  it 'should work' do
216
222
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -0,0 +1,64 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner do
21
+ #let(:instance) { Zernio::GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner.new }
22
+
23
+ describe 'test an instance of GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner' do
24
+ it 'should create an instance of GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "day_of_week"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"])
34
+ # validator.allowable_values.each do |value|
35
+ # expect { instance.day_of_week = value }.not_to raise_error
36
+ # end
37
+ end
38
+ end
39
+
40
+ describe 'test attribute "impressions"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "clicks"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
+ end
50
+ end
51
+
52
+ describe 'test attribute "cost"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
55
+ end
56
+ end
57
+
58
+ describe 'test attribute "conversions"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
61
+ end
62
+ end
63
+
64
+ end