facebookbusiness 0.15.0.2 → 0.16.0.0

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: 682be241264d4bfdfe536f57817964f9bf01077e446b85d1240c224036cfc5d4
4
- data.tar.gz: 87bfe3812712820d50f68f399210bf11d9056a9ee0cabb96b0eae84da3b7728f
3
+ metadata.gz: ab556b892927ec0c49fe039c2f5d3583bb8a72d92424b73e431dd7f29ce357c9
4
+ data.tar.gz: d7a6d7ff350690498302d0e55238c42af4b7b36e6501b6826df20a91e7cac1d6
5
5
  SHA512:
6
- metadata.gz: ecef88b246cd6eea373b1cdd272a7602a88bc22d133c561c11d628679523ff8e5317b3a26ef4f2b201626085417b7b1f2c00175da3306b7f6fab8ea7f1dfb938
7
- data.tar.gz: '091c53d78cae3c71dc806bb87ccbc34cd50769b908a41547ebbfb18e92474fd4f7a97d5b03ee6ba4a136334ca95b82f14d037e5fc3f57aac81d7d98b9b177251'
6
+ metadata.gz: 0f66afb534cb6ca59e8785249ab986801df965ff845fb925b94173f628766c41a2d5d06259712dcc0035e4e2af5079fead24c49e3f70b492402938cc2ba102a7
7
+ data.tar.gz: aee3d13a547677556169948b09af6998356ecd51aa280d7d8c7a6e56d9191fd3961428c167ad82aca15a00ffdb3d0bee8db5e056ec3cff0d503d826a6dd015e7
@@ -137,6 +137,11 @@ module FacebookAds
137
137
  "WEBSITE",
138
138
  ]
139
139
 
140
+ ACTION_SOURCE = [
141
+ "PHYSICAL_STORE",
142
+ "WEBSITE",
143
+ ]
144
+
140
145
 
141
146
  field :account_id, 'string'
142
147
  field :account_status, 'int'
@@ -671,6 +676,12 @@ module FacebookAds
671
676
  end
672
677
  end
673
678
 
679
+ has_edge :businessprojects do |edge|
680
+ edge.get do |api|
681
+ api.has_param :business, 'string'
682
+ end
683
+ end
684
+
674
685
  has_edge :campaigns do |edge|
675
686
  edge.delete do |api|
676
687
  api.has_param :before_date, 'datetime'
@@ -48,10 +48,12 @@ module FacebookAds
48
48
  "FRAGMENTATION",
49
49
  "LEARNING_LIMITED",
50
50
  "LOW_OUTCOME",
51
+ "MMT_CAROUSEL_TO_VIDEO",
51
52
  "MULTI_TEXT",
52
53
  "MUSIC",
53
54
  "PREDICTIVE_CREATIVE_LIMITED",
54
55
  "REVERT",
56
+ "SEMANTIC_BASED_AUDIENCE_EXPANSION",
55
57
  "SIGNALS_GROWTH_CAPI",
56
58
  "SYD_TEST_MODE",
57
59
  "TOP_ADSETS_WITH_ADS_UNDER_CAP",
@@ -194,6 +194,7 @@ module FacebookAds
194
194
  field :billing_event, { enum: -> { BILLING_EVENT }}
195
195
  field :budget_remaining, 'string'
196
196
  field :campaign, 'Campaign'
197
+ field :campaign_attribution, 'string'
197
198
  field :campaign_id, 'string'
198
199
  field :configured_status, { enum: -> { CONFIGURED_STATUS }}
199
200
  field :created_time, 'datetime'
@@ -32,6 +32,7 @@ module FacebookAds
32
32
  "ADS_AI_GENERATED",
33
33
  "AD_BREAK_PREVIEW",
34
34
  "AD_DERIVATIVE",
35
+ "AD_LIBRARY_WATERMARK",
35
36
  "AGE_UP",
36
37
  "ALBUM_MULTIMEDIA_POST",
37
38
  "ALOHA_CALL_VIDEO",
@@ -113,6 +114,7 @@ module FacebookAds
113
114
  "LEGACY_CONTAINED_POST_BROADCAST",
114
115
  "LIVE_AUDIO_ROOM_BROADCAST",
115
116
  "LIVE_CLIP_PREVIEW",
117
+ "LIVE_CLIP_WORKCHAT",
116
118
  "LIVE_CREATIVE_KIT_VIDEO",
117
119
  "LIVE_PHOTO",
