late-sdk 0.0.927 → 0.0.928

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: 3b522983a22f33b813eb3ed655ce02f772c4888899221e73b07b24a556691ba4
4
- data.tar.gz: f9720e017147152e181119b0e9c29498ed99e1e476da7bc6bef6f6250b37434f
3
+ metadata.gz: 53ab0fac247a957ef6103e9d276f05e0eb5d452a0497940d29ce9d7d7be9f8a6
4
+ data.tar.gz: a16380b5ddfdae855972e4d9948f43bbdd2f527bb19d2ff6e034c86dbf2ccda7
5
5
  SHA512:
6
- metadata.gz: 0ff6660bb98e1b02530c847c47d0a1c160f876078b329c4fd8f2935d33f4d9739ab812e9d2837c89cb93b1844502fcdc24034ef5586200626e58e0bf6d9c3dad
7
- data.tar.gz: 9ae969e95899c088b1d390b415b3c86419d89d6d6fac8972ceddb495ca9e389f9a1ae1665f1731ef422cc96260aa7b73e413872980127809802ac1a1368b0bc5
6
+ metadata.gz: 70f7af7d25c30b35fe3ccc84770ee4f848078ef7658955ab573f63aac5b7b31ad04efc7fabc2c4b0108ff4f935fc0deb582b455143799b68e93c5dd34de1e347
7
+ data.tar.gz: 5dcc078e16a7d9d62a5cda5be6d21a1d6df662f1c110b3a02312594b59142975a1c16e9f04d9d1863154b04dabf0d2de050aab6b902d9e6fbe41942f2a38abd2
data/README.md CHANGED
@@ -1717,6 +1717,8 @@ Class | Method | HTTP request | Description
1717
1717
  - [Zernio::GooglePmaxAssetGroupAssetsInner](docs/GooglePmaxAssetGroupAssetsInner.md)
1718
1718
  - [Zernio::GooglePmaxAssetGroupInput](docs/GooglePmaxAssetGroupInput.md)
1719
1719
  - [Zernio::GooglePmaxAssetGroupInputImages](docs/GooglePmaxAssetGroupInputImages.md)
1720
+ - [Zernio::GooglePmaxAssetGroupUpdate](docs/GooglePmaxAssetGroupUpdate.md)
1721
+ - [Zernio::GooglePmaxAssetGroupUpdateImages](docs/GooglePmaxAssetGroupUpdateImages.md)
1720
1722
  - [Zernio::GoogleRsaDescription](docs/GoogleRsaDescription.md)
1721
1723
  - [Zernio::GoogleRsaHeadline](docs/GoogleRsaHeadline.md)
1722
1724
  - [Zernio::GoogleSitelink](docs/GoogleSitelink.md)
@@ -2773,7 +2773,7 @@ end
2773
2773
 
2774
2774
  Update ad
2775
2775
 
2776
- 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); a kind left out is untouched. Any other `targeting` field returns 400: Google cannot mutate it post-create without recreating the campaign. RSA text updates use top-level `headlines`, `descriptions` and `finalUrls`. Each supplied array replaces the full list; omit a field to preserve it. 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 for Google. - **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.
2776
+ 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); 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.
2777
2777
 
2778
2778
  ### Examples
2779
2779
 
