airbyte-agent-facebook-marketing 0.1.0__py3-none-any.whl

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.
Files changed (57) hide show
  1. airbyte_agent_facebook_marketing/__init__.py +221 -0
  2. airbyte_agent_facebook_marketing/_vendored/__init__.py +1 -0
  3. airbyte_agent_facebook_marketing/_vendored/connector_sdk/__init__.py +82 -0
  4. airbyte_agent_facebook_marketing/_vendored/connector_sdk/auth_strategies.py +1171 -0
  5. airbyte_agent_facebook_marketing/_vendored/connector_sdk/auth_template.py +135 -0
  6. airbyte_agent_facebook_marketing/_vendored/connector_sdk/cloud_utils/__init__.py +5 -0
  7. airbyte_agent_facebook_marketing/_vendored/connector_sdk/cloud_utils/client.py +213 -0
  8. airbyte_agent_facebook_marketing/_vendored/connector_sdk/connector_model_loader.py +1120 -0
  9. airbyte_agent_facebook_marketing/_vendored/connector_sdk/constants.py +78 -0
  10. airbyte_agent_facebook_marketing/_vendored/connector_sdk/exceptions.py +23 -0
  11. airbyte_agent_facebook_marketing/_vendored/connector_sdk/executor/__init__.py +31 -0
  12. airbyte_agent_facebook_marketing/_vendored/connector_sdk/executor/hosted_executor.py +201 -0
  13. airbyte_agent_facebook_marketing/_vendored/connector_sdk/executor/local_executor.py +1854 -0
  14. airbyte_agent_facebook_marketing/_vendored/connector_sdk/executor/models.py +202 -0
  15. airbyte_agent_facebook_marketing/_vendored/connector_sdk/extensions.py +693 -0
  16. airbyte_agent_facebook_marketing/_vendored/connector_sdk/http/__init__.py +37 -0
  17. airbyte_agent_facebook_marketing/_vendored/connector_sdk/http/adapters/__init__.py +9 -0
  18. airbyte_agent_facebook_marketing/_vendored/connector_sdk/http/adapters/httpx_adapter.py +251 -0
  19. airbyte_agent_facebook_marketing/_vendored/connector_sdk/http/config.py +98 -0
  20. airbyte_agent_facebook_marketing/_vendored/connector_sdk/http/exceptions.py +119 -0
  21. airbyte_agent_facebook_marketing/_vendored/connector_sdk/http/protocols.py +114 -0
  22. airbyte_agent_facebook_marketing/_vendored/connector_sdk/http/response.py +104 -0
  23. airbyte_agent_facebook_marketing/_vendored/connector_sdk/http_client.py +693 -0
  24. airbyte_agent_facebook_marketing/_vendored/connector_sdk/introspection.py +481 -0
  25. airbyte_agent_facebook_marketing/_vendored/connector_sdk/logging/__init__.py +11 -0
  26. airbyte_agent_facebook_marketing/_vendored/connector_sdk/logging/logger.py +273 -0
  27. airbyte_agent_facebook_marketing/_vendored/connector_sdk/logging/types.py +93 -0
  28. airbyte_agent_facebook_marketing/_vendored/connector_sdk/observability/__init__.py +11 -0
  29. airbyte_agent_facebook_marketing/_vendored/connector_sdk/observability/config.py +179 -0
  30. airbyte_agent_facebook_marketing/_vendored/connector_sdk/observability/models.py +19 -0
  31. airbyte_agent_facebook_marketing/_vendored/connector_sdk/observability/redactor.py +81 -0
  32. airbyte_agent_facebook_marketing/_vendored/connector_sdk/observability/session.py +103 -0
  33. airbyte_agent_facebook_marketing/_vendored/connector_sdk/performance/__init__.py +6 -0
  34. airbyte_agent_facebook_marketing/_vendored/connector_sdk/performance/instrumentation.py +57 -0
  35. airbyte_agent_facebook_marketing/_vendored/connector_sdk/performance/metrics.py +93 -0
  36. airbyte_agent_facebook_marketing/_vendored/connector_sdk/schema/__init__.py +75 -0
  37. airbyte_agent_facebook_marketing/_vendored/connector_sdk/schema/base.py +201 -0
  38. airbyte_agent_facebook_marketing/_vendored/connector_sdk/schema/components.py +244 -0
  39. airbyte_agent_facebook_marketing/_vendored/connector_sdk/schema/connector.py +120 -0
  40. airbyte_agent_facebook_marketing/_vendored/connector_sdk/schema/extensions.py +301 -0
  41. airbyte_agent_facebook_marketing/_vendored/connector_sdk/schema/operations.py +156 -0
  42. airbyte_agent_facebook_marketing/_vendored/connector_sdk/schema/security.py +236 -0
  43. airbyte_agent_facebook_marketing/_vendored/connector_sdk/secrets.py +182 -0
  44. airbyte_agent_facebook_marketing/_vendored/connector_sdk/telemetry/__init__.py +10 -0
  45. airbyte_agent_facebook_marketing/_vendored/connector_sdk/telemetry/config.py +32 -0
  46. airbyte_agent_facebook_marketing/_vendored/connector_sdk/telemetry/events.py +59 -0
  47. airbyte_agent_facebook_marketing/_vendored/connector_sdk/telemetry/tracker.py +155 -0
  48. airbyte_agent_facebook_marketing/_vendored/connector_sdk/types.py +270 -0
  49. airbyte_agent_facebook_marketing/_vendored/connector_sdk/utils.py +60 -0
  50. airbyte_agent_facebook_marketing/_vendored/connector_sdk/validation.py +848 -0
  51. airbyte_agent_facebook_marketing/connector.py +1553 -0
  52. airbyte_agent_facebook_marketing/connector_model.py +3120 -0
  53. airbyte_agent_facebook_marketing/models.py +814 -0
  54. airbyte_agent_facebook_marketing/types.py +1957 -0
  55. airbyte_agent_facebook_marketing-0.1.0.dist-info/METADATA +148 -0
  56. airbyte_agent_facebook_marketing-0.1.0.dist-info/RECORD +57 -0
  57. airbyte_agent_facebook_marketing-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,3120 @@
