Class: PinterestSdkClient::AdsAnalyticsCreateAsyncRequest

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

Defined Under Namespace

Classes: EnumAttributeValidator

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

  if attributes.key?(:'click_window_days')
    self.click_window_days = attributes[:'click_window_days']
  else
    self.click_window_days = ConversionAttributionWindowDays::N30
  end

  if attributes.key?(:'conversion_report_time')
    self.conversion_report_time = attributes[:'conversion_report_time']
  else
    self.conversion_report_time = 'TIME_OF_AD_ACTION'
  end

  if attributes.key?(:'end_date')
    self.end_date = attributes[:'end_date']
  else
    self.end_date = nil
  end

  if attributes.key?(:'engagement_window_days')
    self.engagement_window_days = attributes[:'engagement_window_days']
  else
    self.engagement_window_days = ConversionAttributionWindowDays::N30
  end

  if attributes.key?(:'granularity')
    self.granularity = attributes[:'granularity']
  else
    self.granularity = nil
  end

  if attributes.key?(:'start_date')
    self.start_date = attributes[:'start_date']
  else
    self.start_date = nil
  end

  if attributes.key?(:'view_window_days')
    self.view_window_days = attributes[:'view_window_days']
  else
    self.view_window_days = ConversionAttributionWindowDays::N1
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'columns')
    if (value = attributes[:'columns']).is_a?(Array)
      self.columns = value
    end
  else
    self.columns = nil
  end

  if attributes.key?(:'combine_targeting_types')
    self.combine_targeting_types = attributes[:'combine_targeting_types']
  else
    self.combine_targeting_types = false
  end

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

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

  if attributes.key?(:'level')
    self.level = attributes[:'level']
  else
    self.level = nil
  end

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

  if attributes.key?(:'report_format')
    self.report_format = attributes[:'report_format']
  else
    self.report_format = 'JSON'
  end

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

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

Instance Attribute Details

#ad_group_idsObject

List of ad group ids



55
56
57
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 55

def ad_group_ids
  @ad_group_ids
end

#ad_group_statusesObject

List of values for filtering



58
59
60
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 58

def ad_group_statuses
  @ad_group_statuses
end

#ad_idsObject

List of ad ids [This parameter is no supported for Product Item Level Reports]



61
62
63
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 61

def ad_ids
  @ad_ids
end

#ad_statusesObject

List of values for filtering [This parameter is not supported for Product Item Level Reports]



64
65
66
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 64

def ad_statuses
  @ad_statuses
end

#attribution_typesObject

List of types of attribution for the conversion report



19
20
21
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 19

def attribution_types
  @attribution_types
end

#campaign_brand_labelObject

Campaign brand label for filtering.



52
53
54
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 52

def campaign_brand_label
  @campaign_brand_label
end

#campaign_idsObject

List of campaign ids



43
44
45
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 43

def campaign_ids
  @campaign_ids
end

#campaign_objective_typesObject

List of values for filtering. ["WEB_SESSIONS"] in BETA.



49
50
51
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 49

def campaign_objective_types
  @campaign_objective_types
end

#campaign_statusesObject

List of status values for filtering



46
47
48
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 46

def campaign_statuses
  @campaign_statuses
end

#click_window_daysObject

Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to 30 days.



22
23
24
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 22

def click_window_days
  @click_window_days
end

#columnsObject

Metric and entity columns. Pin promotion and ad related columns are not supported for the Product Item level reports.



82
83
84
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 82

def columns
  @columns
end

#combine_targeting_typesObject

Determines if the targeting types included in the request should be consolidated into a single breakdown. For example, when combine_targeting_types is set to true, if GENDER and COUNTRY are targeting types in the request, the response will have a targeting type of GENDER_AND_COUNTRY and targeting values such as female&US. This feature is currently in BETA and is not available to all users.



85
86
87
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 85

def combine_targeting_types
  @combine_targeting_types
end

#conversion_report_timeObject

The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.



25
26
27
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 25

def conversion_report_time
  @conversion_report_time
end

#custom_conversion_event_metricsObject

List of advertiser-defined custom conversion event metrics to include in the report



88
89
90
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 88

