late-sdk 0.0.712 → 0.0.714

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e2dede122bdc22380ddb34f95c88d683fb5293de67a7b1f103d172227d3d0a8
4
- data.tar.gz: 5d62e5125f5b1e31caee6e2ba5d25eea8102e738ffa2e6a3acbd05f831435ac6
3
+ metadata.gz: 7399f221b1d5acf2f70170084ea9f0e9925f047fa2c48bf8135321c2755c2262
4
+ data.tar.gz: 80346e97094eae3105d3357f1971fe80afc40dfa395d8177f191503ebd02a2d0
5
5
  SHA512:
6
- metadata.gz: 27298a74f36d392ccd5ea40600ab1ddff6d7e61f9fd1c033ae7486b4f0b0e015854fe5bff5972c66b7dbcba5a57f4a532b7068f260d3204dc4e8318c5d4e8388
7
- data.tar.gz: 35950d25ac955a78cb99a5c4d9c8e6e84ac353043cc01b76740f74b2d73cd1ce86b3982bcc28ca0c4e92c745a4aaf1855a590d1dd880ae995821265321c5a089
6
+ metadata.gz: 325afc2f3145f6427034da3770029434ce739014f2331a248041429d541cff6e413db778f81d91312aa3a1c3c9372e68b8257a50b4c1acbba1bb3f0cbf6a12a7
7
+ data.tar.gz: 48001f8f481e38763cfa244c927261aae6c8e6be42d8bf452e382bdf610b052c786563530cb35cd2c67da91a995f62b7fc1784d1b1b8e5d36dd055c8594f3ae1
data/README.md CHANGED
@@ -1956,6 +1956,8 @@ Class | Method | HTTP request | Description
1956
1956
  - [Zernio::UpdateAdRequestCreative](docs/UpdateAdRequestCreative.md)
1957
1957
  - [Zernio::UpdateAdRequestTargeting](docs/UpdateAdRequestTargeting.md)
1958
1958
  - [Zernio::UpdateAdRequestTargetingInterestsInner](docs/UpdateAdRequestTargetingInterestsInner.md)
1959
+ - [Zernio::UpdateAdRequestTargetingKeywordsInner](docs/UpdateAdRequestTargetingKeywordsInner.md)
1960
+ - [Zernio::UpdateAdRequestTargetingKeywordsInnerOneOf](docs/UpdateAdRequestTargetingKeywordsInnerOneOf.md)
1959
1961
  - [Zernio::UpdateAdSet200Response](docs/UpdateAdSet200Response.md)
1960
1962
  - [Zernio::UpdateAdSetRequest](docs/UpdateAdSetRequest.md)
1961
1963
  - [Zernio::UpdateAdSetRequestBudget](docs/UpdateAdSetRequestBudget.md)
@@ -1288,7 +1288,7 @@ end
1288
1288
 
1289
1289
  Update ad
1290
1290
 
