facebookbusiness 0.7.0.3 → 0.8.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/lib/facebook_ads/ad_objects/ad_account.rb +16 -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 +21 -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 +4 -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 +2 -0
  9. data/lib/facebook_ads/ad_objects/ad_creative.rb +3 -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 +3 -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 +10 -0
  20. data/lib/facebook_ads/ad_objects/adoptable_pet.rb +8 -0
  21. data/lib/facebook_ads/ad_objects/ads_insights.rb +1 -0
  22. data/lib/facebook_ads/ad_objects/ads_pixel.rb +4 -0
  23. data/lib/facebook_ads/ad_objects/application.rb +23 -0
  24. data/lib/facebook_ads/ad_objects/atlas_campaign.rb +1 -1
  25. data/lib/facebook_ads/ad_objects/automotive_model.rb +1 -0
  26. data/lib/facebook_ads/ad_objects/business.rb +58 -2
  27. data/lib/facebook_ads/ad_objects/business_asset_group.rb +1 -0
  28. data/lib/facebook_ads/ad_objects/business_role_request.rb +4 -0
  29. data/lib/facebook_ads/ad_objects/business_unit.rb +1 -1
  30. data/lib/facebook_ads/ad_objects/business_user.rb +4 -0
  31. data/lib/facebook_ads/ad_objects/campaign.rb +1 -0
  32. data/lib/facebook_ads/ad_objects/catalog_sub_vertical_list.rb +88 -0
  33. data/lib/facebook_ads/ad_objects/commerce_merchant_settings.rb +16 -19
  34. data/lib/facebook_ads/ad_objects/commerce_merchant_settings_setup_status.rb +1 -0
  35. data/lib/facebook_ads/ad_objects/commerce_order.rb +6 -0
  36. data/lib/facebook_ads/ad_objects/commerce_order_transaction_detail.rb +4 -0
  37. data/lib/facebook_ads/ad_objects/{work_meeting_link.rb → connections_targeting.rb} +3 -2
  38. data/lib/facebook_ads/ad_objects/{iterative_split_test_config.rb → cpas_advertiser_partnership_recommendation.rb} +9 -9
  39. data/lib/facebook_ads/ad_objects/{split_test_config.rb → cpas_collaboration_request.rb} +16 -7
  40. data/lib/facebook_ads/ad_objects/custom_audience_data_source.rb +1 -0
  41. data/lib/facebook_ads/ad_objects/da_check.rb +7 -0
  42. data/lib/facebook_ads/ad_objects/destination.rb +1 -0
  43. data/lib/facebook_ads/ad_objects/event.rb +1 -1
  44. data/lib/facebook_ads/ad_objects/extended_credit.rb +7 -0
  45. data/lib/facebook_ads/ad_objects/flight.rb +1 -0
  46. data/lib/facebook_ads/ad_objects/group.rb +7 -1
  47. data/lib/facebook_ads/ad_objects/home_listing.rb +1 -0
  48. data/lib/facebook_ads/ad_objects/hotel.rb +1 -0
  49. data/lib/facebook_ads/ad_objects/hotel_room.rb +1 -0
  50. data/lib/facebook_ads/ad_objects/life_event.rb +0 -4
  51. data/lib/facebook_ads/ad_objects/link.rb +6 -6
  52. data/lib/facebook_ads/ad_objects/live_video.rb +12 -16
  53. data/lib/facebook_ads/ad_objects/native_offer_view.rb +0 -1
  54. data/lib/facebook_ads/ad_objects/oracle_transaction.rb +0 -7
  55. data/lib/facebook_ads/ad_objects/page.rb +47 -70
  56. data/lib/facebook_ads/ad_objects/page_post.rb +2 -0
  57. data/lib/facebook_ads/ad_objects/photo.rb +6 -0
  58. data/lib/facebook_ads/ad_objects/playable_content.rb +1 -0
  59. data/lib/facebook_ads/ad_objects/post.rb +49 -2
  60. data/lib/facebook_ads/ad_objects/product_catalog.rb +42 -7
  61. data/lib/facebook_ads/ad_objects/product_feed.rb +31 -0
  62. data/lib/facebook_ads/ad_objects/product_group.rb +1 -0
  63. data/lib/facebook_ads/ad_objects/product_item.rb +3 -0
  64. data/lib/facebook_ads/ad_objects/product_set.rb +1 -0
  65. data/lib/facebook_ads/ad_objects/product_set_metadata.rb +1 -0
  66. data/lib/facebook_ads/ad_objects/publisher_block_list.rb +6 -0
  67. data/lib/facebook_ads/ad_objects/referral.rb +2 -0
  68. data/lib/facebook_ads/ad_objects/security_settings.rb +0 -1
  69. data/lib/facebook_ads/ad_objects/server_side/batch_processor.rb +73 -0
  70. data/lib/facebook_ads/ad_objects/server_side/custom_data.rb +21 -0
  71. data/lib/facebook_ads/ad_objects/{page_about_story.rb → server_side/delivery_category.rb} +10 -16
  72. data/lib/facebook_ads/ad_objects/server_side/event_request.rb +61 -14
  73. data/lib/facebook_ads/ad_objects/server_side/event_request_async.rb +43 -0
  74. data/lib/facebook_ads/ad_objects/{atlas_url.rb → server_side/http_method.rb} +7 -16
  75. data/lib/facebook_ads/ad_objects/server_side/http_service_interface.rb +33 -0
  76. data/lib/facebook_ads/ad_objects/server_side/http_util.rb +31 -0
  77. data/lib/facebook_ads/ad_objects/server_side/user_data.rb +20 -1
  78. data/lib/facebook_ads/ad_objects/server_side/util.rb +13 -0
  79. data/lib/facebook_ads/ad_objects/system_user.rb +4 -4
  80. data/lib/facebook_ads/ad_objects/targeting.rb +3 -3
  81. data/lib/facebook_ads/ad_objects/third_party_measurement_report_dataset.rb +0 -1
  82. data/lib/facebook_ads/ad_objects/unified_thread.rb +1 -0
  83. data/lib/facebook_ads/ad_objects/user.rb +27 -25
  84. data/lib/facebook_ads/ad_objects/vehicle.rb +2 -0
  85. data/lib/facebook_ads/ad_objects/vehicle_offer.rb +1 -0
  86. data/lib/facebook_ads/ad_objects/whats_app_business_account.rb +25 -0
  87. data/lib/facebook_ads/errors.rb +1 -1
  88. data/lib/facebook_ads/session.rb +1 -1
  89. data/lib/facebook_ads/version.rb +2 -2
  90. metadata +30 -12
  91. data/lib/facebook_ads/ad_objects/user_taggable_friend.rb +0 -50