118
120
  "LOOK_NOW_DEPRECATED",
@@ -69,21 +69,47 @@ module FacebookAds
69
69
  field :automatic_matching_fields, { list: 'string' }
70
70
  field :can_proxy, 'bool'
71
71
  field :code, 'string'
72
+ field :config, 'string'
72
73
  field :creation_time, 'datetime'
73
74
  field :creator, 'User'
74
75
  field :data_use_setting, 'string'
76
+ field :description, 'string'
77
+ field :duplicate_entries, 'int'
78
+ field :enable_auto_assign_to_accounts, 'bool'
75
79
  field :enable_automatic_matching, 'bool'
80
+ field :event_stats, 'string'
81
+ field :event_time_max, 'int'
82
+ field :event_time_min, 'int'
76
83
  field :first_party_cookie_status, 'string'
77
84
  field :id, 'string'
85
+ field :is_consolidated_container, 'bool'
78
86
  field :is_created_by_business, 'bool'
79
87
  field :is_crm, 'bool'
88
+ field :is_mta_use, 'bool'
89
+ field :is_restricted_use, 'bool'
80
90
  field :is_unavailable, 'bool'
81
91
  field :last_fired_time, 'datetime'
92
+ field :last_upload_app, 'string'
93
+ field :last_upload_app_changed_time, 'int'
94
+ field :match_rate_approx, 'int'
95
+ field :matched_entries, 'int'
82
96
  field :name, 'string'
83
97
  field :owner_ad_account, 'AdAccount'
84
98
  field :owner_business, 'Business'
99
+ field :usage, 'OfflineConversionDataSetUsage'
100
+ field :valid_entries, 'int'
85
101
  has_no_delete
86
102
 
103
+ has_edge :adaccounts do |edge|
104
+ edge.get 'AdAccount' do |api|
105
+ api.has_param :business, 'string'
106
+ end
107
+ end
108
+
109
+ has_edge :agencies do |edge|
110
+ edge.get 'Business'
111
+ end
112
+
87
113
  has_edge :assigned_users do |edge|
88
114
  edge.get 'AssignedUser' do |api|
89
115
  api.has_param :business, 'string'
@@ -119,6 +145,16 @@ module FacebookAds
119
145
  edge.post
120
146
  end
121
147
 
148
+ has_edge :offline_event_uploads do |edge|
149
+ edge.get 'OfflineConversionDataSetUpload' do |api|
150
+ api.has_param :end_time, 'datetime'
151
+ api.has_param :order, { enum: -> { OfflineConversionDataSetUpload::ORDER }}
152
+ api.has_param :sort_by, { enum: -> { OfflineConversionDataSetUpload::SORT_BY }}
153
+ api.has_param :start_time, 'datetime'
154
+ api.has_param :upload_tag, 'string'
155
+ end
156
+ end
157
+
122
158
  has_edge :shadowtraffichelper do |edge|
123
159
  edge.post
124
160
  end
@@ -120,6 +120,11 @@ module FacebookAds
120
120
  "VIEW_MONETIZATION_INSIGHTS",
121
121
  ]
122
122
 
123
+ ACTION_SOURCE = [
124
+ "PHYSICAL_STORE",
125
+ "WEBSITE",
126
+ ]
127
+
123
128
 
124
129
  field :block_offline_analytics, 'bool'
125
130
  field :collaborative_ads_managed_partner_business_info, 'ManagedPartnerBusiness'
@@ -295,6 +300,10 @@ module FacebookAds
295
300
  end
296
301
  end
297
302
 
303
+ has_edge :businessprojects do |edge|
304
+ edge.get
305
+ end
306
+
298
307
  has_edge :claim_custom_conversions do |edge|
299
308
  edge.post 'CustomConversion' do |api|
300
309
  api.has_param :custom_conversion_id, 'string'
@@ -106,6 +106,7 @@ module FacebookAds
106
106
  field :owner, 'object'
107
107
  field :parent_group, 'Group'
108
108
  field :place, 'Place'
109
+ field :registration_setting, 'object'
109
110
  field :scheduled_publish_time, 'string'
110
111
  field :start_time, 'string'
111
112
  field :ticket_setting, 'object'
@@ -163,14 +163,6 @@ module FacebookAds
163
163
  edge.get 'Event'
164
164
  end
165
165
 