@@ -0,0 +1,30 @@
1
+ # Zernio::GooglePmaxAssetGroupUpdate
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **final_url** | **String** | Replaces the asset group's final URL. | [optional] |
8
+ | **headlines** | **Array<String>** | Replaces every HEADLINE asset on the group. | [optional] |
9
+ | **long_headline** | **String** | Replaces the LONG_HEADLINE asset. | [optional] |
10
+ | **descriptions** | **Array<String>** | Replaces every DESCRIPTION asset. At least one must be 60 characters or fewer. | [optional] |
11
+ | **business_name** | **String** | Replaces the BUSINESS_NAME asset. | [optional] |
12
+ | **images** | [**GooglePmaxAssetGroupUpdateImages**](GooglePmaxAssetGroupUpdateImages.md) | | [optional] |
13
+ | **youtube_video_ids** | **Array<String>** | Replaces YOUTUBE_VIDEO assets with existing YouTube video ids. Video uploads and arbitrary video URLs are not supported. | [optional] |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'zernio-sdk'
19
+
20
+ instance = Zernio::GooglePmaxAssetGroupUpdate.new(
21
+ final_url: null,
22
+ headlines: null,
23
+ long_headline: null,
24
+ descriptions: null,
25
+ business_name: null,
26
+ images: null,
27
+ youtube_video_ids: null
28
+ )
29
+ ```
30
+
@@ -0,0 +1,22 @@
1
+ # Zernio::GooglePmaxAssetGroupUpdateImages
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **landscape** | **Array<String>** | Replaces MARKETING_IMAGE assets. Aspect ratio 1.91:1, minimum 600 x 314 pixels. | [optional] |
8
+ | **square** | **Array<String>** | Replaces SQUARE_MARKETING_IMAGE assets. Aspect ratio 1:1, minimum 300 x 300 pixels. | [optional] |
9
+ | **logo** | **Array<String>** | Replaces LOGO assets. Aspect ratio 1:1, minimum 128 x 128 pixels. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zernio-sdk'
15
+
16
+ instance = Zernio::GooglePmaxAssetGroupUpdateImages.new(
17
+ landscape: null,
18
+ square: null,
19
+ logo: null
20
+ )
21
+ ```
22
+
@@ -4,9 +4,10 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **headlines** | [**Array<GoogleRsaHeadline>**](GoogleRsaHeadline.md) | Google RSA only. Replaces the complete headline list. No padding or truncation on update. | [optional] |
8
- | **descriptions** | [**Array<GoogleRsaDescription>**](GoogleRsaDescription.md) | Google RSA only. Replaces the complete description list. No padding or truncation on update. | [optional] |
9
- | **final_urls** | **Array<String>** | Google RSA only. Replaces final URLs. Omitted lists stay unchanged. | [optional] |
7
+ | **headlines** | [**Array<GoogleRsaHeadline>**](GoogleRsaHeadline.md) | Google Search and Display only. Replaces the complete headline list. Search takes 3-15, Display 1-5 and rejects pinnedField; the count is checked once the ad's channel is known. No padding or truncation on update. | [optional] |
8
+ | **descriptions** | [**Array<GoogleRsaDescription>**](GoogleRsaDescription.md) | Google Search and Display only. Replaces the complete description list. Search takes 2-4, Display 1-5 and rejects pinnedField. No padding or truncation on update. | [optional] |
9
+ | **final_urls** | **Array<String>** | Google Search and Display only. Replaces final URLs. Omitted lists stay unchanged. For Performance Max use assetGroup.finalUrl. | [optional] |
10
+ | **asset_group** | [**GooglePmaxAssetGroupUpdate**](GooglePmaxAssetGroupUpdate.md) | Google Performance Max only. Replaces whole asset roles on the ad's asset group. Returns 422 on any other platform or channel. | [optional] |
10
11
  | **status** | **String** | | [optional] |
11
12
  | **budget** | [**UpdateAdRequestBudget**](UpdateAdRequestBudget.md) | | [optional] |
12
13
  | **targeting** | [**UpdateAdRequestTargeting**](UpdateAdRequestTargeting.md) | | [optional] |
