facebookbusiness 24.0.0 → 24.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d288f124a10cb9ca7a0f7d7b212bd1c4254edab43dd3ad429e8572c1304aa76
4
- data.tar.gz: e4df55422c3c5d4493ebe660600ee00732da844bad1ccce1bd03890f1a3993fb
3
+ metadata.gz: 8266c6de7b60110a6b278518eb923d5829356f42594bc597d87ab891ad817025
4
+ data.tar.gz: baa7bb60d36ea0ad26bab19e0da2fd850eeabd2bc7e95723705dc35f1a62b178
5
5
  SHA512:
6
- metadata.gz: 8f4138df50f2f995172932b9204cdf0c812acfc07bb35dd91ee33fdd11ba11e1d34cd57adb4727e04fae0cbfa680cf2ba2f46a526eb38461b1808a31cadb5029
7
- data.tar.gz: dd12ff024d8d3e09784ce4d41d3298579e0c60101e3f2b407a9721f58f7028b77f804ec89aef71168e28dbb73dda502ff37cc9f5446a1bec0ebd290510526186
6
+ metadata.gz: 346fc60212279d1e247f7fc73ef7cf70981b00f467bfcbbe93d021e55ac3bdf0ae10a63801672d82fcf6dde48fb206a736d336121c6a8199615de2d1c83361b7
7
+ data.tar.gz: 885b20b24884ff42591ccf5a264e99390ce3a2a79d1e0032f6e1af95785da39cb903101a2d0d5008165567d7e2ed778b15701d50397ecdd2fe6d966071cbe33a
@@ -16,6 +16,8 @@
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
+ require_relative './attribution_setting'
20
+
19
21
  module FacebookAds
20
22
  module ServerSide
21
23
 
@@ -58,6 +60,21 @@ module FacebookAds
58
60
  # The time when the touchpoint event occurred with the ad that the install was credited to.
59
61
  attr_accessor :touchpoint_ts
60
62
 
63
+ # The attribution method used to attribute the event.
64
+ attr_accessor :attribution_method
65
+
66
+ # The decline reason for the attribution.
67
+ attr_accessor :decline_reason
68
+
69
+ # The auditing token for the attribution.
70
+ attr_accessor :auditing_token
71
+
72
+ # The linkage key for the attribution.
73
+ attr_accessor :linkage_key
74
+
75
+ # The attribution setting for the attribution.
76
+ attr_accessor :attribution_setting
77
+
61
78
 
62
79
 
63
80
  # @param [String] scope
@@ -72,7 +89,12 @@ module FacebookAds
72
89
  # @param [String] attribution_source
73
90
  # @param [String] touchpoint_type
74
91
  # @param [Integer] touchpoint_ts
75
- def initialize(scope: nil, visit_time: nil, ad_id: nil, adset_id: nil, campaign_id: nil, attribution_share: nil, attribution_model: nil, attr_window: nil, attribution_value: nil, attribution_source: nil, touchpoint_type: nil, touchpoint_ts: nil)
92
+ # @param [String] attribution_method
93
+ # @param [String] decline_reason
94
+ # @param [String] auditing_token
95
+ # @param [String] linkage_key
96
+ # @param [FacebookAds::ServerSide::AttributionSetting] attribution_setting
97
+ def initialize(scope: nil, visit_time: nil, ad_id: nil, adset_id: nil, campaign_id: nil, attribution_share: nil, attribution_model: nil, attr_window: nil, attribution_value: nil, attribution_source: nil, touchpoint_type: nil, touchpoint_ts: nil, attribution_method: nil, decline_reason: nil, auditing_token: nil, linkage_key: nil, attribution_setting: nil)
76
98
  unless scope.nil?
77
99
  self.scope = scope
78
100
  end
@@ -109,6 +131,21 @@ module FacebookAds
109
131
  unless touchpoint_ts.nil?
110
132
  self.touchpoint_ts = touchpoint_ts
111
133
  end
134
+ unless attribution_method.nil?
135
+ self.attribution_method = attribution_method
136
+ end
137
+ unless decline_reason.nil?
138
+ self.decline_reason = decline_reason
139
+ end
140
+ unless auditing_token.nil?
141
+ self.auditing_token = auditing_token
142
+ end
143
+ unless linkage_key.nil?
144
+ self.linkage_key = linkage_key
145
+ end
146
+ unless attribution_setting.nil?
147
+ self.attribution_setting = attribution_setting
148
+ end
112
149
  end
113
150
 
114
151
  # build the object using the input hash
@@ -166,6 +203,26 @@ module FacebookAds
166
203
  if attributes.has_key?(:'touchpoint_ts')
167
204
  self.touchpoint_ts = attributes[:'touchpoint_ts']
168
205
  end