@@ -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
@@ -16,24 +16,18 @@
16
16
  # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
17
17
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
18
 
19
- # FB:AUTOGEN
20
-
21
19
  module FacebookAds
22
- # This class is auto-generated.
23
-
24
- # For any issues or feature requests related to this class, please let us know
25
- # on github and we'll fix in our codegen framework. We'll not be able to accept
26
- # pull request for this class.
20
+ module ServerSide
21
+ DeliveryCategory = Set[
27
22
 
28
- class PageAboutStory < AdObject
23
+ # Customer needs to enter the store to get the purchased product.
24
+ 'in_store',
29
25
 
30
- field :composed_text, { list: 'object' }
31
- field :cover_photo, 'Photo'
32
- field :entity_map, { list: 'object' }
33
- field :id, 'string'
34
- field :is_published, 'bool'
35
- field :page_id, 'string'
36
- field :title, 'string'
26
+ # Customer picks up their order by driving to a store and waiting inside their vehicle.
27
+ 'curbside',
37
28
 
38
- end
29
+ # Purchase is delivered to the customer's home.
30
+ 'home_delivery'
31
+ ]
32
+ end
39
33
  end
@@ -51,6 +51,9 @@ module FacebookAds
51
51
  # The origin/source of data for the dataset to be uploaded.
52
52
  attr_accessor :upload_source
53
53
 
54
+ # The HttpServiceInterface client to use for executing the request.
55
+ attr_accessor :http_service_client
56
+
54
57
  # @param [String] pixel_id
55
58
  # @param [Array(FacebookAds::ServerSide::Event)] events
56
59
  # @param [String] test_event_code
@@ -59,8 +62,10 @@ module FacebookAds
59
62
  # @param [String] upload_id
60
63
  # @param [String] upload_tag
61
64
  # @param [String] upload_source
65
+ # @param [HttpServiceInterface] http_service_client
62
66
  def initialize(pixel_id: nil, events: nil, test_event_code: nil, partner_agent: nil,
63
- namespace_id: nil, upload_id: nil, upload_tag: nil, upload_source: nil)
67
+ namespace_id: nil, upload_id: nil, upload_tag: nil, upload_source: nil,
68
+ http_service_client: nil)
64
69
  unless pixel_id.nil?
65
70
  self.pixel_id = pixel_id
66
71
  end
@@ -85,6 +90,9 @@ module FacebookAds
85
90
  unless upload_source.nil?
86
91
  self.upload_source = upload_source
87
92
  end
93
+ unless http_service_client.nil?
94
+ self.http_service_client = http_service_client
95
+ end
88
96
  end
89
97
 
90
98
  # build the object using the input hash
@@ -128,6 +136,10 @@ module FacebookAds
128
136
  if attributes.has_key?(:'upload_source')
129
137
  self.upload_source = attributes[:'upload_source']
130
138
  end
139
+
140
+ if attributes.has_key?(:'http_service_client')
141
+ self.http_service_client = attributes[:'http_service_client']
142
+ end
131
143
  end
132
144
 
133
145
  # Execute request
@@ -135,19 +147,14 @@ module FacebookAds
135
147
  unless valid?
136
148
  raise list_invalid_properties
137
149
  end
138
- normalized_events = normalize
150
+
151
+ if http_service_client
152
+ return execute_with_client(http_service_client)
153
+ end
154
+ params = get_params()
155
+ params[:data] = normalize
139
156
  ads_pixel = FacebookAds::AdsPixel.get(pixel_id)
140
- response = ads_pixel.events.create(
141
- {
142
- data: normalized_events,
143
- test_event_code: test_event_code,
144
- partner_agent: partner_agent,
145
- namespace_id: namespace_id,
146
- upload_id: upload_id,
147
- upload_tag: upload_tag,
148
- upload_source: upload_source,
149
- }
150
- )
157
+ response = ads_pixel.events.create(params)
151
158
  json_response_object = JSON.parse(JSON.generate(response), object_class: OpenStruct)
152
159
  FacebookAds::ServerSide::EventResponse.new(
153
160
  events_received: json_response_object.events_received,
@@ -164,6 +171,44 @@ module FacebookAds
164
171
  normalized_events
165
172
  end
166
173
 
174
+ def get_params
175
+ params = {}
176
+ params[:test_event_code] = test_event_code unless test_event_code.nil?
177
+ params[:partner_agent] = partner_agent unless partner_agent.nil?
178
+ params[:namespace_id] = namespace_id unless namespace_id.nil?
179
+ params[:upload_id] = upload_id unless upload_id.nil?
180
+ params[:upload_tag] = upload_tag unless upload_tag.nil?
181
+ params[:upload_source] = upload_source unless upload_source.nil?
182
+ params
183
+ end
184
+
185
+ def execute_with_client http_client
186
+ url = [
187
+ "https://#{FacebookAds::DEFAULT_HOST}",
188
+ FacebookAds::DEFAULT_API_VERSION,
189
+ pixel_id,
190
+ 'events',
191
+ ].join('/')
192
+ headers = {
193
+ 'User-Agent' => "fbbizsdk-ruby-v#{FacebookAds::VERSION}"
194
+ }
195
+ params = get_params
196
+ params[:data] = events.map(&:normalize)
197
+ appsecret = FacebookAds.config.app_secret
198
+ access_token = FacebookAds.config.access_token
199
+ params[:access_token] = access_token
200
+ if appsecret
201
+ params[:appsecret_proof] = FacebookAds::ServerSide::HttpUtil.appsecret_proof(appsecret, access_token)
202
+ end
203
+
204
+ http_client.execute(
205
+ url,
206
+ FacebookAds::ServerSide::HttpMethod::POST,
207
+ headers,
208
+ params
209
+ )
210
+ end
211
+
167
212
  # Show invalid properties with the reasons. Usually used together with valid?
168
213
  # @return Array for valid properties with the reasons
169
214
  def list_invalid_properties
@@ -193,7 +238,8 @@ module FacebookAds
193
238
  namespace_id == o.namespace_id &&
194
239
  upload_id == o.upload_id &&
195
240
  upload_tag == o.upload_tag &&
196
- upload_source == o.upload_source
241
+ upload_source == o.upload_source &&
242
+ http_service_client == o.http_service_client
197
243
  end
198
244
 
199
245
  # @see the `==` method
@@ -213,6 +259,7 @@ module FacebookAds
213
259
  upload_id,
214
260
  upload_tag,
215
261
  upload_source,
262
+ http_service_client,
216
263
  ].hash
217
264
  end
218
265
 
@@ -0,0 +1,43 @@
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
+ require 'concurrent'
20
+
21
+ module FacebookAds
22
+ module ServerSide
23
+ class EventRequestAsync < EventRequest
24
+ def execute
25
+ Concurrent::Promise.execute do
26
+ super
27
+ end
28
+ end
29
+
30
+ def clone_without_events
31
+ FacebookAds::ServerSide::EventRequestAsync.new(
32
+ pixel_id: pixel_id,
33
+ test_event_code: test_event_code,
34
+ partner_agent: partner_agent,
35
+ namespace_id: namespace_id,
36
+ upload_id: upload_id,
37
+ upload_tag: upload_tag,
38
+ upload_source: upload_source,
39
+ )
40
+ end
41
+ end
42
+ end
43
+ end
@@ -16,22 +16,13 @@
16
16
  # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
17
17
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
18
 
19
- # FB:AUTOGEN
20
-
21
19
  module FacebookAds
22
- # This class is auto-generated.
23
-
24
- # For any issues or feature requests related to this class, please let us know
25
- # on github and we'll fix in our codegen framework. We'll not be able to accept
26
- # pull request for this class.
27
-
28
- class AtlasUrl < AdObject
29
-
30
- field :url, 'string'
31
- has_no_id
32
- has_no_get
33
- has_no_post
34
- has_no_delete
35
-
20
+ module ServerSide
21
+ class HttpMethod
22
+ POST = 'POST'
23
+ PUT = 'PUT'
24
+ GET = 'GET'
25
+ DELETE = 'DELETE'
26
+ end
36
27
  end
37
28
  end
@@ -0,0 +1,33 @@
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
+
20
+ module FacebookAds
21
+ module ServerSide
22
+ class HttpServiceInterface
23
+
24
+ # String url | The graph API endpoint that will be requested
25
+ # String request_method | The HTTP request method
26
+ # Hash headers | Contains HTTP request headers including User-Agent and Accept-Encoding
27
+ # Hash params | Contains request parameters including access_token, data, test_event_code, etc.
28
+ def execute(url, request_method, headers, params)
29
+ raise Exception.new("Method 'execute' not implemented")
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,31 @@
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
20
+ module ServerSide
21
+ class HttpUtil
22
+ def self.appsecret_proof(app_secret, access_token)
23
+ OpenSSL::HMAC.hexdigest(
24
+ OpenSSL::Digest.new('sha256'),
25
+ app_secret,
26
+ access_token
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
@@ -91,6 +91,9 @@ module FacebookAds
91
91
  # The subscription ID for the user in this transaction. This is similar to the order ID for an individual product.
92
92
  attr_accessor :subscription_id
93
93
 
94
+ # The lead ID for the user in this transaction. This ID is associated with a lead generated by Facebook's Lead Ads.
95
+ attr_accessor :lead_id
96
+
94
97
  # The first 5 letters of the first name.
95
98
  attr_accessor :f5first
96
99
 
@@ -126,6 +129,7 @@ module FacebookAds
126
129
  # @param [String] fbc
127
130
  # @param [String] fbp
128
131
  # @param [String] subscription_id
132
+ # @param [String] lead_id
129
133
  # @param [String] f5first
130
134
  # @param [String] f5last
131
135
  # @param [String] fi
@@ -135,7 +139,7 @@ module FacebookAds
135
139
  def initialize(email: nil, phone: nil, gender: nil, date_of_birth: nil,
136
140
  last_name: nil, first_name: nil, city: nil, state: nil,
137
141
  country_code: nil, zip_code: nil, external_id: nil, client_ip_address: nil,
138
- client_user_agent: nil, fbc: nil, fbp: nil, subscription_id: nil,
142
+ client_user_agent: nil, fbc: nil, fbp: nil, subscription_id: nil, lead_id: nil,
139
143
  f5first: nil, f5last: nil, fi: nil, dobd: nil, dobm: nil, doby: nil)
140
144
  unless email.nil?
141
145
  self.email = email
@@ -185,6 +189,9 @@ module FacebookAds
185
189
  unless subscription_id.nil?
186
190
  self.subscription_id = subscription_id
187
191
  end
192
+ unless lead_id.nil?
193
+ self.lead_id = lead_id
194
+ end
188
195
  unless f5first.nil?
189
196
  self.f5first = f5first
190
197
  end
@@ -273,6 +280,10 @@ module FacebookAds
273
280
  self.fbp = attributes[:'fbp']
274
281
  end
275
282
 
283
+ if attributes.has_key?(:'lead_id')
284
+ self.lead_id = attributes[:'lead_id']
285
+ end
286
+
276
287
  if attributes.has_key?(:'f5first')
277
288
  self.f5first = attributes[:'f5first']
278
289
  end
@@ -318,6 +329,7 @@ module FacebookAds
318
329
  fbc == o.fbc &&
319
330
  fbp == o.fbp &&
320
331
  subscription_id == o.subscription_id &&
332
+ lead_id == o.lead_id &&
321
333
  f5first == o.f5first &&
322
334
  f5last == o.f5last &&
323
335
  fi == o.fi &&
@@ -351,6 +363,7 @@ module FacebookAds
351
363
  fbc,
352
364
  fbp,
353
365
  subscription_id,
366
+ lead_id,
354
367
  f5first,
355
368
  f5last,
356
369
  fi,
@@ -413,6 +426,9 @@ module FacebookAds
413
426
  unless subscription_id.nil?
414
427
  hash['subscription_id'] = subscription_id
415
428
  end
429
+ unless lead_id.nil?
430
+ hash['lead_id'] = lead_id
431
+ end
416
432
  unless f5first.nil?
417
433
  hash['f5first'] = f5first
418
434
  end
@@ -486,6 +502,9 @@ module FacebookAds
486
502
  unless subscription_id.nil?
487
503
  hash['subscription_id'] = subscription_id
488
504
  end
505
+ unless lead_id.nil?
506
+ hash['lead_id'] = lead_id
507
+ end
489
508
  unless f5first.nil?
490
509
  hash['f5first'] = FacebookAds::ServerSide::Util.normalize(f5first, 'f5first')
491
510
  end