facebookbusiness 0.7.0.3 → 0.9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/lib/facebook_ads/ad_objects/ad_account.rb +24 -16
  3. data/lib/facebook_ads/ad_objects/ad_account_ad_volume.rb +24 -0
  4. data/lib/facebook_ads/ad_objects/ad_account_targeting_unified.rb +22 -5
  5. data/lib/facebook_ads/ad_objects/ad_activity.rb +0 -1
  6. data/lib/facebook_ads/ad_objects/ad_asset_feed_spec.rb +5 -0
  7. data/lib/facebook_ads/ad_objects/ad_async_request.rb +2 -0
  8. data/lib/facebook_ads/ad_objects/ad_campaign_activity.rb +4 -0
  9. data/lib/facebook_ads/ad_objects/ad_creative.rb +6 -0
  10. data/lib/facebook_ads/ad_objects/ad_creative_interactive_components_spec.rb +1 -0
  11. data/lib/facebook_ads/ad_objects/ad_creative_link_data_call_to_action.rb +4 -0
  12. data/lib/facebook_ads/ad_objects/ad_network_analytics_sync_query_result.rb +1 -0
  13. data/lib/facebook_ads/ad_objects/ad_place_page_set.rb +6 -0
  14. data/lib/facebook_ads/ad_objects/ad_preview.rb +1 -0
  15. data/lib/facebook_ads/ad_objects/ad_report_spec.rb +0 -1
  16. data/lib/facebook_ads/ad_objects/ad_rule_execution_spec.rb +4 -0
  17. data/lib/facebook_ads/ad_objects/ad_study.rb +1 -1
  18. data/lib/facebook_ads/ad_objects/ad_study_objective.rb +0 -4
  19. data/lib/facebook_ads/ad_objects/ad_video.rb +11 -0
  20. data/lib/facebook_ads/ad_objects/adgroup_activity.rb +2 -0
  21. data/lib/facebook_ads/ad_objects/adoptable_pet.rb +8 -0
  22. data/lib/facebook_ads/ad_objects/ads_insights.rb +1 -0
  23. data/lib/facebook_ads/ad_objects/ads_pixel.rb +4 -0
  24. data/lib/facebook_ads/ad_objects/application.rb +23 -0
  25. data/lib/facebook_ads/ad_objects/atlas_campaign.rb +1 -1
  26. data/lib/facebook_ads/ad_objects/automotive_model.rb +1 -0
  27. data/lib/facebook_ads/ad_objects/business.rb +62 -11
  28. data/lib/facebook_ads/ad_objects/business_asset_group.rb +1 -0
  29. data/lib/facebook_ads/ad_objects/business_role_request.rb +4 -0
  30. data/lib/facebook_ads/ad_objects/business_unit.rb +1 -2
  31. data/lib/facebook_ads/ad_objects/business_user.rb +4 -0
  32. data/lib/facebook_ads/ad_objects/campaign.rb +8 -0
  33. data/lib/facebook_ads/ad_objects/catalog_sub_vertical_list.rb +88 -0
  34. data/lib/facebook_ads/ad_objects/commerce_merchant_settings.rb +16 -19
  35. data/lib/facebook_ads/ad_objects/commerce_merchant_settings_setup_status.rb +1 -0
  36. data/lib/facebook_ads/ad_objects/commerce_order.rb +6 -0
  37. data/lib/facebook_ads/ad_objects/commerce_order_transaction_detail.rb +4 -0
  38. data/lib/facebook_ads/ad_objects/{work_meeting_link.rb → connections_targeting.rb} +3 -2
  39. data/lib/facebook_ads/ad_objects/{iterative_split_test_config.rb → cpas_advertiser_partnership_recommendation.rb} +9 -9
  40. data/lib/facebook_ads/ad_objects/{split_test_config.rb → cpas_collaboration_request.rb} +16 -7
  41. data/lib/facebook_ads/ad_objects/custom_audience_data_source.rb +1 -0
  42. data/lib/facebook_ads/ad_objects/da_check.rb +7 -0
  43. data/lib/facebook_ads/ad_objects/destination.rb +1 -0
  44. data/lib/facebook_ads/ad_objects/event.rb +1 -1
  45. data/lib/facebook_ads/ad_objects/extended_credit.rb +7 -1
  46. data/lib/facebook_ads/ad_objects/flight.rb +1 -0
  47. data/lib/facebook_ads/ad_objects/group.rb +8 -1
  48. data/lib/facebook_ads/ad_objects/home_listing.rb +1 -0
  49. data/lib/facebook_ads/ad_objects/hotel.rb +1 -0
  50. data/lib/facebook_ads/ad_objects/hotel_room.rb +1 -0
  51. data/lib/facebook_ads/ad_objects/life_event.rb +0 -4
  52. data/lib/facebook_ads/ad_objects/link.rb +6 -6
  53. data/lib/facebook_ads/ad_objects/live_video.rb +12 -16
  54. data/lib/facebook_ads/ad_objects/native_offer_view.rb +0 -1
  55. data/lib/facebook_ads/ad_objects/oracle_transaction.rb +0 -7
  56. data/lib/facebook_ads/ad_objects/page.rb +48 -70
  57. data/lib/facebook_ads/ad_objects/page_post.rb +2 -0
  58. data/lib/facebook_ads/ad_objects/photo.rb +6 -0
  59. data/lib/facebook_ads/ad_objects/playable_content.rb +1 -0
  60. data/lib/facebook_ads/ad_objects/post.rb +49 -2
  61. data/lib/facebook_ads/ad_objects/product_catalog.rb +43 -7
  62. data/lib/facebook_ads/ad_objects/product_feed.rb +31 -0
  63. data/lib/facebook_ads/ad_objects/product_group.rb +1 -0
  64. data/lib/facebook_ads/ad_objects/product_item.rb +4 -0
  65. data/lib/facebook_ads/ad_objects/product_set.rb +1 -0
  66. data/lib/facebook_ads/ad_objects/product_set_metadata.rb +1 -0
  67. data/lib/facebook_ads/ad_objects/publisher_block_list.rb +6 -0
  68. data/lib/facebook_ads/ad_objects/referral.rb +2 -0
  69. data/lib/facebook_ads/ad_objects/security_settings.rb +0 -1
  70. data/lib/facebook_ads/ad_objects/server_side/batch_processor.rb +73 -0
  71. data/lib/facebook_ads/ad_objects/server_side/content.rb +23 -4
  72. data/lib/facebook_ads/ad_objects/server_side/custom_data.rb +21 -0
  73. data/lib/facebook_ads/ad_objects/{page_about_story.rb → server_side/delivery_category.rb} +10 -16
  74. data/lib/facebook_ads/ad_objects/server_side/event_request.rb +61 -14
  75. data/lib/facebook_ads/ad_objects/server_side/event_request_async.rb +43 -0
  76. data/lib/facebook_ads/ad_objects/{atlas_url.rb → server_side/http_method.rb} +7 -16
  77. data/lib/facebook_ads/ad_objects/server_side/http_service_interface.rb +33 -0
  78. data/lib/facebook_ads/ad_objects/server_side/http_util.rb +31 -0
  79. data/lib/facebook_ads/ad_objects/server_side/user_data.rb +20 -1
  80. data/lib/facebook_ads/ad_objects/server_side/util.rb +13 -0
  81. data/lib/facebook_ads/ad_objects/system_user.rb +0 -20
  82. data/lib/facebook_ads/ad_objects/targeting.rb +3 -3
  83. data/lib/facebook_ads/ad_objects/third_party_measurement_report_dataset.rb +0 -1
  84. data/lib/facebook_ads/ad_objects/unified_thread.rb +1 -0
  85. data/lib/facebook_ads/ad_objects/user.rb +28 -30
  86. data/lib/facebook_ads/ad_objects/vehicle.rb +2 -0
  87. data/lib/facebook_ads/ad_objects/vehicle_offer.rb +1 -0
  88. data/lib/facebook_ads/ad_objects/whats_app_business_account.rb +25 -0
  89. data/lib/facebook_ads/errors.rb +1 -1
  90. data/lib/facebook_ads/session.rb +1 -1
  91. data/lib/facebook_ads/version.rb +2 -2
  92. metadata +30 -12
  93. data/lib/facebook_ads/ad_objects/user_taggable_friend.rb +0 -50
