Class: PinterestSdkClient::CampaignDeliveryEstimatesDerivedMetrics

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb

Overview

Derived metrics for an ad campaign.

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 = {}) ⇒ CampaignDeliveryEstimatesDerivedMetrics

Initializes the object

Parameters:

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

    Model attributes in the form of hash



184
185
186
187
188
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
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
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 184

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#cpcObject

Estimated cost per click.



20
21
22
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 20

def cpc
  @cpc
end

#cpc_lowerObject

Lower estimate of the cost per click.



23
24
25
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 23

def cpc_lower
  @cpc_lower
end

#cpc_upperObject

Upper estimate of the cost per click.



26
27
28
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 26

def cpc_upper
  @cpc_upper
end

#cpmObject

Estimated cost per thousand impressions.



29
30
31
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 29

def cpm
  @cpm
end

#cpm_lowerObject

Lower estimate of cost per thousand impressions.



32
33
34
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 32

def cpm_lower
  @cpm_lower
end

#cpm_upperObject

Upper estimate of cost per thousand impressions.



35
36
37
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 35

def cpm_upper
  @cpm_upper
end

#lifetime_frequencyObject

Estimated lifetime frequency.



38
39
40
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 38

def lifetime_frequency
  @lifetime_frequency
end

#lifetime_frequency_lowerObject

Lower estimate of lifetime frequency.



41
42
43
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 41

def lifetime_frequency_lower
  @lifetime_frequency_lower
end

#lifetime_frequency_upperObject

Upper estimate of lifetime frequency.



44
45
46
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 44

def lifetime_frequency_upper
  @lifetime_frequency_upper
end

#lifetime_impressionObject

Estimated lifetime impressions.



47
48
49
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 47

def lifetime_impression
  @lifetime_impression
end

#lifetime_impression_lowerObject

Lower estimate of lifetime impressions.



50
51
52
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 50

def lifetime_impression_lower
  @lifetime_impression_lower
end

#lifetime_impression_upperObject

Upper estimate of lifetime impressions.



53
54
55
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 53

def lifetime_impression_upper
  @lifetime_impression_upper
end

#lifetime_reachObject

Estimated lifetime reach.



56
57
58
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 56

def lifetime_reach
  @lifetime_reach
end

#lifetime_reach_lowerObject

Lower estimate of lifetime reach.



59
60
61
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 59

def lifetime_reach_lower
  @lifetime_reach_lower
end

#lifetime_reach_upperObject

Upper estimate of lifetime reach.



62
63
64
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 62

def lifetime_reach_upper
  @lifetime_reach_upper
end

#weekly_clickObject

Estimated weekly clicks.



65
66
67
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 65

def weekly_click
  @weekly_click
end

#weekly_click_lowerObject

Lower estimate of weekly clicks.



68
69
70
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 68

def weekly_click_lower
  @weekly_click_lower
end

#weekly_click_upperObject

Upper estimate of weekly clicks.



71
72
73
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 71

def weekly_click_upper
  @weekly_click_upper
end

#weekly_frequencyObject

Estimated weekly frequency.



74
75
76
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 74

def weekly_frequency
  @weekly_frequency
end

#weekly_frequency_lowerObject

Lower estimate of weekly frequency.



77
78
79
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 77

def weekly_frequency_lower
  @weekly_frequency_lower
end

#weekly_frequency_upperObject

Upper estimate of weekly frequency.



80
81
82
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 80

def weekly_frequency_upper
  @weekly_frequency_upper
end

#weekly_impressionObject

Estimated weekly impressions.



83
84
85
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 83

def weekly_impression
  @weekly_impression
end

#weekly_impression_lowerObject

Lower estimate of weekly impressions.



86
87
88
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 86

def weekly_impression_lower
  @weekly_impression_lower
end

#weekly_impression_upperObject

Upper estimate of weekly impressions.



89
90
91
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 89

def weekly_impression_upper
  @weekly_impression_upper
end

#weekly_reachObject

Estimated weekly reach.



92
93
94
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 92

def weekly_reach
  @weekly_reach
end

#weekly_reach_lowerObject

Lower estimate of weekly reach.



95
96
97
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 95

def weekly_reach_lower
  @weekly_reach_lower
end

#weekly_reach_upperObject

Upper estimate of weekly reach.



98
99
100
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 98

def weekly_reach_upper
  @weekly_reach_upper
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



134
135
136
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 134

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



139
140
141
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 139

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 101