@@ -22,6 +23,7 @@ instance = Zernio::UpdateAdRequest.new(
22
23
  headlines: null,
23
24
  descriptions: null,
24
25
  final_urls: null,
26
+ asset_group: null,
25
27
  status: null,
26
28
  budget: null,
27
29
  targeting: null,
@@ -7,6 +7,9 @@
7
7
  | **promotion** | [**MetaPromotion**](MetaPromotion.md) | | [optional] |
8
8
  | **creative_features** | **Hash<String, String>** | Meta Advantage+ creative enhancements. Map snake_case feature names to OPT_IN or OPT_OUT; Meta validates supported keys and unspecified features default to OPT_OUT. auto_promotion_tag is an enhancement; use the separate promotion field for an explicit offer. The deprecated standard_enhancements bundle is rejected by Meta. | [optional] |
9
9
  | **headline** | **String** | Meta and LinkedIn (TikTok has no headline slot) | [optional] |
10
+ | **long_headline** | **String** | Google Display only. Replaces the responsive display ad's long headline. | [optional] |
11
+ | **business_name** | **String** | Google Display only. Replaces the responsive display ad's business name. | [optional] |
12
+ | **square_image_url** | **String** | Google Display only. Uploaded as a new square (1:1) marketing image asset that replaces the current one. | [optional] |
10
13
  | **body** | **String** | | [optional] |
11
14
  | **description** | **String** | Link description slot (Meta `link_data.description` / `video_data.link_description`, LinkedIn creative description). | [optional] |
12
15
  | **call_to_action** | **String** | | [optional] |
@@ -25,6 +28,9 @@ instance = Zernio::UpdateAdRequestCreative.new(
25
28
  promotion: null,
26
29
  creative_features: {auto_promotion_tag=OPT_IN},
27
30
  headline: null,
31
+ long_headline: null,
32
+ business_name: null,
33
+ square_image_url: null,
28
34
  body: null,
29
35
  description: null,
30
36
  call_to_action: null,
@@ -2907,7 +2907,7 @@ module Zernio
2907
2907
  end
2908
2908
 
2909
2909
  # Update ad
2910
- # 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); a kind left out is untouched. Any other `targeting` field returns 400: Google cannot mutate it post-create without recreating the campaign. RSA text updates use top-level `headlines`, `descriptions` and `finalUrls`. Each supplied array replaces the full list; omit a field to preserve it. 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 for Google. - **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.
2910
+ # 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); 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.
2911
2911
  # @param ad_id [String]
2912
2912
  # @param update_ad_request [UpdateAdRequest]
2913
2913
  # @param [Hash] opts the optional parameters
@@ -2918,7 +2918,7 @@ module Zernio
2918
2918
  end
2919
2919
 
2920
2920
  # Update ad
2921
- # 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); a kind left out is untouched. Any other `targeting` field returns 400: Google cannot mutate it post-create without recreating the campaign. RSA text updates use top-level `headlines`, `descriptions` and `finalUrls`. Each supplied array replaces the full list; omit a field to preserve it. 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 for Google. - **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.
2921
+ # 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); 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.
2922
2922
  # @param ad_id [String]
2923
2923
  # @param update_ad_request [UpdateAdRequest]
2924
2924
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,375 @@
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
+ # Replacement assets for an existing Performance Max asset group, sent on PUT /v1/ads/{adId}. Google assets are immutable (AssetService only creates), so each field you send becomes new assets linked to the asset group, and the assets that role held are unlinked in the same atomic request. Send one field or many; a field you omit is left untouched. Re-sending a value the asset group already carries is a no-op for that asset, not a re-upload. Unlinked assets stay in the account's asset library: Google has no asset delete. At least one description must be 60 characters or fewer. Texts within each list must be distinct.
18
+ class GooglePmaxAssetGroupUpdate < ApiModelBase
19
+ # Replaces the asset group's final URL.
20
+ attr_accessor :final_url
21
+
22
+ # Replaces every HEADLINE asset on the group.
23
+ attr_accessor :headlines
24
+
25
+ # Replaces the LONG_HEADLINE asset.
26
+ attr_accessor :long_headline
27
+
28
+ # Replaces every DESCRIPTION asset. At least one must be 60 characters or fewer.
29
+ attr_accessor :descriptions
30
+
31
+ # Replaces the BUSINESS_NAME asset.
32
+ attr_accessor :business_name
33
+
34
+ attr_accessor :images
35
+
36
+ # Replaces YOUTUBE_VIDEO assets with existing YouTube video ids. Video uploads and arbitrary video URLs are not supported.
37
+ attr_accessor :youtube_video_ids
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'final_url' => :'finalUrl',
43
+ :'headlines' => :'headlines',
44
+ :'long_headline' => :'longHeadline',
45
+ :'descriptions' => :'descriptions',
46
+ :'business_name' => :'businessName',
47
+ :'images' => :'images',
48
+ :'youtube_video_ids' => :'youtubeVideoIds'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'final_url' => :'String',
66
+ :'headlines' => :'Array<String>',
67
+ :'long_headline' => :'String',
68
+ :'descriptions' => :'Array<String>',
69
+ :'business_name' => :'String',
70
+ :'images' => :'GooglePmaxAssetGroupUpdateImages',
71
+ :'youtube_video_ids' => :'Array<String>'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GooglePmaxAssetGroupUpdate` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ acceptable_attribute_map = self.class.acceptable_attribute_map
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!acceptable_attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GooglePmaxAssetGroupUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'final_url')
98
+ self.final_url = attributes[:'final_url']
99
+ end
100
+
101
+ if attributes.key?(:'headlines')
102
+ if (value = attributes[:'headlines']).is_a?(Array)
103
+ self.headlines = value
104
+ end
105
+ end
106
+
107
+ if attributes.key?(:'long_headline')
108
+ self.long_headline = attributes[:'long_headline']
109
+ end
110
+
111
+ if attributes.key?(:'descriptions')
112
+ if (value = attributes[:'descriptions']).is_a?(Array)
113
+ self.descriptions = value
114
+ end
115
+ end
116
+
117
+ if attributes.key?(:'business_name')
118
+ self.business_name = attributes[:'business_name']
119
+ end
120
+
121
+ if attributes.key?(:'images')
122
+ self.images = attributes[:'images']
123
+ end
124
+
125
+ if attributes.key?(:'youtube_video_ids')
126
+ if (value = attributes[:'youtube_video_ids']).is_a?(Array)
127
+ self.youtube_video_ids = value
128
+ end
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ pattern = Regexp.new(/^https?:\/\//)
138
+ if !@final_url.nil? && @final_url !~ pattern
139
+ invalid_properties.push("invalid value for \"final_url\", must conform to the pattern #{pattern}.")
140
+ end
141
+
142
+ if !@headlines.nil? && @headlines.length > 15
143
+ invalid_properties.push('invalid value for "headlines", number of items must be less than or equal to 15.')
144
+ end
145
+
146
+ if !@headlines.nil? && @headlines.length < 3
147
+ invalid_properties.push('invalid value for "headlines", number of items must be greater than or equal to 3.')
148
+ end
149
+
150
+ if !@long_headline.nil? && @long_headline.to_s.length > 90
151
+ invalid_properties.push('invalid value for "long_headline", the character length must be smaller than or equal to 90.')
152
+ end
153
+
154
+ if !@long_headline.nil? && @long_headline.to_s.length < 1
155
+ invalid_properties.push('invalid value for "long_headline", the character length must be greater than or equal to 1.')
156
+ end
157
+
158
+ if !@descriptions.nil? && @descriptions.length > 5
159
+ invalid_properties.push('invalid value for "descriptions", number of items must be less than or equal to 5.')
160
+ end
161
+
162
+ if !@descriptions.nil? && @descriptions.length < 2
163
+ invalid_properties.push('invalid value for "descriptions", number of items must be greater than or equal to 2.')
164
+ end
165
+
166
+ if !@business_name.nil? && @business_name.to_s.length > 25
167
+ invalid_properties.push('invalid value for "business_name", the character length must be smaller than or equal to 25.')
168
+ end
169
+
170
+ if !@business_name.nil? && @business_name.to_s.length < 1
171
+ invalid_properties.push('invalid value for "business_name", the character length must be greater than or equal to 1.')
172
+ end
173
+
174
+ if !@youtube_video_ids.nil? && @youtube_video_ids.length > 5
175
+ invalid_properties.push('invalid value for "youtube_video_ids", number of items must be less than or equal to 5.')
176
+ end
177
+
178
+ if !@youtube_video_ids.nil? && @youtube_video_ids.length < 1
179
+ invalid_properties.push('invalid value for "youtube_video_ids", number of items must be greater than or equal to 1.')
180
+ end
181
+
182
+ invalid_properties
183
+ end
184
+
185
+ # Check to see if the all the properties in the model are valid
186
+ # @return true if the model is valid
187
+ def valid?
188
+ warn '[DEPRECATED] the `valid?` method is obsolete'
189
+ return false if !@final_url.nil? && @final_url !~ Regexp.new(/^https?:\/\//)
190
+ return false if !@headlines.nil? && @headlines.length > 15
191
+ return false if !@headlines.nil? && @headlines.length < 3
192
+ return false if !@long_headline.nil? && @long_headline.to_s.length > 90
193
+ return false if !@long_headline.nil? && @long_headline.to_s.length < 1
194
+ return false if !@descriptions.nil? && @descriptions.length > 5
195
+ return false if !@descriptions.nil? && @descriptions.length < 2
196
+ return false if !@business_name.nil? && @business_name.to_s.length > 25
197
+ return false if !@business_name.nil? && @business_name.to_s.length < 1
198
+ return false if !@youtube_video_ids.nil? && @youtube_video_ids.length > 5
199
+ return false if !@youtube_video_ids.nil? && @youtube_video_ids.length < 1
200
+ true
201
+ end
202
+
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] final_url Value to be assigned
205
+ def final_url=(final_url)
206
+ if final_url.nil?
207
+ fail ArgumentError, 'final_url cannot be nil'
208
+ end
209
+
210
+ pattern = Regexp.new(/^https?:\/\//)
211
+ if final_url !~ pattern
212
+ fail ArgumentError, "invalid value for \"final_url\", must conform to the pattern #{pattern}."
213
+ end
214
+
215
+ @final_url = final_url
216
+ end
217
+
218
+ # Custom attribute writer method with validation
219
+ # @param [Object] headlines Value to be assigned
220
+ def headlines=(headlines)
221
+ if headlines.nil?
222
+ fail ArgumentError, 'headlines cannot be nil'
223
+ end
224
+
225
+ if headlines.length > 15
226
+ fail ArgumentError, 'invalid value for "headlines", number of items must be less than or equal to 15.'
227
+ end
228
+
229
+ if headlines.length < 3
230
+ fail ArgumentError, 'invalid value for "headlines", number of items must be greater than or equal to 3.'
231
+ end
232
+
233
+ @headlines = headlines
234
+ end
235
+
236
+ # Custom attribute writer method with validation
237
+ # @param [Object] long_headline Value to be assigned
238
+ def long_headline=(long_headline)
239
+ if long_headline.nil?
240
+ fail ArgumentError, 'long_headline cannot be nil'
241
+ end
242
+
243
+ if long_headline.to_s.length > 90
244
+ fail ArgumentError, 'invalid value for "long_headline", the character length must be smaller than or equal to 90.'
245
+ end
246
+
247
+ if long_headline.to_s.length < 1
248
+ fail ArgumentError, 'invalid value for "long_headline", the character length must be greater than or equal to 1.'
249
+ end
250
+
251
+ @long_headline = long_headline
252
+ end
253
+
254
+ # Custom attribute writer method with validation
255
+ # @param [Object] descriptions Value to be assigned
256
+ def descriptions=(descriptions)
257
+ if descriptions.nil?
258
+ fail ArgumentError, 'descriptions cannot be nil'
259
+ end
260
+
261
+ if descriptions.length > 5
262
+ fail ArgumentError, 'invalid value for "descriptions", number of items must be less than or equal to 5.'
263
+ end
264
+
265
+ if descriptions.length < 2
266
+ fail ArgumentError, 'invalid value for "descriptions", number of items must be greater than or equal to 2.'
267
+ end
268
+
269
+ @descriptions = descriptions
270
+ end
271
+
272
+ # Custom attribute writer method with validation
273
+ # @param [Object] business_name Value to be assigned
274
+ def business_name=(business_name)
275
+ if business_name.nil?
276
+ fail ArgumentError, 'business_name cannot be nil'
277
+ end
278
+
279
+ if business_name.to_s.length > 25
280
+ fail ArgumentError, 'invalid value for "business_name", the character length must be smaller than or equal to 25.'
281
+ end
282
+
283
+ if business_name.to_s.length < 1
284
+ fail ArgumentError, 'invalid value for "business_name", the character length must be greater than or equal to 1.'
285
+ end
286
+
287
+ @business_name = business_name
288
+ end
289
+
290
+ # Custom attribute writer method with validation
291
+ # @param [Object] youtube_video_ids Value to be assigned
292
+ def youtube_video_ids=(youtube_video_ids)
293
+ if youtube_video_ids.nil?
294
+ fail ArgumentError, 'youtube_video_ids cannot be nil'
295
+ end
296
+
297
+ if youtube_video_ids.length > 5
298
+ fail ArgumentError, 'invalid value for "youtube_video_ids", number of items must be less than or equal to 5.'
299
+ end
300
+
301
+ if youtube_video_ids.length < 1
302
+ fail ArgumentError, 'invalid value for "youtube_video_ids", number of items must be greater than or equal to 1.'
303
+ end
304
+
305
+ @youtube_video_ids = youtube_video_ids
306
+ end
307
+
308
+ # Checks equality by comparing each attribute.
309
+ # @param [Object] Object to be compared
310
+ def ==(o)
311
+ return true if self.equal?(o)
312
+ self.class == o.class &&
313
+ final_url == o.final_url &&
314
+ headlines == o.headlines &&
315
+ long_headline == o.long_headline &&
316
+ descriptions == o.descriptions &&
317
+ business_name == o.business_name &&
318
+ images == o.images &&
319
+ youtube_video_ids == o.youtube_video_ids
320
+ end
321
+
322
+ # @see the `==` method
323
+ # @param [Object] Object to be compared
324
+ def eql?(o)
325
+ self == o
326
+ end
327
+
328
+ # Calculates hash code according to all attributes.
329
+ # @return [Integer] Hash code
330
+ def hash
331
+ [final_url, headlines, long_headline, descriptions, business_name, images, youtube_video_ids].hash
332
+ end
333
+
334
+ # Builds the object from hash
335
+ # @param [Hash] attributes Model attributes in the form of hash
336
+ # @return [Object] Returns the model itself
337
+ def self.build_from_hash(attributes)
338
+ return nil unless attributes.is_a?(Hash)
339
+ attributes = attributes.transform_keys(&:to_sym)
340
+ transformed_hash = {}
341
+ openapi_types.each_pair do |key, type|
342
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
343
+ transformed_hash["#{key}"] = nil
344
+ elsif type =~ /\AArray<(.*)>/i
345
+ # check to ensure the input is an array given that the attribute
346
+ # is documented as an array but the input is not
347
+ if attributes[attribute_map[key]].is_a?(Array)
348
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
349
+ end
350
+ elsif !attributes[attribute_map[key]].nil?
351
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
352
+ end
353
+ end
354
+ new(transformed_hash)
355
+ end
356
+
357
+ # Returns the object in the form of hash
358
+ # @return [Hash] Returns the object in the form of hash
359
+ def to_hash
360
+ hash = {}
361
+ self.class.attribute_map.each_pair do |attr, param|
362
+ value = self.send(attr)
363
+ if value.nil?
364
+ is_nullable = self.class.openapi_nullable.include?(attr)
365
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
366
+ end
367
+
368
+ hash[param] = _to_hash(value)
369
+ end
370
+ hash
371
+ end
372
+
373
+ end
374
+
375
+ end