def custom_conversion_event_metrics
  @custom_conversion_event_metrics
end

#end_dateObject

Metric report end date (UTC). Format: YYYY-MM-DD



28
29
30
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 28

def end_date
  @end_date
end

#end_hourObject

Which hour of the end date to stop the report (inclusive). For example, with an end_date of ‘2020-01-01’ and end_hour of ‘15’, the report will contain metrics up to ‘2020-01-01 14:59:59’. The entire day will be included if no end hour is provided. Only allowed for hourly reports.



91
92
93
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 91

def end_hour
  @end_hour
end

#engagement_window_daysObject

Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to 30 days.



31
32
33
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 31

def engagement_window_days
  @engagement_window_days
end

#granularityObject

TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly



34
35
36
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 34

def granularity
  @granularity
end

#levelObject

Level of the report



94
95
96
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 94

def level
  @level
end

#metrics_filtersObject

List of metrics filters



79
80
81
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 79

def metrics_filters
  @metrics_filters
end

#primary_sortObject

Whether to first sort the report by date or by entity ID of the reporting entity level. Date will be used as the first level key for JSON reports that use BY_DATE. BY_DATE is recommended for large requests.



97
98
99
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 97

def primary_sort
  @primary_sort
end

#product_group_idsObject

List of product group ids



67
68
69
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 67

def product_group_ids
  @product_group_ids
end

#product_group_statusesObject

List of values for filtering



70
71
72
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 70

def product_group_statuses
  @product_group_statuses
end

#product_item_idsObject

List of product item ids



73
74
75
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 73

def product_item_ids
  @product_item_ids
end

#report_formatObject

Specification for formatting the report data. Reports in JSON will not zero-fill metrics, whereas reports in CSV will. Both report formats will omit rows where all the columns are equal to 0.



100
101
102
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 100

def report_format
  @report_format
end

#reporting_timezoneObject

Specify the timezone to be applied for the reporting. This feature is currently in BETA and is not available to all users.



103
104
105
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 103

def reporting_timezone
  @reporting_timezone
end

#start_dateObject

Metric report start date (UTC). Format: YYYY-MM-DD



37
38
39
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 37

def start_date
  @start_date
end

#start_hourObject

Which hour of the start date to begin the report. The entire day will be included if no start hour is provided. Only allowed for hourly reports.



106
107
108
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 106

def start_hour
  @start_hour
end

#targeting_typesObject

List of targeting types. Requires level to be a value ending in _TARGETING. ["AUDIENCE_MULTIPLIER"] is only available in CAMPAIGN_TARGETING level. ["MEDIA_TYPE"] is only available in PRODUCT_ITEM_TARGETING level. ["AGE_BUCKET_AND_GENDER"] is in BETA and not yet available to all users.



76
77
78
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 76

def targeting_types
  @targeting_types
end

#view_window_daysObject

Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to 1 day.



40
41
42
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 40

def view_window_days
  @view_window_days
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



167
168
169
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 167

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



172
173
174
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 172

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'attribution_types' => :'attribution_types',
    :'click_window_days' => :'click_window_days',
    :'conversion_report_time' => :'conversion_report_time',
    :'end_date' => :'end_date',
    :'engagement_window_days' => :'engagement_window_days',
    :'granularity' => :'granularity',
    :'start_date' => :'start_date',
    :'view_window_days' => :'view_window_days',
    :'campaign_ids' => :'campaign_ids',
    :'campaign_statuses' => :'campaign_statuses',
    :'campaign_objective_types' => :'campaign_objective_types',
    :'campaign_brand_label' => :'campaign_brand_label',
    :'ad_group_ids' => :'ad_group_ids',
    :'ad_group_statuses' => :'ad_group_statuses',
    :'ad_ids' => :'ad_ids',
    :'ad_statuses' => :'ad_statuses',
    :'product_group_ids' => :'product_group_ids',
    :'product_group_statuses' => :'product_group_statuses',
    :'product_item_ids' => :'product_item_ids',
    :'targeting_types' => :'targeting_types',
    :'metrics_filters' => :'metrics_filters',
    :'columns' => :'columns',
    :'combine_targeting_types' => :'combine_targeting_types',
    :'custom_conversion_event_metrics' => :'custom_conversion_event_metrics',
    :'end_hour' => :'end_hour',
    :'level' => :'level',
    :'primary_sort' => :'primary_sort',
    :'report_format' => :'report_format',
    :'reporting_timezone' => :'reporting_timezone',
    :'start_hour' => :'start_hour'
  }
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



