structifyai 1.158.0__py3-none-any.whl → 1.176.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. structify/_base_client.py +140 -11
  2. structify/_client.py +1116 -253
  3. structify/_models.py +16 -1
  4. structify/_streaming.py +12 -10
  5. structify/_types.py +12 -2
  6. structify/_version.py +1 -1
  7. structify/lib/__init__.py +5 -0
  8. structify/lib/cost_confirmation.py +63 -0
  9. structify/pagination.py +63 -1
  10. structify/resources/__init__.py +57 -27
  11. structify/resources/admin/__init__.py +26 -40
  12. structify/resources/admin/admin.py +39 -71
  13. structify/resources/admin/chat_templates.py +382 -0
  14. structify/resources/admin/jobs.py +76 -3
  15. structify/resources/admin/sandbox.py +184 -0
  16. structify/resources/admin/teams.py +88 -0
  17. structify/resources/admin/users.py +28 -238
  18. structify/resources/chat.py +232 -0
  19. structify/resources/connector_catalog/__init__.py +33 -0
  20. structify/resources/connector_catalog/admin.py +1510 -0
  21. structify/resources/connector_catalog/connector_catalog.py +394 -0
  22. structify/resources/connectors/__init__.py +33 -0
  23. structify/resources/{connectors.py → connectors/connectors.py} +1155 -325
  24. structify/resources/connectors/type_snippets.py +169 -0
  25. structify/resources/datasets/datasets.py +0 -4
  26. structify/resources/documents.py +1 -123
  27. structify/resources/external.py +35 -2
  28. structify/resources/jobs.py +19 -336
  29. structify/resources/nango.py +234 -0
  30. structify/resources/polars.py +225 -103
  31. structify/resources/sandbox.py +13 -110
  32. structify/resources/scrape.py +0 -16
  33. structify/resources/sessions.py +241 -153
  34. structify/resources/slack.py +1 -151
  35. structify/resources/structure.py +120 -48
  36. structify/resources/teams.py +96 -0
  37. structify/resources/user/__init__.py +14 -0
  38. structify/resources/user/api_keys.py +380 -0
  39. structify/resources/user/user.py +209 -2
  40. structify/resources/whitelabel.py +294 -187
  41. structify/resources/whitelabel_service.py +222 -0
  42. structify/resources/{report.py → wiki.py} +237 -210
  43. structify/resources/workflow_schedule.py +4 -5
  44. structify/types/__init__.py +67 -36
  45. structify/types/add_member_response.py +35 -4
  46. structify/types/admin/__init__.py +13 -88
  47. structify/types/admin/admin_dataset_return.py +6 -0
  48. structify/types/admin/{user_get_credits_response.py → admin_delete_jobs_response.py} +3 -3
  49. structify/types/admin/admin_list_jobs_response.py +35 -1
  50. structify/types/admin/admin_sandbox.py +38 -0
  51. structify/types/admin/chat_template_create_params.py +21 -0
  52. structify/types/admin/{human_llm_start_next_job_params.py → chat_template_list_params.py} +3 -3
  53. structify/types/admin/{human_llm_get_jobs_response.py → chat_template_list_response.py} +3 -3
  54. structify/types/admin/chat_template_update_params.py +22 -0
  55. structify/types/admin/{user_add_credits_response.py → expire_grants_response.py} +5 -3
  56. structify/types/admin/impersonate_response.py +17 -0
  57. structify/types/admin/{next_action_get_batched_training_data_params.py → job_delete_params.py} +2 -2
  58. structify/types/admin/{user_get_credits_params.py → sandbox_list_params.py} +4 -4
  59. structify/types/admin/sandbox_type.py +7 -0
  60. structify/types/admin/{user_set_credits_params.py → team_expire_grants_params.py} +4 -4
  61. structify/types/admin/user.py +16 -0
  62. structify/types/admin/user_create_params.py +1 -0
  63. structify/types/admin/{training_dataset_delete_params.py → user_impersonate_params.py} +3 -3
  64. structify/types/admin/user_list_response.py +14 -4
  65. structify/types/admin_grant_access_response.py +2 -0
  66. structify/types/{slack_user_mapping_response.py → admin_issue_found_response.py} +3 -5
  67. structify/types/chat_add_git_commit_response.py +2 -0
  68. structify/types/{admin/human_llm_get_next_step_params.py → chat_admin_issue_found_params.py} +4 -4
  69. structify/types/chat_create_session_params.py +7 -0
  70. structify/types/chat_dependency.py +17 -0
  71. structify/types/chat_event.py +51 -239
  72. structify/types/chat_get_git_commit_response.py +2 -0
  73. structify/types/chat_get_session_timeline_response.py +31 -1
  74. structify/types/{job_get_steps_response.py → chat_list_templates_response.py} +3 -3
  75. structify/types/chat_prompt.py +2 -0
  76. structify/types/chat_revert_to_commit_response.py +2 -0
  77. structify/types/chat_session.py +14 -0
  78. structify/types/chat_session_with_messages.py +33 -1
  79. structify/types/chat_template.py +31 -0
  80. structify/types/chat_update_session_params.py +2 -0
  81. structify/types/code_generate_code_params.py +7 -0
  82. structify/types/connector.py +16 -25
  83. structify/types/connector_auth_method.py +29 -0
  84. structify/types/connector_auth_method_with_fields.py +15 -0
  85. structify/types/connector_catalog/__init__.py +32 -0
  86. structify/types/connector_catalog/admin_batch_create_credential_fields_params.py +14 -0
  87. structify/types/connector_catalog/admin_batch_create_credential_fields_response.py +10 -0
  88. structify/types/connector_catalog/admin_batch_create_scopes_params.py +14 -0
  89. structify/types/connector_catalog/admin_create_auth_method_params.py +22 -0
  90. structify/types/connector_catalog/admin_create_catalog_params.py +22 -0
  91. structify/types/connector_catalog/admin_create_credential_field_params.py +28 -0
  92. structify/types/connector_catalog/admin_create_scope_params.py +19 -0
  93. structify/types/connector_catalog/admin_list_nango_pending_response.py +10 -0
  94. structify/types/{admin/training_dataset_get_datum_info_params.py → connector_catalog/admin_list_scopes_params.py} +3 -3
  95. structify/types/connector_catalog/admin_update_auth_method_params.py +16 -0
  96. structify/types/connector_catalog/admin_update_catalog_params.py +20 -0
  97. structify/types/connector_catalog/admin_update_credential_field_params.py +26 -0
  98. structify/types/connector_catalog/admin_update_scope_params.py +18 -0
  99. structify/types/connector_catalog/admin_upload_logo_params.py +13 -0
  100. structify/types/connector_catalog/batch_create_scopes_response.py +12 -0
  101. structify/types/connector_catalog/connector_auth_method_scope.py +25 -0
  102. structify/types/connector_catalog/connector_catalog.py +26 -0
  103. structify/types/connector_catalog/create_credential_field_request_param.py +28 -0
  104. structify/types/connector_catalog/create_scope_request_param.py +19 -0
  105. structify/types/connector_catalog/list_scopes_response.py +12 -0
  106. structify/types/connector_catalog/pending_nango_integration.py +17 -0
  107. structify/types/{admin/user_set_credits_response.py → connector_catalog/upload_logo_response.py} +3 -3
  108. structify/types/connector_catalog_list_params.py +20 -0
  109. structify/types/connector_catalog_list_response.py +22 -0
  110. structify/types/connector_catalog_with_methods.py +15 -0
  111. structify/types/connector_category.py +7 -0
  112. structify/types/connector_create_params.py +11 -25
  113. structify/types/connector_credential_field.py +34 -0
  114. structify/types/connector_delete_schema_object_params.py +35 -0
  115. structify/types/connector_explore_params.py +19 -0
  116. structify/types/connector_explorer_chat.py +9 -84
  117. structify/types/connector_get_clarification_requests_response.py +36 -0
  118. structify/types/connector_get_response.py +2 -0
  119. structify/types/connector_list_with_snippets_params.py +12 -0
  120. structify/types/connector_list_with_snippets_response.py +10 -0
  121. structify/types/connector_search_tables_params.py +15 -0
  122. structify/types/connector_search_tables_response.py +160 -0
  123. structify/types/connector_store_response.py +21 -0
  124. structify/types/connector_summaries_params.py +15 -0
  125. structify/types/connector_summaries_response.py +10 -0
  126. structify/types/connector_summary.py +16 -0
  127. structify/types/connector_table_info.py +15 -0
  128. structify/types/connector_update_column_params.py +12 -0
  129. structify/types/connector_update_params.py +4 -25
  130. structify/types/connector_update_table_params.py +14 -0
  131. structify/types/connector_with_secrets.py +2 -0
  132. structify/types/connector_with_snippets.py +11 -0
  133. structify/types/connectors/__init__.py +6 -0
  134. structify/types/connectors/snippet.py +20 -0
  135. structify/types/connectors/type_snippet_upsert_params.py +12 -0
  136. structify/types/create_chat_session_response.py +2 -0
  137. structify/types/dataset_create_params.py +0 -2
  138. structify/types/dataset_descriptor.py +6 -0
  139. structify/types/dataset_descriptor_param.py +6 -0
  140. structify/types/dataset_get_response.py +6 -0
  141. structify/types/dataset_list_response.py +6 -0
  142. structify/types/dataset_view_table_response.py +3 -1
  143. structify/types/delete_chat_session_response.py +2 -0
  144. structify/types/delete_schema_object_request_param.py +35 -0
  145. structify/types/delete_schema_object_response.py +13 -0
  146. structify/types/edge_spec_param.py +13 -0
  147. structify/types/entity_get_source_entities_response.py +0 -2
  148. structify/types/entity_list_jobs_response.py +3 -3
  149. structify/types/entity_view_response.py +0 -2
  150. structify/types/estimate_cost_response.py +9 -0
  151. structify/types/exploration_phase_id.py +79 -0
  152. structify/types/finalize_dag_response.py +11 -0
  153. structify/types/get_chat_session_response.py +14 -6
  154. structify/types/get_dependencies_response.py +15 -0
  155. structify/types/get_job_events_response.py +20 -0
  156. structify/types/get_node_response.py +10 -0
  157. structify/types/job_cancel_response.py +3 -3
  158. structify/types/job_event_body.py +108 -1
  159. structify/types/job_get_source_entities_response.py +0 -2
  160. structify/types/job_list_params.py +1 -1
  161. structify/types/job_list_response.py +35 -1
  162. structify/types/knowledge_graph.py +6 -0
  163. structify/types/knowledge_graph_param.py +6 -0
  164. structify/types/list_chat_sessions_response.py +2 -0
  165. structify/types/list_collaborators_response.py +4 -0
  166. structify/types/list_tables_response.py +12 -0
  167. structify/types/llm_information_store.py +62 -28
  168. structify/types/merge_config.py +2 -0
  169. structify/types/merge_config_param.py +2 -0
  170. structify/types/message.py +2 -0
  171. structify/types/nango_create_session_params.py +21 -0
  172. structify/types/nango_create_session_response.py +15 -0
  173. structify/types/nango_list_integrations_response.py +28 -0
  174. structify/types/{session_create_node_params.py → node_spec_param.py} +4 -4
  175. structify/types/refresh_session_response.py +15 -0
  176. structify/types/sandbox.py +8 -2
  177. structify/types/sandbox_get_params.py +2 -1
  178. structify/types/scrape_list_params.py +1 -22
  179. structify/types/scrape_list_response.py +2 -0
  180. structify/types/scrape_scrape_params.py +1 -14
  181. structify/types/scrape_scrape_response.py +2 -0
  182. structify/types/select_team_response.py +3 -1
  183. structify/types/{connector_approve_version_params.py → session_confirm_node_params.py} +3 -3
  184. structify/types/session_finalize_dag_params.py +20 -0
  185. structify/types/session_get_events_response.py +2 -0
  186. structify/types/session_request_confirmation_params.py +13 -0
  187. structify/types/session_upload_node_output_data_params.py +3 -0
  188. structify/types/slack_event_payload_param.py +18 -2
  189. structify/types/slack_events_params.py +18 -2
  190. structify/types/source_list_response.py +0 -2
  191. structify/types/structure_enhance_property_params.py +2 -17
  192. structify/types/structure_enhance_relationship_params.py +2 -17
  193. structify/types/structure_find_relationship_params.py +2 -18
  194. structify/types/structure_pdf_params.py +22 -0
  195. structify/types/structure_pdf_response.py +11 -0
  196. structify/types/structure_run_async_params.py +10 -17
  197. structify/types/table.py +2 -0
  198. structify/types/table_param.py +2 -0
  199. structify/types/team.py +14 -0
  200. structify/types/{admin/training_dataset_remove_datum_params.py → team_create_link_code_params.py} +3 -3
  201. structify/types/team_update_params.py +10 -0
  202. structify/types/team_wiki_page.py +28 -0
  203. structify/types/teams_link_code_response.py +13 -0
  204. structify/types/token_response.py +6 -2
  205. structify/types/tool_invocation.py +468 -0
  206. structify/types/tool_result.py +99 -0
  207. structify/types/update_table_response.py +46 -0
  208. structify/types/usage_group_key.py +14 -1
  209. structify/types/user/__init__.py +4 -0
  210. structify/types/{admin/training_dataset_size_params.py → user/api_key_create_params.py} +5 -5
  211. structify/types/user/api_key_info.py +24 -0
  212. structify/types/user/create_api_key_response.py +12 -0
  213. structify/types/user/list_api_keys_response.py +12 -0
  214. structify/types/user_enrich_params.py +11 -0
  215. structify/types/user_info.py +22 -0
  216. structify/types/user_refresh_params.py +13 -0
  217. structify/types/user_transactions_response.py +5 -5
  218. structify/types/user_update_params.py +32 -12
  219. structify/types/user_usage_response.py +0 -2
  220. structify/types/wiki_connector_reference.py +63 -0
  221. structify/types/wiki_create_params.py +16 -0
  222. structify/types/{admin/training_dataset_list_response.py → wiki_list_response.py} +4 -2
  223. structify/types/wiki_page_with_references.py +12 -0
  224. structify/types/wiki_update_params.py +16 -0
  225. structify/types/workflow_dag.py +2 -0
  226. structify/types/workflow_node_execution_status.py +3 -1
  227. structify/types/workflow_schedule_info.py +2 -2
  228. structify/types/workflow_session_node.py +10 -0
  229. {structifyai-1.158.0.dist-info → structifyai-1.176.1.dist-info}/METADATA +67 -4
  230. structifyai-1.176.1.dist-info/RECORD +496 -0
  231. {structifyai-1.158.0.dist-info → structifyai-1.176.1.dist-info}/licenses/LICENSE +1 -1
  232. structify/resources/admin/human_llm.py +0 -819
  233. structify/resources/admin/next_action.py +0 -656
  234. structify/resources/admin/training_datasets.py +0 -2028
  235. structify/resources/external/__init__.py +0 -61
  236. structify/resources/external/external.py +0 -166
  237. structify/resources/external/news.py +0 -519
  238. structify/resources/external/people.py +0 -998
  239. structify/resources/external/search_api.py +0 -1525
  240. structify/types/active_version_data.py +0 -21
  241. structify/types/active_version_response.py +0 -13
  242. structify/types/admin/action_training_data_entry.py +0 -219
  243. structify/types/admin/action_training_data_response.py +0 -12
  244. structify/types/admin/datum_status.py +0 -19
  245. structify/types/admin/delete_action_training_data_response.py +0 -9
  246. structify/types/admin/human_llm_add_search_for_job_params.py +0 -13
  247. structify/types/admin/human_llm_add_to_dataset_params.py +0 -186
  248. structify/types/admin/human_llm_finish_job_params.py +0 -13
  249. structify/types/admin/human_llm_get_jobs_params.py +0 -12
  250. structify/types/admin/human_llm_get_next_step_response.py +0 -196
  251. structify/types/admin/human_llm_job.py +0 -73
  252. structify/types/admin/human_llm_prelabel_step_response.py +0 -184
  253. structify/types/admin/human_llm_update_step_params.py +0 -186
  254. structify/types/admin/labeling_stats.py +0 -24
  255. structify/types/admin/next_action_add_training_datum_params.py +0 -203
  256. structify/types/admin/next_action_delete_training_data_params.py +0 -12
  257. structify/types/admin/next_action_get_training_data_params.py +0 -25
  258. structify/types/admin/next_action_get_training_datum_params.py +0 -12
  259. structify/types/admin/next_action_label_training_datum_params.py +0 -90
  260. structify/types/admin/step_choices.py +0 -32
  261. structify/types/admin/training_dataset_add_datum_params.py +0 -13
  262. structify/types/admin/training_dataset_add_params.py +0 -12
  263. structify/types/admin/training_dataset_download_datum_params.py +0 -13
  264. structify/types/admin/training_dataset_get_labeller_stats_params.py +0 -23
  265. structify/types/admin/training_dataset_get_labeller_stats_response.py +0 -10
  266. structify/types/admin/training_dataset_get_next_for_labeling_params.py +0 -15
  267. structify/types/admin/training_dataset_get_next_for_qa_params.py +0 -18
  268. structify/types/admin/training_dataset_get_next_suspicious_params.py +0 -23
  269. structify/types/admin/training_dataset_label_datum_params.py +0 -188
  270. structify/types/admin/training_dataset_list_datums_params.py +0 -17
  271. structify/types/admin/training_dataset_list_datums_response.py +0 -33
  272. structify/types/admin/training_dataset_mark_datum_suspicious_params.py +0 -19
  273. structify/types/admin/training_dataset_size_response.py +0 -37
  274. structify/types/admin/training_dataset_suspicious_count_params.py +0 -23
  275. structify/types/admin/training_dataset_suspicious_count_response.py +0 -9
  276. structify/types/admin/training_dataset_switch_dataset_params.py +0 -13
  277. structify/types/admin/training_dataset_update_datum_status_params.py +0 -18
  278. structify/types/admin/training_dataset_upload_labeled_step_params.py +0 -15
  279. structify/types/admin/training_dataset_verify_datum_params.py +0 -17
  280. structify/types/admin/training_datum_response.py +0 -405
  281. structify/types/admin/user_add_credits_params.py +0 -18
  282. structify/types/chat_prompt_param.py +0 -255
  283. structify/types/connector_column_descriptor.py +0 -21
  284. structify/types/connector_relational_database_descriptor.py +0 -13
  285. structify/types/connector_table_descriptor.py +0 -22
  286. structify/types/document_structure_params.py +0 -21
  287. structify/types/document_structure_response.py +0 -8
  288. structify/types/execution_step.py +0 -198
  289. structify/types/external/__init__.py +0 -96
  290. structify/types/external/companies_search_response.py +0 -28
  291. structify/types/external/company_search_result.py +0 -69
  292. structify/types/external/enriched_organization.py +0 -69
  293. structify/types/external/everything_response.py +0 -19
  294. structify/types/external/google_maps_result.py +0 -38
  295. structify/types/external/google_search_response.py +0 -19
  296. structify/types/external/google_search_result.py +0 -21
  297. structify/types/external/job_posting.py +0 -54
  298. structify/types/external/job_postings_response.py +0 -19
  299. structify/types/external/location_coordinates.py +0 -13
  300. structify/types/external/location_response.py +0 -16
  301. structify/types/external/location_result.py +0 -24
  302. structify/types/external/news_article.py +0 -33
  303. structify/types/external/news_everything_params.py +0 -45
  304. structify/types/external/news_source.py +0 -15
  305. structify/types/external/news_source_detail.py +0 -28
  306. structify/types/external/news_sources_params.py +0 -19
  307. structify/types/external/news_top_headlines_params.py +0 -28
  308. structify/types/external/organization_detail.py +0 -87
  309. structify/types/external/people_match_response.py +0 -18
  310. structify/types/external/people_search_response.py +0 -28
  311. structify/types/external/person_companies_search_params.py +0 -63
  312. structify/types/external/person_match.py +0 -60
  313. structify/types/external/person_organization_job_postings_params.py +0 -16
  314. structify/types/external/person_organizations_enrich_params.py +0 -16
  315. structify/types/external/person_people_match_params.py +0 -49
  316. structify/types/external/person_people_search_params.py +0 -57
  317. structify/types/external/person_search_result.py +0 -48
  318. structify/types/external/search_api_google_flights_calendar_params.py +0 -28
  319. structify/types/external/search_api_google_flights_calendar_response.py +0 -8
  320. structify/types/external/search_api_google_flights_location_search_params.py +0 -16
  321. structify/types/external/search_api_google_flights_location_search_response.py +0 -8
  322. structify/types/external/search_api_google_flights_search_params.py +0 -43
  323. structify/types/external/search_api_google_flights_search_response.py +0 -8
  324. structify/types/external/search_api_google_maps_place_details_params.py +0 -16
  325. structify/types/external/search_api_google_maps_place_details_response.py +0 -8
  326. structify/types/external/search_api_google_maps_place_photos_params.py +0 -16
  327. structify/types/external/search_api_google_maps_place_photos_response.py +0 -8
  328. structify/types/external/search_api_google_maps_place_reviews_params.py +0 -19
  329. structify/types/external/search_api_google_maps_place_reviews_response.py +0 -8
  330. structify/types/external/search_api_google_maps_search_params.py +0 -22
  331. structify/types/external/search_api_google_maps_search_response.py +0 -10
  332. structify/types/external/search_api_google_scholar_author_search_params.py +0 -22
  333. structify/types/external/search_api_google_scholar_author_search_response.py +0 -8
  334. structify/types/external/search_api_google_scholar_citations_params.py +0 -22
  335. structify/types/external/search_api_google_scholar_citations_response.py +0 -8
  336. structify/types/external/search_api_google_scholar_search_params.py +0 -28
  337. structify/types/external/search_api_google_scholar_search_response.py +0 -8
  338. structify/types/external/search_api_google_search_params.py +0 -25
  339. structify/types/external/search_api_location_search_params.py +0 -22
  340. structify/types/external/sources_response.py +0 -16
  341. structify/types/external/top_headlines_response.py +0 -19
  342. structify/types/job_delete_response.py +0 -7
  343. structify/types/job_get_response.py +0 -62
  344. structify/types/job_get_step_graph_response.py +0 -233
  345. structify/types/job_get_step_response.py +0 -196
  346. structify/types/message_param.py +0 -35
  347. structify/types/pending_version_response.py +0 -21
  348. structify/types/report_missing_params.py +0 -18
  349. structify/types/report_missing_response.py +0 -7
  350. structify/types/report_relationship_params.py +0 -18
  351. structify/types/report_relationship_response.py +0 -7
  352. structify/types/report_step_params.py +0 -15
  353. structify/types/report_step_response.py +0 -7
  354. structify/types/report_wrong_params.py +0 -18
  355. structify/types/report_wrong_response.py +0 -7
  356. structify/types/sandbox_create_params.py +0 -20
  357. structify/types/session_create_edge_params.py +0 -13
  358. structify/types/slack_connection_status.py +0 -15
  359. structify/types/slack_user_mapping_params.py +0 -18
  360. structify/types/tool_metadata_param.py +0 -17
  361. structify/types/user_team.py +0 -35
  362. structify/types/workflow_schedule_get_response.py +0 -10
  363. structifyai-1.158.0.dist-info/RECORD +0 -530
  364. {structifyai-1.158.0.dist-info → structifyai-1.176.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,1510 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Mapping, Iterable, Optional, cast
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ..._types import (
11
+ Body,
12
+ Omit,
13
+ Query,
14
+ Headers,
15
+ NoneType,
16
+ NotGiven,
17
+ FileTypes,
18
+ SequenceNotStr,
19
+ omit,
20
+ not_given,
21
+ )
22
+ from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
23
+ from ..._compat import cached_property
24
+ from ..._resource import SyncAPIResource, AsyncAPIResource
25
+ from ..._response import (
26
+ to_raw_response_wrapper,
27
+ to_streamed_response_wrapper,
28
+ async_to_raw_response_wrapper,
29
+ async_to_streamed_response_wrapper,
30
+ )
31
+ from ..._base_client import make_request_options
32
+ from ...types.connector_catalog import (
33
+ admin_list_scopes_params,
34
+ admin_upload_logo_params,
35
+ admin_create_scope_params,
36
+ admin_update_scope_params,
37
+ admin_create_catalog_params,
38
+ admin_update_catalog_params,
39
+ admin_create_auth_method_params,
40
+ admin_update_auth_method_params,
41
+ admin_batch_create_scopes_params,
42
+ admin_create_credential_field_params,
43
+ admin_update_credential_field_params,
44
+ admin_batch_create_credential_fields_params,
45
+ )
46
+ from ...types.connector_auth_method import ConnectorAuthMethod
47
+ from ...types.connector_credential_field import ConnectorCredentialField
48
+ from ...types.connector_catalog.connector_catalog import ConnectorCatalog
49
+ from ...types.connector_catalog.list_scopes_response import ListScopesResponse
50
+ from ...types.connector_catalog.upload_logo_response import UploadLogoResponse
51
+ from ...types.connector_catalog.create_scope_request_param import CreateScopeRequestParam
52
+ from ...types.connector_catalog.connector_auth_method_scope import ConnectorAuthMethodScope
53
+ from ...types.connector_catalog.batch_create_scopes_response import BatchCreateScopesResponse
54
+ from ...types.connector_catalog.admin_list_nango_pending_response import AdminListNangoPendingResponse
55
+ from ...types.connector_catalog.create_credential_field_request_param import CreateCredentialFieldRequestParam
56
+ from ...types.connector_catalog.admin_batch_create_credential_fields_response import (
57
+ AdminBatchCreateCredentialFieldsResponse,
58
+ )
59
+
60
+ __all__ = ["AdminResource", "AsyncAdminResource"]
61
+
62
+
63
+ class AdminResource(SyncAPIResource):
64
+ @cached_property
65
+ def with_raw_response(self) -> AdminResourceWithRawResponse:
66
+ """
67
+ This property can be used as a prefix for any HTTP method call to return
68
+ the raw response object instead of the parsed content.
69
+
70
+ For more information, see https://www.github.com/StructifyAI/structify-python#accessing-raw-response-data-eg-headers
71
+ """
72
+ return AdminResourceWithRawResponse(self)
73
+
74
+ @cached_property
75
+ def with_streaming_response(self) -> AdminResourceWithStreamingResponse:
76
+ """
77
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
78
+
79
+ For more information, see https://www.github.com/StructifyAI/structify-python#with_streaming_response
80
+ """
81
+ return AdminResourceWithStreamingResponse(self)
82
+
83
+ def batch_create_credential_fields(
84
+ self,
85
+ *,
86
+ fields: Iterable[CreateCredentialFieldRequestParam],
87
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
88
+ # The extra values given here take precedence over values defined on the client or passed to this method.
89
+ extra_headers: Headers | None = None,
90
+ extra_query: Query | None = None,
91
+ extra_body: Body | None = None,
92
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
93
+ ) -> AdminBatchCreateCredentialFieldsResponse:
94
+ """
95
+ Batch create connector credential fields
96
+
97
+ Args:
98
+ extra_headers: Send extra headers
99
+
100
+ extra_query: Add additional query parameters to the request
101
+
102
+ extra_body: Add additional JSON properties to the request
103
+
104
+ timeout: Override the client-level default timeout for this request, in seconds
105
+ """
106
+ return self._post(
107
+ "/admin/connector-catalog/credential-fields/batch",
108
+ body=maybe_transform(
109
+ {"fields": fields}, admin_batch_create_credential_fields_params.AdminBatchCreateCredentialFieldsParams
110
+ ),
111
+ options=make_request_options(
112
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
113
+ ),
114
+ cast_to=AdminBatchCreateCredentialFieldsResponse,
115
+ )
116
+
117
+ def batch_create_scopes(
118
+ self,
119
+ *,
120
+ scopes: Iterable[CreateScopeRequestParam],
121
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
122
+ # The extra values given here take precedence over values defined on the client or passed to this method.
123
+ extra_headers: Headers | None = None,
124
+ extra_query: Query | None = None,
125
+ extra_body: Body | None = None,
126
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
127
+ ) -> BatchCreateScopesResponse:
128
+ """
129
+ Args:
130
+ extra_headers: Send extra headers
131
+
132
+ extra_query: Add additional query parameters to the request
133
+
134
+ extra_body: Add additional JSON properties to the request
135
+
136
+ timeout: Override the client-level default timeout for this request, in seconds
137
+ """
138
+ return self._post(
139
+ "/admin/connector-catalog/scopes/batch",
140
+ body=maybe_transform({"scopes": scopes}, admin_batch_create_scopes_params.AdminBatchCreateScopesParams),
141
+ options=make_request_options(
142
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
143
+ ),
144
+ cast_to=BatchCreateScopesResponse,
145
+ )
146
+
147
+ def create_auth_method(
148
+ self,
149
+ *,
150
+ auth_type: Literal["credentials", "oauth_nango"],
151
+ connector_catalog_id: str,
152
+ is_active: bool,
153
+ priority: int,
154
+ label: Optional[str] | Omit = omit,
155
+ nango_integration_key: Optional[str] | Omit = omit,
156
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157
+ # The extra values given here take precedence over values defined on the client or passed to this method.
158
+ extra_headers: Headers | None = None,
159
+ extra_query: Query | None = None,
160
+ extra_body: Body | None = None,
161
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
162
+ ) -> ConnectorAuthMethod:
163
+ """
164
+ Create a new connector auth method
165
+
166
+ Args:
167
+ extra_headers: Send extra headers
168
+
169
+ extra_query: Add additional query parameters to the request
170
+
171
+ extra_body: Add additional JSON properties to the request
172
+
173
+ timeout: Override the client-level default timeout for this request, in seconds
174
+ """
175
+ return self._post(
176
+ "/admin/connector-catalog/auth-methods",
177
+ body=maybe_transform(
178
+ {
179
+ "auth_type": auth_type,
180
+ "connector_catalog_id": connector_catalog_id,
181
+ "is_active": is_active,
182
+ "priority": priority,
183
+ "label": label,
184
+ "nango_integration_key": nango_integration_key,
185
+ },
186
+ admin_create_auth_method_params.AdminCreateAuthMethodParams,
187
+ ),
188
+ options=make_request_options(
189
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
190
+ ),
191
+ cast_to=ConnectorAuthMethod,
192
+ )
193
+
194
+ def create_catalog(
195
+ self,
196
+ *,
197
+ name: str,
198
+ slug: str,
199
+ categories: SequenceNotStr[str] | Omit = omit,
200
+ description: Optional[str] | Omit = omit,
201
+ priority: Optional[int] | Omit = omit,
202
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
203
+ # The extra values given here take precedence over values defined on the client or passed to this method.
204
+ extra_headers: Headers | None = None,
205
+ extra_query: Query | None = None,
206
+ extra_body: Body | None = None,
207
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
208
+ ) -> ConnectorCatalog:
209
+ """
210
+ Create a new connector catalog entry
211
+
212
+ Args:
213
+ extra_headers: Send extra headers
214
+
215
+ extra_query: Add additional query parameters to the request
216
+
217
+ extra_body: Add additional JSON properties to the request
218
+
219
+ timeout: Override the client-level default timeout for this request, in seconds
220
+ """
221
+ return self._post(
222
+ "/admin/connector-catalog",
223
+ body=maybe_transform(
224
+ {
225
+ "name": name,
226
+ "slug": slug,
227
+ "categories": categories,
228
+ "description": description,
229
+ "priority": priority,
230
+ },
231
+ admin_create_catalog_params.AdminCreateCatalogParams,
232
+ ),
233
+ options=make_request_options(
234
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
235
+ ),
236
+ cast_to=ConnectorCatalog,
237
+ )
238
+
239
+ def create_credential_field(
240
+ self,
241
+ *,
242
+ auth_method_id: str,
243
+ display_order: int,
244
+ field_type: str,
245
+ is_optional: bool,
246
+ name: str,
247
+ default_value: Optional[str] | Omit = omit,
248
+ description: Optional[str] | Omit = omit,
249
+ label: Optional[str] | Omit = omit,
250
+ options: object | Omit = omit,
251
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
252
+ # The extra values given here take precedence over values defined on the client or passed to this method.
253
+ extra_headers: Headers | None = None,
254
+ extra_query: Query | None = None,
255
+ extra_body: Body | None = None,
256
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
257
+ ) -> ConnectorCredentialField:
258
+ """
259
+ Create a new connector credential field
260
+
261
+ Args:
262
+ extra_headers: Send extra headers
263
+
264
+ extra_query: Add additional query parameters to the request
265
+
266
+ extra_body: Add additional JSON properties to the request
267
+
268
+ timeout: Override the client-level default timeout for this request, in seconds
269
+ """
270
+ return self._post(
271
+ "/admin/connector-catalog/credential-fields",
272
+ body=maybe_transform(
273
+ {
274
+ "auth_method_id": auth_method_id,
275
+ "display_order": display_order,
276
+ "field_type": field_type,
277
+ "is_optional": is_optional,
278
+ "name": name,
279
+ "default_value": default_value,
280
+ "description": description,
281
+ "label": label,
282
+ "options": options,
283
+ },
284
+ admin_create_credential_field_params.AdminCreateCredentialFieldParams,
285
+ ),
286
+ options=make_request_options(
287
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
288
+ ),
289
+ cast_to=ConnectorCredentialField,
290
+ )
291
+
292
+ def create_scope(
293
+ self,
294
+ *,
295
+ connector_auth_method_id: str,
296
+ scope_value: str,
297
+ is_recommended: bool | Omit = omit,
298
+ is_required: bool | Omit = omit,
299
+ query_parameter: str | Omit = omit,
300
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
301
+ # The extra values given here take precedence over values defined on the client or passed to this method.
302
+ extra_headers: Headers | None = None,
303
+ extra_query: Query | None = None,
304
+ extra_body: Body | None = None,
305
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
306
+ ) -> ConnectorAuthMethodScope:
307
+ """
308
+ Args:
309
+ extra_headers: Send extra headers
310
+
311
+ extra_query: Add additional query parameters to the request
312
+
313
+ extra_body: Add additional JSON properties to the request
314
+
315
+ timeout: Override the client-level default timeout for this request, in seconds
316
+ """
317
+ return self._post(
318
+ "/admin/connector-catalog/scopes",
319
+ body=maybe_transform(
320
+ {
321
+ "connector_auth_method_id": connector_auth_method_id,
322
+ "scope_value": scope_value,
323
+ "is_recommended": is_recommended,
324
+ "is_required": is_required,
325
+ "query_parameter": query_parameter,
326
+ },
327
+ admin_create_scope_params.AdminCreateScopeParams,
328
+ ),
329
+ options=make_request_options(
330
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
331
+ ),
332
+ cast_to=ConnectorAuthMethodScope,
333
+ )
334
+
335
+ def delete_credential_field(
336
+ self,
337
+ id: str,
338
+ *,
339
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
340
+ # The extra values given here take precedence over values defined on the client or passed to this method.
341
+ extra_headers: Headers | None = None,
342
+ extra_query: Query | None = None,
343
+ extra_body: Body | None = None,
344
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
345
+ ) -> None:
346
+ """
347
+ Delete a connector credential field
348
+
349
+ Args:
350
+ extra_headers: Send extra headers
351
+
352
+ extra_query: Add additional query parameters to the request
353
+
354
+ extra_body: Add additional JSON properties to the request
355
+
356
+ timeout: Override the client-level default timeout for this request, in seconds
357
+ """
358
+ if not id:
359
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
360
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
361
+ return self._delete(
362
+ f"/admin/connector-catalog/credential-fields/{id}",
363
+ options=make_request_options(
364
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
365
+ ),
366
+ cast_to=NoneType,
367
+ )
368
+
369
+ def delete_scope(
370
+ self,
371
+ id: str,
372
+ *,
373
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
374
+ # The extra values given here take precedence over values defined on the client or passed to this method.
375
+ extra_headers: Headers | None = None,
376
+ extra_query: Query | None = None,
377
+ extra_body: Body | None = None,
378
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
379
+ ) -> None:
380
+ """
381
+ Args:
382
+ extra_headers: Send extra headers
383
+
384
+ extra_query: Add additional query parameters to the request
385
+
386
+ extra_body: Add additional JSON properties to the request
387
+
388
+ timeout: Override the client-level default timeout for this request, in seconds
389
+ """
390
+ if not id:
391
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
392
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
393
+ return self._delete(
394
+ f"/admin/connector-catalog/scopes/{id}",
395
+ options=make_request_options(
396
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
397
+ ),
398
+ cast_to=NoneType,
399
+ )
400
+
401
+ def list_nango_pending(
402
+ self,
403
+ *,
404
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
405
+ # The extra values given here take precedence over values defined on the client or passed to this method.
406
+ extra_headers: Headers | None = None,
407
+ extra_query: Query | None = None,
408
+ extra_body: Body | None = None,
409
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
410
+ ) -> AdminListNangoPendingResponse:
411
+ """List Nango integrations that are not yet in the connector catalog"""
412
+ return self._get(
413
+ "/admin/connector-catalog/nango-pending",
414
+ options=make_request_options(
415
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
416
+ ),
417
+ cast_to=AdminListNangoPendingResponse,
418
+ )
419
+
420
+ def list_scopes(
421
+ self,
422
+ *,
423
+ connector_auth_method_id: str,
424
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
425
+ # The extra values given here take precedence over values defined on the client or passed to this method.
426
+ extra_headers: Headers | None = None,
427
+ extra_query: Query | None = None,
428
+ extra_body: Body | None = None,
429
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
430
+ ) -> ListScopesResponse:
431
+ """
432
+ Args:
433
+ extra_headers: Send extra headers
434
+
435
+ extra_query: Add additional query parameters to the request
436
+
437
+ extra_body: Add additional JSON properties to the request
438
+
439
+ timeout: Override the client-level default timeout for this request, in seconds
440
+ """
441
+ return self._get(
442
+ "/admin/connector-catalog/scopes",
443
+ options=make_request_options(
444
+ extra_headers=extra_headers,
445
+ extra_query=extra_query,
446
+ extra_body=extra_body,
447
+ timeout=timeout,
448
+ query=maybe_transform(
449
+ {"connector_auth_method_id": connector_auth_method_id},
450
+ admin_list_scopes_params.AdminListScopesParams,
451
+ ),
452
+ ),
453
+ cast_to=ListScopesResponse,
454
+ )
455
+
456
+ def update_auth_method(
457
+ self,
458
+ id: str,
459
+ *,
460
+ is_active: Optional[bool] | Omit = omit,
461
+ label: Optional[str] | Omit = omit,
462
+ priority: Optional[int] | Omit = omit,
463
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
464
+ # The extra values given here take precedence over values defined on the client or passed to this method.
465
+ extra_headers: Headers | None = None,
466
+ extra_query: Query | None = None,
467
+ extra_body: Body | None = None,
468
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
469
+ ) -> ConnectorAuthMethod:
470
+ """
471
+ Update a connector auth method
472
+
473
+ Args:
474
+ extra_headers: Send extra headers
475
+
476
+ extra_query: Add additional query parameters to the request
477
+
478
+ extra_body: Add additional JSON properties to the request
479
+
480
+ timeout: Override the client-level default timeout for this request, in seconds
481
+ """
482
+ if not id:
483
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
484
+ return self._patch(
485
+ f"/admin/connector-catalog/auth-methods/{id}",
486
+ body=maybe_transform(
487
+ {
488
+ "is_active": is_active,
489
+ "label": label,
490
+ "priority": priority,
491
+ },
492
+ admin_update_auth_method_params.AdminUpdateAuthMethodParams,
493
+ ),
494
+ options=make_request_options(
495
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
496
+ ),
497
+ cast_to=ConnectorAuthMethod,
498
+ )
499
+
500
+ def update_catalog(
501
+ self,
502
+ id: str,
503
+ *,
504
+ categories: Optional[SequenceNotStr[str]] | Omit = omit,
505
+ description: Optional[str] | Omit = omit,
506
+ name: Optional[str] | Omit = omit,
507
+ priority: Optional[int] | Omit = omit,
508
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
509
+ # The extra values given here take precedence over values defined on the client or passed to this method.
510
+ extra_headers: Headers | None = None,
511
+ extra_query: Query | None = None,
512
+ extra_body: Body | None = None,
513
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
514
+ ) -> ConnectorCatalog:
515
+ """
516
+ Update a connector catalog entry
517
+
518
+ Args:
519
+ extra_headers: Send extra headers
520
+
521
+ extra_query: Add additional query parameters to the request
522
+
523
+ extra_body: Add additional JSON properties to the request
524
+
525
+ timeout: Override the client-level default timeout for this request, in seconds
526
+ """
527
+ if not id:
528
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
529
+ return self._patch(
530
+ f"/admin/connector-catalog/{id}",
531
+ body=maybe_transform(
532
+ {
533
+ "categories": categories,
534
+ "description": description,
535
+ "name": name,
536
+ "priority": priority,
537
+ },
538
+ admin_update_catalog_params.AdminUpdateCatalogParams,
539
+ ),
540
+ options=make_request_options(
541
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
542
+ ),
543
+ cast_to=ConnectorCatalog,
544
+ )
545
+
546
+ def update_credential_field(
547
+ self,
548
+ id: str,
549
+ *,
550
+ default_value: Optional[str] | Omit = omit,
551
+ description: Optional[str] | Omit = omit,
552
+ display_order: Optional[int] | Omit = omit,
553
+ field_type: Optional[str] | Omit = omit,
554
+ is_optional: Optional[bool] | Omit = omit,
555
+ label: Optional[str] | Omit = omit,
556
+ name: Optional[str] | Omit = omit,
557
+ options: object | Omit = omit,
558
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
559
+ # The extra values given here take precedence over values defined on the client or passed to this method.
560
+ extra_headers: Headers | None = None,
561
+ extra_query: Query | None = None,
562
+ extra_body: Body | None = None,
563
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
564
+ ) -> ConnectorCredentialField:
565
+ """
566
+ Update a connector credential field
567
+
568
+ Args:
569
+ extra_headers: Send extra headers
570
+
571
+ extra_query: Add additional query parameters to the request
572
+
573
+ extra_body: Add additional JSON properties to the request
574
+
575
+ timeout: Override the client-level default timeout for this request, in seconds
576
+ """
577
+ if not id:
578
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
579
+ return self._patch(
580
+ f"/admin/connector-catalog/credential-fields/{id}",
581
+ body=maybe_transform(
582
+ {
583
+ "default_value": default_value,
584
+ "description": description,
585
+ "display_order": display_order,
586
+ "field_type": field_type,
587
+ "is_optional": is_optional,
588
+ "label": label,
589
+ "name": name,
590
+ "options": options,
591
+ },
592
+ admin_update_credential_field_params.AdminUpdateCredentialFieldParams,
593
+ ),
594
+ options=make_request_options(
595
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
596
+ ),
597
+ cast_to=ConnectorCredentialField,
598
+ )
599
+
600
+ def update_scope(
601
+ self,
602
+ id: str,
603
+ *,
604
+ is_recommended: Optional[bool] | Omit = omit,
605
+ is_required: Optional[bool] | Omit = omit,
606
+ query_parameter: Optional[str] | Omit = omit,
607
+ scope_value: Optional[str] | Omit = omit,
608
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
609
+ # The extra values given here take precedence over values defined on the client or passed to this method.
610
+ extra_headers: Headers | None = None,
611
+ extra_query: Query | None = None,
612
+ extra_body: Body | None = None,
613
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
614
+ ) -> ConnectorAuthMethodScope:
615
+ """
616
+ Args:
617
+ extra_headers: Send extra headers
618
+
619
+ extra_query: Add additional query parameters to the request
620
+
621
+ extra_body: Add additional JSON properties to the request
622
+
623
+ timeout: Override the client-level default timeout for this request, in seconds
624
+ """
625
+ if not id:
626
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
627
+ return self._patch(
628
+ f"/admin/connector-catalog/scopes/{id}",
629
+ body=maybe_transform(
630
+ {
631
+ "is_recommended": is_recommended,
632
+ "is_required": is_required,
633
+ "query_parameter": query_parameter,
634
+ "scope_value": scope_value,
635
+ },
636
+ admin_update_scope_params.AdminUpdateScopeParams,
637
+ ),
638
+ options=make_request_options(
639
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
640
+ ),
641
+ cast_to=ConnectorAuthMethodScope,
642
+ )
643
+
644
+ def upload_logo(
645
+ self,
646
+ slug: str,
647
+ *,
648
+ file: FileTypes,
649
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
650
+ # The extra values given here take precedence over values defined on the client or passed to this method.
651
+ extra_headers: Headers | None = None,
652
+ extra_query: Query | None = None,
653
+ extra_body: Body | None = None,
654
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
655
+ ) -> UploadLogoResponse:
656
+ """
657
+ Args:
658
+ extra_headers: Send extra headers
659
+
660
+ extra_query: Add additional query parameters to the request
661
+
662
+ extra_body: Add additional JSON properties to the request
663
+
664
+ timeout: Override the client-level default timeout for this request, in seconds
665
+ """
666
+ if not slug:
667
+ raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
668
+ body = deepcopy_minimal({"file": file})
669
+ files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
670
+ # It should be noted that the actual Content-Type header that will be
671
+ # sent to the server will contain a `boundary` parameter, e.g.
672
+ # multipart/form-data; boundary=---abc--
673
+ extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
674
+ return self._put(
675
+ f"/admin/connector-catalog/{slug}/logo",
676
+ body=maybe_transform(body, admin_upload_logo_params.AdminUploadLogoParams),
677
+ files=files,
678
+ options=make_request_options(
679
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
680
+ ),
681
+ cast_to=UploadLogoResponse,
682
+ )
683
+
684
+
685
+ class AsyncAdminResource(AsyncAPIResource):
686
+ @cached_property
687
+ def with_raw_response(self) -> AsyncAdminResourceWithRawResponse:
688
+ """
689
+ This property can be used as a prefix for any HTTP method call to return
690
+ the raw response object instead of the parsed content.
691
+
692
+ For more information, see https://www.github.com/StructifyAI/structify-python#accessing-raw-response-data-eg-headers
693
+ """
694
+ return AsyncAdminResourceWithRawResponse(self)
695
+
696
+ @cached_property
697
+ def with_streaming_response(self) -> AsyncAdminResourceWithStreamingResponse:
698
+ """
699
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
700
+
701
+ For more information, see https://www.github.com/StructifyAI/structify-python#with_streaming_response
702
+ """
703
+ return AsyncAdminResourceWithStreamingResponse(self)
704
+
705
+ async def batch_create_credential_fields(
706
+ self,
707
+ *,
708
+ fields: Iterable[CreateCredentialFieldRequestParam],
709
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
710
+ # The extra values given here take precedence over values defined on the client or passed to this method.
711
+ extra_headers: Headers | None = None,
712
+ extra_query: Query | None = None,
713
+ extra_body: Body | None = None,
714
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
715
+ ) -> AdminBatchCreateCredentialFieldsResponse:
716
+ """
717
+ Batch create connector credential fields
718
+
719
+ Args:
720
+ extra_headers: Send extra headers
721
+
722
+ extra_query: Add additional query parameters to the request
723
+
724
+ extra_body: Add additional JSON properties to the request
725
+
726
+ timeout: Override the client-level default timeout for this request, in seconds
727
+ """
728
+ return await self._post(
729
+ "/admin/connector-catalog/credential-fields/batch",
730
+ body=await async_maybe_transform(
731
+ {"fields": fields}, admin_batch_create_credential_fields_params.AdminBatchCreateCredentialFieldsParams
732
+ ),
733
+ options=make_request_options(
734
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
735
+ ),
736
+ cast_to=AdminBatchCreateCredentialFieldsResponse,
737
+ )
738
+
739
+ async def batch_create_scopes(
740
+ self,
741
+ *,
742
+ scopes: Iterable[CreateScopeRequestParam],
743
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
744
+ # The extra values given here take precedence over values defined on the client or passed to this method.
745
+ extra_headers: Headers | None = None,
746
+ extra_query: Query | None = None,
747
+ extra_body: Body | None = None,
748
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
749
+ ) -> BatchCreateScopesResponse:
750
+ """
751
+ Args:
752
+ extra_headers: Send extra headers
753
+
754
+ extra_query: Add additional query parameters to the request
755
+
756
+ extra_body: Add additional JSON properties to the request
757
+
758
+ timeout: Override the client-level default timeout for this request, in seconds
759
+ """
760
+ return await self._post(
761
+ "/admin/connector-catalog/scopes/batch",
762
+ body=await async_maybe_transform(
763
+ {"scopes": scopes}, admin_batch_create_scopes_params.AdminBatchCreateScopesParams
764
+ ),
765
+ options=make_request_options(
766
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
767
+ ),
768
+ cast_to=BatchCreateScopesResponse,
769
+ )
770
+
771
+ async def create_auth_method(
772
+ self,
773
+ *,
774
+ auth_type: Literal["credentials", "oauth_nango"],
775
+ connector_catalog_id: str,
776
+ is_active: bool,
777
+ priority: int,
778
+ label: Optional[str] | Omit = omit,
779
+ nango_integration_key: Optional[str] | Omit = omit,
780
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
781
+ # The extra values given here take precedence over values defined on the client or passed to this method.
782
+ extra_headers: Headers | None = None,
783
+ extra_query: Query | None = None,
784
+ extra_body: Body | None = None,
785
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
786
+ ) -> ConnectorAuthMethod:
787
+ """
788
+ Create a new connector auth method
789
+
790
+ Args:
791
+ extra_headers: Send extra headers
792
+
793
+ extra_query: Add additional query parameters to the request
794
+
795
+ extra_body: Add additional JSON properties to the request
796
+
797
+ timeout: Override the client-level default timeout for this request, in seconds
798
+ """
799
+ return await self._post(
800
+ "/admin/connector-catalog/auth-methods",
801
+ body=await async_maybe_transform(
802
+ {
803
+ "auth_type": auth_type,
804
+ "connector_catalog_id": connector_catalog_id,
805
+ "is_active": is_active,
806
+ "priority": priority,
807
+ "label": label,
808
+ "nango_integration_key": nango_integration_key,
809
+ },
810
+ admin_create_auth_method_params.AdminCreateAuthMethodParams,
811
+ ),
812
+ options=make_request_options(
813
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
814
+ ),
815
+ cast_to=ConnectorAuthMethod,
816
+ )
817
+
818
+ async def create_catalog(
819
+ self,
820
+ *,
821
+ name: str,
822
+ slug: str,
823
+ categories: SequenceNotStr[str] | Omit = omit,
824
+ description: Optional[str] | Omit = omit,
825
+ priority: Optional[int] | Omit = omit,
826
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
827
+ # The extra values given here take precedence over values defined on the client or passed to this method.
828
+ extra_headers: Headers | None = None,
829
+ extra_query: Query | None = None,
830
+ extra_body: Body | None = None,
831
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
832
+ ) -> ConnectorCatalog:
833
+ """
834
+ Create a new connector catalog entry
835
+
836
+ Args:
837
+ extra_headers: Send extra headers
838
+
839
+ extra_query: Add additional query parameters to the request
840
+
841
+ extra_body: Add additional JSON properties to the request
842
+
843
+ timeout: Override the client-level default timeout for this request, in seconds
844
+ """
845
+ return await self._post(
846
+ "/admin/connector-catalog",
847
+ body=await async_maybe_transform(
848
+ {
849
+ "name": name,
850
+ "slug": slug,
851
+ "categories": categories,
852
+ "description": description,
853
+ "priority": priority,
854
+ },
855
+ admin_create_catalog_params.AdminCreateCatalogParams,
856
+ ),
857
+ options=make_request_options(
858
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
859
+ ),
860
+ cast_to=ConnectorCatalog,
861
+ )
862
+
863
+ async def create_credential_field(
864
+ self,
865
+ *,
866
+ auth_method_id: str,
867
+ display_order: int,
868
+ field_type: str,
869
+ is_optional: bool,
870
+ name: str,
871
+ default_value: Optional[str] | Omit = omit,
872
+ description: Optional[str] | Omit = omit,
873
+ label: Optional[str] | Omit = omit,
874
+ options: object | Omit = omit,
875
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
876
+ # The extra values given here take precedence over values defined on the client or passed to this method.
877
+ extra_headers: Headers | None = None,
878
+ extra_query: Query | None = None,
879
+ extra_body: Body | None = None,
880
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
881
+ ) -> ConnectorCredentialField:
882
+ """
883
+ Create a new connector credential field
884
+
885
+ Args:
886
+ extra_headers: Send extra headers
887
+
888
+ extra_query: Add additional query parameters to the request
889
+
890
+ extra_body: Add additional JSON properties to the request
891
+
892
+ timeout: Override the client-level default timeout for this request, in seconds
893
+ """
894
+ return await self._post(
895
+ "/admin/connector-catalog/credential-fields",
896
+ body=await async_maybe_transform(
897
+ {
898
+ "auth_method_id": auth_method_id,
899
+ "display_order": display_order,
900
+ "field_type": field_type,
901
+ "is_optional": is_optional,
902
+ "name": name,
903
+ "default_value": default_value,
904
+ "description": description,
905
+ "label": label,
906
+ "options": options,
907
+ },
908
+ admin_create_credential_field_params.AdminCreateCredentialFieldParams,
909
+ ),
910
+ options=make_request_options(
911
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
912
+ ),
913
+ cast_to=ConnectorCredentialField,
914
+ )
915
+
916
+ async def create_scope(
917
+ self,
918
+ *,
919
+ connector_auth_method_id: str,
920
+ scope_value: str,
921
+ is_recommended: bool | Omit = omit,
922
+ is_required: bool | Omit = omit,
923
+ query_parameter: str | Omit = omit,
924
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
925
+ # The extra values given here take precedence over values defined on the client or passed to this method.
926
+ extra_headers: Headers | None = None,
927
+ extra_query: Query | None = None,
928
+ extra_body: Body | None = None,
929
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
930
+ ) -> ConnectorAuthMethodScope:
931
+ """
932
+ Args:
933
+ extra_headers: Send extra headers
934
+
935
+ extra_query: Add additional query parameters to the request
936
+
937
+ extra_body: Add additional JSON properties to the request
938
+
939
+ timeout: Override the client-level default timeout for this request, in seconds
940
+ """
941
+ return await self._post(
942
+ "/admin/connector-catalog/scopes",
943
+ body=await async_maybe_transform(
944
+ {
945
+ "connector_auth_method_id": connector_auth_method_id,
946
+ "scope_value": scope_value,
947
+ "is_recommended": is_recommended,
948
+ "is_required": is_required,
949
+ "query_parameter": query_parameter,
950
+ },
951
+ admin_create_scope_params.AdminCreateScopeParams,
952
+ ),
953
+ options=make_request_options(
954
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
955
+ ),
956
+ cast_to=ConnectorAuthMethodScope,
957
+ )
958
+
959
+ async def delete_credential_field(
960
+ self,
961
+ id: str,
962
+ *,
963
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
964
+ # The extra values given here take precedence over values defined on the client or passed to this method.
965
+ extra_headers: Headers | None = None,
966
+ extra_query: Query | None = None,
967
+ extra_body: Body | None = None,
968
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
969
+ ) -> None:
970
+ """
971
+ Delete a connector credential field
972
+
973
+ Args:
974
+ extra_headers: Send extra headers
975
+
976
+ extra_query: Add additional query parameters to the request
977
+
978
+ extra_body: Add additional JSON properties to the request
979
+
980
+ timeout: Override the client-level default timeout for this request, in seconds
981
+ """
982
+ if not id:
983
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
984
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
985
+ return await self._delete(
986
+ f"/admin/connector-catalog/credential-fields/{id}",
987
+ options=make_request_options(
988
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
989
+ ),
990
+ cast_to=NoneType,
991
+ )
992
+
993
+ async def delete_scope(
994
+ self,
995
+ id: str,
996
+ *,
997
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
998
+ # The extra values given here take precedence over values defined on the client or passed to this method.
999
+ extra_headers: Headers | None = None,
1000
+ extra_query: Query | None = None,
1001
+ extra_body: Body | None = None,
1002
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1003
+ ) -> None:
1004
+ """
1005
+ Args:
1006
+ extra_headers: Send extra headers
1007
+
1008
+ extra_query: Add additional query parameters to the request
1009
+
1010
+ extra_body: Add additional JSON properties to the request
1011
+
1012
+ timeout: Override the client-level default timeout for this request, in seconds
1013
+ """
1014
+ if not id:
1015
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1016
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
1017
+ return await self._delete(
1018
+ f"/admin/connector-catalog/scopes/{id}",
1019
+ options=make_request_options(
1020
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1021
+ ),
1022
+ cast_to=NoneType,
1023
+ )
1024
+
1025
+ async def list_nango_pending(
1026
+ self,
1027
+ *,
1028
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1029
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1030
+ extra_headers: Headers | None = None,
1031
+ extra_query: Query | None = None,
1032
+ extra_body: Body | None = None,
1033
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1034
+ ) -> AdminListNangoPendingResponse:
1035
+ """List Nango integrations that are not yet in the connector catalog"""
1036
+ return await self._get(
1037
+ "/admin/connector-catalog/nango-pending",
1038
+ options=make_request_options(
1039
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1040
+ ),
1041
+ cast_to=AdminListNangoPendingResponse,
1042
+ )
1043
+
1044
+ async def list_scopes(
1045
+ self,
1046
+ *,
1047
+ connector_auth_method_id: str,
1048
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1049
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1050
+ extra_headers: Headers | None = None,
1051
+ extra_query: Query | None = None,
1052
+ extra_body: Body | None = None,
1053
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1054
+ ) -> ListScopesResponse:
1055
+ """
1056
+ Args:
1057
+ extra_headers: Send extra headers
1058
+
1059
+ extra_query: Add additional query parameters to the request
1060
+
1061
+ extra_body: Add additional JSON properties to the request
1062
+
1063
+ timeout: Override the client-level default timeout for this request, in seconds
1064
+ """
1065
+ return await self._get(
1066
+ "/admin/connector-catalog/scopes",
1067
+ options=make_request_options(
1068
+ extra_headers=extra_headers,
1069
+ extra_query=extra_query,
1070
+ extra_body=extra_body,
1071
+ timeout=timeout,
1072
+ query=await async_maybe_transform(
1073
+ {"connector_auth_method_id": connector_auth_method_id},
1074
+ admin_list_scopes_params.AdminListScopesParams,
1075
+ ),
1076
+ ),
1077
+ cast_to=ListScopesResponse,
1078
+ )
1079
+
1080
+ async def update_auth_method(
1081
+ self,
1082
+ id: str,
1083
+ *,
1084
+ is_active: Optional[bool] | Omit = omit,
1085
+ label: Optional[str] | Omit = omit,
1086
+ priority: Optional[int] | Omit = omit,
1087
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1088
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1089
+ extra_headers: Headers | None = None,
1090
+ extra_query: Query | None = None,
1091
+ extra_body: Body | None = None,
1092
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1093
+ ) -> ConnectorAuthMethod:
1094
+ """
1095
+ Update a connector auth method
1096
+
1097
+ Args:
1098
+ extra_headers: Send extra headers
1099
+
1100
+ extra_query: Add additional query parameters to the request
1101
+
1102
+ extra_body: Add additional JSON properties to the request
1103
+
1104
+ timeout: Override the client-level default timeout for this request, in seconds
1105
+ """
1106
+ if not id:
1107
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1108
+ return await self._patch(
1109
+ f"/admin/connector-catalog/auth-methods/{id}",
1110
+ body=await async_maybe_transform(
1111
+ {
1112
+ "is_active": is_active,
1113
+ "label": label,
1114
+ "priority": priority,
1115
+ },
1116
+ admin_update_auth_method_params.AdminUpdateAuthMethodParams,
1117
+ ),
1118
+ options=make_request_options(
1119
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1120
+ ),
1121
+ cast_to=ConnectorAuthMethod,
1122
+ )
1123
+
1124
+ async def update_catalog(
1125
+ self,
1126
+ id: str,
1127
+ *,
1128
+ categories: Optional[SequenceNotStr[str]] | Omit = omit,
1129
+ description: Optional[str] | Omit = omit,
1130
+ name: Optional[str] | Omit = omit,
1131
+ priority: Optional[int] | Omit = omit,
1132
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1133
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1134
+ extra_headers: Headers | None = None,
1135
+ extra_query: Query | None = None,
1136
+ extra_body: Body | None = None,
1137
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1138
+ ) -> ConnectorCatalog:
1139
+ """
1140
+ Update a connector catalog entry
1141
+
1142
+ Args:
1143
+ extra_headers: Send extra headers
1144
+
1145
+ extra_query: Add additional query parameters to the request
1146
+
1147
+ extra_body: Add additional JSON properties to the request
1148
+
1149
+ timeout: Override the client-level default timeout for this request, in seconds
1150
+ """
1151
+ if not id:
1152
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1153
+ return await self._patch(
1154
+ f"/admin/connector-catalog/{id}",
1155
+ body=await async_maybe_transform(
1156
+ {
1157
+ "categories": categories,
1158
+ "description": description,
1159
+ "name": name,
1160
+ "priority": priority,
1161
+ },
1162
+ admin_update_catalog_params.AdminUpdateCatalogParams,
1163
+ ),
1164
+ options=make_request_options(
1165
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1166
+ ),
1167
+ cast_to=ConnectorCatalog,
1168
+ )
1169
+
1170
+ async def update_credential_field(
1171
+ self,
1172
+ id: str,
1173
+ *,
1174
+ default_value: Optional[str] | Omit = omit,
1175
+ description: Optional[str] | Omit = omit,
1176
+ display_order: Optional[int] | Omit = omit,
1177
+ field_type: Optional[str] | Omit = omit,
1178
+ is_optional: Optional[bool] | Omit = omit,
1179
+ label: Optional[str] | Omit = omit,
1180
+ name: Optional[str] | Omit = omit,
1181
+ options: object | Omit = omit,
1182
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1183
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1184
+ extra_headers: Headers | None = None,
1185
+ extra_query: Query | None = None,
1186
+ extra_body: Body | None = None,
1187
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1188
+ ) -> ConnectorCredentialField:
1189
+ """
1190
+ Update a connector credential field
1191
+
1192
+ Args:
1193
+ extra_headers: Send extra headers
1194
+
1195
+ extra_query: Add additional query parameters to the request
1196
+
1197
+ extra_body: Add additional JSON properties to the request
1198
+
1199
+ timeout: Override the client-level default timeout for this request, in seconds
1200
+ """
1201
+ if not id:
1202
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1203
+ return await self._patch(
1204
+ f"/admin/connector-catalog/credential-fields/{id}",
1205
+ body=await async_maybe_transform(
1206
+ {
1207
+ "default_value": default_value,
1208
+ "description": description,
1209
+ "display_order": display_order,
1210
+ "field_type": field_type,
1211
+ "is_optional": is_optional,
1212
+ "label": label,
1213
+ "name": name,
1214
+ "options": options,
1215
+ },
1216
+ admin_update_credential_field_params.AdminUpdateCredentialFieldParams,
1217
+ ),
1218
+ options=make_request_options(
1219
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1220
+ ),
1221
+ cast_to=ConnectorCredentialField,
1222
+ )
1223
+
1224
+ async def update_scope(
1225
+ self,
1226
+ id: str,
1227
+ *,
1228
+ is_recommended: Optional[bool] | Omit = omit,
1229
+ is_required: Optional[bool] | Omit = omit,
1230
+ query_parameter: Optional[str] | Omit = omit,
1231
+ scope_value: Optional[str] | Omit = omit,
1232
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1233
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1234
+ extra_headers: Headers | None = None,
1235
+ extra_query: Query | None = None,
1236
+ extra_body: Body | None = None,
1237
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1238
+ ) -> ConnectorAuthMethodScope:
1239
+ """
1240
+ Args:
1241
+ extra_headers: Send extra headers
1242
+
1243
+ extra_query: Add additional query parameters to the request
1244
+
1245
+ extra_body: Add additional JSON properties to the request
1246
+
1247
+ timeout: Override the client-level default timeout for this request, in seconds
1248
+ """
1249
+ if not id:
1250
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1251
+ return await self._patch(
1252
+ f"/admin/connector-catalog/scopes/{id}",
1253
+ body=await async_maybe_transform(
1254
+ {
1255
+ "is_recommended": is_recommended,
1256
+ "is_required": is_required,
1257
+ "query_parameter": query_parameter,
1258
+ "scope_value": scope_value,
1259
+ },
1260
+ admin_update_scope_params.AdminUpdateScopeParams,
1261
+ ),
1262
+ options=make_request_options(
1263
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1264
+ ),
1265
+ cast_to=ConnectorAuthMethodScope,
1266
+ )
1267
+
1268
+ async def upload_logo(
1269
+ self,
1270
+ slug: str,
1271
+ *,
1272
+ file: FileTypes,
1273
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1274
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1275
+ extra_headers: Headers | None = None,
1276
+ extra_query: Query | None = None,
1277
+ extra_body: Body | None = None,
1278
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1279
+ ) -> UploadLogoResponse:
1280
+ """
1281
+ Args:
1282
+ extra_headers: Send extra headers
1283
+
1284
+ extra_query: Add additional query parameters to the request
1285
+
1286
+ extra_body: Add additional JSON properties to the request
1287
+
1288
+ timeout: Override the client-level default timeout for this request, in seconds
1289
+ """
1290
+ if not slug:
1291
+ raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}")
1292
+ body = deepcopy_minimal({"file": file})
1293
+ files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
1294
+ # It should be noted that the actual Content-Type header that will be
1295
+ # sent to the server will contain a `boundary` parameter, e.g.
1296
+ # multipart/form-data; boundary=---abc--
1297
+ extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
1298
+ return await self._put(
1299
+ f"/admin/connector-catalog/{slug}/logo",
1300
+ body=await async_maybe_transform(body, admin_upload_logo_params.AdminUploadLogoParams),
1301
+ files=files,
1302
+ options=make_request_options(
1303
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1304
+ ),
1305
+ cast_to=UploadLogoResponse,
1306
+ )
1307
+
1308
+
1309
+ class AdminResourceWithRawResponse:
1310
+ def __init__(self, admin: AdminResource) -> None:
1311
+ self._admin = admin
1312
+
1313
+ self.batch_create_credential_fields = to_raw_response_wrapper(
1314
+ admin.batch_create_credential_fields,
1315
+ )
1316
+ self.batch_create_scopes = to_raw_response_wrapper(
1317
+ admin.batch_create_scopes,
1318
+ )
1319
+ self.create_auth_method = to_raw_response_wrapper(
1320
+ admin.create_auth_method,
1321
+ )
1322
+ self.create_catalog = to_raw_response_wrapper(
1323
+ admin.create_catalog,
1324
+ )
1325
+ self.create_credential_field = to_raw_response_wrapper(
1326
+ admin.create_credential_field,
1327
+ )
1328
+ self.create_scope = to_raw_response_wrapper(
1329
+ admin.create_scope,
1330
+ )
1331
+ self.delete_credential_field = to_raw_response_wrapper(
1332
+ admin.delete_credential_field,
1333
+ )
1334
+ self.delete_scope = to_raw_response_wrapper(
1335
+ admin.delete_scope,
1336
+ )
1337
+ self.list_nango_pending = to_raw_response_wrapper(
1338
+ admin.list_nango_pending,
1339
+ )
1340
+ self.list_scopes = to_raw_response_wrapper(
1341
+ admin.list_scopes,
1342
+ )
1343
+ self.update_auth_method = to_raw_response_wrapper(
1344
+ admin.update_auth_method,
1345
+ )
1346
+ self.update_catalog = to_raw_response_wrapper(
1347
+ admin.update_catalog,
1348
+ )
1349
+ self.update_credential_field = to_raw_response_wrapper(
1350
+ admin.update_credential_field,
1351
+ )
1352
+ self.update_scope = to_raw_response_wrapper(
1353
+ admin.update_scope,
1354
+ )
1355
+ self.upload_logo = to_raw_response_wrapper(
1356
+ admin.upload_logo,
1357
+ )
1358
+
1359
+
1360
+ class AsyncAdminResourceWithRawResponse:
1361
+ def __init__(self, admin: AsyncAdminResource) -> None:
1362
+ self._admin = admin
1363
+
1364
+ self.batch_create_credential_fields = async_to_raw_response_wrapper(
1365
+ admin.batch_create_credential_fields,
1366
+ )
1367
+ self.batch_create_scopes = async_to_raw_response_wrapper(
1368
+ admin.batch_create_scopes,
1369
+ )
1370
+ self.create_auth_method = async_to_raw_response_wrapper(
1371
+ admin.create_auth_method,
1372
+ )
1373
+ self.create_catalog = async_to_raw_response_wrapper(
1374
+ admin.create_catalog,
1375
+ )
1376
+ self.create_credential_field = async_to_raw_response_wrapper(
1377
+ admin.create_credential_field,
1378
+ )
1379
+ self.create_scope = async_to_raw_response_wrapper(
1380
+ admin.create_scope,
1381
+ )
1382
+ self.delete_credential_field = async_to_raw_response_wrapper(
1383
+ admin.delete_credential_field,
1384
+ )
1385
+ self.delete_scope = async_to_raw_response_wrapper(
1386
+ admin.delete_scope,
1387
+ )
1388
+ self.list_nango_pending = async_to_raw_response_wrapper(
1389
+ admin.list_nango_pending,
1390
+ )
1391
+ self.list_scopes = async_to_raw_response_wrapper(
1392
+ admin.list_scopes,
1393
+ )
1394
+ self.update_auth_method = async_to_raw_response_wrapper(
1395
+ admin.update_auth_method,
1396
+ )
1397
+ self.update_catalog = async_to_raw_response_wrapper(
1398
+ admin.update_catalog,
1399
+ )
1400
+ self.update_credential_field = async_to_raw_response_wrapper(
1401
+ admin.update_credential_field,
1402
+ )
1403
+ self.update_scope = async_to_raw_response_wrapper(
1404
+ admin.update_scope,
1405
+ )
1406
+ self.upload_logo = async_to_raw_response_wrapper(
1407
+ admin.upload_logo,
1408
+ )
1409
+
1410
+
1411
+ class AdminResourceWithStreamingResponse:
1412
+ def __init__(self, admin: AdminResource) -> None:
1413
+ self._admin = admin
1414
+
1415
+ self.batch_create_credential_fields = to_streamed_response_wrapper(
1416
+ admin.batch_create_credential_fields,
1417
+ )
1418
+ self.batch_create_scopes = to_streamed_response_wrapper(
1419
+ admin.batch_create_scopes,
1420
+ )
1421
+ self.create_auth_method = to_streamed_response_wrapper(
1422
+ admin.create_auth_method,
1423
+ )
1424
+ self.create_catalog = to_streamed_response_wrapper(
1425
+ admin.create_catalog,
1426
+ )
1427
+ self.create_credential_field = to_streamed_response_wrapper(
1428
+ admin.create_credential_field,
1429
+ )
1430
+ self.create_scope = to_streamed_response_wrapper(
1431
+ admin.create_scope,
1432
+ )
1433
+ self.delete_credential_field = to_streamed_response_wrapper(
1434
+ admin.delete_credential_field,
1435
+ )
1436
+ self.delete_scope = to_streamed_response_wrapper(
1437
+ admin.delete_scope,
1438
+ )
1439
+ self.list_nango_pending = to_streamed_response_wrapper(
1440
+ admin.list_nango_pending,
1441
+ )
1442
+ self.list_scopes = to_streamed_response_wrapper(
1443
+ admin.list_scopes,
1444
+ )
1445
+ self.update_auth_method = to_streamed_response_wrapper(
1446
+ admin.update_auth_method,
1447
+ )
1448
+ self.update_catalog = to_streamed_response_wrapper(
1449
+ admin.update_catalog,
1450
+ )
1451
+ self.update_credential_field = to_streamed_response_wrapper(
1452
+ admin.update_credential_field,
1453
+ )
1454
+ self.update_scope = to_streamed_response_wrapper(
1455
+ admin.update_scope,
1456
+ )
1457
+ self.upload_logo = to_streamed_response_wrapper(
1458
+ admin.upload_logo,
1459
+ )
1460
+
1461
+
1462
+ class AsyncAdminResourceWithStreamingResponse:
1463
+ def __init__(self, admin: AsyncAdminResource) -> None:
1464
+ self._admin = admin
1465
+
1466
+ self.batch_create_credential_fields = async_to_streamed_response_wrapper(
1467
+ admin.batch_create_credential_fields,
1468
+ )
1469
+ self.batch_create_scopes = async_to_streamed_response_wrapper(
1470
+ admin.batch_create_scopes,
1471
+ )
1472
+ self.create_auth_method = async_to_streamed_response_wrapper(
1473
+ admin.create_auth_method,
1474
+ )
1475
+ self.create_catalog = async_to_streamed_response_wrapper(
1476
+ admin.create_catalog,
1477
+ )
1478
+ self.create_credential_field = async_to_streamed_response_wrapper(
1479
+ admin.create_credential_field,
1480
+ )
1481
+ self.create_scope = async_to_streamed_response_wrapper(
1482
+ admin.create_scope,
1483
+ )
1484
+ self.delete_credential_field = async_to_streamed_response_wrapper(
1485
+ admin.delete_credential_field,
1486
+ )
1487
+ self.delete_scope = async_to_streamed_response_wrapper(
1488
+ admin.delete_scope,
1489
+ )
1490
+ self.list_nango_pending = async_to_streamed_response_wrapper(
1491
+ admin.list_nango_pending,
1492
+ )
1493
+ self.list_scopes = async_to_streamed_response_wrapper(
1494
+ admin.list_scopes,
1495
+ )
1496
+ self.update_auth_method = async_to_streamed_response_wrapper(
1497
+ admin.update_auth_method,
1498
+ )
1499
+ self.update_catalog = async_to_streamed_response_wrapper(
1500
+ admin.update_catalog,
1501
+ )
1502
+ self.update_credential_field = async_to_streamed_response_wrapper(
1503
+ admin.update_credential_field,
1504
+ )
1505
+ self.update_scope = async_to_streamed_response_wrapper(
1506
+ admin.update_scope,
1507
+ )
1508
+ self.upload_logo = async_to_streamed_response_wrapper(
1509
+ admin.upload_logo,
1510
+ )