@@ -35,6 +35,7 @@ module FacebookAds
35
35
  "home_listings",
36
36
  "hotels",
37
37
  "jobs",
38
+ "local_delivery_shipping_profiles",
38
39
  "local_service_businesses",
39
40
  "offer_items",
40
41
  "offline_commerce",
@@ -51,17 +52,48 @@ module FacebookAds
51
52
  PERMITTED_TASKS = [
52
53
  "ADVERTISE",
53
54
  "MANAGE",
55
+ "MANAGE_AR",
54
56
  ]
55
57
 
56
58
  TASKS = [
57
59
  "ADVERTISE",
58
60
  "MANAGE",
61
+ "MANAGE_AR",
59
62
  ]
60
63
 
61
64
  STANDARD = [
62
65
  "google",
63
66
  ]
64
67
 
68
+ ITEM_SUB_TYPE = [
69
+ "APPLIANCES",
70
+ "BABY_FEEDING",
71
+ "BABY_TRANSPORT",
72
+ "BEAUTY",
73
+ "BEDDING",
74
+ "CAMERAS",
75
+ "CELL_PHONES_AND_SMART_WATCHES",
76
+ "CLEANING_SUPPLIES",
77
+ "CLOTHING",
78
+ "CLOTHING_ACCESSORIES",
79
+ "COMPUTERS_AND_TABLETS",
80
+ "DIAPERING_AND_POTTY_TRAINING",
81
+ "ELECTRONICS_ACCESSORIES",
82
+ "FURNITURE",
83
+ "HEALTH",
84
+ "HOME_GOODS",
85
+ "JEWELRY",
86
+ "NURSERY",
87
+ "PRINTERS_AND_SCANNERS",
88
+ "PROJECTORS",
89
+ "SHOES_AND_FOOTWEAR",
90
+ "SOFTWARE",
91
+ "TOYS",
92
+ "TVS_AND_MONITORS",
93
+ "VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES",
94
+ "WATCHES",
95
+ ]
96
+
65
97
 
