robosystems-client 0.1.9__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.

Potentially problematic release.


This version of robosystems-client might be problematic. Click here for more details.

Files changed (282) hide show
  1. robosystems_client/__init__.py +14 -0
  2. robosystems_client/api/__init__.py +1 -0
  3. robosystems_client/api/agent/__init__.py +1 -0
  4. robosystems_client/api/agent/query_financial_agent.py +423 -0
  5. robosystems_client/api/auth/__init__.py +1 -0
  6. robosystems_client/api/auth/check_password_strength.py +172 -0
  7. robosystems_client/api/auth/complete_sso_auth.py +177 -0
  8. robosystems_client/api/auth/generate_sso_token.py +174 -0
  9. robosystems_client/api/auth/get_captcha_config.py +87 -0
  10. robosystems_client/api/auth/get_current_auth_user.py +220 -0
  11. robosystems_client/api/auth/get_password_policy.py +134 -0
  12. robosystems_client/api/auth/login_user.py +181 -0
  13. robosystems_client/api/auth/logout_user.py +169 -0
  14. robosystems_client/api/auth/refresh_session.py +174 -0
  15. robosystems_client/api/auth/register_user.py +189 -0
  16. robosystems_client/api/auth/sso_login.py +177 -0
  17. robosystems_client/api/auth/sso_token_exchange.py +181 -0
  18. robosystems_client/api/backup/__init__.py +1 -0
  19. robosystems_client/api/backup/create_backup.py +401 -0
  20. robosystems_client/api/backup/export_backup.py +225 -0
  21. robosystems_client/api/backup/get_backup_download_url.py +258 -0
  22. robosystems_client/api/backup/get_backup_stats.py +182 -0
  23. robosystems_client/api/backup/kuzu_backup_health.py +202 -0
  24. robosystems_client/api/backup/list_backups.py +217 -0
  25. robosystems_client/api/backup/restore_backup.py +401 -0
  26. robosystems_client/api/billing/__init__.py +1 -0
  27. robosystems_client/api/billing/get_available_subscription_plans_v1_graph_id_billing_available_plans_get.py +198 -0
  28. robosystems_client/api/billing/get_credit_billing_info_v1_graph_id_billing_credits_get.py +210 -0
  29. robosystems_client/api/billing/get_current_graph_bill.py +285 -0
  30. robosystems_client/api/billing/get_graph_billing_history.py +329 -0
  31. robosystems_client/api/billing/get_graph_monthly_bill.py +315 -0
  32. robosystems_client/api/billing/get_graph_pricing_info_v1_graph_id_billing_pricing_get.py +198 -0
  33. robosystems_client/api/billing/get_graph_subscription_v1_graph_id_billing_subscription_get.py +198 -0
  34. robosystems_client/api/billing/get_graph_usage_details.py +350 -0
  35. robosystems_client/api/billing/upgrade_graph_subscription_v1_graph_id_billing_subscription_upgrade_post.py +216 -0
  36. robosystems_client/api/connections/__init__.py +1 -0
  37. robosystems_client/api/connections/create_connection.py +327 -0
  38. robosystems_client/api/connections/create_link_token.py +281 -0
  39. robosystems_client/api/connections/delete_connection.py +278 -0
  40. robosystems_client/api/connections/exchange_link_token.py +301 -0
  41. robosystems_client/api/connections/get_connection.py +262 -0
  42. robosystems_client/api/connections/get_connection_options.py +285 -0
  43. robosystems_client/api/connections/init_o_auth.py +230 -0
  44. robosystems_client/api/connections/list_connections.py +314 -0
  45. robosystems_client/api/connections/oauth_callback.py +318 -0
  46. robosystems_client/api/connections/sync_connection.py +362 -0
  47. robosystems_client/api/create/__init__.py +1 -0
  48. robosystems_client/api/create/create_graph.py +375 -0
  49. robosystems_client/api/create/get_available_extensions.py +134 -0
  50. robosystems_client/api/credits_/__init__.py +1 -0
  51. robosystems_client/api/credits_/check_credit_balance.py +299 -0
  52. robosystems_client/api/credits_/check_storage_limits.py +249 -0
  53. robosystems_client/api/credits_/get_credit_summary.py +245 -0
  54. robosystems_client/api/credits_/get_storage_usage.py +279 -0
  55. robosystems_client/api/credits_/list_credit_transactions.py +392 -0
  56. robosystems_client/api/graph_analytics/__init__.py +1 -0
  57. robosystems_client/api/graph_analytics/get_graph_metrics.py +285 -0
  58. robosystems_client/api/graph_analytics/get_graph_usage_stats.py +329 -0
  59. robosystems_client/api/graph_status/__init__.py +1 -0
  60. robosystems_client/api/graph_status/get_database_health.py +273 -0
  61. robosystems_client/api/graph_status/get_database_info.py +277 -0
  62. robosystems_client/api/mcp/__init__.py +1 -0
  63. robosystems_client/api/mcp/call_mcp_tool.py +432 -0
  64. robosystems_client/api/mcp/list_mcp_tools.py +265 -0
  65. robosystems_client/api/operations/__init__.py +1 -0
  66. robosystems_client/api/operations/cancel_operation.py +246 -0
  67. robosystems_client/api/operations/get_operation_status.py +273 -0
  68. robosystems_client/api/operations/stream_operation_events.py +415 -0
  69. robosystems_client/api/query/__init__.py +1 -0
  70. robosystems_client/api/query/execute_cypher_query.py +482 -0
  71. robosystems_client/api/schema/__init__.py +1 -0
  72. robosystems_client/api/schema/export_graph_schema.py +239 -0
  73. robosystems_client/api/schema/get_graph_schema_info.py +277 -0
  74. robosystems_client/api/schema/list_schema_extensions.py +216 -0
  75. robosystems_client/api/schema/validate_schema.py +326 -0
  76. robosystems_client/api/service_offerings/__init__.py +1 -0
  77. robosystems_client/api/service_offerings/get_service_offerings.py +197 -0
  78. robosystems_client/api/status/__init__.py +1 -0
  79. robosystems_client/api/status/get_mcp_health.py +136 -0
  80. robosystems_client/api/status/get_service_status.py +134 -0
  81. robosystems_client/api/user/__init__.py +1 -0
  82. robosystems_client/api/user/create_user_api_key.py +205 -0
  83. robosystems_client/api/user/get_all_credit_summaries.py +256 -0
  84. robosystems_client/api/user/get_current_user.py +187 -0
  85. robosystems_client/api/user/get_user_graphs.py +187 -0
  86. robosystems_client/api/user/list_user_api_keys.py +187 -0
  87. robosystems_client/api/user/revoke_user_api_key.py +209 -0
  88. robosystems_client/api/user/select_user_graph.py +213 -0
  89. robosystems_client/api/user/update_user.py +205 -0
  90. robosystems_client/api/user/update_user_api_key.py +218 -0
  91. robosystems_client/api/user/update_user_password.py +218 -0
  92. robosystems_client/api/user_analytics/__init__.py +1 -0
  93. robosystems_client/api/user_analytics/get_detailed_user_analytics.py +222 -0
  94. robosystems_client/api/user_analytics/get_user_usage_overview.py +187 -0
  95. robosystems_client/api/user_limits/__init__.py +1 -0
  96. robosystems_client/api/user_limits/get_user_limits.py +190 -0
  97. robosystems_client/api/user_limits/get_user_usage.py +187 -0
  98. robosystems_client/api/user_subscriptions/__init__.py +1 -0
  99. robosystems_client/api/user_subscriptions/cancel_shared_repository_subscription.py +209 -0
  100. robosystems_client/api/user_subscriptions/get_repository_credits.py +206 -0
  101. robosystems_client/api/user_subscriptions/get_shared_repository_credits.py +193 -0
  102. robosystems_client/api/user_subscriptions/get_user_shared_subscriptions.py +213 -0
  103. robosystems_client/api/user_subscriptions/subscribe_to_shared_repository.py +214 -0
  104. robosystems_client/api/user_subscriptions/upgrade_shared_repository_subscription.py +228 -0
  105. robosystems_client/client.py +278 -0
  106. robosystems_client/errors.py +16 -0
  107. robosystems_client/extensions/README.md +611 -0
  108. robosystems_client/extensions/__init__.py +108 -0
  109. robosystems_client/extensions/auth_integration.py +210 -0
  110. robosystems_client/extensions/extensions.py +170 -0
  111. robosystems_client/extensions/operation_client.py +368 -0
  112. robosystems_client/extensions/query_client.py +375 -0
  113. robosystems_client/extensions/sse_client.py +520 -0
  114. robosystems_client/extensions/tests/__init__.py +1 -0
  115. robosystems_client/extensions/tests/test_integration.py +490 -0
  116. robosystems_client/extensions/tests/test_unit.py +560 -0
  117. robosystems_client/extensions/utils.py +526 -0
  118. robosystems_client/models/__init__.py +379 -0
  119. robosystems_client/models/account_info.py +79 -0
  120. robosystems_client/models/add_on_credit_info.py +119 -0
  121. robosystems_client/models/agent_message.py +68 -0
  122. robosystems_client/models/agent_request.py +132 -0
  123. robosystems_client/models/agent_request_context_type_0.py +44 -0
  124. robosystems_client/models/agent_response.py +132 -0
  125. robosystems_client/models/agent_response_metadata_type_0.py +44 -0
  126. robosystems_client/models/api_key_info.py +134 -0
  127. robosystems_client/models/api_keys_response.py +74 -0
  128. robosystems_client/models/auth_response.py +82 -0
  129. robosystems_client/models/auth_response_user.py +44 -0
  130. robosystems_client/models/available_extension.py +78 -0
  131. robosystems_client/models/available_extensions_response.py +73 -0
  132. robosystems_client/models/backup_create_request.py +117 -0
  133. robosystems_client/models/backup_export_request.py +72 -0
  134. robosystems_client/models/backup_list_response.py +90 -0
  135. robosystems_client/models/backup_response.py +200 -0
  136. robosystems_client/models/backup_restore_request.py +81 -0
  137. robosystems_client/models/backup_stats_response.py +156 -0
  138. robosystems_client/models/backup_stats_response_backup_formats.py +44 -0
  139. robosystems_client/models/cancel_operation_response_canceloperation.py +44 -0
  140. robosystems_client/models/cancellation_response.py +76 -0
  141. robosystems_client/models/check_credit_balance_response_checkcreditbalance.py +44 -0
  142. robosystems_client/models/connection_options_response.py +82 -0
  143. robosystems_client/models/connection_provider_info.py +203 -0
  144. robosystems_client/models/connection_provider_info_auth_type.py +11 -0
  145. robosystems_client/models/connection_provider_info_provider.py +10 -0
  146. robosystems_client/models/connection_response.py +149 -0
  147. robosystems_client/models/connection_response_metadata.py +44 -0
  148. robosystems_client/models/connection_response_provider.py +10 -0
  149. robosystems_client/models/create_api_key_request.py +82 -0
  150. robosystems_client/models/create_api_key_response.py +74 -0
  151. robosystems_client/models/create_connection_request.py +179 -0
  152. robosystems_client/models/create_connection_request_provider.py +10 -0
  153. robosystems_client/models/create_graph_request.py +183 -0
  154. robosystems_client/models/credit_check_request.py +82 -0
  155. robosystems_client/models/credit_summary.py +128 -0
  156. robosystems_client/models/credit_summary_response.py +140 -0
  157. robosystems_client/models/credits_summary_response.py +122 -0
  158. robosystems_client/models/credits_summary_response_credits_by_addon_item.py +44 -0
  159. robosystems_client/models/custom_schema_definition.py +194 -0
  160. robosystems_client/models/custom_schema_definition_metadata.py +49 -0
  161. robosystems_client/models/custom_schema_definition_nodes_item.py +44 -0
  162. robosystems_client/models/custom_schema_definition_relationships_item.py +44 -0
  163. robosystems_client/models/cypher_query_request.py +128 -0
  164. robosystems_client/models/cypher_query_request_parameters_type_0.py +44 -0
  165. robosystems_client/models/database_health_response.py +181 -0
  166. robosystems_client/models/database_info_response.py +191 -0
  167. robosystems_client/models/detailed_transactions_response.py +124 -0
  168. robosystems_client/models/detailed_transactions_response_date_range.py +44 -0
  169. robosystems_client/models/detailed_transactions_response_summary.py +59 -0
  170. robosystems_client/models/enhanced_credit_transaction_response.py +192 -0
  171. robosystems_client/models/enhanced_credit_transaction_response_metadata.py +44 -0
  172. robosystems_client/models/error_response.py +145 -0
  173. robosystems_client/models/exchange_token_request.py +116 -0
  174. robosystems_client/models/exchange_token_request_metadata_type_0.py +44 -0
  175. robosystems_client/models/get_all_credit_summaries_response_getallcreditsummaries.py +44 -0
  176. robosystems_client/models/get_backup_download_url_response_getbackupdownloadurl.py +44 -0
  177. robosystems_client/models/get_current_auth_user_response_getcurrentauthuser.py +44 -0
  178. robosystems_client/models/get_current_graph_bill_response_getcurrentgraphbill.py +44 -0
  179. robosystems_client/models/get_graph_billing_history_response_getgraphbillinghistory.py +44 -0
  180. robosystems_client/models/get_graph_monthly_bill_response_getgraphmonthlybill.py +44 -0
  181. robosystems_client/models/get_graph_schema_info_response_getgraphschemainfo.py +44 -0
  182. robosystems_client/models/get_graph_usage_details_response_getgraphusagedetails.py +44 -0
  183. robosystems_client/models/get_mcp_health_response_getmcphealth.py +44 -0
  184. robosystems_client/models/get_operation_status_response_getoperationstatus.py +44 -0
  185. robosystems_client/models/get_storage_usage_response_getstorageusage.py +44 -0
  186. robosystems_client/models/graph_info.py +92 -0
  187. robosystems_client/models/graph_metadata.py +105 -0
  188. robosystems_client/models/graph_metrics_response.py +188 -0
  189. robosystems_client/models/graph_metrics_response_estimated_size.py +44 -0
  190. robosystems_client/models/graph_metrics_response_health_status.py +44 -0
  191. robosystems_client/models/graph_metrics_response_node_counts.py +44 -0
  192. robosystems_client/models/graph_metrics_response_relationship_counts.py +44 -0
  193. robosystems_client/models/graph_usage_response.py +116 -0
  194. robosystems_client/models/graph_usage_response_query_statistics.py +44 -0
  195. robosystems_client/models/graph_usage_response_recent_activity.py +44 -0
  196. robosystems_client/models/graph_usage_response_storage_usage.py +44 -0
  197. robosystems_client/models/health_status.py +110 -0
  198. robosystems_client/models/health_status_details_type_0.py +44 -0
  199. robosystems_client/models/http_validation_error.py +75 -0
  200. robosystems_client/models/initial_entity_data.py +212 -0
  201. robosystems_client/models/kuzu_backup_health_response_kuzubackuphealth.py +44 -0
  202. robosystems_client/models/link_token_request.py +174 -0
  203. robosystems_client/models/link_token_request_options_type_0.py +44 -0
  204. robosystems_client/models/link_token_request_provider_type_0.py +10 -0
  205. robosystems_client/models/list_connections_provider_type_0.py +10 -0
  206. robosystems_client/models/list_schema_extensions_response_listschemaextensions.py +44 -0
  207. robosystems_client/models/login_request.py +68 -0
  208. robosystems_client/models/logout_user_response_logoutuser.py +44 -0
  209. robosystems_client/models/mcp_tool_call.py +84 -0
  210. robosystems_client/models/mcp_tool_call_arguments.py +44 -0
  211. robosystems_client/models/mcp_tools_response.py +74 -0
  212. robosystems_client/models/mcp_tools_response_tools_item.py +44 -0
  213. robosystems_client/models/o_auth_callback_request.py +130 -0
  214. robosystems_client/models/o_auth_init_request.py +128 -0
  215. robosystems_client/models/o_auth_init_request_additional_params_type_0.py +44 -0
  216. robosystems_client/models/o_auth_init_response.py +78 -0
  217. robosystems_client/models/password_check_request.py +82 -0
  218. robosystems_client/models/password_check_response.py +112 -0
  219. robosystems_client/models/password_check_response_character_types.py +44 -0
  220. robosystems_client/models/password_policy_response.py +66 -0
  221. robosystems_client/models/password_policy_response_policy.py +44 -0
  222. robosystems_client/models/plaid_connection_config.py +209 -0
  223. robosystems_client/models/plaid_connection_config_accounts_type_0_item.py +44 -0
  224. robosystems_client/models/plaid_connection_config_institution_type_0.py +44 -0
  225. robosystems_client/models/quick_books_connection_config.py +92 -0
  226. robosystems_client/models/register_request.py +98 -0
  227. robosystems_client/models/repository_credits_response.py +101 -0
  228. robosystems_client/models/repository_plan.py +10 -0
  229. robosystems_client/models/repository_type.py +10 -0
  230. robosystems_client/models/response_mode.py +11 -0
  231. robosystems_client/models/schema_export_response.py +163 -0
  232. robosystems_client/models/schema_export_response_data_stats_type_0.py +44 -0
  233. robosystems_client/models/schema_export_response_schema_definition_type_0.py +44 -0
  234. robosystems_client/models/schema_validation_request.py +142 -0
  235. robosystems_client/models/schema_validation_request_schema_definition_type_0.py +44 -0
  236. robosystems_client/models/schema_validation_response.py +227 -0
  237. robosystems_client/models/schema_validation_response_compatibility_type_0.py +44 -0
  238. robosystems_client/models/schema_validation_response_stats_type_0.py +44 -0
  239. robosystems_client/models/sec_connection_config.py +82 -0
  240. robosystems_client/models/sso_complete_request.py +60 -0
  241. robosystems_client/models/sso_exchange_request.py +90 -0
  242. robosystems_client/models/sso_exchange_response.py +78 -0
  243. robosystems_client/models/sso_login_request.py +60 -0
  244. robosystems_client/models/sso_token_response.py +78 -0
  245. robosystems_client/models/storage_limit_response.py +149 -0
  246. robosystems_client/models/subscription_info.py +180 -0
  247. robosystems_client/models/subscription_info_metadata.py +44 -0
  248. robosystems_client/models/subscription_request.py +89 -0
  249. robosystems_client/models/subscription_response.py +82 -0
  250. robosystems_client/models/success_response.py +112 -0
  251. robosystems_client/models/success_response_data_type_0.py +44 -0
  252. robosystems_client/models/sync_connection_request.py +106 -0
  253. robosystems_client/models/sync_connection_request_sync_options_type_0.py +44 -0
  254. robosystems_client/models/sync_connection_response_syncconnection.py +44 -0
  255. robosystems_client/models/tier_upgrade_request.py +62 -0
  256. robosystems_client/models/transaction_summary_response.py +126 -0
  257. robosystems_client/models/update_api_key_request.py +92 -0
  258. robosystems_client/models/update_password_request.py +76 -0
  259. robosystems_client/models/update_user_request.py +92 -0
  260. robosystems_client/models/upgrade_subscription_request.py +82 -0
  261. robosystems_client/models/user_analytics_response.py +132 -0
  262. robosystems_client/models/user_analytics_response_api_usage.py +44 -0
  263. robosystems_client/models/user_analytics_response_graph_usage.py +44 -0
  264. robosystems_client/models/user_analytics_response_limits.py +44 -0
  265. robosystems_client/models/user_analytics_response_recent_activity_item.py +44 -0
  266. robosystems_client/models/user_analytics_response_user_info.py +44 -0
  267. robosystems_client/models/user_graph_summary.py +134 -0
  268. robosystems_client/models/user_graphs_response.py +96 -0
  269. robosystems_client/models/user_limits_response.py +95 -0
  270. robosystems_client/models/user_response.py +132 -0
  271. robosystems_client/models/user_subscriptions_response.py +90 -0
  272. robosystems_client/models/user_usage_response.py +90 -0
  273. robosystems_client/models/user_usage_response_graphs.py +44 -0
  274. robosystems_client/models/user_usage_summary_response.py +130 -0
  275. robosystems_client/models/user_usage_summary_response_usage_vs_limits.py +44 -0
  276. robosystems_client/models/validation_error.py +88 -0
  277. robosystems_client/py.typed +1 -0
  278. robosystems_client/sdk-config.yaml +5 -0
  279. robosystems_client/types.py +54 -0
  280. robosystems_client-0.1.9.dist-info/METADATA +302 -0
  281. robosystems_client-0.1.9.dist-info/RECORD +282 -0
  282. robosystems_client-0.1.9.dist-info/WHEEL +4 -0