206
+
207
+ if attributes.has_key?(:'attribution_method')
208
+ self.attribution_method = attributes[:'attribution_method']
209
+ end
210
+
211
+ if attributes.has_key?(:'decline_reason')
212
+ self.decline_reason = attributes[:'decline_reason']
213
+ end
214
+
215
+ if attributes.has_key?(:'auditing_token')
216
+ self.auditing_token = attributes[:'auditing_token']
217
+ end
218
+
219
+ if attributes.has_key?(:'linkage_key')
220
+ self.linkage_key = attributes[:'linkage_key']
221
+ end
222
+
223
+ if attributes.has_key?(:'attribution_setting')
224
+ self.attribution_setting = attributes[:'attribution_setting']
225
+ end
169
226
  end
170
227
 
171
228
  # Checks equality by comparing each attribute.
@@ -183,7 +240,12 @@ module FacebookAds
183
240
  attribution_value == o.attribution_value &&
184
241
  attribution_source == o.attribution_source &&
185
242
  touchpoint_type == o.touchpoint_type &&
186
- touchpoint_ts == o.touchpoint_ts
243
+ touchpoint_ts == o.touchpoint_ts &&
244
+ attribution_method == o.attribution_method &&
245
+ decline_reason == o.decline_reason &&
246
+ auditing_token == o.auditing_token &&
247
+ linkage_key == o.linkage_key &&
248
+ attribution_setting == o.attribution_setting
187
249
  end
188
250
 
189
251
  # @see the `==` method
@@ -195,7 +257,7 @@ module FacebookAds
195
257
  # @return [Fixnum] Hash code
196
258
  def hash
197
259
  [
198
- scope, visit_time, ad_id, adset_id, campaign_id, attribution_share, attribution_model, attr_window, attribution_value, attribution_source, touchpoint_type, touchpoint_ts
260
+ scope, visit_time, ad_id, adset_id, campaign_id, attribution_share, attribution_model, attr_window, attribution_value, attribution_source, touchpoint_type, touchpoint_ts, attribution_method, decline_reason, auditing_token, linkage_key, attribution_setting
199
261
  ].hash
200
262
  end
201
263
 
@@ -237,6 +299,21 @@ module FacebookAds
237
299
  unless touchpoint_ts.nil?
238
300
  hash['touchpoint_ts'] = touchpoint_ts
239
301
  end
302
+ unless attribution_method.nil?
303
+ hash['attribution_method'] = attribution_method
304
+ end
305
+ unless decline_reason.nil?
306
+ hash['decline_reason'] = decline_reason
307
+ end
308
+ unless auditing_token.nil?
309
+ hash['auditing_token'] = auditing_token
310
+ end
311
+ unless linkage_key.nil?
312
+ hash['linkage_key'] = linkage_key
313
+ end
314
+ unless attribution_setting.nil?
315
+ hash['attribution_setting'] = attribution_setting
316
+ end
240
317
  hash.to_s
241
318
  end
242
319
 
@@ -280,6 +357,21 @@ module FacebookAds
280
357
  unless touchpoint_ts.nil?
281
358
  hash['touchpoint_ts'] = touchpoint_ts
282
359
  end
360
+ unless attribution_method.nil?
361
+ hash['attribution_method'] = FacebookAds::ServerSide::Util.normalize_attribution_method(attribution_method)
362
+ end
363
+ unless decline_reason.nil?
364
+ hash['decline_reason'] = FacebookAds::ServerSide::Util.normalize_decline_reason(decline_reason)
365
+ end
366
+ unless auditing_token.nil?
367
+ hash['auditing_token'] = auditing_token
368
+ end
369
+ unless linkage_key.nil?
370
+ hash['linkage_key'] = linkage_key
371
+ end
372
+ unless attribution_setting.nil?
373
+ hash['attribution_setting'] = attribution_setting.normalize
374
+ end
283
375
  hash
284
376
  end
285
377
 