def self.attribute_map
  {
    :'cpc' => :'cpc',
    :'cpc_lower' => :'cpc_lower',
    :'cpc_upper' => :'cpc_upper',
    :'cpm' => :'cpm',
    :'cpm_lower' => :'cpm_lower',
    :'cpm_upper' => :'cpm_upper',
    :'lifetime_frequency' => :'lifetime_frequency',
    :'lifetime_frequency_lower' => :'lifetime_frequency_lower',
    :'lifetime_frequency_upper' => :'lifetime_frequency_upper',
    :'lifetime_impression' => :'lifetime_impression',
    :'lifetime_impression_lower' => :'lifetime_impression_lower',
    :'lifetime_impression_upper' => :'lifetime_impression_upper',
    :'lifetime_reach' => :'lifetime_reach',
    :'lifetime_reach_lower' => :'lifetime_reach_lower',
    :'lifetime_reach_upper' => :'lifetime_reach_upper',
    :'weekly_click' => :'weekly_click',
    :'weekly_click_lower' => :'weekly_click_lower',
    :'weekly_click_upper' => :'weekly_click_upper',
    :'weekly_frequency' => :'weekly_frequency',
    :'weekly_frequency_lower' => :'weekly_frequency_lower',
    :'weekly_frequency_upper' => :'weekly_frequency_upper',
    :'weekly_impression' => :'weekly_impression',
    :'weekly_impression_lower' => :'weekly_impression_lower',
    :'weekly_impression_upper' => :'weekly_impression_upper',
    :'weekly_reach' => :'weekly_reach',
    :'weekly_reach_lower' => :'weekly_reach_lower',
    :'weekly_reach_upper' => :'weekly_reach_upper'
  }
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



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 371

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



177
178
179
180
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 177

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

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 144

def self.openapi_types
  {
    :'cpc' => :'Float',
    :'cpc_lower' => :'Float',
    :'cpc_upper' => :'Float',
    :'cpm' => :'Float',
    :'cpm_lower' => :'Float',
    :'cpm_upper' => :'Float',
    :'lifetime_frequency' => :'Float',
    :'lifetime_frequency_lower' => :'Float',
    :'lifetime_frequency_upper' => :'Float',
    :'lifetime_impression' => :'Float',
    :'lifetime_impression_lower' => :'Float',
    :'lifetime_impression_upper' => :'Float',
    :'lifetime_reach' => :'Float',
    :'lifetime_reach_lower' => :'Float',
    :'lifetime_reach_upper' => :'Float',
    :'weekly_click' => :'Float',
    :'weekly_click_lower' => :'Float',
    :'weekly_click_upper' => :'Float',
    :'weekly_frequency' => :'Float',
    :'weekly_frequency_lower' => :'Float',
    :'weekly_frequency_upper' => :'Float',
    :'weekly_impression' => :'Float',
    :'weekly_impression_lower' => :'Float',
    :'weekly_impression_upper' => :'Float',
    :'weekly_reach' => :'Float',
    :'weekly_reach_lower' => :'Float',
    :'weekly_reach_upper' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 324

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      cpc == o.cpc &&
      cpc_lower == o.cpc_lower &&
      cpc_upper == o.cpc_upper &&
      cpm == o.cpm &&
      cpm_lower == o.cpm_lower &&
      cpm_upper == o.cpm_upper &&
      lifetime_frequency == o.lifetime_frequency &&
      lifetime_frequency_lower == o.lifetime_frequency_lower &&
      lifetime_frequency_upper == o.lifetime_frequency_upper &&
      lifetime_impression == o.lifetime_impression &&
      lifetime_impression_lower == o.lifetime_impression_lower &&
      lifetime_impression_upper == o.lifetime_impression_upper &&
      lifetime_reach == o.lifetime_reach &&
      lifetime_reach_lower == o.lifetime_reach_lower &&
      lifetime_reach_upper == o.lifetime_reach_upper &&
      weekly_click == o.weekly_click &&
      weekly_click_lower == o.weekly_click_lower &&
      weekly_click_upper == o.weekly_click_upper &&
      weekly_frequency == o.weekly_frequency &&
      weekly_frequency_lower == o.weekly_frequency_lower &&
      weekly_frequency_upper == o.weekly_frequency_upper &&
      weekly_impression == o.weekly_impression &&
      weekly_impression_lower == o.weekly_impression_lower &&
      weekly_impression_upper == o.weekly_impression_upper &&
      weekly_reach == o.weekly_reach &&
      weekly_reach_lower == o.weekly_reach_lower &&
      weekly_reach_upper == o.weekly_reach_upper
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


358
359
360
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 358

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



364
365
366
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 364

def hash
  [cpc, cpc_lower, cpc_upper, cpm, cpm_lower, cpm_upper, lifetime_frequency, lifetime_frequency_lower, lifetime_frequency_upper, lifetime_impression, lifetime_impression_lower, lifetime_impression_upper, lifetime_reach, lifetime_reach_lower, lifetime_reach_upper, weekly_click, weekly_click_lower, weekly_click_upper, weekly_frequency, weekly_frequency_lower, weekly_frequency_upper, weekly_impression, weekly_impression_lower, weekly_impression_upper, weekly_reach, weekly_reach_lower, weekly_reach_upper].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



309
310
311
312
313
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 309

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



393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 393

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



317
318
319
320
# File 'lib/pinterest_sdk/models/campaign_delivery_estimates_derived_metrics.rb', line 317

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