66
98
  field :business, 'Business'
67
99
  field :commerce_merchant_settings, 'CommerceMerchantSettings'
@@ -75,9 +107,11 @@ module FacebookAds
75
107
  field :product_count, 'int'
76
108
  field :store_catalog_settings, 'StoreCatalogSettings'
77
109
  field :vertical, 'string'
110
+ field :catalog_segment_filter, 'object'
111
+ field :catalog_segment_product_set_id, 'string'
78
112
  field :destination_catalog_settings, 'hash'
79
113
  field :flight_catalog_settings, 'hash'
80
- field :onsite_commerce_merchant, 'object'
114
+ field :parent_catalog_id, 'string'
81
115
 
82
116
  has_edge :agencies do |edge|
83
117
  edge.delete do |api|
@@ -88,6 +122,7 @@ module FacebookAds
88
122
  api.has_param :business, 'string'
89
123
  api.has_param :permitted_roles, { list: { enum: -> { ProductCatalog::PERMITTED_ROLES }} }
90
124
  api.has_param :permitted_tasks, { list: { enum: -> { ProductCatalog::PERMITTED_TASKS }} }
125
+ api.has_param :utm_settings, 'hash'
91
126
  end
92
127
  end
93
128
 
@@ -233,17 +268,12 @@ module FacebookAds
233
268
  has_edge :items_batch do |edge|
234
269
  edge.post 'ProductCatalog' do |api|
235
270
  api.has_param :allow_upsert, 'bool'
271
+ api.has_param :item_sub_type, { enum: -> { ProductCatalog::ITEM_SUB_TYPE }}
236
272
  api.has_param :item_type, 'string'
237
273
  api.has_param :requests, 'hash'
238
274
  end
239
275
  end
240
276
 
241
- has_edge :onsite_commerce_merchant do |edge|
242
- edge.post 'ProductCatalog' do |api|
243
- api.has_param :onsite_commerce_merchant, 'object'
244
- end
245
- end
246
-
247
277
  has_edge :pricing_variables_batch do |edge|
248
278
  edge.get 'ProductCatalogPricingVariablesBatch' do |api|
249
279
  api.has_param :handle, 'string'
@@ -268,6 +298,8 @@ module FacebookAds
268
298
  api.has_param :encoding, { enum: -> { ProductFeed::ENCODING }}
