facebookbusiness 0.3.0.5 → 0.3.0.6

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: e91ff37ccb6d70646660be95e1c09bc28ebd2257b0e544d4411a83d771e1a753
4
- data.tar.gz: 132720dc5722b1306f39e7ca4715f0765e487dffd79666fe49a05c9badbab42a
3
+ metadata.gz: 5aba6ca47d68ee3bb38ce991c6b5fe4f316fde73c0e47c5dae5bf4b5a5efa8a1
4
+ data.tar.gz: d74d528cbdfd2f10dab95e5a376daa7111a9fb42c25c42a6f8e0c6d2afaa2ff3
5
5
  SHA512:
6
- metadata.gz: a5e72ed8671f7235d39539e56bf19a15ea53efb5689b4aa8432bde6440187fa9a4748742907b683f8a054a8f5054f6a88c263701dcd76978ec3deefc3ea729c6
7
- data.tar.gz: 381a57e6f6af0115755801fba5e64b682cecdaab8e684915826128a39a432f6b183105af546fb97e044aea0b62cc6707de38e06a3438630bd66794818fe9a22c
6
+ metadata.gz: dd5c1e96cc267b35658423be8de4836ea25ee2ae8dd2118e5dbacd981ac9a43358f8f166d42cd7e283c0c8a1c6a07cada8780ae1b2a3187755cb5a1c004f8951
7
+ data.tar.gz: 4676476d0d56336172f4e5a570a449be949898fa16f2a5fbc35bf23ba0373062f0e158cf3522f2628a20415c0560a290ec13ccfa5354f401355b0bb0059bf20e
@@ -125,7 +125,7 @@ module FacebookAds
125
125
  "SMB_RELIGIOUS",
126
126
  "SMB_RENTALS",
127
127
  "SMB_REPAIR_AND_MAINTENANCE",
128
- "SMB_WIRELINE_SERVICES",
128
+ "OTHER_WIRELINE_SERVICES",
129
129
  "SOFTWARE",
130
130
  "SPORTING",
131
131
  "SPORTS",
@@ -200,6 +200,7 @@ module FacebookAds
200
200
  field :is_under_authorization, 'bool'
201
201
  field :official_website_url, 'string'
202
202
  field :planning_agency_business, 'Business'
203
+ field :planning_agency_business_id, 'string'
203
204
  field :promotable_app_ids, { list: 'string' }
204
205
  field :promotable_page_ids, { list: 'string' }
205
206
  field :promotable_urls, { list: 'string' }
@@ -210,7 +211,6 @@ module FacebookAds
210
211
  field :vertical, 'string'
211
212
  field :advertiser_business_id, 'string'
212
213
  field :business_registration, 'file'
213
- field :planning_agency_business_id, 'string'
214
214
  field :promotable_page_urls, { list: 'object' }
215
215
 
216
216
  end
@@ -31,7 +31,6 @@ module FacebookAds
31
31
  field :name, 'string'
32
32
  field :permissions, { list: 'int' }
33
33
  field :role, 'int'
34
- field :roles, { list: 'string' }
35
34
  has_no_get
36
35
  has_no_post
37
36
  has_no_delete
@@ -72,6 +72,7 @@ module FacebookAds
72
72
  "update_ad_bid_info",
73
73
  "update_ad_bid_type",
74
74
  "update_ad_run_status",
75
+ "update_ad_run_status_to_be_set_after_review",
75
76
  "update_ad_friendly_name",
76
77
  "update_ad_targets_spec",
77
78
  "update_adgroup_stop_delivery",
@@ -38,6 +38,7 @@ module FacebookAds
38
38
  "COMPLETE_REGISTRATION",
39
39
  "CONTENT_VIEW",
40
40
  "SEARCH",
41
+ "SERVICE_BOOKING_REQUEST",
41
42
  "MESSAGING_CONVERSATION_STARTED_7D",
42
43
  "LEVEL_ACHIEVED",
43
44
  "ACHIEVEMENT_UNLOCKED",
@@ -47,10 +48,12 @@ module FacebookAds
47
48
 
48
49
 
49
50
  field :application_id, 'string'
51
+ field :custom_conversion_id, 'string'
50
52
  field :custom_event_type, { enum: -> { CUSTOM_EVENT_TYPE }}
51
53
  field :event_id, 'string'
52
54
  field :object_store_url, 'string'
53
55
  field :offer_id, 'string'
56
+ field :offline_conversion_data_set_id, 'string'
54
57
  field :page_id, 'string'
55
58
  field :pixel_id, 'string'
56
59
  field :place_page_set_id, 'string'
@@ -83,7 +83,7 @@ module FacebookAds
83
83
 
84
84
 
85
85
  field :block_offline_analytics, 'bool'
86
- field :created_by, 'User'
86
+ field :created_by, 'object'
87
87
  field :created_time, 'datetime'
88
88
  field :id, 'string'
89
89
  field :link, 'string'
@@ -93,7 +93,7 @@ module FacebookAds
93
93
  field :profile_picture_uri, 'string'