166
- has_edge :featured_cards do |edge|
167
- edge.get
168
- edge.post do |api|
169
- api.has_param :description, 'hash'
170
- api.has_param :title, 'hash'
171
- end
172
- end
173
-
174
166
  has_edge :feed do |edge|
175
167
  edge.get 'Post' do |api|
176
168
  api.has_param :include_hidden, 'bool'
@@ -117,6 +117,10 @@ module FacebookAds
117
117
  end
118
118
  end
119
119
 
120
+ has_edge :notification_message_tokens do |edge|
121
+ edge.get 'UserPageOneTimeOptInTokenSettings'
122
+ end
123
+
120
124
  has_edge :product_appeal do |edge|
121
125
  edge.get do |api|
122
126
  api.has_param :product_id, 'string'
@@ -42,6 +42,7 @@ module FacebookAds
42
42
  field :is_organic, 'bool'
43
43
  field :partner_name, 'string'
44
44
  field :platform, 'string'
45
+ field :post, 'Link'
45
46
  field :retailer_item_id, 'string'
46
47
  field :vehicle, 'Vehicle'
47
48
  has_no_post
@@ -41,25 +41,35 @@ module FacebookAds
41
41
  ]
42
42
 
43
43
 
44
+ field :automatic_matching_fields, { list: 'string' }
44
45
  field :business, 'Business'
46
+ field :can_proxy, 'bool'
45
47
  field :config, 'string'
46
48
  field :creation_time, 'datetime'
47
49
  field :creator, 'User'
50
+ field :data_use_setting, 'string'
48
51
  field :description, 'string'
49
52
  field :duplicate_entries, 'int'
50
53
  field :enable_auto_assign_to_accounts, 'bool'
54
+ field :enable_automatic_matching, 'bool'
51
55
  field :event_stats, 'string'
52
56
  field :event_time_max, 'int'
53
57
  field :event_time_min, 'int'
58
+ field :first_party_cookie_status, 'string'
54
59
  field :id, 'string'
60
+ field :is_consolidated_container, 'bool'
61
+ field :is_created_by_business, 'bool'
62
+ field :is_crm, 'bool'
55
63
  field :is_mta_use, 'bool'
56
64
  field :is_restricted_use, 'bool'
57
65
  field :is_unavailable, 'bool'
66
+ field :last_fired_time, 'datetime'
58
67
  field :last_upload_app, 'string'
59
68
  field :last_upload_app_changed_time, 'int'
60
69
  field :match_rate_approx, 'int'
61
70
  field :matched_entries, 'int'
62
71
  field :name, 'string'
72
+ field :owner_ad_account, 'AdAccount'
63
73
  field :owner_business, 'Business'
64
74
  field :usage, 'OfflineConversionDataSetUsage'
65
75
  field :valid_entries, 'int'
@@ -110,6 +120,23 @@ module FacebookAds
110
120
  end
111
121
  end
112
122
 
123
+ has_edge :server_events_permitted_business do |edge|
124
+ edge.get 'Business'
125
+ end
126
+
127
+ has_edge :shared_accounts do |edge|
128
+ edge.get 'AdAccount' do |api|
129
+ api.has_param :action_source, { enum: -> { AdAccount::ACTION_SOURCE }}
130
+ api.has_param :business, 'string'
131
+ end
132
+ end
133
+
134
+ has_edge :shared_agencies do |edge|
135
+ edge.get 'Business' do |api|
136
+ api.has_param :action_source, { enum: -> { Business::ACTION_SOURCE }}
137
+ end
138
+ end
139
+
113
140
  has_edge :stats do |edge|
114
141
  edge.get do |api|
115
142
  api.has_param :aggr_time, { enum: %w{event_time upload_time }}
@@ -617,6 +617,12 @@ module FacebookAds
617
617
  end
618
618
  end
619
619
 
620
+ has_edge :businessprojects do |edge|
621
+ edge.get do |api|
622
+ api.has_param :business, 'string'
623
+ end
624
+ end
625
+
620
626
  has_edge :call_to_actions do |edge|
621
627
  edge.get 'PageCallToAction'
622
628
  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
+ # Access token to use for AdObject Session
55
+ attr_accessor :access_token
56
+
54
57
  # The HttpServiceInterface client to use for executing the request.
55
58
  attr_accessor :http_service_client
56
59
 
@@ -62,10 +65,11 @@ module FacebookAds
62
65
  # @param [String] upload_id
63
66
  # @param [String] upload_tag
64
67
  # @param [String] upload_source
