Class: Zernio::CampaignAnalyticsResponseAnalyticsSummary

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ CampaignAnalyticsResponseAnalyticsSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 254

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CampaignAnalyticsResponseAnalyticsSummary` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CampaignAnalyticsResponseAnalyticsSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'spend')
    self.spend = attributes[:'spend']
  end

  if attributes.key?(:'impressions')
    self.impressions = attributes[:'impressions']
  end

  if attributes.key?(:'reach')
    self.reach = attributes[:'reach']
  end

  if attributes.key?(:'clicks')
    self.clicks = attributes[:'clicks']
  end

  if attributes.key?(:'ctr')
    self.ctr = attributes[:'ctr']
  end

  if attributes.key?(:'cpc')
    self.cpc = attributes[:'cpc']
  end

  if attributes.key?(:'cpm')
    self.cpm = attributes[:'cpm']
  end

  if attributes.key?(:'engagement')
    self.engagement = attributes[:'engagement']
  end

  if attributes.key?(:'conversions')
    self.conversions = attributes[:'conversions']
  end

  if attributes.key?(:'all_conversions')
    self.all_conversions = attributes[:'all_conversions']
  end

  if attributes.key?(:'cost_per_conversion')
    self.cost_per_conversion = attributes[:'cost_per_conversion']
  end

  if attributes.key?(:'actions')
    if (value = attributes[:'actions']).is_a?(Hash)
      self.actions = value
    end
  end

  if attributes.key?(:'action_values')
    if (value = attributes[:'action_values']).is_a?(Hash)
      self.action_values = value
    end
  end

  if attributes.key?(:'purchase_value')
    self.purchase_value = attributes[:'purchase_value']
  end

  if attributes.key?(:'roas')
    self.roas = attributes[:'roas']
  end

  if attributes.key?(:'cost_per_action')
    if (value = attributes[:'cost_per_action']).is_a?(Hash)
      self.cost_per_action = value
    end
  end

  if attributes.key?(:'outbound_clicks')
    self.outbound_clicks = attributes[:'outbound_clicks']
  end

  if attributes.key?(:'outbound_clicks_ctr')
    self.outbound_clicks_ctr = attributes[:'outbound_clicks_ctr']
  end

  if attributes.key?(:'inline_link_clicks')
    self.inline_link_clicks = attributes[:'inline_link_clicks']
  end

  if attributes.key?(:'inline_link_click_ctr')
    self.inline_link_click_ctr = attributes[:'inline_link_click_ctr']
  end

  if attributes.key?(:'unique_clicks')
    self.unique_clicks = attributes[:'unique_clicks']
  end

  if attributes.key?(:'unique_ctr')
    self.unique_ctr = attributes[:'unique_ctr']
  end

  if attributes.key?(:'video_play_actions')
    self.video_play_actions = attributes[:'video_play_actions']
  end

  if attributes.key?(:'video30_sec_watched_actions')
    self.video30_sec_watched_actions = attributes[:'video30_sec_watched_actions']
  end

  if attributes.key?(:'video_thruplay_watched_actions')
    self.video_thruplay_watched_actions = attributes[:'video_thruplay_watched_actions']
  end

  if attributes.key?(:'video_p25_watched_actions')
    self.video_p25_watched_actions = attributes[:'video_p25_watched_actions']
  end

  if attributes.key?(:'video_p50_watched_actions')
    self.video_p50_watched_actions = attributes[:'video_p50_watched_actions']
  end

  if attributes.key?(:'video_p75_watched_actions')
    self.video_p75_watched_actions = attributes[:'video_p75_watched_actions']
  end

  if attributes.key?(:'video_p95_watched_actions')
    self.video_p95_watched_actions = attributes[:'video_p95_watched_actions']
  end

  if attributes.key?(:'video_p100_watched_actions')
    self.video_p100_watched_actions = attributes[:'video_p100_watched_actions']
  end

  if attributes.key?(:'video_avg_time_watched_actions')
    self.video_avg_time_watched_actions = attributes[:'video_avg_time_watched_actions']
  end

  if attributes.key?(:'cost_per_thruplay')
    self.cost_per_thruplay = attributes[:'cost_per_thruplay']
  end

  if attributes.key?(:'funnel')
    self.funnel = attributes[:'funnel']
  end

  if attributes.key?(:'engagement_breakdown')
    self.engagement_breakdown = attributes[:'engagement_breakdown']
  end

  if attributes.key?(:'last_synced_at')
    self.last_synced_at = attributes[:'last_synced_at']
  end

  if attributes.key?(:'search_impression_share')
    self.search_impression_share = attributes[:'search_impression_share']
  end

  if attributes.key?(:'search_budget_lost_impression_share')
    self.search_budget_lost_impression_share = attributes[:'search_budget_lost_impression_share']
  end

  if attributes.key?(:'search_rank_lost_impression_share')
    self.search_rank_lost_impression_share = attributes[:'search_rank_lost_impression_share']
  end

  if attributes.key?(:'search_top_impression_share')
    self.search_top_impression_share = attributes[:'search_top_impression_share']
  end

  if attributes.key?(:'search_absolute_top_impression_share')
    self.search_absolute_top_impression_share = attributes[:'search_absolute_top_impression_share']
  end
end

Instance Attribute Details

#action_valuesObject

Monetary mirror of actions, from Meta's Insights action_values[] array. Same keying: values are the revenue attributed to each action_type, in ad-account native currency (same unit as spend; see the campaign node's currency field). Use this to compute revenue-per-event (e.g. avg purchase value). Meta-only; other platforms return {}.



51
52
53
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 51

def action_values
  @action_values
end

#actionsObject

Per-action-type counts summed over the date range, keyed by the platform's action-type names. Meta: raw Insights action_type keys (link_click, offsite_conversion.fb_pixel_purchase, onsite_conversion.lead_grouped, ...), covering both engagement and conversion events. TikTok: pixel conversions (purchase, add_to_cart, initiate_checkout, view_content, complete_payment, lead) plus the paid-engagement family (follow, post_reaction for paid likes, comment, share). Follow is how FOLLOWERS-goal campaigns report their result. X: conversion types (purchase, sign_up, site_visit, download, custom). LinkedIn: conversion types (post_click, post_view, lead_gen). Google returns {} (its per-action names aren't synced per ad). Empty object when no actions are reported. NOTE: keys differ by platform, so branch on the ad's platform when interpreting them.



48
49
50
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 48

def actions
  @actions
end

#all_conversionsObject

All conversions, including actions excluded from the Conversions column (Google metrics.all_conversions). 0 on platforms without the concept.



42
43
44
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 42

def all_conversions
  @all_conversions
end

#clicksObject

Returns the value of attribute clicks.



25
26
27
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 25

def clicks
  @clicks
end

#conversionsObject

Count of conversion events over the requested date range. FRACTIONAL: attribution splits one conversion across touchpoints and Google additionally reports modeled conversions, so values like 0.347 are normal. Meta: events matching the campaign's promoted_object.custom_event_type (PURCHASE, LEAD, etc.). Google: the account's tracked conversions. X and LinkedIn: their reported website/lead conversions (added 2026-07). 0 for non-conversion campaigns or when no events have fired.



39
40
41
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 39

def conversions
  @conversions
end

#cost_per_actionObject

Derived spend / actions[type] for every action type with a non-zero count, in ad-account native currency. Same keys as actions. Rounded to 4 decimals because cheap actions cost well under a cent. Recomputed from summed spend + counts at every rollup level. Empty object when spend is 0 or no actions are reported.



60
61
62
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 60

def cost_per_action
  @cost_per_action
end

#cost_per_conversionObject

Derived spend / conversions in the same currency as spend. 0 when conversions is 0.



45
46
47
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 45

def cost_per_conversion
  @cost_per_conversion
end

#cost_per_thruplayObject

Derived spend / videoThruplayWatchedActions, in ad-account native currency. Rounded to 4 decimals rather than the usual 2 because a ThruPlay routinely costs well under a cent. 0 when the ad has no ThruPlays (ThruPlay is Meta-only).



108
109
110
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 108

def cost_per_thruplay
  @cost_per_thruplay
end

#cpcObject

Cost per click



31
32
33
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 31

def cpc
  @cpc
end

#cpmObject

Cost per 1000 impressions



34
35
36
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 34

def cpm
  @cpm
end

#ctrObject

Click-through rate (%)



28
29
30
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 28

def ctr
  @ctr
end

#engagementObject

Returns the value of attribute engagement.



36
37
38
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 36

def engagement
  @engagement
end

#engagement_breakdownObject

Returns the value of attribute engagement_breakdown.



112
113
114
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 112

def engagement_breakdown
  @engagement_breakdown
end

#funnelObject

Returns the value of attribute funnel.



110
111
112
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 110

def funnel
  @funnel
end

#impressionsObject

Returns the value of attribute impressions.



20
21
22
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 20

def impressions
  @impressions
end

Derived inlineLinkClicks / impressions * 100, recomputed from sums at every rollup level.



72
73
74
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 72

def inline_link_click_ctr
  @inline_link_click_ctr
end

In-session link clicks. Differs from the attributed link_click count in actions/engagementBreakdown.linkClicks, which uses the attribution window. Meta-only.



69
70
71
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 69

def inline_link_clicks
  @inline_link_clicks
end

#last_synced_atObject

Present on individual ads only, not on campaign aggregations



115
116
117
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 115

def last_synced_at
  @last_synced_at
end

#outbound_clicksObject

Clicks leading off Meta's surfaces to the advertiser's destination. Meta-only; other platforms report 0.



63
64
65
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 63

def outbound_clicks
  @outbound_clicks
end

#outbound_clicks_ctrObject

Derived outboundClicks / impressions * 100, recomputed from sums at every rollup level.



66
67
68
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 66

def outbound_clicks_ctr
  @outbound_clicks_ctr
end

#purchase_valueObject

Convenience sum of purchase-type action values, picked from actionValues via the same priority list as conversions so both fields describe the same events. In ad-account native currency. 0 when the campaign has no purchase event configured. Meta-only.



54
55
56
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 54

def purchase_value
  @purchase_value
end

#reachObject

Unique people reached in the requested date range. Meta (facebook/instagram) and TikTok: the platform's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient platform error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, reach is NOT additive on these platforms: neither daily values nor child nodes sum to the range total. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Frequency (impressions / reach) is only meaningful for Meta and TikTok.



23
24
25
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 23

def reach
  @reach
end

#roasObject

Return on ad spend, derived as purchaseValue / spend. 0 when spend is 0. Equivalent to Meta's purchase_roas under default attribution. At ad-set and campaign levels this is recomputed from summed purchaseValue + spend (NOT averaged across children) so it's mathematically correct at every rollup level.



57
58
59
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 57

def roas
  @roas
end

#search_absolute_top_impression_shareObject

Google only. Date-range ratio, not a percentage. Null when unavailable; Google's threshold sentinel values are preserved.



130
131
132
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 130

def search_absolute_top_impression_share
  @search_absolute_top_impression_share
end

#search_budget_lost_impression_shareObject

Google only. Date-range ratio, not a percentage. Null when unavailable; Google's threshold sentinel values are preserved.



121
122
123
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 121

def search_budget_lost_impression_share
  @search_budget_lost_impression_share
end

#search_impression_shareObject

Google only. Date-range ratio, not a percentage. Null when unavailable; Google's threshold sentinel values are preserved.



118
119
120
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 118

def search_impression_share
  @search_impression_share
end

#search_rank_lost_impression_shareObject

Google only. Date-range ratio, not a percentage. Null when unavailable; Google's threshold sentinel values are preserved.



124
125
126
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 124

def search_rank_lost_impression_share
  @search_rank_lost_impression_share
end

#search_top_impression_shareObject

Google only. Date-range ratio, not a percentage. Null when unavailable; Google's threshold sentinel values are preserved.



127
128
129
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 127

def search_top_impression_share
  @search_top_impression_share
end

#spendObject

Returns the value of attribute spend.



18
19
20
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 18

def spend
  @spend
end

#unique_clicksObject

People who clicked at least once. NOT additive: summed across days/children it overcounts people who clicked on multiple days or ads, so treat rollups as an upper bound (same caveat as reach). Meta-only.



75
76
77
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 75

def unique_clicks
  @unique_clicks
end

#unique_ctrObject

Derived uniqueClicks / impressions * 100 (NOT Meta's reach-based unique_ctr). Inherits the non-additivity caveat of uniqueClicks.



78
79
80
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 78

def unique_ctr
  @unique_ctr
end

#video30_sec_watched_actionsObject

Views of at least 30 seconds (or to the end, for shorter videos). Sources: Meta video_30_sec_watched_actions (Meta only).



84
85
86
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 84

def video30_sec_watched_actions
  @video30_sec_watched_actions
end

#video_avg_time_watched_actionsObject

Average seconds watched per play. Aggregated over date ranges and across children as a play-weighted average (total watch time / total plays), never a plain average of averages. Sources: Meta video_avg_time_watched_actions, TikTok average_video_play.



105
106
107
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 105

def video_avg_time_watched_actions
  @video_avg_time_watched_actions
end

#video_p100_watched_actionsObject

Views reaching 100% of the video's length. Sources: Meta video_p100_watched_actions, TikTok video_views_p100.



102
103
104
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 102

def video_p100_watched_actions
  @video_p100_watched_actions
end

#video_p25_watched_actionsObject

Views reaching 25% of the video's length. With the other percentile fields, powers hook/hold/drop-off analysis (e.g. hook rate = videoP25WatchedActions / videoPlayActions). Sources: Meta video_p25_watched_actions, TikTok video_views_p25.



90
91
92
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 90

def video_p25_watched_actions
  @video_p25_watched_actions
end

#video_p50_watched_actionsObject

Views reaching 50% of the video's length. Sources: Meta video_p50_watched_actions, TikTok video_views_p50.



93
94
95
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 93

def video_p50_watched_actions
  @video_p50_watched_actions
end

#video_p75_watched_actionsObject

Views reaching 75% of the video's length. Sources: Meta video_p75_watched_actions, TikTok video_views_p75.



96
97
98
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 96

def video_p75_watched_actions
  @video_p75_watched_actions
end

#video_p95_watched_actionsObject

Views reaching 95% of the video's length. Sources: Meta video_p95_watched_actions (Meta only).



99
100
101
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 99

def video_p95_watched_actions
  @video_p95_watched_actions
end

#video_play_actionsObject

Number of times the video started playing, summed over the date range and across children at ad-set/campaign level. 0 for non-video ads. Sources: Meta video_play_actions, TikTok video_play_actions.



81
82
83
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 81

def video_play_actions
  @video_play_actions
end

#video_thruplay_watched_actionsObject

ThruPlays (watched to completion, or at least 15 seconds). Sources: Meta video_thruplay_watched_actions (Meta only).



87
88
89
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 87

def video_thruplay_watched_actions
  @video_thruplay_watched_actions
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



179
180
181
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 179

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



184
185
186
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 184

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 133

def self.attribute_map
  {
    :'spend' => :'spend',
    :'impressions' => :'impressions',
    :'reach' => :'reach',
    :'clicks' => :'clicks',
    :'ctr' => :'ctr',
    :'cpc' => :'cpc',
    :'cpm' => :'cpm',
    :'engagement' => :'engagement',
    :'conversions' => :'conversions',
    :'all_conversions' => :'allConversions',
    :'cost_per_conversion' => :'costPerConversion',
    :'actions' => :'actions',
    :'action_values' => :'actionValues',
    :'purchase_value' => :'purchaseValue',
    :'roas' => :'roas',
    :'cost_per_action' => :'costPerAction',
    :'outbound_clicks' => :'outboundClicks',
    :'outbound_clicks_ctr' => :'outboundClicksCtr',
    :'inline_link_clicks' => :'inlineLinkClicks',
    :'inline_link_click_ctr' => :'inlineLinkClickCtr',
    :'unique_clicks' => :'uniqueClicks',
    :'unique_ctr' => :'uniqueCtr',
    :'video_play_actions' => :'videoPlayActions',
    :'video30_sec_watched_actions' => :'video30SecWatchedActions',
    :'video_thruplay_watched_actions' => :'videoThruplayWatchedActions',
    :'video_p25_watched_actions' => :'videoP25WatchedActions',
    :'video_p50_watched_actions' => :'videoP50WatchedActions',
    :'video_p75_watched_actions' => :'videoP75WatchedActions',
    :'video_p95_watched_actions' => :'videoP95WatchedActions',
    :'video_p100_watched_actions' => :'videoP100WatchedActions',
    :'video_avg_time_watched_actions' => :'videoAvgTimeWatchedActions',
    :'cost_per_thruplay' => :'costPerThruplay',
    :'funnel' => :'funnel',
    :'engagement_breakdown' => :'engagementBreakdown',
    :'last_synced_at' => :'lastSyncedAt',
    :'search_impression_share' => :'searchImpressionShare',
    :'search_budget_lost_impression_share' => :'searchBudgetLostImpressionShare',
    :'search_rank_lost_impression_share' => :'searchRankLostImpressionShare',
    :'search_top_impression_share' => :'searchTopImpressionShare',
    :'search_absolute_top_impression_share' => :'searchAbsoluteTopImpressionShare'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 512

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



246
247
248
249
250
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 246

def self.openapi_all_of
  [
  :'AdMetrics'
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



235
236
237
238
239
240
241
242
243
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 235

def self.openapi_nullable
  Set.new([
    :'search_impression_share',
    :'search_budget_lost_impression_share',
    :'search_rank_lost_impression_share',
    :'search_top_impression_share',
    :'search_absolute_top_impression_share'
  ])
end

.openapi_typesObject

Attribute type mapping.



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 189

def self.openapi_types
  {
    :'spend' => :'Float',
    :'impressions' => :'Integer',
    :'reach' => :'Integer',
    :'clicks' => :'Integer',
    :'ctr' => :'Float',
    :'cpc' => :'Float',
    :'cpm' => :'Float',
    :'engagement' => :'Integer',
    :'conversions' => :'Float',
    :'all_conversions' => :'Float',
    :'cost_per_conversion' => :'Float',
    :'actions' => :'Hash<String, Integer>',
    :'action_values' => :'Hash<String, Float>',
    :'purchase_value' => :'Float',
    :'roas' => :'Float',
    :'cost_per_action' => :'Hash<String, Float>',
    :'outbound_clicks' => :'Integer',
    :'outbound_clicks_ctr' => :'Float',
    :'inline_link_clicks' => :'Integer',
    :'inline_link_click_ctr' => :'Float',
    :'unique_clicks' => :'Integer',
    :'unique_ctr' => :'Float',
    :'video_play_actions' => :'Integer',
    :'video30_sec_watched_actions' => :'Integer',
    :'video_thruplay_watched_actions' => :'Integer',
    :'video_p25_watched_actions' => :'Integer',
    :'video_p50_watched_actions' => :'Integer',
    :'video_p75_watched_actions' => :'Integer',
    :'video_p95_watched_actions' => :'Integer',
    :'video_p100_watched_actions' => :'Integer',
    :'video_avg_time_watched_actions' => :'Float',
    :'cost_per_thruplay' => :'Float',
    :'funnel' => :'AdFunnelCounts',
    :'engagement_breakdown' => :'AdEngagementCounts',
    :'last_synced_at' => :'Time',
    :'search_impression_share' => :'Float',
    :'search_budget_lost_impression_share' => :'Float',
    :'search_rank_lost_impression_share' => :'Float',
    :'search_top_impression_share' => :'Float',
    :'search_absolute_top_impression_share' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 452

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      spend == o.spend &&
      impressions == o.impressions &&
      reach == o.reach &&
      clicks == o.clicks &&
      ctr == o.ctr &&
      cpc == o.cpc &&
      cpm == o.cpm &&
      engagement == o.engagement &&
      conversions == o.conversions &&
      all_conversions == o.all_conversions &&
      cost_per_conversion == o.cost_per_conversion &&
      actions == o.actions &&
      action_values == o.action_values &&
      purchase_value == o.purchase_value &&
      roas == o.roas &&
      cost_per_action == o.cost_per_action &&
      outbound_clicks == o.outbound_clicks &&
      outbound_clicks_ctr == o.outbound_clicks_ctr &&
      inline_link_clicks == o.inline_link_clicks &&
      inline_link_click_ctr == o.inline_link_click_ctr &&
      unique_clicks == o.unique_clicks &&
      unique_ctr == o.unique_ctr &&
      video_play_actions == o.video_play_actions &&
      video30_sec_watched_actions == o.video30_sec_watched_actions &&
      video_thruplay_watched_actions == o.video_thruplay_watched_actions &&
      video_p25_watched_actions == o.video_p25_watched_actions &&
      video_p50_watched_actions == o.video_p50_watched_actions &&
      video_p75_watched_actions == o.video_p75_watched_actions &&
      video_p95_watched_actions == o.video_p95_watched_actions &&
      video_p100_watched_actions == o.video_p100_watched_actions &&
      video_avg_time_watched_actions == o.video_avg_time_watched_actions &&
      cost_per_thruplay == o.cost_per_thruplay &&
      funnel == o.funnel &&
      engagement_breakdown == o.engagement_breakdown &&
      last_synced_at == o.last_synced_at &&
      search_impression_share == o.search_impression_share &&
      search_budget_lost_impression_share == o.search_budget_lost_impression_share &&
      search_rank_lost_impression_share == o.search_rank_lost_impression_share &&
      search_top_impression_share == o.search_top_impression_share &&
      search_absolute_top_impression_share == o.search_absolute_top_impression_share
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


499
500
501
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 499

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



505
506
507
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 505

def hash
  [spend, impressions, reach, clicks, ctr, cpc, cpm, engagement, conversions, all_conversions, cost_per_conversion, actions, action_values, purchase_value, roas, cost_per_action, outbound_clicks, outbound_clicks_ctr, inline_link_clicks, inline_link_click_ctr, unique_clicks, unique_ctr, video_play_actions, video30_sec_watched_actions, video_thruplay_watched_actions, video_p25_watched_actions, video_p50_watched_actions, video_p75_watched_actions, video_p95_watched_actions, video_p100_watched_actions, video_avg_time_watched_actions, cost_per_thruplay, funnel, engagement_breakdown, last_synced_at, search_impression_share, search_budget_lost_impression_share, search_rank_lost_impression_share, search_top_impression_share, search_absolute_top_impression_share].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



437
438
439
440
441
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 437

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 534

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



445
446
447
448
# File 'lib/zernio-sdk/models/campaign_analytics_response_analytics_summary.rb', line 445

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end