Class: Zernio::CreateCallAdRequest

Inherits:
ApiModelBase show all
Defined in:
lib/zernio-sdk/models/create_call_ad_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 = {}) ⇒ CreateCallAdRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 310

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#account_id ⇒ Object

Facebook or Instagram SocialAccount ID.



24
25
26
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 24

def 
  @account_id
end

#ad_account_id ⇒ Object

Meta ad account ID, e.g. act_123456789.



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

def 
  @ad_account_id
end

#ad_set_id ⇒ Object

Attach the creatives to this EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase. It then owns budget, targeting and schedule, so budgetAmount, budgetType, endDate, objective, countries, interests, audienceId and campaignStatus are rejected with a 400 alongside it. Its destination_type must match the ad's destination.



70
71
72
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 70

def ad_set_id
  @ad_set_id
end

#ad_set_name ⇒ Object

Exact name for the ad set this request provisions. Omitted keeps <name> - Ad Set. Ignored with adSetId.



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

def ad_set_name
  @ad_set_name
end

#advantage_audience ⇒ Object

Meta's Advantage+ audience expansion. 0 (default) keeps targeting strict; 1 lets Meta expand beyond the supplied targeting when its delivery system finds better matches. Always sent on CREATE (Meta requires it).



117
118
119
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 117

def advantage_audience
  @advantage_audience
end

#age_max ⇒ Object

Returns the value of attribute age_max.



107
108
109
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 107

def age_max
  @age_max
end

#age_min ⇒ Object

Returns the value of attribute age_min.



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

def age_min
  @age_min
end

#audience_id ⇒ Object

Custom audience ID to target.



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

def audience_id
  @audience_id
end

#bid_amount ⇒ Object

Whole currency units (e.g. 5 = $5.00 on a USD account). Required when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP; rejected otherwise.



132
133
134
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 132

def bid_amount
  @bid_amount
end

#bid_strategy ⇒ Object

Meta bid strategy applied to the shared ad set. Defaults to LOWEST_COST_WITHOUT_CAP (auto-bid) when omitted. LOWEST_COST_WITH_BID_CAP and COST_CAP require bidAmount. LOWEST_COST_WITH_MIN_ROAS requires roasAverageFloor. CTWA's optimization_goal is fixed to CONVERSATIONS, but the bid strategy is independent.



129
130
131
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 129

def bid_strategy
  @bid_strategy
end

#body ⇒ Object

Primary text shown above the image / video. Single-creative shape only. Mutually exclusive with creatives[].



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

def body
  @body
end

#budget_amount ⇒ Object

Budget amount in the ad account's currency major units (e.g. dollars for USD, not cents). Must be > 0. Required unless adSetId is set, where the ad set owns it.



73
74
75
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 73

def budget_amount
  @budget_amount
end

#budget_type ⇒ Object

Required unless adSetId is set.



76
77
78
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 76

def budget_type
  @budget_type
end

#campaign_name ⇒ Object

Exact name for the campaign this request provisions. Omitted keeps <name> - Campaign. Ignored with adSetId (the ad set already has a campaign).



33
34
35
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 33

def campaign_name
  @campaign_name
end

#campaign_status ⇒ Object

Campaign-level status, same semantics as POST /v1/ads/create. Defaults to ACTIVE. PAUSED holds activation at the campaign so it never spends before the advertiser reviews it, while the ad set and ad still switch on (one resume call brings the whole hierarchy live). Only meaningful when a new campaign is being created; rejected with a 400 alongside adSetId (the attach shape reuses an existing campaign).



126
127
128
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 126

def campaign_status
  @campaign_status
end

#cities ⇒ Object

City-level geo targeting for local CTWA campaigns. Each entry maps to Meta's TargetingGeoLocationCity. key is Meta's city ID. radius and distance_unit are coupled: set both or neither. Meta enforces a minimum city radius (~17 km / 10 mi); smaller values resolve to a 0-size audience and the ad fails at launch. For a tighter catchment use customLocations (lat/lng).



88
89
90
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 88

def cities
  @cities
end

#countries ⇒ Object