269
299
  api.has_param :feed_type, { enum: -> { ProductFeed::FEED_TYPE }}
270
300
  api.has_param :file_name, 'string'
301
+ api.has_param :item_sub_type, { enum: -> { ProductFeed::ITEM_SUB_TYPE }}
302
+ api.has_param :migrated_from_feed_id, 'string'
271
303
  api.has_param :name, 'string'
272
304
  api.has_param :override_type, { enum: -> { ProductFeed::OVERRIDE_TYPE }}
273
305
  api.has_param :override_value, 'string'
@@ -298,6 +330,7 @@ module FacebookAds
298
330
  api.has_param :filter, 'object'
299
331
  api.has_param :metadata, 'hash'
300
332
  api.has_param :name, 'string'
333
+ api.has_param :retailer_id, 'string'
301
334
  end
302
335
  end
303
336
 
@@ -316,6 +349,7 @@ module FacebookAds
316
349
  edge.post 'ProductItem' do |api|
317
350
  api.has_param :additional_image_files, { list: 'file' }
318
351
  api.has_param :additional_image_urls, { list: 'string' }
352
+ api.has_param :additional_uploaded_image_ids, { list: 'string' }
319
353
  api.has_param :additional_variant_attributes, 'hash'
320
354
  api.has_param :android_app_name, 'string'
321
355
  api.has_param :android_class, 'string'
@@ -324,6 +358,7 @@ module FacebookAds
324
358
  api.has_param :availability, { enum: -> { ProductItem::AVAILABILITY }}
325
359
  api.has_param :brand, 'string'
326
360
  api.has_param :category, 'string'
361
+ api.has_param :category_specific_fields, 'hash'
327
362
  api.has_param :checkout_url, 'string'
328
363
  api.has_param :color, 'string'
329
364
  api.has_param :commerce_tax_category, { enum: -> { ProductItem::COMMERCE_TAX_CATEGORY }}
@@ -337,6 +372,7 @@ module FacebookAds
337
372
  api.has_param :custom_label_4, 'string'
338
373
  api.has_param :description, 'string'
339
374
  api.has_param :expiration_date, 'string'
375
+ api.has_param :fb_product_category, 'string'
340
376
  api.has_param :gender, { enum: -> { ProductItem::GENDER }}
341
377
  api.has_param :gtin, 'string'
342
378
  api.has_param :image_url, 'string'
@@ -68,6 +68,35 @@ module FacebookAds
68
68
  "VEHICLE_OFFER",
69
69
  ]
70
70
 