94
94
  field :timezone_id, 'int'
95
95
  field :two_factor_type, 'string'
96
- field :updated_by, 'User'
96
+ field :updated_by, 'object'
97
97
  field :updated_time, 'datetime'
98
98
  field :vertical, 'string'
99
99
  has_no_post
@@ -130,6 +130,7 @@ module FacebookAds
130
130
  api.has_param :end_advertiser, 'object'
131
131
  api.has_param :funding_id, 'string'
132
132
  api.has_param :invoice, 'bool'
133
+ api.has_param :invoice_group_id, 'object'
133
134
  api.has_param :io, 'bool'
134
135
  api.has_param :liable_address_id, 'object'
135
136
  api.has_param :media_agency, 'string'
@@ -283,10 +284,6 @@ module FacebookAds
283
284
  end
284
285
  end
285
286
 
286
- has_edge :client_businesses do |edge|
287
- edge.get 'Business'
288
- end
289
-
290
287
  has_edge :client_pages do |edge|
291
288
  edge.get 'Page'
292
289
  end
@@ -29,7 +29,7 @@ module FacebookAds
29
29
 
30
30
  field :business, 'Business'
31
31
  field :created_time, 'datetime'
32
- field :creator, 'User'
32
+ field :creator, 'object'
33
33
  field :id, 'string'
34
34
  field :name, 'string'
35
35
  has_no_post
@@ -43,7 +43,7 @@ module FacebookAds
43
43
  ]
44
44
 
45
45
 
46
- field :created_by, 'User'
46
+ field :created_by, 'object'
47
47
  field :created_time, 'datetime'
48
48
  field :email, 'string'
49
49
  field :expiration_time, 'datetime'
@@ -54,7 +54,7 @@ module FacebookAds
54
54
  field :owner, 'Business'
55
55
  field :role, 'string'
56
56
  field :status, 'string'
57
- field :updated_by, 'User'
57
+ field :updated_by, 'object'
58
58
  field :updated_time, 'datetime'
59
59
 
60
60
  end
@@ -136,6 +136,15 @@ module FacebookAds
136
136
  field :parent_audience_id, 'int'
137
137
  field :tags, { list: 'string' }
138
138
 
139
+ has_edge :ad_accounts do |edge|
140
+ edge.post 'AdAccount' do |api|
141
+ api.has_param :adaccounts, { list: 'string' }
142
+ api.has_param :permissions, 'string'
143
+ api.has_param :relationship_type, { list: 'string' }
144
+ api.has_param :replace, 'bool'
145
+ end
146
+ end
147
+
139
148
  has_edge :adaccounts do |edge|
140
149
  edge.delete do |api|
141
150
  api.has_param :adaccounts, { list: 'string' }
@@ -143,11 +152,6 @@ module FacebookAds
143
152
  edge.get 'AdAccount' do |api|
144
153
  api.has_param :permissions, 'string'
145
154
  end
146
- edge.post 'AdAccount' do |api|
147
- api.has_param :adaccounts, { list: 'string' }
148
- api.has_param :permissions, 'string'
149
- api.has_param :replace, 'bool'
150
- end
151
155
  end
152
156
 
153
157
  has_edge :ads do |edge|
@@ -71,9 +71,9 @@ module FacebookAds
71
71
 
72
72
  has_edge :activities do |edge|
73
73
  edge.get do |api|
74
- api.has_param :end_time, 'datetime'
74
+ api.has_param :end_time, 'object'
75
75
  api.has_param :event_type, { enum: %w{conversion_create conversion_delete conversion_update }}
76
- api.has_param :start_time, 'datetime'
76
+ api.has_param :start_time, 'object'
77
77
  end
78
78
  end
79
79
 
@@ -27,6 +27,7 @@ module FacebookAds
27
27
 
28
28
  class ExtendedCreditInvoiceGroup < AdObject
29
29
 
30
+ field :auto_enroll, 'bool'
30
31
  field :customer_po_number, 'string'
31
32
  field :email, 'object'
32
33
  field :emails, { list: 'string' }
@@ -736,7 +736,7 @@ module FacebookAds
736
736
 
737
737
  has_edge :locations do |edge|
738
738
  edge.delete do |api|
739
- api.has_param :location_page_id, 'int'
739
+ api.has_param :location_page_id, 'object'
740
740
  api.has_param :store_number, 'int'
741
741
  end
742
742
  edge.get 'Page'
@@ -779,7 +779,7 @@ module FacebookAds
779
779
  has_edge :messages do |edge|
780
780
  edge.post do |api|
781
781
  api.has_param :message, 'object'
782
- api.has_param :messaging_type, { enum: %w{RESPONSE UPDATE MESSAGE_TAG NON_PROMOTIONAL_SUBSCRIPTION }}
782
+ api.has_param :messaging_type, { enum: %w{RESPONSE UPDATE MESSAGE_TAG }}
783
783
  api.has_param :notification_type, { enum: %w{REGULAR SILENT_PUSH NO_PUSH }}
784
784
  api.has_param :persona_id, 'object'