ISO 3166-1 alpha-2 country codes. Defaults to [\"US\"] only when no other geo (cities, regions, zips, metros, customLocations) is supplied.



85
86
87
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 85

def countries
  @countries
end

#country_groups ⇒ Object

Meta only. Continents and trade blocs (geo_locations.country_groups), for targeting a whole region without listing its countries. Combines with countries rather than replacing it, and is also accepted under excludedLocations. Discoverable via GET /v1/ads/targeting/search?dimension=geo&geoType=country_group.



100
101
102
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 100

def country_groups
  @country_groups
end

#creative_features ⇒ Object

Meta enhancement settings for single or attached ads, and defaults for creatives. An item replaces the entire map, including with an empty object.



19
20
21
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 19

def creative_features
  @creative_features
end

#creatives ⇒ Object

Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Mutually exclusive with the top-level single-creative fields (headline / body / imageUrl / video): setting both is a 400, unlike POST /v1/ads/create where the top-level fields are silently ignored in multi-creative mode. Each entry supplies headline, body, and image/video, or a platformPostId or objectStoryId reference. Fresh and existing creatives can be mixed.



67
68
69
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 67

def creatives
  @creatives
end

#currency ⇒ Object

ISO 4217 currency code matching the ad account's currency (e.g. USD). Optional: Zernio resolves it from the ad account when omitted. The value selects the minor-unit exponent Zernio converts budget/bid amounts by before calling Meta (most currencies are cents; zero-decimal currencies like JPY/KRW are sent as-is).



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

def currency
  @currency
end

#custom_locations ⇒ Object

Point-radius geo (Meta geo_locations.custom_locations). Use for targeting a radius around a specific lat/long when no Meta city/region key fits. distanceUnit is required.



103
104
105
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 103

def custom_locations
  @custom_locations
end

#dsa_beneficiary ⇒ Object

Legal entity that benefits from the ad. Required when targeting EU users (EU DSA, Article 26). Optional if the ad account has a default beneficiary: set it once via PATCH /v1/ads/accounts or in Meta Ads Manager, and Meta fills it in whenever the field is omitted.



138
139
140
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 138

def dsa_beneficiary
  @dsa_beneficiary
end

#dsa_payor ⇒ Object

Legal entity that pays for the ad. Can differ from dsaBeneficiary (for example, an agency paying for a client's ads). Same rules as dsaBeneficiary: required for EU targeting unless the ad account has a default payor.



141
142
143
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 141

def dsa_payor
  @dsa_payor
end

#end_date ⇒ Object

ISO 8601 datetime. Required when budgetType is lifetime.



82
83
84
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 82

def end_date
  @end_date
end

#existing_post_id ⇒ Object

Alias of platformPostId, kept for existing callers. Sending both with different values is a 400.



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

def existing_post_id
  @existing_post_id
end

#headline ⇒ Object

Single-creative shape only. Mutually exclusive with creatives[].



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

def headline
  @headline
end

#image_url ⇒ Object

Image asset for single-creative shape. Mutually exclusive with video and with creatives[]. Required on the single-creative shape if neither video nor an existing post reference is supplied.



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

def image_url
  @image_url
end

#interests ⇒ Object

Returns the value of attribute interests.



109
110
111
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 109

def interests
  @interests
end

Website shown as the creative's link. Required: Meta rejects tel: as link_data.link; the phone number rides only the CTA.



153
154
155
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 153

def link_url
  @link_url
end

#metros ⇒ Object

DMA / metro-area geo targeting. key is Meta's metro id (e.g. DMA:807).



97
98
99
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 97

def metros
  @metros
end

#name ⇒ Object

Ad display name. Used to derive campaign / ad set names. On the multi-creative shape, each ad's Meta name gets a " #N" suffix (1-indexed) so Ads Manager shows them as a numbered batch.



30
31
32
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 30

def name
  @name
end

#object_story_id ⇒ Object

Messaging and CTWA only. Raw Facebook pageId_postId reference, used as object_story_id even with an Instagram account. Mutually exclusive with platformPostId and fresh creative fields.



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

def object_story_id
  @object_story_id
end

#objective ⇒ Object

Defaults to OUTCOME_ENGAGEMENT. OUTCOME_SALES and OUTCOME_LEADS require additional account configuration (Dataset linked to the WABA for sales) and may be rejected by Meta if missing.



120
121
122
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 120

def objective
  @objective
end

#page_id ⇒ Object

Facebook Page the ad runs as, when the connection was granted several Pages. Defaults to the Page bound to the connection. Any Page granted to the connection is accepted; other ids answer 400 listing the granted Pages. Same semantics as pageId on POST /v1/ads/create.



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

def page_id
  @page_id
end

#phone_number ⇒ Object

E.164 number the CALL_NOW CTA dials (e.g. +34600111222).



150
151
152
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 150

def phone_number
  @phone_number
end

#placements ⇒ Object

Returns the value of attribute placements.



114
115
116
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 114

def placements
  @placements
end

#platform_post_id ⇒ Object

Messaging and CTWA only. Platform post or reel ID, the same input boostPost takes as platformPostId. Facebook IDs become object_story_id; Instagram IDs become source_instagram_media_id using the connected Instagram identity. Mutually exclusive with objectStoryId and fresh creative fields.



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

def platform_post_id
  @platform_post_id
end

#regional_regulated_categories ⇒ Object

Meta only. Regional regulation categories required when the ad set targets certain countries (e.g. BRAZIL_REGULATION, SINGAPORE_UNIVERSAL, TAIWAN_UNIVERSAL, THAILAND_UNIVERSAL, AUSTRALIA_FINSERV, INDIA_FINSERV, TAIWAN_FINSERV). Forwarded to the ad set.



144
145
146
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 144

def regional_regulated_categories
  @regional_regulated_categories
end

#regional_regulation_identities ⇒ Object

Meta only. Beneficiary/payer entity IDs required alongside regionalRegulatedCategories. Values are numeric IDs from the advertiser's Meta verification/authorization setup. Keys depend on the declared category: BRAZIL_REGULATION and THAILAND_UNIVERSAL use universal_beneficiary / universal_payer; SINGAPORE_UNIVERSAL uses singapore_universal_beneficiary / singapore_universal_payer; TAIWAN_UNIVERSAL uses taiwan_universal_beneficiary / taiwan_universal_payer; TAIWAN_FINSERV uses taiwan_finserv_beneficiary / taiwan_finserv_payer; AUSTRALIA_FINSERV uses australia_finserv_beneficiary / australia_finserv_payer; INDIA_FINSERV uses india_finserv_beneficiary / india_finserv_payer. Both beneficiary and payer must be included. If omitted and the advertiser has set defaults in Meta Ads Manager advertising settings, Meta auto-fills them.



147
148
149
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 147

def regional_regulation_identities
  @regional_regulation_identities
end

#regions ⇒ Object

Region / state-level geo targeting. key is Meta's region ID (lookupable via GET /v1/ads/targeting/search?type=region).



91
92
93
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 91

def regions
  @regions
end

#roas_average_floor ⇒ Object

Decimal ROAS multiplier (e.g. 2.0 = 2.0× ROAS floor). Required when bidStrategy is LOWEST_COST_WITH_MIN_ROAS; rejected otherwise. Meta enforces its own upper bound server-side.



135
136
137
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 135

def roas_average_floor
  @roas_average_floor
end

#status ⇒ Object

Ad-level status. Defaults to ACTIVE. PAUSED skips activating the newly created ad(s) after Meta accepts them.



123
124
125
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 123

def status
  @status
end

#tracking ⇒ Object

Returns the value of attribute tracking.



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

def tracking
  @tracking
end

#video ⇒ Object

Returns the value of attribute video.



62
63
64
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 62

def video
  @video
end

#welcome_message ⇒ Object

Returns the value of attribute welcome_message.



64
65
66
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 64

def welcome_message
  @welcome_message
end

#whatsapp_phone_number ⇒ Object

WhatsApp only. Optional E.164 number already paired with the Facebook Page. Omit to let Meta select the paired number. Sent to the creative CTA and, when creating a new ad set, its promoted_object. Attach requests do not change the existing ad set. Stored as creative.whatsappPhoneNumber on every created ad.



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

def whatsapp_phone_number
  @whatsapp_phone_number
end

#zips ⇒ Object

ZIP / postal-code geo targeting. key is the platform's postal id resolved via /v1/ads/targeting/search.



94
95
96
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 94

def zips
  @zips
end

Class Method Details

.acceptable_attribute_map ⇒ Object

Returns attribute mapping this model knows about



232
233
234
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 232

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributes ⇒ Object

Returns all the JSON keys this model knows about



237
238
239
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 237

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_map ⇒ Object

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



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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 178

def self.attribute_map
  {
    :'creative_features' => :'creativeFeatures',
    :'tracking' => :'tracking',
    :'account_id' => :'accountId',
    :'ad_account_id' => :'adAccountId',
    :'name' => :'name',
    :'campaign_name' => :'campaignName',
    :'ad_set_name' => :'adSetName',
    :'platform_post_id' => :'platformPostId',
    :'existing_post_id' => :'existingPostId',
    :'object_story_id' => :'objectStoryId',
    :'page_id' => :'pageId',
    :'whatsapp_phone_number' => :'whatsappPhoneNumber',
    :'headline' => :'headline',
    :'body' => :'body',
    :'image_url' => :'imageUrl',
    :'video' => :'video',
    :'welcome_message' => :'welcomeMessage',
    :'creatives' => :'creatives',
    :'ad_set_id' => :'adSetId',
    :'budget_amount' => :'budgetAmount',
    :'budget_type' => :'budgetType',
    :'currency' => :'currency',
    :'end_date' => :'endDate',
    :'countries' => :'countries',
    :'cities' => :'cities',
    :'regions' => :'regions',
    :'zips' => :'zips',
    :'metros' => :'metros',
    :'country_groups' => :'countryGroups',
    :'custom_locations' => :'customLocations',
    :'age_min' => :'ageMin',
    :'age_max' => :'ageMax',
    :'interests' => :'interests',
    :'audience_id' => :'audienceId',
    :'placements' => :'placements',
    :'advantage_audience' => :'advantageAudience',
    :'objective' => :'objective',
    :'status' => :'status',
    :'campaign_status' => :'campaignStatus',
    :'bid_strategy' => :'bidStrategy',
    :'bid_amount' => :'bidAmount',
    :'roas_average_floor' => :'roasAverageFloor',
    :'dsa_beneficiary' => :'dsaBeneficiary',
    :'dsa_payor' => :'dsaPayor',
    :'regional_regulated_categories' => :'regionalRegulatedCategories',
    :'regional_regulation_identities' => :'regionalRegulationIdentities',
    :'phone_number' => :'phoneNumber',
    :'link_url' => :'linkUrl'
  }
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



1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 1116

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_of ⇒ Object

List of class defined in allOf (OpenAPI v3)



302
303
304
305
306
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 302

def self.openapi_all_of
  [
  :'CtwaAdRequestBody'
  ]
end

.openapi_nullable ⇒ Object

List of attributes with nullable: true



296
297
298
299
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 296

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

.openapi_types ⇒ Object

Attribute type mapping.



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
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 242

def self.openapi_types
  {
    :'creative_features' => :'Hash<String, String>',
    :'tracking' => :'AdTracking',
    :'account_id' => :'String',
    :'ad_account_id' => :'String',
    :'name' => :'String',
    :'campaign_name' => :'String',
    :'ad_set_name' => :'String',
    :'platform_post_id' => :'String',
    :'existing_post_id' => :'String',
    :'object_story_id' => :'String',
    :'page_id' => :'String',
    :'whatsapp_phone_number' => :'String',
    :'headline' => :'String',
    :'body' => :'String',
    :'image_url' => :'String',
    :'video' => :'CtwaAdRequestBodyVideo',
    :'welcome_message' => :'CtwaAdRequestBodyWelcomeMessage',
    :'creatives' => :'Array<CtwaAdRequestBodyCreativesInner>',
    :'ad_set_id' => :'String',
    :'budget_amount' => :'Float',
    :'budget_type' => :'String',
    :'currency' => :'String',
    :'end_date' => :'Time',
    :'countries' => :'Array<String>',
    :'cities' => :'Array<CtwaAdRequestBodyCitiesInner>',
    :'regions' => :'Array<CtwaAdRequestBodyRegionsInner>',
    :'zips' => :'Array<CtwaAdRequestBodyZipsInner>',
    :'metros' => :'Array<CtwaAdRequestBodyZipsInner>',
    :'country_groups' => :'Array<String>',
    :'custom_locations' => :'Array<CreateStandaloneAdRequestCustomLocationsInner>',
    :'age_min' => :'Integer',
    :'age_max' => :'Integer',
    :'interests' => :'Array<CreateStandaloneAdRequestBehaviorsInner>',
    :'audience_id' => :'String',
    :'placements' => :'CtwaAdRequestBodyPlacements',
    :'advantage_audience' => :'Integer',
    :'objective' => :'String',
    :'status' => :'String',
    :'campaign_status' => :'String',
    :'bid_strategy' => :'String',
    :'bid_amount' => :'Float',
    :'roas_average_floor' => :'Float',
    :'dsa_beneficiary' => :'String',
    :'dsa_payor' => :'String',
    :'regional_regulated_categories' => :'Array<String>',
    :'regional_regulation_identities' => :'Hash<String, Integer>',
    :'phone_number' => :'String',
    :'link_url' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object) —

    to be compared



1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 1048

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      creative_features == o.creative_features &&
      tracking == o.tracking &&
       == o. &&
       == o. &&
      name == o.name &&
      campaign_name == o.campaign_name &&
      ad_set_name == o.ad_set_name &&
      platform_post_id == o.platform_post_id &&
      existing_post_id == o.existing_post_id &&
      object_story_id == o.object_story_id &&
      page_id == o.page_id &&
      whatsapp_phone_number == o.whatsapp_phone_number &&
      headline == o.headline &&
      body == o.body &&
      image_url == o.image_url &&
      video == o.video &&
      welcome_message == o.welcome_message &&
      creatives == o.creatives &&
      ad_set_id == o.ad_set_id &&
      budget_amount == o.budget_amount &&
      budget_type == o.budget_type &&
      currency == o.currency &&
      end_date == o.end_date &&
      countries == o.countries &&
      cities == o.cities &&
      regions == o.regions &&
      zips == o.zips &&
      metros == o.metros &&
      country_groups == o.country_groups &&
      custom_locations == o.custom_locations &&
      age_min == o.age_min &&
      age_max == o.age_max &&
      interests == o.interests &&
      audience_id == o.audience_id &&
      placements == o.placements &&
      advantage_audience == o.advantage_audience &&
      objective == o.objective &&
      status == o.status &&
      campaign_status == o.campaign_status &&
      bid_strategy == o.bid_strategy &&
      bid_amount == o.bid_amount &&
      roas_average_floor == o.roas_average_floor &&
      dsa_beneficiary == o.dsa_beneficiary &&
      dsa_payor == o.dsa_payor &&
      regional_regulated_categories == o.regional_regulated_categories &&
      regional_regulation_identities == o.regional_regulation_identities &&
      phone_number == o.phone_number &&
      link_url == o.link_url
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object) —

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


1103
1104
1105
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 1103

def eql?(o)
  self == o
end

#hash ⇒ Integer

Calculates hash code according to all attributes.

Returns:

  • (Integer) —

    Hash code



1109
1110
1111
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 1109

def hash
  [creative_features, tracking, , , name, campaign_name, ad_set_name, platform_post_id, existing_post_id, object_story_id, page_id, whatsapp_phone_number, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, country_groups, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, regional_regulated_categories, regional_regulation_identities, phone_number, link_url].hash
end

#list_invalid_properties ⇒ Object

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

Returns:

  • Array for valid properties with the reasons



553
554
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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 553

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

  if @account_id.to_s.length < 1
    invalid_properties.push('invalid value for "account_id", the character length must be greater than or equal to 1.')
  end

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

  if @ad_account_id.to_s.length < 1
    invalid_properties.push('invalid value for "ad_account_id", the character length must be greater than or equal to 1.')
  end

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

  if @name.to_s.length < 1
    invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
  end

  if !@campaign_name.nil? && @campaign_name.to_s.length > 255
    invalid_properties.push('invalid value for "campaign_name", the character length must be smaller than or equal to 255.')
  end

  if !@ad_set_name.nil? && @ad_set_name.to_s.length > 255
    invalid_properties.push('invalid value for "ad_set_name", the character length must be smaller than or equal to 255.')
  end

  if !@platform_post_id.nil? && @platform_post_id.to_s.length < 1
    invalid_properties.push('invalid value for "platform_post_id", the character length must be greater than or equal to 1.')
  end

  if !@existing_post_id.nil? && @existing_post_id.to_s.length < 1
    invalid_properties.push('invalid value for "existing_post_id", the character length must be greater than or equal to 1.')
  end

  pattern = Regexp.new(/^\d+_\d+$/)
  if !@object_story_id.nil? && @object_story_id !~ pattern
    invalid_properties.push("invalid value for \"object_story_id\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^\+[1-9]\d{6,14}$/)
  if !@whatsapp_phone_number.nil? && @whatsapp_phone_number !~ pattern
    invalid_properties.push("invalid value for \"whatsapp_phone_number\", must conform to the pattern #{pattern}.")
  end

  if !@headline.nil? && @headline.to_s.length > 255
    invalid_properties.push('invalid value for "headline", the character length must be smaller than or equal to 255.')
  end

  if !@headline.nil? && @headline.to_s.length < 1
    invalid_properties.push('invalid value for "headline", the character length must be greater than or equal to 1.')
  end

  if !@body.nil? && @body.to_s.length < 1
    invalid_properties.push('invalid value for "body", the character length must be greater than or equal to 1.')
  end

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

  if !@currency.nil? && @currency.to_s.length > 3
    invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
  end

  if !@currency.nil? && @currency.to_s.length < 3
    invalid_properties.push('invalid value for "currency", the character length must be greater than or equal to 3.')
  end

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

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

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

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

  if !@dsa_beneficiary.nil? && @dsa_beneficiary.to_s.length > 100
    invalid_properties.push('invalid value for "dsa_beneficiary", the character length must be smaller than or equal to 100.')
  end

  if !@dsa_payor.nil? && @dsa_payor.to_s.length > 100
    invalid_properties.push('invalid value for "dsa_payor", the character length must be smaller than or equal to 100.')
  end

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

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

  invalid_properties
end

#to_hash ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash) —

    Returns the object in the form of hash



1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 1138

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



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/zernio-sdk/models/create_call_ad_request.rb', line 667

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @account_id.nil?
  return false if @account_id.to_s.length < 1
  return false if @ad_account_id.nil?
  return false if @ad_account_id.to_s.length < 1
  return false if @name.nil?
  return false if @name.to_s.length < 1
  return false if !@campaign_name.nil? && @campaign_name.to_s.length > 255
  return false if !@ad_set_name.nil? && @ad_set_name.to_s.length > 255
  return false if !@platform_post_id.nil? && @platform_post_id.to_s.length < 1
  return false if !@existing_post_id.nil? && @existing_post_id.to_s.length < 1
  return false if !@object_story_id.nil? && @object_story_id !~ Regexp.new(/^\d+_\d+$/)
  return false if !@whatsapp_phone_number.nil? && @whatsapp_phone_number !~ Regexp.new(/^\+[1-9]\d{6,14}$/)
  return false if !@headline.nil? && @headline.to_s.length > 255
  return false if !@headline.nil? && @headline.to_s.length < 1
  return false if !@body.nil? && @body.to_s.length < 1
  return false if !@creatives.nil? && @creatives.length < 1
  budget_type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
  return false unless budget_type_validator.valid?(@budget_type)
  return false if !@currency.nil? && @currency.to_s.length > 3
  return false if !@currency.nil? && @currency.to_s.length < 3
  return false if !@age_min.nil? && @age_min > 65
  return false if !@age_min.nil? && @age_min < 13
  return false if !@age_max.nil? && @age_max > 65
  return false if !@age_max.nil? && @age_max < 13
  advantage_audience_validator = EnumAttributeValidator.new('Integer', [0, 1])
  return false unless advantage_audience_validator.valid?(@advantage_audience)
  objective_validator = EnumAttributeValidator.new('String', ["OUTCOME_ENGAGEMENT", "OUTCOME_SALES", "OUTCOME_LEADS"])
  return false unless objective_validator.valid?(@objective)
  status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"])
  return false unless status_validator.valid?(@status)
  campaign_status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"])
  return false unless campaign_status_validator.valid?(@campaign_status)
  bid_strategy_validator = EnumAttributeValidator.new('String', ["LOWEST_COST_WITHOUT_CAP", "LOWEST_COST_WITH_BID_CAP", "COST_CAP", "LOWEST_COST_WITH_MIN_ROAS"])
  return false unless bid_strategy_validator.valid?(@bid_strategy)
  return false if !@dsa_beneficiary.nil? && @dsa_beneficiary.to_s.length > 100
  return false if !@dsa_payor.nil? && @dsa_payor.to_s.length > 100
  return false if @phone_number.nil?
  return false if @link_url.nil?
  true
end