1
+ """
2
+ Connector model for facebook-marketing.
3
+
4
+ This file is auto-generated from the connector definition at build time.
5
+ DO NOT EDIT MANUALLY - changes will be overwritten on next generation.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from ._vendored.connector_sdk.types import (
11
+ Action,
12
+ AuthConfig,
13
+ AuthType,
14
+ ConnectorModel,
15
+ EndpointDefinition,
16
+ EntityDefinition,
17
+ )
18
+ from ._vendored.connector_sdk.schema.security import (
19
+ AirbyteAuthConfig,
20
+ AuthConfigFieldSpec,
21
+ )
22
+ from uuid import (
23
+ UUID,
24
+ )
25
+
26
+ FacebookMarketingConnectorModel: ConnectorModel = ConnectorModel(
27
+ id=UUID('e7778cfc-e97c-4458-9ecb-b4f2bba8946c'),
28
+ name='facebook-marketing',
29
+ version='1.0.1',
30
+ base_url='https://graph.facebook.com/v24.0',
31
+ auth=AuthConfig(
32
+ type=AuthType.BEARER,
33
+ config={'header': 'Authorization', 'prefix': 'Bearer'},
34
+ user_config_spec=AirbyteAuthConfig(
35
+ title='Facebook Marketing Authentication',
36
+ type='object',
37
+ required=['access_token', 'account_id'],
38
+ properties={
39
+ 'access_token': AuthConfigFieldSpec(
40
+ title='Access Token',
41
+ description='Facebook Marketing API access token',
42
+ ),
43
+ 'account_id': AuthConfigFieldSpec(
44
+ title='Ad Account ID',
45
+ description='Facebook Ad Account ID (without the act_ prefix)',
46
+ ),
47
+ },
48
+ auth_mapping={'token': '${access_token}'},
49
+ ),
50
+ ),
51
+ entities=[
52
+ EntityDefinition(
53
+ name='campaigns',
54
+ stream_name='campaigns',
55
+ actions=[Action.LIST, Action.GET],
56
+ endpoints={
57
+ Action.LIST: EndpointDefinition(
58
+ method='GET',
59
+ path='/act_{account_id}/campaigns',
60
+ action=Action.LIST,
61
+ description='Returns a list of campaigns for the specified ad account',
62
+ query_params=['fields', 'limit', 'after'],
63
+ query_params_schema={
64
+ 'fields': {
65
+ 'type': 'string',
66
+ 'required': False,
67
+ 'default': 'id,name,account_id,adlabels,bid_strategy,boosted_object_id,budget_rebalance_flag,budget_remaining,buying_type,daily_budget,created_time,configured_status,effective_status,issues_info,lifetime_budget,objective,smart_promotion_type,source_campaign_id,special_ad_category,special_ad_category_country,spend_cap,start_time,status,stop_time,updated_time',
68
+ },
69
+ 'limit': {
70
+ 'type': 'integer',
71
+ 'required': False,
72
+ 'default': 25,
73
+ },
74
+ 'after': {'type': 'string', 'required': False},
75
+ },
76
+ path_params=['account_id'],
77
+ path_params_schema={
78
+ 'account_id': {'type': 'string', 'required': True},
79
+ },
80
+ response_schema={
81
+ 'type': 'object',
82
+ 'properties': {
83
+ 'data': {
84
+ 'type': 'array',
85
+ 'items': {
86
+ 'type': 'object',
87
+ 'description': 'Facebook Ad Campaign',
88
+ 'properties': {
89
+ 'id': {'type': 'string', 'description': 'Campaign ID'},
90
+ 'name': {
91
+ 'type': ['string', 'null'],
92
+ 'description': 'Campaign name',
93
+ },
94
+ 'account_id': {
95
+ 'type': ['string', 'null'],
96
+ 'description': 'Ad account ID',
97
+ },
98
+ 'adlabels': {
99
+ 'type': ['array', 'null'],
100
+ 'description': 'Ad labels associated with the campaign',
101
+ 'items': {
102
+ 'type': 'object',
103
+ 'properties': {
104
+ 'id': {
105
+ 'type': ['string', 'null'],
106
+ 'description': 'Ad label ID',
107
+ },
108
+ 'name': {
109
+ 'type': ['string', 'null'],
110
+ 'description': 'Ad label name',
111
+ },
112
+ 'created_time': {
113
+ 'type': ['string', 'null'],
114
+ 'format': 'date-time',
115
+ 'description': 'Creation time',
116
+ },
117
+ 'updated_time': {
118
+ 'type': ['string', 'null'],
119
+ 'format': 'date-time',
120
+ 'description': 'Last update time',
121
+ },
122
+ },
123
+ },
124
+ },
125
+ 'bid_strategy': {
126
+ 'type': ['string', 'null'],
127
+ 'description': 'Bid strategy for the campaign',
128
+ },
129
+ 'boosted_object_id': {
130
+ 'type': ['string', 'null'],
131
+ 'description': 'ID of the boosted object',
132
+ },
133
+ 'budget_rebalance_flag': {
134
+ 'type': ['boolean', 'null'],
135
+ 'description': 'Whether budget rebalancing is enabled',
136
+ },
137
+ 'budget_remaining': {
138
+ 'type': ['number', 'null'],
139
+ 'description': 'Remaining budget',
140
+ },
141
+ 'buying_type': {
142
+ 'type': ['string', 'null'],
143
+ 'description': 'Buying type (AUCTION, RESERVED)',
144
+ },
145
+ 'daily_budget': {
146
+ 'type': ['number', 'null'],
147
+ 'description': 'Daily budget in account currency',
148
+ },
149
+ 'created_time': {
150
+ 'type': ['string', 'null'],
151
+ 'format': 'date-time',
152
+ 'description': 'Campaign creation time',
153
+ },
154
+ 'configured_status': {
155
+ 'type': ['string', 'null'],
156
+ 'description': 'Configured status',
157
+ },
158
+ 'effective_status': {
159
+ 'type': ['string', 'null'],
160
+ 'description': 'Effective status',
161
+ },
162
+ 'issues_info': {
163
+ 'type': ['array', 'null'],
164
+ 'description': 'Issues information',
165
+ 'items': {
166
+ 'type': 'object',
167
+ 'properties': {
168
+ 'error_code': {
169
+ 'type': ['string', 'null'],
170
+ 'description': 'Error code',
171
+ },
172
+ 'error_message': {
173
+ 'type': ['string', 'null'],
174
+ 'description': 'Error message',
175
+ },
176
+ 'error_summary': {
177
+ 'type': ['string', 'null'],
178
+ 'description': 'Error summary',
179
+ },
180
+ 'error_type': {
181
+ 'type': ['string', 'null'],
182
+ 'description': 'Error type',
183
+ },
184
+ 'level': {
185
+ 'type': ['string', 'null'],
186
+ 'description': 'Issue level',
187
+ },
188
+ },
189
+ },
190
+ },
191
+ 'lifetime_budget': {
192
+ 'type': ['number', 'null'],
193
+ 'description': 'Lifetime budget',
194
+ },
195
+ 'objective': {
196
+ 'type': ['string', 'null'],
197
+ 'description': 'Campaign objective',
198
+ },
199
+ 'smart_promotion_type': {
200
+ 'type': ['string', 'null'],
201
+ 'description': 'Smart promotion type',
202
+ },
203
+ 'source_campaign_id': {
204
+ 'type': ['string', 'null'],
205
+ 'description': 'Source campaign ID',
206
+ },
207
+ 'special_ad_category': {
208
+ 'type': ['string', 'null'],
209
+ 'description': 'Special ad category',
210
+ },
211
+ 'special_ad_category_country': {
212
+ 'type': ['array', 'null'],
213
+ 'description': 'Countries for special ad category',
214
+ 'items': {
215
+ 'type': ['string', 'null'],
216
+ },
217
+ },
218
+ 'spend_cap': {
219
+ 'type': ['number', 'null'],
220
+ 'description': 'Spend cap',
221
+ },
222
+ 'start_time': {
223
+ 'type': ['string', 'null'],
224
+ 'format': 'date-time',
225
+ 'description': 'Campaign start time',
226
+ },
227
+ 'status': {
228
+ 'type': ['string', 'null'],
229
+ 'description': 'Campaign status',
230
+ },
231
+ 'stop_time': {
232
+ 'type': ['string', 'null'],
233
+ 'format': 'date-time',
234
+ 'description': 'Campaign stop time',
235
+ },
236
+ 'updated_time': {
237
+ 'type': ['string', 'null'],
238
+ 'format': 'date-time',
239
+ 'description': 'Last update time',
240
+ },
241
+ },
242
+ 'required': ['id'],
243
+ 'x-airbyte-entity-name': 'campaigns',
244
+ 'x-airbyte-stream-name': 'campaigns',
245
+ },
246
+ },
247
+ 'paging': {
248
+ 'type': 'object',
249
+ 'properties': {
250
+ 'cursors': {
251
+ 'type': 'object',
252
+ 'properties': {
253
+ 'before': {
254
+ 'type': ['string', 'null'],
255
+ 'description': 'Cursor for previous page',
256
+ },
257
+ 'after': {
258
+ 'type': ['string', 'null'],
259
+ 'description': 'Cursor for next page',
260
+ },
261
+ },
262
+ },
263
+ 'next': {
264
+ 'type': ['string', 'null'],
265
+ 'description': 'URL for next page',
266
+ },
267
+ 'previous': {
268
+ 'type': ['string', 'null'],
269
+ 'description': 'URL for previous page',
270
+ },
271
+ },
272
+ },
273
+ },
274
+ },
275
+ record_extractor='$.data',
276
+ meta_extractor={'after': '$.paging.cursors.after'},
277
+ preferred_for_check=True,
278
+ ),
279
+ Action.GET: EndpointDefinition(
280
+ method='GET',
281
+ path='/{campaign_id}',
282
+ action=Action.GET,
283
+ description='Returns a single campaign by ID',
284
+ query_params=['fields'],
285
+ query_params_schema={
286
+ 'fields': {
287
+ 'type': 'string',
288
+ 'required': False,
289
+ 'default': 'id,name,account_id,adlabels,bid_strategy,boosted_object_id,budget_rebalance_flag,budget_remaining,buying_type,daily_budget,created_time,configured_status,effective_status,issues_info,lifetime_budget,objective,smart_promotion_type,source_campaign_id,special_ad_category,special_ad_category_country,spend_cap,start_time,status,stop_time,updated_time',
290
+ },
291
+ },
292
+ path_params=['campaign_id'],
293
+ path_params_schema={
294
+ 'campaign_id': {'type': 'string', 'required': True},
295
+ },
296
+ response_schema={
297
+ 'type': 'object',
298
+ 'description': 'Facebook Ad Campaign',
299
+ 'properties': {
300
+ 'id': {'type': 'string', 'description': 'Campaign ID'},
301
+ 'name': {
302
+ 'type': ['string', 'null'],
303
+ 'description': 'Campaign name',
304
+ },
305
+ 'account_id': {
306
+ 'type': ['string', 'null'],
307
+ 'description': 'Ad account ID',
308
+ },
309
+ 'adlabels': {
310
+ 'type': ['array', 'null'],
311
+ 'description': 'Ad labels associated with the campaign',
312
+ 'items': {
313
+ 'type': 'object',
314
+ 'properties': {
315
+ 'id': {
316
+ 'type': ['string', 'null'],
317
+ 'description': 'Ad label ID',
318
+ },
319
+ 'name': {
320
+ 'type': ['string', 'null'],
321
+ 'description': 'Ad label name',
322
+ },
323
+ 'created_time': {
324
+ 'type': ['string', 'null'],
325
+ 'format': 'date-time',
326
+ 'description': 'Creation time',
327
+ },
328
+ 'updated_time': {
329
+ 'type': ['string', 'null'],
330
+ 'format': 'date-time',
331
+ 'description': 'Last update time',
332
+ },
333
+ },
334
+ },
335
+ },
336
+ 'bid_strategy': {
337
+ 'type': ['string', 'null'],
338
+ 'description': 'Bid strategy for the campaign',
339
+ },
340
+ 'boosted_object_id': {
341
+ 'type': ['string', 'null'],
342
+ 'description': 'ID of the boosted object',
343
+ },
344
+ 'budget_rebalance_flag': {
345
+ 'type': ['boolean', 'null'],
346
+ 'description': 'Whether budget rebalancing is enabled',
347
+ },
348
+ 'budget_remaining': {
349
+ 'type': ['number', 'null'],
350
+ 'description': 'Remaining budget',
351
+ },
352
+ 'buying_type': {
353
+ 'type': ['string', 'null'],
354
+ 'description': 'Buying type (AUCTION, RESERVED)',
355
+ },
356
+ 'daily_budget': {
357
+ 'type': ['number', 'null'],
358
+ 'description': 'Daily budget in account currency',
359
+ },
360
+ 'created_time': {
361
+ 'type': ['string', 'null'],
362
+ 'format': 'date-time',
363
+ 'description': 'Campaign creation time',
364
+ },
365
+ 'configured_status': {
366
+ 'type': ['string', 'null'],
367
+ 'description': 'Configured status',
368
+ },
369
+ 'effective_status': {
370
+ 'type': ['string', 'null'],
371
+ 'description': 'Effective status',
372
+ },
373
+ 'issues_info': {
374
+ 'type': ['array', 'null'],
375
+ 'description': 'Issues information',
376
+ 'items': {
377
+ 'type': 'object',
378
+ 'properties': {
379
+ 'error_code': {
380
+ 'type': ['string', 'null'],
381
+ 'description': 'Error code',
382
+ },
383
+ 'error_message': {
384
+ 'type': ['string', 'null'],
385
+ 'description': 'Error message',
386
+ },
387
+ 'error_summary': {
388
+ 'type': ['string', 'null'],
389
+ 'description': 'Error summary',
390
+ },
391
+ 'error_type': {
392
+ 'type': ['string', 'null'],
393
+ 'description': 'Error type',
394
+ },
395
+ 'level': {
396
+ 'type': ['string', 'null'],
397
+ 'description': 'Issue level',
398
+ },
399
+ },
400
+ },
401
+ },
402
+ 'lifetime_budget': {
403
+ 'type': ['number', 'null'],
404
+ 'description': 'Lifetime budget',
405
+ },
406
+ 'objective': {
407
+ 'type': ['string', 'null'],
408
+ 'description': 'Campaign objective',
409
+ },
410
+ 'smart_promotion_type': {
411
+ 'type': ['string', 'null'],
412
+ 'description': 'Smart promotion type',
413
+ },
414
+ 'source_campaign_id': {
415
+ 'type': ['string', 'null'],
416
+ 'description': 'Source campaign ID',
417
+ },
418
+ 'special_ad_category': {
419
+ 'type': ['string', 'null'],
420
+ 'description': 'Special ad category',
421
+ },
422
+ 'special_ad_category_country': {
423
+ 'type': ['array', 'null'],
424
+ 'description': 'Countries for special ad category',
425
+ 'items': {
426
+ 'type': ['string', 'null'],
427
+ },
428
+ },
429
+ 'spend_cap': {
430
+ 'type': ['number', 'null'],
431
+ 'description': 'Spend cap',
432
+ },
433
+ 'start_time': {
434
+ 'type': ['string', 'null'],
435
+ 'format': 'date-time',
436
+ 'description': 'Campaign start time',
437
+ },
438
+ 'status': {
439
+ 'type': ['string', 'null'],
440
+ 'description': 'Campaign status',
441
+ },
442
+ 'stop_time': {
443
+ 'type': ['string', 'null'],
444
+ 'format': 'date-time',
445
+ 'description': 'Campaign stop time',
446
+ },
447
+ 'updated_time': {
448
+ 'type': ['string', 'null'],
449
+ 'format': 'date-time',
450
+ 'description': 'Last update time',
451
+ },
452
+ },
453
+ 'required': ['id'],
454
+ 'x-airbyte-entity-name': 'campaigns',
455
+ 'x-airbyte-stream-name': 'campaigns',
456
+ },
457
+ ),
458
+ },
459
+ entity_schema={
460
+ 'type': 'object',
461
+ 'description': 'Facebook Ad Campaign',
462
+ 'properties': {
463
+ 'id': {'type': 'string', 'description': 'Campaign ID'},
464
+ 'name': {
465
+ 'type': ['string', 'null'],
466
+ 'description': 'Campaign name',
467
+ },
468
+ 'account_id': {
469
+ 'type': ['string', 'null'],
470
+ 'description': 'Ad account ID',
471
+ },
472
+ 'adlabels': {
473
+ 'type': ['array', 'null'],
474
+ 'description': 'Ad labels associated with the campaign',
475
+ 'items': {'$ref': '#/components/schemas/AdLabel'},
476
+ },
477
+ 'bid_strategy': {
478
+ 'type': ['string', 'null'],
479
+ 'description': 'Bid strategy for the campaign',
480
+ },
481
+ 'boosted_object_id': {
482
+ 'type': ['string', 'null'],
483
+ 'description': 'ID of the boosted object',
484
+ },
485
+ 'budget_rebalance_flag': {
486
+ 'type': ['boolean', 'null'],
487
+ 'description': 'Whether budget rebalancing is enabled',
488
+ },
489
+ 'budget_remaining': {
490
+ 'type': ['number', 'null'],
491
+ 'description': 'Remaining budget',
492
+ },
493
+ 'buying_type': {
494
+ 'type': ['string', 'null'],
495
+ 'description': 'Buying type (AUCTION, RESERVED)',
496
+ },
497
+ 'daily_budget': {
498
+ 'type': ['number', 'null'],
499
+ 'description': 'Daily budget in account currency',
500
+ },
501
+ 'created_time': {
502
+ 'type': ['string', 'null'],
503
+ 'format': 'date-time',
504
+ 'description': 'Campaign creation time',
505
+ },
506
+ 'configured_status': {
507
+ 'type': ['string', 'null'],
508
+ 'description': 'Configured status',
509
+ },
510
+ 'effective_status': {
511
+ 'type': ['string', 'null'],
512
+ 'description': 'Effective status',
513
+ },
514
+ 'issues_info': {
515
+ 'type': ['array', 'null'],
516
+ 'description': 'Issues information',
517
+ 'items': {'$ref': '#/components/schemas/IssueInfo'},
518
+ },
519
+ 'lifetime_budget': {
520
+ 'type': ['number', 'null'],
521
+ 'description': 'Lifetime budget',
522
+ },
523
+ 'objective': {
524
+ 'type': ['string', 'null'],
525
+ 'description': 'Campaign objective',
526
+ },
527
+ 'smart_promotion_type': {
528
+ 'type': ['string', 'null'],
529
+ 'description': 'Smart promotion type',
530
+ },
531
+ 'source_campaign_id': {
532
+ 'type': ['string', 'null'],
533
+ 'description': 'Source campaign ID',
534
+ },
535
+ 'special_ad_category': {
536
+ 'type': ['string', 'null'],
537
+ 'description': 'Special ad category',
538
+ },
539
+ 'special_ad_category_country': {
540
+ 'type': ['array', 'null'],
541
+ 'description': 'Countries for special ad category',
542
+ 'items': {
543
+ 'type': ['string', 'null'],
544
+ },
545
+ },
546
+ 'spend_cap': {
547
+ 'type': ['number', 'null'],
548
+ 'description': 'Spend cap',
549
+ },
550
+ 'start_time': {
551
+ 'type': ['string', 'null'],
552
+ 'format': 'date-time',
553
+ 'description': 'Campaign start time',
554
+ },
555
+ 'status': {
556
+ 'type': ['string', 'null'],
557
+ 'description': 'Campaign status',
558
+ },
559
+ 'stop_time': {
560
+ 'type': ['string', 'null'],
561
+ 'format': 'date-time',
562
+ 'description': 'Campaign stop time',
563
+ },
564
+ 'updated_time': {
565
+ 'type': ['string', 'null'],
566
+ 'format': 'date-time',
567
+ 'description': 'Last update time',
568
+ },
569
+ },
570
+ 'required': ['id'],
571
+ 'x-airbyte-entity-name': 'campaigns',
572
+ 'x-airbyte-stream-name': 'campaigns',
573
+ },
574
+ ),
575
+ EntityDefinition(
576
+ name='ad_sets',
577
+ stream_name='ad_sets',
578
+ actions=[Action.LIST, Action.GET],
579
+ endpoints={
580
+ Action.LIST: EndpointDefinition(
581
+ method='GET',
582
+ path='/act_{account_id}/adsets',
583
+ action=Action.LIST,
584
+ description='Returns a list of ad sets for the specified ad account',
585
+ query_params=['fields', 'limit', 'after'],
586
+ query_params_schema={
587
+ 'fields': {
588
+ 'type': 'string',
589
+ 'required': False,
590
+ 'default': 'id,name,account_id,adlabels,bid_amount,bid_info,bid_strategy,bid_constraints,budget_remaining,campaign_id,created_time,daily_budget,effective_status,end_time,learning_stage_info,lifetime_budget,promoted_object,start_time,targeting,updated_time',
591
+ },
592
+ 'limit': {
593
+ 'type': 'integer',
594
+ 'required': False,
595
+ 'default': 25,
596
+ },
597
+ 'after': {'type': 'string', 'required': False},
598
+ },
599
+ path_params=['account_id'],
600
+ path_params_schema={
601
+ 'account_id': {'type': 'string', 'required': True},
602
+ },
603
+ response_schema={
604
+ 'type': 'object',
605
+ 'properties': {
606
+ 'data': {
607
+ 'type': 'array',
608
+ 'items': {
609
+ 'type': 'object',
610
+ 'description': 'Facebook Ad Set',
611
+ 'properties': {
612
+ 'id': {'type': 'string', 'description': 'Ad Set ID'},
613
+ 'name': {
614
+ 'type': ['string', 'null'],
615
+ 'description': 'Ad Set name',
616
+ },
617
+ 'account_id': {
618
+ 'type': ['string', 'null'],
619
+ 'description': 'Ad account ID',
620
+ },
621
+ 'adlabels': {
622
+ 'type': ['array', 'null'],
623
+ 'description': 'Ad labels',
624
+ 'items': {
625
+ 'type': 'object',
626
+ 'properties': {
627
+ 'id': {
628
+ 'type': ['string', 'null'],
629
+ 'description': 'Ad label ID',
630
+ },
631
+ 'name': {
632
+ 'type': ['string', 'null'],
633
+ 'description': 'Ad label name',
634
+ },
635
+ 'created_time': {
636
+ 'type': ['string', 'null'],
637
+ 'format': 'date-time',
638
+ 'description': 'Creation time',
639
+ },
640
+ 'updated_time': {
641
+ 'type': ['string', 'null'],
642
+ 'format': 'date-time',
643
+ 'description': 'Last update time',
644
+ },
645
+ },
646
+ },
647
+ },
648
+ 'bid_amount': {
649
+ 'type': ['number', 'null'],
650
+ 'description': 'Bid amount',
651
+ },
652
+ 'bid_info': {
653
+ 'oneOf': [
654
+ {
655
+ 'type': 'object',
656
+ 'properties': {
657
+ 'CLICKS': {
658
+ 'type': ['integer', 'null'],
659
+ 'description': 'Bid for clicks',
660
+ },
661
+ 'ACTIONS': {
662
+ 'type': ['integer', 'null'],
663
+ 'description': 'Bid for actions',
664
+ },
665
+ 'REACH': {
666
+ 'type': ['integer', 'null'],
667
+ 'description': 'Bid for reach',
668
+ },
669
+ 'IMPRESSIONS': {
670
+ 'type': ['integer', 'null'],
671
+ 'description': 'Bid for impressions',
672
+ },
673
+ 'SOCIAL': {
674
+ 'type': ['integer', 'null'],
675
+ 'description': 'Bid for social',
676
+ },
677
+ },
678
+ },
679
+ {'type': 'null'},
680
+ ],
681
+ },
682
+ 'bid_strategy': {
683
+ 'type': ['string', 'null'],
684
+ 'description': 'Bid strategy',
685
+ },
686
+ 'bid_constraints': {
687
+ 'oneOf': [
688
+ {
689
+ 'type': 'object',
690
+ 'properties': {
691
+ 'roas_average_floor': {
692
+ 'type': ['integer', 'null'],
693
+ 'description': 'ROAS average floor',
694
+ },
695
+ },
696
+ },
697
+ {'type': 'null'},
698
+ ],
699
+ },
700
+ 'budget_remaining': {
701
+ 'type': ['number', 'null'],
702
+ 'description': 'Remaining budget',
703
+ },
704
+ 'campaign_id': {
705
+ 'type': ['string', 'null'],
706
+ 'description': 'Parent campaign ID',
707
+ },
708
+ 'created_time': {
709
+ 'type': ['string', 'null'],
710
+ 'format': 'date-time',
711
+ 'description': 'Creation time',
712
+ },
713
+ 'daily_budget': {
714
+ 'type': ['number', 'null'],
715
+ 'description': 'Daily budget',
716
+ },
717
+ 'effective_status': {
718
+ 'type': ['string', 'null'],
719
+ 'description': 'Effective status',
720
+ },
721
+ 'end_time': {
722
+ 'type': ['string', 'null'],
723
+ 'format': 'date-time',
724
+ 'description': 'End time',
725
+ },
726
+ 'learning_stage_info': {
727
+ 'oneOf': [
728
+ {
729
+ 'type': 'object',
730
+ 'properties': {
731
+ 'status': {
732
+ 'type': ['string', 'null'],
733
+ 'description': 'Learning stage status',
734
+ },
735
+ 'conversions': {
736
+ 'type': ['integer', 'null'],
737
+ 'description': 'Number of conversions',
738
+ },
739
+ 'last_sig_edit_ts': {
740
+ 'type': ['integer', 'null'],
741
+ 'description': 'Last significant edit timestamp',
742
+ },
743
+ 'attribution_windows': {
744
+ 'type': ['array', 'null'],
745
+ 'description': 'Attribution windows',
746
+ 'items': {
747
+ 'type': ['string', 'null'],
748
+ },
749
+ },
750
+ },
751
+ },
752
+ {'type': 'null'},
753
+ ],
754
+ },
755
+ 'lifetime_budget': {
756
+ 'type': ['number', 'null'],
757
+ 'description': 'Lifetime budget',
758
+ },
759
+ 'promoted_object': {
760
+ 'oneOf': [
761
+ {
762
+ 'type': 'object',
763
+ 'properties': {
764
+ 'custom_event_type': {
765
+ 'type': ['string', 'null'],
766
+ 'description': 'Custom event type',
767
+ },
768
+ 'pixel_id': {
769
+ 'type': ['string', 'null'],
770
+ 'description': 'Pixel ID',
771
+ },
772
+ 'pixel_rule': {
773
+ 'type': ['string', 'null'],
774
+ 'description': 'Pixel rule',
775
+ },
776
+ 'page_id': {
777
+ 'type': ['string', 'null'],
778
+ 'description': 'Page ID',
779
+ },
780
+ 'object_store_url': {
781
+ 'type': ['string', 'null'],
782
+ 'description': 'Object store URL',
783
+ },
784
+ 'application_id': {
785
+ 'type': ['string', 'null'],
786
+ 'description': 'Application ID',
787
+ },
788
+ 'product_set_id': {
789
+ 'type': ['string', 'null'],
790
+ 'description': 'Product set ID',
791
+ },
792
+ 'offer_id': {
793
+ 'type': ['string', 'null'],
794
+ 'description': 'Offer ID',
795
+ },
796
+ },
797
+ },
798
+ {'type': 'null'},
799
+ ],
800
+ },
801
+ 'start_time': {
802
+ 'type': ['string', 'null'],
803
+ 'format': 'date-time',
804
+ 'description': 'Start time',
805
+ },
806
+ 'targeting': {
807
+ 'type': ['object', 'null'],
808
+ 'description': 'Targeting specification',
809
+ 'additionalProperties': True,
810
+ },
811
+ 'updated_time': {
812
+ 'type': ['string', 'null'],
813
+ 'format': 'date-time',
814
+ 'description': 'Last update time',
815
+ },
816
+ },
817
+ 'required': ['id'],
818
+ 'x-airbyte-entity-name': 'ad_sets',
819
+ 'x-airbyte-stream-name': 'ad_sets',
820
+ },
821
+ },
822
+ 'paging': {
823
+ 'type': 'object',
824
+ 'properties': {
825
+ 'cursors': {
826
+ 'type': 'object',
827
+ 'properties': {
828
+ 'before': {
829
+ 'type': ['string', 'null'],
830
+ 'description': 'Cursor for previous page',
831
+ },
832
+ 'after': {
833
+ 'type': ['string', 'null'],
834
+ 'description': 'Cursor for next page',
835
+ },
836
+ },
837
+ },
838
+ 'next': {
839
+ 'type': ['string', 'null'],
840
+ 'description': 'URL for next page',
841
+ },
842
+ 'previous': {
843
+ 'type': ['string', 'null'],
844
+ 'description': 'URL for previous page',
845
+ },
846
+ },
847
+ },
848
+ },
849
+ },
850
+ record_extractor='$.data',
851
+ meta_extractor={'after': '$.paging.cursors.after'},
852
+ ),
853
+ Action.GET: EndpointDefinition(
854
+ method='GET',
855
+ path='/{adset_id}',
856
+ action=Action.GET,
857
+ description='Returns a single ad set by ID',
858
+ query_params=['fields'],
859
+ query_params_schema={
860
+ 'fields': {
861
+ 'type': 'string',
862
+ 'required': False,
863
+ 'default': 'id,name,account_id,adlabels,bid_amount,bid_info,bid_strategy,bid_constraints,budget_remaining,campaign_id,created_time,daily_budget,effective_status,end_time,learning_stage_info,lifetime_budget,promoted_object,start_time,targeting,updated_time',
864
+ },
865
+ },
866
+ path_params=['adset_id'],
867
+ path_params_schema={
868
+ 'adset_id': {'type': 'string', 'required': True},
869
+ },
870
+ response_schema={
871
+ 'type': 'object',
872
+ 'description': 'Facebook Ad Set',
873
+ 'properties': {
874
+ 'id': {'type': 'string', 'description': 'Ad Set ID'},
875
+ 'name': {
876
+ 'type': ['string', 'null'],
877
+ 'description': 'Ad Set name',
878
+ },
879
+ 'account_id': {
880
+ 'type': ['string', 'null'],
881
+ 'description': 'Ad account ID',
882
+ },
883
+ 'adlabels': {
884
+ 'type': ['array', 'null'],
885
+ 'description': 'Ad labels',
886
+ 'items': {
887
+ 'type': 'object',
888
+ 'properties': {
889
+ 'id': {
890
+ 'type': ['string', 'null'],
891
+ 'description': 'Ad label ID',
892
+ },
893
+ 'name': {
894
+ 'type': ['string', 'null'],
895
+ 'description': 'Ad label name',
896
+ },
897
+ 'created_time': {
898
+ 'type': ['string', 'null'],
899
+ 'format': 'date-time',
900
+ 'description': 'Creation time',
901
+ },
902
+ 'updated_time': {
903
+ 'type': ['string', 'null'],
904
+ 'format': 'date-time',
905
+ 'description': 'Last update time',
906
+ },
907
+ },
908
+ },
909
+ },
910
+ 'bid_amount': {
911
+ 'type': ['number', 'null'],
912
+ 'description': 'Bid amount',
913
+ },
914
+ 'bid_info': {
915
+ 'oneOf': [
916
+ {
917
+ 'type': 'object',
918
+ 'properties': {
919
+ 'CLICKS': {
920
+ 'type': ['integer', 'null'],
921
+ 'description': 'Bid for clicks',
922
+ },
923
+ 'ACTIONS': {
924
+ 'type': ['integer', 'null'],
925
+ 'description': 'Bid for actions',
926
+ },
927
+ 'REACH': {
928
+ 'type': ['integer', 'null'],
929
+ 'description': 'Bid for reach',
930
+ },
931
+ 'IMPRESSIONS': {
932
+ 'type': ['integer', 'null'],
933
+ 'description': 'Bid for impressions',
934
+ },
935
+ 'SOCIAL': {
936
+ 'type': ['integer', 'null'],
937
+ 'description': 'Bid for social',
938
+ },
939
+ },
940
+ },
941
+ {'type': 'null'},
942
+ ],
943
+ },
944
+ 'bid_strategy': {
945
+ 'type': ['string', 'null'],
946
+ 'description': 'Bid strategy',
947
+ },
948
+ 'bid_constraints': {
949
+ 'oneOf': [
950
+ {
951
+ 'type': 'object',
952
+ 'properties': {
953
+ 'roas_average_floor': {
954
+ 'type': ['integer', 'null'],
955
+ 'description': 'ROAS average floor',
956
+ },
957
+ },
958
+ },
959
+ {'type': 'null'},
960
+ ],
961
+ },
962
+ 'budget_remaining': {
963
+ 'type': ['number', 'null'],
964
+ 'description': 'Remaining budget',
965
+ },
966
+ 'campaign_id': {
967
+ 'type': ['string', 'null'],
968
+ 'description': 'Parent campaign ID',
969
+ },
970
+ 'created_time': {
971
+ 'type': ['string', 'null'],
972
+ 'format': 'date-time',
973
+ 'description': 'Creation time',
974
+ },
975
+ 'daily_budget': {
976
+ 'type': ['number', 'null'],
977
+ 'description': 'Daily budget',
978
+ },
979
+ 'effective_status': {
980
+ 'type': ['string', 'null'],
981
+ 'description': 'Effective status',
982
+ },
983
+ 'end_time': {
984
+ 'type': ['string', 'null'],
985
+ 'format': 'date-time',
986
+ 'description': 'End time',
987
+ },
988
+ 'learning_stage_info': {
989
+ 'oneOf': [
990
+ {
991
+ 'type': 'object',
992
+ 'properties': {
993
+ 'status': {
994
+ 'type': ['string', 'null'],
995
+ 'description': 'Learning stage status',
996
+ },
997
+ 'conversions': {
998
+ 'type': ['integer', 'null'],
999
+ 'description': 'Number of conversions',
1000
+ },
1001
+ 'last_sig_edit_ts': {
1002
+ 'type': ['integer', 'null'],
1003
+ 'description': 'Last significant edit timestamp',
1004
+ },
1005
+ 'attribution_windows': {
1006
+ 'type': ['array', 'null'],
1007
+ 'description': 'Attribution windows',
1008
+ 'items': {
1009
+ 'type': ['string', 'null'],
1010
+ },
1011
+ },
1012
+ },
1013
+ },
1014
+ {'type': 'null'},
1015
+ ],
1016
+ },
1017
+ 'lifetime_budget': {
1018
+ 'type': ['number', 'null'],
1019
+ 'description': 'Lifetime budget',
1020
+ },
1021
+ 'promoted_object': {
1022
+ 'oneOf': [
1023
+ {
1024
+ 'type': 'object',
1025
+ 'properties': {
1026
+ 'custom_event_type': {
1027
+ 'type': ['string', 'null'],
1028
+ 'description': 'Custom event type',
1029
+ },
1030
+ 'pixel_id': {
1031
+ 'type': ['string', 'null'],
1032
+ 'description': 'Pixel ID',
1033
+ },
1034
+ 'pixel_rule': {
1035
+ 'type': ['string', 'null'],
1036
+ 'description': 'Pixel rule',
1037
+ },
1038
+ 'page_id': {
1039
+ 'type': ['string', 'null'],
1040
+ 'description': 'Page ID',
1041
+ },
1042
+ 'object_store_url': {
1043
+ 'type': ['string', 'null'],
1044
+ 'description': 'Object store URL',
1045
+ },
1046
+ 'application_id': {
1047
+ 'type': ['string', 'null'],
1048
+ 'description': 'Application ID',
1049
+ },
1050
+ 'product_set_id': {
1051
+ 'type': ['string', 'null'],
1052
+ 'description': 'Product set ID',
1053
+ },
1054
+ 'offer_id': {
1055
+ 'type': ['string', 'null'],
1056
+ 'description': 'Offer ID',
1057
+ },
1058
+ },
1059
+ },
1060
+ {'type': 'null'},
1061
+ ],
1062
+ },
1063
+ 'start_time': {
1064
+ 'type': ['string', 'null'],
1065
+ 'format': 'date-time',
1066
+ 'description': 'Start time',
1067
+ },
1068
+ 'targeting': {
1069
+ 'type': ['object', 'null'],
1070
+ 'description': 'Targeting specification',
1071
+ 'additionalProperties': True,
1072
+ },
1073
+ 'updated_time': {
1074
+ 'type': ['string', 'null'],
1075
+ 'format': 'date-time',
1076
+ 'description': 'Last update time',
1077
+ },
1078
+ },
1079
+ 'required': ['id'],
1080
+ 'x-airbyte-entity-name': 'ad_sets',
1081
+ 'x-airbyte-stream-name': 'ad_sets',
1082
+ },
1083
+ ),
1084
+ },
1085
+ entity_schema={
1086
+ 'type': 'object',
1087
+ 'description': 'Facebook Ad Set',
1088
+ 'properties': {
1089
+ 'id': {'type': 'string', 'description': 'Ad Set ID'},
1090
+ 'name': {
1091
+ 'type': ['string', 'null'],
1092
+ 'description': 'Ad Set name',
1093
+ },
1094
+ 'account_id': {
1095
+ 'type': ['string', 'null'],
1096
+ 'description': 'Ad account ID',
1097
+ },
1098
+ 'adlabels': {
1099
+ 'type': ['array', 'null'],
1100
+ 'description': 'Ad labels',
1101
+ 'items': {'$ref': '#/components/schemas/AdLabel'},
1102
+ },
1103
+ 'bid_amount': {
1104
+ 'type': ['number', 'null'],
1105
+ 'description': 'Bid amount',
1106
+ },
1107
+ 'bid_info': {
1108
+ 'oneOf': [
1109
+ {'$ref': '#/components/schemas/BidInfo'},
1110
+ {'type': 'null'},
1111
+ ],
1112
+ },
1113
+ 'bid_strategy': {
1114
+ 'type': ['string', 'null'],
1115
+ 'description': 'Bid strategy',
1116
+ },
1117
+ 'bid_constraints': {
1118
+ 'oneOf': [
1119
+ {'$ref': '#/components/schemas/BidConstraints'},
1120
+ {'type': 'null'},
1121
+ ],
1122
+ },
1123
+ 'budget_remaining': {
1124
+ 'type': ['number', 'null'],
1125
+ 'description': 'Remaining budget',
1126
+ },
1127
+ 'campaign_id': {
1128
+ 'type': ['string', 'null'],
1129
+ 'description': 'Parent campaign ID',
1130
+ },
1131
+ 'created_time': {
1132
+ 'type': ['string', 'null'],
1133
+ 'format': 'date-time',
1134
+ 'description': 'Creation time',
1135
+ },
1136
+ 'daily_budget': {
1137
+ 'type': ['number', 'null'],
1138
+ 'description': 'Daily budget',
1139
+ },
1140
+ 'effective_status': {
1141
+ 'type': ['string', 'null'],
1142
+ 'description': 'Effective status',
1143
+ },
1144
+ 'end_time': {
1145
+ 'type': ['string', 'null'],
1146
+ 'format': 'date-time',
1147
+ 'description': 'End time',
1148
+ },
1149
+ 'learning_stage_info': {
1150
+ 'oneOf': [
1151
+ {'$ref': '#/components/schemas/LearningStageInfo'},
1152
+ {'type': 'null'},
1153
+ ],
1154
+ },
1155
+ 'lifetime_budget': {
1156
+ 'type': ['number', 'null'],
1157
+ 'description': 'Lifetime budget',
1158
+ },
1159
+ 'promoted_object': {
1160
+ 'oneOf': [
1161
+ {'$ref': '#/components/schemas/PromotedObject'},
1162
+ {'type': 'null'},
1163
+ ],
1164
+ },
1165
+ 'start_time': {
1166
+ 'type': ['string', 'null'],
1167
+ 'format': 'date-time',
1168
+ 'description': 'Start time',
1169
+ },
1170
+ 'targeting': {
1171
+ 'type': ['object', 'null'],
1172
+ 'description': 'Targeting specification',
1173
+ 'additionalProperties': True,
1174
+ },
1175
+ 'updated_time': {
1176
+ 'type': ['string', 'null'],
1177
+ 'format': 'date-time',
1178
+ 'description': 'Last update time',
1179
+ },
1180
+ },
1181
+ 'required': ['id'],
1182
+ 'x-airbyte-entity-name': 'ad_sets',
1183
+ 'x-airbyte-stream-name': 'ad_sets',
1184
+ },
1185
+ ),
1186
+ EntityDefinition(
1187
+ name='ads',
1188
+ stream_name='ads',
1189
+ actions=[Action.LIST, Action.GET],
1190
+ endpoints={
1191
+ Action.LIST: EndpointDefinition(
1192
+ method='GET',
1193
+ path='/act_{account_id}/ads',
1194
+ action=Action.LIST,
1195
+ description='Returns a list of ads for the specified ad account',
1196
+ query_params=['fields', 'limit', 'after'],
1197
+ query_params_schema={
1198
+ 'fields': {
1199
+ 'type': 'string',
1200
+ 'required': False,
1201
+ 'default': 'id,name,account_id,adset_id,campaign_id,adlabels,bid_amount,bid_info,bid_type,configured_status,conversion_specs,created_time,creative,effective_status,last_updated_by_app_id,recommendations,source_ad_id,status,tracking_specs,updated_time',
1202
+ },
1203
+ 'limit': {
1204
+ 'type': 'integer',
1205
+ 'required': False,
1206
+ 'default': 25,
1207
+ },
1208
+ 'after': {'type': 'string', 'required': False},
1209
+ },
1210
+ path_params=['account_id'],
1211
+ path_params_schema={
1212
+ 'account_id': {'type': 'string', 'required': True},
1213
+ },
1214
+ response_schema={
1215
+ 'type': 'object',
1216
+ 'properties': {
1217
+ 'data': {
1218
+ 'type': 'array',
1219
+ 'items': {
1220
+ 'type': 'object',
1221
+ 'description': 'Facebook Ad',
1222
+ 'properties': {
1223
+ 'id': {'type': 'string', 'description': 'Ad ID'},
1224
+ 'name': {
1225
+ 'type': ['string', 'null'],
1226
+ 'description': 'Ad name',
1227
+ },
1228
+ 'account_id': {
1229
+ 'type': ['string', 'null'],
1230
+ 'description': 'Ad account ID',
1231
+ },
1232
+ 'adset_id': {
1233
+ 'type': ['string', 'null'],
1234
+ 'description': 'Parent ad set ID',
1235
+ },
1236
+ 'campaign_id': {
1237
+ 'type': ['string', 'null'],
1238
+ 'description': 'Parent campaign ID',
1239
+ },
1240
+ 'adlabels': {
1241
+ 'type': ['array', 'null'],
1242
+ 'description': 'Ad labels',
1243
+ 'items': {
1244
+ 'type': 'object',
1245
+ 'properties': {
1246
+ 'id': {
1247
+ 'type': ['string', 'null'],
1248
+ 'description': 'Ad label ID',
1249
+ },
1250
+ 'name': {
1251
+ 'type': ['string', 'null'],
1252
+ 'description': 'Ad label name',
1253
+ },
1254
+ 'created_time': {
1255
+ 'type': ['string', 'null'],
1256
+ 'format': 'date-time',
1257
+ 'description': 'Creation time',
1258
+ },
1259
+ 'updated_time': {
1260
+ 'type': ['string', 'null'],
1261
+ 'format': 'date-time',
1262
+ 'description': 'Last update time',
1263
+ },
1264
+ },
1265
+ },
1266
+ },
1267
+ 'bid_amount': {
1268
+ 'type': ['integer', 'null'],
1269
+ 'description': 'Bid amount',
1270
+ },
1271
+ 'bid_info': {
1272
+ 'oneOf': [
1273
+ {
1274
+ 'type': 'object',
1275
+ 'properties': {
1276
+ 'CLICKS': {
1277
+ 'type': ['integer', 'null'],
1278
+ 'description': 'Bid for clicks',
1279
+ },
1280
+ 'ACTIONS': {
1281
+ 'type': ['integer', 'null'],
1282
+ 'description': 'Bid for actions',
1283
+ },
1284
+ 'REACH': {
1285
+ 'type': ['integer', 'null'],
1286
+ 'description': 'Bid for reach',
1287
+ },
1288
+ 'IMPRESSIONS': {
1289
+ 'type': ['integer', 'null'],
1290
+ 'description': 'Bid for impressions',
1291
+ },
1292
+ 'SOCIAL': {
1293
+ 'type': ['integer', 'null'],
1294
+ 'description': 'Bid for social',
1295
+ },
1296
+ },
1297
+ },
1298
+ {'type': 'null'},
1299
+ ],
1300
+ },
1301
+ 'bid_type': {
1302
+ 'type': ['string', 'null'],
1303
+ 'description': 'Bid type',
1304
+ },
1305
+ 'configured_status': {
1306
+ 'type': ['string', 'null'],
1307
+ 'description': 'Configured status',
1308
+ },
1309
+ 'conversion_specs': {
1310
+ 'type': ['array', 'null'],
1311
+ 'description': 'Conversion specifications',
1312
+ 'items': {'type': 'object', 'additionalProperties': True},
1313
+ },
1314
+ 'created_time': {
1315
+ 'type': ['string', 'null'],
1316
+ 'format': 'date-time',
1317
+ 'description': 'Creation time',
1318
+ },
1319
+ 'creative': {
1320
+ 'oneOf': [
1321
+ {
1322
+ 'type': 'object',
1323
+ 'properties': {
1324
+ 'id': {
1325
+ 'type': ['string', 'null'],
1326
+ 'description': 'Creative ID',
1327
+ },
1328
+ 'creative_id': {
1329
+ 'type': ['string', 'null'],
1330
+ 'description': 'Creative ID (alternate)',
1331
+ },
1332
+ },
1333
+ },
1334
+ {'type': 'null'},
1335
+ ],
1336
+ },
1337
+ 'effective_status': {
1338
+ 'type': ['string', 'null'],
1339
+ 'description': 'Effective status',
1340
+ },
1341
+ 'last_updated_by_app_id': {
1342
+ 'type': ['string', 'null'],
1343
+ 'description': 'Last updated by app ID',
1344
+ },
1345
+ 'recommendations': {
1346
+ 'type': ['array', 'null'],
1347
+ 'description': 'Recommendations',
1348
+ 'items': {
1349
+ 'type': 'object',
1350
+ 'properties': {
1351
+ 'blame_field': {
1352
+ 'type': ['string', 'null'],
1353
+ 'description': 'Field causing the recommendation',
1354
+ },
1355
+ 'code': {
1356
+ 'type': ['integer', 'null'],
1357
+ 'description': 'Recommendation code',
1358
+ },
1359
+ 'confidence': {
1360
+ 'type': ['string', 'null'],
1361
+ 'description': 'Confidence level',
1362
+ },
1363
+ 'importance': {
1364
+ 'type': ['string', 'null'],
1365
+ 'description': 'Importance level',
1366
+ },
1367
+ 'message': {
1368
+ 'type': ['string', 'null'],
1369
+ 'description': 'Recommendation message',
1370
+ },
1371
+ 'title': {
1372
+ 'type': ['string', 'null'],
1373
+ 'description': 'Recommendation title',
1374
+ },
1375
+ },
1376
+ },
1377
+ },
1378
+ 'source_ad_id': {
1379
+ 'type': ['string', 'null'],
1380
+ 'description': 'Source ad ID',
1381
+ },
1382
+ 'status': {
1383
+ 'type': ['string', 'null'],
1384
+ 'description': 'Ad status',
1385
+ },
1386
+ 'tracking_specs': {
1387
+ 'type': ['array', 'null'],
1388
+ 'description': 'Tracking specifications',
1389
+ 'items': {'type': 'object', 'additionalProperties': True},
1390
+ },
1391
+ 'updated_time': {
1392
+ 'type': ['string', 'null'],
1393
+ 'format': 'date-time',
1394
+ 'description': 'Last update time',
1395
+ },
1396
+ },
1397
+ 'required': ['id'],
1398
+ 'x-airbyte-entity-name': 'ads',
1399
+ 'x-airbyte-stream-name': 'ads',
1400
+ },
1401
+ },
1402
+ 'paging': {
1403
+ 'type': 'object',
1404
+ 'properties': {
1405
+ 'cursors': {
1406
+ 'type': 'object',
1407
+ 'properties': {
1408
+ 'before': {
1409
+ 'type': ['string', 'null'],
1410
+ 'description': 'Cursor for previous page',
1411
+ },
1412
+ 'after': {
1413
+ 'type': ['string', 'null'],
1414
+ 'description': 'Cursor for next page',
1415
+ },
1416
+ },
1417
+ },
1418
+ 'next': {
1419
+ 'type': ['string', 'null'],
1420
+ 'description': 'URL for next page',
1421
+ },
1422
+ 'previous': {
1423
+ 'type': ['string', 'null'],
1424
+ 'description': 'URL for previous page',
1425
+ },
1426
+ },
1427
+ },
1428
+ },
1429
+ },
1430
+ record_extractor='$.data',
1431
+ meta_extractor={'after': '$.paging.cursors.after'},
1432
+ ),
1433
+ Action.GET: EndpointDefinition(
1434
+ method='GET',
1435
+ path='/{ad_id}',
1436
+ action=Action.GET,
1437
+ description='Returns a single ad by ID',
1438
+ query_params=['fields'],
1439
+ query_params_schema={
1440
+ 'fields': {
1441
+ 'type': 'string',
1442
+ 'required': False,
1443
+ 'default': 'id,name,account_id,adset_id,campaign_id,adlabels,bid_amount,bid_info,bid_type,configured_status,conversion_specs,created_time,creative,effective_status,last_updated_by_app_id,recommendations,source_ad_id,status,tracking_specs,updated_time',
1444
+ },
1445
+ },
1446
+ path_params=['ad_id'],
1447
+ path_params_schema={
1448
+ 'ad_id': {'type': 'string', 'required': True},
1449
+ },
1450
+ response_schema={
1451
+ 'type': 'object',
1452
+ 'description': 'Facebook Ad',
1453
+ 'properties': {
1454
+ 'id': {'type': 'string', 'description': 'Ad ID'},
1455
+ 'name': {
1456
+ 'type': ['string', 'null'],
1457
+ 'description': 'Ad name',
1458
+ },
1459
+ 'account_id': {
1460
+ 'type': ['string', 'null'],
1461
+ 'description': 'Ad account ID',
1462
+ },
1463
+ 'adset_id': {
1464
+ 'type': ['string', 'null'],
1465
+ 'description': 'Parent ad set ID',
1466
+ },
1467
+ 'campaign_id': {
1468
+ 'type': ['string', 'null'],
1469
+ 'description': 'Parent campaign ID',
1470
+ },
1471
+ 'adlabels': {
1472
+ 'type': ['array', 'null'],
1473
+ 'description': 'Ad labels',
1474
+ 'items': {
1475
+ 'type': 'object',
1476
+ 'properties': {
1477
+ 'id': {
1478
+ 'type': ['string', 'null'],
1479
+ 'description': 'Ad label ID',
1480
+ },
1481
+ 'name': {
1482
+ 'type': ['string', 'null'],
1483
+ 'description': 'Ad label name',
1484
+ },
1485
+ 'created_time': {
1486
+ 'type': ['string', 'null'],
1487
+ 'format': 'date-time',
1488
+ 'description': 'Creation time',
1489
+ },
1490
+ 'updated_time': {
1491
+ 'type': ['string', 'null'],
1492
+ 'format': 'date-time',
1493
+ 'description': 'Last update time',
1494
+ },
1495
+ },
1496
+ },
1497
+ },
1498
+ 'bid_amount': {
1499
+ 'type': ['integer', 'null'],
1500
+ 'description': 'Bid amount',
1501
+ },
1502
+ 'bid_info': {
1503
+ 'oneOf': [
1504
+ {
1505
+ 'type': 'object',
1506
+ 'properties': {
1507
+ 'CLICKS': {
1508
+ 'type': ['integer', 'null'],
1509
+ 'description': 'Bid for clicks',
1510
+ },
1511
+ 'ACTIONS': {
1512
+ 'type': ['integer', 'null'],
1513
+ 'description': 'Bid for actions',
1514
+ },
1515
+ 'REACH': {
1516
+ 'type': ['integer', 'null'],
1517
+ 'description': 'Bid for reach',
1518
+ },
1519
+ 'IMPRESSIONS': {
1520
+ 'type': ['integer', 'null'],
1521
+ 'description': 'Bid for impressions',
1522
+ },
1523
+ 'SOCIAL': {
1524
+ 'type': ['integer', 'null'],
1525
+ 'description': 'Bid for social',
1526
+ },
1527
+ },
1528
+ },
1529
+ {'type': 'null'},
1530
+ ],
1531
+ },
1532
+ 'bid_type': {
1533
+ 'type': ['string', 'null'],
1534
+ 'description': 'Bid type',
1535
+ },
1536
+ 'configured_status': {
1537
+ 'type': ['string', 'null'],
1538
+ 'description': 'Configured status',
1539
+ },
1540
+ 'conversion_specs': {
1541
+ 'type': ['array', 'null'],
1542
+ 'description': 'Conversion specifications',
1543
+ 'items': {'type': 'object', 'additionalProperties': True},
1544
+ },
1545
+ 'created_time': {
1546
+ 'type': ['string', 'null'],
1547
+ 'format': 'date-time',
1548
+ 'description': 'Creation time',
1549
+ },
1550
+ 'creative': {
1551
+ 'oneOf': [
1552
+ {
1553
+ 'type': 'object',
1554
+ 'properties': {
1555
+ 'id': {
1556
+ 'type': ['string', 'null'],
1557
+ 'description': 'Creative ID',
1558
+ },
1559
+ 'creative_id': {
1560
+ 'type': ['string', 'null'],
1561
+ 'description': 'Creative ID (alternate)',
1562
+ },
1563
+ },
1564
+ },
1565
+ {'type': 'null'},
1566
+ ],
1567
+ },
1568
+ 'effective_status': {
1569
+ 'type': ['string', 'null'],
1570
+ 'description': 'Effective status',
1571
+ },
1572
+ 'last_updated_by_app_id': {
1573
+ 'type': ['string', 'null'],
1574
+ 'description': 'Last updated by app ID',
1575
+ },
1576
+ 'recommendations': {
1577
+ 'type': ['array', 'null'],
1578
+ 'description': 'Recommendations',
1579
+ 'items': {
1580
+ 'type': 'object',
1581
+ 'properties': {
1582
+ 'blame_field': {
1583
+ 'type': ['string', 'null'],
1584
+ 'description': 'Field causing the recommendation',
1585
+ },
1586
+ 'code': {
1587
+ 'type': ['integer', 'null'],
1588
+ 'description': 'Recommendation code',
1589
+ },
1590
+ 'confidence': {
1591
+ 'type': ['string', 'null'],
1592
+ 'description': 'Confidence level',
1593
+ },
1594
+ 'importance': {
1595
+ 'type': ['string', 'null'],
1596
+ 'description': 'Importance level',
1597
+ },
1598
+ 'message': {
1599
+ 'type': ['string', 'null'],
1600
+ 'description': 'Recommendation message',
1601
+ },
1602
+ 'title': {
1603
+ 'type': ['string', 'null'],
1604
+ 'description': 'Recommendation title',
1605
+ },
1606
+ },
1607
+ },
1608
+ },
1609
+ 'source_ad_id': {
1610
+ 'type': ['string', 'null'],
1611
+ 'description': 'Source ad ID',
1612
+ },
1613
+ 'status': {
1614
+ 'type': ['string', 'null'],
1615
+ 'description': 'Ad status',
1616
+ },
1617
+ 'tracking_specs': {
1618
+ 'type': ['array', 'null'],
1619
+ 'description': 'Tracking specifications',
1620
+ 'items': {'type': 'object', 'additionalProperties': True},
1621
+ },
1622
+ 'updated_time': {
1623
+ 'type': ['string', 'null'],
1624
+ 'format': 'date-time',
1625
+ 'description': 'Last update time',
1626
+ },
1627
+ },
1628
+ 'required': ['id'],
1629
+ 'x-airbyte-entity-name': 'ads',
1630
+ 'x-airbyte-stream-name': 'ads',
1631
+ },
1632
+ ),
1633
+ },
1634
+ entity_schema={
1635
+ 'type': 'object',
1636
+ 'description': 'Facebook Ad',
1637
+ 'properties': {
1638
+ 'id': {'type': 'string', 'description': 'Ad ID'},
1639
+ 'name': {
1640
+ 'type': ['string', 'null'],
1641
+ 'description': 'Ad name',
1642
+ },
1643
+ 'account_id': {
1644
+ 'type': ['string', 'null'],
1645
+ 'description': 'Ad account ID',
1646
+ },
1647
+ 'adset_id': {
1648
+ 'type': ['string', 'null'],
1649
+ 'description': 'Parent ad set ID',
1650
+ },
1651
+ 'campaign_id': {
1652
+ 'type': ['string', 'null'],
1653
+ 'description': 'Parent campaign ID',
1654
+ },
1655
+ 'adlabels': {
1656
+ 'type': ['array', 'null'],
1657
+ 'description': 'Ad labels',
1658
+ 'items': {'$ref': '#/components/schemas/AdLabel'},
1659
+ },
1660
+ 'bid_amount': {
1661
+ 'type': ['integer', 'null'],
1662
+ 'description': 'Bid amount',
1663
+ },
1664
+ 'bid_info': {
1665
+ 'oneOf': [
1666
+ {'$ref': '#/components/schemas/BidInfo'},
1667
+ {'type': 'null'},
1668
+ ],
1669
+ },
1670
+ 'bid_type': {
1671
+ 'type': ['string', 'null'],
1672
+ 'description': 'Bid type',
1673
+ },
1674
+ 'configured_status': {
1675
+ 'type': ['string', 'null'],
1676
+ 'description': 'Configured status',
1677
+ },
1678
+ 'conversion_specs': {
1679
+ 'type': ['array', 'null'],
1680
+ 'description': 'Conversion specifications',
1681
+ 'items': {'type': 'object', 'additionalProperties': True},
1682
+ },
1683
+ 'created_time': {
1684
+ 'type': ['string', 'null'],
1685
+ 'format': 'date-time',
1686
+ 'description': 'Creation time',
1687
+ },
1688
+ 'creative': {
1689
+ 'oneOf': [
1690
+ {'$ref': '#/components/schemas/AdCreativeRef'},
1691
+ {'type': 'null'},
1692
+ ],
1693
+ },
1694
+ 'effective_status': {
1695
+ 'type': ['string', 'null'],
1696
+ 'description': 'Effective status',
1697
+ },
1698
+ 'last_updated_by_app_id': {
1699
+ 'type': ['string', 'null'],
1700
+ 'description': 'Last updated by app ID',
1701
+ },
1702
+ 'recommendations': {
1703
+ 'type': ['array', 'null'],
1704
+ 'description': 'Recommendations',
1705
+ 'items': {'$ref': '#/components/schemas/Recommendation'},
1706
+ },
1707
+ 'source_ad_id': {
1708
+ 'type': ['string', 'null'],
1709
+ 'description': 'Source ad ID',
1710
+ },
1711
+ 'status': {
1712
+ 'type': ['string', 'null'],
1713
+ 'description': 'Ad status',
1714
+ },
1715
+ 'tracking_specs': {
1716
+ 'type': ['array', 'null'],
1717
+ 'description': 'Tracking specifications',
1718
+ 'items': {'type': 'object', 'additionalProperties': True},
1719
+ },
1720
+ 'updated_time': {
1721
+ 'type': ['string', 'null'],
1722
+ 'format': 'date-time',
1723
+ 'description': 'Last update time',
1724
+ },
1725
+ },
1726
+ 'required': ['id'],
1727
+ 'x-airbyte-entity-name': 'ads',
1728
+ 'x-airbyte-stream-name': 'ads',
1729
+ },
1730
+ ),
1731
+ EntityDefinition(
1732
+ name='ad_creatives',
1733
+ stream_name='ad_creatives',
1734
+ actions=[Action.LIST],
1735
+ endpoints={
1736
+ Action.LIST: EndpointDefinition(
1737
+ method='GET',
1738
+ path='/act_{account_id}/adcreatives',
1739
+ action=Action.LIST,
1740
+ description='Returns a list of ad creatives for the specified ad account',
1741
+ query_params=['fields', 'limit', 'after'],
1742
+ query_params_schema={
1743
+ 'fields': {
1744
+ 'type': 'string',
1745
+ 'required': False,
1746
+ 'default': 'id,name,account_id,actor_id,body,call_to_action_type,effective_object_story_id,image_hash,image_url,link_url,object_story_id,object_story_spec,object_type,status,thumbnail_url,title,url_tags',
1747
+ },
1748
+ 'limit': {
1749
+ 'type': 'integer',
1750
+ 'required': False,
1751
+ 'default': 25,
1752
+ },
1753
+ 'after': {'type': 'string', 'required': False},
1754
+ },
1755
+ path_params=['account_id'],
1756
+ path_params_schema={
1757
+ 'account_id': {'type': 'string', 'required': True},
1758
+ },
1759
+ response_schema={
1760
+ 'type': 'object',
1761
+ 'properties': {
1762
+ 'data': {
1763
+ 'type': 'array',
1764
+ 'items': {
1765
+ 'type': 'object',
1766
+ 'description': 'Facebook Ad Creative',
1767
+ 'properties': {
1768
+ 'id': {'type': 'string', 'description': 'Ad Creative ID'},
1769
+ 'name': {
1770
+ 'type': ['string', 'null'],
1771
+ 'description': 'Ad Creative name',
1772
+ },
1773
+ 'account_id': {
1774
+ 'type': ['string', 'null'],
1775
+ 'description': 'Ad account ID',
1776
+ },
1777
+ 'actor_id': {
1778
+ 'type': ['string', 'null'],
1779
+ 'description': 'Actor ID (Page ID)',
1780
+ },
1781
+ 'body': {
1782
+ 'type': ['string', 'null'],
1783
+ 'description': 'Ad body text',
1784
+ },
1785
+ 'call_to_action_type': {
1786
+ 'type': ['string', 'null'],
1787
+ 'description': 'Call to action type',
1788
+ },
1789
+ 'effective_object_story_id': {
1790
+ 'type': ['string', 'null'],
1791
+ 'description': 'Effective object story ID',
1792
+ },
1793
+ 'image_hash': {
1794
+ 'type': ['string', 'null'],
1795
+ 'description': 'Image hash',
1796
+ },
1797
+ 'image_url': {
1798
+ 'type': ['string', 'null'],
1799
+ 'description': 'Image URL',
1800
+ },
1801
+ 'link_url': {
1802
+ 'type': ['string', 'null'],
1803
+ 'description': 'Link URL',
1804
+ },
1805
+ 'object_story_id': {
1806
+ 'type': ['string', 'null'],
1807
+ 'description': 'Object story ID',
1808
+ },
1809
+ 'object_story_spec': {
1810
+ 'type': ['object', 'null'],
1811
+ 'description': 'Object story specification',
1812
+ 'additionalProperties': True,
1813
+ },
1814
+ 'object_type': {
1815
+ 'type': ['string', 'null'],
1816
+ 'description': 'Object type',
1817
+ },
1818
+ 'status': {
1819
+ 'type': ['string', 'null'],
1820
+ 'description': 'Creative status',
1821
+ },
1822
+ 'thumbnail_url': {
1823
+ 'type': ['string', 'null'],
1824
+ 'description': 'Thumbnail URL',
1825
+ },
1826
+ 'title': {
1827
+ 'type': ['string', 'null'],
1828
+ 'description': 'Ad title',
1829
+ },
1830
+ 'url_tags': {
1831
+ 'type': ['string', 'null'],
1832
+ 'description': 'URL tags',
1833
+ },
1834
+ },
1835
+ 'required': ['id'],
1836
+ 'x-airbyte-entity-name': 'ad_creatives',
1837
+ 'x-airbyte-stream-name': 'ad_creatives',
1838
+ },
1839
+ },
1840
+ 'paging': {
1841
+ 'type': 'object',
1842
+ 'properties': {
1843
+ 'cursors': {
1844
+ 'type': 'object',
1845
+ 'properties': {
1846
+ 'before': {
1847
+ 'type': ['string', 'null'],
1848
+ 'description': 'Cursor for previous page',
1849
+ },
1850
+ 'after': {
1851
+ 'type': ['string', 'null'],
1852
+ 'description': 'Cursor for next page',
1853
+ },
1854
+ },
1855
+ },
1856
+ 'next': {
1857
+ 'type': ['string', 'null'],
1858
+ 'description': 'URL for next page',
1859
+ },
1860
+ 'previous': {
1861
+ 'type': ['string', 'null'],
1862
+ 'description': 'URL for previous page',
1863
+ },
1864
+ },
1865
+ },
1866
+ },
1867
+ },
1868
+ record_extractor='$.data',
1869
+ meta_extractor={'after': '$.paging.cursors.after'},
1870
+ ),
1871
+ },
1872
+ entity_schema={
1873
+ 'type': 'object',
1874
+ 'description': 'Facebook Ad Creative',
1875
+ 'properties': {
1876
+ 'id': {'type': 'string', 'description': 'Ad Creative ID'},
1877
+ 'name': {
1878
+ 'type': ['string', 'null'],
1879
+ 'description': 'Ad Creative name',
1880
+ },
1881
+ 'account_id': {
1882
+ 'type': ['string', 'null'],
1883
+ 'description': 'Ad account ID',
1884
+ },
1885
+ 'actor_id': {
1886
+ 'type': ['string', 'null'],
1887
+ 'description': 'Actor ID (Page ID)',
1888
+ },
1889
+ 'body': {
1890
+ 'type': ['string', 'null'],
1891
+ 'description': 'Ad body text',
1892
+ },
1893
+ 'call_to_action_type': {
1894
+ 'type': ['string', 'null'],
1895
+ 'description': 'Call to action type',
1896
+ },
1897
+ 'effective_object_story_id': {
1898
+ 'type': ['string', 'null'],
1899
+ 'description': 'Effective object story ID',
1900
+ },
1901
+ 'image_hash': {
1902
+ 'type': ['string', 'null'],
1903
+ 'description': 'Image hash',
1904
+ },
1905
+ 'image_url': {
1906
+ 'type': ['string', 'null'],
1907
+ 'description': 'Image URL',
1908
+ },
1909
+ 'link_url': {
1910
+ 'type': ['string', 'null'],
1911
+ 'description': 'Link URL',
1912
+ },
1913
+ 'object_story_id': {
1914
+ 'type': ['string', 'null'],
1915
+ 'description': 'Object story ID',
1916
+ },
1917
+ 'object_story_spec': {
1918
+ 'type': ['object', 'null'],
1919
+ 'description': 'Object story specification',
1920
+ 'additionalProperties': True,
1921
+ },
1922
+ 'object_type': {
1923
+ 'type': ['string', 'null'],
1924
+ 'description': 'Object type',
1925
+ },
1926
+ 'status': {
1927
+ 'type': ['string', 'null'],
1928
+ 'description': 'Creative status',
1929
+ },
1930
+ 'thumbnail_url': {
1931
+ 'type': ['string', 'null'],
1932
+ 'description': 'Thumbnail URL',
1933
+ },
1934
+ 'title': {
1935
+ 'type': ['string', 'null'],
1936
+ 'description': 'Ad title',
1937
+ },
1938
+ 'url_tags': {
1939
+ 'type': ['string', 'null'],
1940
+ 'description': 'URL tags',
1941
+ },
1942
+ },
1943
+ 'required': ['id'],
1944
+ 'x-airbyte-entity-name': 'ad_creatives',
1945
+ 'x-airbyte-stream-name': 'ad_creatives',
1946
+ },
1947
+ ),
1948
+ EntityDefinition(
1949
+ name='ads_insights',
1950
+ stream_name='ads_insights',
1951
+ actions=[Action.LIST],
1952
+ endpoints={
1953
+ Action.LIST: EndpointDefinition(
1954
+ method='GET',
1955
+ path='/act_{account_id}/insights',
1956
+ action=Action.LIST,
1957
+ description='Returns performance insights for the specified ad account',
1958
+ query_params=[
1959
+ 'fields',
1960
+ 'date_preset',
1961
+ 'time_range',
1962
+ 'level',
1963
+ 'limit',
1964
+ 'after',
1965
+ ],
1966
+ query_params_schema={
1967
+ 'fields': {
1968
+ 'type': 'string',
1969
+ 'required': False,
1970
+ 'default': 'account_id,account_name,campaign_id,campaign_name,adset_id,adset_name,ad_id,ad_name,clicks,impressions,reach,spend,cpc,cpm,ctr,date_start,date_stop',
1971
+ },
1972
+ 'date_preset': {'type': 'string', 'required': False},
1973
+ 'time_range': {'type': 'string', 'required': False},
1974
+ 'level': {
1975
+ 'type': 'string',
1976
+ 'required': False,
1977
+ 'default': 'account',
1978
+ },
1979
+ 'limit': {
1980
+ 'type': 'integer',
1981
+ 'required': False,
1982
+ 'default': 25,
1983
+ },
1984
+ 'after': {'type': 'string', 'required': False},
1985
+ },
1986
+ path_params=['account_id'],
1987
+ path_params_schema={
1988
+ 'account_id': {'type': 'string', 'required': True},
1989
+ },
1990
+ response_schema={
1991
+ 'type': 'object',
1992
+ 'properties': {
1993
+ 'data': {
1994
+ 'type': 'array',
1995
+ 'items': {
1996
+ 'type': 'object',
1997
+ 'description': 'Facebook Ads Insight',
1998
+ 'properties': {
1999
+ 'account_id': {
2000
+ 'type': ['string', 'null'],
2001
+ 'description': 'Ad account ID',
2002
+ },
2003
+ 'account_name': {
2004
+ 'type': ['string', 'null'],
2005
+ 'description': 'Ad account name',
2006
+ },
2007
+ 'campaign_id': {
2008
+ 'type': ['string', 'null'],
2009
+ 'description': 'Campaign ID',
2010
+ },
2011
+ 'campaign_name': {
2012
+ 'type': ['string', 'null'],
2013
+ 'description': 'Campaign name',
2014
+ },
2015
+ 'adset_id': {
2016
+ 'type': ['string', 'null'],
2017
+ 'description': 'Ad set ID',
2018
+ },
2019
+ 'adset_name': {
2020
+ 'type': ['string', 'null'],
2021
+ 'description': 'Ad set name',
2022
+ },
2023
+ 'ad_id': {
2024
+ 'type': ['string', 'null'],
2025
+ 'description': 'Ad ID',
2026
+ },
2027
+ 'ad_name': {
2028
+ 'type': ['string', 'null'],
2029
+ 'description': 'Ad name',
2030
+ },
2031
+ 'clicks': {
2032
+ 'type': ['integer', 'null'],
2033
+ 'description': 'Number of clicks',
2034
+ },
2035
+ 'impressions': {
2036
+ 'type': ['integer', 'null'],
2037
+ 'description': 'Number of impressions',
2038
+ },
2039
+ 'reach': {
2040
+ 'type': ['integer', 'null'],
2041
+ 'description': 'Number of people reached',
2042
+ },
2043
+ 'spend': {
2044
+ 'type': ['number', 'null'],
2045
+ 'description': 'Amount spent',
2046
+ },
2047
+ 'cpc': {
2048
+ 'type': ['number', 'null'],
2049
+ 'description': 'Cost per click',
2050
+ },
2051
+ 'cpm': {
2052
+ 'type': ['number', 'null'],
2053
+ 'description': 'Cost per 1000 impressions',
2054
+ },
2055
+ 'ctr': {
2056
+ 'type': ['number', 'null'],
2057
+ 'description': 'Click-through rate',
2058
+ },
2059
+ 'date_start': {
2060
+ 'type': ['string', 'null'],
2061
+ 'format': 'date',
2062
+ 'description': 'Start date of the data',
2063
+ },
2064
+ 'date_stop': {
2065
+ 'type': ['string', 'null'],
2066
+ 'format': 'date',
2067
+ 'description': 'End date of the data',
2068
+ },
2069
+ },
2070
+ 'x-airbyte-entity-name': 'ads_insights',
2071
+ 'x-airbyte-stream-name': 'ads_insights',
2072
+ },
2073
+ },
2074
+ 'paging': {
2075
+ 'type': 'object',
2076
+ 'properties': {
2077
+ 'cursors': {
2078
+ 'type': 'object',
2079
+ 'properties': {
2080
+ 'before': {
2081
+ 'type': ['string', 'null'],
2082
+ 'description': 'Cursor for previous page',
2083
+ },
2084
+ 'after': {
2085
+ 'type': ['string', 'null'],
2086
+ 'description': 'Cursor for next page',
2087
+ },
2088
+ },
2089
+ },
2090
+ 'next': {
2091
+ 'type': ['string', 'null'],
2092
+ 'description': 'URL for next page',
2093
+ },
2094
+ 'previous': {
2095
+ 'type': ['string', 'null'],
2096
+ 'description': 'URL for previous page',
2097
+ },
2098
+ },
2099
+ },
2100
+ },
2101
+ },
2102
+ record_extractor='$.data',
2103
+ meta_extractor={'after': '$.paging.cursors.after'},
2104
+ ),
2105
+ },
2106
+ entity_schema={
2107
+ 'type': 'object',
2108
+ 'description': 'Facebook Ads Insight',
2109
+ 'properties': {
2110
+ 'account_id': {
2111
+ 'type': ['string', 'null'],
2112
+ 'description': 'Ad account ID',
2113
+ },
2114
+ 'account_name': {
2115
+ 'type': ['string', 'null'],
2116
+ 'description': 'Ad account name',
2117
+ },
2118
+ 'campaign_id': {
2119
+ 'type': ['string', 'null'],
2120
+ 'description': 'Campaign ID',
2121
+ },
2122
+ 'campaign_name': {
2123
+ 'type': ['string', 'null'],
2124
+ 'description': 'Campaign name',
2125
+ },
2126
+ 'adset_id': {
2127
+ 'type': ['string', 'null'],
2128
+ 'description': 'Ad set ID',
2129
+ },
2130
+ 'adset_name': {
2131
+ 'type': ['string', 'null'],
2132
+ 'description': 'Ad set name',
2133
+ },
2134
+ 'ad_id': {
2135
+ 'type': ['string', 'null'],
2136
+ 'description': 'Ad ID',
2137
+ },
2138
+ 'ad_name': {
2139
+ 'type': ['string', 'null'],
2140
+ 'description': 'Ad name',
2141
+ },
2142
+ 'clicks': {
2143
+ 'type': ['integer', 'null'],
2144
+ 'description': 'Number of clicks',
2145
+ },
2146
+ 'impressions': {
2147
+ 'type': ['integer', 'null'],
2148
+ 'description': 'Number of impressions',
2149
+ },
2150
+ 'reach': {
2151
+ 'type': ['integer', 'null'],
2152
+ 'description': 'Number of people reached',
2153
+ },
2154
+ 'spend': {
2155
+ 'type': ['number', 'null'],
2156
+ 'description': 'Amount spent',
2157
+ },
2158
+ 'cpc': {
2159
+ 'type': ['number', 'null'],
2160
+ 'description': 'Cost per click',
2161
+ },
2162
+ 'cpm': {
2163
+ 'type': ['number', 'null'],
2164
+ 'description': 'Cost per 1000 impressions',
2165
+ },
2166
+ 'ctr': {
2167
+ 'type': ['number', 'null'],
2168
+ 'description': 'Click-through rate',
2169
+ },
2170
+ 'date_start': {
2171
+ 'type': ['string', 'null'],
2172
+ 'format': 'date',
2173
+ 'description': 'Start date of the data',
2174
+ },
2175
+ 'date_stop': {
2176
+ 'type': ['string', 'null'],
2177
+ 'format': 'date',
2178
+ 'description': 'End date of the data',
2179
+ },
2180
+ },
2181
+ 'x-airbyte-entity-name': 'ads_insights',
2182
+ 'x-airbyte-stream-name': 'ads_insights',
2183
+ },
2184
+ ),
2185
+ EntityDefinition(
2186
+ name='custom_conversions',
2187
+ stream_name='custom_conversions',
2188
+ actions=[Action.LIST],
2189
+ endpoints={
2190
+ Action.LIST: EndpointDefinition(
2191
+ method='GET',
2192
+ path='/act_{account_id}/customconversions',
2193
+ action=Action.LIST,
2194
+ description='Returns a list of custom conversions for the specified ad account',
2195
+ query_params=['fields', 'limit', 'after'],
2196
+ query_params_schema={
2197
+ 'fields': {
2198
+ 'type': 'string',
2199
+ 'required': False,
2200
+ 'default': 'id,name,account_id,business,creation_time,custom_event_type,data_sources,default_conversion_value,description,event_source_type,first_fired_time,is_archived,is_unavailable,last_fired_time,offline_conversion_data_set,retention_days,rule',
2201
+ },
2202
+ 'limit': {
2203
+ 'type': 'integer',
2204
+ 'required': False,
2205
+ 'default': 25,
2206
+ },
2207
+ 'after': {'type': 'string', 'required': False},
2208
+ },
2209
+ path_params=['account_id'],
2210
+ path_params_schema={
2211
+ 'account_id': {'type': 'string', 'required': True},
2212
+ },
2213
+ response_schema={
2214
+ 'type': 'object',
2215
+ 'properties': {
2216
+ 'data': {
2217
+ 'type': 'array',
2218
+ 'items': {
2219
+ 'type': 'object',
2220
+ 'description': 'Facebook Custom Conversion',
2221
+ 'properties': {
2222
+ 'id': {'type': 'string', 'description': 'Custom Conversion ID'},
2223
+ 'name': {
2224
+ 'type': ['string', 'null'],
2225
+ 'description': 'Custom Conversion name',
2226
+ },
2227
+ 'account_id': {
2228
+ 'type': ['string', 'null'],
2229
+ 'description': 'Ad account ID',
2230
+ },
2231
+ 'business': {
2232
+ 'type': ['string', 'null'],
2233
+ 'description': 'Business ID',
2234
+ },
2235
+ 'creation_time': {
2236
+ 'type': ['string', 'null'],
2237
+ 'format': 'date-time',
2238
+ 'description': 'Creation time',
2239
+ },
2240
+ 'custom_event_type': {
2241
+ 'type': ['string', 'null'],
2242
+ 'description': 'Custom event type',
2243
+ },
2244
+ 'data_sources': {
2245
+ 'type': ['array', 'null'],
2246
+ 'description': 'Data sources',
2247
+ 'items': {
2248
+ 'type': 'object',
2249
+ 'properties': {
2250
+ 'id': {
2251
+ 'type': ['string', 'null'],
2252
+ 'description': 'Data source ID',
2253
+ },
2254
+ 'source_type': {
2255
+ 'type': ['string', 'null'],
2256
+ 'description': 'Source type',
2257
+ },
2258
+ 'name': {
2259
+ 'type': ['string', 'null'],
2260
+ 'description': 'Data source name',
2261
+ },
2262
+ },
2263
+ },
2264
+ },
2265
+ 'default_conversion_value': {
2266
+ 'type': ['number', 'null'],
2267
+ 'description': 'Default conversion value',
2268
+ },
2269
+ 'description': {
2270
+ 'type': ['string', 'null'],
2271
+ 'description': 'Description',
2272
+ },
2273
+ 'event_source_type': {
2274
+ 'type': ['string', 'null'],
2275
+ 'description': 'Event source type',
2276
+ },
2277
+ 'first_fired_time': {
2278
+ 'type': ['string', 'null'],
2279
+ 'format': 'date-time',
2280
+ 'description': 'First fired time',
2281
+ },
2282
+ 'is_archived': {
2283
+ 'type': ['boolean', 'null'],
2284
+ 'description': 'Whether archived',
2285
+ },
2286
+ 'is_unavailable': {
2287
+ 'type': ['boolean', 'null'],
2288
+ 'description': 'Whether unavailable',
2289
+ },
2290
+ 'last_fired_time': {
2291
+ 'type': ['string', 'null'],
2292
+ 'format': 'date-time',
2293
+ 'description': 'Last fired time',
2294
+ },
2295
+ 'offline_conversion_data_set': {
2296
+ 'type': ['string', 'null'],
2297
+ 'description': 'Offline conversion data set ID',
2298
+ },
2299
+ 'retention_days': {
2300
+ 'type': ['number', 'null'],
2301
+ 'description': 'Retention days',
2302
+ },
2303
+ 'rule': {
2304
+ 'type': ['string', 'null'],
2305
+ 'description': 'Rule definition',
2306
+ },
2307
+ },
2308
+ 'required': ['id'],
2309
+ 'x-airbyte-entity-name': 'custom_conversions',
2310
+ 'x-airbyte-stream-name': 'custom_conversions',
2311
+ },
2312
+ },
2313
+ 'paging': {
2314
+ 'type': 'object',
2315
+ 'properties': {
2316
+ 'cursors': {
2317
+ 'type': 'object',
2318
+ 'properties': {
2319
+ 'before': {
2320
+ 'type': ['string', 'null'],
2321
+ 'description': 'Cursor for previous page',
2322
+ },
2323
+ 'after': {
2324
+ 'type': ['string', 'null'],
2325
+ 'description': 'Cursor for next page',
2326
+ },
2327
+ },
2328
+ },
2329
+ 'next': {
2330
+ 'type': ['string', 'null'],
2331
+ 'description': 'URL for next page',
2332
+ },
2333
+ 'previous': {
2334
+ 'type': ['string', 'null'],
2335
+ 'description': 'URL for previous page',
2336
+ },
2337
+ },
2338
+ },
2339
+ },
2340
+ },
2341
+ record_extractor='$.data',
2342
+ meta_extractor={'after': '$.paging.cursors.after'},
2343
+ ),
2344
+ },
2345
+ entity_schema={
2346
+ 'type': 'object',
2347
+ 'description': 'Facebook Custom Conversion',
2348
+ 'properties': {
2349
+ 'id': {'type': 'string', 'description': 'Custom Conversion ID'},
2350
+ 'name': {
2351
+ 'type': ['string', 'null'],
2352
+ 'description': 'Custom Conversion name',
2353
+ },
2354
+ 'account_id': {
2355
+ 'type': ['string', 'null'],
2356
+ 'description': 'Ad account ID',
2357
+ },
2358
+ 'business': {
2359
+ 'type': ['string', 'null'],
2360
+ 'description': 'Business ID',
2361
+ },
2362
+ 'creation_time': {
2363
+ 'type': ['string', 'null'],
2364
+ 'format': 'date-time',
2365
+ 'description': 'Creation time',
2366
+ },
2367
+ 'custom_event_type': {
2368
+ 'type': ['string', 'null'],
2369
+ 'description': 'Custom event type',
2370
+ },
2371
+ 'data_sources': {
2372
+ 'type': ['array', 'null'],
2373
+ 'description': 'Data sources',
2374
+ 'items': {'$ref': '#/components/schemas/DataSource'},
2375
+ },
2376
+ 'default_conversion_value': {
2377
+ 'type': ['number', 'null'],
2378
+ 'description': 'Default conversion value',
2379
+ },
2380
+ 'description': {
2381
+ 'type': ['string', 'null'],
2382
+ 'description': 'Description',
2383
+ },
2384
+ 'event_source_type': {
2385
+ 'type': ['string', 'null'],
2386
+ 'description': 'Event source type',
2387
+ },
2388
+ 'first_fired_time': {
2389
+ 'type': ['string', 'null'],
2390
+ 'format': 'date-time',
2391
+ 'description': 'First fired time',
2392
+ },
2393
+ 'is_archived': {
2394
+ 'type': ['boolean', 'null'],
2395
+ 'description': 'Whether archived',
2396
+ },
2397
+ 'is_unavailable': {
2398
+ 'type': ['boolean', 'null'],
2399
+ 'description': 'Whether unavailable',
2400
+ },
2401
+ 'last_fired_time': {
2402
+ 'type': ['string', 'null'],
2403
+ 'format': 'date-time',
2404
+ 'description': 'Last fired time',
2405
+ },
2406
+ 'offline_conversion_data_set': {
2407
+ 'type': ['string', 'null'],
2408
+ 'description': 'Offline conversion data set ID',
2409
+ },
2410
+ 'retention_days': {
2411
+ 'type': ['number', 'null'],
2412
+ 'description': 'Retention days',
2413
+ },
2414
+ 'rule': {
2415
+ 'type': ['string', 'null'],
2416
+ 'description': 'Rule definition',
2417
+ },
2418
+ },
2419
+ 'required': ['id'],
2420
+ 'x-airbyte-entity-name': 'custom_conversions',
2421
+ 'x-airbyte-stream-name': 'custom_conversions',
2422
+ },
2423
+ ),
2424
+ EntityDefinition(
2425
+ name='images',
2426
+ stream_name='images',
2427
+ actions=[Action.LIST],
2428
+ endpoints={
2429
+ Action.LIST: EndpointDefinition(
2430
+ method='GET',
2431
+ path='/act_{account_id}/adimages',
2432
+ action=Action.LIST,
2433
+ description='Returns a list of ad images for the specified ad account',
2434
+ query_params=['fields', 'limit', 'after'],
2435
+ query_params_schema={
2436
+ 'fields': {
2437
+ 'type': 'string',
2438
+ 'required': False,
2439
+ 'default': 'id,name,account_id,created_time,creatives,filename,hash,height,is_associated_creatives_in_adgroups,original_height,original_width,permalink_url,status,updated_time,url,url_128,width',
2440
+ },
2441
+ 'limit': {
2442
+ 'type': 'integer',
2443
+ 'required': False,
2444
+ 'default': 25,
2445
+ },
2446
+ 'after': {'type': 'string', 'required': False},
2447
+ },
2448
+ path_params=['account_id'],
2449
+ path_params_schema={
2450
+ 'account_id': {'type': 'string', 'required': True},
2451
+ },
2452
+ response_schema={
2453
+ 'type': 'object',
2454
+ 'properties': {
2455
+ 'data': {
2456
+ 'type': 'array',
2457
+ 'items': {
2458
+ 'type': 'object',
2459
+ 'properties': {
2460
+ 'id': {
2461
+ 'type': ['string', 'null'],
2462
+ 'description': 'Image ID',
2463
+ },
2464
+ 'name': {
2465
+ 'type': ['string', 'null'],
2466
+ 'description': 'Image name',
2467
+ },
2468
+ 'account_id': {
2469
+ 'type': ['string', 'null'],
2470
+ 'description': 'Ad account ID',
2471
+ },
2472
+ 'created_time': {
2473
+ 'type': ['string', 'null'],
2474
+ 'format': 'date-time',
2475
+ 'description': 'Creation time',
2476
+ },
2477
+ 'creatives': {
2478
+ 'type': ['array', 'null'],
2479
+ 'description': 'Associated creatives',
2480
+ 'items': {
2481
+ 'type': ['string', 'null'],
2482
+ },
2483
+ },
2484
+ 'filename': {
2485
+ 'type': ['string', 'null'],
2486
+ 'description': 'Filename',
2487
+ },
2488
+ 'hash': {
2489
+ 'type': ['string', 'null'],
2490
+ 'description': 'Image hash',
2491
+ },
2492
+ 'height': {
2493
+ 'type': ['integer', 'null'],
2494
+ 'description': 'Image height',
2495
+ },
2496
+ 'is_associated_creatives_in_adgroups': {
2497
+ 'type': ['boolean', 'null'],
2498
+ 'description': 'Whether associated with creatives in ad groups',
2499
+ },
2500
+ 'original_height': {
2501
+ 'type': ['integer', 'null'],
2502
+ 'description': 'Original height',
2503
+ },
2504
+ 'original_width': {
2505
+ 'type': ['integer', 'null'],
2506
+ 'description': 'Original width',
2507
+ },
2508
+ 'permalink_url': {
2509
+ 'type': ['string', 'null'],
2510
+ 'description': 'Permalink URL',
2511
+ },
2512
+ 'status': {
2513
+ 'type': ['string', 'null'],
2514
+ 'description': 'Image status',
2515
+ },
2516
+ 'updated_time': {
2517
+ 'type': ['string', 'null'],
2518
+ 'format': 'date-time',
2519
+ 'description': 'Last update time',
2520
+ },
2521
+ 'url': {
2522
+ 'type': ['string', 'null'],
2523
+ 'description': 'Image URL',
2524
+ },
2525
+ 'url_128': {
2526
+ 'type': ['string', 'null'],
2527
+ 'description': '128px thumbnail URL',
2528
+ },
2529
+ 'width': {
2530
+ 'type': ['integer', 'null'],
2531
+ 'description': 'Image width',
2532
+ },
2533
+ },
2534
+ 'x-airbyte-entity-name': 'images',
2535
+ 'x-airbyte-stream-name': 'images',
2536
+ },
2537
+ },
2538
+ 'paging': {
2539
+ 'type': 'object',
2540
+ 'properties': {
2541
+ 'cursors': {
2542
+ 'type': 'object',
2543
+ 'properties': {
2544
+ 'before': {
2545
+ 'type': ['string', 'null'],
2546
+ 'description': 'Cursor for previous page',
2547
+ },
2548
+ 'after': {
2549
+ 'type': ['string', 'null'],
2550
+ 'description': 'Cursor for next page',
2551
+ },
2552
+ },
2553
+ },
2554
+ 'next': {
2555
+ 'type': ['string', 'null'],
2556
+ 'description': 'URL for next page',
2557
+ },
2558
+ 'previous': {
2559
+ 'type': ['string', 'null'],
2560
+ 'description': 'URL for previous page',
2561
+ },
2562
+ },
2563
+ },
2564
+ },
2565
+ },
2566
+ record_extractor='$.data',
2567
+ meta_extractor={'after': '$.paging.cursors.after'},
2568
+ ),
2569
+ },
2570
+ entity_schema={
2571
+ 'type': 'object',
2572
+ 'properties': {
2573
+ 'id': {
2574
+ 'type': ['string', 'null'],
2575
+ 'description': 'Image ID',
2576
+ },
2577
+ 'name': {
2578
+ 'type': ['string', 'null'],
2579
+ 'description': 'Image name',
2580
+ },
2581
+ 'account_id': {
2582
+ 'type': ['string', 'null'],
2583
+ 'description': 'Ad account ID',
2584
+ },
2585
+ 'created_time': {
2586
+ 'type': ['string', 'null'],
2587
+ 'format': 'date-time',
2588
+ 'description': 'Creation time',
2589
+ },
2590
+ 'creatives': {
2591
+ 'type': ['array', 'null'],
2592
+ 'description': 'Associated creatives',
2593
+ 'items': {
2594
+ 'type': ['string', 'null'],
2595
+ },
2596
+ },
2597
+ 'filename': {
2598
+ 'type': ['string', 'null'],
2599
+ 'description': 'Filename',
2600
+ },
2601
+ 'hash': {
2602
+ 'type': ['string', 'null'],
2603
+ 'description': 'Image hash',
2604
+ },
2605
+ 'height': {
2606
+ 'type': ['integer', 'null'],
2607
+ 'description': 'Image height',
2608
+ },
2609
+ 'is_associated_creatives_in_adgroups': {
2610
+ 'type': ['boolean', 'null'],
2611
+ 'description': 'Whether associated with creatives in ad groups',
2612
+ },
2613
+ 'original_height': {
2614
+ 'type': ['integer', 'null'],
2615
+ 'description': 'Original height',
2616
+ },
2617
+ 'original_width': {
2618
+ 'type': ['integer', 'null'],
2619
+ 'description': 'Original width',
2620
+ },
2621
+ 'permalink_url': {
2622
+ 'type': ['string', 'null'],
2623
+ 'description': 'Permalink URL',
2624
+ },
2625
+ 'status': {
2626
+ 'type': ['string', 'null'],
2627
+ 'description': 'Image status',
2628
+ },
2629
+ 'updated_time': {
2630
+ 'type': ['string', 'null'],
2631
+ 'format': 'date-time',
2632
+ 'description': 'Last update time',
2633
+ },
2634
+ 'url': {
2635
+ 'type': ['string', 'null'],
2636
+ 'description': 'Image URL',
2637
+ },
2638
+ 'url_128': {
2639
+ 'type': ['string', 'null'],
2640
+ 'description': '128px thumbnail URL',
2641
+ },
2642
+ 'width': {
2643
+ 'type': ['integer', 'null'],
2644
+ 'description': 'Image width',
2645
+ },
2646
+ },
2647
+ 'x-airbyte-entity-name': 'images',
2648
+ 'x-airbyte-stream-name': 'images',
2649
+ },
2650
+ ),
2651
+ EntityDefinition(
2652
+ name='videos',
2653
+ stream_name='videos',
2654
+ actions=[Action.LIST],
2655
+ endpoints={
2656
+ Action.LIST: EndpointDefinition(
2657
+ method='GET',
2658
+ path='/act_{account_id}/advideos',
2659
+ action=Action.LIST,
2660
+ description='Returns a list of ad videos for the specified ad account',
2661
+ query_params=['fields', 'limit', 'after'],
2662
+ query_params_schema={
2663
+ 'fields': {
2664
+ 'type': 'string',
2665
+ 'required': False,
2666
+ 'default': 'id,title,account_id,ad_breaks,backdated_time,backdated_time_granularity,content_category,content_tags,created_time,custom_labels,description,embed_html,embeddable,format,icon,is_crosspost_video,is_crossposting_eligible,is_episode,is_instagram_eligible,length,live_status,permalink_url,post_views,premiere_living_room_status,published,scheduled_publish_time,source,universal_video_id,updated_time,views',
2667
+ },
2668
+ 'limit': {
2669
+ 'type': 'integer',
2670
+ 'required': False,
2671
+ 'default': 25,
2672
+ },
2673
+ 'after': {'type': 'string', 'required': False},
2674
+ },
2675
+ path_params=['account_id'],
2676
+ path_params_schema={
2677
+ 'account_id': {'type': 'string', 'required': True},
2678
+ },
2679
+ response_schema={
2680
+ 'type': 'object',
2681
+ 'properties': {
2682
+ 'data': {
2683
+ 'type': 'array',
2684
+ 'items': {
2685
+ 'type': 'object',
2686
+ 'properties': {
2687
+ 'id': {'type': 'string', 'description': 'Video ID'},
2688
+ 'title': {
2689
+ 'type': ['string', 'null'],
2690
+ 'description': 'Video title',
2691
+ },
2692
+ 'account_id': {
2693
+ 'type': ['string', 'null'],
2694
+ 'description': 'Ad account ID',
2695
+ },
2696
+ 'ad_breaks': {
2697
+ 'type': ['array', 'null'],
2698
+ 'description': 'Ad breaks',
2699
+ 'items': {'type': 'integer'},
2700
+ },
2701
+ 'backdated_time': {
2702
+ 'type': ['string', 'null'],
2703
+ 'format': 'date-time',
2704
+ 'description': 'Backdated time',
2705
+ },
2706
+ 'backdated_time_granularity': {
2707
+ 'type': ['string', 'null'],
2708
+ 'description': 'Backdated time granularity',
2709
+ },
2710
+ 'content_category': {
2711
+ 'type': ['string', 'null'],
2712
+ 'description': 'Content category',
2713
+ },
2714
+ 'content_tags': {
2715
+ 'type': ['array', 'null'],
2716
+ 'description': 'Content tags',
2717
+ 'items': {'type': 'string'},
2718
+ },
2719
+ 'created_time': {
2720
+ 'type': ['string', 'null'],
2721
+ 'format': 'date-time',
2722
+ 'description': 'Creation time',
2723
+ },
2724
+ 'custom_labels': {
2725
+ 'type': ['array', 'null'],
2726
+ 'description': 'Custom labels',
2727
+ 'items': {'type': 'string'},
2728
+ },
2729
+ 'description': {
2730
+ 'type': ['string', 'null'],
2731
+ 'description': 'Video description',
2732
+ },
2733
+ 'embed_html': {
2734
+ 'type': ['string', 'null'],
2735
+ 'description': 'Embed HTML',
2736
+ },
2737
+ 'embeddable': {
2738
+ 'type': ['boolean', 'null'],
2739
+ 'description': 'Whether embeddable',
2740
+ },
2741
+ 'format': {
2742
+ 'type': ['array', 'null'],
2743
+ 'description': 'Video formats',
2744
+ 'items': {
2745
+ 'type': 'object',
2746
+ 'properties': {
2747
+ 'filter': {
2748
+ 'type': ['string', 'null'],
2749
+ 'description': 'Format filter',
2750
+ },
2751
+ 'embed_html': {
2752
+ 'type': ['string', 'null'],
2753
+ 'description': 'Embed HTML',
2754
+ },
2755
+ 'width': {
2756
+ 'type': ['integer', 'null'],
2757
+ 'description': 'Width',
2758
+ },
2759
+ 'height': {
2760
+ 'type': ['integer', 'null'],
2761
+ 'description': 'Height',
2762
+ },
2763
+ 'picture': {
2764
+ 'type': ['string', 'null'],
2765
+ 'description': 'Picture URL',
2766
+ },
2767
+ },
2768
+ },
2769
+ },
2770
+ 'icon': {
2771
+ 'type': ['string', 'null'],
2772
+ 'description': 'Icon URL',
2773
+ },
2774
+ 'is_crosspost_video': {
2775
+ 'type': ['boolean', 'null'],
2776
+ 'description': 'Whether crosspost video',
2777
+ },
2778
+ 'is_crossposting_eligible': {
2779
+ 'type': ['boolean', 'null'],
2780
+ 'description': 'Whether eligible for crossposting',
2781
+ },
2782
+ 'is_episode': {
2783
+ 'type': ['boolean', 'null'],
2784
+ 'description': 'Whether episode',
2785
+ },
2786
+ 'is_instagram_eligible': {
2787
+ 'type': ['boolean', 'null'],
2788
+ 'description': 'Whether Instagram eligible',
2789
+ },
2790
+ 'length': {
2791
+ 'type': ['number', 'null'],
2792
+ 'description': 'Video length in seconds',
2793
+ },
2794
+ 'live_status': {
2795
+ 'type': ['string', 'null'],
2796
+ 'description': 'Live status',
2797
+ },
2798
+ 'permalink_url': {
2799
+ 'type': ['string', 'null'],
2800
+ 'description': 'Permalink URL',
2801
+ },
2802
+ 'post_views': {
2803
+ 'type': ['integer', 'null'],
2804
+ 'description': 'Post views',
2805
+ },
2806
+ 'premiere_living_room_status': {
2807
+ 'type': ['boolean', 'null'],
2808
+ 'description': 'Premiere living room status',
2809
+ },
2810
+ 'published': {
2811
+ 'type': ['boolean', 'null'],
2812
+ 'description': 'Whether published',
2813
+ },
2814
+ 'scheduled_publish_time': {
2815
+ 'type': ['string', 'null'],
2816
+ 'format': 'date-time',
2817
+ 'description': 'Scheduled publish time',
2818
+ },
2819
+ 'source': {
2820
+ 'type': ['string', 'null'],
2821
+ 'description': 'Video source URL',
2822
+ },
2823
+ 'universal_video_id': {
2824
+ 'type': ['string', 'null'],
2825
+ 'description': 'Universal video ID',
2826
+ },
2827
+ 'updated_time': {
2828
+ 'type': ['string', 'null'],
2829
+ 'format': 'date-time',
2830
+ 'description': 'Last update time',
2831
+ },
2832
+ 'views': {
2833
+ 'type': ['integer', 'null'],
2834
+ 'description': 'View count',
2835
+ },
2836
+ },
2837
+ 'required': ['id'],
2838
+ 'x-airbyte-entity-name': 'videos',
2839
+ 'x-airbyte-stream-name': 'videos',
2840
+ },
2841
+ },
2842
+ 'paging': {
2843
+ 'type': 'object',
2844
+ 'properties': {
2845
+ 'cursors': {
2846
+ 'type': 'object',
2847
+ 'properties': {
2848
+ 'before': {
2849
+ 'type': ['string', 'null'],
2850
+ 'description': 'Cursor for previous page',
2851
+ },
2852
+ 'after': {
2853
+ 'type': ['string', 'null'],
2854
+ 'description': 'Cursor for next page',
2855
+ },
2856
+ },
2857
+ },
2858
+ 'next': {
2859
+ 'type': ['string', 'null'],
2860
+ 'description': 'URL for next page',
2861
+ },
2862
+ 'previous': {
2863
+ 'type': ['string', 'null'],
2864
+ 'description': 'URL for previous page',
2865
+ },
2866
+ },
2867
+ },
2868
+ },
2869
+ },
2870
+ record_extractor='$.data',
2871
+ meta_extractor={'after': '$.paging.cursors.after'},
2872
+ ),
2873
+ },
2874
+ entity_schema={
2875
+ 'type': 'object',
2876
+ 'properties': {
2877
+ 'id': {'type': 'string', 'description': 'Video ID'},
2878
+ 'title': {
2879
+ 'type': ['string', 'null'],
2880
+ 'description': 'Video title',
2881
+ },
2882
+ 'account_id': {
2883
+ 'type': ['string', 'null'],
2884
+ 'description': 'Ad account ID',
2885
+ },
2886
+ 'ad_breaks': {
2887
+ 'type': ['array', 'null'],
2888
+ 'description': 'Ad breaks',
2889
+ 'items': {'type': 'integer'},
2890
+ },
2891
+ 'backdated_time': {
2892
+ 'type': ['string', 'null'],
2893
+ 'format': 'date-time',
2894
+ 'description': 'Backdated time',
2895
+ },
2896
+ 'backdated_time_granularity': {
2897
+ 'type': ['string', 'null'],
2898
+ 'description': 'Backdated time granularity',
2899
+ },
2900
+ 'content_category': {
2901
+ 'type': ['string', 'null'],
2902
+ 'description': 'Content category',
2903
+ },
2904
+ 'content_tags': {
2905
+ 'type': ['array', 'null'],
2906
+ 'description': 'Content tags',
2907
+ 'items': {'type': 'string'},
2908
+ },
2909
+ 'created_time': {
2910
+ 'type': ['string', 'null'],
2911
+ 'format': 'date-time',
2912
+ 'description': 'Creation time',
2913
+ },
2914
+ 'custom_labels': {
2915
+ 'type': ['array', 'null'],
2916
+ 'description': 'Custom labels',
2917
+ 'items': {'type': 'string'},
2918
+ },
2919
+ 'description': {
2920
+ 'type': ['string', 'null'],
2921
+ 'description': 'Video description',
2922
+ },
2923
+ 'embed_html': {
2924
+ 'type': ['string', 'null'],
2925
+ 'description': 'Embed HTML',
2926
+ },
2927
+ 'embeddable': {
2928
+ 'type': ['boolean', 'null'],
2929
+ 'description': 'Whether embeddable',
2930
+ },
2931
+ 'format': {
2932
+ 'type': ['array', 'null'],
2933
+ 'description': 'Video formats',
2934
+ 'items': {'$ref': '#/components/schemas/VideoFormat'},
2935
+ },
2936
+ 'icon': {
2937
+ 'type': ['string', 'null'],
2938
+ 'description': 'Icon URL',
2939
+ },
2940
+ 'is_crosspost_video': {
2941
+ 'type': ['boolean', 'null'],
2942
+ 'description': 'Whether crosspost video',
2943
+ },
2944
+ 'is_crossposting_eligible': {
2945
+ 'type': ['boolean', 'null'],
2946
+ 'description': 'Whether eligible for crossposting',
2947
+ },
2948
+ 'is_episode': {
2949
+ 'type': ['boolean', 'null'],
2950
+ 'description': 'Whether episode',
2951
+ },
2952
+ 'is_instagram_eligible': {
2953
+ 'type': ['boolean', 'null'],
2954
+ 'description': 'Whether Instagram eligible',
2955
+ },
2956
+ 'length': {
2957
+ 'type': ['number', 'null'],
2958
+ 'description': 'Video length in seconds',
2959
+ },
2960
+ 'live_status': {
2961
+ 'type': ['string', 'null'],
2962
+ 'description': 'Live status',
2963
+ },
2964
+ 'permalink_url': {
2965
+ 'type': ['string', 'null'],
2966
+ 'description': 'Permalink URL',
2967
+ },
2968
+ 'post_views': {
2969
+ 'type': ['integer', 'null'],
2970
+ 'description': 'Post views',
2971
+ },
2972
+ 'premiere_living_room_status': {
2973
+ 'type': ['boolean', 'null'],
2974
+ 'description': 'Premiere living room status',
2975
+ },
2976
+ 'published': {
2977
+ 'type': ['boolean', 'null'],
2978
+ 'description': 'Whether published',
2979
+ },
2980
+ 'scheduled_publish_time': {
2981
+ 'type': ['string', 'null'],
2982
+ 'format': 'date-time',
2983
+ 'description': 'Scheduled publish time',
2984
+ },
2985
+ 'source': {
2986
+ 'type': ['string', 'null'],
2987
+ 'description': 'Video source URL',
2988
+ },
2989
+ 'universal_video_id': {
2990
+ 'type': ['string', 'null'],
2991
+ 'description': 'Universal video ID',
2992
+ },
2993
+ 'updated_time': {
2994
+ 'type': ['string', 'null'],
2995
+ 'format': 'date-time',
2996
+ 'description': 'Last update time',
2997
+ },
2998
+ 'views': {
2999
+ 'type': ['integer', 'null'],
3000
+ 'description': 'View count',
3001
+ },
3002
+ },
3003
+ 'required': ['id'],
3004
+ 'x-airbyte-entity-name': 'videos',
3005
+ 'x-airbyte-stream-name': 'videos',
3006
+ },
3007
+ ),
3008
+ ],
3009
+ search_field_paths={
3010
+ 'campaigns': [
3011
+ 'id',
3012
+ 'name',
3013
+ 'account_id',
3014
+ 'status',
3015
+ 'effective_status',
3016
+ 'objective',
3017
+ 'daily_budget',
3018
+ 'lifetime_budget',
3019
+ 'budget_remaining',
3020
+ 'created_time',
3021
+ 'start_time',
3022
+ 'stop_time',
3023
+ 'updated_time',
3024
+ ],
3025
+ 'ad_sets': [
3026
+ 'id',
3027
+ 'name',
3028
+ 'account_id',
3029
+ 'campaign_id',
3030
+ 'effective_status',
3031
+ 'daily_budget',
3032
+ 'lifetime_budget',
3033
+ 'budget_remaining',
3034
+ 'bid_amount',
3035
+ 'bid_strategy',
3036
+ 'created_time',
3037
+ 'start_time',
3038
+ 'end_time',
3039
+ 'updated_time',
3040
+ ],
3041
+ 'ads': [
3042
+ 'id',
3043
+ 'name',
3044
+ 'account_id',
3045
+ 'adset_id',
3046
+ 'campaign_id',
3047
+ 'status',
3048
+ 'effective_status',
3049
+ 'created_time',
3050
+ 'updated_time',
3051
+ ],
3052
+ 'ad_creatives': [
3053
+ 'id',
3054
+ 'name',
3055
+ 'account_id',
3056
+ 'body',
3057
+ 'title',
3058
+ 'status',
3059
+ 'image_url',
3060
+ 'thumbnail_url',
3061
+ 'link_url',
3062
+ 'call_to_action_type',
3063
+ ],
3064
+ 'ads_insights': [
3065
+ 'account_id',
3066
+ 'account_name',
3067
+ 'campaign_id',
3068
+ 'campaign_name',
3069
+ 'adset_id',
3070
+ 'adset_name',
3071
+ 'ad_id',
3072
+ 'ad_name',
3073
+ 'clicks',
3074
+ 'impressions',
3075
+ 'reach',
3076
+ 'spend',
3077
+ 'cpc',
3078
+ 'cpm',
3079
+ 'ctr',
3080
+ 'date_start',
3081
+ 'date_stop',
3082
+ ],
3083
+ 'custom_conversions': [
3084
+ 'id',
3085
+ 'name',
3086
+ 'account_id',
3087
+ 'description',
3088
+ 'custom_event_type',
3089
+ 'creation_time',
3090
+ 'first_fired_time',
3091
+ 'last_fired_time',
3092
+ 'is_archived',
3093
+ ],
3094
+ 'images': [
3095
+ 'id',
3096
+ 'name',
3097
+ 'account_id',
3098
+ 'hash',
3099
+ 'url',
3100
+ 'permalink_url',
3101
+ 'width',
3102
+ 'height',
3103
+ 'status',
3104
+ 'created_time',
3105
+ 'updated_time',
3106
+ ],
3107
+ 'videos': [
3108
+ 'id',
3109
+ 'title',
3110
+ 'account_id',
3111
+ 'description',
3112
+ 'length',
3113
+ 'source',
3114
+ 'permalink_url',
3115
+ 'views',
3116
+ 'created_time',
3117
+ 'updated_time',
3118
+ ],
3119
+ },
3120
+ )