1291
- 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`). - **Pinterest / X / LinkedIn / Google / 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).
1291
+ 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, and KEYWORD edits via `targeting.keywords` / `targeting.negativeKeywords` — each list you send becomes the FULL new set of its kind on the ad group (criteria not in the list are removed); a kind left out is untouched. Any other `targeting` field returns 400: Google cannot mutate broad targeting post-create without recreating the campaign. `creative` returns 501. - **Pinterest / X / LinkedIn / 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).
1292
1292
 
1293
1293
  ### Examples
1294
1294
 
data/docs/ContactsApi.md CHANGED
@@ -363,7 +363,7 @@ end
363
363
 
364
364
  List contacts
365
365
 
366
- List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and full-text search.
366
+ List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and text search on name, email and company.
367
367
 
368
368
  ### Examples
369
369
 
@@ -380,7 +380,7 @@ api_instance = Zernio::ContactsApi.new
380
380
  opts = {
381
381
  profile_id: 'profile_id_example', # String | Filter by profile. Omit to list across all profiles. Matches the profile recorded on the contact itself, which is set when the contact is created and is independent of the profile its account currently belongs to. Filter by accountId to list a contact through its channel instead.
382
382
  account_id: 'account_id_example', # String | Filter by the SocialAccount that owns the contact channel. Contacts are resolved through their channels, so the profileId contact filter is not applied while accountId is set. A profileId sent alongside is still access-checked and still scopes the returned filters.tags list.
383
- search: 'search_example', # String |
383
+ search: 'search_example', # String | Case-insensitive substring match on the contact name, email and company. Phone numbers and other platform identifiers are not matched: they live on the contact channel, not on the contact. To reach a contact from an inbox webhook, use the conversation.contactId it already carries.
384
384
  tag: 'tag_example', # String |
385
385
  tags: 'tags_example', # String | Comma-separated tags, matches contacts carrying any of them
386
386
  platform: 'instagram', # String |
@@ -422,7 +422,7 @@ end
422
422
  | ---- | ---- | ----------- | ----- |
423
423
  | **profile_id** | **String** | Filter by profile. Omit to list across all profiles. Matches the profile recorded on the contact itself, which is set when the contact is created and is independent of the profile its account currently belongs to. Filter by accountId to list a contact through its channel instead. | [optional] |
424
424
  | **account_id** | **String** | Filter by the SocialAccount that owns the contact channel. Contacts are resolved through their channels, so the profileId contact filter is not applied while accountId is set. A profileId sent alongside is still access-checked and still scopes the returned filters.tags list. | [optional] |
425
- | **search** | **String** | | [optional] |
425
+ | **search** | **String** | Case-insensitive substring match on the contact name, email and company. Phone numbers and other platform identifiers are not matched: they live on the contact channel, not on the contact. To reach a contact from an inbox webhook, use the conversation.contactId it already carries. | [optional] |
426
426
  | **tag** | **String** | | [optional] |
427
427
  | **tags** | **String** | Comma-separated tags, matches contacts carrying any of them | [optional] |
428
428
  | **platform** | **String** | | [optional] |
@@ -69,7 +69,8 @@
69
69
  | **placement_assets** | [**CreateStandaloneAdRequestPlacementAssets**](CreateStandaloneAdRequestPlacementAssets.md) | | [optional] |
70
70
  | **audience_id** | **String** | Custom audience ID for targeting | [optional] |
71
71
  | **campaign_type** | **String** | Google only | [optional][default to 'display'] |
72
- | **keywords** | **Array<String>** | Google Search only | [optional] |
72
+ | **keywords** | **Array<String>** | Google Search only. BROAD-match keywords on the new ad group (first 20). | [optional] |
73
+ | **negative_keywords** | **Array<String>** | Google Search only; other platforms return 400. BROAD-match negative keywords on the new ad group. Editable later via PUT /v1/ads/{adId} targeting.negativeKeywords. | [optional] |
73
74
  | **additional_headlines** | **Array<String>** | Google Search RSA only. Extra headlines. | [optional] |
74
75
  | **additional_descriptions** | **Array<String>** | Google Search RSA only. Extra descriptions. | [optional] |
75
76
  | **advantage_audience** | **Integer** | Meta only. Controls the Advantage audience feature (targeting_automation). 0 = disabled (default), 1 = enabled. Meta Marketing API requires this field on all ad set creation requests. | [optional] |
@@ -159,6 +160,7 @@ instance = Zernio::CreateStandaloneAdRequest.new(
159
160
  audience_id: null,
160
161
  campaign_type: null,
161
162
  keywords: null,
163
+ negative_keywords: null,
162
164
  additional_headlines: null,
163
165
  additional_descriptions: null,
164
166
  advantage_audience: null,
@@ -4,6 +4,8 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
+ | **keywords** | [**Array<UpdateAdRequestTargetingKeywordsInner>**](UpdateAdRequestTargetingKeywordsInner.md) | Google only. The FULL new set of positive keywords for the ad group; live keywords not listed are removed. Entries are strings (BROAD) or { text, matchType } with matchType exact | phrase | broad. Mirrored to GET /v1/ads/keywords immediately. | [optional] |
8
+ | **negative_keywords** | [**Array<UpdateAdRequestTargetingKeywordsInner>**](UpdateAdRequestTargetingKeywordsInner.md) | Google only. Same declarative contract as keywords, for the ad group's negative keywords. | [optional] |
7
9
  | **age_min** | **Integer** | | [optional] |
8
10
  | **age_max** | **Integer** | | [optional] |
9
11
  | **countries** | **Array<String>** | | [optional] |
@@ -16,6 +18,8 @@
16
18
  require 'zernio-sdk'
17
19
 
18
20
  instance = Zernio::UpdateAdRequestTargeting.new(
21
+ keywords: null,
22
+ negative_keywords: null,
19
23
  age_min: null,
20
24
  age_max: null,
21
25
  countries: null,
@@ -0,0 +1,49 @@
1
+ # Zernio::UpdateAdRequestTargetingKeywordsInner
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'zernio-sdk'
13
+
14
+ Zernio::UpdateAdRequestTargetingKeywordsInner.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'String',
18
+ # :'UpdateAdRequestTargetingKeywordsInnerOneOf'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'zernio-sdk'
30
+
31
+ Zernio::UpdateAdRequestTargetingKeywordsInner.build(data)
32
+ # => #<String:0x00007fdd4aab02a0>
33
+
34
+ Zernio::UpdateAdRequestTargetingKeywordsInner.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `String`
47
+ - `UpdateAdRequestTargetingKeywordsInnerOneOf`
48
+ - `nil` (if no type matches)
49
+
@@ -0,0 +1,20 @@
1
+ # Zernio::UpdateAdRequestTargetingKeywordsInnerOneOf
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **text** | **String** | | |
8
+ | **match_type** | **String** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zernio-sdk'
14
+
15
+ instance = Zernio::UpdateAdRequestTargetingKeywordsInnerOneOf.new(
16
+ text: null,
17
+ match_type: null
18
+ )
19
+ ```
20
+
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id** | **String** | | |
8
- | **contact_id** | **String** | Zernio CRM Contact id for this sender, when one exists. | [optional] |
8
+ | **contact_id** | **String** | Always omitted on this event: the sender is the business, not a contact. Use conversation.contactId to join back to the CRM Contact. | [optional] |
9
9
  | **name** | **String** | | [optional] |
10
10
  | **username** | **String** | | [optional] |
11
11
  | **picture** | **String** | | [optional] |
@@ -1381,7 +1381,7 @@ module Zernio
1381
1381
  end
1382
1382
 
1383
1383
  # Update ad
1384
- # 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`). - **Pinterest / X / LinkedIn / Google / 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).
1384
+ # 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, and KEYWORD edits via `targeting.keywords` / `targeting.negativeKeywords` — each list you send becomes the FULL new set of its kind on the ad group (criteria not in the list are removed); a kind left out is untouched. Any other `targeting` field returns 400: Google cannot mutate broad targeting post-create without recreating the campaign. `creative` returns 501. - **Pinterest / X / LinkedIn / 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).
1385
1385
  # @param ad_id [String]
1386
1386
  # @param update_ad_request [UpdateAdRequest]
1387
1387
  # @param [Hash] opts the optional parameters
@@ -1392,7 +1392,7 @@ module Zernio
1392
1392
  end
1393
1393
 
1394
1394
  # Update ad
1395
- # 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 &#x60;/v2/adgroup/update/&#x60;), and creative (via &#x60;/v2/ad/update/&#x60; patch-style — &#x60;headline&#x60; is ignored, &#x60;body&#x60; becomes &#x60;ad_text&#x60;). - **Pinterest / X / LinkedIn / Google / OpenAI Ads**: status + budget only. Sending &#x60;targeting&#x60; or &#x60;creative&#x60; returns 501 with code &#x60;unsupported_platform_operation&#x60;. OpenAI Ads budget is lifetime-only (see &#x60;budget.type&#x60; below).
1395
+ # 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 &#x60;/v2/adgroup/update/&#x60;), and creative (via &#x60;/v2/ad/update/&#x60; patch-style — &#x60;headline&#x60; is ignored, &#x60;body&#x60; becomes &#x60;ad_text&#x60;). - **Google**: status, budget, and KEYWORD edits via &#x60;targeting.keywords&#x60; / &#x60;targeting.negativeKeywords&#x60; — each list you send becomes the FULL new set of its kind on the ad group (criteria not in the list are removed); a kind left out is untouched. Any other &#x60;targeting&#x60; field returns 400: Google cannot mutate broad targeting post-create without recreating the campaign. &#x60;creative&#x60; returns 501. - **Pinterest / X / LinkedIn / OpenAI Ads**: status + budget only. Sending &#x60;targeting&#x60; or &#x60;creative&#x60; returns 501 with code &#x60;unsupported_platform_operation&#x60;. OpenAI Ads budget is lifetime-only (see &#x60;budget.type&#x60; below).
1396
1396
  # @param ad_id [String]