71
+ ITEM_SUB_TYPE = [
72
+ "APPLIANCES",
73
+ "BABY_FEEDING",
74
+ "BABY_TRANSPORT",
75
+ "BEAUTY",
76
+ "BEDDING",
77
+ "CAMERAS",
78
+ "CELL_PHONES_AND_SMART_WATCHES",
79
+ "CLEANING_SUPPLIES",
80
+ "CLOTHING",
81
+ "CLOTHING_ACCESSORIES",
82
+ "COMPUTERS_AND_TABLETS",
83
+ "DIAPERING_AND_POTTY_TRAINING",
84
+ "ELECTRONICS_ACCESSORIES",
85
+ "FURNITURE",
86
+ "HEALTH",
87
+ "HOME_GOODS",
88
+ "JEWELRY",
89
+ "NURSERY",
90
+ "PRINTERS_AND_SCANNERS",
91
+ "PROJECTORS",
92
+ "SHOES_AND_FOOTWEAR",
93
+ "SOFTWARE",
94
+ "TOYS",
95
+ "TVS_AND_MONITORS",
96
+ "VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES",
97
+ "WATCHES",
98
+ ]
99
+
71
100
  OVERRIDE_TYPE = [
72
101
  "CATALOG_SEGMENT_CUSTOMIZE_DEFAULT",
73
102
  "COUNTRY",
@@ -85,7 +114,9 @@ module FacebookAds
85
114
  field :encoding, 'string'
86
115
  field :file_name, 'string'
87
116
  field :id, 'string'
117
+ field :item_sub_type, 'string'
88
118
  field :latest_upload, 'ProductFeedUpload'
119
+ field :migrated_from_feed_id, 'string'
89
120
  field :name, 'string'
90
121
  field :override_type, 'string'
91
122
  field :product_count, 'int'
@@ -57,6 +57,7 @@ module FacebookAds
57
57
  api.has_param :custom_label_4, 'string'
58
58
  api.has_param :description, 'string'
59
59
  api.has_param :expiration_date, 'string'
60
+ api.has_param :fb_product_category, 'string'
60
61
  api.has_param :gender, { enum: -> { ProductItem::GENDER }}
61
62
  api.has_param :gtin, 'string'
62
63
  api.has_param :image_url, 'string'
@@ -297,6 +297,7 @@ module FacebookAds
297
297
  field :brand, 'string'
298
298
  field :capability_to_review_status, 'hash'
299
299
  field :category, 'string'
300
+ field :category_specific_fields, 'CatalogSubVerticalList'
300
301
  field :color, 'string'
301
302
  field :commerce_insights, 'ProductItemCommerceInsights'
302
303
  field :condition, { enum: -> { CONDITION }}
@@ -309,11 +310,13 @@ module FacebookAds
309
310
  field :custom_label_4, 'string'
310
311
  field :description, 'string'
311
312
  field :expiration_date, 'string'
313
+ field :fb_product_category, 'string'
312
314
  field :gender, { enum: -> { GENDER }}
313
315
  field :gtin, 'string'
314
316
  field :id, 'string'
315
317
  field :image_cdn_urls, 'hash'
316
318
  field :image_url, 'string'
319
+ field :images, { list: 'string' }
317
320
  field :inventory, 'int'
318
321
  field :manufacturer_part_number, 'string'
319
322
  field :material, 'string'
@@ -341,6 +344,7 @@ module FacebookAds
341
344
  field :url, 'string'
342
345
  field :visibility, { enum: -> { VISIBILITY }}
343
346
  field :additional_image_files, { list: 'file' }
347
+ field :additional_uploaded_image_ids, { list: 'string' }
344
348
  field :android_app_name, 'string'
345
349
  field :android_class, 'string'
346
350
  field :android_package, 'string'
@@ -35,6 +35,7 @@ module FacebookAds
35
35
  field :name, 'string'
36
36
  field :product_catalog, 'ProductCatalog'
37
37
  field :product_count, 'int'
38
+ field :retailer_id, 'string'
38
39
  field :metadata, 'hash'
39
40
 
40
41
  has_edge :automotive_models do |edge|
@@ -29,6 +29,7 @@ module FacebookAds
29
29
 
30
30
  field :cover_image_url, 'string'
31
31
  field :description, 'string'
32
+ field :external_url, 'string'
32
33
  field :integrity_review_status, 'string'
33
34
  has_no_id
34
35
  has_no_get
@@ -38,6 +38,12 @@ module FacebookAds
38
38
  field :owner_ad_account_id, 'string'
39
39
  field :web_publishers, { list: 'object' }
40
40
 
41
+ has_edge :append_publisher_urls do |edge|
42
+ edge.post do |api|
43
+ api.has_param :publisher_urls, { list: 'string' }
44
+ end
45
+ end
46
+
41
47
  has_edge :paged_web_publishers do |edge|
42
48
  edge.get do |api|
43
49
  api.has_param :draft_id, 'string'
@@ -34,10 +34,12 @@ module FacebookAds
34
34
  field :namespace, 'string'
35
35
  field :need_promo_code, 'bool'
36
36
  field :offer_origin, 'string'
37
+ field :privacy_policy_link, 'string'
37
38
  field :promotion_text, 'string'
38
39
  field :receiver_benefits_text, 'string'
39
40
  field :referral_link_uri, 'string'
40
41
  field :sender_benefits_text, 'string'
42
+ field :terms_and_condition_link, 'string'
41
43
 
42
44
  end
43
45
  end
@@ -27,7 +27,6 @@ module FacebookAds
27
27
 
28
28
  class SecuritySettings < AdObject
29
29
 
30
- field :secure_browsing, 'object'
31
30
  has_no_id
32
31
  has_no_get
33
32
  has_no_post
@@ -0,0 +1,73 @@
1
+ # Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
2
+ #
3
+ # You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
4
+ # copy, modify, and distribute this software in source code or binary form for use
5
+ # in connection with the web services and APIs provided by Facebook.
6
+ #
7
+ # As with any software that integrates with the Facebook platform, your use of
8
+ # this software is subject to the Facebook Platform Policy
9
+ # [http://developers.facebook.com/policy/]. This copyright notice shall be
10
+ # included in all copies or substantial portions of the software.
11
+ #
12
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
14
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
16
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
17
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+
19
+ module FacebookAds::ServerSide
20
+ class BatchProcessor
21
+ attr_accessor :batch_size
22
+ attr_accessor :concurrent_requests
23
+
24
+ # Initializes the object
25
+ # @param [Integer] batch_size The number of events to send in each request
26
+ # @param [Integer] concurrent_requests The number of threads to use when making requests concurrently
27
+ def initialize(batch_size=50, concurrent_requests=4)
28
+ self.batch_size = batch_size
29
+ self.concurrent_requests = concurrent_requests
30
+ end
31
+
32
+ def process_event_requests(event_requests_async)
33
+ generator = self.process_event_requests_generator(event_requests_async)
34
+ generator.each do |batch|
35
+ Concurrent::Promise.zip(*batch).execute.value!
36
+ end
37
+ end
38
+
39
+ def process_events(event_request_async_to_clone, events)
40
+ generator = self.process_events_generator(event_request_async_to_clone, events)
41
+ generator.each do |batch|
42
+ Concurrent::Promise.zip(*batch).execute.value!
43
+ end
44
+ end
45
+
46
+ def process_event_requests_generator(event_requests_async)
47
+ index = 0
48
+ Enumerator.new do |generator|
49
+ while index < event_requests_async.size do
50
+ batch = event_requests_async[index, concurrent_requests].map(&:execute)
51
+ generator.yield *[batch]
52
+ index += concurrent_requests
53
+ end
54
+ end
55
+ end
56
+
57
+ def process_events_generator(event_request_async_to_clone, events)
58
+ index = 0
59
+ Enumerator.new do |generator|
60
+ while index < events.size do
61
+ batch = []
62
+ while index < events.size && batch.size < concurrent_requests do
63
+ event_request_async = event_request_async_to_clone.clone_without_events
64
+ event_request_async.events = events[index, batch_size]
65
+ batch << event_request_async
66
+ index += batch_size
67
+ end
68
+ generator.yield *[batch.map(&:execute)]
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -28,7 +28,8 @@ module FacebookAds
28
28
  :title,
29
29
  :description,
30
30
  :brand,
31
- :category
31
+ :category,
32
+ :delivery_category
32
33
 
33
34
  # Initializes the object
34
35
  # @param [String] product_id
@@ -38,7 +39,8 @@ module FacebookAds
38
39
  # @param [String] description
39
40
  # @param [String] brand
40
41
  # @param [String] category
41
- def initialize(product_id: nil, quantity: nil, item_price: nil, title: nil, description: nil, brand: nil, category: nil)
42
+ # @param [String] delivery_category
43
+ def initialize(product_id: nil, quantity: nil, item_price: nil, title: nil, description: nil, brand: nil, category: nil, delivery_category: nil)
42
44
  unless product_id.nil?
43
45
  self.product_id = String(product_id)
44
46
  end
@@ -60,6 +62,9 @@ module FacebookAds
60
62
  unless category.nil?
61
63
  self.category = String(category)
62
64
  end
65
+ unless delivery_category.nil?
66
+ self.delivery_category = String(delivery_category)
67
+ end
63
68
  end
64
69
 
65
70
  # build the object using the input hash
@@ -97,6 +102,10 @@ module FacebookAds
97
102
  if attributes.has_key?(:'category')
98
103
  self.category = attributes[:'category']
99
104
  end
105
+
106
+ if attributes.has_key?(:'delivery_category')
107
+ self.delivery_category = attributes[:'delivery_category']
108
+ end
100
109
  end
101
110
 
102
111
  # Checks equality by comparing each attribute.
@@ -108,7 +117,8 @@ module FacebookAds
108
117
  title == o.title &&
109
118
  description == o.description &&
110
119
  brand == o.brand &&
111
- category == o.category
120
+ category == o.category &&
121
+ delivery_category == o.delivery_category
112
122
  end
113
123
 
114
124
  # @see the `==` method
@@ -126,7 +136,8 @@ module FacebookAds
126
136
  title,
127
137
  description,
128
138
  brand,
129
- category
139
+ category,
140
+ delivery_category
130
141
  ].hash
