mage-integrations 0.2.1__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 (1016) hide show
  1. mage_integrations/__init__.py +0 -0
  2. mage_integrations/connections/__init__.py +0 -0
  3. mage_integrations/connections/airtable/__init__.py +31 -0
  4. mage_integrations/connections/base.py +19 -0
  5. mage_integrations/connections/bigquery/__init__.py +49 -0
  6. mage_integrations/connections/constants.py +3 -0
  7. mage_integrations/connections/couchbase/__init__.py +43 -0
  8. mage_integrations/connections/doris/__init__.py +89 -0
  9. mage_integrations/connections/dremio/__init__.py +104 -0
  10. mage_integrations/connections/google_analytics/__init__.py +104 -0
  11. mage_integrations/connections/google_analytics/constants.py +266 -0
  12. mage_integrations/connections/google_analytics/utils.py +14 -0
  13. mage_integrations/connections/google_cloud_storage/__init__.py +33 -0
  14. mage_integrations/connections/google_search_console/__init__.py +58 -0
  15. mage_integrations/connections/google_sheets/__init__.py +96 -0
  16. mage_integrations/connections/mssql/__init__.py +60 -0
  17. mage_integrations/connections/mysql/__init__.py +93 -0
  18. mage_integrations/connections/oracledb/__init__.py +33 -0
  19. mage_integrations/connections/postgresql/__init__.py +39 -0
  20. mage_integrations/connections/redshift/__init__.py +45 -0
  21. mage_integrations/connections/snowflake/__init__.py +47 -0
  22. mage_integrations/connections/sql/__init__.py +0 -0
  23. mage_integrations/connections/sql/base.py +124 -0
  24. mage_integrations/connections/teradata/__init__.py +33 -0
  25. mage_integrations/connections/trino/__init__.py +40 -0
  26. mage_integrations/connections/trino/connection_wrapper.py +28 -0
  27. mage_integrations/connections/utils/__init__.py +0 -0
  28. mage_integrations/connections/utils/google.py +14 -0
  29. mage_integrations/connections/utils/sql.py +2 -0
  30. mage_integrations/destinations/__init__.py +0 -0
  31. mage_integrations/destinations/airtable/Readme.md +27 -0
  32. mage_integrations/destinations/airtable/__init__.py +92 -0
  33. mage_integrations/destinations/airtable/templates/config.json +4 -0
  34. mage_integrations/destinations/amazon_s3/README.md +24 -0
  35. mage_integrations/destinations/amazon_s3/__init__.py +172 -0
  36. mage_integrations/destinations/amazon_s3/templates/config.json +10 -0
  37. mage_integrations/destinations/amplitude/README.md +58 -0
  38. mage_integrations/destinations/amplitude/__init__.py +91 -0
  39. mage_integrations/destinations/amplitude/templates/config.json +5 -0
  40. mage_integrations/destinations/base.py +810 -0
  41. mage_integrations/destinations/bigquery/README.md +54 -0
  42. mage_integrations/destinations/bigquery/__init__.py +834 -0
  43. mage_integrations/destinations/bigquery/constants.py +8 -0
  44. mage_integrations/destinations/bigquery/templates/config.json +8 -0
  45. mage_integrations/destinations/bigquery/utils.py +304 -0
  46. mage_integrations/destinations/clickhouse/LICENSE +201 -0
  47. mage_integrations/destinations/clickhouse/README.md +14 -0
  48. mage_integrations/destinations/clickhouse/__init__.py +32 -0
  49. mage_integrations/destinations/clickhouse/target_clickhouse/__init__.py +1 -0
  50. mage_integrations/destinations/clickhouse/target_clickhouse/sinks.py +234 -0
  51. mage_integrations/destinations/clickhouse/target_clickhouse/target.py +137 -0
  52. mage_integrations/destinations/clickhouse/templates/config.json +4 -0
  53. mage_integrations/destinations/constants.py +50 -0
  54. mage_integrations/destinations/delta_lake/README.md +0 -0
  55. mage_integrations/destinations/delta_lake/__init__.py +0 -0
  56. mage_integrations/destinations/delta_lake/base.py +227 -0
  57. mage_integrations/destinations/delta_lake/constants.py +2 -0
  58. mage_integrations/destinations/delta_lake_azure/README.md +18 -0
  59. mage_integrations/destinations/delta_lake_azure/__init__.py +45 -0
  60. mage_integrations/destinations/delta_lake_azure/templates/config.json +6 -0
  61. mage_integrations/destinations/delta_lake_s3/README.md +21 -0
  62. mage_integrations/destinations/delta_lake_s3/__init__.py +130 -0
  63. mage_integrations/destinations/delta_lake_s3/templates/config.json +9 -0
  64. mage_integrations/destinations/doris/README.md +32 -0
  65. mage_integrations/destinations/doris/__init__.py +209 -0
  66. mage_integrations/destinations/doris/constants.py +755 -0
  67. mage_integrations/destinations/doris/templates/config.json +9 -0
  68. mage_integrations/destinations/doris/utils.py +118 -0
  69. mage_integrations/destinations/elasticsearch/README.md +57 -0
  70. mage_integrations/destinations/elasticsearch/__init__.py +37 -0
  71. mage_integrations/destinations/elasticsearch/target_elasticsearch/__init__.py +0 -0
  72. mage_integrations/destinations/elasticsearch/target_elasticsearch/common.py +32 -0
  73. mage_integrations/destinations/elasticsearch/target_elasticsearch/sinks.py +262 -0
  74. mage_integrations/destinations/elasticsearch/target_elasticsearch/target.py +267 -0
  75. mage_integrations/destinations/elasticsearch/templates/config.json +8 -0
  76. mage_integrations/destinations/google_cloud_storage/README.md +19 -0
  77. mage_integrations/destinations/google_cloud_storage/__init__.py +109 -0
  78. mage_integrations/destinations/google_cloud_storage/templates/config.json +8 -0
  79. mage_integrations/destinations/kafka/README.md +18 -0
  80. mage_integrations/destinations/kafka/__init__.py +91 -0
  81. mage_integrations/destinations/kafka/templates/config.json +5 -0
  82. mage_integrations/destinations/mongodb/README.md +11 -0
  83. mage_integrations/destinations/mongodb/__init__.py +28 -0
  84. mage_integrations/destinations/mongodb/target_mongodb/__init__.py +0 -0
  85. mage_integrations/destinations/mongodb/target_mongodb/sinks.py +135 -0
  86. mage_integrations/destinations/mongodb/target_mongodb/target.py +169 -0
  87. mage_integrations/destinations/mongodb/templates/config.json +5 -0
  88. mage_integrations/destinations/mssql/README.md +31 -0
  89. mage_integrations/destinations/mssql/__init__.py +214 -0
  90. mage_integrations/destinations/mssql/templates/config.json +10 -0
  91. mage_integrations/destinations/mssql/utils.py +101 -0
  92. mage_integrations/destinations/mysql/README.md +36 -0
  93. mage_integrations/destinations/mysql/__init__.py +215 -0
  94. mage_integrations/destinations/mysql/constants.py +755 -0
  95. mage_integrations/destinations/mysql/templates/config.json +9 -0
  96. mage_integrations/destinations/mysql/utils.py +154 -0
  97. mage_integrations/destinations/opensearch/README.md +22 -0
  98. mage_integrations/destinations/opensearch/__init__.py +35 -0
  99. mage_integrations/destinations/opensearch/target_opensearch/__init__.py +0 -0
  100. mage_integrations/destinations/opensearch/target_opensearch/common.py +30 -0
  101. mage_integrations/destinations/opensearch/target_opensearch/sinks.py +221 -0
  102. mage_integrations/destinations/opensearch/target_opensearch/target.py +241 -0
  103. mage_integrations/destinations/opensearch/templates/config.json +5 -0
  104. mage_integrations/destinations/oracledb/README.md +22 -0
  105. mage_integrations/destinations/oracledb/__init__.py +241 -0
  106. mage_integrations/destinations/oracledb/templates/config.json +10 -0
  107. mage_integrations/destinations/oracledb/utils.py +114 -0
  108. mage_integrations/destinations/postgresql/README.md +30 -0
  109. mage_integrations/destinations/postgresql/__init__.py +264 -0
  110. mage_integrations/destinations/postgresql/templates/config.json +9 -0
  111. mage_integrations/destinations/postgresql/utils.py +77 -0
  112. mage_integrations/destinations/redshift/README.md +45 -0
  113. mage_integrations/destinations/redshift/__init__.py +306 -0
  114. mage_integrations/destinations/redshift/constants.py +155 -0
  115. mage_integrations/destinations/redshift/templates/config.json +11 -0
  116. mage_integrations/destinations/redshift/utils.py +28 -0
  117. mage_integrations/destinations/salesforce/README.md +38 -0
  118. mage_integrations/destinations/salesforce/__init__.py +37 -0
  119. mage_integrations/destinations/salesforce/target_salesforce/__init__.py +0 -0
  120. mage_integrations/destinations/salesforce/target_salesforce/session_credentials.py +96 -0
  121. mage_integrations/destinations/salesforce/target_salesforce/sinks.py +161 -0
  122. mage_integrations/destinations/salesforce/target_salesforce/target.py +182 -0
  123. mage_integrations/destinations/salesforce/target_salesforce/utils/__init__.py +0 -0
  124. mage_integrations/destinations/salesforce/target_salesforce/utils/exceptions.py +10 -0
  125. mage_integrations/destinations/salesforce/target_salesforce/utils/transformation.py +25 -0
  126. mage_integrations/destinations/salesforce/target_salesforce/utils/validation.py +54 -0
  127. mage_integrations/destinations/salesforce/templates/config.json +8 -0
  128. mage_integrations/destinations/sink.py +594 -0
  129. mage_integrations/destinations/snowflake/README.md +39 -0
  130. mage_integrations/destinations/snowflake/__init__.py +582 -0
  131. mage_integrations/destinations/snowflake/constants.py +1 -0
  132. mage_integrations/destinations/snowflake/templates/config.json +14 -0
  133. mage_integrations/destinations/snowflake/utils.py +92 -0
  134. mage_integrations/destinations/sql/__init__.py +0 -0
  135. mage_integrations/destinations/sql/base.py +435 -0
  136. mage_integrations/destinations/sql/constants.py +843 -0
  137. mage_integrations/destinations/sql/utils.py +363 -0
  138. mage_integrations/destinations/sqlsink.py +414 -0
  139. mage_integrations/destinations/target.py +561 -0
  140. mage_integrations/destinations/teradata/README.md +18 -0
  141. mage_integrations/destinations/teradata/__init__.py +357 -0
  142. mage_integrations/destinations/teradata/templates/config.json +7 -0
  143. mage_integrations/destinations/teradata/utils.py +103 -0
  144. mage_integrations/destinations/trino/README.md +84 -0
  145. mage_integrations/destinations/trino/__init__.py +27 -0
  146. mage_integrations/destinations/trino/connectors/__init__.py +0 -0
  147. mage_integrations/destinations/trino/connectors/base.py +325 -0
  148. mage_integrations/destinations/trino/connectors/deltalake.py +53 -0
  149. mage_integrations/destinations/trino/connectors/iceberg.py +19 -0
  150. mage_integrations/destinations/trino/templates/config.json +14 -0
  151. mage_integrations/destinations/trino/utils.py +33 -0
  152. mage_integrations/destinations/utils.py +50 -0
  153. mage_integrations/sources/README.md +3 -0
  154. mage_integrations/sources/__init__.py +0 -0
  155. mage_integrations/sources/airtable/README.md +27 -0
  156. mage_integrations/sources/airtable/__init__.py +180 -0
  157. mage_integrations/sources/airtable/templates/config.json +5 -0
  158. mage_integrations/sources/amazon_s3/README.md +25 -0
  159. mage_integrations/sources/amazon_s3/__init__.py +298 -0
  160. mage_integrations/sources/amazon_s3/templates/config.json +11 -0
  161. mage_integrations/sources/amplitude/README.md +67 -0
  162. mage_integrations/sources/amplitude/__init__.py +356 -0
  163. mage_integrations/sources/amplitude/constants.py +58 -0
  164. mage_integrations/sources/amplitude/schemas/active_users.json +28 -0
  165. mage_integrations/sources/amplitude/schemas/annotations.json +54 -0
  166. mage_integrations/sources/amplitude/schemas/average_session_length.json +28 -0
  167. mage_integrations/sources/amplitude/schemas/cohort_members.json +34 -0
  168. mage_integrations/sources/amplitude/schemas/cohorts.json +144 -0
  169. mage_integrations/sources/amplitude/schemas/event_properties.json +72 -0
  170. mage_integrations/sources/amplitude/schemas/event_types.json +77 -0
  171. mage_integrations/sources/amplitude/schemas/events.json +349 -0
  172. mage_integrations/sources/amplitude/schemas/new_users.json +28 -0
  173. mage_integrations/sources/amplitude/schemas/sessions_per_user.json +28 -0
  174. mage_integrations/sources/amplitude/schemas/user_properties.json +66 -0
  175. mage_integrations/sources/amplitude/templates/config.json +7 -0
  176. mage_integrations/sources/amplitude/templates/query.json +4 -0
  177. mage_integrations/sources/api/README.md +211 -0
  178. mage_integrations/sources/api/__init__.py +279 -0
  179. mage_integrations/sources/api/templates/config.json +9 -0
  180. mage_integrations/sources/azure_blob_storage/README.md +21 -0
  181. mage_integrations/sources/azure_blob_storage/__init__.py +160 -0
  182. mage_integrations/sources/azure_blob_storage/templates/config.json +5 -0
  183. mage_integrations/sources/base.py +781 -0
  184. mage_integrations/sources/bigquery/README.md +49 -0
  185. mage_integrations/sources/bigquery/__init__.py +56 -0
  186. mage_integrations/sources/bigquery/templates/config.json +4 -0
  187. mage_integrations/sources/catalog.py +125 -0
  188. mage_integrations/sources/chargebee/README.md +21 -0
  189. mage_integrations/sources/chargebee/__init__.py +83 -0
  190. mage_integrations/sources/chargebee/client.py +194 -0
  191. mage_integrations/sources/chargebee/schemas/common/cards.json +57 -0
  192. mage_integrations/sources/chargebee/schemas/common/comments.json +30 -0
  193. mage_integrations/sources/chargebee/schemas/common/credit_notes.json +404 -0
  194. mage_integrations/sources/chargebee/schemas/common/customers.json +428 -0
  195. mage_integrations/sources/chargebee/schemas/common/gifts.json +85 -0
  196. mage_integrations/sources/chargebee/schemas/common/invoices.json +680 -0
  197. mage_integrations/sources/chargebee/schemas/common/orders.json +431 -0
  198. mage_integrations/sources/chargebee/schemas/common/payment_sources.json +180 -0
  199. mage_integrations/sources/chargebee/schemas/common/promotional_credits.json +46 -0
  200. mage_integrations/sources/chargebee/schemas/common/quotes.json +380 -0
  201. mage_integrations/sources/chargebee/schemas/common/transactions.json +241 -0
  202. mage_integrations/sources/chargebee/schemas/common/virtual_bank_accounts.json +56 -0
  203. mage_integrations/sources/chargebee/schemas/item_model/coupons.json +251 -0
  204. mage_integrations/sources/chargebee/schemas/item_model/events.json +653 -0
  205. mage_integrations/sources/chargebee/schemas/item_model/item_families.json +63 -0
  206. mage_integrations/sources/chargebee/schemas/item_model/item_prices.json +342 -0
  207. mage_integrations/sources/chargebee/schemas/item_model/items.json +187 -0
  208. mage_integrations/sources/chargebee/schemas/item_model/subscriptions.json +873 -0
  209. mage_integrations/sources/chargebee/schemas/plan_model/addons.json +163 -0
  210. mage_integrations/sources/chargebee/schemas/plan_model/coupons.json +103 -0
  211. mage_integrations/sources/chargebee/schemas/plan_model/events.json +647 -0
  212. mage_integrations/sources/chargebee/schemas/plan_model/plans.json +250 -0
  213. mage_integrations/sources/chargebee/schemas/plan_model/subscriptions.json +465 -0
  214. mage_integrations/sources/chargebee/state.py +44 -0
  215. mage_integrations/sources/chargebee/streams/__init__.py +69 -0
  216. mage_integrations/sources/chargebee/streams/addons.py +19 -0
  217. mage_integrations/sources/chargebee/streams/base.py +244 -0
  218. mage_integrations/sources/chargebee/streams/comments.py +19 -0
  219. mage_integrations/sources/chargebee/streams/coupons.py +24 -0
  220. mage_integrations/sources/chargebee/streams/credit_notes.py +19 -0
  221. mage_integrations/sources/chargebee/streams/customers.py +19 -0
  222. mage_integrations/sources/chargebee/streams/events.py +24 -0
  223. mage_integrations/sources/chargebee/streams/gifts.py +19 -0
  224. mage_integrations/sources/chargebee/streams/invoices.py +19 -0
  225. mage_integrations/sources/chargebee/streams/item_families.py +19 -0
  226. mage_integrations/sources/chargebee/streams/item_prices.py +19 -0
  227. mage_integrations/sources/chargebee/streams/items.py +19 -0
  228. mage_integrations/sources/chargebee/streams/orders.py +19 -0
  229. mage_integrations/sources/chargebee/streams/payment_sources.py +19 -0
  230. mage_integrations/sources/chargebee/streams/plans.py +19 -0
  231. mage_integrations/sources/chargebee/streams/promotional_credits.py +19 -0
  232. mage_integrations/sources/chargebee/streams/quotes.py +19 -0
  233. mage_integrations/sources/chargebee/streams/subscriptions.py +24 -0
  234. mage_integrations/sources/chargebee/streams/transactions.py +19 -0
  235. mage_integrations/sources/chargebee/streams/util.py +6 -0
  236. mage_integrations/sources/chargebee/streams/virtual_bank_accounts.py +19 -0
  237. mage_integrations/sources/chargebee/templates/config.json +7 -0
  238. mage_integrations/sources/commercetools/README.md +28 -0
  239. mage_integrations/sources/commercetools/__init__.py +40 -0
  240. mage_integrations/sources/commercetools/client.py +54 -0
  241. mage_integrations/sources/commercetools/schemas/customers.json +108 -0
  242. mage_integrations/sources/commercetools/schemas/discount_codes.json +77 -0
  243. mage_integrations/sources/commercetools/schemas/inventory.json +50 -0
  244. mage_integrations/sources/commercetools/schemas/orders.json +542 -0
  245. mage_integrations/sources/commercetools/schemas/payments.json +113 -0
  246. mage_integrations/sources/commercetools/schemas/products.json +82 -0
  247. mage_integrations/sources/commercetools/schemas/shared/address.json +83 -0
  248. mage_integrations/sources/commercetools/schemas/shared/created_by.json +17 -0
  249. mage_integrations/sources/commercetools/schemas/shared/custom.json +17 -0
  250. mage_integrations/sources/commercetools/schemas/shared/dimension.json +11 -0
  251. mage_integrations/sources/commercetools/schemas/shared/discounted_price_per_quantity.json +30 -0
  252. mage_integrations/sources/commercetools/schemas/shared/field_type.json +8 -0
  253. mage_integrations/sources/commercetools/schemas/shared/key_reference.json +11 -0
  254. mage_integrations/sources/commercetools/schemas/shared/last_modified_by.json +17 -0
  255. mage_integrations/sources/commercetools/schemas/shared/localized_string.json +8 -0
  256. mage_integrations/sources/commercetools/schemas/shared/money.json +17 -0
  257. mage_integrations/sources/commercetools/schemas/shared/price.json +56 -0
  258. mage_integrations/sources/commercetools/schemas/shared/price_scoped.json +45 -0
  259. mage_integrations/sources/commercetools/schemas/shared/product_data.json +52 -0
  260. mage_integrations/sources/commercetools/schemas/shared/product_variant.json +132 -0
  261. mage_integrations/sources/commercetools/schemas/shared/reference.json +22 -0
  262. mage_integrations/sources/commercetools/schemas/shared/shipping_details.json +22 -0
  263. mage_integrations/sources/commercetools/schemas/shared/state.json +11 -0
  264. mage_integrations/sources/commercetools/schemas/shared/taxed_item_price.json +11 -0
  265. mage_integrations/sources/commercetools/schemas/shared/taxed_price.json +28 -0
  266. mage_integrations/sources/commercetools/schemas/shared/taxrate.json +37 -0
  267. mage_integrations/sources/commercetools/schemas.py +25 -0
  268. mage_integrations/sources/commercetools/streams/__init__.py +0 -0
  269. mage_integrations/sources/commercetools/streams/base.py +30 -0
  270. mage_integrations/sources/commercetools/streams/customers.py +7 -0
  271. mage_integrations/sources/commercetools/streams/discount_codes.py +7 -0
  272. mage_integrations/sources/commercetools/streams/inventory.py +7 -0
  273. mage_integrations/sources/commercetools/streams/orders.py +7 -0
  274. mage_integrations/sources/commercetools/streams/payments.py +7 -0
  275. mage_integrations/sources/commercetools/streams/products.py +7 -0
  276. mage_integrations/sources/commercetools/templates/config.json +7 -0
  277. mage_integrations/sources/constants.py +46 -0
  278. mage_integrations/sources/couchbase/README.md +25 -0
  279. mage_integrations/sources/couchbase/__init__.py +140 -0
  280. mage_integrations/sources/couchbase/templates/config.json +7 -0
  281. mage_integrations/sources/couchbase/utils.py +58 -0
  282. mage_integrations/sources/datadog/README.md +25 -0
  283. mage_integrations/sources/datadog/__init__.py +55 -0
  284. mage_integrations/sources/datadog/client.py +18 -0
  285. mage_integrations/sources/datadog/schemas/audit_logs.json +49 -0
  286. mage_integrations/sources/datadog/schemas/dashboards.json +55 -0
  287. mage_integrations/sources/datadog/schemas/downtimes.json +103 -0
  288. mage_integrations/sources/datadog/schemas/incident_teams.json +92 -0
  289. mage_integrations/sources/datadog/schemas/incidents.json +135 -0
  290. mage_integrations/sources/datadog/schemas/logs.json +61 -0
  291. mage_integrations/sources/datadog/schemas/synthetic_tests.json +105 -0
  292. mage_integrations/sources/datadog/schemas/users.json +76 -0
  293. mage_integrations/sources/datadog/streams/__init__.py +275 -0
  294. mage_integrations/sources/datadog/templates/config.json +9 -0
  295. mage_integrations/sources/doris/README.md +28 -0
  296. mage_integrations/sources/doris/__init__.py +68 -0
  297. mage_integrations/sources/doris/templates/config.json +13 -0
  298. mage_integrations/sources/dremio/README.md +44 -0
  299. mage_integrations/sources/dremio/__init__.py +174 -0
  300. mage_integrations/sources/dremio/templates/config.json +6 -0
  301. mage_integrations/sources/dremio/utils.py +28 -0
  302. mage_integrations/sources/dynamodb/README.md +14 -0
  303. mage_integrations/sources/dynamodb/__init__.py +225 -0
  304. mage_integrations/sources/dynamodb/templates/config.json +6 -0
  305. mage_integrations/sources/facebook_ads/README.md +49 -0
  306. mage_integrations/sources/facebook_ads/__init__.py +45 -0
  307. mage_integrations/sources/facebook_ads/tap_facebook/__init__.py +1040 -0
  308. mage_integrations/sources/facebook_ads/tap_facebook/process_output.py +114 -0
  309. mage_integrations/sources/facebook_ads/tap_facebook/schemas/adcreative.json +1440 -0
  310. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads.json +859 -0
  311. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights.json +339 -0
  312. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_age_and_gender.json +352 -0
  313. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_country.json +345 -0
  314. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_dma.json +183 -0
  315. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_hourly_advertiser.json +311 -0
  316. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_platform_and_device.json +363 -0
  317. mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_region.json +345 -0
  318. mage_integrations/sources/facebook_ads/tap_facebook/schemas/adsets.json +200 -0
  319. mage_integrations/sources/facebook_ads/tap_facebook/schemas/campaigns.json +98 -0
  320. mage_integrations/sources/facebook_ads/tap_facebook/schemas/leads.json +65 -0
  321. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_action_stats.json +74 -0
  322. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_histogram_stats.json +32 -0
  323. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_image_crops.json +134 -0
  324. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/geo_locations.json +270 -0
  325. mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/targeting.json +401 -0
  326. mage_integrations/sources/facebook_ads/templates/config.json +5 -0
  327. mage_integrations/sources/facebook_ads/tests/base.py +396 -0
  328. mage_integrations/sources/facebook_ads/tests/facebook_ads/adcreative/output/00000000000000000000 +8 -0
  329. mage_integrations/sources/facebook_ads/tests/facebook_ads/ads/output/00000000000000000000 +10 -0
  330. mage_integrations/sources/facebook_ads/tests/facebook_ads/adsets/output/00000000000000000000 +11 -0
  331. mage_integrations/sources/facebook_ads/tests/facebook_ads/campaigns/output/00000000000000000000 +14 -0
  332. mage_integrations/sources/facebook_ads/tests/test_facebook_archived_data.py +115 -0
  333. mage_integrations/sources/facebook_ads/tests/test_facebook_attribution_window.py +104 -0
  334. mage_integrations/sources/facebook_ads/tests/test_facebook_automatic_fields.py +85 -0
  335. mage_integrations/sources/facebook_ads/tests/test_facebook_bookmarks.py +256 -0
  336. mage_integrations/sources/facebook_ads/tests/test_facebook_discovery.py +122 -0
  337. mage_integrations/sources/facebook_ads/tests/test_facebook_field_selection.py +118 -0
  338. mage_integrations/sources/facebook_ads/tests/test_facebook_invalid_attribution_window.py +65 -0
  339. mage_integrations/sources/facebook_ads/tests/test_facebook_start_date.py +145 -0
  340. mage_integrations/sources/facebook_ads/tests/unittests/test_attribute_error_retry.py +193 -0
  341. mage_integrations/sources/facebook_ads/tests/unittests/test_attribution_window.py +29 -0
  342. mage_integrations/sources/facebook_ads/tests/unittests/test_request_timeout.py +504 -0
  343. mage_integrations/sources/facebook_ads/tests/unittests/test_retry_logic.py +261 -0
  344. mage_integrations/sources/facebook_ads/tests/unittests/test_sync_batches_retry.py +154 -0
  345. mage_integrations/sources/facebook_ads/tests/unittests/test_tap_facebook.py +160 -0
  346. mage_integrations/sources/freshdesk/README.md +24 -0
  347. mage_integrations/sources/freshdesk/__init__.py +25 -0
  348. mage_integrations/sources/freshdesk/tap_freshdesk/__init__.py +325 -0
  349. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/agents.json +85 -0
  350. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/companies.json +45 -0
  351. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/contacts.json +165 -0
  352. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/conversations.json +178 -0
  353. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/groups.json +40 -0
  354. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/roles.json +25 -0
  355. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/satisfaction_ratings.json +75 -0
  356. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/tickets.json +332 -0
  357. mage_integrations/sources/freshdesk/tap_freshdesk/schemas/time_entries.json +72 -0
  358. mage_integrations/sources/freshdesk/tap_freshdesk/utils.py +93 -0
  359. mage_integrations/sources/freshdesk/templates/config.json +5 -0
  360. mage_integrations/sources/freshdesk/tests/base.py +262 -0
  361. mage_integrations/sources/freshdesk/tests/test_freshdesk_bookmarks.py +250 -0
  362. mage_integrations/sources/freshdesk/tests/test_freshdesk_check.py +29 -0
  363. mage_integrations/sources/freshdesk/tests/test_freshdesk_pagination.py +58 -0
  364. mage_integrations/sources/freshdesk/tests/test_freshdesk_start_date.py +181 -0
  365. mage_integrations/sources/front/README.md +25 -0
  366. mage_integrations/sources/front/__init__.py +40 -0
  367. mage_integrations/sources/front/client.py +76 -0
  368. mage_integrations/sources/front/context.py +62 -0
  369. mage_integrations/sources/front/schemas/accounts.json +37 -0
  370. mage_integrations/sources/front/schemas/analytics.json +71 -0
  371. mage_integrations/sources/front/schemas/channels.json +28 -0
  372. mage_integrations/sources/front/schemas/contact_groups.json +15 -0
  373. mage_integrations/sources/front/schemas/contacts.json +49 -0
  374. mage_integrations/sources/front/schemas/conversations.json +40 -0
  375. mage_integrations/sources/front/schemas/custom_fields.json +18 -0
  376. mage_integrations/sources/front/schemas/events.json +27 -0
  377. mage_integrations/sources/front/schemas/rules.json +21 -0
  378. mage_integrations/sources/front/schemas/tags.json +27 -0
  379. mage_integrations/sources/front/schemas/teammates.json +30 -0
  380. mage_integrations/sources/front/schemas/teams.json +12 -0
  381. mage_integrations/sources/front/schemas.py +43 -0
  382. mage_integrations/sources/front/streams/__init__.py +0 -0
  383. mage_integrations/sources/front/streams/accounts.py +7 -0
  384. mage_integrations/sources/front/streams/analytics.py +97 -0
  385. mage_integrations/sources/front/streams/base.py +29 -0
  386. mage_integrations/sources/front/streams/channels.py +7 -0
  387. mage_integrations/sources/front/streams/contact_groups.py +7 -0
  388. mage_integrations/sources/front/streams/contacts.py +7 -0
  389. mage_integrations/sources/front/streams/conversations.py +7 -0
  390. mage_integrations/sources/front/streams/custom_fields.py +7 -0
  391. mage_integrations/sources/front/streams/events.py +7 -0
  392. mage_integrations/sources/front/streams/rules.py +7 -0
  393. mage_integrations/sources/front/streams/tags.py +7 -0
  394. mage_integrations/sources/front/streams/teammates.py +7 -0
  395. mage_integrations/sources/front/streams/teams.py +7 -0
  396. mage_integrations/sources/front/templates/config.json +6 -0
  397. mage_integrations/sources/github/README.md +55 -0
  398. mage_integrations/sources/github/__init__.py +48 -0
  399. mage_integrations/sources/github/tap_github/__init__.py +47 -0
  400. mage_integrations/sources/github/tap_github/client.py +430 -0
  401. mage_integrations/sources/github/tap_github/discover.py +41 -0
  402. mage_integrations/sources/github/tap_github/schema.py +88 -0
  403. mage_integrations/sources/github/tap_github/schemas/assignees.json +72 -0
  404. mage_integrations/sources/github/tap_github/schemas/collaborators.json +75 -0
  405. mage_integrations/sources/github/tap_github/schemas/comments.json +120 -0
  406. mage_integrations/sources/github/tap_github/schemas/commit_comments.json +114 -0
  407. mage_integrations/sources/github/tap_github/schemas/commits.json +278 -0
  408. mage_integrations/sources/github/tap_github/schemas/events.json +1055 -0
  409. mage_integrations/sources/github/tap_github/schemas/issue_events.json +963 -0
  410. mage_integrations/sources/github/tap_github/schemas/issue_labels.json +29 -0
  411. mage_integrations/sources/github/tap_github/schemas/issue_milestones.json +125 -0
  412. mage_integrations/sources/github/tap_github/schemas/issues.json +276 -0
  413. mage_integrations/sources/github/tap_github/schemas/pr_commits.json +323 -0
  414. mage_integrations/sources/github/tap_github/schemas/project_cards.json +120 -0
  415. mage_integrations/sources/github/tap_github/schemas/project_columns.json +34 -0
  416. mage_integrations/sources/github/tap_github/schemas/projects.json +117 -0
  417. mage_integrations/sources/github/tap_github/schemas/pull_requests.json +1646 -0
  418. mage_integrations/sources/github/tap_github/schemas/releases.json +192 -0
  419. mage_integrations/sources/github/tap_github/schemas/review_comments.json +178 -0
  420. mage_integrations/sources/github/tap_github/schemas/reviews.json +70 -0
  421. mage_integrations/sources/github/tap_github/schemas/shared/issue_permissions.json +20 -0
  422. mage_integrations/sources/github/tap_github/schemas/shared/performed_via_github_app.json +61 -0
  423. mage_integrations/sources/github/tap_github/schemas/shared/pull_permissions.json +20 -0
  424. mage_integrations/sources/github/tap_github/schemas/shared/reactions.json +35 -0
  425. mage_integrations/sources/github/tap_github/schemas/shared/user.json +68 -0
  426. mage_integrations/sources/github/tap_github/schemas/stargazers.json +19 -0
  427. mage_integrations/sources/github/tap_github/schemas/team_members.json +74 -0
  428. mage_integrations/sources/github/tap_github/schemas/team_memberships.json +20 -0
  429. mage_integrations/sources/github/tap_github/schemas/teams.json +47 -0
  430. mage_integrations/sources/github/tap_github/streams.py +952 -0
  431. mage_integrations/sources/github/tap_github/sync.py +306 -0
  432. mage_integrations/sources/github/templates/config.json +7 -0
  433. mage_integrations/sources/github/tests/__init__.py +0 -0
  434. mage_integrations/sources/github/tests/base.py +445 -0
  435. mage_integrations/sources/google_ads/README.md +28 -0
  436. mage_integrations/sources/google_ads/__init__.py +41 -0
  437. mage_integrations/sources/google_ads/tap_google_ads/__init__.py +57 -0
  438. mage_integrations/sources/google_ads/tap_google_ads/client.py +17 -0
  439. mage_integrations/sources/google_ads/tap_google_ads/discover.py +268 -0
  440. mage_integrations/sources/google_ads/tap_google_ads/report_definitions.py +1877 -0
  441. mage_integrations/sources/google_ads/tap_google_ads/schemas/accounts.json +171 -0
  442. mage_integrations/sources/google_ads/tap_google_ads/schemas/ad_groups.json +268 -0
  443. mage_integrations/sources/google_ads/tap_google_ads/schemas/ads.json +1759 -0
  444. mage_integrations/sources/google_ads/tap_google_ads/schemas/campaigns.json +858 -0
  445. mage_integrations/sources/google_ads/tap_google_ads/streams.py +1170 -0
  446. mage_integrations/sources/google_ads/tap_google_ads/sync.py +144 -0
  447. mage_integrations/sources/google_ads/tap_google_ads/tests/base.py +434 -0
  448. mage_integrations/sources/google_ads/templates/config.json +13 -0
  449. mage_integrations/sources/google_analytics/README.md +31 -0
  450. mage_integrations/sources/google_analytics/__init__.py +128 -0
  451. mage_integrations/sources/google_analytics/templates/config.json +6 -0
  452. mage_integrations/sources/google_cloud_storage/README.md +40 -0
  453. mage_integrations/sources/google_cloud_storage/__init__.py +166 -0
  454. mage_integrations/sources/google_cloud_storage/templates/config.json +7 -0
  455. mage_integrations/sources/google_search_console/README.md +20 -0
  456. mage_integrations/sources/google_search_console/__init__.py +99 -0
  457. mage_integrations/sources/google_search_console/schemas/performance_report_country.json +31 -0
  458. mage_integrations/sources/google_search_console/schemas/performance_report_custom.json +40 -0
  459. mage_integrations/sources/google_search_console/schemas/performance_report_date.json +28 -0
  460. mage_integrations/sources/google_search_console/schemas/performance_report_device.json +31 -0
  461. mage_integrations/sources/google_search_console/schemas/performance_report_page.json +31 -0
  462. mage_integrations/sources/google_search_console/schemas/performance_report_query.json +31 -0
  463. mage_integrations/sources/google_search_console/streams.py +118 -0
  464. mage_integrations/sources/google_search_console/templates/config.json +6 -0
  465. mage_integrations/sources/google_sheets/README.md +24 -0
  466. mage_integrations/sources/google_sheets/__init__.py +460 -0
  467. mage_integrations/sources/google_sheets/templates/config.json +5 -0
  468. mage_integrations/sources/google_sheets/transform.py +297 -0
  469. mage_integrations/sources/http/__init__.py +0 -0
  470. mage_integrations/sources/http/client.py +179 -0
  471. mage_integrations/sources/hubspot/README.md +48 -0
  472. mage_integrations/sources/hubspot/__init__.py +41 -0
  473. mage_integrations/sources/hubspot/bin/run-a-test.sh +5 -0
  474. mage_integrations/sources/hubspot/bin/run-all-tests.sh +1 -0
  475. mage_integrations/sources/hubspot/tap_hubspot/__init__.py +1548 -0
  476. mage_integrations/sources/hubspot/tap_hubspot/constants.py +13 -0
  477. mage_integrations/sources/hubspot/tap_hubspot/schemas/campaigns.json +91 -0
  478. mage_integrations/sources/hubspot/tap_hubspot/schemas/companies.json +11 -0
  479. mage_integrations/sources/hubspot/tap_hubspot/schemas/contact_lists.json +97 -0
  480. mage_integrations/sources/hubspot/tap_hubspot/schemas/contacts.json +201 -0
  481. mage_integrations/sources/hubspot/tap_hubspot/schemas/contacts_by_company.json +12 -0
  482. mage_integrations/sources/hubspot/tap_hubspot/schemas/deal_pipelines.json +46 -0
  483. mage_integrations/sources/hubspot/tap_hubspot/schemas/deals.json +37 -0
  484. mage_integrations/sources/hubspot/tap_hubspot/schemas/email_events.json +118 -0
  485. mage_integrations/sources/hubspot/tap_hubspot/schemas/engagements.json +179 -0
  486. mage_integrations/sources/hubspot/tap_hubspot/schemas/forms.json +229 -0
  487. mage_integrations/sources/hubspot/tap_hubspot/schemas/owners.json +72 -0
  488. mage_integrations/sources/hubspot/tap_hubspot/schemas/subscription_changes.json +54 -0
  489. mage_integrations/sources/hubspot/tap_hubspot/schemas/versions.json +30 -0
  490. mage_integrations/sources/hubspot/tap_hubspot/schemas/workflows.json +48 -0
  491. mage_integrations/sources/hubspot/tap_hubspot/tests/__init__.py +0 -0
  492. mage_integrations/sources/hubspot/tap_hubspot/tests/test_bookmarks.py +62 -0
  493. mage_integrations/sources/hubspot/tap_hubspot/tests/test_deals.py +32 -0
  494. mage_integrations/sources/hubspot/tap_hubspot/tests/test_get_streams_to_sync.py +44 -0
  495. mage_integrations/sources/hubspot/tap_hubspot/tests/test_offsets.py +57 -0
  496. mage_integrations/sources/hubspot/tap_hubspot/tests/unittests/test_get_start.py +94 -0
  497. mage_integrations/sources/hubspot/tap_hubspot/tests/unittests/test_request_timeout.py +121 -0
  498. mage_integrations/sources/hubspot/tap_hubspot/tests/utils.py +80 -0
  499. mage_integrations/sources/hubspot/templates/config.json +6 -0
  500. mage_integrations/sources/hubspot/tests/base.py +383 -0
  501. mage_integrations/sources/hubspot/tests/client.py +1583 -0
  502. mage_integrations/sources/hubspot/tests/client_tester.py +280 -0
  503. mage_integrations/sources/hubspot/tests/test_hubspot_all_fields.py +323 -0
  504. mage_integrations/sources/hubspot/tests/test_hubspot_automatic_fields.py +109 -0
  505. mage_integrations/sources/hubspot/tests/test_hubspot_bookmarks.py +236 -0
  506. mage_integrations/sources/hubspot/tests/test_hubspot_bookmarks_static.py +127 -0
  507. mage_integrations/sources/hubspot/tests/test_hubspot_child_stream_only.py +88 -0
  508. mage_integrations/sources/hubspot/tests/test_hubspot_discovery.py +131 -0
  509. mage_integrations/sources/hubspot/tests/test_hubspot_interrupted_sync.py +137 -0
  510. mage_integrations/sources/hubspot/tests/test_hubspot_interrupted_sync_offset.py +135 -0
  511. mage_integrations/sources/hubspot/tests/test_hubspot_pagination.py +140 -0
  512. mage_integrations/sources/hubspot/tests/test_hubspot_start_date.py +179 -0
  513. mage_integrations/sources/hubspot/tests/unittests/test_deals.py +101 -0
  514. mage_integrations/sources/intercom/README.md +19 -0
  515. mage_integrations/sources/intercom/__init__.py +54 -0
  516. mage_integrations/sources/intercom/client.py +246 -0
  517. mage_integrations/sources/intercom/schema.py +57 -0
  518. mage_integrations/sources/intercom/schemas/admins.json +65 -0
  519. mage_integrations/sources/intercom/schemas/companies.json +106 -0
  520. mage_integrations/sources/intercom/schemas/company_attributes.json +63 -0
  521. mage_integrations/sources/intercom/schemas/company_segments.json +26 -0
  522. mage_integrations/sources/intercom/schemas/contact_attributes.json +104 -0
  523. mage_integrations/sources/intercom/schemas/contacts.json +534 -0
  524. mage_integrations/sources/intercom/schemas/conversation_parts.json +180 -0
  525. mage_integrations/sources/intercom/schemas/conversations.json +797 -0
  526. mage_integrations/sources/intercom/schemas/segments.json +26 -0
  527. mage_integrations/sources/intercom/schemas/tags.json +15 -0
  528. mage_integrations/sources/intercom/schemas/teams.json +28 -0
  529. mage_integrations/sources/intercom/streams.py +739 -0
  530. mage_integrations/sources/intercom/templates/config.json +4 -0
  531. mage_integrations/sources/intercom/transform.py +134 -0
  532. mage_integrations/sources/knowi/README.md +20 -0
  533. mage_integrations/sources/knowi/__init__.py +68 -0
  534. mage_integrations/sources/knowi/client.py +249 -0
  535. mage_integrations/sources/knowi/schema.py +60 -0
  536. mage_integrations/sources/knowi/schemas/dashboards.json +150 -0
  537. mage_integrations/sources/knowi/schemas/widgets.json +688 -0
  538. mage_integrations/sources/knowi/streams.py +190 -0
  539. mage_integrations/sources/knowi/templates/config.json +6 -0
  540. mage_integrations/sources/linkedin_ads/README.md +34 -0
  541. mage_integrations/sources/linkedin_ads/__init__.py +66 -0
  542. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/__init__.py +65 -0
  543. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/client.py +335 -0
  544. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/discover.py +30 -0
  545. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schema.py +91 -0
  546. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/account_users.json +91 -0
  547. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/accounts.json +190 -0
  548. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/ad_analytics_by_campaign.json +501 -0
  549. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/ad_analytics_by_creative.json +501 -0
  550. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/campaign_groups.json +133 -0
  551. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/campaigns.json +469 -0
  552. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/creatives.json +182 -0
  553. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/video_ads.json +115 -0
  554. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/sync.py +868 -0
  555. mage_integrations/sources/linkedin_ads/tap_linkedin_ads/transform.py +323 -0
  556. mage_integrations/sources/linkedin_ads/templates/config.json +9 -0
  557. mage_integrations/sources/linkedin_ads/tests/base.py +305 -0
  558. mage_integrations/sources/linkedin_ads/tests/test_all_fields.py +94 -0
  559. mage_integrations/sources/linkedin_ads/tests/test_discovery.py +95 -0
  560. mage_integrations/sources/linkedin_ads/tests/test_pagination.py +53 -0
  561. mage_integrations/sources/linkedin_ads/tests/test_start_date.py +130 -0
  562. mage_integrations/sources/linkedin_ads/tests/test_sync_canary.py +31 -0
  563. mage_integrations/sources/linkedin_ads/tests/test_sync_without_refrence_organization_id.py +31 -0
  564. mage_integrations/sources/linkedin_ads/tests/test_sync_without_refresh_token.py +131 -0
  565. mage_integrations/sources/linkedin_ads/tests/unittests/test_account_number.py +81 -0
  566. mage_integrations/sources/linkedin_ads/tests/unittests/test_adCampaignGroup_4XX.py +97 -0
  567. mage_integrations/sources/linkedin_ads/tests/unittests/test_client.py +94 -0
  568. mage_integrations/sources/linkedin_ads/tests/unittests/test_exception_handling.py +351 -0
  569. mage_integrations/sources/linkedin_ads/tests/unittests/test_fetch_access_token.py +36 -0
  570. mage_integrations/sources/linkedin_ads/tests/unittests/test_sync.py +197 -0
  571. mage_integrations/sources/linkedin_ads/tests/unittests/test_sync_endpoint.py +42 -0
  572. mage_integrations/sources/linkedin_ads/tests/unittests/test_timeout.py +279 -0
  573. mage_integrations/sources/messages.py +138 -0
  574. mage_integrations/sources/mode/README.md +21 -0
  575. mage_integrations/sources/mode/__init__.py +58 -0
  576. mage_integrations/sources/mode/client.py +251 -0
  577. mage_integrations/sources/mode/schema.py +57 -0
  578. mage_integrations/sources/mode/schemas/charts.json +116 -0
  579. mage_integrations/sources/mode/schemas/queries.json +41 -0
  580. mage_integrations/sources/mode/schemas/reports.json +128 -0
  581. mage_integrations/sources/mode/schemas/spaces.json +36 -0
  582. mage_integrations/sources/mode/streams.py +310 -0
  583. mage_integrations/sources/mode/templates/config.json +7 -0
  584. mage_integrations/sources/monday/README.md +24 -0
  585. mage_integrations/sources/monday/__init__.py +39 -0
  586. mage_integrations/sources/monday/client.py +35 -0
  587. mage_integrations/sources/monday/schemas/board_views.json +18 -0
  588. mage_integrations/sources/monday/schemas/boards.json +32 -0
  589. mage_integrations/sources/monday/schemas/columns.json +27 -0
  590. mage_integrations/sources/monday/schemas/groups.json +21 -0
  591. mage_integrations/sources/monday/schemas/workspaces.json +18 -0
  592. mage_integrations/sources/monday/streams.py +260 -0
  593. mage_integrations/sources/monday/templates/config.json +5 -0
  594. mage_integrations/sources/mongodb/README.md +33 -0
  595. mage_integrations/sources/mongodb/__init__.py +194 -0
  596. mage_integrations/sources/mongodb/schema.py +78 -0
  597. mage_integrations/sources/mongodb/spikes/atlas_setup.md +47 -0
  598. mage_integrations/sources/mongodb/spikes/dbreps_and_hackathon_review.md +46 -0
  599. mage_integrations/sources/mongodb/spikes/local_mongo_setup.md +92 -0
  600. mage_integrations/sources/mongodb/spikes/pymongo_spike.py +115 -0
  601. mage_integrations/sources/mongodb/spikes/supported_versions_spike.md +58 -0
  602. mage_integrations/sources/mongodb/tap_mongodb/__init__.py +465 -0
  603. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/common.py +354 -0
  604. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/full_table.py +162 -0
  605. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/incremental.py +125 -0
  606. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/oplog.py +271 -0
  607. mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/utils.py +39 -0
  608. mage_integrations/sources/mongodb/templates/config.json +7 -0
  609. mage_integrations/sources/mongodb/tests/__init__.py +0 -0
  610. mage_integrations/sources/mongodb/tests/mongodb_common.py +37 -0
  611. mage_integrations/sources/mongodb/tests/test_mongodb_cname_restrictions.py +252 -0
  612. mage_integrations/sources/mongodb/tests/test_mongodb_configurable_properties.py +195 -0
  613. mage_integrations/sources/mongodb/tests/test_mongodb_datatype.py +246 -0
  614. mage_integrations/sources/mongodb/tests/test_mongodb_discovery.py +272 -0
  615. mage_integrations/sources/mongodb/tests/test_mongodb_fname_restrictions.py +302 -0
  616. mage_integrations/sources/mongodb/tests/test_mongodb_full_table.py +288 -0
  617. mage_integrations/sources/mongodb/tests/test_mongodb_full_table_id.py +227 -0
  618. mage_integrations/sources/mongodb/tests/test_mongodb_full_table_interruptible.py +232 -0
  619. mage_integrations/sources/mongodb/tests/test_mongodb_id_pk_variations.py +273 -0
  620. mage_integrations/sources/mongodb/tests/test_mongodb_incremental.py +480 -0
  621. mage_integrations/sources/mongodb/tests/test_mongodb_incremental_open_transactions.py +312 -0
  622. mage_integrations/sources/mongodb/tests/test_mongodb_index.py +162 -0
  623. mage_integrations/sources/mongodb/tests/test_mongodb_log_based_interruptible.py +328 -0
  624. mage_integrations/sources/mongodb/tests/test_mongodb_namespace_restrictions.py +258 -0
  625. mage_integrations/sources/mongodb/tests/test_mongodb_oplog.py +260 -0
  626. mage_integrations/sources/mongodb/tests/test_mongodb_oplog_aged_out.py +181 -0
  627. mage_integrations/sources/mongodb/tests/test_mongodb_oplog_bookmarks.py +245 -0
  628. mage_integrations/sources/mongodb/tests/test_mongodb_projection.py +271 -0
  629. mage_integrations/sources/mongodb/tests/test_mongodb_table_reset_inc.py +300 -0
  630. mage_integrations/sources/mongodb/tests/test_mongodb_table_reset_log.py +209 -0
  631. mage_integrations/sources/mongodb/tests/test_mongodb_views.py +159 -0
  632. mage_integrations/sources/mongodb/tests/unittests/test_common.py +436 -0
  633. mage_integrations/sources/mssql/README.md +28 -0
  634. mage_integrations/sources/mssql/__init__.py +88 -0
  635. mage_integrations/sources/mssql/templates/config.json +9 -0
  636. mage_integrations/sources/mysql/README.md +32 -0
  637. mage_integrations/sources/mysql/__init__.py +70 -0
  638. mage_integrations/sources/mysql/templates/config.json +13 -0
  639. mage_integrations/sources/oracledb/README.md +22 -0
  640. mage_integrations/sources/oracledb/__init__.py +152 -0
  641. mage_integrations/sources/oracledb/templates/config.json +8 -0
  642. mage_integrations/sources/outreach/README.md +68 -0
  643. mage_integrations/sources/outreach/__init__.py +47 -0
  644. mage_integrations/sources/outreach/tap_outreach/__init__.py +50 -0
  645. mage_integrations/sources/outreach/tap_outreach/client.py +131 -0
  646. mage_integrations/sources/outreach/tap_outreach/discover.py +87 -0
  647. mage_integrations/sources/outreach/tap_outreach/schemas/accounts.json +356 -0
  648. mage_integrations/sources/outreach/tap_outreach/schemas/call_dispositions.json +49 -0
  649. mage_integrations/sources/outreach/tap_outreach/schemas/call_purposes.json +43 -0
  650. mage_integrations/sources/outreach/tap_outreach/schemas/calls.json +179 -0
  651. mage_integrations/sources/outreach/tap_outreach/schemas/content_categories.json +55 -0
  652. mage_integrations/sources/outreach/tap_outreach/schemas/duties.json +23 -0
  653. mage_integrations/sources/outreach/tap_outreach/schemas/events.json +97 -0
  654. mage_integrations/sources/outreach/tap_outreach/schemas/mailboxes.json +306 -0
  655. mage_integrations/sources/outreach/tap_outreach/schemas/mailings.json +283 -0
  656. mage_integrations/sources/outreach/tap_outreach/schemas/opportunities.json +724 -0
  657. mage_integrations/sources/outreach/tap_outreach/schemas/personas.json +37 -0
  658. mage_integrations/sources/outreach/tap_outreach/schemas/prospects.json +906 -0
  659. mage_integrations/sources/outreach/tap_outreach/schemas/sequence_states.json +161 -0
  660. mage_integrations/sources/outreach/tap_outreach/schemas/sequence_steps.json +152 -0
  661. mage_integrations/sources/outreach/tap_outreach/schemas/sequence_templates.json +122 -0
  662. mage_integrations/sources/outreach/tap_outreach/schemas/sequences.json +275 -0
  663. mage_integrations/sources/outreach/tap_outreach/schemas/stages.json +55 -0
  664. mage_integrations/sources/outreach/tap_outreach/schemas/tasks.json +186 -0
  665. mage_integrations/sources/outreach/tap_outreach/schemas/teams.json +30 -0
  666. mage_integrations/sources/outreach/tap_outreach/schemas/users.json +361 -0
  667. mage_integrations/sources/outreach/tap_outreach/sync.py +378 -0
  668. mage_integrations/sources/outreach/templates/config.json +7 -0
  669. mage_integrations/sources/paystack/README.md +15 -0
  670. mage_integrations/sources/paystack/__init__.py +44 -0
  671. mage_integrations/sources/paystack/client.py +14 -0
  672. mage_integrations/sources/paystack/schemas/customers.json +45 -0
  673. mage_integrations/sources/paystack/schemas/transactions.json +170 -0
  674. mage_integrations/sources/paystack/streams/__init__.py +8 -0
  675. mage_integrations/sources/paystack/streams/base.py +122 -0
  676. mage_integrations/sources/paystack/streams/customers.py +18 -0
  677. mage_integrations/sources/paystack/streams/transactions.py +18 -0
  678. mage_integrations/sources/paystack/templates/config.json +5 -0
  679. mage_integrations/sources/pipedrive/README.md +14 -0
  680. mage_integrations/sources/pipedrive/__init__.py +38 -0
  681. mage_integrations/sources/pipedrive/tap_pipedrive/__init__.py +1 -0
  682. mage_integrations/sources/pipedrive/tap_pipedrive/cli.py +32 -0
  683. mage_integrations/sources/pipedrive/tap_pipedrive/config.py +5 -0
  684. mage_integrations/sources/pipedrive/tap_pipedrive/exceptions.py +46 -0
  685. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/activity_types.json +37 -0
  686. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/currency.json +26 -0
  687. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/deal_products.json +125 -0
  688. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/dealflow.json +45 -0
  689. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/filters.json +37 -0
  690. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/pipelines.json +31 -0
  691. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/activities.json +112 -0
  692. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/deals.json +197 -0
  693. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/notes.json +90 -0
  694. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/organizations.json +156 -0
  695. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/persons.json +174 -0
  696. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/products.json +81 -0
  697. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/files.json +97 -0
  698. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/users.json +75 -0
  699. mage_integrations/sources/pipedrive/tap_pipedrive/schemas/stages.json +40 -0
  700. mage_integrations/sources/pipedrive/tap_pipedrive/stream.py +195 -0
  701. mage_integrations/sources/pipedrive/tap_pipedrive/streams/__init__.py +22 -0
  702. mage_integrations/sources/pipedrive/tap_pipedrive/streams/activity_types.py +9 -0
  703. mage_integrations/sources/pipedrive/tap_pipedrive/streams/currencies.py +7 -0
  704. mage_integrations/sources/pipedrive/tap_pipedrive/streams/deal_products.py +17 -0
  705. mage_integrations/sources/pipedrive/tap_pipedrive/streams/dealflow.py +24 -0
  706. mage_integrations/sources/pipedrive/tap_pipedrive/streams/filters.py +9 -0
  707. mage_integrations/sources/pipedrive/tap_pipedrive/streams/notes.py +8 -0
  708. mage_integrations/sources/pipedrive/tap_pipedrive/streams/pipelines.py +9 -0
  709. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/__init__.py +36 -0
  710. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/__init__.py +86 -0
  711. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/activities.py +16 -0
  712. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/deals.py +22 -0
  713. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/notes.py +14 -0
  714. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/organizations.py +22 -0
  715. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/persons.py +21 -0
  716. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/products.py +13 -0
  717. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/files.py +10 -0
  718. mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/users.py +21 -0
  719. mage_integrations/sources/pipedrive/tap_pipedrive/streams/stages.py +9 -0
  720. mage_integrations/sources/pipedrive/tap_pipedrive/tap.py +426 -0
  721. mage_integrations/sources/pipedrive/templates/config.json +4 -0
  722. mage_integrations/sources/postgresql/README.md +34 -0
  723. mage_integrations/sources/postgresql/__init__.py +499 -0
  724. mage_integrations/sources/postgresql/decoders.py +396 -0
  725. mage_integrations/sources/postgresql/templates/config.json +10 -0
  726. mage_integrations/sources/postmark/README.md +20 -0
  727. mage_integrations/sources/postmark/__init__.py +43 -0
  728. mage_integrations/sources/postmark/tap_postmark/__init__.py +4 -0
  729. mage_integrations/sources/postmark/tap_postmark/cleaners.py +331 -0
  730. mage_integrations/sources/postmark/tap_postmark/discover.py +55 -0
  731. mage_integrations/sources/postmark/tap_postmark/postmark.py +552 -0
  732. mage_integrations/sources/postmark/tap_postmark/schema.py +40 -0
  733. mage_integrations/sources/postmark/tap_postmark/schemas/messages_opens.json +134 -0
  734. mage_integrations/sources/postmark/tap_postmark/schemas/messages_outbound.json +93 -0
  735. mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_bounces.json +81 -0
  736. mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_clients.json +19 -0
  737. mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_overview.json +88 -0
  738. mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_platform.json +46 -0
  739. mage_integrations/sources/postmark/tap_postmark/streams.py +535 -0
  740. mage_integrations/sources/postmark/tap_postmark/sync.py +124 -0
  741. mage_integrations/sources/postmark/tap_postmark/tap.py +51 -0
  742. mage_integrations/sources/postmark/tap_postmark/tools.py +87 -0
  743. mage_integrations/sources/postmark/templates/config.json +4 -0
  744. mage_integrations/sources/powerbi/README.md +20 -0
  745. mage_integrations/sources/powerbi/__init__.py +68 -0
  746. mage_integrations/sources/powerbi/client.py +249 -0
  747. mage_integrations/sources/powerbi/schema.py +60 -0
  748. mage_integrations/sources/powerbi/schemas/apps.json +22 -0
  749. mage_integrations/sources/powerbi/schemas/dashboards.json +36 -0
  750. mage_integrations/sources/powerbi/schemas/datasets.json +31 -0
  751. mage_integrations/sources/powerbi/schemas/groups.json +34 -0
  752. mage_integrations/sources/powerbi/schemas/reports.json +25 -0
  753. mage_integrations/sources/powerbi/schemas/tiles.json +31 -0
  754. mage_integrations/sources/powerbi/streams.py +365 -0
  755. mage_integrations/sources/powerbi/templates/config.json +6 -0
  756. mage_integrations/sources/query.py +23 -0
  757. mage_integrations/sources/redshift/README.md +36 -0
  758. mage_integrations/sources/redshift/__init__.py +143 -0
  759. mage_integrations/sources/redshift/constants.py +57 -0
  760. mage_integrations/sources/redshift/templates/config.json +9 -0
  761. mage_integrations/sources/redshift/utils.py +26 -0
  762. mage_integrations/sources/salesforce/README.md +149 -0
  763. mage_integrations/sources/salesforce/__init__.py +77 -0
  764. mage_integrations/sources/salesforce/client/LICENSE +620 -0
  765. mage_integrations/sources/salesforce/client/__init__.py +0 -0
  766. mage_integrations/sources/salesforce/client/tap_salesforce/__init__.py +616 -0
  767. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/__init__.py +400 -0
  768. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/bulk.py +353 -0
  769. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/credentials.py +112 -0
  770. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/exceptions.py +8 -0
  771. mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/rest.py +109 -0
  772. mage_integrations/sources/salesforce/client/tap_salesforce/sync.py +221 -0
  773. mage_integrations/sources/salesforce/templates/config.json +10 -0
  774. mage_integrations/sources/sftp/LICENSE +620 -0
  775. mage_integrations/sources/sftp/README.md +47 -0
  776. mage_integrations/sources/sftp/__init__.py +39 -0
  777. mage_integrations/sources/sftp/tap_sftp/__init__.py +0 -0
  778. mage_integrations/sources/sftp/tap_sftp/aws_ssm.py +24 -0
  779. mage_integrations/sources/sftp/tap_sftp/client.py +217 -0
  780. mage_integrations/sources/sftp/tap_sftp/decrypt.py +24 -0
  781. mage_integrations/sources/sftp/tap_sftp/discover.py +32 -0
  782. mage_integrations/sources/sftp/tap_sftp/singer_encodings/__init__.py +0 -0
  783. mage_integrations/sources/sftp/tap_sftp/singer_encodings/compression.py +20 -0
  784. mage_integrations/sources/sftp/tap_sftp/singer_encodings/csv_handler.py +58 -0
  785. mage_integrations/sources/sftp/tap_sftp/singer_encodings/json_schema.py +204 -0
  786. mage_integrations/sources/sftp/tap_sftp/stats.py +44 -0
  787. mage_integrations/sources/sftp/tap_sftp/sync.py +122 -0
  788. mage_integrations/sources/sftp/tap_sftp/tap.py +97 -0
  789. mage_integrations/sources/sftp/templates/config.json +22 -0
  790. mage_integrations/sources/snowflake/README.md +36 -0
  791. mage_integrations/sources/snowflake/__init__.py +63 -0
  792. mage_integrations/sources/snowflake/constants.py +0 -0
  793. mage_integrations/sources/snowflake/templates/config.json +11 -0
  794. mage_integrations/sources/sql/__init__.py +0 -0
  795. mage_integrations/sources/sql/base.py +464 -0
  796. mage_integrations/sources/sql/constants.py +10 -0
  797. mage_integrations/sources/sql/utils.py +77 -0
  798. mage_integrations/sources/stripe/README.md +43 -0
  799. mage_integrations/sources/stripe/__init__.py +1297 -0
  800. mage_integrations/sources/stripe/schemas/balance_transactions.json +145 -0
  801. mage_integrations/sources/stripe/schemas/charges.json +1 -0
  802. mage_integrations/sources/stripe/schemas/coupons.json +120 -0
  803. mage_integrations/sources/stripe/schemas/customers.json +501 -0
  804. mage_integrations/sources/stripe/schemas/disputes.json +210 -0
  805. mage_integrations/sources/stripe/schemas/events.json +68 -0
  806. mage_integrations/sources/stripe/schemas/invoice_items.json +251 -0
  807. mage_integrations/sources/stripe/schemas/invoice_line_items.json +504 -0
  808. mage_integrations/sources/stripe/schemas/invoices.json +966 -0
  809. mage_integrations/sources/stripe/schemas/payment_intents.json +1101 -0
  810. mage_integrations/sources/stripe/schemas/payout_transactions.json +20 -0
  811. mage_integrations/sources/stripe/schemas/payouts.json +280 -0
  812. mage_integrations/sources/stripe/schemas/plans.json +1 -0
  813. mage_integrations/sources/stripe/schemas/products.json +181 -0
  814. mage_integrations/sources/stripe/schemas/shared/charge.json +1896 -0
  815. mage_integrations/sources/stripe/schemas/shared/discount.json +177 -0
  816. mage_integrations/sources/stripe/schemas/shared/plan.json +190 -0
  817. mage_integrations/sources/stripe/schemas/shared/source.json +573 -0
  818. mage_integrations/sources/stripe/schemas/shared/tax_ids.json +84 -0
  819. mage_integrations/sources/stripe/schemas/subscription_items.json +456 -0
  820. mage_integrations/sources/stripe/schemas/subscriptions.json +494 -0
  821. mage_integrations/sources/stripe/schemas/transfers.json +170 -0
  822. mage_integrations/sources/stripe/templates/config.json +5 -0
  823. mage_integrations/sources/tableau/README.md +22 -0
  824. mage_integrations/sources/tableau/__init__.py +71 -0
  825. mage_integrations/sources/tableau/client.py +251 -0
  826. mage_integrations/sources/tableau/schema.py +60 -0
  827. mage_integrations/sources/tableau/schemas/views.json +50 -0
  828. mage_integrations/sources/tableau/schemas/workbooks.json +250 -0
  829. mage_integrations/sources/tableau/streams.py +193 -0
  830. mage_integrations/sources/tableau/templates/config.json +7 -0
  831. mage_integrations/sources/teradata/README.md +24 -0
  832. mage_integrations/sources/teradata/__init__.py +255 -0
  833. mage_integrations/sources/teradata/templates/config.json +7 -0
  834. mage_integrations/sources/titanic/README.md +0 -0
  835. mage_integrations/sources/titanic/__init__.py +34 -0
  836. mage_integrations/sources/titanic/schemas/passengers.json +81 -0
  837. mage_integrations/sources/titanic/templates/config.json +4 -0
  838. mage_integrations/sources/twitter_ads/README.md +29 -0
  839. mage_integrations/sources/twitter_ads/__init__.py +56 -0
  840. mage_integrations/sources/twitter_ads/tap_twitter_ads/__init__.py +132 -0
  841. mage_integrations/sources/twitter_ads/tap_twitter_ads/client.py +108 -0
  842. mage_integrations/sources/twitter_ads/tap_twitter_ads/discover.py +31 -0
  843. mage_integrations/sources/twitter_ads/tap_twitter_ads/schema.py +223 -0
  844. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/account_media.json +74 -0
  845. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/accounts.json +45 -0
  846. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/advertiser_business_categories.json +25 -0
  847. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/campaigns.json +69 -0
  848. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards.json +37 -0
  849. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_image_conversation.json +56 -0
  850. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_poll.json +73 -0
  851. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_video_conversation.json +62 -0
  852. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/content_categories.json +25 -0
  853. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/funding_instruments.json +71 -0
  854. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/iab_categories.json +15 -0
  855. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/line_item_apps.json +32 -0
  856. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/line_items.json +127 -0
  857. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/media_creatives.json +38 -0
  858. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/preroll_call_to_actions.json +32 -0
  859. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promotable_users.json +26 -0
  860. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promoted_accounts.json +35 -0
  861. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promoted_tweets.json +35 -0
  862. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/scheduled_promoted_tweets.json +32 -0
  863. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/billing.json +12 -0
  864. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/dimensions.json +87 -0
  865. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/engagement_all.json +39 -0
  866. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/engagement_basic.json +24 -0
  867. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/media.json +12 -0
  868. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/mobile_conversion.json +60 -0
  869. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/mobile_conversion_obj.json +21 -0
  870. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_account.json +23 -0
  871. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_funding_instrument.json +26 -0
  872. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_mobile_conversion.json +23 -0
  873. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_organic_tweet.json +26 -0
  874. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_other.json +38 -0
  875. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_web_conversion.json +23 -0
  876. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/video.json +36 -0
  877. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/web_conversion.json +21 -0
  878. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/web_conversion_obj.json +36 -0
  879. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tailored_audiences.json +70 -0
  880. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_app_store_categories.json +18 -0
  881. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_conversations.json +18 -0
  882. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_criteria.json +44 -0
  883. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_devices.json +21 -0
  884. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_events.json +123 -0
  885. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_interests.json +15 -0
  886. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_languages.json +15 -0
  887. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_locations.json +21 -0
  888. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_network_operators.json +18 -0
  889. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_platform_versions.json +21 -0
  890. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_platforms.json +15 -0
  891. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_tv_markets.json +15 -0
  892. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_tv_shows.json +37 -0
  893. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tracking_tags.json +30 -0
  894. mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tweets.json +920 -0
  895. mage_integrations/sources/twitter_ads/tap_twitter_ads/streams.py +1875 -0
  896. mage_integrations/sources/twitter_ads/tap_twitter_ads/sync.py +176 -0
  897. mage_integrations/sources/twitter_ads/tap_twitter_ads/transform.py +165 -0
  898. mage_integrations/sources/twitter_ads/templates/config.json +27 -0
  899. mage_integrations/sources/utils.py +318 -0
  900. mage_integrations/sources/zendesk/README.md +64 -0
  901. mage_integrations/sources/zendesk/__init__.py +45 -0
  902. mage_integrations/sources/zendesk/spikes/ticket_events.py +138 -0
  903. mage_integrations/sources/zendesk/tap_zendesk/__init__.py +253 -0
  904. mage_integrations/sources/zendesk/tap_zendesk/discover.py +80 -0
  905. mage_integrations/sources/zendesk/tap_zendesk/http.py +253 -0
  906. mage_integrations/sources/zendesk/tap_zendesk/metrics.py +102 -0
  907. mage_integrations/sources/zendesk/tap_zendesk/schemas/group_memberships.json +52 -0
  908. mage_integrations/sources/zendesk/tap_zendesk/schemas/groups.json +46 -0
  909. mage_integrations/sources/zendesk/tap_zendesk/schemas/macros.json +116 -0
  910. mage_integrations/sources/zendesk/tap_zendesk/schemas/organizations.json +114 -0
  911. mage_integrations/sources/zendesk/tap_zendesk/schemas/satisfaction_ratings.json +49 -0
  912. mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/attachments.json +148 -0
  913. mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/metadata.json +145 -0
  914. mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/via.json +122 -0
  915. mage_integrations/sources/zendesk/tap_zendesk/schemas/sla_policies.json +128 -0
  916. mage_integrations/sources/zendesk/tap_zendesk/schemas/tags.json +20 -0
  917. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_audits.json +789 -0
  918. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_comments.json +72 -0
  919. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_fields.json +199 -0
  920. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_forms.json +113 -0
  921. mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_metrics.json +277 -0
  922. mage_integrations/sources/zendesk/tap_zendesk/schemas/tickets.json +393 -0
  923. mage_integrations/sources/zendesk/tap_zendesk/schemas/users.json +382 -0
  924. mage_integrations/sources/zendesk/tap_zendesk/streams.py +657 -0
  925. mage_integrations/sources/zendesk/tap_zendesk/sync.py +61 -0
  926. mage_integrations/sources/zendesk/templates/config.json +6 -0
  927. mage_integrations/sources/zendesk/test/__init__.py +0 -0
  928. mage_integrations/sources/zendesk/test/base.py +400 -0
  929. mage_integrations/sources/zendesk/test/test_all_fields.py +83 -0
  930. mage_integrations/sources/zendesk/test/test_all_streams.py +150 -0
  931. mage_integrations/sources/zendesk/test/test_automatic_fields.py +71 -0
  932. mage_integrations/sources/zendesk/test/test_bookmarks.py +160 -0
  933. mage_integrations/sources/zendesk/test/test_custom_fields_discover.py +43 -0
  934. mage_integrations/sources/zendesk/test/test_discovery.py +129 -0
  935. mage_integrations/sources/zendesk/test/test_minimal_selection.py +67 -0
  936. mage_integrations/sources/zendesk/test/test_pagination.py +74 -0
  937. mage_integrations/sources/zendesk/test/test_standard_bookmark.py +197 -0
  938. mage_integrations/sources/zendesk/test/test_start_date.py +165 -0
  939. mage_integrations/sources/zendesk/test/unittests/test_discovery_mode.py +308 -0
  940. mage_integrations/sources/zendesk/test/unittests/test_exception.py +55 -0
  941. mage_integrations/sources/zendesk/test/unittests/test_http.py +481 -0
  942. mage_integrations/sources/zendesk/test/unittests/test_init.py +23 -0
  943. mage_integrations/sources/zendesk/test/unittests/test_request_timeout.py +628 -0
  944. mage_integrations/sources/zendesk/test/unittests/test_tickets_child_stream_skip_404_error.py +82 -0
  945. mage_integrations/sources/zendesk/test/unittests/test_yield_records.py +193 -0
  946. mage_integrations/tests/__init__.py +0 -0
  947. mage_integrations/tests/connections/__init__.py +0 -0
  948. mage_integrations/tests/destinations/__init__.py +0 -0
  949. mage_integrations/tests/destinations/amplitude/__init__.py +0 -0
  950. mage_integrations/tests/destinations/amplitude/test_amplitude.py +117 -0
  951. mage_integrations/tests/destinations/bigquery/__init__.py +0 -0
  952. mage_integrations/tests/destinations/bigquery/test_bigquery.py +54 -0
  953. mage_integrations/tests/destinations/doris/__init__.py +0 -0
  954. mage_integrations/tests/destinations/doris/test_doris.py +64 -0
  955. mage_integrations/tests/destinations/mongodb/__init__.py +0 -0
  956. mage_integrations/tests/destinations/mongodb/test_mongodb.py +67 -0
  957. mage_integrations/tests/destinations/mssql/__init__.py +0 -0
  958. mage_integrations/tests/destinations/mssql/test_mssql.py +64 -0
  959. mage_integrations/tests/destinations/mysql/__init__.py +0 -0
  960. mage_integrations/tests/destinations/mysql/test_mysql.py +116 -0
  961. mage_integrations/tests/destinations/oracledb/__init__.py +0 -0
  962. mage_integrations/tests/destinations/oracledb/test_oracledb.py +63 -0
  963. mage_integrations/tests/destinations/postgresql/__init__.py +0 -0
  964. mage_integrations/tests/destinations/postgresql/test_postgres.py +60 -0
  965. mage_integrations/tests/destinations/redshift/__init__.py +0 -0
  966. mage_integrations/tests/destinations/redshift/test_redshift.py +68 -0
  967. mage_integrations/tests/destinations/search/__init__.py +0 -0
  968. mage_integrations/tests/destinations/search/test_sinks.py +71 -0
  969. mage_integrations/tests/destinations/snowflake/__init__.py +0 -0
  970. mage_integrations/tests/destinations/snowflake/test_snowflake.py +113 -0
  971. mage_integrations/tests/destinations/sql/__init__.py +0 -0
  972. mage_integrations/tests/destinations/sql/mixins.py +48 -0
  973. mage_integrations/tests/destinations/sql/test_truncate.py +94 -0
  974. mage_integrations/tests/destinations/test_base.py +557 -0
  975. mage_integrations/tests/sources/__init__.py +0 -0
  976. mage_integrations/tests/sources/amplitude/__init__.py +0 -0
  977. mage_integrations/tests/sources/amplitude/test_amplitude.py +232 -0
  978. mage_integrations/tests/sources/api/__init__.py +0 -0
  979. mage_integrations/tests/sources/api/test_api.py +377 -0
  980. mage_integrations/tests/sources/bigquery/__init__.py +0 -0
  981. mage_integrations/tests/sources/bigquery/test_bigquery.py +232 -0
  982. mage_integrations/tests/sources/couchbase/__init__.py +0 -0
  983. mage_integrations/tests/sources/couchbase/test_couchbase.py +379 -0
  984. mage_integrations/tests/sources/doris/__init__.py +0 -0
  985. mage_integrations/tests/sources/doris/test_doris.py +118 -0
  986. mage_integrations/tests/sources/mongodb/__init__.py +0 -0
  987. mage_integrations/tests/sources/mongodb/test_common.py +73 -0
  988. mage_integrations/tests/sources/mongodb/test_schema.py +91 -0
  989. mage_integrations/tests/sources/mysql/__init__.py +0 -0
  990. mage_integrations/tests/sources/mysql/test_mysql.py +114 -0
  991. mage_integrations/tests/sources/postgresql/__init__.py +0 -0
  992. mage_integrations/tests/sources/postgresql/test_postgresql.py +46 -0
  993. mage_integrations/tests/sources/sql/__init__.py +0 -0
  994. mage_integrations/tests/sources/sql/test_base.py +215 -0
  995. mage_integrations/tests/sources/test_base.py +404 -0
  996. mage_integrations/tests/test_dependency_contracts.py +28 -0
  997. mage_integrations/tests/utils/__init__.py +0 -0
  998. mage_integrations/tests/utils/test_frames.py +122 -0
  999. mage_integrations/transformers/__init__.py +0 -0
  1000. mage_integrations/transformers/base.py +183 -0
  1001. mage_integrations/transformers/utils.py +39 -0
  1002. mage_integrations/utils/__init__.py +0 -0
  1003. mage_integrations/utils/array.py +40 -0
  1004. mage_integrations/utils/dates.py +45 -0
  1005. mage_integrations/utils/dictionary.py +108 -0
  1006. mage_integrations/utils/files.py +5 -0
  1007. mage_integrations/utils/frames.py +123 -0
  1008. mage_integrations/utils/logger/__init__.py +103 -0
  1009. mage_integrations/utils/logger/constants.py +11 -0
  1010. mage_integrations/utils/parsers.py +56 -0
  1011. mage_integrations/utils/schema_helpers.py +37 -0
  1012. mage_integrations/utils/strings.py +6 -0
  1013. mage_integrations-0.2.1.dist-info/METADATA +304 -0
  1014. mage_integrations-0.2.1.dist-info/RECORD +1016 -0
  1015. mage_integrations-0.2.1.dist-info/WHEEL +5 -0
  1016. mage_integrations-0.2.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,504 @@