1397
1397
  # @param update_ad_request [UpdateAdRequest]
1398
1398
  # @param [Hash] opts the optional parameters
@@ -345,11 +345,11 @@ module Zernio
345
345
  end
346
346
 
347
347
  # List contacts
348
- # List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and full-text search.
348
+ # List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and text search on name, email and company.
349
349
  # @param [Hash] opts the optional parameters
350
350
  # @option opts [String] :profile_id Filter by profile. Omit to list across all profiles. Matches the profile recorded on the contact itself, which is set when the contact is created and is independent of the profile its account currently belongs to. Filter by accountId to list a contact through its channel instead.
351
351
  # @option opts [String] :account_id Filter by the SocialAccount that owns the contact channel. Contacts are resolved through their channels, so the profileId contact filter is not applied while accountId is set. A profileId sent alongside is still access-checked and still scopes the returned filters.tags list.
352
- # @option opts [String] :search
352
+ # @option opts [String] :search Case-insensitive substring match on the contact name, email and company. Phone numbers and other platform identifiers are not matched: they live on the contact channel, not on the contact. To reach a contact from an inbox webhook, use the conversation.contactId it already carries.
353
353
  # @option opts [String] :tag
354
354
  # @option opts [String] :tags Comma-separated tags, matches contacts carrying any of them
355
355
  # @option opts [String] :platform
@@ -363,11 +363,11 @@ module Zernio
363
363
  end
364
364
 
365
365
  # List contacts
366
- # List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and full-text search.
366
+ # List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and text search on name, email and company.
367
367
  # @param [Hash] opts the optional parameters
368
368
  # @option opts [String] :profile_id Filter by profile. Omit to list across all profiles. Matches the profile recorded on the contact itself, which is set when the contact is created and is independent of the profile its account currently belongs to. Filter by accountId to list a contact through its channel instead.
369
369
  # @option opts [String] :account_id Filter by the SocialAccount that owns the contact channel. Contacts are resolved through their channels, so the profileId contact filter is not applied while accountId is set. A profileId sent alongside is still access-checked and still scopes the returned filters.tags list.
370
- # @option opts [String] :search
370
+ # @option opts [String] :search Case-insensitive substring match on the contact name, email and company. Phone numbers and other platform identifiers are not matched: they live on the contact channel, not on the contact. To reach a contact from an inbox webhook, use the conversation.contactId it already carries.
371
371
  # @option opts [String] :tag
372
372
  # @option opts [String] :tags Comma-separated tags, matches contacts carrying any of them
373
373
  # @option opts [String] :platform
@@ -198,9 +198,12 @@ module Zernio
198
198
  # Google only
199
199
  attr_accessor :campaign_type
200
200
 