68
+ # @param [String] access_token
65
69
  # @param [HttpServiceInterface] http_service_client
66
70
  def initialize(pixel_id: nil, events: nil, test_event_code: nil, partner_agent: nil,
67
71
  namespace_id: nil, upload_id: nil, upload_tag: nil, upload_source: nil,
68
- http_service_client: nil)
72
+ access_token: nil, http_service_client: nil)
69
73
  unless pixel_id.nil?
70
74
  self.pixel_id = pixel_id
71
75
  end
@@ -90,6 +94,9 @@ module FacebookAds
90
94
  unless upload_source.nil?
91
95
  self.upload_source = upload_source
92
96
  end
97
+ unless access_token.nil?
98
+ self.access_token = access_token
99
+ end
93
100
  unless http_service_client.nil?
94
101
  self.http_service_client = http_service_client
95
102
  end
@@ -153,7 +160,8 @@ module FacebookAds
153
160
  end
154
161
  params = get_params()
155
162
  params[:data] = normalize
156
- ads_pixel = FacebookAds::AdsPixel.get(pixel_id)
163
+ session = FacebookAds::Session.new(access_token: access_token) if access_token
164
+ ads_pixel = FacebookAds::AdsPixel.get(pixel_id, session)
157
165
  response = ads_pixel.events.create(params)
158
166
  json_response_object = JSON.parse(JSON.generate(response), object_class: OpenStruct)
159
167
  FacebookAds::ServerSide::EventResponse.new(
@@ -99,6 +99,7 @@ module FacebookAds
99
99
  edge.delete
100
100
  edge.post 'User' do |api|
101
101
  api.has_param :business_app, 'int'
102
+ api.has_param :is_permanent_token, 'bool'
102
103
  api.has_param :page_id, 'string'
103
104
  api.has_param :scope, { list: 'Permission' }
104
105
  end
@@ -474,6 +475,7 @@ module FacebookAds
474
475
 
475
476
  has_edge :notifications do |edge|
476
477
  edge.post 'User' do |api|
478
+ api.has_param :bot_message_payload_elements, 'string'
477
479
  api.has_param :filtering, { list: { enum: -> { User::FILTERING }} }
478
480
  api.has_param :href, 'object'
479
481
  api.has_param :label, 'string'
@@ -28,6 +28,7 @@ module FacebookAds
28
28
  class UserPageOneTimeOptInTokenSettings < AdObject
29
29
 
30
30
  field :creation_timestamp, 'int'
31
+ field :next_eligible_time, 'int'
31
32
  field :notification_messages_frequency, 'string'
32
33
  field :notification_messages_reoptin, 'string'
33
34
  field :notification_messages_timezone, 'string'
@@ -137,7 +137,6 @@ module FacebookAds
137
137
  field :condition, 'string'
138
138
  field :currency, 'string'
139
139
  field :custom_label_0, 'string'
140
- field :custom_number_0, 'int'
141
140
  field :date_first_on_lot, 'string'
142
141
  field :dealer_communication_channel, 'string'
143
142
  field :dealer_email, 'string'
@@ -30,17 +30,17 @@ module FacebookAds
30
30
  "DEVELOP",
31
31
  "FULL_CONTROL",
32
32
  "MANAGE",
33
+ "MANAGE_EXTENSIONS",
33
34
  "MANAGE_PHONE",
34
35
  "MANAGE_TEMPLATES",
35
- "MANAGE_TEMPLATES_AND_PHONE",
36
36
  "MESSAGING",
37
37
  "VIEW_COST",
38
38
  ]
39
39
 
40
40
  CATEGORY = [
41
+ "AUTHENTICATION",
41
42
  "MARKETING",
42
- "OTP",
43
- "TRANSACTIONAL",
43
+ "UTILITY",
44
44
  ]
45
45
 
46
46
 
@@ -70,7 +70,7 @@ module FacebookAds
70
70
  end
71
71
 
72
72
  self.next_page_cursor = response.dig('paging', 'cursors', 'after')
73
- self.has_next_page = !(response['data'].length < fetch_options[:limit])
73
+ self.has_next_page = !!response.dig('paging', 'next')
74
74
  end
75
75
  end
76
76
 
@@ -77,7 +77,7 @@ module FacebookAds
77
77
  case value
78
78
  when String, File, Tempfile
79
79
  if value.is_a?(String)