1
+ import unittest
2
+ import tap_facebook
3
+ from unittest.mock import Mock
4
+ from unittest import mock
5
+ from requests.exceptions import ConnectionError, Timeout
6
+ from tap_facebook import AdCreative, Ads, AdSets, Campaigns, AdsInsights, Leads
7
+
8
+ @mock.patch("time.sleep")
9
+ class TestRequestTimeoutBackoff(unittest.TestCase):
10
+ """A set of unit tests to ensure that requests are retrying properly for Timeout Error"""
11
+ def test_get_adcreatives(self, mocked_sleep):
12
+ """
13
+ AdCreative.get_adcreatives calls a `facebook_business` method,`get_ad_creatives()`, to get a batch of ad creatives.
14
+ We mock this method to raise a `Timeout` and expect the tap to retry this that function up to 5 times,
15
+ which is the current hard coded `max_tries` value.
16
+ """
17
+
18
+ # Mock get_ad_creatives function to throw Timeout exception
19
+ mocked_account = Mock()
20
+ mocked_account.get_ad_creatives = Mock()
21
+ mocked_account.get_ad_creatives.side_effect = Timeout
22
+
23
+ # Call get_adcreatives() function of AdCreatives and verify Timeout is raised
24
+ ad_creative_object = AdCreative('', mocked_account, '', '')
25
+ with self.assertRaises(Timeout):
26
+ ad_creative_object.get_adcreatives()
27
+
28
+ # verify get_ad_creatives() is called 5 times as max 5 reties provided for function
29
+ self.assertEqual(mocked_account.get_ad_creatives.call_count, 5)
30
+
31
+ def test__call_get_ads(self, mocked_sleep):
32
+ """
33
+ Ads._call_get_ads calls a `facebook_business` method,`get_ads()`, to get a batch of ads.
34
+ We mock this method to raise a `Timeout` and expect the tap to retry this that function up to 5 times,
35
+ which is the current hard coded `max_tries` value.
36
+ """
37
+
38
+ # Mock get_ads function to throw Timeout exception
39
+ mocked_account = Mock()
40
+ mocked_account.get_ads = Mock()
41
+ mocked_account.get_ads.side_effect = Timeout
42
+
43
+ # Call _call_get_ads() function of Ads and verify Timeout is raised
44
+ ad_object = Ads('', mocked_account, '', '', '')
45
+ with self.assertRaises(Timeout):
46
+ ad_object._call_get_ads('test')
47
+
48
+ # verify get_ads() is called 5 times as max 5 reties provided for function
49
+ self.assertEqual(mocked_account.get_ads.call_count, 5)
50
+
51
+ @mock.patch("pendulum.parse")
52
+ def test_ad_prepare_record(self, mocked_parse, mocked_sleep):
53
+ """
54
+ __iter__ of Ads calls a function _iterate which calls a nested prepare_record function.
55
+ Prepare_record calls a `facebook_business` method,`ad.api_get()`, to get a ad fields.
56
+ We mock this method to raise a `Timeout` and expect the tap to retry this that function up to 5 times,
57
+ which is the current hard coded `max_tries` value.
58
+ """
59
+ # Mock ad object
60
+ mocked_ad = Mock()
61
+ mocked_ad.api_get = Mock()
62
+ mocked_ad.__getitem__ = Mock()
63
+ mocked_ad.api_get.side_effect = Timeout
64
+
65
+ # # Mock get_ads function return mocked ad object
66
+ mocked_account = Mock()
67
+ mocked_account.get_ads = Mock()
68
+ mocked_account.get_ads.side_effect = [[mocked_ad]]
69
+
70
+ # Iterate ads object which calls prepare_record() inside and verify Timeout is raised
71
+ ad_object = Ads('', mocked_account, '', '', '')
72
+ with self.assertRaises(Timeout):
73
+ for message in ad_object:
74
+ pass
75
+
76
+ # verify prepare_record() function by checking call count of mocked ad.api_get()
77
+ self.assertEqual(mocked_ad.api_get.call_count, 5)
78
+
79
+ def test__call_get_ad_sets(self, mocked_sleep):
80
+ """
81
+ AdSets._call_get_ad_sets calls a `facebook_business` method,`get_ad_sets()`, to get a batch of adsets.
82
+ We mock this method to raise a `Timeout` and expect the tap to retry this that function up to 5 times,
83
+ which is the current hard coded `max_tries` value.
84
+ """
85
+
86
+ # Mock get_ad_sets function to throw Timeout exception
87
+ mocked_account = Mock()
88
+ mocked_account.get_ad_sets = Mock()
89
+ mocked_account.get_ad_sets.side_effect = Timeout
90
+
91
+ # Call _call_get_ad_sets() function of AdSets and verify Timeout is raised
92
+ ad_set_object = AdSets('', mocked_account, '', '', '')
93
+ with self.assertRaises(Timeout):
94
+ ad_set_object._call_get_ad_sets('test')
95
+
96
+ # verify get_ad_sets() is called 5 times as max 5 reties provided for function
97
+ self.assertEqual(mocked_account.get_ad_sets.call_count, 5)
98
+
99
+ @mock.patch("pendulum.parse")
100
+ def test_adset_prepare_record(self, mocked_parse, mocked_sleep):
101
+ """
102
+ __iter__ of AdSets calls a function _iterate which calls a nested prepare_record function.
103
+ Prepare_record calls a `facebook_business` method,`ad.api_get()`, to get a ad fields.
104
+ We mock this method to raise a `Timeout` and expect the tap to retry this that function up to 5 times,
105
+ which is the current hard coded `max_tries` value.
106
+ """
107
+
108
+ # Mock adset object
109
+ mocked_adset = Mock()
110
+ mocked_adset.api_get = Mock()
111
+ mocked_adset.__getitem__ = Mock()
112
+ mocked_adset.api_get.side_effect = Timeout
113
+
114
+ # Mock get_ad_sets function return mocked ad object
115
+ mocked_account = Mock()
116
+ mocked_account.get_ad_sets = Mock()
117
+ mocked_account.get_ad_sets.side_effect = [[mocked_adset]]
118
+
119
+ # Iterate adset object which calls prepare_record() inside and verify Timeout is raised
120
+ ad_set_object = AdSets('', mocked_account, '', '', '')
121
+ with self.assertRaises(Timeout):
122
+ for message in ad_set_object:
123
+ pass
124
+
125
+ # verify prepare_record() function by checking call count of mocked ad.api_get()
126
+ self.assertEqual(mocked_adset.api_get.call_count, 5)
127
+
128
+ def test__call_get_campaigns(self, mocked_sleep):
129
+ """
130
+ Campaigns._call_get_campaigns calls a `facebook_business` method,`get_campaigns()`, to get a batch of campaigns.
131
+ We mock this method to raise a `Timeout` and expect the tap to retry this that function up to 5 times,
132
+ which is the current hard coded `max_tries` value.
133
+ """
134
+
135
+ # Mock get_campaigns function to throw Timeout exception
136
+ mocked_account = Mock()
137
+ mocked_account.get_campaigns = Mock()
138
+ mocked_account.get_campaigns.side_effect = Timeout
139
+
140
+ # Call _call_get_campaigns() function of Campaigns and verify Timeout is raised
141
+ campaigns_object = Campaigns('', mocked_account, '', '', '')
142
+ with self.assertRaises(Timeout):
143
+ campaigns_object._call_get_campaigns('test')
144
+
145
+ # verify get_campaigns() is called 5 times as max 5 reties provided for function
146
+ self.assertEqual(mocked_account.get_campaigns.call_count, 5)
147
+
148
+ @mock.patch("pendulum.parse")
149
+ def test_campaign_prepare_record(self, mocked_parse, mocked_sleep):
150
+ """
151
+ __iter__ of Campaigns calls a function _iterate which calls a nested prepare_record function.
152
+ Prepare_record calls a `facebook_business` method,`ad.api_get()`, to get a ad fields.
153
+ We mock this method to raise a `Timeout` and expect the tap to retry this that function up to 5 times,
154
+ which is the current hard coded `max_tries` value.
155
+ """
156
+
157
+ # # Mock campaign object
158
+ mocked_campaign = Mock()
159
+ mocked_campaign.api_get = Mock()
160
+ mocked_campaign.__getitem__ = Mock()
161
+ mocked_campaign.api_get.side_effect = Timeout
162
+
163
+ # # Mock get_campaigns function return mocked ad object
164
+ mocked_account = Mock()
165
+ mocked_account.get_campaigns = Mock()
166
+ mocked_account.get_campaigns.side_effect = [[mocked_campaign]]
167
+
168
+ # Iterate campaigns object which calls prepare_record() inside and verify Timeout is raised
169
+ campaign_object = Campaigns('', mocked_account, '', '', '')
170
+ with self.assertRaises(Timeout):
171
+ for message in campaign_object:
172
+ pass
173
+
174
+ # verify prepare_record() function by checking call count of mocked ad.api_get()
175
+ self.assertEqual(mocked_campaign.api_get.call_count, 5)
176
+
177
+ def test_run_job(self, mocked_sleep):
178
+ """
179
+ AdsInsights.run_job calls a `facebook_business` method,`get_insights()`, to get a batch of insights.
180
+ We mock this method to raise a `Timeout` and expect the tap to retry this that function up to 5 times,
181
+ which is the current hard coded `max_tries` value.
182
+ """
183
+
184
+ # Mock get_insights function to throw Timeout exception
185
+ mocked_account = Mock()
186
+ mocked_account.get_insights = Mock()
187
+ mocked_account.get_insights.side_effect = Timeout
188
+
189
+ # Call run_job() function of Campaigns and verify Timeout is raised
190
+ ads_insights_object = AdsInsights('', mocked_account, '', '', '', {})
191
+ with self.assertRaises(Timeout):
192
+ ads_insights_object.run_job('test')
193
+
194
+ # verify get_insights() is called 5 times as max 5 reties provided for function
195
+ self.assertEqual(mocked_account.get_insights.call_count, 5)
196
+
197
+ @mock.patch("time.sleep")
198
+ class TestConnectionErrorBackoff(unittest.TestCase):
199
+ """A set of unit tests to ensure that requests are retrying properly for ConnectionError Error"""
200
+ def test_get_adcreatives(self, mocked_sleep):
201
+ """
202
+ AdCreative.get_adcreatives calls a `facebook_business` method,`get_ad_creatives()`, to get a batch of ad creatives.
203
+ We mock this method to raise a `ConnectionError` and expect the tap to retry this that function up to 5 times,
204
+ which is the current hard coded `max_tries` value.
205
+ """
206
+
207
+ # Mock get_ad_creatives function to throw ConnectionError exception
208
+ mocked_account = Mock()
209
+ mocked_account.get_ad_creatives = Mock()
210
+ mocked_account.get_ad_creatives.side_effect = ConnectionError
211
+
212
+ # Call get_adcreatives() function of AdCreatives and verify ConnectionError is raised
213
+ ad_creative_object = AdCreative('', mocked_account, '', '')
214
+ with self.assertRaises(ConnectionError):
215
+ ad_creative_object.get_adcreatives()
216
+
217
+ # verify get_ad_creatives() is called 5 times as max 5 reties provided for function
218
+ self.assertEqual(mocked_account.get_ad_creatives.call_count, 5)
219
+
220
+ def test__call_get_ads(self, mocked_sleep):
221
+ """
222
+ Ads._call_get_ads calls a `facebook_business` method,`get_ads()`, to get a batch of ads.
223
+ We mock this method to raise a `ConnectionError` and expect the tap to retry this that function up to 5 times,
224
+ which is the current hard coded `max_tries` value.
225
+ """
226
+
227
+ # Mock get_ads function to throw ConnectionError exception
228
+ mocked_account = Mock()
229
+ mocked_account.get_ads = Mock()
230
+ mocked_account.get_ads.side_effect = ConnectionError
231
+
232
+ # Call _call_get_ads() function of Ads and verify ConnectionError is raised
233
+ ad_object = Ads('', mocked_account, '', '', '')
234
+ with self.assertRaises(ConnectionError):
235
+ ad_object._call_get_ads('test')
236
+
237
+ # verify get_ads() is called 5 times as max 5 reties provided for function
238
+ self.assertEqual(mocked_account.get_ads.call_count, 5)
239
+
240
+ @mock.patch("pendulum.parse")
241
+ def test_ad_prepare_record(self, mocked_parse, mocked_sleep):
242
+ """
243
+ __iter__ of Ads calls a function _iterate which calls a nested prepare_record function.
244
+ Prepare_record calls a `facebook_business` method,`ad.api_get()`, to get a ad fields.
245
+ We mock this method to raise a `ConnectionError` and expect the tap to retry this that function up to 5 times,
246
+ which is the current hard coded `max_tries` value.
247
+ """
248
+ # Mock ad object
249
+ mocked_ad = Mock()
250
+ mocked_ad.api_get = Mock()
251
+ mocked_ad.__getitem__ = Mock()
252
+ mocked_ad.api_get.side_effect = ConnectionError
253
+
254
+ # # Mock get_ads function return mocked ad object
255
+ mocked_account = Mock()
256
+ mocked_account.get_ads = Mock()
257
+ mocked_account.get_ads.side_effect = [[mocked_ad]]
258
+
259
+ # Iterate ads object which calls prepare_record() inside and verify ConnectionError is raised
260
+ ad_object = Ads('', mocked_account, '', '', '')
261
+ with self.assertRaises(ConnectionError):
262
+ for message in ad_object:
263
+ pass
264
+
265
+ # verify prepare_record() function by checking call count of mocked ad.api_get()
266
+ self.assertEqual(mocked_ad.api_get.call_count, 5)
267
+
268
+ def test__call_get_ad_sets(self, mocked_sleep):
269
+ """
270
+ AdSets._call_get_ad_sets calls a `facebook_business` method,`get_ad_sets()`, to get a batch of adsets.
271
+ We mock this method to raise a `ConnectionError` and expect the tap to retry this that function up to 5 times,
272
+ which is the current hard coded `max_tries` value.
273
+ """
274
+
275
+ # Mock get_ad_sets function to throw ConnectionError exception
276
+ mocked_account = Mock()
277
+ mocked_account.get_ad_sets = Mock()
278
+ mocked_account.get_ad_sets.side_effect = ConnectionError
279
+
280
+ # Call _call_get_ad_sets() function of AdSets and verify ConnectionError is raised
281
+ ad_set_object = AdSets('', mocked_account, '', '', '')
282
+ with self.assertRaises(ConnectionError):
283
+ ad_set_object._call_get_ad_sets('test')
284
+
285
+ # verify get_ad_sets() is called 5 times as max 5 reties provided for function
286
+ self.assertEqual(mocked_account.get_ad_sets.call_count, 5)
287
+
288
+ @mock.patch("pendulum.parse")
289
+ def test_adset_prepare_record(self, mocked_parse, mocked_sleep):
290
+ """
291
+ __iter__ of AdSets calls a function _iterate which calls a nested prepare_record function.
292
+ Prepare_record calls a `facebook_business` method,`ad.api_get()`, to get a ad fields.
293
+ We mock this method to raise a `ConnectionError` and expect the tap to retry this that function up to 5 times,
294
+ which is the current hard coded `max_tries` value.
295
+ """
296
+
297
+ # Mock adset object
298
+ mocked_adset = Mock()
299
+ mocked_adset.api_get = Mock()
300
+ mocked_adset.__getitem__ = Mock()
301
+ mocked_adset.api_get.side_effect = ConnectionError
302
+
303
+ # Mock get_ad_sets function return mocked ad object
304
+ mocked_account = Mock()
305
+ mocked_account.get_ad_sets = Mock()
306
+ mocked_account.get_ad_sets.side_effect = [[mocked_adset]]
307
+
308
+ # Iterate adset object which calls prepare_record() inside and verify ConnectionError is raised
309
+ ad_set_object = AdSets('', mocked_account, '', '', '')
310
+ with self.assertRaises(ConnectionError):
311
+ for message in ad_set_object:
312
+ pass
313
+
314
+ # verify prepare_record() function by checking call count of mocked ad.api_get()
315
+ self.assertEqual(mocked_adset.api_get.call_count, 5)
316
+
317
+ def test__call_get_campaigns(self, mocked_sleep):
318
+ """
319
+ Campaigns._call_get_campaigns calls a `facebook_business` method,`get_campaigns()`, to get a batch of campaigns.
320
+ We mock this method to raise a `ConnectionError` and expect the tap to retry this that function up to 5 times,
321
+ which is the current hard coded `max_tries` value.
322
+ """
323
+
324
+ # Mock get_campaigns function to throw ConnectionError exception
325
+ mocked_account = Mock()
326
+ mocked_account.get_campaigns = Mock()
327
+ mocked_account.get_campaigns.side_effect = ConnectionError
328
+
329
+ # Call _call_get_campaigns() function of Campaigns and verify ConnectionError is raised
330
+ campaigns_object = Campaigns('', mocked_account, '', '', '')
331
+ with self.assertRaises(ConnectionError):
332
+ campaigns_object._call_get_campaigns('test')
333
+
334
+ # verify get_campaigns() is called 5 times as max 5 reties provided for function
335
+ self.assertEqual(mocked_account.get_campaigns.call_count, 5)
336
+
337
+ @mock.patch("pendulum.parse")
338
+ def test_campaign_prepare_record(self, mocked_parse, mocked_sleep):
339
+ """
340
+ __iter__ of Campaigns calls a function _iterate which calls a nested prepare_record function.
341
+ Prepare_record calls a `facebook_business` method,`ad.api_get()`, to get a ad fields.
342
+ We mock this method to raise a `ConnectionError` and expect the tap to retry this that function up to 5 times,
343
+ which is the current hard coded `max_tries` value.
344
+ """
345
+
346
+ # # Mock campaign object
347
+ mocked_campaign = Mock()
348
+ mocked_campaign.api_get = Mock()
349
+ mocked_campaign.__getitem__ = Mock()
350
+ mocked_campaign.api_get.side_effect = ConnectionError
351
+
352
+ # # Mock get_campaigns function return mocked ad object
353
+ mocked_account = Mock()
354
+ mocked_account.get_campaigns = Mock()
355
+ mocked_account.get_campaigns.side_effect = [[mocked_campaign]]
356
+
357
+ # Iterate campaigns object which calls prepare_record() inside and verify ConnectionError is raised
358
+ campaign_object = Campaigns('', mocked_account, '', '', '')
359
+ with self.assertRaises(ConnectionError):
360
+ for message in campaign_object:
361
+ pass
362
+
363
+ # verify prepare_record() function by checking call count of mocked ad.api_get()
364
+ self.assertEqual(mocked_campaign.api_get.call_count, 5)
365
+
366
+ def test_run_job(self, mocked_sleep):
367
+ """
368
+ AdsInsights.run_job calls a `facebook_business` method,`get_insights()`, to get a batch of insights.
369
+ We mock this method to raise a `ConnectionError` and expect the tap to retry this that function up to 5 times,
370
+ which is the current hard coded `max_tries` value.
371
+ """
372
+
373
+ # Mock get_insights function to throw ConnectionError exception
374
+ mocked_account = Mock()
375
+ mocked_account.get_insights = Mock()
376
+ mocked_account.get_insights.side_effect = ConnectionError
377
+
378
+ # Call run_job() function of Campaigns and verify ConnectionError is raised
379
+ ads_insights_object = AdsInsights('', mocked_account, '', '', '', {})
380
+ with self.assertRaises(ConnectionError):
381
+ ads_insights_object.run_job('test')
382
+
383
+ # verify get_insights() is called 5 times as max 5 reties provided for function
384
+ self.assertEqual(mocked_account.get_insights.call_count, 5)
385
+
386
+
387
+ # Mock args
388
+ class Args():
389
+ def __init__(self, config):
390
+ self.config = config
391
+ self.discover = False
392
+ self.properties = False
393
+ self.catalog = False
394
+ self.state = False
395
+
396
+ @mock.patch('tap_facebook.utils.parse_args')
397
+ @mock.patch("tap_facebook.FacebookAdsApi.init")
398
+ @mock.patch("tap_facebook.fb_user.User")
399
+ class TestRequestTimeoutValue(unittest.TestCase):
400
+ """A set of unit tests to ensure that request timeout is set based on config or default value"""
401
+
402
+ def test_default_value_request_timeout(self, mocked_user, mocked_facebook_api, mocked_args):
403
+ """
404
+ unit tests to ensure that request timeout is set based on config or default value
405
+ """
406
+ tap_facebook.CONFIG = {}
407
+ config = {'account_id': 'test', 'access_token': 'test'} # No request_timeout in config
408
+ mocked_args.return_value = Args(config)
409
+
410
+ # Mock fb_user and get_add_accounts
411
+ mocked_fb_user = Mock()
412
+ mocked_fb_user.get_ad_accounts = Mock()
413
+ mocked_fb_user.get_ad_accounts.return_value = [{'account_id': 'test'}]
414
+ mocked_user.return_value = mocked_fb_user
415
+
416
+ # Call main_impl function which initialize FacebookAdsApi with timeout
417
+ tap_facebook.main_impl()
418
+
419
+ # verify that FacebookAdsApi.init() called with default timeout
420
+ mocked_facebook_api.assert_called_with(access_token='test', timeout=300)
421
+
422
+ def test_config_provided_int_request_timeout(self, mocked_user, mocked_facebook_api, mocked_args):
423
+ """
424
+ unit tests to ensure that request timeout is set based on config(integer value)
425
+ """
426
+ tap_facebook.CONFIG = {}
427
+ # request_timeout provided in config with 100(integer)
428
+ config = {'account_id': 'test', 'access_token': 'test', 'request_timeout': 100}
429
+ mocked_args.return_value = Args(config)
430
+
431
+ # Mock fb_user and get_add_accounts
432
+ mocked_fb_user = Mock()
433
+ mocked_fb_user.get_ad_accounts = Mock()
434
+ mocked_fb_user.get_ad_accounts.return_value = [{'account_id': 'test'}]
435
+ mocked_user.return_value = mocked_fb_user
436
+
437
+ # Call main_impl function which initialize FacebookAdsApi with timeout
438
+ tap_facebook.main_impl()
439
+
440
+ # verify that FacebookAdsApi.init() called with timeout provided in config
441
+ mocked_facebook_api.assert_called_with(access_token='test', timeout=100)
442
+
443
+ def test_config_provided_float_request_timeout(self, mocked_user, mocked_facebook_api, mocked_args):
444
+ """
445
+ unit tests to ensure that request timeout is set based on config(float value)
446
+ """
447
+ tap_facebook.CONFIG = {}
448
+ # request_timeout provided in config with 100.5(float)
449
+ config = {'account_id': 'test', 'access_token': 'test', 'request_timeout': 100.5}
450
+ mocked_args.return_value = Args(config)
451
+
452
+ # Mock fb_user and get_add_accounts
453
+ mocked_fb_user = Mock()
454
+ mocked_fb_user.get_ad_accounts = Mock()
455
+ mocked_fb_user.get_ad_accounts.return_value = [{'account_id': 'test'}]
456
+ mocked_user.return_value = mocked_fb_user
457
+
458
+ # Call main_impl function which initialize FacebookAdsApi with timeout
459
+ tap_facebook.main_impl()
460
+
461
+ # verify that FacebookAdsApi.init() called with timeout provided in config
462
+ mocked_facebook_api.assert_called_with(access_token='test', timeout=100.5)
463
+
464
+ def test_config_provided_string_request_timeout(self, mocked_user, mocked_facebook_api, mocked_args):
465
+ """
466
+ unit tests to ensure that request timeout is set based on config(string value)
467
+ """
468
+ tap_facebook.CONFIG = {}
469
+ # request_timeout provided in config with 100(string)
470
+ config = {'account_id': 'test', 'access_token': 'test', 'request_timeout': '100'}
471
+ mocked_args.return_value = Args(config)
472
+
473
+ # Mock fb_user and get_add_accounts
474
+ mocked_fb_user = Mock()
475
+ mocked_fb_user.get_ad_accounts = Mock()
476
+ mocked_fb_user.get_ad_accounts.return_value = [{'account_id': 'test'}]
477
+ mocked_user.return_value = mocked_fb_user
478
+
479
+ # Call main_impl function which initialize FacebookAdsApi with timeout
480
+ tap_facebook.main_impl()
481
+
482
+ # verify that FacebookAdsApi.init() called with timeout provided in config
483
+ mocked_facebook_api.assert_called_with(access_token='test', timeout=100)
484
+
485
+ def test_config_provided_empty_request_timeout(self, mocked_user, mocked_facebook_api, mocked_args):
486
+ """
487
+ unit tests to ensure that request timeout is set based on default value as config file has empty string
488
+ """
489
+ tap_facebook.CONFIG = {}
490
+ # request_timeout provided in config with empty string
491
+ config = {'account_id': 'test', 'access_token': 'test', 'request_timeout': ''}
492
+ mocked_args.return_value = Args(config)
493
+
494
+ # Mock fb_user and get_add_accounts
495
+ mocked_fb_user = Mock()
496
+ mocked_fb_user.get_ad_accounts = Mock()
497
+ mocked_fb_user.get_ad_accounts.return_value = [{'account_id': 'test'}]
498
+ mocked_user.return_value = mocked_fb_user
499
+
500
+ # Call main_impl function which initialize FacebookAdsApi with timeout
501
+ tap_facebook.main_impl()
502
+
503
+ # verify that FacebookAdsApi.init() called with default timeout
504
+ mocked_facebook_api.assert_called_with(access_token='test', timeout=300)