201
- # Google Search only
201
+ # Google Search only. BROAD-match keywords on the new ad group (first 20).
202
202
  attr_accessor :keywords
203
203
 
204
+ # Google Search only; other platforms return 400. BROAD-match negative keywords on the new ad group. Editable later via PUT /v1/ads/{adId} targeting.negativeKeywords.
205
+ attr_accessor :negative_keywords
206
+
204
207
  # Google Search RSA only. Extra headlines.
205
208
  attr_accessor :additional_headlines
206
209
 
@@ -337,6 +340,7 @@ module Zernio
337
340
  :'audience_id' => :'audienceId',
338
341
  :'campaign_type' => :'campaignType',
339
342
  :'keywords' => :'keywords',
343
+ :'negative_keywords' => :'negativeKeywords',
340
344
  :'additional_headlines' => :'additionalHeadlines',
341
345
  :'additional_descriptions' => :'additionalDescriptions',
342
346
  :'advantage_audience' => :'advantageAudience',
@@ -435,6 +439,7 @@ module Zernio
435
439
  :'audience_id' => :'String',
436
440
  :'campaign_type' => :'String',
437
441
  :'keywords' => :'Array<String>',
442
+ :'negative_keywords' => :'Array<String>',
438
443
  :'additional_headlines' => :'Array<String>',
439
444
  :'additional_descriptions' => :'Array<String>',
440
445
  :'advantage_audience' => :'Integer',
@@ -784,6 +789,12 @@ module Zernio
784
789
  end
785
790
  end
786
791
 
792
+ if attributes.key?(:'negative_keywords')
793
+ if (value = attributes[:'negative_keywords']).is_a?(Array)
794
+ self.negative_keywords = value
795
+ end
796
+ end
797
+
787
798
  if attributes.key?(:'additional_headlines')
788
799
  if (value = attributes[:'additional_headlines']).is_a?(Array)
789
800
  self.additional_headlines = value
@@ -1473,6 +1484,7 @@ module Zernio
1473
1484
  audience_id == o.audience_id &&
1474
1485
  campaign_type == o.campaign_type &&
1475
1486
  keywords == o.keywords &&
1487
+ negative_keywords == o.negative_keywords &&
1476
1488
  additional_headlines == o.additional_headlines &&
1477
1489
  additional_descriptions == o.additional_descriptions &&
1478
1490
  advantage_audience == o.advantage_audience &&
@@ -1500,7 +1512,7 @@ module Zernio
1500
1512
  # Calculates hash code according to all attributes.
1501
1513
  # @return [Integer] Hash code
1502
1514
  def hash