131
142
  end
132
143
 
@@ -156,6 +167,9 @@ module FacebookAds
156
167
  unless category.nil?
157
168
  hash['category'] = category
158
169
  end
170
+ unless delivery_category.nil?
171
+ hash['delivery_category'] = delivery_category
172
+ end
159
173
  hash.to_s
160
174
  end
161
175
 
@@ -183,6 +197,11 @@ module FacebookAds
183
197
  unless category.nil?
184
198
  hash['category'] = category
185
199
  end
200
+ unless delivery_category.nil?
201
+ hash['delivery_category'] = FacebookAds::ServerSide::Util.normalize_delivery_category(
202
+ delivery_category
203
+ )
204
+ end
186
205
  hash
187
206
  end
188
207
  end
@@ -70,6 +70,10 @@ module FacebookAds
70
70
  # Example: 'lettuce'.
71
71
  attr_accessor :search_string
72
72
 
73
+ # Type of delivery for a purchase event
74
+ # Example: 'home_delivery'.
75
+ attr_accessor :delivery_category
76
+
73
77
  # The item number.
74
78
  # Example: 'item1234'.
75
79
  attr_accessor :item_number
@@ -90,6 +94,7 @@ module FacebookAds
90
94
  # @param [Integer] num_items
91
95
  # @param [String] status
