facebookbusiness 0.9.0.0 → 0.9.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37ca4f8749f72bc1cd7eba12b4bcd07c4d4621e95efd3f028e21982037c378e7
|
4
|
+
data.tar.gz: e532f62cf2f842d6a18bc3916aa07bd3799fa4ca2979df9ea3e8362168893cb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fb8c27d58ddd9e18a5304adb7ce70031e3e5d1c8c0c3c0d8f09dbf1cd84a6e8a33ea45e2d9c8bc5191bc2fe4b389ecaab36b090855252cbe3e2b95bc66256ac
|
7
|
+
data.tar.gz: 3985f549327ac4d822b6614f6555815f0586ebfae93d2657c42919bf4a04ccd11d5eed5040491b436bee186cf279d76af96f87b2e3618349ecf0ba39ec5c7210
|
@@ -0,0 +1,48 @@
|
|
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
|
+
ActionSource = Set[
|
22
|
+
|
23
|
+
# Conversion happened over email.
|
24
|
+
'email',
|
25
|
+
|
26
|
+
# Conversion was made on your website.
|
27
|
+
'website',
|
28
|
+
|
29
|
+
# Conversion was made using your app.
|
30
|
+
'app',
|
31
|
+
|
32
|
+
# Conversion was made over the phone.
|
33
|
+
'phone_call',
|
34
|
+
|
35
|
+
# Conversion was made via a messaging app, SMS, or online messaging feature.
|
36
|
+
'chat',
|
37
|
+
|
38
|
+
# Conversion was made in person at your physical store.
|
39
|
+
'physical_store',
|
40
|
+
|
41
|
+
# Conversion happened automatically, for example, a subscription renewal that's set on auto-pay each month.
|
42
|
+
'system_generated',
|
43
|
+
|
44
|
+
# Conversion happened in a way that is not listed.
|
45
|
+
'other'
|
46
|
+
]
|
47
|
+
end
|
48
|
+
end
|
@@ -64,6 +64,9 @@ module FacebookAds
|
|
64
64
|
# For more details see https://developers.facebook.com/docs/marketing-apis/data-processing-options
|
65
65
|
attr_accessor :data_processing_options_state
|
66
66
|
|
67
|
+
# Where the conversion occurred.
|
68
|
+
attr_accessor :action_source
|
69
|
+
|
67
70
|
# @param [String] event_name
|
68
71
|
# @param [int] event_time
|
69
72
|
# @param [String] event_source_url
|
@@ -74,6 +77,7 @@ module FacebookAds
|
|
74
77
|
# @param [Array<String>] data_processing_options
|
75
78
|
# @param [int] data_processing_options_country
|
76
79
|
# @param [int] data_processing_options_state
|
80
|
+
# @param String action_source
|
77
81
|
def initialize(event_name: nil,
|
78
82
|
event_time: nil,
|
79
83
|
event_source_url: nil,
|
@@ -83,7 +87,8 @@ module FacebookAds
|
|
83
87
|
custom_data: nil,
|
84
88
|
data_processing_options: nil,
|
85
89
|
data_processing_options_country: nil,
|
86
|
-
data_processing_options_state: nil
|
90
|
+
data_processing_options_state: nil,
|
91
|
+
action_source: nil)
|
87
92
|
|
88
93
|
unless event_name.nil?
|
89
94
|
self.event_name = event_name
|
@@ -115,6 +120,9 @@ module FacebookAds
|
|
115
120
|
unless data_processing_options_state.nil?
|
116
121
|
self.data_processing_options_state = data_processing_options_state
|
117
122
|
end
|
123
|
+
unless action_source.nil?
|
124
|
+
self.action_source = action_source
|
125
|
+
end
|
118
126
|
end
|
119
127
|
|
120
128
|
# build the object using the input hash
|
@@ -154,15 +162,19 @@ module FacebookAds
|
|
154
162
|
end
|
155
163
|
|
156
164
|
if attributes.has_key?(:'data_processing_options')
|
157
|
-
self.
|
165
|
+
self.data_processing_options = attributes[:'data_processing_options']
|
158
166
|
end
|
159
167
|
|
160
168
|
if attributes.has_key?(:'data_processing_options_country')
|
161
|
-
self.
|
169
|
+
self.data_processing_options_country = attributes[:'data_processing_options_country']
|
162
170
|
end
|
163
171
|
|
164
172
|
if attributes.has_key?(:'data_processing_options_state')
|
165
|
-
self.
|
173
|
+
self.data_processing_options_state = attributes[:'data_processing_options_state']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.has_key?(:'action_source')
|
177
|
+
self.action_source = attributes[:'action_source']
|
166
178
|
end
|
167
179
|
end
|
168
180
|
|
@@ -207,7 +219,8 @@ module FacebookAds
|
|
207
219
|
custom_data == o.custom_data &&
|
208
220
|
data_processing_options == o.data_processing_options &&
|
209
221
|
data_processing_options_country == o.data_processing_options_country &&
|
210
|
-
data_processing_options_state == o.data_processing_options_state
|
222
|
+
data_processing_options_state == o.data_processing_options_state &&
|
223
|
+
action_source == o.action_source
|
211
224
|
end
|
212
225
|
|
213
226
|
# @see the `==` method
|
@@ -218,7 +231,11 @@ module FacebookAds
|
|
218
231
|
# Calculates hash code according to all attributes.
|
219
232
|
# @return [Fixnum] Hash code
|
220
233
|
def hash
|
221
|
-
[
|
234
|
+
[
|
235
|
+
event_name, event_time, event_source_url, opt_out, event_id, user_data, custom_data,
|
236
|
+
data_processing_options, data_processing_options_country, data_processing_options_state,
|
237
|
+
action_source,
|
238
|
+
].hash
|
222
239
|
end
|
223
240
|
|
224
241
|
def to_s
|
@@ -253,6 +270,9 @@ module FacebookAds
|
|
253
270
|
unless data_processing_options_state.nil?
|
254
271
|
hash['data_processing_options_state'] = data_processing_options_state.to_s
|
255
272
|
end
|
273
|
+
unless action_source.nil?
|
274
|
+
hash['action_source'] = action_source
|
275
|
+
end
|
256
276
|
hash.to_s
|
257
277
|
end
|
258
278
|
|
@@ -290,6 +310,12 @@ module FacebookAds
|
|
290
310
|
unless data_processing_options_state.nil?
|
291
311
|
hash['data_processing_options_state'] = data_processing_options_state
|
292
312
|
end
|
313
|
+
unless action_source.nil?
|
314
|
+
hash['action_source'] = FacebookAds::ServerSide::Util.normalize(
|
315
|
+
action_source,
|
316
|
+
'action_source'
|
317
|
+
)
|
318
|
+
end
|
293
319
|
hash
|
294
320
|
end
|
295
321
|
|
@@ -52,6 +52,8 @@ module FacebookAds
|
|
52
52
|
normalized_input = input;
|
53
53
|
|
54
54
|
case field_type
|
55
|
+
when 'action_source'
|
56
|
+
return normalize_action_source input
|
55
57
|
when 'country'
|
56
58
|
normalized_input = normalize_country input
|
57
59
|
when 'ct'
|
@@ -290,6 +292,17 @@ module FacebookAds
|
|
290
292
|
delivery_category;
|
291
293
|
end
|
292
294
|
|
295
|
+
# Normalizes the input action_source and returns valid value (or throw exception if invalid).
|
296
|
+
def self.normalize_action_source(action_source)
|
297
|
+
unless FacebookAds::ServerSide::ActionSource.include?(action_source)
|
298
|
+
values = FacebookAds::ServerSide::ActionSource.to_a.join(',')
|
299
|
+
raise ArgumentError.new(
|
300
|
+
"Invalid action_source passed: #{action_source}. Please use one of the defined values: #{values}"
|
301
|
+
)
|
302
|
+
end
|
303
|
+
|
304
|
+
action_source
|
305
|
+
end
|
293
306
|
end
|
294
307
|
end
|
295
308
|
end
|
data/lib/facebook_ads/version.rb
CHANGED
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: 0.9.0.
|
4
|
+
version: 0.9.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: 2020-
|
11
|
+
date: 2020-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -609,6 +609,7 @@ files:
|
|
609
609
|
- lib/facebook_ads/ad_objects/saved_audience.rb
|
610
610
|
- lib/facebook_ads/ad_objects/saved_message_response.rb
|
611
611
|
- lib/facebook_ads/ad_objects/security_settings.rb
|
612
|
+
- lib/facebook_ads/ad_objects/server_side/action_source.rb
|
612
613
|
- lib/facebook_ads/ad_objects/server_side/batch_processor.rb
|
613
614
|
- lib/facebook_ads/ad_objects/server_side/content.rb
|
614
615
|
- lib/facebook_ads/ad_objects/server_side/custom_data.rb
|
@@ -735,7 +736,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
735
736
|
- !ruby/object:Gem::Version
|
736
737
|
version: '0'
|
737
738
|
requirements: []
|
738
|
-
|
739
|
+
rubyforge_project:
|
740
|
+
rubygems_version: 2.7.6
|
739
741
|
signing_key:
|
740
742
|
specification_version: 4
|
741
743
|
summary: Facebook Business API SDK for Ruby (Official)
|