1503
- [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, multi_advertiser, validate_only, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
1515
+ [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, multi_advertiser, validate_only, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, negative_keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
1504
1516
  end
1505
1517
 
1506
1518
  # Builds the object from hash
@@ -14,8 +14,14 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zernio
17
- # Meta + TikTok only. Pinterest / X / LinkedIn / Google return 501.
17
+ # Meta + TikTok (demographics/interests) and Google (keyword edits only). Pinterest / X / LinkedIn return 501.
18
18
  class UpdateAdRequestTargeting < ApiModelBase
19
+ # Google only. The FULL new set of positive keywords for the ad group; live keywords not listed are removed. Entries are strings (BROAD) or { text, matchType } with matchType exact | phrase | broad. Mirrored to GET /v1/ads/keywords immediately.
20
+ attr_accessor :keywords
21
+
22
+ # Google only. Same declarative contract as keywords, for the ad group's negative keywords.
23
+ attr_accessor :negative_keywords
24
+
19
25
  attr_accessor :age_min
20
26
 
21
27
  attr_accessor :age_max
@@ -53,6 +59,8 @@ module Zernio
53
59
  # Attribute mapping from ruby-style variable name to JSON key.
54
60
  def self.attribute_map
55
61
  {
62
+ :'keywords' => :'keywords',
63
+ :'negative_keywords' => :'negativeKeywords',
56
64
  :'age_min' => :'ageMin',
57
65
  :'age_max' => :'ageMax',
58
66
  :'countries' => :'countries',
@@ -74,6 +82,8 @@ module Zernio
74
82
  # Attribute type mapping.
75
83
  def self.openapi_types
76
84
  {
85
+ :'keywords' => :'Array<UpdateAdRequestTargetingKeywordsInner>',
86
+ :'negative_keywords' => :'Array<UpdateAdRequestTargetingKeywordsInner>',
77
87
  :'age_min' => :'Integer',
78
88
  :'age_max' => :'Integer',
79
89
  :'countries' => :'Array<String>',
@@ -104,6 +114,18 @@ module Zernio
104
114
  h[k.to_sym] = v
105
115
  }
106
116
 
117
+ if attributes.key?(:'keywords')
118
+ if (value = attributes[:'keywords']).is_a?(Array)
119
+ self.keywords = value
120
+ end
121
+ end
122
+
123
+ if attributes.key?(:'negative_keywords')
124
+ if (value = attributes[:'negative_keywords']).is_a?(Array)
125
+ self.negative_keywords = value
126
+ end
127
+ end
128
+
107
129
  if attributes.key?(:'age_min')
108
130
  self.age_min = attributes[:'age_min']
109
131
  end
@@ -217,6 +239,8 @@ module Zernio
217
239
  def ==(o)
218
240
  return true if self.equal?(o)
219
241
  self.class == o.class &&
242
+ keywords == o.keywords &&
243
+ negative_keywords == o.negative_keywords &&
220
244
  age_min == o.age_min &&
221
245
  age_max == o.age_max &&
222
246
  countries == o.countries &&
@@ -233,7 +257,7 @@ module Zernio
233
257
  # Calculates hash code according to all attributes.
234
258
  # @return [Integer] Hash code
235
259
  def hash
236
- [age_min, age_max, countries, interests, advantage_audience].hash
260
+ [keywords, negative_keywords, age_min, age_max, countries, interests, advantage_audience].hash
237
261
  end
238
262
 
239
263
  # Builds the object from hash
@@ -0,0 +1,104 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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
+ module UpdateAdRequestTargetingKeywordsInner
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'String',
23
+ :'UpdateAdRequestTargetingKeywordsInnerOneOf'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - We do not attempt to check whether exactly one item matches.
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_one_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ return find_and_cast_into_type(klass, data)
42
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
+ end
44
+ end
45
+
46
+ openapi_one_of.include?(:AnyType) ? data : nil
47
+ end
48
+
49
+ private
50
+
51
+ SchemaMismatchError = Class.new(StandardError)
52
+
53
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
+ def find_and_cast_into_type(klass, data)
55
+ return if data.nil?
56
+
57
+ case klass.to_s
58
+ when 'Boolean'
59
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
+ when 'Float'
61
+ return data if data.instance_of?(Float)
62
+ when 'Integer'
63
+ return data if data.instance_of?(Integer)
64
+ when 'Time'
65
+ return Time.parse(data)
66
+ when 'Date'
67
+ return Date.iso8601(data)
68
+ when 'String'
69
+ return data if data.instance_of?(String)
70
+ when 'Object' # "type: object"
71
+ return data if data.instance_of?(Hash)
72
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
+ if data.instance_of?(Array)
74
+ sub_type = Regexp.last_match[:sub_type]
75
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
+ end
77
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
+ sub_type = Regexp.last_match[:sub_type]
80
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
+ end
82
+ else # model
83
+ const = Zernio.const_get(klass)
84
+ if const
85
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
86
+ model = const.build(data)
87
+ return model if model
88
+ else
89
+ # raise if data contains keys that are not known to the model
90
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ model = const.build_from_hash(data)
92
+ return model if model
93
+ end
94
+ end
95
+ end
96
+
97
+ raise # if no match by now, raise
98
+ rescue
99
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
+ end
101
+ end
102
+ end
103
+
104
+ end