@@ -0,0 +1,318 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error_response import ErrorResponse
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...models.o_auth_callback_request import OAuthCallbackRequest
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ graph_id: str,
16
+ provider: str,
17
+ *,
18
+ body: OAuthCallbackRequest,
19
+ authorization: Union[None, Unset, str] = UNSET,
20
+ auth_token: Union[None, Unset, str] = UNSET,
21
+ ) -> dict[str, Any]:
22
+ headers: dict[str, Any] = {}
23
+ if not isinstance(authorization, Unset):
24
+ headers["authorization"] = authorization
25
+
26
+ cookies = {}
27
+ if auth_token is not UNSET:
28
+ cookies["auth-token"] = auth_token
29
+
30
+ _kwargs: dict[str, Any] = {
31
+ "method": "post",
32
+ "url": f"/v1/{graph_id}/connections/oauth/callback/{provider}",
33
+ "cookies": cookies,
34
+ }
35
+
36
+ _kwargs["json"] = body.to_dict()
37
+
38
+ headers["Content-Type"] = "application/json"
39
+
40
+ _kwargs["headers"] = headers
41
+ return _kwargs
42
+
43
+
44
+ def _parse_response(
45
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
46
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError]]:
47
+ if response.status_code == 200:
48
+ response_200 = response.json()
49
+ return response_200
50
+ if response.status_code == 400:
51
+ response_400 = ErrorResponse.from_dict(response.json())
52
+
53
+ return response_400
54
+ if response.status_code == 403:
55
+ response_403 = ErrorResponse.from_dict(response.json())
56
+
57
+ return response_403
58
+ if response.status_code == 404:
59
+ response_404 = ErrorResponse.from_dict(response.json())
60
+
61
+ return response_404
62
+ if response.status_code == 500:
63
+ response_500 = ErrorResponse.from_dict(response.json())
64
+
65
+ return response_500
66
+ if response.status_code == 422:
67
+ response_422 = HTTPValidationError.from_dict(response.json())
68
+
69
+ return response_422
70
+ if client.raise_on_unexpected_status:
71
+ raise errors.UnexpectedStatus(response.status_code, response.content)
72
+ else:
73
+ return None
74
+
75
+
76
+ def _build_response(
77
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
78
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError]]:
79
+ return Response(
80
+ status_code=HTTPStatus(response.status_code),
81
+ content=response.content,
82
+ headers=response.headers,
83
+ parsed=_parse_response(client=client, response=response),
84
+ )
85
+
86
+
87
+ def sync_detailed(
88
+ graph_id: str,
89
+ provider: str,
90
+ *,
91
+ client: AuthenticatedClient,
92
+ body: OAuthCallbackRequest,
93
+ authorization: Union[None, Unset, str] = UNSET,
94
+ auth_token: Union[None, Unset, str] = UNSET,
95
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError]]:
96
+ """OAuth Callback
97
+
98
+ Handle OAuth callback from provider after user authorization.
99
+
100
+ This endpoint completes the OAuth flow:
101
+ 1. Validates the OAuth state parameter
102
+ 2. Exchanges authorization code for access tokens
103
+ 3. Stores tokens securely
104
+ 4. Updates connection status
105
+ 5. Optionally triggers initial sync
106
+
107
+ Supported providers:
108
+ - **QuickBooks**: Accounting data integration
109
+
110
+ Security measures:
111
+ - State validation prevents CSRF attacks
112
+ - User context is verified
113
+ - Tokens are encrypted before storage
114
+ - Full audit trail is maintained
115
+
116
+ No credits are consumed for OAuth callbacks.
117
+
118
+ Args:
119
+ graph_id (str): Graph database identifier
120
+ provider (str): OAuth provider name
121
+ authorization (Union[None, Unset, str]):
122
+ auth_token (Union[None, Unset, str]):
123
+ body (OAuthCallbackRequest): OAuth callback parameters.
124
+
125
+ Raises:
126
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
127
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
128
+
129
+ Returns:
130
+ Response[Union[Any, ErrorResponse, HTTPValidationError]]
131
+ """
132
+
133
+ kwargs = _get_kwargs(
134
+ graph_id=graph_id,
135
+ provider=provider,
136
+ body=body,
137
+ authorization=authorization,
138
+ auth_token=auth_token,
139
+ )
140
+
141
+ response = client.get_httpx_client().request(
142
+ **kwargs,
143
+ )
144
+
145
+ return _build_response(client=client, response=response)
146
+
147
+
148
+ def sync(
149
+ graph_id: str,
150
+ provider: str,
151
+ *,
152
+ client: AuthenticatedClient,
153
+ body: OAuthCallbackRequest,
154
+ authorization: Union[None, Unset, str] = UNSET,
155
+ auth_token: Union[None, Unset, str] = UNSET,
156
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError]]:
157
+ """OAuth Callback
158
+
159
+ Handle OAuth callback from provider after user authorization.
160
+
161
+ This endpoint completes the OAuth flow:
162
+ 1. Validates the OAuth state parameter
163
+ 2. Exchanges authorization code for access tokens
164
+ 3. Stores tokens securely
165
+ 4. Updates connection status
166
+ 5. Optionally triggers initial sync
167
+
168
+ Supported providers:
169
+ - **QuickBooks**: Accounting data integration
170
+
171
+ Security measures:
172
+ - State validation prevents CSRF attacks
173
+ - User context is verified
174
+ - Tokens are encrypted before storage
175
+ - Full audit trail is maintained
176
+
177
+ No credits are consumed for OAuth callbacks.
178
+
179
+ Args:
180
+ graph_id (str): Graph database identifier
181
+ provider (str): OAuth provider name
182
+ authorization (Union[None, Unset, str]):
183
+ auth_token (Union[None, Unset, str]):
184
+ body (OAuthCallbackRequest): OAuth callback parameters.
185
+
186
+ Raises:
187
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
188
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
189
+
190
+ Returns:
191
+ Union[Any, ErrorResponse, HTTPValidationError]
192
+ """
193
+
194
+ return sync_detailed(
195
+ graph_id=graph_id,
196
+ provider=provider,
197
+ client=client,
198
+ body=body,
199
+ authorization=authorization,
200
+ auth_token=auth_token,
201
+ ).parsed
202
+
203
+
204
+ async def asyncio_detailed(
205
+ graph_id: str,
206
+ provider: str,
207
+ *,
208
+ client: AuthenticatedClient,
209
+ body: OAuthCallbackRequest,
210
+ authorization: Union[None, Unset, str] = UNSET,
211
+ auth_token: Union[None, Unset, str] = UNSET,
212
+ ) -> Response[Union[Any, ErrorResponse, HTTPValidationError]]:
213
+ """OAuth Callback
214
+
215
+ Handle OAuth callback from provider after user authorization.
216
+
217
+ This endpoint completes the OAuth flow:
218
+ 1. Validates the OAuth state parameter
219
+ 2. Exchanges authorization code for access tokens
220
+ 3. Stores tokens securely
221
+ 4. Updates connection status
222
+ 5. Optionally triggers initial sync
223
+
224
+ Supported providers:
225
+ - **QuickBooks**: Accounting data integration
226
+
227
+ Security measures:
228
+ - State validation prevents CSRF attacks
229
+ - User context is verified
230
+ - Tokens are encrypted before storage
231
+ - Full audit trail is maintained
232
+
233
+ No credits are consumed for OAuth callbacks.
234
+
235
+ Args:
236
+ graph_id (str): Graph database identifier
237
+ provider (str): OAuth provider name
238
+ authorization (Union[None, Unset, str]):
239
+ auth_token (Union[None, Unset, str]):
240
+ body (OAuthCallbackRequest): OAuth callback parameters.
241
+
242
+ Raises:
243
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
244
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
245
+
246
+ Returns:
247
+ Response[Union[Any, ErrorResponse, HTTPValidationError]]
248
+ """
249
+
250
+ kwargs = _get_kwargs(
251
+ graph_id=graph_id,
252
+ provider=provider,
253
+ body=body,
254
+ authorization=authorization,
255
+ auth_token=auth_token,
256
+ )
257
+
258
+ response = await client.get_async_httpx_client().request(**kwargs)
259
+
260
+ return _build_response(client=client, response=response)
261
+
262
+
263
+ async def asyncio(
264
+ graph_id: str,
265
+ provider: str,
266
+ *,
267
+ client: AuthenticatedClient,
268
+ body: OAuthCallbackRequest,
269
+ authorization: Union[None, Unset, str] = UNSET,
270
+ auth_token: Union[None, Unset, str] = UNSET,
271
+ ) -> Optional[Union[Any, ErrorResponse, HTTPValidationError]]:
272
+ """OAuth Callback
273
+
274
+ Handle OAuth callback from provider after user authorization.
275
+
276
+ This endpoint completes the OAuth flow:
277
+ 1. Validates the OAuth state parameter
278
+ 2. Exchanges authorization code for access tokens
279
+ 3. Stores tokens securely
280
+ 4. Updates connection status
281
+ 5. Optionally triggers initial sync
282
+
283
+ Supported providers:
284
+ - **QuickBooks**: Accounting data integration
285
+
286
+ Security measures:
287
+ - State validation prevents CSRF attacks
288
+ - User context is verified
289
+ - Tokens are encrypted before storage
290
+ - Full audit trail is maintained
291
+
292
+ No credits are consumed for OAuth callbacks.
293
+
294
+ Args:
295
+ graph_id (str): Graph database identifier
296
+ provider (str): OAuth provider name
297
+ authorization (Union[None, Unset, str]):
298
+ auth_token (Union[None, Unset, str]):
299
+ body (OAuthCallbackRequest): OAuth callback parameters.
300
+
301
+ Raises:
302
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
303
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
304
+
305
+ Returns:
306
+ Union[Any, ErrorResponse, HTTPValidationError]
307
+ """
308
+
309
+ return (
310
+ await asyncio_detailed(
311
+ graph_id=graph_id,
312
+ provider=provider,
313
+ client=client,
314
+ body=body,
315
+ authorization=authorization,
316
+ auth_token=auth_token,
317
+ )
318
+ ).parsed
@@ -0,0 +1,362 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error_response import ErrorResponse
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...models.sync_connection_request import SyncConnectionRequest
11
+ from ...models.sync_connection_response_syncconnection import (
12
+ SyncConnectionResponseSyncconnection,
13
+ )
14
+ from ...types import UNSET, Response, Unset
15
+
16
+
17
+ def _get_kwargs(
18
+ graph_id: str,
19
+ connection_id: str,
20
+ *,
21
+ body: SyncConnectionRequest,
22
+ authorization: Union[None, Unset, str] = UNSET,
23
+ auth_token: Union[None, Unset, str] = UNSET,
24
+ ) -> dict[str, Any]:
25
+ headers: dict[str, Any] = {}
26
+ if not isinstance(authorization, Unset):
27
+ headers["authorization"] = authorization
28
+
29
+ cookies = {}
30
+ if auth_token is not UNSET:
31
+ cookies["auth-token"] = auth_token
32
+
33
+ _kwargs: dict[str, Any] = {
34
+ "method": "post",
35
+ "url": f"/v1/{graph_id}/connections/{connection_id}/sync",
36
+ "cookies": cookies,
37
+ }
38
+
39
+ _kwargs["json"] = body.to_dict()
40
+
41
+ headers["Content-Type"] = "application/json"
42
+
43
+ _kwargs["headers"] = headers
44
+ return _kwargs
45
+
46
+
47
+ def _parse_response(
48
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
49
+ ) -> Optional[
50
+ Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]
51
+ ]:
52
+ if response.status_code == 200:
53
+ response_200 = SyncConnectionResponseSyncconnection.from_dict(response.json())
54
+
55
+ return response_200
56
+ if response.status_code == 402:
57
+ response_402 = ErrorResponse.from_dict(response.json())
58
+
59
+ return response_402
60
+ if response.status_code == 403:
61
+ response_403 = ErrorResponse.from_dict(response.json())
62
+
63
+ return response_403
64
+ if response.status_code == 404:
65
+ response_404 = ErrorResponse.from_dict(response.json())
66
+
67
+ return response_404
68
+ if response.status_code == 500:
69
+ response_500 = ErrorResponse.from_dict(response.json())
70
+
71
+ return response_500
72
+ if response.status_code == 422:
73
+ response_422 = HTTPValidationError.from_dict(response.json())
74
+
75
+ return response_422
76
+ if client.raise_on_unexpected_status:
77
+ raise errors.UnexpectedStatus(response.status_code, response.content)
78
+ else:
79
+ return None
80
+
81
+
82
+ def _build_response(
83
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
84
+ ) -> Response[
85
+ Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]
86
+ ]:
87
+ return Response(
88
+ status_code=HTTPStatus(response.status_code),
89
+ content=response.content,
90
+ headers=response.headers,
91
+ parsed=_parse_response(client=client, response=response),
92
+ )
93
+
94
+
95
+ def sync_detailed(
96
+ graph_id: str,
97
+ connection_id: str,
98
+ *,
99
+ client: AuthenticatedClient,
100
+ body: SyncConnectionRequest,
101
+ authorization: Union[None, Unset, str] = UNSET,
102
+ auth_token: Union[None, Unset, str] = UNSET,
103
+ ) -> Response[
104
+ Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]
105
+ ]:
106
+ """Sync Connection
107
+
108
+ Trigger a data synchronization for the connection.
109
+
110
+ Initiates data sync based on provider type:
111
+
112
+ **SEC Sync**:
113
+ - Downloads latest filings from EDGAR
114
+ - Parses XBRL data and updates graph
115
+ - Typically completes in 5-10 minutes
116
+
117
+ **QuickBooks Sync**:
118
+ - Fetches latest transactions and balances
119
+ - Updates chart of accounts
120
+ - Generates fresh trial balance
121
+ - Duration depends on data volume
122
+
123
+ **Plaid Sync**:
124
+ - Retrieves recent bank transactions
125
+ - Updates account balances
126
+ - Categorizes new transactions
127
+
128
+ Credit consumption:
129
+ - Base cost: 20.0 credits
130
+ - Multiplied by graph tier
131
+ - Additional credits may be consumed during processing
132
+
133
+ Returns a task ID for monitoring sync progress.
134
+
135
+ Args:
136
+ graph_id (str): Graph database identifier
137
+ connection_id (str): Connection identifier
138
+ authorization (Union[None, Unset, str]):
139
+ auth_token (Union[None, Unset, str]):
140
+ body (SyncConnectionRequest): Request to sync a connection.
141
+
142
+ Raises:
143
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
144
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
145
+
146
+ Returns:
147
+ Response[Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]]
148
+ """
149
+
150
+ kwargs = _get_kwargs(
151
+ graph_id=graph_id,
152
+ connection_id=connection_id,
153
+ body=body,
154
+ authorization=authorization,
155
+ auth_token=auth_token,
156
+ )
157
+
158
+ response = client.get_httpx_client().request(
159
+ **kwargs,
160
+ )
161
+
162
+ return _build_response(client=client, response=response)
163
+
164
+
165
+ def sync(
166
+ graph_id: str,
167
+ connection_id: str,
168
+ *,
169
+ client: AuthenticatedClient,
170
+ body: SyncConnectionRequest,
171
+ authorization: Union[None, Unset, str] = UNSET,
172
+ auth_token: Union[None, Unset, str] = UNSET,
173
+ ) -> Optional[
174
+ Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]
175
+ ]:
176
+ """Sync Connection
177
+
178
+ Trigger a data synchronization for the connection.
179
+
180
+ Initiates data sync based on provider type:
181
+
182
+ **SEC Sync**:
183
+ - Downloads latest filings from EDGAR
184
+ - Parses XBRL data and updates graph
185
+ - Typically completes in 5-10 minutes
186
+
187
+ **QuickBooks Sync**:
188
+ - Fetches latest transactions and balances
189
+ - Updates chart of accounts
190
+ - Generates fresh trial balance
191
+ - Duration depends on data volume
192
+
193
+ **Plaid Sync**:
194
+ - Retrieves recent bank transactions
195
+ - Updates account balances
196
+ - Categorizes new transactions
197
+
198
+ Credit consumption:
199
+ - Base cost: 20.0 credits
200
+ - Multiplied by graph tier
201
+ - Additional credits may be consumed during processing
202
+
203
+ Returns a task ID for monitoring sync progress.
204
+
205
+ Args:
206
+ graph_id (str): Graph database identifier
207
+ connection_id (str): Connection identifier
208
+ authorization (Union[None, Unset, str]):
209
+ auth_token (Union[None, Unset, str]):
210
+ body (SyncConnectionRequest): Request to sync a connection.
211
+
212
+ Raises:
213
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
214
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
215
+
216
+ Returns:
217
+ Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]
218
+ """
219
+
220
+ return sync_detailed(
221
+ graph_id=graph_id,
222
+ connection_id=connection_id,
223
+ client=client,
224
+ body=body,
225
+ authorization=authorization,
226
+ auth_token=auth_token,
227
+ ).parsed
228
+
229
+
230
+ async def asyncio_detailed(
231
+ graph_id: str,
232
+ connection_id: str,
233
+ *,
234
+ client: AuthenticatedClient,
235
+ body: SyncConnectionRequest,
236
+ authorization: Union[None, Unset, str] = UNSET,
237
+ auth_token: Union[None, Unset, str] = UNSET,
238
+ ) -> Response[
239
+ Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]
240
+ ]:
241
+ """Sync Connection
242
+
243
+ Trigger a data synchronization for the connection.
244
+
245
+ Initiates data sync based on provider type:
246
+
247
+ **SEC Sync**:
248
+ - Downloads latest filings from EDGAR
249
+ - Parses XBRL data and updates graph
250
+ - Typically completes in 5-10 minutes
251
+
252
+ **QuickBooks Sync**:
253
+ - Fetches latest transactions and balances
254
+ - Updates chart of accounts
255
+ - Generates fresh trial balance
256
+ - Duration depends on data volume
257
+
258
+ **Plaid Sync**:
259
+ - Retrieves recent bank transactions
260
+ - Updates account balances
261
+ - Categorizes new transactions
262
+
263
+ Credit consumption:
264
+ - Base cost: 20.0 credits
265
+ - Multiplied by graph tier
266
+ - Additional credits may be consumed during processing
267
+
268
+ Returns a task ID for monitoring sync progress.
269
+
270
+ Args:
271
+ graph_id (str): Graph database identifier
272
+ connection_id (str): Connection identifier
273
+ authorization (Union[None, Unset, str]):
274
+ auth_token (Union[None, Unset, str]):
275
+ body (SyncConnectionRequest): Request to sync a connection.
276
+
277
+ Raises:
278
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
279
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
280
+
281
+ Returns:
282
+ Response[Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]]
283
+ """
284
+
285
+ kwargs = _get_kwargs(
286
+ graph_id=graph_id,
287
+ connection_id=connection_id,
288
+ body=body,
289
+ authorization=authorization,
290
+ auth_token=auth_token,
291
+ )
292
+
293
+ response = await client.get_async_httpx_client().request(**kwargs)
294
+
295
+ return _build_response(client=client, response=response)
296
+
297
+
298
+ async def asyncio(
299
+ graph_id: str,
300
+ connection_id: str,
301
+ *,
302
+ client: AuthenticatedClient,
303
+ body: SyncConnectionRequest,
304
+ authorization: Union[None, Unset, str] = UNSET,
305
+ auth_token: Union[None, Unset, str] = UNSET,
306
+ ) -> Optional[
307
+ Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]
308
+ ]:
309
+ """Sync Connection
310
+
311
+ Trigger a data synchronization for the connection.
312
+
313
+ Initiates data sync based on provider type:
314
+
315
+ **SEC Sync**:
316
+ - Downloads latest filings from EDGAR
317
+ - Parses XBRL data and updates graph
318
+ - Typically completes in 5-10 minutes
319
+
320
+ **QuickBooks Sync**:
321
+ - Fetches latest transactions and balances
322
+ - Updates chart of accounts
323
+ - Generates fresh trial balance
324
+ - Duration depends on data volume
325
+
326
+ **Plaid Sync**:
327
+ - Retrieves recent bank transactions
328
+ - Updates account balances
329
+ - Categorizes new transactions
330
+
331
+ Credit consumption:
332
+ - Base cost: 20.0 credits
333
+ - Multiplied by graph tier
334
+ - Additional credits may be consumed during processing
335
+
336
+ Returns a task ID for monitoring sync progress.
337
+
338
+ Args:
339
+ graph_id (str): Graph database identifier
340
+ connection_id (str): Connection identifier
341
+ authorization (Union[None, Unset, str]):
342
+ auth_token (Union[None, Unset, str]):
343
+ body (SyncConnectionRequest): Request to sync a connection.
344
+
345
+ Raises:
346
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
347
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
348
+
349
+ Returns:
350
+ Union[ErrorResponse, HTTPValidationError, SyncConnectionResponseSyncconnection]
351
+ """
352
+
353
+ return (
354
+ await asyncio_detailed(
355
+ graph_id=graph_id,
356
+ connection_id=connection_id,
357
+ client=client,
358
+ body=body,
359
+ authorization=authorization,
360
+ auth_token=auth_token,
361
+ )
362
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""