late-sdk 0.0.596 → 0.0.598
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 +9 -0
- data/docs/AdInsightsApi.md +155 -9
- data/docs/CreatePostRequestPlatformsInnerPlatformSpecificData.md +2 -0
- data/docs/GenerateKeywordHistoricalMetrics200Response.md +22 -0
- data/docs/GenerateKeywordHistoricalMetricsRequest.md +32 -0
- data/docs/GenerateKeywordIdeas200Response.md +24 -0
- data/docs/GenerateKeywordIdeas200ResponsePaging.md +18 -0
- data/docs/GenerateKeywordIdeasRequest.md +36 -0
- data/docs/GetAdsActivityLog200Response.md +1 -1
- data/docs/GetAdsActivityLog200ResponsePaging.md +18 -0
- data/docs/ListAdCreatives200Response.md +1 -1
- data/docs/ListAdImages200Response.md +1 -1
- data/docs/ListAdLabels200Response.md +1 -1
- data/docs/ListAdStudies200Response.md +1 -1
- data/docs/ListHighDemandPeriods200Response.md +1 -1
- data/docs/ListMetaBusinesses200Response.md +1 -1
- data/docs/PlatformTargetPlatformSpecificData.md +2 -0
- data/docs/QueryAdInsights200Response.md +5 -1
- data/docs/QueryAdInsights200ResponsePaging.md +4 -2
- data/docs/SlackPlatformData.md +26 -0
- data/lib/zernio-sdk/api/accounts_api.rb +1 -1
- data/lib/zernio-sdk/api/ad_insights_api.rb +158 -13
- data/lib/zernio-sdk/api/connect_api.rb +1 -1
- data/lib/zernio-sdk/models/account_with_follower_stats.rb +2 -2
- data/lib/zernio-sdk/models/create_post_request_platforms_inner_platform_specific_data.rb +1 -0
- data/lib/zernio-sdk/models/generate_keyword_historical_metrics200_response.rb +169 -0
- data/lib/zernio-sdk/models/generate_keyword_historical_metrics_request.rb +337 -0
- data/lib/zernio-sdk/models/generate_keyword_ideas200_response.rb +178 -0
- data/lib/zernio-sdk/models/generate_keyword_ideas200_response_paging.rb +149 -0
- data/lib/zernio-sdk/models/generate_keyword_ideas_request.rb +378 -0
- data/lib/zernio-sdk/models/get_ads_activity_log200_response.rb +1 -1
- data/lib/zernio-sdk/models/get_ads_activity_log200_response_paging.rb +149 -0
- data/lib/zernio-sdk/models/list_ad_creatives200_response.rb +1 -1
- data/lib/zernio-sdk/models/list_ad_images200_response.rb +1 -1
- data/lib/zernio-sdk/models/list_ad_labels200_response.rb +1 -1
- data/lib/zernio-sdk/models/list_ad_studies200_response.rb +1 -1
- data/lib/zernio-sdk/models/list_high_demand_periods200_response.rb +1 -1
- data/lib/zernio-sdk/models/list_meta_businesses200_response.rb +1 -1
- data/lib/zernio-sdk/models/platform_target_platform_specific_data.rb +1 -0
- data/lib/zernio-sdk/models/query_ad_insights200_response.rb +23 -1
- data/lib/zernio-sdk/models/query_ad_insights200_response_paging.rb +17 -6
- data/lib/zernio-sdk/models/slack_platform_data.rb +189 -0
- data/lib/zernio-sdk/models/social_account.rb +2 -2
- data/lib/zernio-sdk/models/validate_post_request_platforms_inner.rb +2 -2
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +7 -0
- data/openapi.yaml +156 -22
- data/spec/api/ad_insights_api_spec.rb +30 -3
- data/spec/models/account_with_follower_stats_spec.rb +1 -1
- data/spec/models/generate_keyword_historical_metrics200_response_spec.rb +48 -0
- data/spec/models/generate_keyword_historical_metrics_request_spec.rb +82 -0
- data/spec/models/generate_keyword_ideas200_response_paging_spec.rb +36 -0
- data/spec/models/generate_keyword_ideas200_response_spec.rb +54 -0
- data/spec/models/generate_keyword_ideas_request_spec.rb +94 -0
- data/spec/models/get_ads_activity_log200_response_paging_spec.rb +36 -0
- data/spec/models/query_ad_insights200_response_paging_spec.rb +6 -0
- data/spec/models/query_ad_insights200_response_spec.rb +12 -0
- data/spec/models/slack_platform_data_spec.rb +60 -0
- data/spec/models/social_account_spec.rb +1 -1
- data/spec/models/validate_post_request_platforms_inner_spec.rb +1 -1
- data/zernio-sdk-0.0.598.gem +0 -0
- metadata +30 -2
- data/zernio-sdk-0.0.596.gem +0 -0
|
@@ -87,6 +87,142 @@ module Zernio
|
|
|
87
87
|
return data, status_code, headers
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
+
# Historical keyword metrics (Google Keyword Planner)
|
|
91
|
+
# Google Ads only. Runs Keyword Planner's generateKeywordHistoricalMetrics for up to 1,000 exact keywords: historical search volume, competition and top-of-page bid ranges, plus averageCpcMicros when includeAverageCpc is set. Rows come back verbatim; counters are int64s encoded as strings, bid/CPC values are micros of the account currency.
|
|
92
|
+
# @param generate_keyword_historical_metrics_request [GenerateKeywordHistoricalMetricsRequest]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [GenerateKeywordHistoricalMetrics200Response]
|
|
95
|
+
def generate_keyword_historical_metrics(generate_keyword_historical_metrics_request, opts = {})
|
|
96
|
+
data, _status_code, _headers = generate_keyword_historical_metrics_with_http_info(generate_keyword_historical_metrics_request, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Historical keyword metrics (Google Keyword Planner)
|
|
101
|
+
# Google Ads only. Runs Keyword Planner's generateKeywordHistoricalMetrics for up to 1,000 exact keywords: historical search volume, competition and top-of-page bid ranges, plus averageCpcMicros when includeAverageCpc is set. Rows come back verbatim; counters are int64s encoded as strings, bid/CPC values are micros of the account currency.
|
|
102
|
+
# @param generate_keyword_historical_metrics_request [GenerateKeywordHistoricalMetricsRequest]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(GenerateKeywordHistoricalMetrics200Response, Integer, Hash)>] GenerateKeywordHistoricalMetrics200Response data, response status code and response headers
|
|
105
|
+
def generate_keyword_historical_metrics_with_http_info(generate_keyword_historical_metrics_request, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: AdInsightsApi.generate_keyword_historical_metrics ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'generate_keyword_historical_metrics_request' is set
|
|
110
|
+
if @api_client.config.client_side_validation && generate_keyword_historical_metrics_request.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'generate_keyword_historical_metrics_request' when calling AdInsightsApi.generate_keyword_historical_metrics"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/ads/keywords/historical-metrics'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_keyword_historical_metrics_request)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type] || 'GenerateKeywordHistoricalMetrics200Response'
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"AdInsightsApi.generate_keyword_historical_metrics",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: AdInsightsApi#generate_keyword_historical_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Generate keyword ideas (Google Keyword Planner)
|
|
159
|
+
# Google Ads only. Runs Keyword Planner's generateKeywordIdeas from seed keywords, a seed URL, or both, returning idea rows verbatim (avgMonthlySearches, competition, competitionIndex, top-of-page bid micros, monthlySearchVolumes). Counters are int64s encoded as strings; bid values are micros of the account currency. Omitting `countries` targets worldwide.
|
|
160
|
+
# @param generate_keyword_ideas_request [GenerateKeywordIdeasRequest]
|
|
161
|
+
# @param [Hash] opts the optional parameters
|
|
162
|
+
# @return [GenerateKeywordIdeas200Response]
|
|
163
|
+
def generate_keyword_ideas(generate_keyword_ideas_request, opts = {})
|
|
164
|
+
data, _status_code, _headers = generate_keyword_ideas_with_http_info(generate_keyword_ideas_request, opts)
|
|
165
|
+
data
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Generate keyword ideas (Google Keyword Planner)
|
|
169
|
+
# Google Ads only. Runs Keyword Planner's generateKeywordIdeas from seed keywords, a seed URL, or both, returning idea rows verbatim (avgMonthlySearches, competition, competitionIndex, top-of-page bid micros, monthlySearchVolumes). Counters are int64s encoded as strings; bid values are micros of the account currency. Omitting `countries` targets worldwide.
|
|
170
|
+
# @param generate_keyword_ideas_request [GenerateKeywordIdeasRequest]
|
|
171
|
+
# @param [Hash] opts the optional parameters
|
|
172
|
+
# @return [Array<(GenerateKeywordIdeas200Response, Integer, Hash)>] GenerateKeywordIdeas200Response data, response status code and response headers
|
|
173
|
+
def generate_keyword_ideas_with_http_info(generate_keyword_ideas_request, opts = {})
|
|
174
|
+
if @api_client.config.debugging
|
|
175
|
+
@api_client.config.logger.debug 'Calling API: AdInsightsApi.generate_keyword_ideas ...'
|
|
176
|
+
end
|
|
177
|
+
# verify the required parameter 'generate_keyword_ideas_request' is set
|
|
178
|
+
if @api_client.config.client_side_validation && generate_keyword_ideas_request.nil?
|
|
179
|
+
fail ArgumentError, "Missing the required parameter 'generate_keyword_ideas_request' when calling AdInsightsApi.generate_keyword_ideas"
|
|
180
|
+
end
|
|
181
|
+
# resource path
|
|
182
|
+
local_var_path = '/v1/ads/keywords/ideas'
|
|
183
|
+
|
|
184
|
+
# query parameters
|
|
185
|
+
query_params = opts[:query_params] || {}
|
|
186
|
+
|
|
187
|
+
# header parameters
|
|
188
|
+
header_params = opts[:header_params] || {}
|
|
189
|
+
# HTTP header 'Accept' (if needed)
|
|
190
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
191
|
+
# HTTP header 'Content-Type'
|
|
192
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
193
|
+
if !content_type.nil?
|
|
194
|
+
header_params['Content-Type'] = content_type
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# form parameters
|
|
198
|
+
form_params = opts[:form_params] || {}
|
|
199
|
+
|
|
200
|
+
# http body (model)
|
|
201
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_keyword_ideas_request)
|
|
202
|
+
|
|
203
|
+
# return_type
|
|
204
|
+
return_type = opts[:debug_return_type] || 'GenerateKeywordIdeas200Response'
|
|
205
|
+
|
|
206
|
+
# auth_names
|
|
207
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
208
|
+
|
|
209
|
+
new_options = opts.merge(
|
|
210
|
+
:operation => :"AdInsightsApi.generate_keyword_ideas",
|
|
211
|
+
:header_params => header_params,
|
|
212
|
+
:query_params => query_params,
|
|
213
|
+
:form_params => form_params,
|
|
214
|
+
:body => post_body,
|
|
215
|
+
:auth_names => auth_names,
|
|
216
|
+
:return_type => return_type
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
220
|
+
if @api_client.config.debugging
|
|
221
|
+
@api_client.config.logger.debug "API called: AdInsightsApi#generate_keyword_ideas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
222
|
+
end
|
|
223
|
+
return data, status_code, headers
|
|
224
|
+
end
|
|
225
|
+
|
|
90
226
|
# Get ad analytics
|
|
91
227
|
# Returns detailed performance analytics for an ad. Includes summary metrics, a daily timeline over the requested date range, and optional demographic breakdowns (Meta and TikTok only). If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
|
|
92
228
|
# @param ad_id [String]
|
|
@@ -319,10 +455,13 @@ module Zernio
|
|
|
319
455
|
end
|
|
320
456
|
|
|
321
457
|
# Flexible live insights query
|
|
322
|
-
# Live, flexible insights query
|
|
323
|
-
# @param account_id [String] Zernio SocialAccount id (posting or ads variant)
|
|
324
|
-
# @param object_id [String] Meta insights node: act_<n>, campaign id, ad set id or ad id.
|
|
458
|
+
# Live, flexible insights query. The account's platform picks the contract: **Meta (facebook/instagram)**: forwards caller-chosen `fields`, `breakdowns` and `filtering` to any Meta insights node and returns Meta's rows verbatim. `objectId` (required) selects the node; `level` sets row granularity. Semantic validation is Meta's: an unknown field or invalid breakdown combination returns a 400 carrying Meta's message. For long ranges or agency-scale accounts prefer the async variant (POST /v1/ads/insights/reports). **Google Ads (googleads)**: raw GAQL passthrough. Send any read-only GAQL SELECT via `query` (campaign/keyword/search-term/geo/demographic/asset/shopping resources, `change_event`, any `segments.*`) and rows come back verbatim (camelCase, counters as strings). Results are paged at a fixed 10,000 rows; follow `paging.nextPageToken` with `pageToken`. `customerId` is only needed when the connection has several Google Ads accounts. Semantic validation is Google's: an invalid query returns a 400 carrying Google's message (note: selecting `segments.date` requires a finite date filter).
|
|
459
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant); its platform selects the Meta or Google contract.
|
|
325
460
|
# @param [Hash] opts the optional parameters
|
|
461
|
+
# @option opts [String] :object_id Meta only (required there): insights node — act_<n>, campaign id, ad set id or ad id.
|
|
462
|
+
# @option opts [String] :query Google only (required there): the GAQL SELECT statement to run.
|
|
463
|
+
# @option opts [String] :customer_id Google only: numeric customer id (no dashes) when the connection has several Google Ads accounts.
|
|
464
|
+
# @option opts [String] :page_token Google only: cursor from paging.nextPageToken of the previous page.
|
|
326
465
|
# @option opts [String] :level Row granularity
|
|
327
466
|
# @option opts [String] :fields Comma-separated Graph insights fields (e.g. spend,impressions,frequency,website_purchase_roas). Omitted = Meta's default set.
|
|
328
467
|
# @option opts [String] :breakdowns Comma-separated Graph breakdowns (e.g. age,gender or publisher_platform).
|
|
@@ -338,16 +477,19 @@ module Zernio
|
|
|
338
477
|
# @option opts [Integer] :limit Rows per page (default to 25)
|
|
339
478
|
# @option opts [String] :after Cursor from paging.after of the previous page.
|
|
340
479
|
# @return [QueryAdInsights200Response]
|
|
341
|
-
def query_ad_insights(account_id,
|
|
342
|
-
data, _status_code, _headers = query_ad_insights_with_http_info(account_id,
|
|
480
|
+
def query_ad_insights(account_id, opts = {})
|
|
481
|
+
data, _status_code, _headers = query_ad_insights_with_http_info(account_id, opts)
|
|
343
482
|
data
|
|
344
483
|
end
|
|
345
484
|
|
|
346
485
|
# Flexible live insights query
|
|
347
|
-
# Live, flexible insights query
|
|
348
|
-
# @param account_id [String] Zernio SocialAccount id (posting or ads variant)
|
|
349
|
-
# @param object_id [String] Meta insights node: act_<n>, campaign id, ad set id or ad id.
|
|
486
|
+
# Live, flexible insights query. The account's platform picks the contract: **Meta (facebook/instagram)**: forwards caller-chosen `fields`, `breakdowns` and `filtering` to any Meta insights node and returns Meta's rows verbatim. `objectId` (required) selects the node; `level` sets row granularity. Semantic validation is Meta's: an unknown field or invalid breakdown combination returns a 400 carrying Meta's message. For long ranges or agency-scale accounts prefer the async variant (POST /v1/ads/insights/reports). **Google Ads (googleads)**: raw GAQL passthrough. Send any read-only GAQL SELECT via `query` (campaign/keyword/search-term/geo/demographic/asset/shopping resources, `change_event`, any `segments.*`) and rows come back verbatim (camelCase, counters as strings). Results are paged at a fixed 10,000 rows; follow `paging.nextPageToken` with `pageToken`. `customerId` is only needed when the connection has several Google Ads accounts. Semantic validation is Google's: an invalid query returns a 400 carrying Google's message (note: selecting `segments.date` requires a finite date filter).
|
|
487
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant); its platform selects the Meta or Google contract.
|
|
350
488
|
# @param [Hash] opts the optional parameters
|
|
489
|
+
# @option opts [String] :object_id Meta only (required there): insights node — act_<n>, campaign id, ad set id or ad id.
|
|
490
|
+
# @option opts [String] :query Google only (required there): the GAQL SELECT statement to run.
|
|
491
|
+
# @option opts [String] :customer_id Google only: numeric customer id (no dashes) when the connection has several Google Ads accounts.
|
|
492
|
+
# @option opts [String] :page_token Google only: cursor from paging.nextPageToken of the previous page.
|
|
351
493
|
# @option opts [String] :level Row granularity
|
|
352
494
|
# @option opts [String] :fields Comma-separated Graph insights fields (e.g. spend,impressions,frequency,website_purchase_roas). Omitted = Meta's default set.
|
|
353
495
|
# @option opts [String] :breakdowns Comma-separated Graph breakdowns (e.g. age,gender or publisher_platform).
|
|
@@ -363,7 +505,7 @@ module Zernio
|
|
|
363
505
|
# @option opts [Integer] :limit Rows per page (default to 25)
|
|
364
506
|
# @option opts [String] :after Cursor from paging.after of the previous page.
|
|
365
507
|
# @return [Array<(QueryAdInsights200Response, Integer, Hash)>] QueryAdInsights200Response data, response status code and response headers
|
|
366
|
-
def query_ad_insights_with_http_info(account_id,
|
|
508
|
+
def query_ad_insights_with_http_info(account_id, opts = {})
|
|
367
509
|
if @api_client.config.debugging
|
|
368
510
|
@api_client.config.logger.debug 'Calling API: AdInsightsApi.query_ad_insights ...'
|
|
369
511
|
end
|
|
@@ -371,10 +513,10 @@ module Zernio
|
|
|
371
513
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
372
514
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling AdInsightsApi.query_ad_insights"
|
|
373
515
|
end
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
fail ArgumentError, "Missing the required parameter 'object_id' when calling AdInsightsApi.query_ad_insights"
|
|
516
|
+
if @api_client.config.client_side_validation && !opts[:'query'].nil? && opts[:'query'].to_s.length > 10000
|
|
517
|
+
fail ArgumentError, 'invalid value for "opts[:"query"]" when calling AdInsightsApi.query_ad_insights, the character length must be smaller than or equal to 10000.'
|
|
377
518
|
end
|
|
519
|
+
|
|
378
520
|
allowable_values = ["ad", "adset", "campaign", "account"]
|
|
379
521
|
if @api_client.config.client_side_validation && opts[:'level'] && !allowable_values.include?(opts[:'level'])
|
|
380
522
|
fail ArgumentError, "invalid value for \"level\", must be one of #{allowable_values}"
|
|
@@ -393,7 +535,10 @@ module Zernio
|
|
|
393
535
|
# query parameters
|
|
394
536
|
query_params = opts[:query_params] || {}
|
|
395
537
|
query_params[:'accountId'] = account_id
|
|
396
|
-
query_params[:'objectId'] = object_id
|
|
538
|
+
query_params[:'objectId'] = opts[:'object_id'] if !opts[:'object_id'].nil?
|
|
539
|
+
query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
|
|
540
|
+
query_params[:'customerId'] = opts[:'customer_id'] if !opts[:'customer_id'].nil?
|
|
541
|
+
query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil?
|
|
397
542
|
query_params[:'level'] = opts[:'level'] if !opts[:'level'].nil?
|
|
398
543
|
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
|
399
544
|
query_params[:'breakdowns'] = opts[:'breakdowns'] if !opts[:'breakdowns'].nil?
|
|
@@ -697,7 +697,7 @@ module Zernio
|
|
|
697
697
|
fail ArgumentError, "Missing the required parameter 'platform' when calling ConnectApi.get_connect_url"
|
|
698
698
|
end
|
|
699
699
|
# verify enum value
|
|
700
|
-
allowable_values = ["facebook", "instagram", "linkedin", "twitter", "tiktok", "youtube", "threads", "reddit", "pinterest", "bluesky", "googlebusiness", "telegram", "snapchat", "discord", "whatsapp"]
|
|
700
|
+
allowable_values = ["facebook", "instagram", "linkedin", "twitter", "tiktok", "youtube", "threads", "reddit", "pinterest", "bluesky", "googlebusiness", "telegram", "snapchat", "discord", "slack", "whatsapp"]
|
|
701
701
|
if @api_client.config.client_side_validation && !allowable_values.include?(platform)
|
|
702
702
|
fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
|
|
703
703
|
end
|
|
@@ -299,7 +299,7 @@ module Zernio
|
|
|
299
299
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
300
300
|
return false if @_id.nil?
|
|
301
301
|
return false if @platform.nil?
|
|
302
|
-
platform_validator = EnumAttributeValidator.new('String', ["tiktok", "instagram", "facebook", "youtube", "linkedin", "twitter", "threads", "pinterest", "reddit", "bluesky", "googlebusiness", "telegram", "snapchat", "discord", "whatsapp", "linkedinads", "metaads", "pinterestads", "tiktokads", "xads", "googleads", "openaiads"])
|
|
302
|
+
platform_validator = EnumAttributeValidator.new('String', ["tiktok", "instagram", "facebook", "youtube", "linkedin", "twitter", "threads", "pinterest", "reddit", "bluesky", "googlebusiness", "telegram", "snapchat", "discord", "slack", "whatsapp", "linkedinads", "metaads", "pinterestads", "tiktokads", "xads", "googleads", "openaiads"])
|
|
303
303
|
return false unless platform_validator.valid?(@platform)
|
|
304
304
|
return false if @profile_id.nil?
|
|
305
305
|
return false if @is_active.nil?
|
|
@@ -319,7 +319,7 @@ module Zernio
|
|
|
319
319
|
# Custom attribute writer method checking allowed values (enum).
|
|
320
320
|
# @param [Object] platform Object to be assigned
|
|
321
321
|
def platform=(platform)
|
|
322
|
-
validator = EnumAttributeValidator.new('String', ["tiktok", "instagram", "facebook", "youtube", "linkedin", "twitter", "threads", "pinterest", "reddit", "bluesky", "googlebusiness", "telegram", "snapchat", "discord", "whatsapp", "linkedinads", "metaads", "pinterestads", "tiktokads", "xads", "googleads", "openaiads"])
|
|
322
|
+
validator = EnumAttributeValidator.new('String', ["tiktok", "instagram", "facebook", "youtube", "linkedin", "twitter", "threads", "pinterest", "reddit", "bluesky", "googlebusiness", "telegram", "snapchat", "discord", "slack", "whatsapp", "linkedinads", "metaads", "pinterestads", "tiktokads", "xads", "googleads", "openaiads"])
|
|
323
323
|
unless validator.valid?(platform)
|
|
324
324
|
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
325
325
|
end
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
class GenerateKeywordHistoricalMetrics200Response < ApiModelBase
|
|
18
|
+
# The customer the request ran against.
|
|
19
|
+
attr_accessor :customer_id
|
|
20
|
+
|
|
21
|
+
attr_accessor :data
|
|
22
|
+
|
|
23
|
+
attr_accessor :aggregate_metric_results
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'customer_id' => :'customerId',
|
|
29
|
+
:'data' => :'data',
|
|
30
|
+
:'aggregate_metric_results' => :'aggregateMetricResults'
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns attribute mapping this model knows about
|
|
35
|
+
def self.acceptable_attribute_map
|
|
36
|
+
attribute_map
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns all the JSON keys this model knows about
|
|
40
|
+
def self.acceptable_attributes
|
|
41
|
+
acceptable_attribute_map.values
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Attribute type mapping.
|
|
45
|
+
def self.openapi_types
|
|
46
|
+
{
|
|
47
|
+
:'customer_id' => :'String',
|
|
48
|
+
:'data' => :'Array<Object>',
|
|
49
|
+
:'aggregate_metric_results' => :'Object'
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# List of attributes with nullable: true
|
|
54
|
+
def self.openapi_nullable
|
|
55
|
+
Set.new([
|
|
56
|
+
:'aggregate_metric_results'
|
|
57
|
+
])
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Initializes the object
|
|
61
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
62
|
+
def initialize(attributes = {})
|
|
63
|
+
if (!attributes.is_a?(Hash))
|
|
64
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GenerateKeywordHistoricalMetrics200Response` initialize method"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
68
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
70
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GenerateKeywordHistoricalMetrics200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
72
|
+
end
|
|
73
|
+
h[k.to_sym] = v
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'customer_id')
|
|
77
|
+
self.customer_id = attributes[:'customer_id']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'data')
|
|
81
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
82
|
+
self.data = value
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'aggregate_metric_results')
|
|
87
|
+
self.aggregate_metric_results = attributes[:'aggregate_metric_results']
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
92
|
+
# @return Array for valid properties with the reasons
|
|
93
|
+
def list_invalid_properties
|
|
94
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
95
|
+
invalid_properties = Array.new
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
true
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(o)
|
|
109
|
+
return true if self.equal?(o)
|
|
110
|
+
self.class == o.class &&
|
|
111
|
+
customer_id == o.customer_id &&
|
|
112
|
+
data == o.data &&
|
|
113
|
+
aggregate_metric_results == o.aggregate_metric_results
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# @see the `==` method
|
|
117
|
+
# @param [Object] Object to be compared
|
|
118
|
+
def eql?(o)
|
|
119
|
+
self == o
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Calculates hash code according to all attributes.
|
|
123
|
+
# @return [Integer] Hash code
|
|
124
|
+
def hash
|
|
125
|
+
[customer_id, data, aggregate_metric_results].hash
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Builds the object from hash
|
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
130
|
+
# @return [Object] Returns the model itself
|
|
131
|
+
def self.build_from_hash(attributes)
|
|
132
|
+
return nil unless attributes.is_a?(Hash)
|
|
133
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
134
|
+
transformed_hash = {}
|
|
135
|
+
openapi_types.each_pair do |key, type|
|
|
136
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
137
|
+
transformed_hash["#{key}"] = nil
|
|
138
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
139
|
+
# check to ensure the input is an array given that the attribute
|
|
140
|
+
# is documented as an array but the input is not
|
|
141
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
142
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
143
|
+
end
|
|
144
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
145
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
new(transformed_hash)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Returns the object in the form of hash
|
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
|
153
|
+
def to_hash
|
|
154
|
+
hash = {}
|
|
155
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
156
|
+
value = self.send(attr)
|
|
157
|
+
if value.nil?
|
|
158
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
159
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
hash[param] = _to_hash(value)
|
|
163
|
+
end
|
|
164
|
+
hash
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
end
|