@@ -0,0 +1,30 @@
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
+ AttributionMethod = Set[
22
+ 'ard',
23
+ 'deeplink',
24
+ 'gpir',
25
+ 'invalid_response',
26
+ 'mir',
27
+ 'srn'
28
+ ]
29
+ end
30
+ end
@@ -0,0 +1,107 @@
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
+
22
+ # AttributionSetting contains attribution window settings used for attribution.
23
+ class AttributionSetting
24
+
25
+ # Inactivity window in hours.
26
+ attr_accessor :inactivity_window_hours
27
+
28
+ # Reattribution window in hours.
29
+ attr_accessor :reattribution_window_hours
30
+
31
+
32
+ # @param [Integer] inactivity_window_hours
33
+ # @param [Integer] reattribution_window_hours
34
+ def initialize(inactivity_window_hours: nil, reattribution_window_hours: nil)
35
+ unless inactivity_window_hours.nil?
36
+ self.inactivity_window_hours = inactivity_window_hours
37
+ end
38
+ unless reattribution_window_hours.nil?
39
+ self.reattribution_window_hours = reattribution_window_hours
40
+ end
41
+ end
42
+
43
+ # build the object using the input hash
44
+ # @param [Hash] attributes attributes in the form of hash
45
+ def build(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ if attributes.has_key?(:'inactivity_window_hours')
52
+ self.inactivity_window_hours = attributes[:'inactivity_window_hours']
53
+ end
54
+
55
+ if attributes.has_key?(:'reattribution_window_hours')
56
+ self.reattribution_window_hours = attributes[:'reattribution_window_hours']
57
+ end
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ def ==(o)
62
+ return true if self.equal?(o)
63
+ self.class == o.class &&
64
+ inactivity_window_hours == o.inactivity_window_hours &&
65
+ reattribution_window_hours == o.reattribution_window_hours
66
+ end
67
+
68
+ # @see the `==` method
69
+ def eql?(o)
70
+ self == o
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Fixnum] Hash code
75
+ def hash
76
+ [
77
+ inactivity_window_hours, reattribution_window_hours
78
+ ].hash
79
+ end
80
+
81
+ def to_s
82
+ hash = {}
83
+ unless inactivity_window_hours.nil?
84
+ hash['inactivity_window_hours'] = inactivity_window_hours
85
+ end
86
+ unless reattribution_window_hours.nil?
87
+ hash['reattribution_window_hours'] = reattribution_window_hours
88
+ end
89
+ hash.to_s
90
+ end
91
+
92
+
93
+ # Normalize input fields to server request format.
94
+ def normalize
95
+ hash = {}
96
+ unless inactivity_window_hours.nil?
97
+ hash['inactivity_window_hours'] = inactivity_window_hours
98
+ end
99
+ unless reattribution_window_hours.nil?
100
+ hash['reattribution_window_hours'] = reattribution_window_hours
101
+ end
102
+ hash
103
+ end
104
+
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,39 @@
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
+ DeclineReason = Set[
22
+ 'attribute_to_other_source',
23
+ 'out_of_lookback_window',
24
+ 'view_through_disabled',
25
+ 'within_inactive_window',
26
+ 'inactive',
27
+ 'fraud_detected',
28
+ 'unknown',
29
+ 'reinstall_attribution_disabled',
30
+ 'lookback',
31
+ 'not_pmod_match',
32
+ 'validation_rule_detected',
33
+ 'preload_install',
34
+ 'min_time_between_re_engagements',
35
+ 'duplicated',
36
+ 'pmod_disabled'
37
+ ]
38
+ end
39
+ end
@@ -318,6 +318,30 @@ module FacebookAds
318
318
 
319
319
  action_source
320
320
  end
321
+
322
+ # Normalizes the input attribution_method and returns valid value (or throw exception if invalid).
323
+ def self.normalize_attribution_method(attribution_method)
324
+ unless FacebookAds::ServerSide::AttributionMethod.include?(attribution_method)
325
+ values = FacebookAds::ServerSide::AttributionMethod.to_a.join(',')
326
+ raise ArgumentError.new(
327
+ "Invalid attribution_method passed: #{attribution_method}. Please use one of the defined values: #{values}"
328
+ )
329
+ end
330
+
331
+ attribution_method
332
+ end
333
+
334
+ # Normalizes the input decline_reason and returns valid value (or throw exception if invalid).
335
+ def self.normalize_decline_reason(decline_reason)
336
+ unless FacebookAds::ServerSide::DeclineReason.include?(decline_reason)
337
+ values = FacebookAds::ServerSide::DeclineReason.to_a.join(',')
338
+ raise ArgumentError.new(
339
+ "Invalid decline_reason passed: #{decline_reason}. Please use one of the defined values: #{values}"
340
+ )
341
+ end
342
+
343
+ decline_reason
344
+ end
321
345
  end
322
346
  end
323
347
  end
@@ -7,6 +7,6 @@
7
7
  # FB:AUTOGEN
8
8
 
9
9
  module FacebookAds
10
- VERSION = '24.0.0'
10
+ VERSION = '24.0.1'
11
11
  API_VERSION = '24.0'
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebookbusiness
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.0.0
4
+ version: 24.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facebook
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-24 00:00:00.000000000 Z
11
+ date: 2025-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -1079,9 +1079,12 @@ files:
1079
1079
  - lib/facebook_ads/ad_objects/server_side/action_source.rb
1080
1080
  - lib/facebook_ads/ad_objects/server_side/app_data.rb
1081
1081
  - lib/facebook_ads/ad_objects/server_side/attribution_data.rb
1082
+ - lib/facebook_ads/ad_objects/server_side/attribution_method.rb
1083
+ - lib/facebook_ads/ad_objects/server_side/attribution_setting.rb
1082
1084
  - lib/facebook_ads/ad_objects/server_side/batch_processor.rb
1083
1085
  - lib/facebook_ads/ad_objects/server_side/content.rb
1084
1086
  - lib/facebook_ads/ad_objects/server_side/custom_data.rb
1087
+ - lib/facebook_ads/ad_objects/server_side/decline_reason.rb
1085
1088
  - lib/facebook_ads/ad_objects/server_side/delivery_category.rb
1086
1089
  - lib/facebook_ads/ad_objects/server_side/event.rb
1087
1090
  - lib/facebook_ads/ad_objects/server_side/event_request.rb