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,250 @@
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 'date'
10
+ require 'time'
11
+
12
+ module Composio
13
+ class ActionsMinimalListResponseDTO
14
+ attr_accessor :items
15
+
16
+ attr_accessor :page
17
+
18
+ attr_accessor :total_pages
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'items' => :'items',
24
+ :'page' => :'page',
25
+ :'total_pages' => :'totalPages'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'items' => :'Array<ActionDetailsMinimal>',
38
+ :'page' => :'Float',
39
+ :'total_pages' => :'Float'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::ActionsMinimalListResponseDTO` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::ActionsMinimalListResponseDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'items')
65
+ if (value = attributes[:'items']).is_a?(Array)
66
+ self.items = value
67
+ end
68
+ end
69
+
70
+ if attributes.key?(:'page')
71
+ self.page = attributes[:'page']
72
+ end
73
+
74
+ if attributes.key?(:'total_pages')
75
+ self.total_pages = attributes[:'total_pages']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @items.nil?
84
+ invalid_properties.push('invalid value for "items", items cannot be nil.')
85
+ end
86
+
87
+ if @page.nil?
88
+ invalid_properties.push('invalid value for "page", page cannot be nil.')
89
+ end
90
+
91
+ if @total_pages.nil?
92
+ invalid_properties.push('invalid value for "total_pages", total_pages cannot be nil.')
93
+ end
94
+
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ return false if @items.nil?
102
+ return false if @page.nil?
103
+ return false if @total_pages.nil?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ items == o.items &&
113
+ page == o.page &&
114
+ total_pages == o.total_pages
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [items, page, total_pages].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = Composio.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -0,0 +1,300 @@
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 'date'
10
+ require 'time'
11
+
12
+ module Composio
13
+ class ActionsQueryDTO
14
+ attr_accessor :tags
15
+
16
+ # Names of the apps
17
+ attr_accessor :app_names
18
+
19
+ # Use case
20
+ attr_accessor :use_case
21
+
22
+ # Show enabled only
23
+ attr_accessor :show_enabled_only
24
+
25
+ # Limit
26
+ attr_accessor :limit
27
+
28
+ attr_accessor :apps
29
+
30
+ attr_accessor :actions
31
+
32
+ attr_accessor :usecase_limit
33
+
34
+ attr_accessor :filter_important_actions
35
+
36
+ attr_accessor :show_all
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'tags' => :'tags',
42
+ :'app_names' => :'appNames',
43
+ :'use_case' => :'useCase',
44
+ :'show_enabled_only' => :'showEnabledOnly',
45
+ :'limit' => :'limit',
46
+ :'apps' => :'apps',
47
+ :'actions' => :'actions',
48
+ :'usecase_limit' => :'usecaseLimit',
49
+ :'filter_important_actions' => :'filterImportantActions',
50
+ :'show_all' => :'showAll'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'tags' => :'String',
63
+ :'app_names' => :'String',
64
+ :'use_case' => :'String',
65
+ :'show_enabled_only' => :'Boolean',
66
+ :'limit' => :'Float',
67
+ :'apps' => :'String',
68
+ :'actions' => :'String',
69
+ :'usecase_limit' => :'Float',
70
+ :'filter_important_actions' => :'Boolean',
71
+ :'show_all' => :'Boolean'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::ActionsQueryDTO` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::ActionsQueryDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'tags')
97
+ self.tags = attributes[:'tags']
98
+ end
99
+
100
+ if attributes.key?(:'app_names')
101
+ self.app_names = attributes[:'app_names']
102
+ end
103
+
104
+ if attributes.key?(:'use_case')
105
+ self.use_case = attributes[:'use_case']
106
+ end
107
+
108
+ if attributes.key?(:'show_enabled_only')
109
+ self.show_enabled_only = attributes[:'show_enabled_only']
110
+ end
111
+
112
+ if attributes.key?(:'limit')
113
+ self.limit = attributes[:'limit']
114
+ end
115
+
116
+ if attributes.key?(:'apps')
117
+ self.apps = attributes[:'apps']
118
+ end
119
+
120
+ if attributes.key?(:'actions')
121
+ self.actions = attributes[:'actions']
122
+ end
123
+
124
+ if attributes.key?(:'usecase_limit')
125
+ self.usecase_limit = attributes[:'usecase_limit']
126
+ end
127
+
128
+ if attributes.key?(:'filter_important_actions')
129
+ self.filter_important_actions = attributes[:'filter_important_actions']
130
+ end
131
+
132
+ if attributes.key?(:'show_all')
133
+ self.show_all = attributes[:'show_all']
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ tags == o.tags &&
156
+ app_names == o.app_names &&
157
+ use_case == o.use_case &&
158
+ show_enabled_only == o.show_enabled_only &&
159
+ limit == o.limit &&
160
+ apps == o.apps &&
161
+ actions == o.actions &&
162
+ usecase_limit == o.usecase_limit &&
163
+ filter_important_actions == o.filter_important_actions &&
164
+ show_all == o.show_all
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [tags, app_names, use_case, show_enabled_only, limit, apps, actions, usecase_limit, filter_important_actions, show_all].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ new.build_from_hash(attributes)
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def build_from_hash(attributes)
190
+ return nil unless attributes.is_a?(Hash)
191
+ attributes = attributes.transform_keys(&:to_sym)
192
+ self.class.openapi_types.each_pair do |key, type|
193
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
194
+ self.send("#{key}=", nil)
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
199
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
200
+ end
201
+ elsif !attributes[self.class.attribute_map[key]].nil?
202
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
203
+ end
204
+ end
205
+
206
+ self
207
+ end
208
+
209
+ # Deserializes the data based on type
210
+ # @param string type Data type
211
+ # @param string value Value to be deserialized
212
+ # @return [Object] Deserialized data
213
+ def _deserialize(type, value)
214
+ case type.to_sym
215
+ when :Time
216
+ Time.parse(value)
217
+ when :Date
218
+ Date.parse(value)
219
+ when :String
220
+ value.to_s
221
+ when :Integer
222
+ value.to_i
223
+ when :Float
224
+ value.to_f
225
+ when :Boolean
226
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
227
+ true
228
+ else
229
+ false
230
+ end
231
+ when :Object
232
+ # generic object (usually a Hash), return directly
233
+ value
234
+ when /\AArray<(?<inner_type>.+)>\z/
235
+ inner_type = Regexp.last_match[:inner_type]
236
+ value.map { |v| _deserialize(inner_type, v) }
237
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
238
+ k_type = Regexp.last_match[:k_type]
239
+ v_type = Regexp.last_match[:v_type]
240
+ {}.tap do |hash|
241
+ value.each do |k, v|
242
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
243
+ end
244
+ end
245
+ else # model
246
+ # models (e.g. Pet) or oneOf
247
+ klass = Composio.const_get(type)
248
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
249
+ end
250
+ end
251
+
252
+ # Returns the string representation of the object
253
+ # @return [String] String presentation of the object
254
+ def to_s
255
+ to_hash.to_s
256
+ end
257
+
258
+ # to_body is an alias to to_hash (backward compatibility)
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_body
261
+ to_hash
262
+ end
263
+
264
+ # Returns the object in the form of hash
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_hash
267
+ hash = {}
268
+ self.class.attribute_map.each_pair do |attr, param|
269
+ value = self.send(attr)
270
+ if value.nil?
271
+ is_nullable = self.class.openapi_nullable.include?(attr)
272
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
273
+ end
274
+
275
+ hash[param] = _to_hash(value)
276
+ end
277
+ hash
278
+ end
279
+
280
+ # Outputs non-array value in the form of hash
281
+ # For object, use to_hash. Otherwise, just return the value
282
+ # @param [Object] value Any valid value
283
+ # @return [Hash] Returns the value in the form of hash
284
+ def _to_hash(value)
285
+ if value.is_a?(Array)
286
+ value.compact.map { |v| _to_hash(v) }
287
+ elsif value.is_a?(Hash)
288
+ {}.tap do |hash|
289
+ value.each { |k, v| hash[k] = _to_hash(v) }
290
+ end
291
+ elsif value.respond_to? :to_hash
292
+ value.to_hash
293
+ else
294
+ value
295
+ end
296
+ end
297
+
298
+ end
299
+
300
+ end