Class: Zernio::GetAdsTimeline200ResponseRowsInner

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.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 = {}) ⇒ GetAdsTimeline200ResponseRowsInner

Initializes the object

Parameters:

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

    Model attributes in the form of hash



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 117

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdsTimeline200ResponseRowsInner` 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::GetAdsTimeline200ResponseRowsInner`. 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?(:'date')
    self.date = attributes[:'date']
  end

  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?(:'engagement')
    self.engagement = attributes[:'engagement']
  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?(:'conversions')
    self.conversions = attributes[:'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
end

Instance Attribute Details

#action_valuesObject

Monetary mirror of actions in native currency.



49
50
51
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 49

def action_values
  @action_values
end

#actionsObject

Per-action-type counts merged across all ads on this day. Keys are platform-native action types.



46
47
48
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 46

def actions
  @actions
end

#clicksObject

Returns the value of attribute clicks.



27
28
29
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 27

def clicks
  @clicks
end

#conversionsObject

Sum of conversion events over the range. Meta: events matching the campaign optimization goal. Google: tracked conversions. X / LinkedIn: reported website/lead conversions (added 2026-07).



41
42
43
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 41

def conversions
  @conversions
end

#cost_per_conversionObject

Returns the value of attribute cost_per_conversion.



43
44
45
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 43

def cost_per_conversion
  @cost_per_conversion
end

#cpcObject

Cost per click in native currency.



35
36
37
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 35

def cpc
  @cpc
end

#cpmObject

Cost per 1000 impressions in native currency.



38
39
40
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 38

def cpm
  @cpm
end

#ctrObject

Click-through rate as a percentage (0–100).



32
33
34
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 32

def ctr
  @ctr
end

#dateObject

Returns the value of attribute date.



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

def date
  @date
end

#engagementObject

Returns the value of attribute engagement.



29
30
31
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 29

def engagement
  @engagement
end

#impressionsObject

Returns the value of attribute impressions.



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

def impressions
  @impressions
end

#purchase_valueObject

Sum of purchase-type action values on this day, native currency.



52
53
54
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 52

def purchase_value
  @purchase_value
end

#reachObject

Returns the value of attribute reach.



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

def reach
  @reach
end

#roasObject

Derived purchaseValue / spend.



55
56
57
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 55

def roas
  @roas
end

#spendObject

Native currency units (matches /ads/tree convention).



21
22
23
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 21

def spend
  @spend
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



79
80
81
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 79

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



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

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 58

def self.attribute_map
  {
    :'date' => :'date',
    :'spend' => :'spend',
    :'impressions' => :'impressions',
    :'reach' => :'reach',
    :'clicks' => :'clicks',
    :'engagement' => :'engagement',
    :'ctr' => :'ctr',
    :'cpc' => :'cpc',
    :'cpm' => :'cpm',
    :'conversions' => :'conversions',
    :'cost_per_conversion' => :'costPerConversion',
    :'actions' => :'actions',
    :'action_values' => :'actionValues',
    :'purchase_value' => :'purchaseValue',
    :'roas' => :'roas'
  }
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



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 248

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_nullableObject

List of attributes with nullable: true



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

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 89

def self.openapi_types
  {
    :'date' => :'Date',
    :'spend' => :'Float',
    :'impressions' => :'Integer',
    :'reach' => :'Integer',
    :'clicks' => :'Integer',
    :'engagement' => :'Integer',
    :'ctr' => :'Float',
    :'cpc' => :'Float',
    :'cpm' => :'Float',
    :'conversions' => :'Integer',
    :'cost_per_conversion' => :'Float',
    :'actions' => :'Hash<String, Float>',
    :'action_values' => :'Hash<String, Float>',
    :'purchase_value' => :'Float',
    :'roas' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 213

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      date == o.date &&
      spend == o.spend &&
      impressions == o.impressions &&
      reach == o.reach &&
      clicks == o.clicks &&
      engagement == o.engagement &&
      ctr == o.ctr &&
      cpc == o.cpc &&
      cpm == o.cpm &&
      conversions == o.conversions &&
      cost_per_conversion == o.cost_per_conversion &&
      actions == o.actions &&
      action_values == o.action_values &&
      purchase_value == o.purchase_value &&
      roas == o.roas
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


235
236
237
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 235

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



241
242
243
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 241

def hash
  [date, spend, impressions, reach, clicks, engagement, ctr, cpc, cpm, conversions, cost_per_conversion, actions, action_values, purchase_value, roas].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



198
199
200
201
202
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 198

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



270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 270

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



206
207
208
209
# File 'lib/zernio-sdk/models/get_ads_timeline200_response_rows_inner.rb', line 206

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