80
- raise InvalidParameterError, "No such file: #{value}" unless File.exists?(value)
80
+ raise InvalidParameterError, "No such file: #{value}" unless File.exist?(value)
81
81
  value = File.new(value)
82
82
  end
83
83
 
@@ -114,7 +114,7 @@ module FacebookAds
114
114
  return true if value.is_a?(type)
115
115
  end
116
116
 
117
- value.is_a?(String) ? File.exists?(value) : false
117
+ value.is_a?(String) ? File.exist?(value) : false
118
118
  end
119
119
  end
120
120
  end
@@ -41,7 +41,7 @@ module FacebookAds
41
41
 
42
42
  def override_from!(filename = nil)
43
43
  filename ||= File.expand_path("../../../../tests/test_config.json", __FILE__)
44
- if File.exists?(filename)
44
+ if File.exist?(filename)
45
45
  settings = JSON.parse(File.read(filename))
46
46
 
47
47
  settings.each do |k,v|
@@ -52,4 +52,4 @@ module FacebookAds
52
52
  end
53
53
  end
54
54
  end
55
- end
55
+ end
@@ -19,6 +19,6 @@
19
19
  # FB:AUTOGEN
20
20
 
21
21
  module FacebookAds
22
- VERSION = '0.15.0.2'
23
- API_VERSION = '15.0'
22
+ VERSION = '0.16.0.0'
23
+ API_VERSION = '16.0'
24
24
  end
@@ -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 'faraday/multipart'
20
+
19
21
  module FacebookAds
20
22
  class VideoIO < ::UploadIO
21
23
  def is_video?
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.15.0.2
4
+ version: 0.16.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facebook
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-18 00:00:00.000000000 Z
11
+ date: 2023-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -26,6 +26,20 @@ dependencies:
26
26
  version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.6'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday-multipart
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
@@ -44,28 +58,34 @@ dependencies:
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '2.2'
61
+ version: '2.6'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '2.2'
68
+ version: '2.6'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: countries
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '3'
76
+ - - "<"
60
77
  - !ruby/object:Gem::Version
61
- version: '3.0'
78
+ version: '6'
62
79
  type: :runtime
63
80
  prerelease: false
64
81
  version_requirements: !ruby/object:Gem::Requirement
65
82
  requirements:
66
- - - "~>"
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '3'
86
+ - - "<"
67
87
  - !ruby/object:Gem::Version
68
- version: '3.0'
88
+ version: '6'
69
89
  - !ruby/object:Gem::Dependency
70
90
  name: money
71
91
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +120,14 @@ dependencies:
100
120
  requirements:
101
121
  - - "~>"
102
122
  - !ruby/object:Gem::Version
103
- version: '1.17'
123
+ version: '2.2'
104
124
  type: :development
105
125
  prerelease: false
106
126
  version_requirements: !ruby/object:Gem::Requirement
107
127
  requirements:
108
128
  - - "~>"
109
129
  - !ruby/object:Gem::Version
110
- version: '1.17'
130
+ version: '2.2'
111
131
  - !ruby/object:Gem::Dependency
112
132
  name: byebug
113
133
  requirement: !ruby/object:Gem::Requirement
@@ -220,34 +240,6 @@ dependencies:
220
240
  - - "~>"
221
241
  - !ruby/object:Gem::Version
222
242
  version: '0.71'
223
- - !ruby/object:Gem::Dependency
224
- name: countries
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - "~>"
228
- - !ruby/object:Gem::Version
229
- version: '3.0'
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - "~>"
235
- - !ruby/object:Gem::Version
236
- version: '3.0'
237
- - !ruby/object:Gem::Dependency
238
- name: money
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - "~>"
242
- - !ruby/object:Gem::Version
243
- version: '6.13'
244
- type: :development
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - "~>"
249
- - !ruby/object:Gem::Version
250
- version: '6.13'
251
243
  description: |2
252
244
  The official Facebook Business API SDK for Ruby.
253
245
  https://developers.facebook.com/docs/marketing-api/sdks'
@@ -745,9 +737,9 @@ require_paths:
745
737
  - lib
746
738
  required_ruby_version: !ruby/object:Gem::Requirement
747
739
  requirements:
748
- - - ">"
740
+ - - ">="
749
741
  - !ruby/object:Gem::Version
750
- version: '2.4'
742
+ version: '3.0'
751
743
  required_rubygems_version: !ruby/object:Gem::Requirement
752
744
  requirements:
753
745
  - - ">="