late-sdk 0.0.905 → 0.0.906
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 +6 -0
- data/docs/AdCampaignsApi.md +71 -1
- data/docs/AdCreative.md +4 -0
- data/docs/CreateStandaloneAdRequest.md +8 -6
- data/docs/GooglePmaxAssetGroup.md +28 -0
- data/docs/GooglePmaxAssetGroupAssetsInner.md +28 -0
- data/docs/GooglePmaxAssetGroupInput.md +32 -0
- data/docs/GooglePmaxAssetGroupInputImages.md +22 -0
- data/docs/ListGoogleAssetGroups200Response.md +22 -0
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +70 -2
- data/lib/zernio-sdk/models/ad_creative.rb +21 -1
- data/lib/zernio-sdk/models/create_standalone_ad200_response_results_inner.rb +2 -2
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +18 -9
- data/lib/zernio-sdk/models/google_pmax_asset_group.rb +299 -0
- data/lib/zernio-sdk/models/google_pmax_asset_group_assets_inner.rb +244 -0
- data/lib/zernio-sdk/models/google_pmax_asset_group_input.rb +453 -0
- data/lib/zernio-sdk/models/google_pmax_asset_group_input_images.rb +280 -0
- data/lib/zernio-sdk/models/list_google_asset_groups200_response.rb +204 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +5 -0
- data/openapi.yaml +184 -8
- data/spec/api/ad_campaigns_api_spec.rb +13 -1
- data/spec/models/ad_creative_spec.rb +12 -0
- data/spec/models/create_standalone_ad200_response_results_inner_spec.rb +1 -1
- data/spec/models/create_standalone_ad_request_spec.rb +7 -1
- data/spec/models/google_pmax_asset_group_assets_inner_spec.rb +66 -0
- data/spec/models/google_pmax_asset_group_input_images_spec.rb +48 -0
- data/spec/models/google_pmax_asset_group_input_spec.rb +78 -0
- data/spec/models/google_pmax_asset_group_spec.rb +66 -0
- data/spec/models/list_google_asset_groups200_response_spec.rb +48 -0
- data/zernio-sdk-0.0.906.gem +0 -0
- metadata +22 -2
- data/zernio-sdk-0.0.905.gem +0 -0
|
@@ -55,16 +55,16 @@ module Zernio
|
|
|
55
55
|
# Meta only. Multi-advertiser ads: whether Meta may show this ad alongside other advertisers' in one unit. Meta auto-enrols since Aug 2024, so send OPT_OUT to leave. It is a top-level creative field, NOT a `creativeFeatures` key, and Meta rejects it there.
|
|
56
56
|
attr_accessor :multi_advertiser
|
|
57
57
|
|
|
58
|
-
#
|
|
58
|
+
# Google Performance Max validates the complete atomic campaign and asset group with no resource creation or local persistence. Google validation still downloads image URLs and consumes quota. On Meta, validates the complete inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created, and validation bypasses Idempotency-Key storage. Supports a single image, existing video.id or existingCreativeId; media pools, new video uploads, creatives[], adSetId and RESERVED buying return 400. Existing campaign or creative nodes are marked skipped. Success returns 200 with per-node results; Meta rejection returns an error.
|
|
59
59
|
attr_accessor :validate_only
|
|
60
60
|
|
|
61
|
-
# Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents. Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy
|
|
61
|
+
# Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents. Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy, multi-creative and Performance Max shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
|
|
62
62
|
attr_accessor :budget_amount
|
|
63
63
|
|
|
64
|
-
# Required on legacy
|
|
64
|
+
# Required on legacy, multi-creative and Performance Max shapes. Inherited on attach. OpenAI Ads accepts lifetime only (no daily-budget concept on the platform); sending daily returns 422. OpenAI Ads lifetime budgets require `endDate` to give the lifetime cap a spend window.
|
|
65
65
|
attr_accessor :budget_type
|
|
66
66
|
|
|
67
|
-
# Meta, TikTok, and LinkedIn
|
|
67
|
+
# Google Performance Max accepts PAUSED only and always creates a paused campaign. Meta, TikTok, and LinkedIn: publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/{campaignId}/status with `active` brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: `existingCampaignId` (that campaign may be running and is never touched) or `campaignStatus: ACTIVE`. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
|
|
68
68
|
attr_accessor :status
|
|
69
69
|
|
|
70
70
|
# Meta only. Overrides `status` for the campaign level alone, so you can create a live campaign whose ad set and ad stay paused, or the reverse. Omitted, it follows `status`.
|
|
@@ -225,9 +225,11 @@ module Zernio
|
|
|
225
225
|
# Custom audience ID for targeting
|
|
226
226
|
attr_accessor :audience_id
|
|
227
227
|
|
|
228
|
-
# Google only
|
|
228
|
+
# Google only. Performance Max requires assetGroup and is always created PAUSED.
|
|
229
229
|
attr_accessor :campaign_type
|
|
230
230
|
|
|
231
|
+
attr_accessor :asset_group
|
|
232
|
+
|
|
231
233
|
# Google Search only. Keywords on the new ad group; entries are strings (BROAD) or { text, matchType }. Editable later via PUT /v1/ads/{adId} targeting.keywords.
|
|
232
234
|
attr_accessor :keywords
|
|
233
235
|
|
|
@@ -270,7 +272,7 @@ module Zernio
|
|
|
270
272
|
# Deprecated: send it inside `platformSpecificData` instead (Meta today; TikTok's nested shape is planned). The flat field keeps working during the deprecation window; sending both shapes returns a 400. Minimum ROAS as a decimal multiplier (e.g. 2.0 = 2.0x ROAS). Required when `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`. Sending it without `bidStrategy` is a 400. Sent to Meta as `bid_constraints.roas_average_floor` × 10000. Known gap: a CBO campaign's ROAS floor lives on the campaign only (set via `POST /v1/ads/campaigns`); there is no supported way to set it while joining a CBO campaign here.
|
|
271
273
|
attr_accessor :roas_average_floor
|
|
272
274
|
|
|
273
|
-
# Google only. Attach an existing portfolio bid strategy (numeric id from GET /v1/ads/bid-strategies) to the new campaign instead of a standard one. Exclusive with bidStrategy.
|
|
275
|
+
# Google Search and Display only. Performance Max rejects portfolio bidding. Attach an existing portfolio bid strategy (numeric id from GET /v1/ads/bid-strategies) to the new campaign instead of a standard one. Exclusive with bidStrategy.
|
|
274
276
|
attr_accessor :portfolio_bid_strategy_id
|
|
275
277
|
|
|
276
278
|
# Meta only (facebook, instagram; other platforms return 400). Value rule set to attach to the new ad set, from `/v1/ads/value-rule-sets`. Attachment is driven by this id, so `valueRulesApplied` is optional alongside it. Rejected with 400 in `adSetId` attach mode: that shape inherits the existing ad set's attachment, so the field would be silently ignored. Use `PUT /v1/ads/ad-sets/{adSetId}` there instead. Ignored (stripped before the ad-set create) when `buyingType` is `RESERVED`: value rules only apply to auction ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`, and a Reach & Frequency reservation has no auction bid strategy. Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`; the attachment is not mirrored onto Zernio's ad documents.
|
|
@@ -409,6 +411,7 @@ module Zernio
|
|
|
409
411
|
:'placement_assets' => :'placementAssets',
|
|
410
412
|
:'audience_id' => :'audienceId',
|
|
411
413
|
:'campaign_type' => :'campaignType',
|
|
414
|
+
:'asset_group' => :'assetGroup',
|
|
412
415
|
:'keywords' => :'keywords',
|
|
413
416
|
:'negative_keywords' => :'negativeKeywords',
|
|
414
417
|
:'campaign_negative_keywords' => :'campaignNegativeKeywords',
|
|
@@ -528,6 +531,7 @@ module Zernio
|
|
|
528
531
|
:'placement_assets' => :'CreateStandaloneAdRequestPlacementAssets',
|
|
529
532
|
:'audience_id' => :'String',
|
|
530
533
|
:'campaign_type' => :'String',
|
|
534
|
+
:'asset_group' => :'GooglePmaxAssetGroupInput',
|
|
531
535
|
:'keywords' => :'Array<KeywordEntry>',
|
|
532
536
|
:'negative_keywords' => :'Array<KeywordEntry>',
|
|
533
537
|
:'campaign_negative_keywords' => :'Array<KeywordEntry>',
|
|
@@ -939,6 +943,10 @@ module Zernio
|
|
|
939
943
|
self.campaign_type = 'display'
|
|
940
944
|
end
|
|
941
945
|
|
|
946
|
+
if attributes.key?(:'asset_group')
|
|
947
|
+
self.asset_group = attributes[:'asset_group']
|
|
948
|
+
end
|
|
949
|
+
|
|
942
950
|
if attributes.key?(:'keywords')
|
|
943
951
|
if (value = attributes[:'keywords']).is_a?(Array)
|
|
944
952
|
self.keywords = value
|
|
@@ -1311,7 +1319,7 @@ module Zernio
|
|
|
1311
1319
|
return false if !@carousel_cards.nil? && @carousel_cards.length < 2
|
|
1312
1320
|
return false if !@translations.nil? && @translations.length > 10
|
|
1313
1321
|
return false if !@translations.nil? && @translations.length < 1
|
|
1314
|
-
campaign_type_validator = EnumAttributeValidator.new('String', ["display", "search"])
|
|
1322
|
+
campaign_type_validator = EnumAttributeValidator.new('String', ["display", "search", "pmax"])
|
|
1315
1323
|
return false unless campaign_type_validator.valid?(@campaign_type)
|
|
1316
1324
|
return false if !@keywords.nil? && @keywords.length > 1000
|
|
1317
1325
|
return false if !@negative_keywords.nil? && @negative_keywords.length > 1000
|
|
@@ -1710,7 +1718,7 @@ module Zernio
|
|
|
1710
1718
|
# Custom attribute writer method checking allowed values (enum).
|
|
1711
1719
|
# @param [Object] campaign_type Object to be assigned
|
|
1712
1720
|
def campaign_type=(campaign_type)
|
|
1713
|
-
validator = EnumAttributeValidator.new('String', ["display", "search"])
|
|
1721
|
+
validator = EnumAttributeValidator.new('String', ["display", "search", "pmax"])
|
|
1714
1722
|
unless validator.valid?(campaign_type)
|
|
1715
1723
|
fail ArgumentError, "invalid value for \"campaign_type\", must be one of #{validator.allowable_values}."
|
|
1716
1724
|
end
|
|
@@ -2037,6 +2045,7 @@ module Zernio
|
|
|
2037
2045
|
placement_assets == o.placement_assets &&
|
|
2038
2046
|
audience_id == o.audience_id &&
|
|
2039
2047
|
campaign_type == o.campaign_type &&
|
|
2048
|
+
asset_group == o.asset_group &&
|
|
2040
2049
|
keywords == o.keywords &&
|
|
2041
2050
|
negative_keywords == o.negative_keywords &&
|
|
2042
2051
|
campaign_negative_keywords == o.campaign_negative_keywords &&
|
|
@@ -2076,7 +2085,7 @@ module Zernio
|
|
|
2076
2085
|
# Calculates hash code according to all attributes.
|
|
2077
2086
|
# @return [Integer] Hash code
|
|
2078
2087
|
def hash
|
|
2079
|
-
[account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, promotion, creative_features, multi_advertiser, validate_only, budget_amount, budget_type, status, campaign_status, budget_level, currency, headline, long_headline, body, description, bodies, headlines, descriptions, 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, work_positions, work_employers, work_industries, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, negative_keywords, campaign_negative_keywords, additional_headlines, additional_descriptions, sitelinks, callouts, structured_snippets, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, portfolio_bid_strategy_id, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, smart_plus, user_os, user_device, is_skadnetwork_attribution, campaign_attribution, promoted_object].hash
|
|
2088
|
+
[account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, promotion, creative_features, multi_advertiser, validate_only, budget_amount, budget_type, status, campaign_status, budget_level, currency, headline, long_headline, body, description, bodies, headlines, descriptions, 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, work_positions, work_employers, work_industries, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, regional_regulated_categories, regional_regulation_identities, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, asset_group, keywords, negative_keywords, campaign_negative_keywords, additional_headlines, additional_descriptions, sitelinks, callouts, structured_snippets, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, portfolio_bid_strategy_id, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, smart_plus, user_os, user_device, is_skadnetwork_attribution, campaign_attribution, promoted_object].hash
|
|
2080
2089
|
end
|
|
2081
2090
|
|
|
2082
2091
|
# Builds the object from hash
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class GooglePmaxAssetGroup < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :resource_name
|
|
21
|
+
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# Asset-group status on Google. Campaign status independently controls delivery.
|
|
25
|
+
attr_accessor :status
|
|
26
|
+
|
|
27
|
+
attr_accessor :final_urls
|
|
28
|
+
|
|
29
|
+
attr_accessor :assets
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'id' => :'id',
|
|
35
|
+
:'resource_name' => :'resourceName',
|
|
36
|
+
:'name' => :'name',
|
|
37
|
+
:'status' => :'status',
|
|
38
|
+
:'final_urls' => :'finalUrls',
|
|
39
|
+
:'assets' => :'assets'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Returns attribute mapping this model knows about
|
|
44
|
+
def self.acceptable_attribute_map
|
|
45
|
+
attribute_map
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
acceptable_attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'id' => :'String',
|
|
57
|
+
:'resource_name' => :'String',
|
|
58
|
+
:'name' => :'String',
|
|
59
|
+
:'status' => :'String',
|
|
60
|
+
:'final_urls' => :'Array<String>',
|
|
61
|
+
:'assets' => :'Array<GooglePmaxAssetGroupAssetsInner>'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GooglePmaxAssetGroup` initialize method"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GooglePmaxAssetGroup`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'id')
|
|
88
|
+
self.id = attributes[:'id']
|
|
89
|
+
else
|
|
90
|
+
self.id = nil
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'resource_name')
|
|
94
|
+
self.resource_name = attributes[:'resource_name']
|
|
95
|
+
else
|
|
96
|
+
self.resource_name = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'name')
|
|
100
|
+
self.name = attributes[:'name']
|
|
101
|
+
else
|
|
102
|
+
self.name = nil
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'status')
|
|
106
|
+
self.status = attributes[:'status']
|
|
107
|
+
else
|
|
108
|
+
self.status = nil
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'final_urls')
|
|
112
|
+
if (value = attributes[:'final_urls']).is_a?(Array)
|
|
113
|
+
self.final_urls = value
|
|
114
|
+
end
|
|
115
|
+
else
|
|
116
|
+
self.final_urls = nil
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'assets')
|
|
120
|
+
if (value = attributes[:'assets']).is_a?(Array)
|
|
121
|
+
self.assets = value
|
|
122
|
+
end
|
|
123
|
+
else
|
|
124
|
+
self.assets = nil
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
129
|
+
# @return Array for valid properties with the reasons
|
|
130
|
+
def list_invalid_properties
|
|
131
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
132
|
+
invalid_properties = Array.new
|
|
133
|
+
if @id.nil?
|
|
134
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if @resource_name.nil?
|
|
138
|
+
invalid_properties.push('invalid value for "resource_name", resource_name cannot be nil.')
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if @name.nil?
|
|
142
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if @status.nil?
|
|
146
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if @final_urls.nil?
|
|
150
|
+
invalid_properties.push('invalid value for "final_urls", final_urls cannot be nil.')
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if @assets.nil?
|
|
154
|
+
invalid_properties.push('invalid value for "assets", assets cannot be nil.')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
invalid_properties
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Check to see if the all the properties in the model are valid
|
|
161
|
+
# @return true if the model is valid
|
|
162
|
+
def valid?
|
|
163
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
164
|
+
return false if @id.nil?
|
|
165
|
+
return false if @resource_name.nil?
|
|
166
|
+
return false if @name.nil?
|
|
167
|
+
return false if @status.nil?
|
|
168
|
+
return false if @final_urls.nil?
|
|
169
|
+
return false if @assets.nil?
|
|
170
|
+
true
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Custom attribute writer method with validation
|
|
174
|
+
# @param [Object] id Value to be assigned
|
|
175
|
+
def id=(id)
|
|
176
|
+
if id.nil?
|
|
177
|
+
fail ArgumentError, 'id cannot be nil'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
@id = id
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Custom attribute writer method with validation
|
|
184
|
+
# @param [Object] resource_name Value to be assigned
|
|
185
|
+
def resource_name=(resource_name)
|
|
186
|
+
if resource_name.nil?
|
|
187
|
+
fail ArgumentError, 'resource_name cannot be nil'
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
@resource_name = resource_name
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Custom attribute writer method with validation
|
|
194
|
+
# @param [Object] name Value to be assigned
|
|
195
|
+
def name=(name)
|
|
196
|
+
if name.nil?
|
|
197
|
+
fail ArgumentError, 'name cannot be nil'
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
@name = name
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Custom attribute writer method with validation
|
|
204
|
+
# @param [Object] status Value to be assigned
|
|
205
|
+
def status=(status)
|
|
206
|
+
if status.nil?
|
|
207
|
+
fail ArgumentError, 'status cannot be nil'
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
@status = status
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Custom attribute writer method with validation
|
|
214
|
+
# @param [Object] final_urls Value to be assigned
|
|
215
|
+
def final_urls=(final_urls)
|
|
216
|
+
if final_urls.nil?
|
|
217
|
+
fail ArgumentError, 'final_urls cannot be nil'
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
@final_urls = final_urls
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Custom attribute writer method with validation
|
|
224
|
+
# @param [Object] assets Value to be assigned
|
|
225
|
+
def assets=(assets)
|
|
226
|
+
if assets.nil?
|
|
227
|
+
fail ArgumentError, 'assets cannot be nil'
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
@assets = assets
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Checks equality by comparing each attribute.
|
|
234
|
+
# @param [Object] Object to be compared
|
|
235
|
+
def ==(o)
|
|
236
|
+
return true if self.equal?(o)
|
|
237
|
+
self.class == o.class &&
|
|
238
|
+
id == o.id &&
|
|
239
|
+
resource_name == o.resource_name &&
|
|
240
|
+
name == o.name &&
|
|
241
|
+
status == o.status &&
|
|
242
|
+
final_urls == o.final_urls &&
|
|
243
|
+
assets == o.assets
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# @see the `==` method
|
|
247
|
+
# @param [Object] Object to be compared
|
|
248
|
+
def eql?(o)
|
|
249
|
+
self == o
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Calculates hash code according to all attributes.
|
|
253
|
+
# @return [Integer] Hash code
|
|
254
|
+
def hash
|
|
255
|
+
[id, resource_name, name, status, final_urls, assets].hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Builds the object from hash
|
|
259
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
260
|
+
# @return [Object] Returns the model itself
|
|
261
|
+
def self.build_from_hash(attributes)
|
|
262
|
+
return nil unless attributes.is_a?(Hash)
|
|
263
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
264
|
+
transformed_hash = {}
|
|
265
|
+
openapi_types.each_pair do |key, type|
|
|
266
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
267
|
+
transformed_hash["#{key}"] = nil
|
|
268
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
269
|
+
# check to ensure the input is an array given that the attribute
|
|
270
|
+
# is documented as an array but the input is not
|
|
271
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
272
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
273
|
+
end
|
|
274
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
275
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
276
|
+
end
|
|
277
|
+
end
|
|
278
|
+
new(transformed_hash)
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Returns the object in the form of hash
|
|
282
|
+
# @return [Hash] Returns the object in the form of hash
|
|
283
|
+
def to_hash
|
|
284
|
+
hash = {}
|
|
285
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
286
|
+
value = self.send(attr)
|
|
287
|
+
if value.nil?
|
|
288
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
289
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
hash[param] = _to_hash(value)
|
|
293
|
+
end
|
|
294
|
+
hash
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
end
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class GooglePmaxAssetGroupAssetsInner < ApiModelBase
|
|
18
|
+
attr_accessor :resource_name
|
|
19
|
+
|
|
20
|
+
# Google asset role, such as HEADLINE or LOGO.
|
|
21
|
+
attr_accessor :field_type
|
|
22
|
+
|
|
23
|
+
attr_accessor :status
|
|
24
|
+
|
|
25
|
+
attr_accessor :text
|
|
26
|
+
|
|
27
|
+
attr_accessor :image_url
|
|
28
|
+
|
|
29
|
+
attr_accessor :youtube_video_id
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'resource_name' => :'resourceName',
|
|
35
|
+
:'field_type' => :'fieldType',
|
|
36
|
+
:'status' => :'status',
|
|
37
|
+
:'text' => :'text',
|
|
38
|
+
:'image_url' => :'imageUrl',
|
|
39
|
+
:'youtube_video_id' => :'youtubeVideoId'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Returns attribute mapping this model knows about
|
|
44
|
+
def self.acceptable_attribute_map
|
|
45
|
+
attribute_map
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
acceptable_attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'resource_name' => :'String',
|
|
57
|
+
:'field_type' => :'String',
|
|
58
|
+
:'status' => :'String',
|
|
59
|
+
:'text' => :'String',
|
|
60
|
+
:'image_url' => :'String',
|
|
61
|
+
:'youtube_video_id' => :'String'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GooglePmaxAssetGroupAssetsInner` initialize method"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GooglePmaxAssetGroupAssetsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'resource_name')
|
|
88
|
+
self.resource_name = attributes[:'resource_name']
|
|
89
|
+
else
|
|
90
|
+
self.resource_name = nil
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'field_type')
|
|
94
|
+
self.field_type = attributes[:'field_type']
|
|
95
|
+
else
|
|
96
|
+
self.field_type = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'status')
|
|
100
|
+
self.status = attributes[:'status']
|
|
101
|
+
else
|
|
102
|
+
self.status = nil
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'text')
|
|
106
|
+
self.text = attributes[:'text']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'image_url')
|
|
110
|
+
self.image_url = attributes[:'image_url']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'youtube_video_id')
|
|
114
|
+
self.youtube_video_id = attributes[:'youtube_video_id']
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
119
|
+
# @return Array for valid properties with the reasons
|
|
120
|
+
def list_invalid_properties
|
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
122
|
+
invalid_properties = Array.new
|
|
123
|
+
if @resource_name.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "resource_name", resource_name cannot be nil.')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if @field_type.nil?
|
|
128
|
+
invalid_properties.push('invalid value for "field_type", field_type cannot be nil.')
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if @status.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
invalid_properties
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Check to see if the all the properties in the model are valid
|
|
139
|
+
# @return true if the model is valid
|
|
140
|
+
def valid?
|
|
141
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
142
|
+
return false if @resource_name.nil?
|
|
143
|
+
return false if @field_type.nil?
|
|
144
|
+
return false if @status.nil?
|
|
145
|
+
true
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Custom attribute writer method with validation
|
|
149
|
+
# @param [Object] resource_name Value to be assigned
|
|
150
|
+
def resource_name=(resource_name)
|
|
151
|
+
if resource_name.nil?
|
|
152
|
+
fail ArgumentError, 'resource_name cannot be nil'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
@resource_name = resource_name
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Custom attribute writer method with validation
|
|
159
|
+
# @param [Object] field_type Value to be assigned
|
|
160
|
+
def field_type=(field_type)
|
|
161
|
+
if field_type.nil?
|
|
162
|
+
fail ArgumentError, 'field_type cannot be nil'
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
@field_type = field_type
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Custom attribute writer method with validation
|
|
169
|
+
# @param [Object] status Value to be assigned
|
|
170
|
+
def status=(status)
|
|
171
|
+
if status.nil?
|
|
172
|
+
fail ArgumentError, 'status cannot be nil'
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
@status = status
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Checks equality by comparing each attribute.
|
|
179
|
+
# @param [Object] Object to be compared
|
|
180
|
+
def ==(o)
|
|
181
|
+
return true if self.equal?(o)
|
|
182
|
+
self.class == o.class &&
|
|
183
|
+
resource_name == o.resource_name &&
|
|
184
|
+
field_type == o.field_type &&
|
|
185
|
+
status == o.status &&
|
|
186
|
+
text == o.text &&
|
|
187
|
+
image_url == o.image_url &&
|
|
188
|
+
youtube_video_id == o.youtube_video_id
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# @see the `==` method
|
|
192
|
+
# @param [Object] Object to be compared
|
|
193
|
+
def eql?(o)
|
|
194
|
+
self == o
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Calculates hash code according to all attributes.
|
|
198
|
+
# @return [Integer] Hash code
|
|
199
|
+
def hash
|
|
200
|
+
[resource_name, field_type, status, text, image_url, youtube_video_id].hash
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Builds the object from hash
|
|
204
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
205
|
+
# @return [Object] Returns the model itself
|
|
206
|
+
def self.build_from_hash(attributes)
|
|
207
|
+
return nil unless attributes.is_a?(Hash)
|
|
208
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
209
|
+
transformed_hash = {}
|
|
210
|
+
openapi_types.each_pair do |key, type|
|
|
211
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
212
|
+
transformed_hash["#{key}"] = nil
|
|
213
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
214
|
+
# check to ensure the input is an array given that the attribute
|
|
215
|
+
# is documented as an array but the input is not
|
|
216
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
217
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
218
|
+
end
|
|
219
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
220
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
new(transformed_hash)
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Returns the object in the form of hash
|
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
|
228
|
+
def to_hash
|
|
229
|
+
hash = {}
|
|
230
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
231
|
+
value = self.send(attr)
|
|
232
|
+
if value.nil?
|
|
233
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
234
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
hash[param] = _to_hash(value)
|
|
238
|
+
end
|
|
239
|
+
hash
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
end
|