948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 948

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



213
214
215
216
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 213

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

.openapi_typesObject

Attribute type mapping.



177
178
179
180
181
182
183
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
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 177

def self.openapi_types
  {
    :'attribution_types' => :'Array<ConversionReportAttributionType>',
    :'click_window_days' => :'ConversionAttributionWindowDays',
    :'conversion_report_time' => :'ConversionReportTimeType',
    :'end_date' => :'String',
    :'engagement_window_days' => :'ConversionAttributionWindowDays',
    :'granularity' => :'Granularity',
    :'start_date' => :'String',
    :'view_window_days' => :'ConversionAttributionWindowDays',
    :'campaign_ids' => :'Array<String>',
    :'campaign_statuses' => :'Array<CampaignSummaryStatus>',
    :'campaign_objective_types' => :'Array<ObjectiveType>',
    :'campaign_brand_label' => :'String',
    :'ad_group_ids' => :'Array<String>',
    :'ad_group_statuses' => :'Array<AdGroupSummaryStatus>',
    :'ad_ids' => :'Array<String>',
    :'ad_statuses' => :'Array<PinPromotionSummaryStatus>',
    :'product_group_ids' => :'Array<String>',
    :'product_group_statuses' => :'Array<ProductGroupSummaryStatus>',
    :'product_item_ids' => :'Array<String>',
    :'targeting_types' => :'Array<String>',
    :'metrics_filters' => :'Array<AdsAnalyticsMetricsFilter>',
    :'columns' => :'Array<ReportingColumnAsync>',
    :'combine_targeting_types' => :'Boolean',
    :'custom_conversion_event_metrics' => :'Array<AdsAnalyticsCreateAsyncRequestAllOfCustomConversionEventMetrics>',
    :'end_hour' => :'Integer',
    :'level' => :'MetricsReportingLevel',
    :'primary_sort' => :'String',
    :'report_format' => :'DataOutputFormat',
    :'reporting_timezone' => :'ReportingTimeZone',
    :'start_hour' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 898

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      attribution_types == o.attribution_types &&
      click_window_days == o.click_window_days &&
      conversion_report_time == o.conversion_report_time &&
      end_date == o.end_date &&
      engagement_window_days == o.engagement_window_days &&
      granularity == o.granularity &&
      start_date == o.start_date &&
      view_window_days == o.view_window_days &&
      campaign_ids == o.campaign_ids &&
      campaign_statuses == o.campaign_statuses &&
      campaign_objective_types == o.campaign_objective_types &&
      campaign_brand_label == o.campaign_brand_label &&
      ad_group_ids == o.ad_group_ids &&
      ad_group_statuses == o.ad_group_statuses &&
      ad_ids == o.ad_ids &&
      ad_statuses == o.ad_statuses &&
      product_group_ids == o.product_group_ids &&
      product_group_statuses == o.product_group_statuses &&
      product_item_ids == o.product_item_ids &&
      targeting_types == o.targeting_types &&
      metrics_filters == o.metrics_filters &&
      columns == o.columns &&
      combine_targeting_types == o.combine_targeting_types &&
      custom_conversion_event_metrics == o.custom_conversion_event_metrics &&
      end_hour == o.end_hour &&
      level == o.level &&
      primary_sort == o.primary_sort &&
      report_format == o.report_format &&
      reporting_timezone == o.reporting_timezone &&
      start_hour == o.start_hour
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


935
936
937
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 935

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



941
942
943
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 941

def hash
  [attribution_types, click_window_days, conversion_report_time, end_date, engagement_window_days, granularity, start_date, view_window_days, campaign_ids, campaign_statuses, campaign_objective_types, campaign_brand_label, ad_group_ids, ad_group_statuses, ad_ids, ad_statuses, product_group_ids, product_group_statuses, product_item_ids, targeting_types, metrics_filters, columns, combine_targeting_types, custom_conversion_event_metrics, end_hour, level, primary_sort, report_format, reporting_timezone, start_hour].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
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
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 409

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @end_date.nil?
    invalid_properties.push('invalid value for "end_date", end_date cannot be nil.')
  end

  pattern = Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/)
  if @end_date !~ pattern
    invalid_properties.push("invalid value for \"end_date\", must conform to the pattern #{pattern}.")
  end

  if @granularity.nil?
    invalid_properties.push('invalid value for "granularity", granularity cannot be nil.')
  end

  if @start_date.nil?
    invalid_properties.push('invalid value for "start_date", start_date cannot be nil.')
  end

  pattern = Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/)
  if @start_date !~ pattern
    invalid_properties.push("invalid value for \"start_date\", must conform to the pattern #{pattern}.")
  end

  if !@campaign_ids.nil? && @campaign_ids.length > 500
    invalid_properties.push('invalid value for "campaign_ids", number of items must be less than or equal to 500.')
  end

  if !@campaign_ids.nil? && @campaign_ids.length < 1
    invalid_properties.push('invalid value for "campaign_ids", number of items must be greater than or equal to 1.')
  end

  if !@campaign_statuses.nil? && @campaign_statuses.length > 6
    invalid_properties.push('invalid value for "campaign_statuses", number of items must be less than or equal to 6.')
  end

  if !@campaign_statuses.nil? && @campaign_statuses.length < 1
    invalid_properties.push('invalid value for "campaign_statuses", number of items must be greater than or equal to 1.')
  end

  if !@campaign_objective_types.nil? && @campaign_objective_types.length > 7
    invalid_properties.push('invalid value for "campaign_objective_types", number of items must be less than or equal to 7.')
  end

  if !@campaign_objective_types.nil? && @campaign_objective_types.length < 1
    invalid_properties.push('invalid value for "campaign_objective_types", number of items must be greater than or equal to 1.')
  end

  if !@ad_group_ids.nil? && @ad_group_ids.length > 500
    invalid_properties.push('invalid value for "ad_group_ids", number of items must be less than or equal to 500.')
  end

  if !@ad_group_ids.nil? && @ad_group_ids.length < 1
    invalid_properties.push('invalid value for "ad_group_ids", number of items must be greater than or equal to 1.')
  end

  if !@ad_group_statuses.nil? && @ad_group_statuses.length > 6
    invalid_properties.push('invalid value for "ad_group_statuses", number of items must be less than or equal to 6.')
  end

  if !@ad_group_statuses.nil? && @ad_group_statuses.length < 1
    invalid_properties.push('invalid value for "ad_group_statuses", number of items must be greater than or equal to 1.')
  end

  if !@ad_ids.nil? && @ad_ids.length > 500
    invalid_properties.push('invalid value for "ad_ids", number of items must be less than or equal to 500.')
  end

  if !@ad_ids.nil? && @ad_ids.length < 1
    invalid_properties.push('invalid value for "ad_ids", number of items must be greater than or equal to 1.')
  end

  if !@ad_statuses.nil? && @ad_statuses.length > 6
    invalid_properties.push('invalid value for "ad_statuses", number of items must be less than or equal to 6.')
  end

  if !@ad_statuses.nil? && @ad_statuses.length < 1
    invalid_properties.push('invalid value for "ad_statuses", number of items must be greater than or equal to 1.')
  end

  if !@product_group_ids.nil? && @product_group_ids.length > 500
    invalid_properties.push('invalid value for "product_group_ids", number of items must be less than or equal to 500.')
  end

  if !@product_group_ids.nil? && @product_group_ids.length < 1
    invalid_properties.push('invalid value for "product_group_ids", number of items must be greater than or equal to 1.')
  end

  if !@product_group_statuses.nil? && @product_group_statuses.length > 6
    invalid_properties.push('invalid value for "product_group_statuses", number of items must be less than or equal to 6.')
  end

  if !@product_group_statuses.nil? && @product_group_statuses.length < 1
    invalid_properties.push('invalid value for "product_group_statuses", number of items must be greater than or equal to 1.')
  end

  if !@product_item_ids.nil? && @product_item_ids.length > 500
    invalid_properties.push('invalid value for "product_item_ids", number of items must be less than or equal to 500.')
  end

  if !@product_item_ids.nil? && @product_item_ids.length < 1
    invalid_properties.push('invalid value for "product_item_ids", number of items must be greater than or equal to 1.')
  end

  if !@targeting_types.nil? && @targeting_types.length > 5
    invalid_properties.push('invalid value for "targeting_types", number of items must be less than or equal to 5.')
  end

  if !@targeting_types.nil? && @targeting_types.length < 1
    invalid_properties.push('invalid value for "targeting_types", number of items must be greater than or equal to 1.')
  end

  if !@metrics_filters.nil? && @metrics_filters.length < 1
    invalid_properties.push('invalid value for "metrics_filters", number of items must be greater than or equal to 1.')
  end

  if @columns.nil?
    invalid_properties.push('invalid value for "columns", columns cannot be nil.')
  end

  if !@end_hour.nil? && @end_hour > 23
    invalid_properties.push('invalid value for "end_hour", must be smaller than or equal to 23.')
  end

  if !@end_hour.nil? && @end_hour < 0
    invalid_properties.push('invalid value for "end_hour", must be greater than or equal to 0.')
  end

  if @level.nil?
    invalid_properties.push('invalid value for "level", level cannot be nil.')
  end

  if !@start_hour.nil? && @start_hour > 23
    invalid_properties.push('invalid value for "start_hour", must be smaller than or equal to 23.')
  end

  if !@start_hour.nil? && @start_hour < 0
    invalid_properties.push('invalid value for "start_hour", must be greater than or equal to 0.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



970
971
972
973
974
975
976
977
978
979
980
981
982
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 970

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



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 555

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @end_date.nil?
  return false if @end_date !~ Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/)
  return false if @granularity.nil?
  return false if @start_date.nil?
  return false if @start_date !~ Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/)
  return false if !@campaign_ids.nil? && @campaign_ids.length > 500
  return false if !@campaign_ids.nil? && @campaign_ids.length < 1
  return false if !@campaign_statuses.nil? && @campaign_statuses.length > 6
  return false if !@campaign_statuses.nil? && @campaign_statuses.length < 1
  return false if !@campaign_objective_types.nil? && @campaign_objective_types.length > 7
  return false if !@campaign_objective_types.nil? && @campaign_objective_types.length < 1
  return false if !@ad_group_ids.nil? && @ad_group_ids.length > 500
  return false if !@ad_group_ids.nil? && @ad_group_ids.length < 1
  return false if !@ad_group_statuses.nil? && @ad_group_statuses.length > 6
  return false if !@ad_group_statuses.nil? && @ad_group_statuses.length < 1
  return false if !@ad_ids.nil? && @ad_ids.length > 500
  return false if !@ad_ids.nil? && @ad_ids.length < 1
  return false if !@ad_statuses.nil? && @ad_statuses.length > 6
  return false if !@ad_statuses.nil? && @ad_statuses.length < 1
  return false if !@product_group_ids.nil? && @product_group_ids.length > 500
  return false if !@product_group_ids.nil? && @product_group_ids.length < 1
  return false if !@product_group_statuses.nil? && @product_group_statuses.length > 6
  return false if !@product_group_statuses.nil? && @product_group_statuses.length < 1
  return false if !@product_item_ids.nil? && @product_item_ids.length > 500
  return false if !@product_item_ids.nil? && @product_item_ids.length < 1
  return false if !@targeting_types.nil? && @targeting_types.length > 5
  return false if !@targeting_types.nil? && @targeting_types.length < 1
  return false if !@metrics_filters.nil? && @metrics_filters.length < 1
  return false if @columns.nil?
  return false if !@end_hour.nil? && @end_hour > 23
  return false if !@end_hour.nil? && @end_hour < 0
  return false if @level.nil?
  primary_sort_validator = EnumAttributeValidator.new('String', ["BY_ID", "BY_DATE"])
  return false unless primary_sort_validator.valid?(@primary_sort)
  return false if !@start_hour.nil? && @start_hour > 23
  return false if !@start_hour.nil? && @start_hour < 0
  true
end