92
96
  # @param [String] search_string
97
+ # @param [String] delivery_category
93
98
  # @param [String] item_number
94
99
  # @param [String] custom_properties
95
100
  def initialize(value: nil,
@@ -104,6 +109,7 @@ module FacebookAds
104
109
  num_items: nil,
105
110
  status: nil,
106
111
  search_string: nil,
112
+ delivery_category: nil,
107
113
  item_number: nil,
108
114
  custom_properties: {})
109
115
 
@@ -143,6 +149,9 @@ module FacebookAds
143
149
  unless search_string.nil?
144
150
  self.search_string = search_string
145
151
  end
152
+ unless delivery_category.nil?
153
+ self.delivery_category = delivery_category
154
+ end
146
155
  unless item_number.nil?
147
156
  self.item_number = item_number
148
157
  end
@@ -212,6 +221,10 @@ module FacebookAds
212
221
  self.search_string = attributes[:'search_string']
213
222
  end
214
223
 
224
+ if attributes.has_key?(:'delivery_category')
225
+ self.delivery_category = attributes[:'delivery_category']
226
+ end
227
+
215
228
  if attributes.has_key?(:'item_number')
216
229
  self.item_number = attributes[:'item_number']
217
230
  end
@@ -237,6 +250,7 @@ module FacebookAds
237
250
  num_items == o.num_items &&
238
251
  status == o.status &&
239
252
  search_string == o.search_string &&
253
+ delivery_category == o.delivery_category &&
240
254
  item_number == o.item_number &&
241
255
  custom_properties == o.custom_properties
242
256
  end
@@ -262,6 +276,7 @@ module FacebookAds
262
276
  num_items,
263
277
  status,
264
278
  search_string,
279
+ delivery_category,
265
280
  item_number,
266
281
  custom_properties
267
282
  ].hash
@@ -307,6 +322,9 @@ module FacebookAds
307
322
  unless search_string.nil?
308
323
  hash['search_string'] = search_string
309
324
  end
325
+ unless delivery_category.nil?
326
+ hash['delivery_category'] = delivery_category
327
+ end
310
328
  unless custom_properties.nil?
311
329
  hash['custom_properties'] = custom_properties
312
330
  end
@@ -354,6 +372,9 @@ module FacebookAds
354
372
  unless search_string.nil?
355
373
  hash['search_string'] = search_string
356
374
  end
375
+ unless delivery_category.nil?
376
+ hash['delivery_category'] = FacebookAds::ServerSide::Util.normalize(delivery_category, 'delivery_category')
377
+ end
357
378
  unless item_number.nil?
358
379
  hash['item_number'] = item_number
359
380
  end