airbyte-cdk 0.0.0.dev0__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 (368) hide show
  1. airbyte_cdk/__init__.py +358 -0
  2. airbyte_cdk/cli/__init__.py +1 -0
  3. airbyte_cdk/cli/source_declarative_manifest/__init__.py +5 -0
  4. airbyte_cdk/cli/source_declarative_manifest/_run.py +236 -0
  5. airbyte_cdk/cli/source_declarative_manifest/spec.json +17 -0
  6. airbyte_cdk/config_observation.py +104 -0
  7. airbyte_cdk/connector.py +123 -0
  8. airbyte_cdk/connector_builder/README.md +53 -0
  9. airbyte_cdk/connector_builder/__init__.py +3 -0
  10. airbyte_cdk/connector_builder/connector_builder_handler.py +121 -0
  11. airbyte_cdk/connector_builder/main.py +107 -0
  12. airbyte_cdk/connector_builder/models.py +73 -0
  13. airbyte_cdk/connector_builder/test_reader/__init__.py +7 -0
  14. airbyte_cdk/connector_builder/test_reader/helpers.py +689 -0
  15. airbyte_cdk/connector_builder/test_reader/message_grouper.py +173 -0
  16. airbyte_cdk/connector_builder/test_reader/reader.py +441 -0
  17. airbyte_cdk/connector_builder/test_reader/types.py +83 -0
  18. airbyte_cdk/destinations/__init__.py +8 -0
  19. airbyte_cdk/destinations/destination.py +154 -0
  20. airbyte_cdk/destinations/vector_db_based/README.md +37 -0
  21. airbyte_cdk/destinations/vector_db_based/__init__.py +38 -0
  22. airbyte_cdk/destinations/vector_db_based/config.py +298 -0
  23. airbyte_cdk/destinations/vector_db_based/document_processor.py +223 -0
  24. airbyte_cdk/destinations/vector_db_based/embedder.py +303 -0
  25. airbyte_cdk/destinations/vector_db_based/indexer.py +78 -0
  26. airbyte_cdk/destinations/vector_db_based/test_utils.py +63 -0
  27. airbyte_cdk/destinations/vector_db_based/utils.py +35 -0
  28. airbyte_cdk/destinations/vector_db_based/writer.py +104 -0
  29. airbyte_cdk/entrypoint.py +414 -0
  30. airbyte_cdk/exception_handler.py +56 -0
  31. airbyte_cdk/logger.py +109 -0
  32. airbyte_cdk/models/__init__.py +72 -0
  33. airbyte_cdk/models/airbyte_protocol.py +88 -0
  34. airbyte_cdk/models/airbyte_protocol_serializers.py +44 -0
  35. airbyte_cdk/models/well_known_types.py +5 -0
  36. airbyte_cdk/py.typed +0 -0
  37. airbyte_cdk/sources/__init__.py +26 -0
  38. airbyte_cdk/sources/abstract_source.py +326 -0
  39. airbyte_cdk/sources/concurrent_source/__init__.py +8 -0
  40. airbyte_cdk/sources/concurrent_source/concurrent_read_processor.py +255 -0
  41. airbyte_cdk/sources/concurrent_source/concurrent_source.py +165 -0
  42. airbyte_cdk/sources/concurrent_source/concurrent_source_adapter.py +147 -0
  43. airbyte_cdk/sources/concurrent_source/partition_generation_completed_sentinel.py +24 -0
  44. airbyte_cdk/sources/concurrent_source/stream_thread_exception.py +25 -0
  45. airbyte_cdk/sources/concurrent_source/thread_pool_manager.py +115 -0
  46. airbyte_cdk/sources/config.py +27 -0
  47. airbyte_cdk/sources/connector_state_manager.py +161 -0
  48. airbyte_cdk/sources/declarative/__init__.py +3 -0
  49. airbyte_cdk/sources/declarative/async_job/__init__.py +0 -0
  50. airbyte_cdk/sources/declarative/async_job/job.py +52 -0
  51. airbyte_cdk/sources/declarative/async_job/job_orchestrator.py +525 -0
  52. airbyte_cdk/sources/declarative/async_job/job_tracker.py +79 -0
  53. airbyte_cdk/sources/declarative/async_job/repository.py +35 -0
  54. airbyte_cdk/sources/declarative/async_job/status.py +24 -0
  55. airbyte_cdk/sources/declarative/async_job/timer.py +39 -0
  56. airbyte_cdk/sources/declarative/auth/__init__.py +8 -0
  57. airbyte_cdk/sources/declarative/auth/declarative_authenticator.py +42 -0
  58. airbyte_cdk/sources/declarative/auth/jwt.py +197 -0
  59. airbyte_cdk/sources/declarative/auth/oauth.py +293 -0
  60. airbyte_cdk/sources/declarative/auth/selective_authenticator.py +45 -0
  61. airbyte_cdk/sources/declarative/auth/token.py +267 -0
  62. airbyte_cdk/sources/declarative/auth/token_provider.py +82 -0
  63. airbyte_cdk/sources/declarative/checks/__init__.py +24 -0
  64. airbyte_cdk/sources/declarative/checks/check_dynamic_stream.py +61 -0
  65. airbyte_cdk/sources/declarative/checks/check_stream.py +56 -0
  66. airbyte_cdk/sources/declarative/checks/connection_checker.py +35 -0
  67. airbyte_cdk/sources/declarative/concurrency_level/__init__.py +7 -0
  68. airbyte_cdk/sources/declarative/concurrency_level/concurrency_level.py +50 -0
  69. airbyte_cdk/sources/declarative/concurrent_declarative_source.py +526 -0
  70. airbyte_cdk/sources/declarative/datetime/__init__.py +3 -0
  71. airbyte_cdk/sources/declarative/datetime/datetime_parser.py +65 -0
  72. airbyte_cdk/sources/declarative/datetime/min_max_datetime.py +118 -0
  73. airbyte_cdk/sources/declarative/declarative_component_schema.yaml +3975 -0
  74. airbyte_cdk/sources/declarative/declarative_source.py +36 -0
  75. airbyte_cdk/sources/declarative/declarative_stream.py +241 -0
  76. airbyte_cdk/sources/declarative/decoders/__init__.py +33 -0
  77. airbyte_cdk/sources/declarative/decoders/composite_raw_decoder.py +218 -0
  78. airbyte_cdk/sources/declarative/decoders/decoder.py +32 -0
  79. airbyte_cdk/sources/declarative/decoders/decoder_parser.py +30 -0
  80. airbyte_cdk/sources/declarative/decoders/json_decoder.py +65 -0
  81. airbyte_cdk/sources/declarative/decoders/noop_decoder.py +21 -0
  82. airbyte_cdk/sources/declarative/decoders/pagination_decoder_decorator.py +39 -0
  83. airbyte_cdk/sources/declarative/decoders/xml_decoder.py +98 -0
  84. airbyte_cdk/sources/declarative/decoders/zipfile_decoder.py +56 -0
  85. airbyte_cdk/sources/declarative/exceptions.py +9 -0
  86. airbyte_cdk/sources/declarative/extractors/__init__.py +21 -0
  87. airbyte_cdk/sources/declarative/extractors/dpath_extractor.py +86 -0
  88. airbyte_cdk/sources/declarative/extractors/http_selector.py +37 -0
  89. airbyte_cdk/sources/declarative/extractors/record_extractor.py +27 -0
  90. airbyte_cdk/sources/declarative/extractors/record_filter.py +91 -0
  91. airbyte_cdk/sources/declarative/extractors/record_selector.py +170 -0
  92. airbyte_cdk/sources/declarative/extractors/response_to_file_extractor.py +176 -0
  93. airbyte_cdk/sources/declarative/extractors/type_transformer.py +55 -0
  94. airbyte_cdk/sources/declarative/incremental/__init__.py +37 -0
  95. airbyte_cdk/sources/declarative/incremental/concurrent_partition_cursor.py +497 -0
  96. airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py +459 -0
  97. airbyte_cdk/sources/declarative/incremental/declarative_cursor.py +13 -0
  98. airbyte_cdk/sources/declarative/incremental/global_substream_cursor.py +357 -0
  99. airbyte_cdk/sources/declarative/incremental/per_partition_cursor.py +380 -0
  100. airbyte_cdk/sources/declarative/incremental/per_partition_with_global.py +200 -0
  101. airbyte_cdk/sources/declarative/incremental/resumable_full_refresh_cursor.py +122 -0
  102. airbyte_cdk/sources/declarative/interpolation/__init__.py +9 -0
  103. airbyte_cdk/sources/declarative/interpolation/filters.py +139 -0
  104. airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py +66 -0
  105. airbyte_cdk/sources/declarative/interpolation/interpolated_mapping.py +56 -0
  106. airbyte_cdk/sources/declarative/interpolation/interpolated_nested_mapping.py +52 -0
  107. airbyte_cdk/sources/declarative/interpolation/interpolated_string.py +79 -0
  108. airbyte_cdk/sources/declarative/interpolation/interpolation.py +34 -0
  109. airbyte_cdk/sources/declarative/interpolation/jinja.py +161 -0
  110. airbyte_cdk/sources/declarative/interpolation/macros.py +191 -0
  111. airbyte_cdk/sources/declarative/manifest_declarative_source.py +421 -0
  112. airbyte_cdk/sources/declarative/migrations/__init__.py +0 -0
  113. airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py +98 -0
  114. airbyte_cdk/sources/declarative/migrations/state_migration.py +24 -0
  115. airbyte_cdk/sources/declarative/models/__init__.py +2 -0
  116. airbyte_cdk/sources/declarative/models/declarative_component_schema.py +2503 -0
  117. airbyte_cdk/sources/declarative/parsers/__init__.py +3 -0
  118. airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py +157 -0
  119. airbyte_cdk/sources/declarative/parsers/custom_exceptions.py +21 -0
  120. airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py +172 -0
  121. airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py +213 -0
  122. airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py +3407 -0
  123. airbyte_cdk/sources/declarative/partition_routers/__init__.py +29 -0
  124. airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py +65 -0
  125. airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py +176 -0
  126. airbyte_cdk/sources/declarative/partition_routers/list_partition_router.py +121 -0
  127. airbyte_cdk/sources/declarative/partition_routers/partition_router.py +62 -0
  128. airbyte_cdk/sources/declarative/partition_routers/single_partition_router.py +63 -0
  129. airbyte_cdk/sources/declarative/partition_routers/substream_partition_router.py +437 -0
  130. airbyte_cdk/sources/declarative/requesters/README.md +56 -0
  131. airbyte_cdk/sources/declarative/requesters/__init__.py +9 -0
  132. airbyte_cdk/sources/declarative/requesters/error_handlers/__init__.py +25 -0
  133. airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/__init__.py +23 -0
  134. airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/constant_backoff_strategy.py +45 -0
  135. airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/exponential_backoff_strategy.py +45 -0
  136. airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/header_helper.py +41 -0
  137. airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/wait_time_from_header_backoff_strategy.py +70 -0
  138. airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/wait_until_time_from_header_backoff_strategy.py +77 -0
  139. airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategy.py +17 -0
  140. airbyte_cdk/sources/declarative/requesters/error_handlers/composite_error_handler.py +101 -0
  141. airbyte_cdk/sources/declarative/requesters/error_handlers/default_error_handler.py +147 -0
  142. airbyte_cdk/sources/declarative/requesters/error_handlers/default_http_response_filter.py +40 -0
  143. airbyte_cdk/sources/declarative/requesters/error_handlers/error_handler.py +17 -0
  144. airbyte_cdk/sources/declarative/requesters/error_handlers/http_response_filter.py +179 -0
  145. airbyte_cdk/sources/declarative/requesters/http_job_repository.py +350 -0
  146. airbyte_cdk/sources/declarative/requesters/http_requester.py +433 -0
  147. airbyte_cdk/sources/declarative/requesters/paginators/__init__.py +21 -0
  148. airbyte_cdk/sources/declarative/requesters/paginators/default_paginator.py +327 -0
  149. airbyte_cdk/sources/declarative/requesters/paginators/no_pagination.py +76 -0
  150. airbyte_cdk/sources/declarative/requesters/paginators/paginator.py +65 -0
  151. airbyte_cdk/sources/declarative/requesters/paginators/strategies/__init__.py +25 -0
  152. airbyte_cdk/sources/declarative/requesters/paginators/strategies/cursor_pagination_strategy.py +98 -0
  153. airbyte_cdk/sources/declarative/requesters/paginators/strategies/offset_increment.py +102 -0
  154. airbyte_cdk/sources/declarative/requesters/paginators/strategies/page_increment.py +71 -0
  155. airbyte_cdk/sources/declarative/requesters/paginators/strategies/pagination_strategy.py +48 -0
  156. airbyte_cdk/sources/declarative/requesters/paginators/strategies/stop_condition.py +66 -0
  157. airbyte_cdk/sources/declarative/requesters/request_option.py +117 -0
  158. airbyte_cdk/sources/declarative/requesters/request_options/__init__.py +23 -0
  159. airbyte_cdk/sources/declarative/requesters/request_options/datetime_based_request_options_provider.py +92 -0
  160. airbyte_cdk/sources/declarative/requesters/request_options/default_request_options_provider.py +60 -0
  161. airbyte_cdk/sources/declarative/requesters/request_options/interpolated_nested_request_input_provider.py +59 -0
  162. airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py +68 -0
  163. airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py +119 -0
  164. airbyte_cdk/sources/declarative/requesters/request_options/request_options_provider.py +79 -0
  165. airbyte_cdk/sources/declarative/requesters/request_path.py +15 -0
  166. airbyte_cdk/sources/declarative/requesters/requester.py +144 -0
  167. airbyte_cdk/sources/declarative/resolvers/__init__.py +41 -0
  168. airbyte_cdk/sources/declarative/resolvers/components_resolver.py +55 -0
  169. airbyte_cdk/sources/declarative/resolvers/config_components_resolver.py +136 -0
  170. airbyte_cdk/sources/declarative/resolvers/http_components_resolver.py +112 -0
  171. airbyte_cdk/sources/declarative/retrievers/__init__.py +19 -0
  172. airbyte_cdk/sources/declarative/retrievers/async_retriever.py +124 -0
  173. airbyte_cdk/sources/declarative/retrievers/file_uploader.py +89 -0
  174. airbyte_cdk/sources/declarative/retrievers/retriever.py +54 -0
  175. airbyte_cdk/sources/declarative/retrievers/simple_retriever.py +702 -0
  176. airbyte_cdk/sources/declarative/schema/__init__.py +25 -0
  177. airbyte_cdk/sources/declarative/schema/default_schema_loader.py +47 -0
  178. airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py +285 -0
  179. airbyte_cdk/sources/declarative/schema/inline_schema_loader.py +19 -0
  180. airbyte_cdk/sources/declarative/schema/json_file_schema_loader.py +92 -0
  181. airbyte_cdk/sources/declarative/schema/schema_loader.py +17 -0
  182. airbyte_cdk/sources/declarative/spec/__init__.py +7 -0
  183. airbyte_cdk/sources/declarative/spec/spec.py +48 -0
  184. airbyte_cdk/sources/declarative/stream_slicers/__init__.py +7 -0
  185. airbyte_cdk/sources/declarative/stream_slicers/declarative_partition_generator.py +93 -0
  186. airbyte_cdk/sources/declarative/stream_slicers/stream_slicer.py +25 -0
  187. airbyte_cdk/sources/declarative/transformations/__init__.py +17 -0
  188. airbyte_cdk/sources/declarative/transformations/add_fields.py +146 -0
  189. airbyte_cdk/sources/declarative/transformations/dpath_flatten_fields.py +61 -0
  190. airbyte_cdk/sources/declarative/transformations/flatten_fields.py +52 -0
  191. airbyte_cdk/sources/declarative/transformations/keys_replace_transformation.py +61 -0
  192. airbyte_cdk/sources/declarative/transformations/keys_to_lower_transformation.py +22 -0
  193. airbyte_cdk/sources/declarative/transformations/keys_to_snake_transformation.py +68 -0
  194. airbyte_cdk/sources/declarative/transformations/remove_fields.py +75 -0
  195. airbyte_cdk/sources/declarative/transformations/transformation.py +37 -0
  196. airbyte_cdk/sources/declarative/types.py +25 -0
  197. airbyte_cdk/sources/declarative/yaml_declarative_source.py +67 -0
  198. airbyte_cdk/sources/file_based/README.md +152 -0
  199. airbyte_cdk/sources/file_based/__init__.py +24 -0
  200. airbyte_cdk/sources/file_based/availability_strategy/__init__.py +11 -0
  201. airbyte_cdk/sources/file_based/availability_strategy/abstract_file_based_availability_strategy.py +73 -0
  202. airbyte_cdk/sources/file_based/availability_strategy/default_file_based_availability_strategy.py +149 -0
  203. airbyte_cdk/sources/file_based/config/__init__.py +0 -0
  204. airbyte_cdk/sources/file_based/config/abstract_file_based_spec.py +153 -0
  205. airbyte_cdk/sources/file_based/config/avro_format.py +25 -0
  206. airbyte_cdk/sources/file_based/config/csv_format.py +210 -0
  207. airbyte_cdk/sources/file_based/config/excel_format.py +18 -0
  208. airbyte_cdk/sources/file_based/config/file_based_stream_config.py +99 -0
  209. airbyte_cdk/sources/file_based/config/jsonl_format.py +18 -0
  210. airbyte_cdk/sources/file_based/config/parquet_format.py +25 -0
  211. airbyte_cdk/sources/file_based/config/unstructured_format.py +102 -0
  212. airbyte_cdk/sources/file_based/config/validate_config_transfer_modes.py +81 -0
  213. airbyte_cdk/sources/file_based/discovery_policy/__init__.py +8 -0
  214. airbyte_cdk/sources/file_based/discovery_policy/abstract_discovery_policy.py +21 -0
  215. airbyte_cdk/sources/file_based/discovery_policy/default_discovery_policy.py +33 -0
  216. airbyte_cdk/sources/file_based/exceptions.py +159 -0
  217. airbyte_cdk/sources/file_based/file_based_source.py +466 -0
  218. airbyte_cdk/sources/file_based/file_based_stream_permissions_reader.py +123 -0
  219. airbyte_cdk/sources/file_based/file_based_stream_reader.py +209 -0
  220. airbyte_cdk/sources/file_based/file_record_data.py +22 -0
  221. airbyte_cdk/sources/file_based/file_types/__init__.py +37 -0
  222. airbyte_cdk/sources/file_based/file_types/avro_parser.py +233 -0
  223. airbyte_cdk/sources/file_based/file_types/csv_parser.py +527 -0
  224. airbyte_cdk/sources/file_based/file_types/excel_parser.py +196 -0
  225. airbyte_cdk/sources/file_based/file_types/file_transfer.py +30 -0
  226. airbyte_cdk/sources/file_based/file_types/file_type_parser.py +86 -0
  227. airbyte_cdk/sources/file_based/file_types/jsonl_parser.py +145 -0
  228. airbyte_cdk/sources/file_based/file_types/parquet_parser.py +275 -0
  229. airbyte_cdk/sources/file_based/file_types/unstructured_parser.py +480 -0
  230. airbyte_cdk/sources/file_based/remote_file.py +18 -0
  231. airbyte_cdk/sources/file_based/schema_helpers.py +281 -0
  232. airbyte_cdk/sources/file_based/schema_validation_policies/__init__.py +17 -0
  233. airbyte_cdk/sources/file_based/schema_validation_policies/abstract_schema_validation_policy.py +20 -0
  234. airbyte_cdk/sources/file_based/schema_validation_policies/default_schema_validation_policies.py +52 -0
  235. airbyte_cdk/sources/file_based/stream/__init__.py +13 -0
  236. airbyte_cdk/sources/file_based/stream/abstract_file_based_stream.py +197 -0
  237. airbyte_cdk/sources/file_based/stream/concurrent/__init__.py +0 -0
  238. airbyte_cdk/sources/file_based/stream/concurrent/adapters.py +343 -0
  239. airbyte_cdk/sources/file_based/stream/concurrent/cursor/__init__.py +9 -0
  240. airbyte_cdk/sources/file_based/stream/concurrent/cursor/abstract_concurrent_file_based_cursor.py +59 -0
  241. airbyte_cdk/sources/file_based/stream/concurrent/cursor/file_based_concurrent_cursor.py +313 -0
  242. airbyte_cdk/sources/file_based/stream/concurrent/cursor/file_based_final_state_cursor.py +83 -0
  243. airbyte_cdk/sources/file_based/stream/cursor/__init__.py +4 -0
  244. airbyte_cdk/sources/file_based/stream/cursor/abstract_file_based_cursor.py +66 -0
  245. airbyte_cdk/sources/file_based/stream/cursor/default_file_based_cursor.py +149 -0
  246. airbyte_cdk/sources/file_based/stream/default_file_based_stream.py +396 -0
  247. airbyte_cdk/sources/file_based/stream/identities_stream.py +49 -0
  248. airbyte_cdk/sources/file_based/stream/permissions_file_based_stream.py +92 -0
  249. airbyte_cdk/sources/file_based/types.py +10 -0
  250. airbyte_cdk/sources/http_config.py +10 -0
  251. airbyte_cdk/sources/http_logger.py +55 -0
  252. airbyte_cdk/sources/message/__init__.py +19 -0
  253. airbyte_cdk/sources/message/repository.py +137 -0
  254. airbyte_cdk/sources/source.py +95 -0
  255. airbyte_cdk/sources/specs/transfer_modes.py +26 -0
  256. airbyte_cdk/sources/streams/__init__.py +8 -0
  257. airbyte_cdk/sources/streams/availability_strategy.py +84 -0
  258. airbyte_cdk/sources/streams/call_rate.py +704 -0
  259. airbyte_cdk/sources/streams/checkpoint/__init__.py +26 -0
  260. airbyte_cdk/sources/streams/checkpoint/checkpoint_reader.py +335 -0
  261. airbyte_cdk/sources/streams/checkpoint/cursor.py +77 -0
  262. airbyte_cdk/sources/streams/checkpoint/per_partition_key_serializer.py +22 -0
  263. airbyte_cdk/sources/streams/checkpoint/resumable_full_refresh_cursor.py +51 -0
  264. airbyte_cdk/sources/streams/checkpoint/substream_resumable_full_refresh_cursor.py +110 -0
  265. airbyte_cdk/sources/streams/concurrent/README.md +7 -0
  266. airbyte_cdk/sources/streams/concurrent/__init__.py +3 -0
  267. airbyte_cdk/sources/streams/concurrent/abstract_stream.py +96 -0
  268. airbyte_cdk/sources/streams/concurrent/abstract_stream_facade.py +37 -0
  269. airbyte_cdk/sources/streams/concurrent/adapters.py +397 -0
  270. airbyte_cdk/sources/streams/concurrent/availability_strategy.py +94 -0
  271. airbyte_cdk/sources/streams/concurrent/clamping.py +99 -0
  272. airbyte_cdk/sources/streams/concurrent/cursor.py +481 -0
  273. airbyte_cdk/sources/streams/concurrent/cursor_types.py +32 -0
  274. airbyte_cdk/sources/streams/concurrent/default_stream.py +102 -0
  275. airbyte_cdk/sources/streams/concurrent/exceptions.py +18 -0
  276. airbyte_cdk/sources/streams/concurrent/helpers.py +42 -0
  277. airbyte_cdk/sources/streams/concurrent/partition_enqueuer.py +64 -0
  278. airbyte_cdk/sources/streams/concurrent/partition_reader.py +45 -0
  279. airbyte_cdk/sources/streams/concurrent/partitions/__init__.py +3 -0
  280. airbyte_cdk/sources/streams/concurrent/partitions/partition.py +48 -0
  281. airbyte_cdk/sources/streams/concurrent/partitions/partition_generator.py +18 -0
  282. airbyte_cdk/sources/streams/concurrent/partitions/stream_slicer.py +21 -0
  283. airbyte_cdk/sources/streams/concurrent/partitions/types.py +38 -0
  284. airbyte_cdk/sources/streams/concurrent/state_converters/__init__.py +0 -0
  285. airbyte_cdk/sources/streams/concurrent/state_converters/abstract_stream_state_converter.py +182 -0
  286. airbyte_cdk/sources/streams/concurrent/state_converters/datetime_stream_state_converter.py +223 -0
  287. airbyte_cdk/sources/streams/concurrent/state_converters/incrementing_count_stream_state_converter.py +92 -0
  288. airbyte_cdk/sources/streams/core.py +703 -0
  289. airbyte_cdk/sources/streams/http/__init__.py +10 -0
  290. airbyte_cdk/sources/streams/http/availability_strategy.py +54 -0
  291. airbyte_cdk/sources/streams/http/error_handlers/__init__.py +22 -0
  292. airbyte_cdk/sources/streams/http/error_handlers/backoff_strategy.py +28 -0
  293. airbyte_cdk/sources/streams/http/error_handlers/default_backoff_strategy.py +17 -0
  294. airbyte_cdk/sources/streams/http/error_handlers/default_error_mapping.py +86 -0
  295. airbyte_cdk/sources/streams/http/error_handlers/error_handler.py +42 -0
  296. airbyte_cdk/sources/streams/http/error_handlers/error_message_parser.py +19 -0
  297. airbyte_cdk/sources/streams/http/error_handlers/http_status_error_handler.py +110 -0
  298. airbyte_cdk/sources/streams/http/error_handlers/json_error_message_parser.py +52 -0
  299. airbyte_cdk/sources/streams/http/error_handlers/response_models.py +65 -0
  300. airbyte_cdk/sources/streams/http/exceptions.py +61 -0
  301. airbyte_cdk/sources/streams/http/http.py +673 -0
  302. airbyte_cdk/sources/streams/http/http_client.py +531 -0
  303. airbyte_cdk/sources/streams/http/rate_limiting.py +158 -0
  304. airbyte_cdk/sources/streams/http/requests_native_auth/__init__.py +14 -0
  305. airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py +479 -0
  306. airbyte_cdk/sources/streams/http/requests_native_auth/abstract_token.py +34 -0
  307. airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py +436 -0
  308. airbyte_cdk/sources/streams/http/requests_native_auth/token.py +83 -0
  309. airbyte_cdk/sources/streams/permissions/identities_stream.py +75 -0
  310. airbyte_cdk/sources/streams/utils/__init__.py +3 -0
  311. airbyte_cdk/sources/types.py +169 -0
  312. airbyte_cdk/sources/utils/__init__.py +7 -0
  313. airbyte_cdk/sources/utils/casing.py +12 -0
  314. airbyte_cdk/sources/utils/files_directory.py +15 -0
  315. airbyte_cdk/sources/utils/record_helper.py +53 -0
  316. airbyte_cdk/sources/utils/schema_helpers.py +230 -0
  317. airbyte_cdk/sources/utils/slice_logger.py +57 -0
  318. airbyte_cdk/sources/utils/transform.py +277 -0
  319. airbyte_cdk/sources/utils/types.py +7 -0
  320. airbyte_cdk/sql/__init__.py +0 -0
  321. airbyte_cdk/sql/_util/__init__.py +0 -0
  322. airbyte_cdk/sql/_util/hashing.py +34 -0
  323. airbyte_cdk/sql/_util/name_normalizers.py +92 -0
  324. airbyte_cdk/sql/constants.py +32 -0
  325. airbyte_cdk/sql/exceptions.py +235 -0
  326. airbyte_cdk/sql/secrets.py +123 -0
  327. airbyte_cdk/sql/shared/__init__.py +15 -0
  328. airbyte_cdk/sql/shared/catalog_providers.py +145 -0
  329. airbyte_cdk/sql/shared/sql_processor.py +786 -0
  330. airbyte_cdk/sql/types.py +160 -0
  331. airbyte_cdk/test/__init__.py +7 -0
  332. airbyte_cdk/test/catalog_builder.py +81 -0
  333. airbyte_cdk/test/entrypoint_wrapper.py +250 -0
  334. airbyte_cdk/test/mock_http/__init__.py +6 -0
  335. airbyte_cdk/test/mock_http/matcher.py +41 -0
  336. airbyte_cdk/test/mock_http/mocker.py +185 -0
  337. airbyte_cdk/test/mock_http/request.py +103 -0
  338. airbyte_cdk/test/mock_http/response.py +28 -0
  339. airbyte_cdk/test/mock_http/response_builder.py +237 -0
  340. airbyte_cdk/test/state_builder.py +33 -0
  341. airbyte_cdk/test/utils/__init__.py +1 -0
  342. airbyte_cdk/test/utils/data.py +24 -0
  343. airbyte_cdk/test/utils/http_mocking.py +16 -0
  344. airbyte_cdk/test/utils/manifest_only_fixtures.py +59 -0
  345. airbyte_cdk/test/utils/reading.py +26 -0
  346. airbyte_cdk/utils/__init__.py +10 -0
  347. airbyte_cdk/utils/airbyte_secrets_utils.py +80 -0
  348. airbyte_cdk/utils/analytics_message.py +25 -0
  349. airbyte_cdk/utils/constants.py +5 -0
  350. airbyte_cdk/utils/datetime_format_inferrer.py +94 -0
  351. airbyte_cdk/utils/datetime_helpers.py +499 -0
  352. airbyte_cdk/utils/event_timing.py +85 -0
  353. airbyte_cdk/utils/is_cloud_environment.py +18 -0
  354. airbyte_cdk/utils/mapping_helpers.py +162 -0
  355. airbyte_cdk/utils/message_utils.py +26 -0
  356. airbyte_cdk/utils/oneof_option_config.py +33 -0
  357. airbyte_cdk/utils/print_buffer.py +75 -0
  358. airbyte_cdk/utils/schema_inferrer.py +270 -0
  359. airbyte_cdk/utils/slice_hasher.py +37 -0
  360. airbyte_cdk/utils/spec_schema_transformations.py +26 -0
  361. airbyte_cdk/utils/stream_status_utils.py +43 -0
  362. airbyte_cdk/utils/traced_exception.py +145 -0
  363. airbyte_cdk-0.0.0.dev0.dist-info/LICENSE.txt +19 -0
  364. airbyte_cdk-0.0.0.dev0.dist-info/LICENSE_SHORT +1 -0
  365. airbyte_cdk-0.0.0.dev0.dist-info/METADATA +111 -0
  366. airbyte_cdk-0.0.0.dev0.dist-info/RECORD +368 -0
  367. airbyte_cdk-0.0.0.dev0.dist-info/WHEEL +4 -0
  368. airbyte_cdk-0.0.0.dev0.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,2503 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: declarative_component_schema.yaml
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+ from typing import Any, Dict, List, Literal, Optional, Union
8
+
9
+ from pydantic.v1 import BaseModel, Extra, Field
10
+
11
+
12
+ class AuthFlowType(Enum):
13
+ oauth2_0 = "oauth2.0"
14
+ oauth1_0 = "oauth1.0"
15
+
16
+
17
+ class BasicHttpAuthenticator(BaseModel):
18
+ type: Literal["BasicHttpAuthenticator"]
19
+ username: str = Field(
20
+ ...,
21
+ description="The username that will be combined with the password, base64 encoded and used to make requests. Fill it in the user inputs.",
22
+ examples=["{{ config['username'] }}", "{{ config['api_key'] }}"],
23
+ title="Username",
24
+ )
25
+ password: Optional[str] = Field(
26
+ "",
27
+ description="The password that will be combined with the username, base64 encoded and used to make requests. Fill it in the user inputs.",
28
+ examples=["{{ config['password'] }}", ""],
29
+ title="Password",
30
+ )
31
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
32
+
33
+
34
+ class BearerAuthenticator(BaseModel):
35
+ type: Literal["BearerAuthenticator"]
36
+ api_token: str = Field(
37
+ ...,
38
+ description="Token to inject as request header for authenticating with the API.",
39
+ examples=["{{ config['api_key'] }}", "{{ config['token'] }}"],
40
+ title="Bearer Token",
41
+ )
42
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
43
+
44
+
45
+ class CheckStream(BaseModel):
46
+ type: Literal["CheckStream"]
47
+ stream_names: List[str] = Field(
48
+ ...,
49
+ description="Names of the streams to try reading from when running a check operation.",
50
+ examples=[["users"], ["users", "contacts"]],
51
+ title="Stream Names",
52
+ )
53
+
54
+
55
+ class CheckDynamicStream(BaseModel):
56
+ type: Literal["CheckDynamicStream"]
57
+ stream_count: int = Field(
58
+ ...,
59
+ description="Numbers of the streams to try reading from when running a check operation.",
60
+ title="Stream Count",
61
+ )
62
+ use_check_availability: Optional[bool] = Field(
63
+ True,
64
+ description="Enables stream check availability. This field is automatically set by the CDK.",
65
+ title="Use Check Availability",
66
+ )
67
+
68
+
69
+ class ConcurrencyLevel(BaseModel):
70
+ type: Optional[Literal["ConcurrencyLevel"]] = None
71
+ default_concurrency: Union[int, str] = Field(
72
+ ...,
73
+ description="The amount of concurrency that will applied during a sync. This value can be hardcoded or user-defined in the config if different users have varying volume thresholds in the target API.",
74
+ examples=[10, "{{ config['num_workers'] or 10 }}"],
75
+ title="Default Concurrency",
76
+ )
77
+ max_concurrency: Optional[int] = Field(
78
+ None,
79
+ description="The maximum level of concurrency that will be used during a sync. This becomes a required field when the default_concurrency derives from the config, because it serves as a safeguard against a user-defined threshold that is too high.",
80
+ examples=[20, 100],
81
+ title="Max Concurrency",
82
+ )
83
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
84
+
85
+
86
+ class ConstantBackoffStrategy(BaseModel):
87
+ type: Literal["ConstantBackoffStrategy"]
88
+ backoff_time_in_seconds: Union[float, str] = Field(
89
+ ...,
90
+ description="Backoff time in seconds.",
91
+ examples=[30, 30.5, "{{ config['backoff_time'] }}"],
92
+ title="Backoff Time",
93
+ )
94
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
95
+
96
+
97
+ class CursorPagination(BaseModel):
98
+ type: Literal["CursorPagination"]
99
+ cursor_value: str = Field(
100
+ ...,
101
+ description="Value of the cursor defining the next page to fetch.",
102
+ examples=[
103
+ "{{ headers.link.next.cursor }}",
104
+ "{{ last_record['key'] }}",
105
+ "{{ response['nextPage'] }}",
106
+ ],
107
+ title="Cursor Value",
108
+ )
109
+ page_size: Optional[int] = Field(
110
+ None,
111
+ description="The number of records to include in each pages.",
112
+ examples=[100],
113
+ title="Page Size",
114
+ )
115
+ stop_condition: Optional[str] = Field(
116
+ None,
117
+ description="Template string evaluating when to stop paginating.",
118
+ examples=[
119
+ "{{ response.data.has_more is false }}",
120
+ "{{ 'next' not in headers['link'] }}",
121
+ ],
122
+ title="Stop Condition",
123
+ )
124
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
125
+
126
+
127
+ class CustomAuthenticator(BaseModel):
128
+ class Config:
129
+ extra = Extra.allow
130
+
131
+ type: Literal["CustomAuthenticator"]
132
+ class_name: str = Field(
133
+ ...,
134
+ description="Fully-qualified name of the class that will be implementing the custom authentication strategy. Has to be a sub class of DeclarativeAuthenticator. The format is `source_<name>.<package>.<class_name>`.",
135
+ examples=["source_railz.components.ShortLivedTokenAuthenticator"],
136
+ title="Class Name",
137
+ )
138
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
139
+
140
+
141
+ class CustomBackoffStrategy(BaseModel):
142
+ class Config:
143
+ extra = Extra.allow
144
+
145
+ type: Literal["CustomBackoffStrategy"]
146
+ class_name: str = Field(
147
+ ...,
148
+ description="Fully-qualified name of the class that will be implementing the custom backoff strategy. The format is `source_<name>.<package>.<class_name>`.",
149
+ examples=["source_railz.components.MyCustomBackoffStrategy"],
150
+ title="Class Name",
151
+ )
152
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
153
+
154
+
155
+ class CustomErrorHandler(BaseModel):
156
+ class Config:
157
+ extra = Extra.allow
158
+
159
+ type: Literal["CustomErrorHandler"]
160
+ class_name: str = Field(
161
+ ...,
162
+ description="Fully-qualified name of the class that will be implementing the custom error handler. The format is `source_<name>.<package>.<class_name>`.",
163
+ examples=["source_railz.components.MyCustomErrorHandler"],
164
+ title="Class Name",
165
+ )
166
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
167
+
168
+
169
+ class CustomIncrementalSync(BaseModel):
170
+ class Config:
171
+ extra = Extra.allow
172
+
173
+ type: Literal["CustomIncrementalSync"]
174
+ class_name: str = Field(
175
+ ...,
176
+ description="Fully-qualified name of the class that will be implementing the custom incremental sync. The format is `source_<name>.<package>.<class_name>`.",
177
+ examples=["source_railz.components.MyCustomIncrementalSync"],
178
+ title="Class Name",
179
+ )
180
+ cursor_field: str = Field(
181
+ ...,
182
+ description="The location of the value on a record that will be used as a bookmark during sync.",
183
+ )
184
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
185
+
186
+
187
+ class CustomPaginationStrategy(BaseModel):
188
+ class Config:
189
+ extra = Extra.allow
190
+
191
+ type: Literal["CustomPaginationStrategy"]
192
+ class_name: str = Field(
193
+ ...,
194
+ description="Fully-qualified name of the class that will be implementing the custom pagination strategy. The format is `source_<name>.<package>.<class_name>`.",
195
+ examples=["source_railz.components.MyCustomPaginationStrategy"],
196
+ title="Class Name",
197
+ )
198
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
199
+
200
+
201
+ class CustomRecordExtractor(BaseModel):
202
+ class Config:
203
+ extra = Extra.allow
204
+
205
+ type: Literal["CustomRecordExtractor"]
206
+ class_name: str = Field(
207
+ ...,
208
+ description="Fully-qualified name of the class that will be implementing the custom record extraction strategy. The format is `source_<name>.<package>.<class_name>`.",
209
+ examples=["source_railz.components.MyCustomRecordExtractor"],
210
+ title="Class Name",
211
+ )
212
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
213
+
214
+
215
+ class CustomRecordFilter(BaseModel):
216
+ class Config:
217
+ extra = Extra.allow
218
+
219
+ type: Literal["CustomRecordFilter"]
220
+ class_name: str = Field(
221
+ ...,
222
+ description="Fully-qualified name of the class that will be implementing the custom record filter strategy. The format is `source_<name>.<package>.<class_name>`.",
223
+ examples=["source_railz.components.MyCustomCustomRecordFilter"],
224
+ title="Class Name",
225
+ )
226
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
227
+
228
+
229
+ class CustomRequester(BaseModel):
230
+ class Config:
231
+ extra = Extra.allow
232
+
233
+ type: Literal["CustomRequester"]
234
+ class_name: str = Field(
235
+ ...,
236
+ description="Fully-qualified name of the class that will be implementing the custom requester strategy. The format is `source_<name>.<package>.<class_name>`.",
237
+ examples=["source_railz.components.MyCustomRecordExtractor"],
238
+ title="Class Name",
239
+ )
240
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
241
+
242
+
243
+ class CustomRetriever(BaseModel):
244
+ class Config:
245
+ extra = Extra.allow
246
+
247
+ type: Literal["CustomRetriever"]
248
+ class_name: str = Field(
249
+ ...,
250
+ description="Fully-qualified name of the class that will be implementing the custom retriever strategy. The format is `source_<name>.<package>.<class_name>`.",
251
+ examples=["source_railz.components.MyCustomRetriever"],
252
+ title="Class Name",
253
+ )
254
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
255
+
256
+
257
+ class CustomPartitionRouter(BaseModel):
258
+ class Config:
259
+ extra = Extra.allow
260
+
261
+ type: Literal["CustomPartitionRouter"]
262
+ class_name: str = Field(
263
+ ...,
264
+ description="Fully-qualified name of the class that will be implementing the custom partition router. The format is `source_<name>.<package>.<class_name>`.",
265
+ examples=["source_railz.components.MyCustomPartitionRouter"],
266
+ title="Class Name",
267
+ )
268
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
269
+
270
+
271
+ class CustomSchemaLoader(BaseModel):
272
+ class Config:
273
+ extra = Extra.allow
274
+
275
+ type: Literal["CustomSchemaLoader"]
276
+ class_name: str = Field(
277
+ ...,
278
+ description="Fully-qualified name of the class that will be implementing the custom schema loader. The format is `source_<name>.<package>.<class_name>`.",
279
+ examples=["source_railz.components.MyCustomSchemaLoader"],
280
+ title="Class Name",
281
+ )
282
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
283
+
284
+
285
+ class CustomSchemaNormalization(BaseModel):
286
+ class Config:
287
+ extra = Extra.allow
288
+
289
+ type: Literal["CustomSchemaNormalization"]
290
+ class_name: str = Field(
291
+ ...,
292
+ description="Fully-qualified name of the class that will be implementing the custom normalization. The format is `source_<name>.<package>.<class_name>`.",
293
+ examples=[
294
+ "source_amazon_seller_partner.components.LedgerDetailedViewReportsTypeTransformer"
295
+ ],
296
+ title="Class Name",
297
+ )
298
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
299
+
300
+
301
+ class CustomStateMigration(BaseModel):
302
+ class Config:
303
+ extra = Extra.allow
304
+
305
+ type: Literal["CustomStateMigration"]
306
+ class_name: str = Field(
307
+ ...,
308
+ description="Fully-qualified name of the class that will be implementing the custom state migration. The format is `source_<name>.<package>.<class_name>`.",
309
+ examples=["source_railz.components.MyCustomStateMigration"],
310
+ title="Class Name",
311
+ )
312
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
313
+
314
+
315
+ class CustomTransformation(BaseModel):
316
+ class Config:
317
+ extra = Extra.allow
318
+
319
+ type: Literal["CustomTransformation"]
320
+ class_name: str = Field(
321
+ ...,
322
+ description="Fully-qualified name of the class that will be implementing the custom transformation. The format is `source_<name>.<package>.<class_name>`.",
323
+ examples=["source_railz.components.MyCustomTransformation"],
324
+ title="Class Name",
325
+ )
326
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
327
+
328
+
329
+ class LegacyToPerPartitionStateMigration(BaseModel):
330
+ class Config:
331
+ extra = Extra.allow
332
+
333
+ type: Optional[Literal["LegacyToPerPartitionStateMigration"]] = None
334
+
335
+
336
+ class Clamping(BaseModel):
337
+ target: str = Field(
338
+ ...,
339
+ description="The period of time that datetime windows will be clamped by",
340
+ examples=["DAY", "WEEK", "MONTH", "{{ config['target'] }}"],
341
+ title="Target",
342
+ )
343
+ target_details: Optional[Dict[str, Any]] = None
344
+
345
+
346
+ class Algorithm(Enum):
347
+ HS256 = "HS256"
348
+ HS384 = "HS384"
349
+ HS512 = "HS512"
350
+ ES256 = "ES256"
351
+ ES256K = "ES256K"
352
+ ES384 = "ES384"
353
+ ES512 = "ES512"
354
+ RS256 = "RS256"
355
+ RS384 = "RS384"
356
+ RS512 = "RS512"
357
+ PS256 = "PS256"
358
+ PS384 = "PS384"
359
+ PS512 = "PS512"
360
+ EdDSA = "EdDSA"
361
+
362
+
363
+ class JwtHeaders(BaseModel):
364
+ class Config:
365
+ extra = Extra.forbid
366
+
367
+ kid: Optional[str] = Field(
368
+ None,
369
+ description="Private key ID for user account.",
370
+ examples=["{{ config['kid'] }}"],
371
+ title="Key Identifier",
372
+ )
373
+ typ: Optional[str] = Field(
374
+ "JWT",
375
+ description="The media type of the complete JWT.",
376
+ examples=["JWT"],
377
+ title="Type",
378
+ )
379
+ cty: Optional[str] = Field(
380
+ None,
381
+ description="Content type of JWT header.",
382
+ examples=["JWT"],
383
+ title="Content Type",
384
+ )
385
+
386
+
387
+ class JwtPayload(BaseModel):
388
+ class Config:
389
+ extra = Extra.forbid
390
+
391
+ iss: Optional[str] = Field(
392
+ None,
393
+ description="The user/principal that issued the JWT. Commonly a value unique to the user.",
394
+ examples=["{{ config['iss'] }}"],
395
+ title="Issuer",
396
+ )
397
+ sub: Optional[str] = Field(
398
+ None,
399
+ description="The subject of the JWT. Commonly defined by the API.",
400
+ title="Subject",
401
+ )
402
+ aud: Optional[str] = Field(
403
+ None,
404
+ description="The recipient that the JWT is intended for. Commonly defined by the API.",
405
+ examples=["appstoreconnect-v1"],
406
+ title="Audience",
407
+ )
408
+
409
+
410
+ class JwtAuthenticator(BaseModel):
411
+ type: Literal["JwtAuthenticator"]
412
+ secret_key: str = Field(
413
+ ...,
414
+ description="Secret used to sign the JSON web token.",
415
+ examples=["{{ config['secret_key'] }}"],
416
+ )
417
+ base64_encode_secret_key: Optional[bool] = Field(
418
+ False,
419
+ description='When set to true, the secret key will be base64 encoded prior to being encoded as part of the JWT. Only set to "true" when required by the API.',
420
+ )
421
+ algorithm: Algorithm = Field(
422
+ ...,
423
+ description="Algorithm used to sign the JSON web token.",
424
+ examples=["ES256", "HS256", "RS256", "{{ config['algorithm'] }}"],
425
+ )
426
+ token_duration: Optional[int] = Field(
427
+ 1200,
428
+ description="The amount of time in seconds a JWT token can be valid after being issued.",
429
+ examples=[1200, 3600],
430
+ title="Token Duration",
431
+ )
432
+ header_prefix: Optional[str] = Field(
433
+ None,
434
+ description="The prefix to be used within the Authentication header.",
435
+ examples=["Bearer", "Basic"],
436
+ title="Header Prefix",
437
+ )
438
+ jwt_headers: Optional[JwtHeaders] = Field(
439
+ None,
440
+ description="JWT headers used when signing JSON web token.",
441
+ title="JWT Headers",
442
+ )
443
+ additional_jwt_headers: Optional[Dict[str, Any]] = Field(
444
+ None,
445
+ description="Additional headers to be included with the JWT headers object.",
446
+ title="Additional JWT Headers",
447
+ )
448
+ jwt_payload: Optional[JwtPayload] = Field(
449
+ None,
450
+ description="JWT Payload used when signing JSON web token.",
451
+ title="JWT Payload",
452
+ )
453
+ additional_jwt_payload: Optional[Dict[str, Any]] = Field(
454
+ None,
455
+ description="Additional properties to be added to the JWT payload.",
456
+ title="Additional JWT Payload Properties",
457
+ )
458
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
459
+
460
+
461
+ class RefreshTokenUpdater(BaseModel):
462
+ refresh_token_name: Optional[str] = Field(
463
+ "refresh_token",
464
+ description="The name of the property which contains the updated refresh token in the response from the token refresh endpoint.",
465
+ examples=["refresh_token"],
466
+ title="Refresh Token Property Name",
467
+ )
468
+ access_token_config_path: Optional[List[str]] = Field(
469
+ ["credentials", "access_token"],
470
+ description="Config path to the access token. Make sure the field actually exists in the config.",
471
+ examples=[["credentials", "access_token"], ["access_token"]],
472
+ title="Config Path To Access Token",
473
+ )
474
+ refresh_token_config_path: Optional[List[str]] = Field(
475
+ ["credentials", "refresh_token"],
476
+ description="Config path to the access token. Make sure the field actually exists in the config.",
477
+ examples=[["credentials", "refresh_token"], ["refresh_token"]],
478
+ title="Config Path To Refresh Token",
479
+ )
480
+ token_expiry_date_config_path: Optional[List[str]] = Field(
481
+ ["credentials", "token_expiry_date"],
482
+ description="Config path to the expiry date. Make sure actually exists in the config.",
483
+ examples=[["credentials", "token_expiry_date"]],
484
+ title="Config Path To Expiry Date",
485
+ )
486
+ refresh_token_error_status_codes: Optional[List[int]] = Field(
487
+ [],
488
+ description="Status Codes to Identify refresh token error in response (Refresh Token Error Key and Refresh Token Error Values should be also specified). Responses with one of the error status code and containing an error value will be flagged as a config error",
489
+ examples=[[400, 500]],
490
+ title="Refresh Token Error Status Codes",
491
+ )
492
+ refresh_token_error_key: Optional[str] = Field(
493
+ "",
494
+ description="Key to Identify refresh token error in response (Refresh Token Error Status Codes and Refresh Token Error Values should be also specified).",
495
+ examples=["error"],
496
+ title="Refresh Token Error Key",
497
+ )
498
+ refresh_token_error_values: Optional[List[str]] = Field(
499
+ [],
500
+ description='List of values to check for exception during token refresh process. Used to check if the error found in the response matches the key from the Refresh Token Error Key field (e.g. response={"error": "invalid_grant"}). Only responses with one of the error status code and containing an error value will be flagged as a config error',
501
+ examples=[["invalid_grant", "invalid_permissions"]],
502
+ title="Refresh Token Error Values",
503
+ )
504
+
505
+
506
+ class OAuthAuthenticator(BaseModel):
507
+ type: Literal["OAuthAuthenticator"]
508
+ client_id_name: Optional[str] = Field(
509
+ "client_id",
510
+ description="The name of the property to use to refresh the `access_token`.",
511
+ examples=["custom_app_id"],
512
+ title="Client ID Property Name",
513
+ )
514
+ client_id: Optional[str] = Field(
515
+ None,
516
+ description="The OAuth client ID. Fill it in the user inputs.",
517
+ examples=["{{ config['client_id }}", "{{ config['credentials']['client_id }}"],
518
+ title="Client ID",
519
+ )
520
+ client_secret_name: Optional[str] = Field(
521
+ "client_secret",
522
+ description="The name of the property to use to refresh the `access_token`.",
523
+ examples=["custom_app_secret"],
524
+ title="Client Secret Property Name",
525
+ )
526
+ client_secret: Optional[str] = Field(
527
+ None,
528
+ description="The OAuth client secret. Fill it in the user inputs.",
529
+ examples=[
530
+ "{{ config['client_secret }}",
531
+ "{{ config['credentials']['client_secret }}",
532
+ ],
533
+ title="Client Secret",
534
+ )
535
+ refresh_token_name: Optional[str] = Field(
536
+ "refresh_token",
537
+ description="The name of the property to use to refresh the `access_token`.",
538
+ examples=["custom_app_refresh_value"],
539
+ title="Refresh Token Property Name",
540
+ )
541
+ refresh_token: Optional[str] = Field(
542
+ None,
543
+ description="Credential artifact used to get a new access token.",
544
+ examples=[
545
+ "{{ config['refresh_token'] }}",
546
+ "{{ config['credentials]['refresh_token'] }}",
547
+ ],
548
+ title="Refresh Token",
549
+ )
550
+ token_refresh_endpoint: Optional[str] = Field(
551
+ None,
552
+ description="The full URL to call to obtain a new access token.",
553
+ examples=["https://connect.squareup.com/oauth2/token"],
554
+ title="Token Refresh Endpoint",
555
+ )
556
+ access_token_name: Optional[str] = Field(
557
+ "access_token",
558
+ description="The name of the property which contains the access token in the response from the token refresh endpoint.",
559
+ examples=["access_token"],
560
+ title="Access Token Property Name",
561
+ )
562
+ access_token_value: Optional[str] = Field(
563
+ None,
564
+ description="The value of the access_token to bypass the token refreshing using `refresh_token`.",
565
+ examples=["secret_access_token_value"],
566
+ title="Access Token Value",
567
+ )
568
+ expires_in_name: Optional[str] = Field(
569
+ "expires_in",
570
+ description="The name of the property which contains the expiry date in the response from the token refresh endpoint.",
571
+ examples=["expires_in"],
572
+ title="Token Expiry Property Name",
573
+ )
574
+ grant_type_name: Optional[str] = Field(
575
+ "grant_type",
576
+ description="The name of the property to use to refresh the `access_token`.",
577
+ examples=["custom_grant_type"],
578
+ title="Grant Type Property Name",
579
+ )
580
+ grant_type: Optional[str] = Field(
581
+ "refresh_token",
582
+ description="Specifies the OAuth2 grant type. If set to refresh_token, the refresh_token needs to be provided as well. For client_credentials, only client id and secret are required. Other grant types are not officially supported.",
583
+ examples=["refresh_token", "client_credentials"],
584
+ title="Grant Type",
585
+ )
586
+ refresh_request_body: Optional[Dict[str, Any]] = Field(
587
+ None,
588
+ description="Body of the request sent to get a new access token.",
589
+ examples=[
590
+ {
591
+ "applicationId": "{{ config['application_id'] }}",
592
+ "applicationSecret": "{{ config['application_secret'] }}",
593
+ "token": "{{ config['token'] }}",
594
+ }
595
+ ],
596
+ title="Refresh Request Body",
597
+ )
598
+ refresh_request_headers: Optional[Dict[str, Any]] = Field(
599
+ None,
600
+ description="Headers of the request sent to get a new access token.",
601
+ examples=[
602
+ {
603
+ "Authorization": "<AUTH_TOKEN>",
604
+ "Content-Type": "application/x-www-form-urlencoded",
605
+ }
606
+ ],
607
+ title="Refresh Request Headers",
608
+ )
609
+ scopes: Optional[List[str]] = Field(
610
+ None,
611
+ description="List of scopes that should be granted to the access token.",
612
+ examples=[["crm.list.read", "crm.objects.contacts.read", "crm.schema.contacts.read"]],
613
+ title="Scopes",
614
+ )
615
+ token_expiry_date: Optional[str] = Field(
616
+ None,
617
+ description="The access token expiry date.",
618
+ examples=["2023-04-06T07:12:10.421833+00:00", 1680842386],
619
+ title="Token Expiry Date",
620
+ )
621
+ token_expiry_date_format: Optional[str] = Field(
622
+ None,
623
+ description="The format of the time to expiration datetime. Provide it if the time is returned as a date-time string instead of seconds.",
624
+ examples=["%Y-%m-%d %H:%M:%S.%f+00:00"],
625
+ title="Token Expiry Date Format",
626
+ )
627
+ refresh_token_updater: Optional[RefreshTokenUpdater] = Field(
628
+ None,
629
+ description="When the token updater is defined, new refresh tokens, access tokens and the access token expiry date are written back from the authentication response to the config object. This is important if the refresh token can only used once.",
630
+ title="Token Updater",
631
+ )
632
+ profile_assertion: Optional[JwtAuthenticator] = Field(
633
+ None,
634
+ description="The authenticator being used to authenticate the client authenticator.",
635
+ title="Profile Assertion",
636
+ )
637
+ use_profile_assertion: Optional[bool] = Field(
638
+ False,
639
+ description="Enable using profile assertion as a flow for OAuth authorization.",
640
+ title="Use Profile Assertion",
641
+ )
642
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
643
+
644
+
645
+ class Rate(BaseModel):
646
+ class Config:
647
+ extra = Extra.allow
648
+
649
+ limit: Union[int, str] = Field(
650
+ ...,
651
+ description="The maximum number of calls allowed within the interval.",
652
+ title="Limit",
653
+ )
654
+ interval: str = Field(
655
+ ...,
656
+ description="The time interval for the rate limit.",
657
+ examples=["PT1H", "P1D"],
658
+ title="Interval",
659
+ )
660
+
661
+
662
+ class HttpRequestRegexMatcher(BaseModel):
663
+ class Config:
664
+ extra = Extra.allow
665
+
666
+ method: Optional[str] = Field(
667
+ None, description="The HTTP method to match (e.g., GET, POST).", title="Method"
668
+ )
669
+ url_base: Optional[str] = Field(
670
+ None,
671
+ description='The base URL (scheme and host, e.g. "https://api.example.com") to match.',
672
+ title="URL Base",
673
+ )
674
+ url_path_pattern: Optional[str] = Field(
675
+ None,
676
+ description="A regular expression pattern to match the URL path.",
677
+ title="URL Path Pattern",
678
+ )
679
+ params: Optional[Dict[str, Any]] = Field(
680
+ None, description="The query parameters to match.", title="Parameters"
681
+ )
682
+ headers: Optional[Dict[str, Any]] = Field(
683
+ None, description="The headers to match.", title="Headers"
684
+ )
685
+
686
+
687
+ class DpathExtractor(BaseModel):
688
+ type: Literal["DpathExtractor"]
689
+ field_path: List[str] = Field(
690
+ ...,
691
+ description='List of potentially nested fields describing the full path of the field to extract. Use "*" to extract all values from an array. See more info in the [docs](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/record-selector).',
692
+ examples=[
693
+ ["data"],
694
+ ["data", "records"],
695
+ ["data", "{{ parameters.name }}"],
696
+ ["data", "*", "record"],
697
+ ],
698
+ title="Field Path",
699
+ )
700
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
701
+
702
+
703
+ class ResponseToFileExtractor(BaseModel):
704
+ type: Literal["ResponseToFileExtractor"]
705
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
706
+
707
+
708
+ class ExponentialBackoffStrategy(BaseModel):
709
+ type: Literal["ExponentialBackoffStrategy"]
710
+ factor: Optional[Union[float, str]] = Field(
711
+ 5,
712
+ description="Multiplicative constant applied on each retry.",
713
+ examples=[5, 5.5, "10"],
714
+ title="Factor",
715
+ )
716
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
717
+
718
+
719
+ class SessionTokenRequestBearerAuthenticator(BaseModel):
720
+ type: Literal["Bearer"]
721
+
722
+
723
+ class HttpMethod(Enum):
724
+ GET = "GET"
725
+ POST = "POST"
726
+
727
+
728
+ class Action(Enum):
729
+ SUCCESS = "SUCCESS"
730
+ FAIL = "FAIL"
731
+ RETRY = "RETRY"
732
+ IGNORE = "IGNORE"
733
+ RATE_LIMITED = "RATE_LIMITED"
734
+
735
+
736
+ class FailureType(Enum):
737
+ system_error = "system_error"
738
+ config_error = "config_error"
739
+ transient_error = "transient_error"
740
+
741
+
742
+ class HttpResponseFilter(BaseModel):
743
+ type: Literal["HttpResponseFilter"]
744
+ action: Optional[Action] = Field(
745
+ None,
746
+ description="Action to execute if a response matches the filter.",
747
+ examples=["SUCCESS", "FAIL", "RETRY", "IGNORE", "RATE_LIMITED"],
748
+ title="Action",
749
+ )
750
+ failure_type: Optional[FailureType] = Field(
751
+ None,
752
+ description="Failure type of traced exception if a response matches the filter.",
753
+ examples=["system_error", "config_error", "transient_error"],
754
+ title="Failure Type",
755
+ )
756
+ error_message: Optional[str] = Field(
757
+ None,
758
+ description="Error Message to display if the response matches the filter.",
759
+ title="Error Message",
760
+ )
761
+ error_message_contains: Optional[str] = Field(
762
+ None,
763
+ description="Match the response if its error message contains the substring.",
764
+ example=["This API operation is not enabled for this site"],
765
+ title="Error Message Substring",
766
+ )
767
+ http_codes: Optional[List[int]] = Field(
768
+ None,
769
+ description="Match the response if its HTTP code is included in this list.",
770
+ examples=[[420, 429], [500]],
771
+ title="HTTP Codes",
772
+ unique_items=True,
773
+ )
774
+ predicate: Optional[str] = Field(
775
+ None,
776
+ description="Match the response if the predicate evaluates to true.",
777
+ examples=[
778
+ "{{ 'Too much requests' in response }}",
779
+ "{{ 'error_code' in response and response['error_code'] == 'ComplexityException' }}",
780
+ ],
781
+ title="Predicate",
782
+ )
783
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
784
+
785
+
786
+ class ComplexFieldType(BaseModel):
787
+ field_type: str
788
+ items: Optional[Union[str, ComplexFieldType]] = None
789
+
790
+
791
+ class TypesMap(BaseModel):
792
+ target_type: Union[str, List[str], ComplexFieldType]
793
+ current_type: Union[str, List[str]]
794
+ condition: Optional[str] = None
795
+
796
+
797
+ class SchemaTypeIdentifier(BaseModel):
798
+ type: Optional[Literal["SchemaTypeIdentifier"]] = None
799
+ schema_pointer: Optional[List[str]] = Field(
800
+ [],
801
+ description="List of nested fields defining the schema field path to extract. Defaults to [].",
802
+ title="Schema Path",
803
+ )
804
+ key_pointer: List[str] = Field(
805
+ ...,
806
+ description="List of potentially nested fields describing the full path of the field key to extract.",
807
+ title="Key Path",
808
+ )
809
+ type_pointer: Optional[List[str]] = Field(
810
+ None,
811
+ description="List of potentially nested fields describing the full path of the field type to extract.",
812
+ title="Type Path",
813
+ )
814
+ types_mapping: Optional[List[TypesMap]] = None
815
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
816
+
817
+
818
+ class InlineSchemaLoader(BaseModel):
819
+ type: Literal["InlineSchemaLoader"]
820
+ schema_: Optional[Dict[str, Any]] = Field(
821
+ None,
822
+ alias="schema",
823
+ description='Describes a streams\' schema. Refer to the <a href="https://docs.airbyte.com/understanding-airbyte/supported-data-types/">Data Types documentation</a> for more details on which types are valid.',
824
+ title="Schema",
825
+ )
826
+
827
+
828
+ class JsonFileSchemaLoader(BaseModel):
829
+ type: Literal["JsonFileSchemaLoader"]
830
+ file_path: Optional[str] = Field(
831
+ None,
832
+ description="Path to the JSON file defining the schema. The path is relative to the connector module's root.",
833
+ example=["./schemas/users.json"],
834
+ title="File Path",
835
+ )
836
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
837
+
838
+
839
+ class JsonDecoder(BaseModel):
840
+ type: Literal["JsonDecoder"]
841
+
842
+
843
+ class JsonlDecoder(BaseModel):
844
+ type: Literal["JsonlDecoder"]
845
+
846
+
847
+ class KeysToLower(BaseModel):
848
+ type: Literal["KeysToLower"]
849
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
850
+
851
+
852
+ class KeysToSnakeCase(BaseModel):
853
+ type: Literal["KeysToSnakeCase"]
854
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
855
+
856
+
857
+ class FlattenFields(BaseModel):
858
+ type: Literal["FlattenFields"]
859
+ flatten_lists: Optional[bool] = Field(
860
+ True,
861
+ description="Whether to flatten lists or leave it as is. Default is True.",
862
+ title="Flatten Lists",
863
+ )
864
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
865
+
866
+
867
+ class DpathFlattenFields(BaseModel):
868
+ type: Literal["DpathFlattenFields"]
869
+ field_path: List[str] = Field(
870
+ ...,
871
+ description="A path to field that needs to be flattened.",
872
+ examples=[["data"], ["data", "*", "field"]],
873
+ title="Field Path",
874
+ )
875
+ delete_origin_value: Optional[bool] = Field(
876
+ None,
877
+ description="Whether to delete the origin value or keep it. Default is False.",
878
+ title="Delete Origin Value",
879
+ )
880
+ replace_record: Optional[bool] = Field(
881
+ None,
882
+ description="Whether to replace the origin record or not. Default is False.",
883
+ title="Replace Origin Record",
884
+ )
885
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
886
+
887
+
888
+ class KeysReplace(BaseModel):
889
+ type: Literal["KeysReplace"]
890
+ old: str = Field(
891
+ ...,
892
+ description="Old value to replace.",
893
+ examples=[
894
+ " ",
895
+ "{{ record.id }}",
896
+ "{{ config['id'] }}",
897
+ "{{ stream_slice['id'] }}",
898
+ ],
899
+ title="Old value",
900
+ )
901
+ new: str = Field(
902
+ ...,
903
+ description="New value to set.",
904
+ examples=[
905
+ "_",
906
+ "{{ record.id }}",
907
+ "{{ config['id'] }}",
908
+ "{{ stream_slice['id'] }}",
909
+ ],
910
+ title="New value",
911
+ )
912
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
913
+
914
+
915
+ class IterableDecoder(BaseModel):
916
+ type: Literal["IterableDecoder"]
917
+
918
+
919
+ class XmlDecoder(BaseModel):
920
+ type: Literal["XmlDecoder"]
921
+
922
+
923
+ class CustomDecoder(BaseModel):
924
+ class Config:
925
+ extra = Extra.allow
926
+
927
+ type: Literal["CustomDecoder"]
928
+ class_name: str = Field(
929
+ ...,
930
+ description="Fully-qualified name of the class that will be implementing the custom decoding. Has to be a sub class of Decoder. The format is `source_<name>.<package>.<class_name>`.",
931
+ examples=["source_amazon_ads.components.GzipJsonlDecoder"],
932
+ title="Class Name",
933
+ )
934
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
935
+
936
+
937
+ class MinMaxDatetime(BaseModel):
938
+ type: Literal["MinMaxDatetime"]
939
+ datetime: str = Field(
940
+ ...,
941
+ description="Datetime value.",
942
+ examples=["2021-01-01", "2021-01-01T00:00:00Z", "{{ config['start_time'] }}"],
943
+ title="Datetime",
944
+ )
945
+ datetime_format: Optional[str] = Field(
946
+ "",
947
+ description='Format of the datetime value. Defaults to "%Y-%m-%dT%H:%M:%S.%f%z" if left empty. Use placeholders starting with "%" to describe the format the API is using. The following placeholders are available:\n * **%s**: Epoch unix timestamp - `1686218963`\n * **%s_as_float**: Epoch unix timestamp in seconds as float with microsecond precision - `1686218963.123456`\n * **%ms**: Epoch unix timestamp - `1686218963123`\n * **%a**: Weekday (abbreviated) - `Sun`\n * **%A**: Weekday (full) - `Sunday`\n * **%w**: Weekday (decimal) - `0` (Sunday), `6` (Saturday)\n * **%d**: Day of the month (zero-padded) - `01`, `02`, ..., `31`\n * **%b**: Month (abbreviated) - `Jan`\n * **%B**: Month (full) - `January`\n * **%m**: Month (zero-padded) - `01`, `02`, ..., `12`\n * **%y**: Year (without century, zero-padded) - `00`, `01`, ..., `99`\n * **%Y**: Year (with century) - `0001`, `0002`, ..., `9999`\n * **%H**: Hour (24-hour, zero-padded) - `00`, `01`, ..., `23`\n * **%I**: Hour (12-hour, zero-padded) - `01`, `02`, ..., `12`\n * **%p**: AM/PM indicator\n * **%M**: Minute (zero-padded) - `00`, `01`, ..., `59`\n * **%S**: Second (zero-padded) - `00`, `01`, ..., `59`\n * **%f**: Microsecond (zero-padded to 6 digits) - `000000`, `000001`, ..., `999999`\n * **%_ms**: Millisecond (zero-padded to 3 digits) - `000`, `001`, ..., `999`\n * **%z**: UTC offset - `(empty)`, `+0000`, `-04:00`\n * **%Z**: Time zone name - `(empty)`, `UTC`, `GMT`\n * **%j**: Day of the year (zero-padded) - `001`, `002`, ..., `366`\n * **%U**: Week number of the year (Sunday as first day) - `00`, `01`, ..., `53`\n * **%W**: Week number of the year (Monday as first day) - `00`, `01`, ..., `53`\n * **%c**: Date and time representation - `Tue Aug 16 21:30:00 1988`\n * **%x**: Date representation - `08/16/1988`\n * **%X**: Time representation - `21:30:00`\n * **%%**: Literal \'%\' character\n\n Some placeholders depend on the locale of the underlying system - in most cases this locale is configured as en/US. For more information see the [Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).\n',
948
+ examples=["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%d", "%s"],
949
+ title="Datetime Format",
950
+ )
951
+ max_datetime: Optional[str] = Field(
952
+ None,
953
+ description="Ceiling applied on the datetime value. Must be formatted with the datetime_format field.",
954
+ examples=["2021-01-01T00:00:00Z", "2021-01-01"],
955
+ title="Max Datetime",
956
+ )
957
+ min_datetime: Optional[str] = Field(
958
+ None,
959
+ description="Floor applied on the datetime value. Must be formatted with the datetime_format field.",
960
+ examples=["2010-01-01T00:00:00Z", "2010-01-01"],
961
+ title="Min Datetime",
962
+ )
963
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
964
+
965
+
966
+ class NoAuth(BaseModel):
967
+ type: Literal["NoAuth"]
968
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
969
+
970
+
971
+ class NoPagination(BaseModel):
972
+ type: Literal["NoPagination"]
973
+
974
+
975
+ class State(BaseModel):
976
+ class Config:
977
+ extra = Extra.allow
978
+
979
+ min: int
980
+ max: int
981
+
982
+
983
+ class OauthConnectorInputSpecification(BaseModel):
984
+ class Config:
985
+ extra = Extra.allow
986
+
987
+ consent_url: str = Field(
988
+ ...,
989
+ description="The DeclarativeOAuth Specific string URL string template to initiate the authentication.\nThe placeholders are replaced during the processing to provide neccessary values.",
990
+ examples=[
991
+ "https://domain.host.com/marketing_api/auth?{{client_id_key}}={{client_id_value}}&{{redirect_uri_key}}={{{{redirect_uri_value}} | urlEncoder}}&{{state_key}}={{state_value}}",
992
+ "https://endpoint.host.com/oauth2/authorize?{{client_id_key}}={{client_id_value}}&{{redirect_uri_key}}={{{{redirect_uri_value}} | urlEncoder}}&{{scope_key}}={{{{scope_value}} | urlEncoder}}&{{state_key}}={{state_value}}&subdomain={{subdomain}}",
993
+ ],
994
+ title="Consent URL",
995
+ )
996
+ scope: Optional[str] = Field(
997
+ None,
998
+ description="The DeclarativeOAuth Specific string of the scopes needed to be grant for authenticated user.",
999
+ examples=["user:read user:read_orders workspaces:read"],
1000
+ title="Scopes",
1001
+ )
1002
+ access_token_url: str = Field(
1003
+ ...,
1004
+ description="The DeclarativeOAuth Specific URL templated string to obtain the `access_token`, `refresh_token` etc.\nThe placeholders are replaced during the processing to provide neccessary values.",
1005
+ examples=[
1006
+ "https://auth.host.com/oauth2/token?{{client_id_key}}={{client_id_value}}&{{client_secret_key}}={{client_secret_value}}&{{auth_code_key}}={{auth_code_value}}&{{redirect_uri_key}}={{{{redirect_uri_value}} | urlEncoder}}"
1007
+ ],
1008
+ title="Access Token URL",
1009
+ )
1010
+ access_token_headers: Optional[Dict[str, Any]] = Field(
1011
+ None,
1012
+ description="The DeclarativeOAuth Specific optional headers to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.",
1013
+ examples=[
1014
+ {
1015
+ "Authorization": "Basic {{ {{ client_id_value }}:{{ client_secret_value }} | base64Encoder }}"
1016
+ }
1017
+ ],
1018
+ title="Access Token Headers",
1019
+ )
1020
+ access_token_params: Optional[Dict[str, Any]] = Field(
1021
+ None,
1022
+ description="The DeclarativeOAuth Specific optional query parameters to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.\nWhen this property is provided, the query params will be encoded as `Json` and included in the outgoing API request.",
1023
+ examples=[
1024
+ {
1025
+ "{{ auth_code_key }}": "{{ auth_code_value }}",
1026
+ "{{ client_id_key }}": "{{ client_id_value }}",
1027
+ "{{ client_secret_key }}": "{{ client_secret_value }}",
1028
+ }
1029
+ ],
1030
+ title="Access Token Query Params (Json Encoded)",
1031
+ )
1032
+ extract_output: Optional[List[str]] = Field(
1033
+ None,
1034
+ description="The DeclarativeOAuth Specific list of strings to indicate which keys should be extracted and returned back to the input config.",
1035
+ examples=[["access_token", "refresh_token", "other_field"]],
1036
+ title="Extract Output",
1037
+ )
1038
+ state: Optional[State] = Field(
1039
+ None,
1040
+ description="The DeclarativeOAuth Specific object to provide the criteria of how the `state` query param should be constructed,\nincluding length and complexity.",
1041
+ examples=[{"min": 7, "max": 128}],
1042
+ title="Configurable State Query Param",
1043
+ )
1044
+ client_id_key: Optional[str] = Field(
1045
+ None,
1046
+ description="The DeclarativeOAuth Specific optional override to provide the custom `client_id` key name, if required by data-provider.",
1047
+ examples=["my_custom_client_id_key_name"],
1048
+ title="Client ID Key Override",
1049
+ )
1050
+ client_secret_key: Optional[str] = Field(
1051
+ None,
1052
+ description="The DeclarativeOAuth Specific optional override to provide the custom `client_secret` key name, if required by data-provider.",
1053
+ examples=["my_custom_client_secret_key_name"],
1054
+ title="Client Secret Key Override",
1055
+ )
1056
+ scope_key: Optional[str] = Field(
1057
+ None,
1058
+ description="The DeclarativeOAuth Specific optional override to provide the custom `scope` key name, if required by data-provider.",
1059
+ examples=["my_custom_scope_key_key_name"],
1060
+ title="Scopes Key Override",
1061
+ )
1062
+ state_key: Optional[str] = Field(
1063
+ None,
1064
+ description="The DeclarativeOAuth Specific optional override to provide the custom `state` key name, if required by data-provider.",
1065
+ examples=["my_custom_state_key_key_name"],
1066
+ title="State Key Override",
1067
+ )
1068
+ auth_code_key: Optional[str] = Field(
1069
+ None,
1070
+ description="The DeclarativeOAuth Specific optional override to provide the custom `code` key name to something like `auth_code` or `custom_auth_code`, if required by data-provider.",
1071
+ examples=["my_custom_auth_code_key_name"],
1072
+ title="Auth Code Key Override",
1073
+ )
1074
+ redirect_uri_key: Optional[str] = Field(
1075
+ None,
1076
+ description="The DeclarativeOAuth Specific optional override to provide the custom `redirect_uri` key name to something like `callback_uri`, if required by data-provider.",
1077
+ examples=["my_custom_redirect_uri_key_name"],
1078
+ title="Redirect URI Key Override",
1079
+ )
1080
+
1081
+
1082
+ class OAuthConfigSpecification(BaseModel):
1083
+ class Config:
1084
+ extra = Extra.allow
1085
+
1086
+ oauth_user_input_from_connector_config_specification: Optional[Dict[str, Any]] = Field(
1087
+ None,
1088
+ description="OAuth specific blob. This is a Json Schema used to validate Json configurations used as input to OAuth.\nMust be a valid non-nested JSON that refers to properties from ConnectorSpecification.connectionSpecification\nusing special annotation 'path_in_connector_config'.\nThese are input values the user is entering through the UI to authenticate to the connector, that might also shared\nas inputs for syncing data via the connector.\nExamples:\nif no connector values is shared during oauth flow, oauth_user_input_from_connector_config_specification=[]\nif connector values such as 'app_id' inside the top level are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['app_id']\n }\n }\nif connector values such as 'info.app_id' nested inside another object are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['info', 'app_id']\n }\n }",
1089
+ examples=[
1090
+ {"app_id": {"type": "string", "path_in_connector_config": ["app_id"]}},
1091
+ {
1092
+ "app_id": {
1093
+ "type": "string",
1094
+ "path_in_connector_config": ["info", "app_id"],
1095
+ }
1096
+ },
1097
+ ],
1098
+ title="OAuth user input",
1099
+ )
1100
+ oauth_connector_input_specification: Optional[OauthConnectorInputSpecification] = Field(
1101
+ None,
1102
+ description='The DeclarativeOAuth specific blob.\nPertains to the fields defined by the connector relating to the OAuth flow.\n\nInterpolation capabilities:\n- The variables placeholders are declared as `{{my_var}}`.\n- The nested resolution variables like `{{ {{my_nested_var}} }}` is allowed as well.\n\n- The allowed interpolation context is:\n + base64Encoder - encode to `base64`, {{ {{my_var_a}}:{{my_var_b}} | base64Encoder }}\n + base64Decorer - decode from `base64` encoded string, {{ {{my_string_variable_or_string_value}} | base64Decoder }}\n + urlEncoder - encode the input string to URL-like format, {{ https://test.host.com/endpoint | urlEncoder}}\n + urlDecorer - decode the input url-encoded string into text format, {{ urlDecoder:https%3A%2F%2Fairbyte.io | urlDecoder}}\n + codeChallengeS256 - get the `codeChallenge` encoded value to provide additional data-provider specific authorisation values, {{ {{state_value}} | codeChallengeS256 }}\n\nExamples:\n - The TikTok Marketing DeclarativeOAuth spec:\n {\n "oauth_connector_input_specification": {\n "type": "object",\n "additionalProperties": false,\n "properties": {\n "consent_url": "https://ads.tiktok.com/marketing_api/auth?{{client_id_key}}={{client_id_value}}&{{redirect_uri_key}}={{ {{redirect_uri_value}} | urlEncoder}}&{{state_key}}={{state_value}}",\n "access_token_url": "https://business-api.tiktok.com/open_api/v1.3/oauth2/access_token/",\n "access_token_params": {\n "{{ auth_code_key }}": "{{ auth_code_value }}",\n "{{ client_id_key }}": "{{ client_id_value }}",\n "{{ client_secret_key }}": "{{ client_secret_value }}"\n },\n "access_token_headers": {\n "Content-Type": "application/json",\n "Accept": "application/json"\n },\n "extract_output": ["data.access_token"],\n "client_id_key": "app_id",\n "client_secret_key": "secret",\n "auth_code_key": "auth_code"\n }\n }\n }',
1103
+ title="DeclarativeOAuth Connector Specification",
1104
+ )
1105
+ complete_oauth_output_specification: Optional[Dict[str, Any]] = Field(
1106
+ None,
1107
+ description="OAuth specific blob. This is a Json Schema used to validate Json configurations produced by the OAuth flows as they are\nreturned by the distant OAuth APIs.\nMust be a valid JSON describing the fields to merge back to `ConnectorSpecification.connectionSpecification`.\nFor each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it,\nExamples:\n complete_oauth_output_specification={\n refresh_token: {\n type: string,\n path_in_connector_config: ['credentials', 'refresh_token']\n }\n }",
1108
+ examples=[
1109
+ {
1110
+ "refresh_token": {
1111
+ "type": "string,",
1112
+ "path_in_connector_config": ["credentials", "refresh_token"],
1113
+ }
1114
+ }
1115
+ ],
1116
+ title="OAuth output specification",
1117
+ )
1118
+ complete_oauth_server_input_specification: Optional[Dict[str, Any]] = Field(
1119
+ None,
1120
+ description="OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations.\nMust be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the\nserver when completing an OAuth flow (typically exchanging an auth code for refresh token).\nExamples:\n complete_oauth_server_input_specification={\n client_id: {\n type: string\n },\n client_secret: {\n type: string\n }\n }",
1121
+ examples=[{"client_id": {"type": "string"}, "client_secret": {"type": "string"}}],
1122
+ title="OAuth input specification",
1123
+ )
1124
+ complete_oauth_server_output_specification: Optional[Dict[str, Any]] = Field(
1125
+ None,
1126
+ description="OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations that\nalso need to be merged back into the connector configuration at runtime.\nThis is a subset configuration of `complete_oauth_server_input_specification` that filters fields out to retain only the ones that\nare necessary for the connector to function with OAuth. (some fields could be used during oauth flows but not needed afterwards, therefore\nthey would be listed in the `complete_oauth_server_input_specification` but not `complete_oauth_server_output_specification`)\nMust be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the\nconnector when using OAuth flow APIs.\nThese fields are to be merged back to `ConnectorSpecification.connectionSpecification`.\nFor each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it,\nExamples:\n complete_oauth_server_output_specification={\n client_id: {\n type: string,\n path_in_connector_config: ['credentials', 'client_id']\n },\n client_secret: {\n type: string,\n path_in_connector_config: ['credentials', 'client_secret']\n }\n }",
1127
+ examples=[
1128
+ {
1129
+ "client_id": {
1130
+ "type": "string,",
1131
+ "path_in_connector_config": ["credentials", "client_id"],
1132
+ },
1133
+ "client_secret": {
1134
+ "type": "string,",
1135
+ "path_in_connector_config": ["credentials", "client_secret"],
1136
+ },
1137
+ }
1138
+ ],
1139
+ title="OAuth server output specification",
1140
+ )
1141
+
1142
+
1143
+ class OffsetIncrement(BaseModel):
1144
+ type: Literal["OffsetIncrement"]
1145
+ page_size: Optional[Union[int, str]] = Field(
1146
+ None,
1147
+ description="The number of records to include in each pages.",
1148
+ examples=[100, "{{ config['page_size'] }}"],
1149
+ title="Limit",
1150
+ )
1151
+ inject_on_first_request: Optional[bool] = Field(
1152
+ False,
1153
+ description="Using the `offset` with value `0` during the first request",
1154
+ title="Inject Offset",
1155
+ )
1156
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1157
+
1158
+
1159
+ class PageIncrement(BaseModel):
1160
+ type: Literal["PageIncrement"]
1161
+ page_size: Optional[Union[int, str]] = Field(
1162
+ None,
1163
+ description="The number of records to include in each pages.",
1164
+ examples=[100, "100", "{{ config['page_size'] }}"],
1165
+ title="Page Size",
1166
+ )
1167
+ start_from_page: Optional[int] = Field(
1168
+ 0,
1169
+ description="Index of the first page to request.",
1170
+ examples=[0, 1],
1171
+ title="Start From Page",
1172
+ )
1173
+ inject_on_first_request: Optional[bool] = Field(
1174
+ False,
1175
+ description="Using the `page number` with value defined by `start_from_page` during the first request",
1176
+ title="Inject Page Number",
1177
+ )
1178
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1179
+
1180
+
1181
+ class PrimaryKey(BaseModel):
1182
+ __root__: Union[str, List[str], List[List[str]]] = Field(
1183
+ ...,
1184
+ description="The stream field to be used to distinguish unique records. Can either be a single field, an array of fields representing a composite key, or an array of arrays representing a composite key where the fields are nested fields.",
1185
+ examples=["id", ["code", "type"]],
1186
+ title="Primary Key",
1187
+ )
1188
+
1189
+
1190
+ class RecordFilter(BaseModel):
1191
+ type: Literal["RecordFilter"]
1192
+ condition: Optional[str] = Field(
1193
+ "",
1194
+ description="The predicate to filter a record. Records will be removed if evaluated to False.",
1195
+ examples=[
1196
+ "{{ record['created_at'] >= stream_interval['start_time'] }}",
1197
+ "{{ record.status in ['active', 'expired'] }}",
1198
+ ],
1199
+ )
1200
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1201
+
1202
+
1203
+ class SchemaNormalization(Enum):
1204
+ None_ = "None"
1205
+ Default = "Default"
1206
+
1207
+
1208
+ class RemoveFields(BaseModel):
1209
+ type: Literal["RemoveFields"]
1210
+ condition: Optional[str] = Field(
1211
+ "",
1212
+ description="The predicate to filter a property by a property value. Property will be removed if it is empty OR expression is evaluated to True.,",
1213
+ examples=[
1214
+ "{{ property|string == '' }}",
1215
+ "{{ property is integer }}",
1216
+ "{{ property|length > 5 }}",
1217
+ "{{ property == 'some_string_to_match' }}",
1218
+ ],
1219
+ )
1220
+ field_pointers: List[List[str]] = Field(
1221
+ ...,
1222
+ description="Array of paths defining the field to remove. Each item is an array whose field describe the path of a field to remove.",
1223
+ examples=[["tags"], [["content", "html"], ["content", "plain_text"]]],
1224
+ title="Field Paths",
1225
+ )
1226
+
1227
+
1228
+ class RequestPath(BaseModel):
1229
+ type: Literal["RequestPath"]
1230
+
1231
+
1232
+ class InjectInto(Enum):
1233
+ request_parameter = "request_parameter"
1234
+ header = "header"
1235
+ body_data = "body_data"
1236
+ body_json = "body_json"
1237
+
1238
+
1239
+ class RequestOption(BaseModel):
1240
+ type: Literal["RequestOption"]
1241
+ field_name: Optional[str] = Field(
1242
+ None,
1243
+ description="Configures which key should be used in the location that the descriptor is being injected into. We hope to eventually deprecate this field in favor of `field_path` for all request_options, but must currently maintain it for backwards compatibility in the Builder.",
1244
+ examples=["segment_id"],
1245
+ title="Field Name",
1246
+ )
1247
+ field_path: Optional[List[str]] = Field(
1248
+ None,
1249
+ description="Configures a path to be used for nested structures in JSON body requests (e.g. GraphQL queries)",
1250
+ examples=[["data", "viewer", "id"]],
1251
+ title="Field Path",
1252
+ )
1253
+ inject_into: InjectInto = Field(
1254
+ ...,
1255
+ description="Configures where the descriptor should be set on the HTTP requests. Note that request parameters that are already encoded in the URL path will not be duplicated.",
1256
+ examples=["request_parameter", "header", "body_data", "body_json"],
1257
+ title="Inject Into",
1258
+ )
1259
+
1260
+
1261
+ class Schemas(BaseModel):
1262
+ pass
1263
+
1264
+ class Config:
1265
+ extra = Extra.allow
1266
+
1267
+
1268
+ class LegacySessionTokenAuthenticator(BaseModel):
1269
+ type: Literal["LegacySessionTokenAuthenticator"]
1270
+ header: str = Field(
1271
+ ...,
1272
+ description="The name of the session token header that will be injected in the request",
1273
+ examples=["X-Session"],
1274
+ title="Session Request Header",
1275
+ )
1276
+ login_url: str = Field(
1277
+ ...,
1278
+ description="Path of the login URL (do not include the base URL)",
1279
+ examples=["session"],
1280
+ title="Login Path",
1281
+ )
1282
+ session_token: Optional[str] = Field(
1283
+ None,
1284
+ description="Session token to use if using a pre-defined token. Not needed if authenticating with username + password pair",
1285
+ example=["{{ config['session_token'] }}"],
1286
+ title="Session Token",
1287
+ )
1288
+ session_token_response_key: str = Field(
1289
+ ...,
1290
+ description="Name of the key of the session token to be extracted from the response",
1291
+ examples=["id"],
1292
+ title="Response Token Response Key",
1293
+ )
1294
+ username: Optional[str] = Field(
1295
+ None,
1296
+ description="Username used to authenticate and obtain a session token",
1297
+ examples=[" {{ config['username'] }}"],
1298
+ title="Username",
1299
+ )
1300
+ password: Optional[str] = Field(
1301
+ "",
1302
+ description="Password used to authenticate and obtain a session token",
1303
+ examples=["{{ config['password'] }}", ""],
1304
+ title="Password",
1305
+ )
1306
+ validate_session_url: str = Field(
1307
+ ...,
1308
+ description="Path of the URL to use to validate that the session token is valid (do not include the base URL)",
1309
+ examples=["user/current"],
1310
+ title="Validate Session Path",
1311
+ )
1312
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1313
+
1314
+
1315
+ class CsvDecoder(BaseModel):
1316
+ type: Literal["CsvDecoder"]
1317
+ encoding: Optional[str] = "utf-8"
1318
+ delimiter: Optional[str] = ","
1319
+
1320
+
1321
+ class AsyncJobStatusMap(BaseModel):
1322
+ type: Optional[Literal["AsyncJobStatusMap"]] = None
1323
+ running: List[str]
1324
+ completed: List[str]
1325
+ failed: List[str]
1326
+ timeout: List[str]
1327
+
1328
+
1329
+ class ValueType(Enum):
1330
+ string = "string"
1331
+ number = "number"
1332
+ integer = "integer"
1333
+ boolean = "boolean"
1334
+
1335
+
1336
+ class WaitTimeFromHeader(BaseModel):
1337
+ type: Literal["WaitTimeFromHeader"]
1338
+ header: str = Field(
1339
+ ...,
1340
+ description="The name of the response header defining how long to wait before retrying.",
1341
+ examples=["Retry-After"],
1342
+ title="Response Header Name",
1343
+ )
1344
+ regex: Optional[str] = Field(
1345
+ None,
1346
+ description="Optional regex to apply on the header to extract its value. The regex should define a capture group defining the wait time.",
1347
+ examples=["([-+]?\\d+)"],
1348
+ title="Extraction Regex",
1349
+ )
1350
+ max_waiting_time_in_seconds: Optional[float] = Field(
1351
+ None,
1352
+ description="Given the value extracted from the header is greater than this value, stop the stream.",
1353
+ examples=[3600],
1354
+ title="Max Waiting Time in Seconds",
1355
+ )
1356
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1357
+
1358
+
1359
+ class WaitUntilTimeFromHeader(BaseModel):
1360
+ type: Literal["WaitUntilTimeFromHeader"]
1361
+ header: str = Field(
1362
+ ...,
1363
+ description="The name of the response header defining how long to wait before retrying.",
1364
+ examples=["wait_time"],
1365
+ title="Response Header",
1366
+ )
1367
+ min_wait: Optional[Union[float, str]] = Field(
1368
+ None,
1369
+ description="Minimum time to wait before retrying.",
1370
+ examples=[10, "60"],
1371
+ title="Minimum Wait Time",
1372
+ )
1373
+ regex: Optional[str] = Field(
1374
+ None,
1375
+ description="Optional regex to apply on the header to extract its value. The regex should define a capture group defining the wait time.",
1376
+ examples=["([-+]?\\d+)"],
1377
+ title="Extraction Regex",
1378
+ )
1379
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1380
+
1381
+
1382
+ class ComponentMappingDefinition(BaseModel):
1383
+ type: Literal["ComponentMappingDefinition"]
1384
+ field_path: List[str] = Field(
1385
+ ...,
1386
+ description="A list of potentially nested fields indicating the full path where value will be added or updated.",
1387
+ examples=[
1388
+ ["data"],
1389
+ ["data", "records"],
1390
+ ["data", 1, "name"],
1391
+ ["data", "{{ components_values.name }}"],
1392
+ ["data", "*", "record"],
1393
+ ["*", "**", "name"],
1394
+ ],
1395
+ title="Field Path",
1396
+ )
1397
+ value: str = Field(
1398
+ ...,
1399
+ description="The dynamic or static value to assign to the key. Interpolated values can be used to dynamically determine the value during runtime.",
1400
+ examples=[
1401
+ "{{ components_values['updates'] }}",
1402
+ "{{ components_values['MetaData']['LastUpdatedTime'] }}",
1403
+ "{{ config['segment_id'] }}",
1404
+ "{{ stream_slice['parent_id'] }}",
1405
+ "{{ stream_slice['extra_fields']['name'] }}",
1406
+ ],
1407
+ title="Value",
1408
+ )
1409
+ value_type: Optional[ValueType] = Field(
1410
+ None,
1411
+ description="The expected data type of the value. If omitted, the type will be inferred from the value provided.",
1412
+ title="Value Type",
1413
+ )
1414
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1415
+
1416
+
1417
+ class StreamConfig(BaseModel):
1418
+ type: Literal["StreamConfig"]
1419
+ configs_pointer: List[str] = Field(
1420
+ ...,
1421
+ description="A list of potentially nested fields indicating the full path in source config file where streams configs located.",
1422
+ examples=[["data"], ["data", "streams"], ["data", "{{ parameters.name }}"]],
1423
+ title="Configs Pointer",
1424
+ )
1425
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1426
+
1427
+
1428
+ class ConfigComponentsResolver(BaseModel):
1429
+ type: Literal["ConfigComponentsResolver"]
1430
+ stream_config: StreamConfig
1431
+ components_mapping: List[ComponentMappingDefinition]
1432
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1433
+
1434
+
1435
+ class AddedFieldDefinition(BaseModel):
1436
+ type: Literal["AddedFieldDefinition"]
1437
+ path: List[str] = Field(
1438
+ ...,
1439
+ description="List of strings defining the path where to add the value on the record.",
1440
+ examples=[["segment_id"], ["metadata", "segment_id"]],
1441
+ title="Path",
1442
+ )
1443
+ value: str = Field(
1444
+ ...,
1445
+ description="Value of the new field. Use {{ record['existing_field'] }} syntax to refer to other fields in the record.",
1446
+ examples=[
1447
+ "{{ record['updates'] }}",
1448
+ "{{ record['MetaData']['LastUpdatedTime'] }}",
1449
+ "{{ stream_partition['segment_id'] }}",
1450
+ ],
1451
+ title="Value",
1452
+ )
1453
+ value_type: Optional[ValueType] = Field(
1454
+ None,
1455
+ description="Type of the value. If not specified, the type will be inferred from the value.",
1456
+ title="Value Type",
1457
+ )
1458
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1459
+
1460
+
1461
+ class AddFields(BaseModel):
1462
+ type: Literal["AddFields"]
1463
+ fields: List[AddedFieldDefinition] = Field(
1464
+ ...,
1465
+ description="List of transformations (path and corresponding value) that will be added to the record.",
1466
+ title="Fields",
1467
+ )
1468
+ condition: Optional[str] = Field(
1469
+ "",
1470
+ description="Fields will be added if expression is evaluated to True.",
1471
+ examples=[
1472
+ "{{ property|string == '' }}",
1473
+ "{{ property is integer }}",
1474
+ "{{ property|length > 5 }}",
1475
+ "{{ property == 'some_string_to_match' }}",
1476
+ ],
1477
+ )
1478
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1479
+
1480
+
1481
+ class ApiKeyAuthenticator(BaseModel):
1482
+ type: Literal["ApiKeyAuthenticator"]
1483
+ api_token: Optional[str] = Field(
1484
+ None,
1485
+ description="The API key to inject in the request. Fill it in the user inputs.",
1486
+ examples=["{{ config['api_key'] }}", "Token token={{ config['api_key'] }}"],
1487
+ title="API Key",
1488
+ )
1489
+ header: Optional[str] = Field(
1490
+ None,
1491
+ description="The name of the HTTP header that will be set to the API key. This setting is deprecated, use inject_into instead. Header and inject_into can not be defined at the same time.",
1492
+ examples=["Authorization", "Api-Token", "X-Auth-Token"],
1493
+ title="Header Name",
1494
+ )
1495
+ inject_into: Optional[RequestOption] = Field(
1496
+ None,
1497
+ description="Configure how the API Key will be sent in requests to the source API. Either inject_into or header has to be defined.",
1498
+ examples=[
1499
+ {"inject_into": "header", "field_name": "Authorization"},
1500
+ {"inject_into": "request_parameter", "field_name": "authKey"},
1501
+ ],
1502
+ title="Inject API Key Into Outgoing HTTP Request",
1503
+ )
1504
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1505
+
1506
+
1507
+ class AuthFlow(BaseModel):
1508
+ auth_flow_type: Optional[AuthFlowType] = Field(
1509
+ None, description="The type of auth to use", title="Auth flow type"
1510
+ )
1511
+ predicate_key: Optional[List[str]] = Field(
1512
+ None,
1513
+ description="JSON path to a field in the connectorSpecification that should exist for the advanced auth to be applicable.",
1514
+ examples=[["credentials", "auth_type"]],
1515
+ title="Predicate key",
1516
+ )
1517
+ predicate_value: Optional[str] = Field(
1518
+ None,
1519
+ description="Value of the predicate_key fields for the advanced auth to be applicable.",
1520
+ examples=["Oauth"],
1521
+ title="Predicate value",
1522
+ )
1523
+ oauth_config_specification: Optional[OAuthConfigSpecification] = None
1524
+
1525
+
1526
+ class IncrementingCountCursor(BaseModel):
1527
+ type: Literal["IncrementingCountCursor"]
1528
+ cursor_field: str = Field(
1529
+ ...,
1530
+ description="The location of the value on a record that will be used as a bookmark during sync. To ensure no data loss, the API must return records in ascending order based on the cursor field. Nested fields are not supported, so the field must be at the top level of the record. You can use a combination of Add Field and Remove Field transformations to move the nested field to the top.",
1531
+ examples=["created_at", "{{ config['record_cursor'] }}"],
1532
+ title="Cursor Field",
1533
+ )
1534
+ start_value: Optional[Union[str, int]] = Field(
1535
+ None,
1536
+ description="The value that determines the earliest record that should be synced.",
1537
+ examples=[0, "{{ config['start_value'] }}"],
1538
+ title="Start Value",
1539
+ )
1540
+ start_value_option: Optional[RequestOption] = Field(
1541
+ None,
1542
+ description="Optionally configures how the start value will be sent in requests to the source API.",
1543
+ title="Inject Start Value Into Outgoing HTTP Request",
1544
+ )
1545
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1546
+
1547
+
1548
+ class DatetimeBasedCursor(BaseModel):
1549
+ type: Literal["DatetimeBasedCursor"]
1550
+ clamping: Optional[Clamping] = Field(
1551
+ None,
1552
+ description="This option is used to adjust the upper and lower boundaries of each datetime window to beginning and end of the provided target period (day, week, month)",
1553
+ title="Date Range Clamping",
1554
+ )
1555
+ cursor_field: str = Field(
1556
+ ...,
1557
+ description="The location of the value on a record that will be used as a bookmark during sync. To ensure no data loss, the API must return records in ascending order based on the cursor field. Nested fields are not supported, so the field must be at the top level of the record. You can use a combination of Add Field and Remove Field transformations to move the nested field to the top.",
1558
+ examples=["created_at", "{{ config['record_cursor'] }}"],
1559
+ title="Cursor Field",
1560
+ )
1561
+ datetime_format: str = Field(
1562
+ ...,
1563
+ description="The datetime format used to format the datetime values that are sent in outgoing requests to the API. Use placeholders starting with \"%\" to describe the format the API is using. The following placeholders are available:\n * **%s**: Epoch unix timestamp - `1686218963`\n * **%s_as_float**: Epoch unix timestamp in seconds as float with microsecond precision - `1686218963.123456`\n * **%ms**: Epoch unix timestamp (milliseconds) - `1686218963123`\n * **%a**: Weekday (abbreviated) - `Sun`\n * **%A**: Weekday (full) - `Sunday`\n * **%w**: Weekday (decimal) - `0` (Sunday), `6` (Saturday)\n * **%d**: Day of the month (zero-padded) - `01`, `02`, ..., `31`\n * **%b**: Month (abbreviated) - `Jan`\n * **%B**: Month (full) - `January`\n * **%m**: Month (zero-padded) - `01`, `02`, ..., `12`\n * **%y**: Year (without century, zero-padded) - `00`, `01`, ..., `99`\n * **%Y**: Year (with century) - `0001`, `0002`, ..., `9999`\n * **%H**: Hour (24-hour, zero-padded) - `00`, `01`, ..., `23`\n * **%I**: Hour (12-hour, zero-padded) - `01`, `02`, ..., `12`\n * **%p**: AM/PM indicator\n * **%M**: Minute (zero-padded) - `00`, `01`, ..., `59`\n * **%S**: Second (zero-padded) - `00`, `01`, ..., `59`\n * **%f**: Microsecond (zero-padded to 6 digits) - `000000`\n * **%_ms**: Millisecond (zero-padded to 3 digits) - `000`\n * **%z**: UTC offset - `(empty)`, `+0000`, `-04:00`\n * **%Z**: Time zone name - `(empty)`, `UTC`, `GMT`\n * **%j**: Day of the year (zero-padded) - `001`, `002`, ..., `366`\n * **%U**: Week number of the year (starting Sunday) - `00`, ..., `53`\n * **%W**: Week number of the year (starting Monday) - `00`, ..., `53`\n * **%c**: Date and time - `Tue Aug 16 21:30:00 1988`\n * **%x**: Date standard format - `08/16/1988`\n * **%X**: Time standard format - `21:30:00`\n * **%%**: Literal '%' character\n\n Some placeholders depend on the locale of the underlying system - in most cases this locale is configured as en/US. For more information see the [Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).\n",
1564
+ examples=["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%d", "%s", "%ms", "%s_as_float"],
1565
+ title="Outgoing Datetime Format",
1566
+ )
1567
+ start_datetime: Union[str, MinMaxDatetime] = Field(
1568
+ ...,
1569
+ description="The datetime that determines the earliest record that should be synced.",
1570
+ examples=["2020-01-1T00:00:00Z", "{{ config['start_time'] }}"],
1571
+ title="Start Datetime",
1572
+ )
1573
+ cursor_datetime_formats: Optional[List[str]] = Field(
1574
+ None,
1575
+ description="The possible formats for the cursor field, in order of preference. The first format that matches the cursor field value will be used to parse it. If not provided, the `datetime_format` will be used.",
1576
+ title="Cursor Datetime Formats",
1577
+ )
1578
+ cursor_granularity: Optional[str] = Field(
1579
+ None,
1580
+ description="Smallest increment the datetime_format has (ISO 8601 duration) that is used to ensure the start of a slice does not overlap with the end of the previous one, e.g. for %Y-%m-%d the granularity should be P1D, for %Y-%m-%dT%H:%M:%SZ the granularity should be PT1S. Given this field is provided, `step` needs to be provided as well.",
1581
+ examples=["PT1S"],
1582
+ title="Cursor Granularity",
1583
+ )
1584
+ end_datetime: Optional[Union[str, MinMaxDatetime]] = Field(
1585
+ None,
1586
+ description="The datetime that determines the last record that should be synced. If not provided, `{{ now_utc() }}` will be used.",
1587
+ examples=["2021-01-1T00:00:00Z", "{{ now_utc() }}", "{{ day_delta(-1) }}"],
1588
+ title="End Datetime",
1589
+ )
1590
+ end_time_option: Optional[RequestOption] = Field(
1591
+ None,
1592
+ description="Optionally configures how the end datetime will be sent in requests to the source API.",
1593
+ title="Inject End Time Into Outgoing HTTP Request",
1594
+ )
1595
+ is_data_feed: Optional[bool] = Field(
1596
+ None,
1597
+ description="A data feed API is an API that does not allow filtering and paginates the content from the most recent to the least recent. Given this, the CDK needs to know when to stop paginating and this field will generate a stop condition for pagination.",
1598
+ title="Whether the target API is formatted as a data feed",
1599
+ )
1600
+ is_client_side_incremental: Optional[bool] = Field(
1601
+ None,
1602
+ description="If the target API endpoint does not take cursor values to filter records and returns all records anyway, the connector with this cursor will filter out records locally, and only emit new records from the last sync, hence incremental. This means that all records would be read from the API, but only new records will be emitted to the destination.",
1603
+ title="Whether the target API does not support filtering and returns all data (the cursor filters records in the client instead of the API side)",
1604
+ )
1605
+ is_compare_strictly: Optional[bool] = Field(
1606
+ False,
1607
+ description="Set to True if the target API does not accept queries where the start time equal the end time.",
1608
+ title="Whether to skip requests if the start time equals the end time",
1609
+ )
1610
+ global_substream_cursor: Optional[bool] = Field(
1611
+ False,
1612
+ description="This setting optimizes performance when the parent stream has thousands of partitions by storing the cursor as a single value rather than per partition. Notably, the substream state is updated only at the end of the sync, which helps prevent data loss in case of a sync failure. See more info in the [docs](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/incremental-syncs).",
1613
+ title="Whether to store cursor as one value instead of per partition",
1614
+ )
1615
+ lookback_window: Optional[str] = Field(
1616
+ None,
1617
+ description="Time interval before the start_datetime to read data for, e.g. P1M for looking back one month.",
1618
+ examples=["P1D", "P{{ config['lookback_days'] }}D"],
1619
+ title="Lookback Window",
1620
+ )
1621
+ partition_field_end: Optional[str] = Field(
1622
+ None,
1623
+ description="Name of the partition start time field.",
1624
+ examples=["ending_time"],
1625
+ title="Partition Field End",
1626
+ )
1627
+ partition_field_start: Optional[str] = Field(
1628
+ None,
1629
+ description="Name of the partition end time field.",
1630
+ examples=["starting_time"],
1631
+ title="Partition Field Start",
1632
+ )
1633
+ start_time_option: Optional[RequestOption] = Field(
1634
+ None,
1635
+ description="Optionally configures how the start datetime will be sent in requests to the source API.",
1636
+ title="Inject Start Time Into Outgoing HTTP Request",
1637
+ )
1638
+ step: Optional[str] = Field(
1639
+ None,
1640
+ description="The size of the time window (ISO8601 duration). Given this field is provided, `cursor_granularity` needs to be provided as well.",
1641
+ examples=["P1W", "{{ config['step_increment'] }}"],
1642
+ title="Step",
1643
+ )
1644
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1645
+
1646
+
1647
+ class FixedWindowCallRatePolicy(BaseModel):
1648
+ class Config:
1649
+ extra = Extra.allow
1650
+
1651
+ type: Literal["FixedWindowCallRatePolicy"]
1652
+ period: str = Field(
1653
+ ..., description="The time interval for the rate limit window.", title="Period"
1654
+ )
1655
+ call_limit: int = Field(
1656
+ ...,
1657
+ description="The maximum number of calls allowed within the period.",
1658
+ title="Call Limit",
1659
+ )
1660
+ matchers: List[HttpRequestRegexMatcher] = Field(
1661
+ ...,
1662
+ description="List of matchers that define which requests this policy applies to.",
1663
+ title="Matchers",
1664
+ )
1665
+
1666
+
1667
+ class MovingWindowCallRatePolicy(BaseModel):
1668
+ class Config:
1669
+ extra = Extra.allow
1670
+
1671
+ type: Literal["MovingWindowCallRatePolicy"]
1672
+ rates: List[Rate] = Field(
1673
+ ...,
1674
+ description="List of rates that define the call limits for different time intervals.",
1675
+ title="Rates",
1676
+ )
1677
+ matchers: List[HttpRequestRegexMatcher] = Field(
1678
+ ...,
1679
+ description="List of matchers that define which requests this policy applies to.",
1680
+ title="Matchers",
1681
+ )
1682
+
1683
+
1684
+ class UnlimitedCallRatePolicy(BaseModel):
1685
+ class Config:
1686
+ extra = Extra.allow
1687
+
1688
+ type: Literal["UnlimitedCallRatePolicy"]
1689
+ matchers: List[HttpRequestRegexMatcher] = Field(
1690
+ ...,
1691
+ description="List of matchers that define which requests this policy applies to.",
1692
+ title="Matchers",
1693
+ )
1694
+
1695
+
1696
+ class DefaultErrorHandler(BaseModel):
1697
+ type: Literal["DefaultErrorHandler"]
1698
+ backoff_strategies: Optional[
1699
+ List[
1700
+ Union[
1701
+ ConstantBackoffStrategy,
1702
+ CustomBackoffStrategy,
1703
+ ExponentialBackoffStrategy,
1704
+ WaitTimeFromHeader,
1705
+ WaitUntilTimeFromHeader,
1706
+ ]
1707
+ ]
1708
+ ] = Field(
1709
+ None,
1710
+ description="List of backoff strategies to use to determine how long to wait before retrying a retryable request.",
1711
+ title="Backoff Strategies",
1712
+ )
1713
+ max_retries: Optional[int] = Field(
1714
+ 5,
1715
+ description="The maximum number of time to retry a retryable request before giving up and failing.",
1716
+ examples=[5, 0, 10],
1717
+ title="Max Retry Count",
1718
+ )
1719
+ response_filters: Optional[List[HttpResponseFilter]] = Field(
1720
+ None,
1721
+ description="List of response filters to iterate on when deciding how to handle an error. When using an array of multiple filters, the filters will be applied sequentially and the response will be selected if it matches any of the filter's predicate.",
1722
+ title="Response Filters",
1723
+ )
1724
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1725
+
1726
+
1727
+ class DefaultPaginator(BaseModel):
1728
+ type: Literal["DefaultPaginator"]
1729
+ pagination_strategy: Union[
1730
+ CursorPagination, CustomPaginationStrategy, OffsetIncrement, PageIncrement
1731
+ ] = Field(
1732
+ ...,
1733
+ description="Strategy defining how records are paginated.",
1734
+ title="Pagination Strategy",
1735
+ )
1736
+ page_size_option: Optional[RequestOption] = None
1737
+ page_token_option: Optional[Union[RequestOption, RequestPath]] = None
1738
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1739
+
1740
+
1741
+ class SessionTokenRequestApiKeyAuthenticator(BaseModel):
1742
+ type: Literal["ApiKey"]
1743
+ inject_into: RequestOption = Field(
1744
+ ...,
1745
+ description="Configure how the API Key will be sent in requests to the source API.",
1746
+ examples=[
1747
+ {"inject_into": "header", "field_name": "Authorization"},
1748
+ {"inject_into": "request_parameter", "field_name": "authKey"},
1749
+ ],
1750
+ title="Inject API Key Into Outgoing HTTP Request",
1751
+ )
1752
+
1753
+
1754
+ class ListPartitionRouter(BaseModel):
1755
+ type: Literal["ListPartitionRouter"]
1756
+ cursor_field: str = Field(
1757
+ ...,
1758
+ description='While iterating over list values, the name of field used to reference a list value. The partition value can be accessed with string interpolation. e.g. "{{ stream_partition[\'my_key\'] }}" where "my_key" is the value of the cursor_field.',
1759
+ examples=["section", "{{ config['section_key'] }}"],
1760
+ title="Current Partition Value Identifier",
1761
+ )
1762
+ values: Union[str, List[str]] = Field(
1763
+ ...,
1764
+ description="The list of attributes being iterated over and used as input for the requests made to the source API.",
1765
+ examples=[["section_a", "section_b", "section_c"], "{{ config['sections'] }}"],
1766
+ title="Partition Values",
1767
+ )
1768
+ request_option: Optional[RequestOption] = Field(
1769
+ None,
1770
+ description="A request option describing where the list value should be injected into and under what field name if applicable.",
1771
+ title="Inject Partition Value Into Outgoing HTTP Request",
1772
+ )
1773
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1774
+
1775
+
1776
+ class RecordSelector(BaseModel):
1777
+ type: Literal["RecordSelector"]
1778
+ extractor: Union[CustomRecordExtractor, DpathExtractor]
1779
+ record_filter: Optional[Union[CustomRecordFilter, RecordFilter]] = Field(
1780
+ None,
1781
+ description="Responsible for filtering records to be emitted by the Source.",
1782
+ title="Record Filter",
1783
+ )
1784
+ schema_normalization: Optional[Union[SchemaNormalization, CustomSchemaNormalization]] = Field(
1785
+ SchemaNormalization.None_,
1786
+ description="Responsible for normalization according to the schema.",
1787
+ title="Schema Normalization",
1788
+ )
1789
+ transform_before_filtering: Optional[bool] = Field(
1790
+ False,
1791
+ description="If true, transformation will be applied before record filtering.",
1792
+ )
1793
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1794
+
1795
+
1796
+ class GzipDecoder(BaseModel):
1797
+ type: Literal["GzipDecoder"]
1798
+ decoder: Union[CsvDecoder, GzipDecoder, JsonDecoder, JsonlDecoder]
1799
+
1800
+
1801
+ class Spec(BaseModel):
1802
+ type: Literal["Spec"]
1803
+ connection_specification: Dict[str, Any] = Field(
1804
+ ...,
1805
+ description="A connection specification describing how a the connector can be configured.",
1806
+ title="Connection Specification",
1807
+ )
1808
+ documentation_url: Optional[str] = Field(
1809
+ None,
1810
+ description="URL of the connector's documentation page.",
1811
+ examples=["https://docs.airbyte.com/integrations/sources/dremio"],
1812
+ title="Documentation URL",
1813
+ )
1814
+ advanced_auth: Optional[AuthFlow] = Field(
1815
+ None,
1816
+ description="Advanced specification for configuring the authentication flow.",
1817
+ title="Advanced Auth",
1818
+ )
1819
+
1820
+
1821
+ class CompositeErrorHandler(BaseModel):
1822
+ type: Literal["CompositeErrorHandler"]
1823
+ error_handlers: List[Union[CompositeErrorHandler, DefaultErrorHandler]] = Field(
1824
+ ...,
1825
+ description="List of error handlers to iterate on to determine how to handle a failed response.",
1826
+ title="Error Handlers",
1827
+ )
1828
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1829
+
1830
+
1831
+ class HTTPAPIBudget(BaseModel):
1832
+ class Config:
1833
+ extra = Extra.allow
1834
+
1835
+ type: Literal["HTTPAPIBudget"]
1836
+ policies: List[
1837
+ Union[
1838
+ FixedWindowCallRatePolicy,
1839
+ MovingWindowCallRatePolicy,
1840
+ UnlimitedCallRatePolicy,
1841
+ ]
1842
+ ] = Field(
1843
+ ...,
1844
+ description="List of call rate policies that define how many calls are allowed.",
1845
+ title="Policies",
1846
+ )
1847
+ ratelimit_reset_header: Optional[str] = Field(
1848
+ "ratelimit-reset",
1849
+ description="The HTTP response header name that indicates when the rate limit resets.",
1850
+ title="Rate Limit Reset Header",
1851
+ )
1852
+ ratelimit_remaining_header: Optional[str] = Field(
1853
+ "ratelimit-remaining",
1854
+ description="The HTTP response header name that indicates the number of remaining allowed calls.",
1855
+ title="Rate Limit Remaining Header",
1856
+ )
1857
+ status_codes_for_ratelimit_hit: Optional[List[int]] = Field(
1858
+ [429],
1859
+ description="List of HTTP status codes that indicate a rate limit has been hit.",
1860
+ title="Status Codes for Rate Limit Hit",
1861
+ )
1862
+
1863
+
1864
+ class ZipfileDecoder(BaseModel):
1865
+ class Config:
1866
+ extra = Extra.allow
1867
+
1868
+ type: Literal["ZipfileDecoder"]
1869
+ decoder: Union[CsvDecoder, GzipDecoder, JsonDecoder, JsonlDecoder] = Field(
1870
+ ...,
1871
+ description="Parser to parse the decompressed data from the zipfile(s).",
1872
+ title="Parser",
1873
+ )
1874
+
1875
+
1876
+ class DeclarativeSource1(BaseModel):
1877
+ class Config:
1878
+ extra = Extra.forbid
1879
+
1880
+ type: Literal["DeclarativeSource"]
1881
+ check: Union[CheckStream, CheckDynamicStream]
1882
+ streams: List[Union[DeclarativeStream, StateDelegatingStream]]
1883
+ dynamic_streams: Optional[List[DynamicDeclarativeStream]] = None
1884
+ version: str = Field(
1885
+ ...,
1886
+ description="The version of the Airbyte CDK used to build and test the source.",
1887
+ )
1888
+ schemas: Optional[Schemas] = None
1889
+ definitions: Optional[Dict[str, Any]] = None
1890
+ spec: Optional[Spec] = None
1891
+ concurrency_level: Optional[ConcurrencyLevel] = None
1892
+ api_budget: Optional[HTTPAPIBudget] = None
1893
+ max_concurrent_async_job_count: Optional[int] = Field(
1894
+ None,
1895
+ description="Maximum number of concurrent asynchronous jobs to run. This property is only relevant for sources/streams that support asynchronous job execution through the AsyncRetriever (e.g. a report-based stream that initiates a job, polls the job status, and then fetches the job results). This is often set by the API's maximum number of concurrent jobs on the account level. Refer to the API's documentation for this information.",
1896
+ title="Maximum Concurrent Asynchronous Jobs",
1897
+ )
1898
+ metadata: Optional[Dict[str, Any]] = Field(
1899
+ None,
1900
+ description="For internal Airbyte use only - DO NOT modify manually. Used by consumers of declarative manifests for storing related metadata.",
1901
+ )
1902
+ description: Optional[str] = Field(
1903
+ None,
1904
+ description="A description of the connector. It will be presented on the Source documentation page.",
1905
+ )
1906
+
1907
+
1908
+ class DeclarativeSource2(BaseModel):
1909
+ class Config:
1910
+ extra = Extra.forbid
1911
+
1912
+ type: Literal["DeclarativeSource"]
1913
+ check: Union[CheckStream, CheckDynamicStream]
1914
+ streams: Optional[List[Union[DeclarativeStream, StateDelegatingStream]]] = None
1915
+ dynamic_streams: List[DynamicDeclarativeStream]
1916
+ version: str = Field(
1917
+ ...,
1918
+ description="The version of the Airbyte CDK used to build and test the source.",
1919
+ )
1920
+ schemas: Optional[Schemas] = None
1921
+ definitions: Optional[Dict[str, Any]] = None
1922
+ spec: Optional[Spec] = None
1923
+ concurrency_level: Optional[ConcurrencyLevel] = None
1924
+ api_budget: Optional[HTTPAPIBudget] = None
1925
+ max_concurrent_async_job_count: Optional[int] = Field(
1926
+ None,
1927
+ description="Maximum number of concurrent asynchronous jobs to run. This property is only relevant for sources/streams that support asynchronous job execution through the AsyncRetriever (e.g. a report-based stream that initiates a job, polls the job status, and then fetches the job results). This is often set by the API's maximum number of concurrent jobs on the account level. Refer to the API's documentation for this information.",
1928
+ title="Maximum Concurrent Asynchronous Jobs",
1929
+ )
1930
+ metadata: Optional[Dict[str, Any]] = Field(
1931
+ None,
1932
+ description="For internal Airbyte use only - DO NOT modify manually. Used by consumers of declarative manifests for storing related metadata.",
1933
+ )
1934
+ description: Optional[str] = Field(
1935
+ None,
1936
+ description="A description of the connector. It will be presented on the Source documentation page.",
1937
+ )
1938
+
1939
+
1940
+ class DeclarativeSource(BaseModel):
1941
+ class Config:
1942
+ extra = Extra.forbid
1943
+
1944
+ __root__: Union[DeclarativeSource1, DeclarativeSource2] = Field(
1945
+ ...,
1946
+ description="An API source that extracts data according to its declarative components.",
1947
+ title="DeclarativeSource",
1948
+ )
1949
+
1950
+
1951
+ class SelectiveAuthenticator(BaseModel):
1952
+ class Config:
1953
+ extra = Extra.allow
1954
+
1955
+ type: Literal["SelectiveAuthenticator"]
1956
+ authenticator_selection_path: List[str] = Field(
1957
+ ...,
1958
+ description="Path of the field in config with selected authenticator name",
1959
+ examples=[["auth"], ["auth", "type"]],
1960
+ title="Authenticator Selection Path",
1961
+ )
1962
+ authenticators: Dict[
1963
+ str,
1964
+ Union[
1965
+ ApiKeyAuthenticator,
1966
+ BasicHttpAuthenticator,
1967
+ BearerAuthenticator,
1968
+ CustomAuthenticator,
1969
+ OAuthAuthenticator,
1970
+ JwtAuthenticator,
1971
+ NoAuth,
1972
+ SessionTokenAuthenticator,
1973
+ LegacySessionTokenAuthenticator,
1974
+ ],
1975
+ ] = Field(
1976
+ ...,
1977
+ description="Authenticators to select from.",
1978
+ examples=[
1979
+ {
1980
+ "authenticators": {
1981
+ "token": "#/definitions/ApiKeyAuthenticator",
1982
+ "oauth": "#/definitions/OAuthAuthenticator",
1983
+ "jwt": "#/definitions/JwtAuthenticator",
1984
+ }
1985
+ }
1986
+ ],
1987
+ title="Authenticators",
1988
+ )
1989
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
1990
+
1991
+
1992
+ class FileUploader(BaseModel):
1993
+ type: Literal["FileUploader"]
1994
+ requester: Union[CustomRequester, HttpRequester] = Field(
1995
+ ...,
1996
+ description="Requester component that describes how to prepare HTTP requests to send to the source API.",
1997
+ )
1998
+ download_target_extractor: Union[CustomRecordExtractor, DpathExtractor] = Field(
1999
+ ...,
2000
+ description="Responsible for fetching the url where the file is located. This is applied on each records and not on the HTTP response",
2001
+ )
2002
+ file_extractor: Optional[Union[CustomRecordExtractor, DpathExtractor]] = Field(
2003
+ None,
2004
+ description="Responsible for fetching the content of the file. If not defined, the assumption is that the whole response body is the file content",
2005
+ )
2006
+ filename_extractor: Optional[str] = Field(
2007
+ None,
2008
+ description="Defines the name to store the file. Stream name is automatically added to the file path. File unique ID can be used to avoid overwriting files. Random UUID will be used if the extractor is not provided.",
2009
+ examples=[
2010
+ "{{ record.id }}/{{ record.file_name }}/",
2011
+ "{{ record.id }}_{{ record.file_name }}/",
2012
+ ],
2013
+ )
2014
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2015
+
2016
+
2017
+ class DeclarativeStream(BaseModel):
2018
+ class Config:
2019
+ extra = Extra.allow
2020
+
2021
+ type: Literal["DeclarativeStream"]
2022
+ retriever: Union[AsyncRetriever, CustomRetriever, SimpleRetriever] = Field(
2023
+ ...,
2024
+ description="Component used to coordinate how records are extracted across stream slices and request pages.",
2025
+ title="Retriever",
2026
+ )
2027
+ incremental_sync: Optional[
2028
+ Union[CustomIncrementalSync, DatetimeBasedCursor, IncrementingCountCursor]
2029
+ ] = Field(
2030
+ None,
2031
+ description="Component used to fetch data incrementally based on a time field in the data.",
2032
+ title="Incremental Sync",
2033
+ )
2034
+ name: Optional[str] = Field("", description="The stream name.", example=["Users"], title="Name")
2035
+ primary_key: Optional[PrimaryKey] = Field(
2036
+ "", description="The primary key of the stream.", title="Primary Key"
2037
+ )
2038
+ schema_loader: Optional[
2039
+ Union[
2040
+ DynamicSchemaLoader,
2041
+ InlineSchemaLoader,
2042
+ JsonFileSchemaLoader,
2043
+ CustomSchemaLoader,
2044
+ ]
2045
+ ] = Field(
2046
+ None,
2047
+ description="Component used to retrieve the schema for the current stream.",
2048
+ title="Schema Loader",
2049
+ )
2050
+ transformations: Optional[
2051
+ List[
2052
+ Union[
2053
+ AddFields,
2054
+ CustomTransformation,
2055
+ RemoveFields,
2056
+ KeysToLower,
2057
+ KeysToSnakeCase,
2058
+ FlattenFields,
2059
+ DpathFlattenFields,
2060
+ KeysReplace,
2061
+ ]
2062
+ ]
2063
+ ] = Field(
2064
+ None,
2065
+ description="A list of transformations to be applied to each output record.",
2066
+ title="Transformations",
2067
+ )
2068
+ state_migrations: Optional[
2069
+ List[Union[LegacyToPerPartitionStateMigration, CustomStateMigration]]
2070
+ ] = Field(
2071
+ [],
2072
+ description="Array of state migrations to be applied on the input state",
2073
+ title="State Migrations",
2074
+ )
2075
+ file_uploader: Optional[FileUploader] = Field(
2076
+ None,
2077
+ description="(experimental) Describes how to fetch a file",
2078
+ title="File Uploader",
2079
+ )
2080
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2081
+
2082
+
2083
+ class SessionTokenAuthenticator(BaseModel):
2084
+ type: Literal["SessionTokenAuthenticator"]
2085
+ login_requester: HttpRequester = Field(
2086
+ ...,
2087
+ description="Description of the request to perform to obtain a session token to perform data requests. The response body is expected to be a JSON object with a session token property.",
2088
+ examples=[
2089
+ {
2090
+ "type": "HttpRequester",
2091
+ "url_base": "https://my_api.com",
2092
+ "path": "/login",
2093
+ "authenticator": {
2094
+ "type": "BasicHttpAuthenticator",
2095
+ "username": "{{ config.username }}",
2096
+ "password": "{{ config.password }}",
2097
+ },
2098
+ }
2099
+ ],
2100
+ title="Login Requester",
2101
+ )
2102
+ session_token_path: List[str] = Field(
2103
+ ...,
2104
+ description="The path in the response body returned from the login requester to the session token.",
2105
+ examples=[["access_token"], ["result", "token"]],
2106
+ title="Session Token Path",
2107
+ )
2108
+ expiration_duration: Optional[str] = Field(
2109
+ None,
2110
+ description="The duration in ISO 8601 duration notation after which the session token expires, starting from the time it was obtained. Omitting it will result in the session token being refreshed for every request.",
2111
+ examples=["PT1H", "P1D"],
2112
+ title="Expiration Duration",
2113
+ )
2114
+ request_authentication: Union[
2115
+ SessionTokenRequestApiKeyAuthenticator, SessionTokenRequestBearerAuthenticator
2116
+ ] = Field(
2117
+ ...,
2118
+ description="Authentication method to use for requests sent to the API, specifying how to inject the session token.",
2119
+ title="Data Request Authentication",
2120
+ )
2121
+ decoder: Optional[Union[JsonDecoder, XmlDecoder]] = Field(
2122
+ None, description="Component used to decode the response.", title="Decoder"
2123
+ )
2124
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2125
+
2126
+
2127
+ class HttpRequester(BaseModel):
2128
+ type: Literal["HttpRequester"]
2129
+ url_base: str = Field(
2130
+ ...,
2131
+ description="Base URL of the API source. Do not put sensitive information (e.g. API tokens) into this field - Use the Authentication component for this.",
2132
+ examples=[
2133
+ "https://connect.squareup.com/v2",
2134
+ "{{ config['base_url'] or 'https://app.posthog.com'}}/api",
2135
+ "https://connect.squareup.com/v2/quotes/{{ stream_partition['id'] }}/quote_line_groups",
2136
+ "https://example.com/api/v1/resource/{{ next_page_token['id'] }}",
2137
+ ],
2138
+ title="API Base URL",
2139
+ )
2140
+ path: Optional[str] = Field(
2141
+ None,
2142
+ description="Path the specific API endpoint that this stream represents. Do not put sensitive information (e.g. API tokens) into this field - Use the Authentication component for this.",
2143
+ examples=[
2144
+ "/products",
2145
+ "/quotes/{{ stream_partition['id'] }}/quote_line_groups",
2146
+ "/trades/{{ config['symbol_id'] }}/history",
2147
+ ],
2148
+ title="URL Path",
2149
+ )
2150
+ authenticator: Optional[
2151
+ Union[
2152
+ ApiKeyAuthenticator,
2153
+ BasicHttpAuthenticator,
2154
+ BearerAuthenticator,
2155
+ CustomAuthenticator,
2156
+ OAuthAuthenticator,
2157
+ JwtAuthenticator,
2158
+ NoAuth,
2159
+ SessionTokenAuthenticator,
2160
+ LegacySessionTokenAuthenticator,
2161
+ SelectiveAuthenticator,
2162
+ ]
2163
+ ] = Field(
2164
+ None,
2165
+ description="Authentication method to use for requests sent to the API.",
2166
+ title="Authenticator",
2167
+ )
2168
+ error_handler: Optional[
2169
+ Union[DefaultErrorHandler, CustomErrorHandler, CompositeErrorHandler]
2170
+ ] = Field(
2171
+ None,
2172
+ description="Error handler component that defines how to handle errors.",
2173
+ title="Error Handler",
2174
+ )
2175
+ http_method: Optional[HttpMethod] = Field(
2176
+ HttpMethod.GET,
2177
+ description="The HTTP method used to fetch data from the source (can be GET or POST).",
2178
+ examples=["GET", "POST"],
2179
+ title="HTTP Method",
2180
+ )
2181
+ request_body_data: Optional[Union[str, Dict[str, str]]] = Field(
2182
+ None,
2183
+ description="Specifies how to populate the body of the request with a non-JSON payload. Plain text will be sent as is, whereas objects will be converted to a urlencoded form.",
2184
+ examples=[
2185
+ '[{"clause": {"type": "timestamp", "operator": 10, "parameters":\n [{"value": {{ stream_interval[\'start_time\'] | int * 1000 }} }]\n }, "orderBy": 1, "columnName": "Timestamp"}]/\n'
2186
+ ],
2187
+ title="Request Body Payload (Non-JSON)",
2188
+ )
2189
+ request_body_json: Optional[Union[str, Dict[str, Any]]] = Field(
2190
+ None,
2191
+ description="Specifies how to populate the body of the request with a JSON payload. Can contain nested objects.",
2192
+ examples=[
2193
+ {"sort_order": "ASC", "sort_field": "CREATED_AT"},
2194
+ {"key": "{{ config['value'] }}"},
2195
+ {"sort": {"field": "updated_at", "order": "ascending"}},
2196
+ ],
2197
+ title="Request Body JSON Payload",
2198
+ )
2199
+ request_headers: Optional[Union[str, Dict[str, str]]] = Field(
2200
+ None,
2201
+ description="Return any non-auth headers. Authentication headers will overwrite any overlapping headers returned from this method.",
2202
+ examples=[{"Output-Format": "JSON"}, {"Version": "{{ config['version'] }}"}],
2203
+ title="Request Headers",
2204
+ )
2205
+ request_parameters: Optional[Union[str, Dict[str, str]]] = Field(
2206
+ None,
2207
+ description="Specifies the query parameters that should be set on an outgoing HTTP request given the inputs.",
2208
+ examples=[
2209
+ {"unit": "day"},
2210
+ {
2211
+ "query": 'last_event_time BETWEEN TIMESTAMP "{{ stream_interval.start_time }}" AND TIMESTAMP "{{ stream_interval.end_time }}"'
2212
+ },
2213
+ {"searchIn": "{{ ','.join(config.get('search_in', [])) }}"},
2214
+ {"sort_by[asc]": "updated_at"},
2215
+ ],
2216
+ title="Query Parameters",
2217
+ )
2218
+ use_cache: Optional[bool] = Field(
2219
+ False,
2220
+ description="Enables stream requests caching. This field is automatically set by the CDK.",
2221
+ title="Use Cache",
2222
+ )
2223
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2224
+
2225
+
2226
+ class DynamicSchemaLoader(BaseModel):
2227
+ type: Literal["DynamicSchemaLoader"]
2228
+ retriever: Union[AsyncRetriever, CustomRetriever, SimpleRetriever] = Field(
2229
+ ...,
2230
+ description="Component used to coordinate how records are extracted across stream slices and request pages.",
2231
+ title="Retriever",
2232
+ )
2233
+ schema_transformations: Optional[
2234
+ List[
2235
+ Union[
2236
+ AddFields,
2237
+ CustomTransformation,
2238
+ RemoveFields,
2239
+ KeysToLower,
2240
+ KeysToSnakeCase,
2241
+ FlattenFields,
2242
+ DpathFlattenFields,
2243
+ KeysReplace,
2244
+ ]
2245
+ ]
2246
+ ] = Field(
2247
+ None,
2248
+ description="A list of transformations to be applied to the schema.",
2249
+ title="Schema Transformations",
2250
+ )
2251
+ schema_type_identifier: SchemaTypeIdentifier
2252
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2253
+
2254
+
2255
+ class ParentStreamConfig(BaseModel):
2256
+ type: Literal["ParentStreamConfig"]
2257
+ lazy_read_pointer: Optional[List[str]] = Field(
2258
+ [],
2259
+ description="If set, this will enable lazy reading, using the initial read of parent records to extract child records.",
2260
+ title="Lazy Read Pointer",
2261
+ )
2262
+ parent_key: str = Field(
2263
+ ...,
2264
+ description="The primary key of records from the parent stream that will be used during the retrieval of records for the current substream. This parent identifier field is typically a characteristic of the child records being extracted from the source API.",
2265
+ examples=["id", "{{ config['parent_record_id'] }}"],
2266
+ title="Parent Key",
2267
+ )
2268
+ stream: Union[DeclarativeStream, StateDelegatingStream] = Field(
2269
+ ..., description="Reference to the parent stream.", title="Parent Stream"
2270
+ )
2271
+ partition_field: str = Field(
2272
+ ...,
2273
+ description="While iterating over parent records during a sync, the parent_key value can be referenced by using this field.",
2274
+ examples=["parent_id", "{{ config['parent_partition_field'] }}"],
2275
+ title="Current Parent Key Value Identifier",
2276
+ )
2277
+ request_option: Optional[RequestOption] = Field(
2278
+ None,
2279
+ description="A request option describing where the parent key value should be injected into and under what field name if applicable.",
2280
+ title="Request Option",
2281
+ )
2282
+ incremental_dependency: Optional[bool] = Field(
2283
+ False,
2284
+ description="Indicates whether the parent stream should be read incrementally based on updates in the child stream.",
2285
+ title="Incremental Dependency",
2286
+ )
2287
+ extra_fields: Optional[List[List[str]]] = Field(
2288
+ None,
2289
+ description="Array of field paths to include as additional fields in the stream slice. Each path is an array of strings representing keys to access fields in the respective parent record. Accessible via `stream_slice.extra_fields`. Missing fields are set to `None`.",
2290
+ title="Extra Fields",
2291
+ )
2292
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2293
+
2294
+
2295
+ class StateDelegatingStream(BaseModel):
2296
+ type: Literal["StateDelegatingStream"]
2297
+ name: str = Field(..., description="The stream name.", example=["Users"], title="Name")
2298
+ full_refresh_stream: DeclarativeStream = Field(
2299
+ ...,
2300
+ description="Component used to coordinate how records are extracted across stream slices and request pages when the state is empty or not provided.",
2301
+ title="Retriever",
2302
+ )
2303
+ incremental_stream: DeclarativeStream = Field(
2304
+ ...,
2305
+ description="Component used to coordinate how records are extracted across stream slices and request pages when the state provided.",
2306
+ title="Retriever",
2307
+ )
2308
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2309
+
2310
+
2311
+ class SimpleRetriever(BaseModel):
2312
+ type: Literal["SimpleRetriever"]
2313
+ record_selector: RecordSelector = Field(
2314
+ ...,
2315
+ description="Component that describes how to extract records from a HTTP response.",
2316
+ )
2317
+ requester: Union[CustomRequester, HttpRequester] = Field(
2318
+ ...,
2319
+ description="Requester component that describes how to prepare HTTP requests to send to the source API.",
2320
+ )
2321
+ paginator: Optional[Union[DefaultPaginator, NoPagination]] = Field(
2322
+ None,
2323
+ description="Paginator component that describes how to navigate through the API's pages.",
2324
+ )
2325
+ ignore_stream_slicer_parameters_on_paginated_requests: Optional[bool] = Field(
2326
+ False,
2327
+ description="If true, the partition router and incremental request options will be ignored when paginating requests. Request options set directly on the requester will not be ignored.",
2328
+ )
2329
+ partition_router: Optional[
2330
+ Union[
2331
+ CustomPartitionRouter,
2332
+ ListPartitionRouter,
2333
+ SubstreamPartitionRouter,
2334
+ List[Union[CustomPartitionRouter, ListPartitionRouter, SubstreamPartitionRouter]],
2335
+ ]
2336
+ ] = Field(
2337
+ [],
2338
+ description="PartitionRouter component that describes how to partition the stream, enabling incremental syncs and checkpointing.",
2339
+ title="Partition Router",
2340
+ )
2341
+ decoder: Optional[
2342
+ Union[
2343
+ CustomDecoder,
2344
+ CsvDecoder,
2345
+ GzipDecoder,
2346
+ JsonDecoder,
2347
+ JsonlDecoder,
2348
+ IterableDecoder,
2349
+ XmlDecoder,
2350
+ ZipfileDecoder,
2351
+ ]
2352
+ ] = Field(
2353
+ None,
2354
+ description="Component decoding the response so records can be extracted.",
2355
+ title="Decoder",
2356
+ )
2357
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2358
+
2359
+
2360
+ class AsyncRetriever(BaseModel):
2361
+ type: Literal["AsyncRetriever"]
2362
+ record_selector: RecordSelector = Field(
2363
+ ...,
2364
+ description="Component that describes how to extract records from a HTTP response.",
2365
+ )
2366
+ status_mapping: AsyncJobStatusMap = Field(
2367
+ ..., description="Async Job Status to Airbyte CDK Async Job Status mapping."
2368
+ )
2369
+ status_extractor: Union[CustomRecordExtractor, DpathExtractor] = Field(
2370
+ ..., description="Responsible for fetching the actual status of the async job."
2371
+ )
2372
+ download_target_extractor: Union[CustomRecordExtractor, DpathExtractor] = Field(
2373
+ ...,
2374
+ description="Responsible for fetching the final result `urls` provided by the completed / finished / ready async job.",
2375
+ )
2376
+ download_extractor: Optional[
2377
+ Union[CustomRecordExtractor, DpathExtractor, ResponseToFileExtractor]
2378
+ ] = Field(None, description="Responsible for fetching the records from provided urls.")
2379
+ creation_requester: Union[CustomRequester, HttpRequester] = Field(
2380
+ ...,
2381
+ description="Requester component that describes how to prepare HTTP requests to send to the source API to create the async server-side job.",
2382
+ )
2383
+ polling_requester: Union[CustomRequester, HttpRequester] = Field(
2384
+ ...,
2385
+ description="Requester component that describes how to prepare HTTP requests to send to the source API to fetch the status of the running async job.",
2386
+ )
2387
+ polling_job_timeout: Optional[Union[int, str]] = Field(
2388
+ None,
2389
+ description="The time in minutes after which the single Async Job should be considered as Timed Out.",
2390
+ )
2391
+ download_target_requester: Optional[Union[CustomRequester, HttpRequester]] = Field(
2392
+ None,
2393
+ description="Requester component that describes how to prepare HTTP requests to send to the source API to extract the url from polling response by the completed async job.",
2394
+ )
2395
+ download_requester: Union[CustomRequester, HttpRequester] = Field(
2396
+ ...,
2397
+ description="Requester component that describes how to prepare HTTP requests to send to the source API to download the data provided by the completed async job.",
2398
+ )
2399
+ download_paginator: Optional[Union[DefaultPaginator, NoPagination]] = Field(
2400
+ None,
2401
+ description="Paginator component that describes how to navigate through the API's pages during download.",
2402
+ )
2403
+ abort_requester: Optional[Union[CustomRequester, HttpRequester]] = Field(
2404
+ None,
2405
+ description="Requester component that describes how to prepare HTTP requests to send to the source API to abort a job once it is timed out from the source's perspective.",
2406
+ )
2407
+ delete_requester: Optional[Union[CustomRequester, HttpRequester]] = Field(
2408
+ None,
2409
+ description="Requester component that describes how to prepare HTTP requests to send to the source API to delete a job once the records are extracted.",
2410
+ )
2411
+ partition_router: Optional[
2412
+ Union[
2413
+ CustomPartitionRouter,
2414
+ ListPartitionRouter,
2415
+ SubstreamPartitionRouter,
2416
+ List[Union[CustomPartitionRouter, ListPartitionRouter, SubstreamPartitionRouter]],
2417
+ ]
2418
+ ] = Field(
2419
+ [],
2420
+ description="PartitionRouter component that describes how to partition the stream, enabling incremental syncs and checkpointing.",
2421
+ title="Partition Router",
2422
+ )
2423
+ decoder: Optional[
2424
+ Union[
2425
+ CustomDecoder,
2426
+ CsvDecoder,
2427
+ GzipDecoder,
2428
+ JsonDecoder,
2429
+ JsonlDecoder,
2430
+ IterableDecoder,
2431
+ XmlDecoder,
2432
+ ZipfileDecoder,
2433
+ ]
2434
+ ] = Field(
2435
+ None,
2436
+ description="Component decoding the response so records can be extracted.",
2437
+ title="Decoder",
2438
+ )
2439
+ download_decoder: Optional[
2440
+ Union[
2441
+ CustomDecoder,
2442
+ CsvDecoder,
2443
+ GzipDecoder,
2444
+ JsonDecoder,
2445
+ JsonlDecoder,
2446
+ IterableDecoder,
2447
+ XmlDecoder,
2448
+ ZipfileDecoder,
2449
+ ]
2450
+ ] = Field(
2451
+ None,
2452
+ description="Component decoding the download response so records can be extracted.",
2453
+ title="Download Decoder",
2454
+ )
2455
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2456
+
2457
+
2458
+ class SubstreamPartitionRouter(BaseModel):
2459
+ type: Literal["SubstreamPartitionRouter"]
2460
+ parent_stream_configs: List[ParentStreamConfig] = Field(
2461
+ ...,
2462
+ description="Specifies which parent streams are being iterated over and how parent records should be used to partition the child stream data set.",
2463
+ title="Parent Stream Configs",
2464
+ )
2465
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2466
+
2467
+
2468
+ class HttpComponentsResolver(BaseModel):
2469
+ type: Literal["HttpComponentsResolver"]
2470
+ retriever: Union[AsyncRetriever, CustomRetriever, SimpleRetriever] = Field(
2471
+ ...,
2472
+ description="Component used to coordinate how records are extracted across stream slices and request pages.",
2473
+ title="Retriever",
2474
+ )
2475
+ components_mapping: List[ComponentMappingDefinition]
2476
+ parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
2477
+
2478
+
2479
+ class DynamicDeclarativeStream(BaseModel):
2480
+ type: Literal["DynamicDeclarativeStream"]
2481
+ stream_template: DeclarativeStream = Field(
2482
+ ..., description="Reference to the stream template.", title="Stream Template"
2483
+ )
2484
+ components_resolver: Union[HttpComponentsResolver, ConfigComponentsResolver] = Field(
2485
+ ...,
2486
+ description="Component resolve and populates stream templates with components values.",
2487
+ title="Components Resolver",
2488
+ )
2489
+
2490
+
2491
+ ComplexFieldType.update_forward_refs()
2492
+ GzipDecoder.update_forward_refs()
2493
+ CompositeErrorHandler.update_forward_refs()
2494
+ DeclarativeSource1.update_forward_refs()
2495
+ DeclarativeSource2.update_forward_refs()
2496
+ SelectiveAuthenticator.update_forward_refs()
2497
+ FileUploader.update_forward_refs()
2498
+ DeclarativeStream.update_forward_refs()
2499
+ SessionTokenAuthenticator.update_forward_refs()
2500
+ DynamicSchemaLoader.update_forward_refs()
2501
+ ParentStreamConfig.update_forward_refs()
2502
+ SimpleRetriever.update_forward_refs()
2503
+ AsyncRetriever.update_forward_refs()