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.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/docs/AdCampaignsApi.md +155 -1
- data/docs/AdKeyword.md +3 -1
- data/docs/AdKeywordQuality.md +24 -0
- data/docs/AdScheduleWindow.md +32 -0
- data/docs/BoostPostRequest.md +2 -0
- data/docs/BoostPostRequestPromotedObject.md +20 -0
- data/docs/GetCampaignAdSchedule200Response.md +28 -0
- data/docs/GetCampaignAdSchedule200ResponsePerformance.md +22 -0
- data/docs/GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner.md +26 -0
- data/docs/GetCampaignAdSchedule200ResponsePerformanceByHourInner.md +26 -0
- data/docs/UpdateCampaignAdSchedule200Response.md +22 -0
- data/docs/UpdateCampaignAdScheduleRequest.md +18 -0
- data/docs/UpdateCampaignAdScheduleRequestScheduleInner.md +28 -0
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +166 -2
- data/lib/zernio-sdk/models/ad_keyword.rb +11 -2
- data/lib/zernio-sdk/models/ad_keyword_quality.rb +241 -0
- data/lib/zernio-sdk/models/ad_schedule_window.rb +329 -0
- data/lib/zernio-sdk/models/boost_post_request.rb +10 -1
- data/lib/zernio-sdk/models/boost_post_request_promoted_object.rb +159 -0
- data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response.rb +197 -0
- data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance.rb +174 -0
- data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner.rb +218 -0
- data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_hour_inner.rb +212 -0
- data/lib/zernio-sdk/models/update_campaign_ad_schedule200_response.rb +167 -0
- data/lib/zernio-sdk/models/update_campaign_ad_schedule_request.rb +176 -0
- data/lib/zernio-sdk/models/update_campaign_ad_schedule_request_schedule_inner.rb +362 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +10 -0
- data/openapi.yaml +230 -7
- data/spec/api/ad_campaigns_api_spec.rb +31 -1
- data/spec/models/ad_keyword_quality_spec.rb +66 -0
- data/spec/models/ad_keyword_spec.rb +6 -0
- data/spec/models/ad_schedule_window_spec.rb +90 -0
- data/spec/models/boost_post_request_promoted_object_spec.rb +42 -0
- data/spec/models/boost_post_request_spec.rb +6 -0
- data/spec/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner_spec.rb +64 -0
- data/spec/models/get_campaign_ad_schedule200_response_performance_by_hour_inner_spec.rb +60 -0
- data/spec/models/get_campaign_ad_schedule200_response_performance_spec.rb +48 -0
- data/spec/models/get_campaign_ad_schedule200_response_spec.rb +66 -0
- data/spec/models/update_campaign_ad_schedule200_response_spec.rb +48 -0
- data/spec/models/update_campaign_ad_schedule_request_schedule_inner_spec.rb +78 -0
- data/spec/models/update_campaign_ad_schedule_request_spec.rb +36 -0
- data/zernio-sdk-0.0.952.gem +0 -0
- metadata +43 -3
- data/zernio-sdk-0.0.950.gem +0 -0
|
@@ -1553,6 +1553,96 @@ module Zernio
|
|
|
1553
1553
|
return data, status_code, headers
|
|
1554
1554
|
end
|
|
1555
1555
|
|
|
1556
|
+
# Read a campaign's ad schedule (dayparting)
|
|
1557
|
+
# 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.
|
|
1558
|
+
# @param campaign_id [String] Numeric Google platform campaign id.
|
|
1559
|
+
# @param [Hash] opts the optional parameters
|
|
1560
|
+
# @option opts [String] :platform Disambiguates the campaign id when the connection spans platforms.
|
|
1561
|
+
# @option opts [Boolean] :include_performance Also return delivery by day of week and by hour. Costs one extra Google call.
|
|
1562
|
+
# @option opts [Integer] :window_days Trailing window for the performance split. Ignored when fromDate and toDate are both given. (default to 30)
|
|
1563
|
+
# @option opts [Date] :from_date Start of an explicit performance range (YYYY-MM-DD). Use together with toDate.
|
|
1564
|
+
# @option opts [Date] :to_date End of an explicit performance range (YYYY-MM-DD). Must be on or after fromDate.
|
|
1565
|
+
# @return [GetCampaignAdSchedule200Response]
|
|
1566
|
+
def get_campaign_ad_schedule(campaign_id, opts = {})
|
|
1567
|
+
data, _status_code, _headers = get_campaign_ad_schedule_with_http_info(campaign_id, opts)
|
|
1568
|
+
data
|
|
1569
|
+
end
|
|
1570
|
+
|
|
1571
|
+
# Read a campaign's ad schedule (dayparting)
|
|
1572
|
+
# 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.
|
|
1573
|
+
# @param campaign_id [String] Numeric Google platform campaign id.
|
|
1574
|
+
# @param [Hash] opts the optional parameters
|
|
1575
|
+
# @option opts [String] :platform Disambiguates the campaign id when the connection spans platforms.
|
|
1576
|
+
# @option opts [Boolean] :include_performance Also return delivery by day of week and by hour. Costs one extra Google call.
|
|
1577
|
+
# @option opts [Integer] :window_days Trailing window for the performance split. Ignored when fromDate and toDate are both given. (default to 30)
|
|
1578
|
+
# @option opts [Date] :from_date Start of an explicit performance range (YYYY-MM-DD). Use together with toDate.
|
|
1579
|
+
# @option opts [Date] :to_date End of an explicit performance range (YYYY-MM-DD). Must be on or after fromDate.
|
|
1580
|
+
# @return [Array<(GetCampaignAdSchedule200Response, Integer, Hash)>] GetCampaignAdSchedule200Response data, response status code and response headers
|
|
1581
|
+
def get_campaign_ad_schedule_with_http_info(campaign_id, opts = {})
|
|
1582
|
+
if @api_client.config.debugging
|
|
1583
|
+
@api_client.config.logger.debug 'Calling API: AdCampaignsApi.get_campaign_ad_schedule ...'
|
|
1584
|
+
end
|
|
1585
|
+
# verify the required parameter 'campaign_id' is set
|
|
1586
|
+
if @api_client.config.client_side_validation && campaign_id.nil?
|
|
1587
|
+
fail ArgumentError, "Missing the required parameter 'campaign_id' when calling AdCampaignsApi.get_campaign_ad_schedule"
|
|
1588
|
+
end
|
|
1589
|
+
allowable_values = ["google"]
|
|
1590
|
+
if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform'])
|
|
1591
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
|
|
1592
|
+
end
|
|
1593
|
+
if @api_client.config.client_side_validation && !opts[:'window_days'].nil? && opts[:'window_days'] > 90
|
|
1594
|
+
fail ArgumentError, 'invalid value for "opts[:"window_days"]" when calling AdCampaignsApi.get_campaign_ad_schedule, must be smaller than or equal to 90.'
|
|
1595
|
+
end
|
|
1596
|
+
|
|
1597
|
+
if @api_client.config.client_side_validation && !opts[:'window_days'].nil? && opts[:'window_days'] < 1
|
|
1598
|
+
fail ArgumentError, 'invalid value for "opts[:"window_days"]" when calling AdCampaignsApi.get_campaign_ad_schedule, must be greater than or equal to 1.'
|
|
1599
|
+
end
|
|
1600
|
+
|
|
1601
|
+
# resource path
|
|
1602
|
+
local_var_path = '/v1/ads/campaigns/{campaignId}/ad-schedule'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))
|
|
1603
|
+
|
|
1604
|
+
# query parameters
|
|
1605
|
+
query_params = opts[:query_params] || {}
|
|
1606
|
+
query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
|
|
1607
|
+
query_params[:'includePerformance'] = opts[:'include_performance'] if !opts[:'include_performance'].nil?
|
|
1608
|
+
query_params[:'windowDays'] = opts[:'window_days'] if !opts[:'window_days'].nil?
|
|
1609
|
+
query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
|
|
1610
|
+
query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?
|
|
1611
|
+
|
|
1612
|
+
# header parameters
|
|
1613
|
+
header_params = opts[:header_params] || {}
|
|
1614
|
+
# HTTP header 'Accept' (if needed)
|
|
1615
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1616
|
+
|
|
1617
|
+
# form parameters
|
|
1618
|
+
form_params = opts[:form_params] || {}
|
|
1619
|
+
|
|
1620
|
+
# http body (model)
|
|
1621
|
+
post_body = opts[:debug_body]
|
|
1622
|
+
|
|
1623
|
+
# return_type
|
|
1624
|
+
return_type = opts[:debug_return_type] || 'GetCampaignAdSchedule200Response'
|
|
1625
|
+
|
|
1626
|
+
# auth_names
|
|
1627
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
1628
|
+
|
|
1629
|
+
new_options = opts.merge(
|
|
1630
|
+
:operation => :"AdCampaignsApi.get_campaign_ad_schedule",
|
|
1631
|
+
:header_params => header_params,
|
|
1632
|
+
:query_params => query_params,
|
|
1633
|
+
:form_params => form_params,
|
|
1634
|
+
:body => post_body,
|
|
1635
|
+
:auth_names => auth_names,
|
|
1636
|
+
:return_type => return_type
|
|
1637
|
+
)
|
|
1638
|
+
|
|
1639
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1640
|
+
if @api_client.config.debugging
|
|
1641
|
+
@api_client.config.logger.debug "API called: AdCampaignsApi#get_campaign_ad_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1642
|
+
end
|
|
1643
|
+
return data, status_code, headers
|
|
1644
|
+
end
|
|
1645
|
+
|
|
1556
1646
|
# Read a campaign's current bidding
|
|
1557
1647
|
# 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.
|
|
1558
1648
|
# @param campaign_id [String] Numeric Google platform campaign id.
|
|
@@ -2977,7 +3067,7 @@ module Zernio
|
|
|
2977
3067
|
end
|
|
2978
3068
|
|
|
2979
3069
|
# Update ad
|
|
2980
|
-
# 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.
|
|
3070
|
+
# 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.
|
|
2981
3071
|
# @param ad_id [String]
|
|
2982
3072
|
# @param update_ad_request [UpdateAdRequest]
|
|
2983
3073
|
# @param [Hash] opts the optional parameters
|
|
@@ -2988,7 +3078,7 @@ module Zernio
|
|
|
2988
3078
|
end
|
|
2989
3079
|
|
|
2990
3080
|
# Update ad
|
|
2991
|
-
# 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.
|
|
3081
|
+
# 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.
|
|
2992
3082
|
# @param ad_id [String]
|
|
2993
3083
|
# @param update_ad_request [UpdateAdRequest]
|
|
2994
3084
|
# @param [Hash] opts the optional parameters
|
|
@@ -3647,6 +3737,80 @@ module Zernio
|
|
|
3647
3737
|
return data, status_code, headers
|
|
3648
3738
|
end
|
|
3649
3739
|
|
|
3740
|
+
# Replace a campaign's ad schedule (dayparting)
|
|
3741
|
+
# 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.
|
|
3742
|
+
# @param campaign_id [String] Numeric Google platform campaign id.
|
|
3743
|
+
# @param update_campaign_ad_schedule_request [UpdateCampaignAdScheduleRequest]
|
|
3744
|
+
# @param [Hash] opts the optional parameters
|
|
3745
|
+
# @return [UpdateCampaignAdSchedule200Response]
|
|
3746
|
+
def update_campaign_ad_schedule(campaign_id, update_campaign_ad_schedule_request, opts = {})
|
|
3747
|
+
data, _status_code, _headers = update_campaign_ad_schedule_with_http_info(campaign_id, update_campaign_ad_schedule_request, opts)
|
|
3748
|
+
data
|
|
3749
|
+
end
|
|
3750
|
+
|
|
3751
|
+
# Replace a campaign's ad schedule (dayparting)
|
|
3752
|
+
# 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.
|
|
3753
|
+
# @param campaign_id [String] Numeric Google platform campaign id.
|
|
3754
|
+
# @param update_campaign_ad_schedule_request [UpdateCampaignAdScheduleRequest]
|
|
3755
|
+
# @param [Hash] opts the optional parameters
|
|
3756
|
+
# @return [Array<(UpdateCampaignAdSchedule200Response, Integer, Hash)>] UpdateCampaignAdSchedule200Response data, response status code and response headers
|
|
3757
|
+
def update_campaign_ad_schedule_with_http_info(campaign_id, update_campaign_ad_schedule_request, opts = {})
|
|
3758
|
+
if @api_client.config.debugging
|
|
3759
|
+
@api_client.config.logger.debug 'Calling API: AdCampaignsApi.update_campaign_ad_schedule ...'
|
|
3760
|
+
end
|
|
3761
|
+
# verify the required parameter 'campaign_id' is set
|
|
3762
|
+
if @api_client.config.client_side_validation && campaign_id.nil?
|
|
3763
|
+
fail ArgumentError, "Missing the required parameter 'campaign_id' when calling AdCampaignsApi.update_campaign_ad_schedule"
|
|
3764
|
+
end
|
|
3765
|
+
# verify the required parameter 'update_campaign_ad_schedule_request' is set
|
|
3766
|
+
if @api_client.config.client_side_validation && update_campaign_ad_schedule_request.nil?
|
|
3767
|
+
fail ArgumentError, "Missing the required parameter 'update_campaign_ad_schedule_request' when calling AdCampaignsApi.update_campaign_ad_schedule"
|
|
3768
|
+
end
|
|
3769
|
+
# resource path
|
|
3770
|
+
local_var_path = '/v1/ads/campaigns/{campaignId}/ad-schedule'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))
|
|
3771
|
+
|
|
3772
|
+
# query parameters
|
|
3773
|
+
query_params = opts[:query_params] || {}
|
|
3774
|
+
|
|
3775
|
+
# header parameters
|
|
3776
|
+
header_params = opts[:header_params] || {}
|
|
3777
|
+
# HTTP header 'Accept' (if needed)
|
|
3778
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
3779
|
+
# HTTP header 'Content-Type'
|
|
3780
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
3781
|
+
if !content_type.nil?
|
|
3782
|
+
header_params['Content-Type'] = content_type
|
|
3783
|
+
end
|
|
3784
|
+
|
|
3785
|
+
# form parameters
|
|
3786
|
+
form_params = opts[:form_params] || {}
|
|
3787
|
+
|
|
3788
|
+
# http body (model)
|
|
3789
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_campaign_ad_schedule_request)
|
|
3790
|
+
|
|
3791
|
+
# return_type
|
|
3792
|
+
return_type = opts[:debug_return_type] || 'UpdateCampaignAdSchedule200Response'
|
|
3793
|
+
|
|
3794
|
+
# auth_names
|
|
3795
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
3796
|
+
|
|
3797
|
+
new_options = opts.merge(
|
|
3798
|
+
:operation => :"AdCampaignsApi.update_campaign_ad_schedule",
|
|
3799
|
+
:header_params => header_params,
|
|
3800
|
+
:query_params => query_params,
|
|
3801
|
+
:form_params => form_params,
|
|
3802
|
+
:body => post_body,
|
|
3803
|
+
:auth_names => auth_names,
|
|
3804
|
+
:return_type => return_type
|
|
3805
|
+
)
|
|
3806
|
+
|
|
3807
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
3808
|
+
if @api_client.config.debugging
|
|
3809
|
+
@api_client.config.logger.debug "API called: AdCampaignsApi#update_campaign_ad_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
3810
|
+
end
|
|
3811
|
+
return data, status_code, headers
|
|
3812
|
+
end
|
|
3813
|
+
|
|
3650
3814
|
# Update campaign assets
|
|
3651
3815
|
# 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.
|
|
3652
3816
|
# @param campaign_id [String] Numeric Google platform id.
|
|
@@ -48,9 +48,11 @@ module Zernio
|
|
|
48
48
|
|
|
49
49
|
attr_accessor :negative
|
|
50
50
|
|
|
51
|
-
# Google Quality Score, 1-10. Null when unrated.
|
|
51
|
+
# Deprecated, use `quality.score`. Google Quality Score, 1-10. Null when unrated.
|
|
52
52
|
attr_accessor :quality_score
|
|
53
53
|
|
|
54
|
+
attr_accessor :quality
|
|
55
|
+
|
|
54
56
|
attr_accessor :synced_at
|
|
55
57
|
|
|
56
58
|
attr_accessor :metrics
|
|
@@ -96,6 +98,7 @@ module Zernio
|
|
|
96
98
|
:'status' => :'status',
|
|
97
99
|
:'negative' => :'negative',
|
|
98
100
|
:'quality_score' => :'qualityScore',
|
|
101
|
+
:'quality' => :'quality',
|
|
99
102
|
:'synced_at' => :'syncedAt',
|
|
100
103
|
:'metrics' => :'metrics'
|
|
101
104
|
}
|
|
@@ -130,6 +133,7 @@ module Zernio
|
|
|
130
133
|
:'status' => :'String',
|
|
131
134
|
:'negative' => :'Boolean',
|
|
132
135
|
:'quality_score' => :'Integer',
|
|
136
|
+
:'quality' => :'AdKeywordQuality',
|
|
133
137
|
:'synced_at' => :'Time',
|
|
134
138
|
:'metrics' => :'AdKeywordMetrics'
|
|
135
139
|
}
|
|
@@ -227,6 +231,10 @@ module Zernio
|
|
|
227
231
|
self.quality_score = attributes[:'quality_score']
|
|
228
232
|
end
|
|
229
233
|
|
|
234
|
+
if attributes.key?(:'quality')
|
|
235
|
+
self.quality = attributes[:'quality']
|
|
236
|
+
end
|
|
237
|
+
|
|
230
238
|
if attributes.key?(:'synced_at')
|
|
231
239
|
self.synced_at = attributes[:'synced_at']
|
|
232
240
|
end
|
|
@@ -308,6 +316,7 @@ module Zernio
|
|
|
308
316
|
status == o.status &&
|
|
309
317
|
negative == o.negative &&
|
|
310
318
|
quality_score == o.quality_score &&
|
|
319
|
+
quality == o.quality &&
|
|
311
320
|
synced_at == o.synced_at &&
|
|
312
321
|
metrics == o.metrics
|
|
313
322
|
end
|
|
@@ -321,7 +330,7 @@ module Zernio
|
|
|
321
330
|
# Calculates hash code according to all attributes.
|
|
322
331
|
# @return [Integer] Hash code
|
|
323
332
|
def hash
|
|
324
|
-
[id, account_id, profile_id, platform, ad_account_id, campaign_id, campaign_name, campaign_status, ad_set_id, ad_set_name, ad_set_status, keyword, match_type, status, negative, quality_score, synced_at, metrics].hash
|
|
333
|
+
[id, account_id, profile_id, platform, ad_account_id, campaign_id, campaign_name, campaign_status, ad_set_id, ad_set_name, ad_set_status, keyword, match_type, status, negative, quality_score, quality, synced_at, metrics].hash
|
|
325
334
|
end
|
|
326
335
|
|
|
327
336
|
# Builds the object from hash
|
|
@@ -0,0 +1,241 @@
|
|
|
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
|
+
# Google Quality Score and the three component ratings behind it (`ad_group_criterion.quality_info`). Every field is null until Google has rated the keyword: a keyword with too little traffic is unrated, and negatives are never rated. Google's own UNKNOWN / UNSPECIFIED buckets are reported as null so \"unrated\" has a single representation.
|
|
18
|
+
class AdKeywordQuality < ApiModelBase
|
|
19
|
+
# Quality Score, 1-10.
|
|
20
|
+
attr_accessor :score
|
|
21
|
+
|
|
22
|
+
# How the click-through rate compares with other ads in the same position (`search_predicted_ctr`).
|
|
23
|
+
attr_accessor :expected_ctr
|
|
24
|
+
|
|
25
|
+
# How closely the ad matches the intent behind the search (`creative_quality_score`).
|
|
26
|
+
attr_accessor :ad_relevance
|
|
27
|
+
|
|
28
|
+
# How relevant and useful the landing page is to people who click (`post_click_quality_score`).
|
|
29
|
+
attr_accessor :landing_page_experience
|
|
30
|
+
|
|
31
|
+
class EnumAttributeValidator
|
|
32
|
+
attr_reader :datatype
|
|
33
|
+
attr_reader :allowable_values
|
|
34
|
+
|
|
35
|
+
def initialize(datatype, allowable_values)
|
|
36
|
+
@allowable_values = allowable_values.map do |value|
|
|
37
|
+
case datatype.to_s
|
|
38
|
+
when /Integer/i
|
|
39
|
+
value.to_i
|
|
40
|
+
when /Float/i
|
|
41
|
+
value.to_f
|
|
42
|
+
else
|
|
43
|
+
value
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def valid?(value)
|
|
49
|
+
!value || allowable_values.include?(value)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
54
|
+
def self.attribute_map
|
|
55
|
+
{
|
|
56
|
+
:'score' => :'score',
|
|
57
|
+
:'expected_ctr' => :'expectedCtr',
|
|
58
|
+
:'ad_relevance' => :'adRelevance',
|
|
59
|
+
:'landing_page_experience' => :'landingPageExperience'
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns attribute mapping this model knows about
|
|
64
|
+
def self.acceptable_attribute_map
|
|
65
|
+
attribute_map
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns all the JSON keys this model knows about
|
|
69
|
+
def self.acceptable_attributes
|
|
70
|
+
acceptable_attribute_map.values
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute type mapping.
|
|
74
|
+
def self.openapi_types
|
|
75
|
+
{
|
|
76
|
+
:'score' => :'Integer',
|
|
77
|
+
:'expected_ctr' => :'String',
|
|
78
|
+
:'ad_relevance' => :'String',
|
|
79
|
+
:'landing_page_experience' => :'String'
|
|
80
|
+
}
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# List of attributes with nullable: true
|
|
84
|
+
def self.openapi_nullable
|
|
85
|
+
Set.new([
|
|
86
|
+
:'score',
|
|
87
|
+
:'expected_ctr',
|
|
88
|
+
:'ad_relevance',
|
|
89
|
+
:'landing_page_experience'
|
|
90
|
+
])
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Initializes the object
|
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
|
+
def initialize(attributes = {})
|
|
96
|
+
if (!attributes.is_a?(Hash))
|
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AdKeywordQuality` initialize method"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
102
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AdKeywordQuality`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
105
|
+
end
|
|
106
|
+
h[k.to_sym] = v
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'score')
|
|
110
|
+
self.score = attributes[:'score']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'expected_ctr')
|
|
114
|
+
self.expected_ctr = attributes[:'expected_ctr']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'ad_relevance')
|
|
118
|
+
self.ad_relevance = attributes[:'ad_relevance']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'landing_page_experience')
|
|
122
|
+
self.landing_page_experience = attributes[:'landing_page_experience']
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
127
|
+
# @return Array for valid properties with the reasons
|
|
128
|
+
def list_invalid_properties
|
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
130
|
+
invalid_properties = Array.new
|
|
131
|
+
invalid_properties
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Check to see if the all the properties in the model are valid
|
|
135
|
+
# @return true if the model is valid
|
|
136
|
+
def valid?
|
|
137
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
138
|
+
expected_ctr_validator = EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
|
|
139
|
+
return false unless expected_ctr_validator.valid?(@expected_ctr)
|
|
140
|
+
ad_relevance_validator = EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
|
|
141
|
+
return false unless ad_relevance_validator.valid?(@ad_relevance)
|
|
142
|
+
landing_page_experience_validator = EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
|
|
143
|
+
return false unless landing_page_experience_validator.valid?(@landing_page_experience)
|
|
144
|
+
true
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
148
|
+
# @param [Object] expected_ctr Object to be assigned
|
|
149
|
+
def expected_ctr=(expected_ctr)
|
|
150
|
+
validator = EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
|
|
151
|
+
unless validator.valid?(expected_ctr)
|
|
152
|
+
fail ArgumentError, "invalid value for \"expected_ctr\", must be one of #{validator.allowable_values}."
|
|
153
|
+
end
|
|
154
|
+
@expected_ctr = expected_ctr
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
158
|
+
# @param [Object] ad_relevance Object to be assigned
|
|
159
|
+
def ad_relevance=(ad_relevance)
|
|
160
|
+
validator = EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
|
|
161
|
+
unless validator.valid?(ad_relevance)
|
|
162
|
+
fail ArgumentError, "invalid value for \"ad_relevance\", must be one of #{validator.allowable_values}."
|
|
163
|
+
end
|
|
164
|
+
@ad_relevance = ad_relevance
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
168
|
+
# @param [Object] landing_page_experience Object to be assigned
|
|
169
|
+
def landing_page_experience=(landing_page_experience)
|
|
170
|
+
validator = EnumAttributeValidator.new('String', ["BELOW_AVERAGE", "AVERAGE", "ABOVE_AVERAGE"])
|
|
171
|
+
unless validator.valid?(landing_page_experience)
|
|
172
|
+
fail ArgumentError, "invalid value for \"landing_page_experience\", must be one of #{validator.allowable_values}."
|
|
173
|
+
end
|
|
174
|
+
@landing_page_experience = landing_page_experience
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Checks equality by comparing each attribute.
|
|
178
|
+
# @param [Object] Object to be compared
|
|
179
|
+
def ==(o)
|
|
180
|
+
return true if self.equal?(o)
|
|
181
|
+
self.class == o.class &&
|
|
182
|
+
score == o.score &&
|
|
183
|
+
expected_ctr == o.expected_ctr &&
|
|
184
|
+
ad_relevance == o.ad_relevance &&
|
|
185
|
+
landing_page_experience == o.landing_page_experience
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# @see the `==` method
|
|
189
|
+
# @param [Object] Object to be compared
|
|
190
|
+
def eql?(o)
|
|
191
|
+
self == o
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Calculates hash code according to all attributes.
|
|
195
|
+
# @return [Integer] Hash code
|
|
196
|
+
def hash
|
|
197
|
+
[score, expected_ctr, ad_relevance, landing_page_experience].hash
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Builds the object from hash
|
|
201
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
202
|
+
# @return [Object] Returns the model itself
|
|
203
|
+
def self.build_from_hash(attributes)
|
|
204
|
+
return nil unless attributes.is_a?(Hash)
|
|
205
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
206
|
+
transformed_hash = {}
|
|
207
|
+
openapi_types.each_pair do |key, type|
|
|
208
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
209
|
+
transformed_hash["#{key}"] = nil
|
|
210
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
211
|
+
# check to ensure the input is an array given that the attribute
|
|
212
|
+
# is documented as an array but the input is not
|
|
213
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
214
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
215
|
+
end
|
|
216
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
217
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
new(transformed_hash)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Returns the object in the form of hash
|
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
|
225
|
+
def to_hash
|
|
226
|
+
hash = {}
|
|
227
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
228
|
+
value = self.send(attr)
|
|
229
|
+
if value.nil?
|
|
230
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
231
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
hash[param] = _to_hash(value)
|
|
235
|
+
end
|
|
236
|
+
hash
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
end
|