785
785
  api.has_param :recipient, 'object'
@@ -1136,6 +1136,7 @@ module FacebookAds
1136
1136
  api.has_param :copyright_content_id, 'string'
1137
1137
  api.has_param :excluded_ownership_countries, { list: 'string' }
1138
1138
  api.has_param :excluded_ownership_segments, { list: 'object' }
1139
+ api.has_param :fingerprint_id, 'string'
1139
1140
  api.has_param :is_reference_disabled, 'bool'
1140
1141
  api.has_param :is_reference_video, 'bool'
1141
1142
  api.has_param :monitoring_type, { enum: -> { VideoCopyright::MONITORING_TYPE }}
@@ -109,7 +109,9 @@ module FacebookAds
109
109
  "SUBSCRIPTIONS",
110
110
  "NEWS_SUBSCRIPTIONS_PUBLISHER_TOOLS",
111
111
  "NEWS_SUBSCRIPTIONS_PUBLISHER_ASSET_MANAGEMENT",
112
+ "NEWS_SUBSCRIPTIONS_PUBLISHER_OFFER_MANAGEMENT",
112
113
  "QR_CODE",
114
+ "ORGANIC_PIXEL",
113
115
  "CREDIBILITY_INDICATORS",
114
116
  "ATTRIBUTIONS",
115
117
  "BROADCASTED_MESSAGES",
@@ -121,6 +123,8 @@ module FacebookAds
121
123
  "MONETIZED_VIDEOS",
122
124
  "AUDIO_RELEASES",
123
125
  "NEWS_STORYLINES",
126
+ "REGISTRATIONS",
127
+ "IA_REGIWALL_SETTINGS",
124
128
  ]
125
129
 
126
130
 
@@ -223,7 +223,7 @@ module FacebookAds
223
223
  has_edge :products do |edge|
224
224
  edge.get 'ProductItem' do |api|
225
225
  api.has_param :bulk_pagination, 'bool'
226
- api.has_param :filter, 'object'
226
+ api.has_param :return_only_approved_products, 'bool'
227
227
  end
228
228
  edge.post 'ProductItem' do |api|
229
229
  api.has_param :additional_image_urls, { list: 'string' }
@@ -50,6 +50,7 @@ module FacebookAds
50
50
  field :reference_file, 'object'
51
51
  field :reference_file_disabled, 'bool'
52
52
  field :reference_file_disabled_by_ops, 'bool'
53
+ field :reference_file_expired, 'bool'
53
54
  field :reference_owner_id, 'string'
54
55
  field :rule_ids, { list: 'VideoCopyrightRule' }
55
56
  field :whitelisted_ids, { list: 'string' }
@@ -32,28 +32,30 @@ module FacebookAds
32
32
 
33
33
  def execute
34
34
  return [] if operations.empty?
35
- api_response = APIRequest.new(:post, '', session: session, params: batch_args).execute_now
36
- self.last_api_response = api_response
37
- operations.zip(api_response.result).map do |req, res|
38
- next unless res
35
+ operations.each_slice(50) do |slice|
36
+ api_response = APIRequest.new(:post, '', session: session, params: batch_args(slice)).execute_now
37
+ self.last_api_response = api_response
38
+ slice.zip(api_response.result).map do |req, res|
39
+ next unless res
39
40
 
40
- begin
41
- req.create_response(
42
- res['code'],
43
- convert_headers_to_hash(res['headers']),
44
- res['body'])
45
- rescue APIError => e
46
- e
41
+ begin
42
+ req.create_response(
43
+ res['code'],
44
+ convert_headers_to_hash(res['headers']),
45
+ res['body'])
46
+ rescue APIError => e
47
+ e
48
+ end
47
49
  end
48
50
  end
49
51
  end
50
52
 
51
- def batch_args
52
- {batch: JSON.dump(operations_args)}.merge(files_args)
53
+ def batch_args(slice = operations)
54
+ {batch: JSON.dump(operations_args(slice))}.merge(files_args)
53
55
  end
54
56
 
55
- def operations_args
56
- operations.map do |api_req|
57
+ def operations_args(slice)
58
+ slice.map do |api_req|
57
59
  api_req.to_batch_params
58
60
  end
59
61
  end
@@ -79,7 +81,7 @@ module FacebookAds
79
81
  private
80
82
  def convert_headers_to_hash(headers)
81
83
  Faraday::Utils::Headers.new(
82
- Hash[headers.map {|h| [h['name'], h['value']]}]
84
+ Hash[headers.map {|h| [h['name'], h['value']]}]
83
85
  )
84
86
  end
85
87
  end
@@ -19,6 +19,6 @@
19
19
  # FB:AUTOGEN
20
20
 
21
21
  module FacebookAds
22
- VERSION = '0.3.0.5'
22
+ VERSION = '0.3.0.6'
23
23
  API_VERSION = '3.0'
24
24
  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: 0.3.0.5
4
+ version: 0.3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facebook
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-27 00:00:00.000000000 Z
11
+ date: 2018-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday