composio 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (270) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +11 -0
  3. data/Gemfile.lock +93 -0
  4. data/README.md +1779 -0
  5. data/Rakefile +10 -0
  6. data/composio.gemspec +39 -0
  7. data/header.png +0 -0
  8. data/lib/composio/api/actions_api.rb +1062 -0
  9. data/lib/composio/api/api_keys_api.rb +268 -0
  10. data/lib/composio/api/apps_api.rb +266 -0
  11. data/lib/composio/api/auth_api.rb +370 -0
  12. data/lib/composio/api/cli_api.rb +266 -0
  13. data/lib/composio/api/connections_api.rb +591 -0
  14. data/lib/composio/api/integrations_api.rb +578 -0
  15. data/lib/composio/api/logs_api.rb +166 -0
  16. data/lib/composio/api/metadata_api.rb +180 -0
  17. data/lib/composio/api/team_api.rb +188 -0
  18. data/lib/composio/api/triggers_api.rb +1222 -0
  19. data/lib/composio/api_client.rb +436 -0
  20. data/lib/composio/api_client_custom.rb +14 -0
  21. data/lib/composio/api_error.rb +53 -0
  22. data/lib/composio/configuration.rb +330 -0
  23. data/lib/composio/models/action_details.rb +357 -0
  24. data/lib/composio/models/action_details_minimal.rb +329 -0
  25. data/lib/composio/models/action_execution_req_dto.rb +260 -0
  26. data/lib/composio/models/action_execution_res_dto.rb +238 -0
  27. data/lib/composio/models/action_log_data.rb +345 -0
  28. data/lib/composio/models/action_metadata.rb +402 -0
  29. data/lib/composio/models/action_metadata_type.rb +101 -0
  30. data/lib/composio/models/actions_controller_v1.rb +222 -0
  31. data/lib/composio/models/actions_list_response_dto.rb +250 -0
  32. data/lib/composio/models/actions_minimal_list_response_dto.rb +250 -0
  33. data/lib/composio/models/actions_query_dto.rb +300 -0
  34. data/lib/composio/models/active_trigger_instance.rb +311 -0
  35. data/lib/composio/models/active_triggers_res_dto.rb +238 -0
  36. data/lib/composio/models/add_repo_url_req_dto.rb +221 -0
  37. data/lib/composio/models/add_repo_url_res_dto.rb +221 -0
  38. data/lib/composio/models/add_tools_req_dto.rb +251 -0
  39. data/lib/composio/models/add_tools_request_dto.rb +251 -0
  40. data/lib/composio/models/api_key_res_dto.rb +323 -0
  41. data/lib/composio/models/app_info_response_dto.rb +323 -0
  42. data/lib/composio/models/app_list_res_dto.rb +238 -0
  43. data/lib/composio/models/app_query_dto.rb +216 -0
  44. data/lib/composio/models/auth_config_dto.rb +229 -0
  45. data/lib/composio/models/cli_query_dto.rb +231 -0
  46. data/lib/composio/models/connected_account_response_dto.rb +331 -0
  47. data/lib/composio/models/connection_params.rb +395 -0
  48. data/lib/composio/models/connection_params_for_account.rb +323 -0
  49. data/lib/composio/models/connection_params_headers.rb +224 -0
  50. data/lib/composio/models/connection_with_app_data.rb +358 -0
  51. data/lib/composio/models/connection_with_app_data_created_at.rb +101 -0
  52. data/lib/composio/models/connector_list_item_dto.rb +376 -0
  53. data/lib/composio/models/connector_list_item_dto_created_at.rb +102 -0
  54. data/lib/composio/models/connector_list_item_dto_updated_at.rb +102 -0
  55. data/lib/composio/models/create_connector_payload_dto.rb +274 -0
  56. data/lib/composio/models/create_connector_payload_dto_use_composio_auth.rb +226 -0
  57. data/lib/composio/models/delete_api_key_req_dto.rb +221 -0
  58. data/lib/composio/models/delete_api_key_response_dto.rb +221 -0
  59. data/lib/composio/models/delete_row_apidto.rb +236 -0
  60. data/lib/composio/models/delete_tools_req_dto.rb +221 -0
  61. data/lib/composio/models/delete_tools_res_dto.rb +221 -0
  62. data/lib/composio/models/direct_execute_req_dto.rb +262 -0
  63. data/lib/composio/models/enable_trigger_body_dto.rb +221 -0
  64. data/lib/composio/models/enable_trigger_params_dto.rb +236 -0
  65. data/lib/composio/models/execute_action_res_dto.rb +236 -0
  66. data/lib/composio/models/generate_api_key_req_dto.rb +221 -0
  67. data/lib/composio/models/generate_cli_session_req_dto.rb +221 -0
  68. data/lib/composio/models/generate_cli_session_res_dto.rb +221 -0
  69. data/lib/composio/models/get_active_triggers_query_dto.rb +276 -0
  70. data/lib/composio/models/get_cli_session_res_dto.rb +236 -0
  71. data/lib/composio/models/get_connections_query_dto.rb +287 -0
  72. data/lib/composio/models/get_connections_response_dto.rb +250 -0
  73. data/lib/composio/models/get_connections_result.rb +236 -0
  74. data/lib/composio/models/get_connector_info_res_dto.rb +417 -0
  75. data/lib/composio/models/get_connector_list_res_dto.rb +253 -0
  76. data/lib/composio/models/get_logs_dto.rb +288 -0
  77. data/lib/composio/models/get_logs_query_dto.rb +246 -0
  78. data/lib/composio/models/get_trigger_params_dto.rb +221 -0
  79. data/lib/composio/models/get_trigger_response_dto.rb +230 -0
  80. data/lib/composio/models/handle_trigger_body_dto.rb +221 -0
  81. data/lib/composio/models/handle_trigger_params_dto.rb +236 -0
  82. data/lib/composio/models/identify_client_req_dto.rb +231 -0
  83. data/lib/composio/models/identify_client_res_dto.rb +251 -0
  84. data/lib/composio/models/initiate_connection_payload_dto.rb +281 -0
  85. data/lib/composio/models/initiate_connection_response.rb +272 -0
  86. data/lib/composio/models/invite_member_req_dto.rb +251 -0
  87. data/lib/composio/models/job_status.rb +37 -0
  88. data/lib/composio/models/list_triggers_query_dto.rb +246 -0
  89. data/lib/composio/models/logout_res_dto.rb +221 -0
  90. data/lib/composio/models/logs_res_dto.rb +233 -0
  91. data/lib/composio/models/magic_link_req_dto.rb +236 -0
  92. data/lib/composio/models/magic_link_res_dto.rb +220 -0
  93. data/lib/composio/models/member_res_dto.rb +305 -0
  94. data/lib/composio/models/meta.rb +220 -0
  95. data/lib/composio/models/meta_app.rb +220 -0
  96. data/lib/composio/models/metadata_query_dto.rb +221 -0
  97. data/lib/composio/models/metadata_req_dto.rb +232 -0
  98. data/lib/composio/models/o_auth2_callback_query_dto.rb +220 -0
  99. data/lib/composio/models/open_api_spec_list_res_dto.rb +436 -0
  100. data/lib/composio/models/page_info.rb +338 -0
  101. data/lib/composio/models/page_info_dto.rb +248 -0
  102. data/lib/composio/models/patch_connector_req_dto.rb +226 -0
  103. data/lib/composio/models/patch_connector_res_dto.rb +221 -0
  104. data/lib/composio/models/proxy_execution_req_dto.rb +234 -0
  105. data/lib/composio/models/redirect_uri_dto.rb +215 -0
  106. data/lib/composio/models/set_callback_url_body_dto.rb +221 -0
  107. data/lib/composio/models/single_app_info_res_dto.rb +394 -0
  108. data/lib/composio/models/single_trigger_res_dto.rb +336 -0
  109. data/lib/composio/models/status.rb +37 -0
  110. data/lib/composio/models/switch_trigger_status_body_dto.rb +221 -0
  111. data/lib/composio/models/switch_trigger_status_params_dto.rb +221 -0
  112. data/lib/composio/models/time.rb +41 -0
  113. data/lib/composio/models/toggle_connected_account_response_dto.rb +220 -0
  114. data/lib/composio/models/toggle_trigger_state_response_dto.rb +220 -0
  115. data/lib/composio/models/tools_execute_req_dto.rb +275 -0
  116. data/lib/composio/models/track_client_req_dto.rb +240 -0
  117. data/lib/composio/models/track_client_res_dto.rb +221 -0
  118. data/lib/composio/models/trigger_config.rb +237 -0
  119. data/lib/composio/models/trigger_instance_params_dto.rb +221 -0
  120. data/lib/composio/models/trigger_log_data.rb +345 -0
  121. data/lib/composio/models/trigger_log_item_dto.rb +336 -0
  122. data/lib/composio/models/trigger_logs_res_dto.rb +236 -0
  123. data/lib/composio/models/trigger_metadata.rb +402 -0
  124. data/lib/composio/models/trigger_metadata_dto.rb +347 -0
  125. data/lib/composio/models/trigger_metadata_type.rb +101 -0
  126. data/lib/composio/models/trigger_res_dto.rb +361 -0
  127. data/lib/composio/models/trigger_response_dto.rb +241 -0
  128. data/lib/composio/models/trigger_toggle_info_response_dto.rb +221 -0
  129. data/lib/composio/models/triggers_enabled_toggle_req_dto.rb +221 -0
  130. data/lib/composio/models/triggers_enabled_toggle_res_dto.rb +221 -0
  131. data/lib/composio/models/type.rb +37 -0
  132. data/lib/composio/models/user_git_user_info.rb +230 -0
  133. data/lib/composio/models/verify_cli_code_res_dto.rb +251 -0
  134. data/lib/composio/models/verify_magic_link_data_dto.rb +263 -0
  135. data/lib/composio/models/verify_magic_link_req_dto.rb +221 -0
  136. data/lib/composio/models/verify_magic_link_res_dto.rb +230 -0
  137. data/lib/composio/models/webhook_url_response_dto.rb +231 -0
  138. data/lib/composio/version.rb +11 -0
  139. data/lib/composio.rb +214 -0
  140. data/spec/api/actions_api_spec.rb +164 -0
  141. data/spec/api/api_keys_api_spec.rb +61 -0
  142. data/spec/api/apps_api_spec.rb +63 -0
  143. data/spec/api/auth_api_spec.rb +73 -0
  144. data/spec/api/cli_api_spec.rb +63 -0
  145. data/spec/api/connections_api_spec.rb +103 -0
  146. data/spec/api/integrations_api_spec.rb +96 -0
  147. data/spec/api/logs_api_spec.rb +48 -0
  148. data/spec/api/metadata_api_spec.rb +50 -0
  149. data/spec/api/team_api_spec.rb +50 -0
  150. data/spec/api/triggers_api_spec.rb +188 -0
  151. data/spec/api_client_spec.rb +191 -0
  152. data/spec/configuration_spec.rb +38 -0
  153. data/spec/models/action_details_minimal_spec.rb +76 -0
  154. data/spec/models/action_details_spec.rb +88 -0
  155. data/spec/models/action_execution_req_dto_spec.rb +58 -0
  156. data/spec/models/action_execution_res_dto_spec.rb +40 -0
  157. data/spec/models/action_log_data_spec.rb +70 -0
  158. data/spec/models/action_metadata_spec.rb +88 -0
  159. data/spec/models/action_metadata_type_spec.rb +25 -0
  160. data/spec/models/actions_controller_v1_spec.rb +28 -0
  161. data/spec/models/actions_list_response_dto_spec.rb +40 -0
  162. data/spec/models/actions_minimal_list_response_dto_spec.rb +40 -0
  163. data/spec/models/actions_query_dto_spec.rb +82 -0
  164. data/spec/models/active_trigger_instance_spec.rb +70 -0
  165. data/spec/models/active_triggers_res_dto_spec.rb +34 -0
  166. data/spec/models/add_repo_url_req_dto_spec.rb +28 -0
  167. data/spec/models/add_repo_url_res_dto_spec.rb +28 -0
  168. data/spec/models/add_tools_req_dto_spec.rb +40 -0
  169. data/spec/models/add_tools_request_dto_spec.rb +40 -0
  170. data/spec/models/api_key_res_dto_spec.rb +52 -0
  171. data/spec/models/app_info_response_dto_spec.rb +70 -0
  172. data/spec/models/app_list_res_dto_spec.rb +34 -0
  173. data/spec/models/app_query_dto_spec.rb +28 -0
  174. data/spec/models/auth_config_dto_spec.rb +34 -0
  175. data/spec/models/cli_query_dto_spec.rb +34 -0
  176. data/spec/models/connected_account_response_dto_spec.rb +82 -0
  177. data/spec/models/connection_params_for_account_spec.rb +100 -0
  178. data/spec/models/connection_params_headers_spec.rb +34 -0
  179. data/spec/models/connection_params_spec.rb +118 -0
  180. data/spec/models/connection_with_app_data_created_at_spec.rb +25 -0
  181. data/spec/models/connection_with_app_data_spec.rb +100 -0
  182. data/spec/models/connector_list_item_dto_created_at_spec.rb +25 -0
  183. data/spec/models/connector_list_item_dto_spec.rb +94 -0
  184. data/spec/models/connector_list_item_dto_updated_at_spec.rb +25 -0
  185. data/spec/models/create_connector_payload_dto_spec.rb +58 -0
  186. data/spec/models/create_connector_payload_dto_use_composio_auth_spec.rb +22 -0
  187. data/spec/models/delete_api_key_req_dto_spec.rb +28 -0
  188. data/spec/models/delete_api_key_response_dto_spec.rb +28 -0
  189. data/spec/models/delete_row_apidto_spec.rb +34 -0
  190. data/spec/models/delete_tools_req_dto_spec.rb +28 -0
  191. data/spec/models/delete_tools_res_dto_spec.rb +28 -0
  192. data/spec/models/direct_execute_req_dto_spec.rb +46 -0
  193. data/spec/models/enable_trigger_body_dto_spec.rb +28 -0
  194. data/spec/models/enable_trigger_params_dto_spec.rb +34 -0
  195. data/spec/models/execute_action_res_dto_spec.rb +34 -0
  196. data/spec/models/generate_api_key_req_dto_spec.rb +28 -0
  197. data/spec/models/generate_cli_session_req_dto_spec.rb +28 -0
  198. data/spec/models/generate_cli_session_res_dto_spec.rb +28 -0
  199. data/spec/models/get_active_triggers_query_dto_spec.rb +64 -0
  200. data/spec/models/get_cli_session_res_dto_spec.rb +34 -0
  201. data/spec/models/get_connections_query_dto_spec.rb +76 -0
  202. data/spec/models/get_connections_response_dto_spec.rb +40 -0
  203. data/spec/models/get_connections_result_spec.rb +34 -0
  204. data/spec/models/get_connector_info_res_dto_spec.rb +106 -0
  205. data/spec/models/get_connector_list_res_dto_spec.rb +40 -0
  206. data/spec/models/get_logs_dto_spec.rb +70 -0
  207. data/spec/models/get_logs_query_dto_spec.rb +46 -0
  208. data/spec/models/get_trigger_params_dto_spec.rb +28 -0
  209. data/spec/models/get_trigger_response_dto_spec.rb +34 -0
  210. data/spec/models/handle_trigger_body_dto_spec.rb +28 -0
  211. data/spec/models/handle_trigger_params_dto_spec.rb +34 -0
  212. data/spec/models/identify_client_req_dto_spec.rb +34 -0
  213. data/spec/models/identify_client_res_dto_spec.rb +40 -0
  214. data/spec/models/initiate_connection_payload_dto_spec.rb +46 -0
  215. data/spec/models/initiate_connection_response_spec.rb +34 -0
  216. data/spec/models/invite_member_req_dto_spec.rb +40 -0
  217. data/spec/models/job_status_spec.rb +22 -0
  218. data/spec/models/list_triggers_query_dto_spec.rb +46 -0
  219. data/spec/models/logout_res_dto_spec.rb +28 -0
  220. data/spec/models/logs_res_dto_spec.rb +34 -0
  221. data/spec/models/magic_link_req_dto_spec.rb +34 -0
  222. data/spec/models/magic_link_res_dto_spec.rb +28 -0
  223. data/spec/models/member_res_dto_spec.rb +52 -0
  224. data/spec/models/meta_app_spec.rb +28 -0
  225. data/spec/models/meta_spec.rb +28 -0
  226. data/spec/models/metadata_query_dto_spec.rb +28 -0
  227. data/spec/models/metadata_req_dto_spec.rb +34 -0
  228. data/spec/models/o_auth2_callback_query_dto_spec.rb +28 -0
  229. data/spec/models/open_api_spec_list_res_dto_spec.rb +94 -0
  230. data/spec/models/page_info_dto_spec.rb +40 -0
  231. data/spec/models/page_info_spec.rb +46 -0
  232. data/spec/models/patch_connector_req_dto_spec.rb +34 -0
  233. data/spec/models/patch_connector_res_dto_spec.rb +28 -0
  234. data/spec/models/proxy_execution_req_dto_spec.rb +34 -0
  235. data/spec/models/redirect_uri_dto_spec.rb +28 -0
  236. data/spec/models/set_callback_url_body_dto_spec.rb +28 -0
  237. data/spec/models/single_app_info_res_dto_spec.rb +118 -0
  238. data/spec/models/single_trigger_res_dto_spec.rb +76 -0
  239. data/spec/models/status_spec.rb +22 -0
  240. data/spec/models/switch_trigger_status_body_dto_spec.rb +28 -0
  241. data/spec/models/switch_trigger_status_params_dto_spec.rb +28 -0
  242. data/spec/models/time_spec.rb +22 -0
  243. data/spec/models/toggle_connected_account_response_dto_spec.rb +28 -0
  244. data/spec/models/toggle_trigger_state_response_dto_spec.rb +28 -0
  245. data/spec/models/tools_execute_req_dto_spec.rb +58 -0
  246. data/spec/models/track_client_req_dto_spec.rb +40 -0
  247. data/spec/models/track_client_res_dto_spec.rb +28 -0
  248. data/spec/models/trigger_config_spec.rb +34 -0
  249. data/spec/models/trigger_instance_params_dto_spec.rb +28 -0
  250. data/spec/models/trigger_log_data_spec.rb +70 -0
  251. data/spec/models/trigger_log_item_dto_spec.rb +82 -0
  252. data/spec/models/trigger_logs_res_dto_spec.rb +34 -0
  253. data/spec/models/trigger_metadata_dto_spec.rb +82 -0
  254. data/spec/models/trigger_metadata_spec.rb +94 -0
  255. data/spec/models/trigger_metadata_type_spec.rb +25 -0
  256. data/spec/models/trigger_res_dto_spec.rb +100 -0
  257. data/spec/models/trigger_response_dto_spec.rb +40 -0
  258. data/spec/models/trigger_toggle_info_response_dto_spec.rb +28 -0
  259. data/spec/models/triggers_enabled_toggle_req_dto_spec.rb +28 -0
  260. data/spec/models/triggers_enabled_toggle_res_dto_spec.rb +28 -0
  261. data/spec/models/type_spec.rb +22 -0
  262. data/spec/models/user_git_user_info_spec.rb +34 -0
  263. data/spec/models/verify_cli_code_res_dto_spec.rb +40 -0
  264. data/spec/models/verify_magic_link_data_dto_spec.rb +46 -0
  265. data/spec/models/verify_magic_link_req_dto_spec.rb +28 -0
  266. data/spec/models/verify_magic_link_res_dto_spec.rb +34 -0
  267. data/spec/models/webhook_url_response_dto_spec.rb +34 -0
  268. data/spec/simple_test_spec.rb +52 -0
  269. data/spec/spec_helper.rb +107 -0
  270. metadata +504 -0
@@ -0,0 +1,591 @@
1
+ =begin
2
+ #Composio OpenAPI
3
+
4
+ #Composio SDK: Equip your agent with high-quality tools and build your real-world usecase
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'cgi'
10
+
11
+ module Composio
12
+ class ConnectionsApi
13
+ attr_accessor :api_client
14
+
15
+ def initialize(api_client = ApiClient.default)
16
+ @api_client = api_client
17
+ end
18
+
19
+ # Delete connection
20
+ #
21
+ # @param connected_account_id [String]
22
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
23
+ def delete(connected_account_id:, extra: {})
24
+ api_response = delete_with_http_info_impl(connected_account_id, extra)
25
+ api_response.data
26
+ end
27
+
28
+ # Delete connection
29
+ #
30
+ # @param connected_account_id [String]
31
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
32
+ def delete_with_http_info(connected_account_id:, extra: {})
33
+ delete_with_http_info_impl(connected_account_id, extra)
34
+ end
35
+
36
+ # Delete connection
37
+ # @param connected_account_id [String]
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [DeleteRowAPIDTO]
40
+ private def delete_impl(connected_account_id, opts = {})
41
+ data, _status_code, _headers = delete_with_http_info(connected_account_id, opts)
42
+ data
43
+ end
44
+
45
+ # Delete connection
46
+ # @param connected_account_id [String]
47
+ # @param [Hash] opts the optional parameters
48
+ # @return [APIResponse] data is DeleteRowAPIDTO, status code, headers and response
49
+ private def delete_with_http_info_impl(connected_account_id, opts = {})
50
+ if @api_client.config.debugging
51
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.delete ...'
52
+ end
53
+ # verify the required parameter 'connected_account_id' is set
54
+ if @api_client.config.client_side_validation && connected_account_id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'connected_account_id' when calling ConnectionsApi.delete"
56
+ end
57
+ pattern = Regexp.new(/[^\/#\?]+?/)
58
+ if @api_client.config.client_side_validation && connected_account_id !~ pattern
59
+ fail ArgumentError, "invalid value for 'connected_account_id' when calling ConnectionsApi.delete, must conform to the pattern #{pattern}."
60
+ end
61
+
62
+ # resource path
63
+ local_var_path = '/api/v1/connectedAccounts/{connectedAccountId}'.sub('{' + 'connectedAccountId' + '}', CGI.escape(connected_account_id.to_s))
64
+
65
+ # query parameters
66
+ query_params = opts[:query_params] || {}
67
+
68
+ # header parameters
69
+ header_params = opts[:header_params] || {}
70
+ # HTTP header 'Accept' (if needed)
71
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
72
+
73
+ # form parameters
74
+ form_params = opts[:form_params] || {}
75
+
76
+ # http body (model)
77
+ post_body = opts[:debug_body]
78
+
79
+ # return_type
80
+ return_type = opts[:debug_return_type] || 'DeleteRowAPIDTO'
81
+
82
+ # auth_names
83
+ auth_names = opts[:debug_auth_names] || ['api_key']
84
+
85
+ new_options = opts.merge(
86
+ :operation => :"ConnectionsApi.delete",
87
+ :header_params => header_params,
88
+ :query_params => query_params,
89
+ :form_params => form_params,
90
+ :body => post_body,
91
+ :auth_names => auth_names,
92
+ :return_type => return_type
93
+ )
94
+
95
+ data, status_code, headers, response = @api_client.call_api(:DELETE, local_var_path, new_options)
96
+ if @api_client.config.debugging
97
+ @api_client.config.logger.debug "API called: ConnectionsApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
+ end
99
+ APIResponse::new(data, status_code, headers, response)
100
+ end
101
+
102
+
103
+ # Disable connection
104
+ #
105
+ # @param connected_account_id [String]
106
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
107
+ def disable(connected_account_id:, extra: {})
108
+ api_response = disable_with_http_info_impl(connected_account_id, extra)
109
+ api_response.data
110
+ end
111
+
112
+ # Disable connection
113
+ #
114
+ # @param connected_account_id [String]
115
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
116
+ def disable_with_http_info(connected_account_id:, extra: {})
117
+ disable_with_http_info_impl(connected_account_id, extra)
118
+ end
119
+
120
+ # Disable connection
121
+ # @param connected_account_id [String]
122
+ # @param [Hash] opts the optional parameters
123
+ # @return [ToggleConnectedAccountResponseDTO]
124
+ private def disable_impl(connected_account_id, opts = {})
125
+ data, _status_code, _headers = disable_with_http_info(connected_account_id, opts)
126
+ data
127
+ end
128
+
129
+ # Disable connection
130
+ # @param connected_account_id [String]
131
+ # @param [Hash] opts the optional parameters
132
+ # @return [APIResponse] data is ToggleConnectedAccountResponseDTO, status code, headers and response
133
+ private def disable_with_http_info_impl(connected_account_id, opts = {})
134
+ if @api_client.config.debugging
135
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.disable ...'
136
+ end
137
+ # verify the required parameter 'connected_account_id' is set
138
+ if @api_client.config.client_side_validation && connected_account_id.nil?
139
+ fail ArgumentError, "Missing the required parameter 'connected_account_id' when calling ConnectionsApi.disable"
140
+ end
141
+ pattern = Regexp.new(/[^\/#\?]+?/)
142
+ if @api_client.config.client_side_validation && connected_account_id !~ pattern
143
+ fail ArgumentError, "invalid value for 'connected_account_id' when calling ConnectionsApi.disable, must conform to the pattern #{pattern}."
144
+ end
145
+
146
+ # resource path
147
+ local_var_path = '/api/v1/connectedAccounts/{connectedAccountId}/disable'.sub('{' + 'connectedAccountId' + '}', CGI.escape(connected_account_id.to_s))
148
+
149
+ # query parameters
150
+ query_params = opts[:query_params] || {}
151
+
152
+ # header parameters
153
+ header_params = opts[:header_params] || {}
154
+ # HTTP header 'Accept' (if needed)
155
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
156
+
157
+ # form parameters
158
+ form_params = opts[:form_params] || {}
159
+
160
+ # http body (model)
161
+ post_body = opts[:debug_body]
162
+
163
+ # return_type
164
+ return_type = opts[:debug_return_type] || 'ToggleConnectedAccountResponseDTO'
165
+
166
+ # auth_names
167
+ auth_names = opts[:debug_auth_names] || ['api_key']
168
+
169
+ new_options = opts.merge(
170
+ :operation => :"ConnectionsApi.disable",
171
+ :header_params => header_params,
172
+ :query_params => query_params,
173
+ :form_params => form_params,
174
+ :body => post_body,
175
+ :auth_names => auth_names,
176
+ :return_type => return_type
177
+ )
178
+
179
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
180
+ if @api_client.config.debugging
181
+ @api_client.config.logger.debug "API called: ConnectionsApi#disable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
182
+ end
183
+ APIResponse::new(data, status_code, headers, response)
184
+ end
185
+
186
+
187
+ # Enable connection
188
+ #
189
+ # @param connected_account_id [String]
190
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
191
+ def enable(connected_account_id:, extra: {})
192
+ api_response = enable_with_http_info_impl(connected_account_id, extra)
193
+ api_response.data
194
+ end
195
+
196
+ # Enable connection
197
+ #
198
+ # @param connected_account_id [String]
199
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
200
+ def enable_with_http_info(connected_account_id:, extra: {})
201
+ enable_with_http_info_impl(connected_account_id, extra)
202
+ end
203
+
204
+ # Enable connection
205
+ # @param connected_account_id [String]
206
+ # @param [Hash] opts the optional parameters
207
+ # @return [ToggleConnectedAccountResponseDTO]
208
+ private def enable_impl(connected_account_id, opts = {})
209
+ data, _status_code, _headers = enable_with_http_info(connected_account_id, opts)
210
+ data
211
+ end
212
+
213
+ # Enable connection
214
+ # @param connected_account_id [String]
215
+ # @param [Hash] opts the optional parameters
216
+ # @return [APIResponse] data is ToggleConnectedAccountResponseDTO, status code, headers and response
217
+ private def enable_with_http_info_impl(connected_account_id, opts = {})
218
+ if @api_client.config.debugging
219
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.enable ...'
220
+ end
221
+ # verify the required parameter 'connected_account_id' is set
222
+ if @api_client.config.client_side_validation && connected_account_id.nil?
223
+ fail ArgumentError, "Missing the required parameter 'connected_account_id' when calling ConnectionsApi.enable"
224
+ end
225
+ pattern = Regexp.new(/[^\/#\?]+?/)
226
+ if @api_client.config.client_side_validation && connected_account_id !~ pattern
227
+ fail ArgumentError, "invalid value for 'connected_account_id' when calling ConnectionsApi.enable, must conform to the pattern #{pattern}."
228
+ end
229
+
230
+ # resource path
231
+ local_var_path = '/api/v1/connectedAccounts/{connectedAccountId}/enable'.sub('{' + 'connectedAccountId' + '}', CGI.escape(connected_account_id.to_s))
232
+
233
+ # query parameters
234
+ query_params = opts[:query_params] || {}
235
+
236
+ # header parameters
237
+ header_params = opts[:header_params] || {}
238
+ # HTTP header 'Accept' (if needed)
239
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
240
+
241
+ # form parameters
242
+ form_params = opts[:form_params] || {}
243
+
244
+ # http body (model)
245
+ post_body = opts[:debug_body]
246
+
247
+ # return_type
248
+ return_type = opts[:debug_return_type] || 'ToggleConnectedAccountResponseDTO'
249
+
250
+ # auth_names
251
+ auth_names = opts[:debug_auth_names] || ['api_key']
252
+
253
+ new_options = opts.merge(
254
+ :operation => :"ConnectionsApi.enable",
255
+ :header_params => header_params,
256
+ :query_params => query_params,
257
+ :form_params => form_params,
258
+ :body => post_body,
259
+ :auth_names => auth_names,
260
+ :return_type => return_type
261
+ )
262
+
263
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
264
+ if @api_client.config.debugging
265
+ @api_client.config.logger.debug "API called: ConnectionsApi#enable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
266
+ end
267
+ APIResponse::new(data, status_code, headers, response)
268
+ end
269
+
270
+
271
+ # Get connection
272
+ #
273
+ # @param connected_account_id [String]
274
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
275
+ def get(connected_account_id:, extra: {})
276
+ api_response = get_with_http_info_impl(connected_account_id, extra)
277
+ api_response.data
278
+ end
279
+
280
+ # Get connection
281
+ #
282
+ # @param connected_account_id [String]
283
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
284
+ def get_with_http_info(connected_account_id:, extra: {})
285
+ get_with_http_info_impl(connected_account_id, extra)
286
+ end
287
+
288
+ # Get connection
289
+ # @param connected_account_id [String]
290
+ # @param [Hash] opts the optional parameters
291
+ # @return [ConnectedAccountResponseDTO]
292
+ private def get_impl(connected_account_id, opts = {})
293
+ data, _status_code, _headers = get_with_http_info(connected_account_id, opts)
294
+ data
295
+ end
296
+
297
+ # Get connection
298
+ # @param connected_account_id [String]
299
+ # @param [Hash] opts the optional parameters
300
+ # @return [APIResponse] data is ConnectedAccountResponseDTO, status code, headers and response
301
+ private def get_with_http_info_impl(connected_account_id, opts = {})
302
+ if @api_client.config.debugging
303
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.get ...'
304
+ end
305
+ # verify the required parameter 'connected_account_id' is set
306
+ if @api_client.config.client_side_validation && connected_account_id.nil?
307
+ fail ArgumentError, "Missing the required parameter 'connected_account_id' when calling ConnectionsApi.get"
308
+ end
309
+ pattern = Regexp.new(/[^\/#\?]+?/)
310
+ if @api_client.config.client_side_validation && connected_account_id !~ pattern
311
+ fail ArgumentError, "invalid value for 'connected_account_id' when calling ConnectionsApi.get, must conform to the pattern #{pattern}."
312
+ end
313
+
314
+ # resource path
315
+ local_var_path = '/api/v1/connectedAccounts/{connectedAccountId}'.sub('{' + 'connectedAccountId' + '}', CGI.escape(connected_account_id.to_s))
316
+
317
+ # query parameters
318
+ query_params = opts[:query_params] || {}
319
+
320
+ # header parameters
321
+ header_params = opts[:header_params] || {}
322
+ # HTTP header 'Accept' (if needed)
323
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
324
+
325
+ # form parameters
326
+ form_params = opts[:form_params] || {}
327
+
328
+ # http body (model)
329
+ post_body = opts[:debug_body]
330
+
331
+ # return_type
332
+ return_type = opts[:debug_return_type] || 'ConnectedAccountResponseDTO'
333
+
334
+ # auth_names
335
+ auth_names = opts[:debug_auth_names] || ['api_key']
336
+
337
+ new_options = opts.merge(
338
+ :operation => :"ConnectionsApi.get",
339
+ :header_params => header_params,
340
+ :query_params => query_params,
341
+ :form_params => form_params,
342
+ :body => post_body,
343
+ :auth_names => auth_names,
344
+ :return_type => return_type
345
+ )
346
+
347
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
348
+ if @api_client.config.debugging
349
+ @api_client.config.logger.debug "API called: ConnectionsApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
350
+ end
351
+ APIResponse::new(data, status_code, headers, response)
352
+ end
353
+
354
+
355
+ # Initiate connection
356
+ #
357
+ # @param integration_id [String]
358
+ # @param data [String]
359
+ # @param redirect_uri [String]
360
+ # @param user_uuid [String]
361
+ # @param body [InitiateConnectionPayloadDto]
362
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
363
+ def initiate(integration_id:, data: SENTINEL, redirect_uri: SENTINEL, user_uuid: SENTINEL, extra: {})
364
+ _body = {}
365
+ _body[:data] = data if data != SENTINEL
366
+ _body[:integrationId] = integration_id if integration_id != SENTINEL
367
+ _body[:redirectUri] = redirect_uri if redirect_uri != SENTINEL
368
+ _body[:userUuid] = user_uuid if user_uuid != SENTINEL
369
+ extra[:initiate_connection_payload_dto] = _body if !_body.empty?
370
+ api_response = initiate_with_http_info_impl(extra)
371
+ api_response.data
372
+ end
373
+
374
+ # Initiate connection
375
+ #
376
+ # @param integration_id [String]
377
+ # @param data [String]
378
+ # @param redirect_uri [String]
379
+ # @param user_uuid [String]
380
+ # @param body [InitiateConnectionPayloadDto]
381
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
382
+ def initiate_with_http_info(integration_id:, data: SENTINEL, redirect_uri: SENTINEL, user_uuid: SENTINEL, extra: {})
383
+ _body = {}
384
+ _body[:data] = data if data != SENTINEL
385
+ _body[:integrationId] = integration_id if integration_id != SENTINEL
386
+ _body[:redirectUri] = redirect_uri if redirect_uri != SENTINEL
387
+ _body[:userUuid] = user_uuid if user_uuid != SENTINEL
388
+ extra[:initiate_connection_payload_dto] = _body if !_body.empty?
389
+ initiate_with_http_info_impl(extra)
390
+ end
391
+
392
+ # Initiate connection
393
+ # @param [Hash] opts the optional parameters
394
+ # @option opts [InitiateConnectionPayloadDto] :initiate_connection_payload_dto InitiateConnectionPayloadDto
395
+ # @return [InitiateConnectionResponse]
396
+ private def initiate_impl(opts = {})
397
+ data, _status_code, _headers = initiate_with_http_info(opts)
398
+ data
399
+ end
400
+
401
+ # Initiate connection
402
+ # @param [Hash] opts the optional parameters
403
+ # @option opts [InitiateConnectionPayloadDto] :initiate_connection_payload_dto InitiateConnectionPayloadDto
404
+ # @return [APIResponse] data is InitiateConnectionResponse, status code, headers and response
405
+ private def initiate_with_http_info_impl(opts = {})
406
+ if @api_client.config.debugging
407
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.initiate ...'
408
+ end
409
+ # resource path
410
+ local_var_path = '/api/v1/connectedAccounts'
411
+
412
+ # query parameters
413
+ query_params = opts[:query_params] || {}
414
+
415
+ # header parameters
416
+ header_params = opts[:header_params] || {}
417
+ # HTTP header 'Accept' (if needed)
418
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
419
+ # HTTP header 'Content-Type'
420
+ content_type = @api_client.select_header_content_type(['application/json'])
421
+ if !content_type.nil?
422
+ header_params['Content-Type'] = content_type
423
+ end
424
+
425
+ # form parameters
426
+ form_params = opts[:form_params] || {}
427
+
428
+ # http body (model)
429
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'initiate_connection_payload_dto'])
430
+
431
+ # return_type
432
+ return_type = opts[:debug_return_type] || 'InitiateConnectionResponse'
433
+
434
+ # auth_names
435
+ auth_names = opts[:debug_auth_names] || ['api_key']
436
+
437
+ new_options = opts.merge(
438
+ :operation => :"ConnectionsApi.initiate",
439
+ :header_params => header_params,
440
+ :query_params => query_params,
441
+ :form_params => form_params,
442
+ :body => post_body,
443
+ :auth_names => auth_names,
444
+ :return_type => return_type
445
+ )
446
+
447
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
448
+ if @api_client.config.debugging
449
+ @api_client.config.logger.debug "API called: ConnectionsApi#initiate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
450
+ end
451
+ APIResponse::new(data, status_code, headers, response)
452
+ end
453
+
454
+
455
+ # Get connections
456
+ #
457
+ # @param page [Float]
458
+ # @param page_size [Float]
459
+ # @param app_names [String]
460
+ # @param integration_id [String]
461
+ # @param connection_id [String]
462
+ # @param user_uuid [String]
463
+ # @param show_active_only [Boolean]
464
+ # @param status [String]
465
+ # @param show_disabled [Boolean]
466
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
467
+ def list(page: SENTINEL, page_size: SENTINEL, app_names: SENTINEL, integration_id: SENTINEL, connection_id: SENTINEL, user_uuid: SENTINEL, show_active_only: SENTINEL, status: SENTINEL, show_disabled: SENTINEL, extra: {})
468
+ extra[:page] = page if page != SENTINEL
469
+ extra[:page_size] = page_size if page_size != SENTINEL
470
+ extra[:app_names] = app_names if app_names != SENTINEL
471
+ extra[:integration_id] = integration_id if integration_id != SENTINEL
472
+ extra[:connection_id] = connection_id if connection_id != SENTINEL
473
+ extra[:user_uuid] = user_uuid if user_uuid != SENTINEL
474
+ extra[:show_active_only] = show_active_only if show_active_only != SENTINEL
475
+ extra[:status] = status if status != SENTINEL
476
+ extra[:show_disabled] = show_disabled if show_disabled != SENTINEL
477
+ api_response = list_with_http_info_impl(extra)
478
+ api_response.data
479
+ end
480
+
481
+ # Get connections
482
+ #
483
+ # @param page [Float]
484
+ # @param page_size [Float]
485
+ # @param app_names [String]
486
+ # @param integration_id [String]
487
+ # @param connection_id [String]
488
+ # @param user_uuid [String]
489
+ # @param show_active_only [Boolean]
490
+ # @param status [String]
491
+ # @param show_disabled [Boolean]
492
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
493
+ def list_with_http_info(page: SENTINEL, page_size: SENTINEL, app_names: SENTINEL, integration_id: SENTINEL, connection_id: SENTINEL, user_uuid: SENTINEL, show_active_only: SENTINEL, status: SENTINEL, show_disabled: SENTINEL, extra: {})
494
+ extra[:page] = page if page != SENTINEL
495
+ extra[:page_size] = page_size if page_size != SENTINEL
496
+ extra[:app_names] = app_names if app_names != SENTINEL
497
+ extra[:integration_id] = integration_id if integration_id != SENTINEL
498
+ extra[:connection_id] = connection_id if connection_id != SENTINEL
499
+ extra[:user_uuid] = user_uuid if user_uuid != SENTINEL
500
+ extra[:show_active_only] = show_active_only if show_active_only != SENTINEL
501
+ extra[:status] = status if status != SENTINEL
502
+ extra[:show_disabled] = show_disabled if show_disabled != SENTINEL
503
+ list_with_http_info_impl(extra)
504
+ end
505
+
506
+ # Get connections
507
+ # @param [Hash] opts the optional parameters
508
+ # @option opts [Float] :page
509
+ # @option opts [Float] :page_size
510
+ # @option opts [String] :app_names
511
+ # @option opts [String] :integration_id
512
+ # @option opts [String] :connection_id
513
+ # @option opts [String] :user_uuid
514
+ # @option opts [Boolean] :show_active_only
515
+ # @option opts [String] :status
516
+ # @option opts [Boolean] :show_disabled
517
+ # @return [GetConnectionsResponseDto]
518
+ private def list_impl(opts = {})
519
+ data, _status_code, _headers = list_with_http_info(opts)
520
+ data
521
+ end
522
+
523
+ # Get connections
524
+ # @param [Hash] opts the optional parameters
525
+ # @option opts [Float] :page
526
+ # @option opts [Float] :page_size
527
+ # @option opts [String] :app_names
528
+ # @option opts [String] :integration_id
529
+ # @option opts [String] :connection_id
530
+ # @option opts [String] :user_uuid
531
+ # @option opts [Boolean] :show_active_only
532
+ # @option opts [String] :status
533
+ # @option opts [Boolean] :show_disabled
534
+ # @return [APIResponse] data is GetConnectionsResponseDto, status code, headers and response
535
+ private def list_with_http_info_impl(opts = {})
536
+ if @api_client.config.debugging
537
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.list ...'
538
+ end
539
+ # resource path
540
+ local_var_path = '/api/v1/connectedAccounts'
541
+
542
+ # query parameters
543
+ query_params = opts[:query_params] || {}
544
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
545
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
546
+ query_params[:'appNames'] = opts[:'app_names'] if !opts[:'app_names'].nil?
547
+ query_params[:'integrationId'] = opts[:'integration_id'] if !opts[:'integration_id'].nil?
548
+ query_params[:'connectionId'] = opts[:'connection_id'] if !opts[:'connection_id'].nil?
549
+ query_params[:'user_uuid'] = opts[:'user_uuid'] if !opts[:'user_uuid'].nil?
550
+ query_params[:'showActiveOnly'] = opts[:'show_active_only'] if !opts[:'show_active_only'].nil?
551
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
552
+ query_params[:'showDisabled'] = opts[:'show_disabled'] if !opts[:'show_disabled'].nil?
553
+
554
+ # header parameters
555
+ header_params = opts[:header_params] || {}
556
+ # HTTP header 'Accept' (if needed)
557
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
558
+
559
+ # form parameters
560
+ form_params = opts[:form_params] || {}
561
+
562
+ # http body (model)
563
+ post_body = opts[:debug_body]
564
+
565
+ # return_type
566
+ return_type = opts[:debug_return_type] || 'GetConnectionsResponseDto'
567
+
568
+ # auth_names
569
+ auth_names = opts[:debug_auth_names] || ['api_key']
570
+
571
+ new_options = opts.merge(
572
+ :operation => :"ConnectionsApi.list",
573
+ :header_params => header_params,
574
+ :query_params => query_params,
575
+ :form_params => form_params,
576
+ :body => post_body,
577
+ :auth_names => auth_names,
578
+ :return_type => return_type
579
+ )
580
+
581
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
582
+ if @api_client.config.debugging
583
+ @api_client.config.logger.debug "API called: ConnectionsApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
584
+ end
585
+ APIResponse::new(data, status_code, headers, response)
586
+ end
587
+ end
588
+
589
+ # top-level client access to avoid having the user to insantiate their own API instances
590
+ Connections = ConnectionsApi::new
591
+ end