composio 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +492 -4
  4. data/lib/composio/api/actions_api.rb +107 -0
  5. data/lib/composio/api/analytics_api.rb +181 -0
  6. data/lib/composio/api/apps_api.rb +257 -0
  7. data/lib/composio/api/connections_api.rb +84 -0
  8. data/lib/composio/api/event_logs_api.rb +427 -0
  9. data/lib/composio/api/logs_api.rb +127 -9
  10. data/lib/composio/api/payment_api.rb +430 -0
  11. data/lib/composio/models/action_analytics_dto.rb +250 -0
  12. data/lib/composio/models/action_by_app_dto.rb +237 -0
  13. data/lib/composio/models/action_by_status_dto.rb +237 -0
  14. data/lib/composio/models/action_get_nla_inputs_req_dto.rb +220 -0
  15. data/lib/composio/models/additional_info.rb +220 -0
  16. data/lib/composio/models/analytics_data_req_dto.rb +250 -0
  17. data/lib/composio/models/analytics_data_res_dto.rb +282 -0
  18. data/lib/composio/models/analytics_entity_data_dto.rb +257 -0
  19. data/lib/composio/models/api_key_res_dto.rb +61 -4
  20. data/lib/composio/models/app_name_count_dto.rb +267 -0
  21. data/lib/composio/models/client_unique_user_id_count_dto.rb +237 -0
  22. data/lib/composio/models/connected_account_response_dto.rb +10 -1
  23. data/lib/composio/models/connection_params.rb +22 -6
  24. data/lib/composio/models/connection_with_app_data.rb +22 -6
  25. data/lib/composio/models/connector_list_item_dto.rb +16 -1
  26. data/lib/composio/models/create_checkout_session_req_dto.rb +220 -0
  27. data/lib/composio/models/data.rb +234 -0
  28. data/lib/composio/models/entity_query_req_dto.rb +216 -0
  29. data/lib/composio/models/fetch_query_dto.rb +278 -0
  30. data/lib/composio/models/get_connection_info_response_dto.rb +250 -0
  31. data/lib/composio/models/get_connector_list_res_dto.rb +0 -1
  32. data/lib/composio/models/get_logs_dto.rb +10 -10
  33. data/lib/composio/models/{job_status.rb → get_logs_dto_status.rb} +6 -6
  34. data/lib/composio/models/ingest_data_dto.rb +298 -0
  35. data/lib/composio/models/ingest_data_response_dto.rb +220 -0
  36. data/lib/composio/models/integrations_with_counts_dto.rb +297 -0
  37. data/lib/composio/models/invite_member_req_dto.rb +14 -4
  38. data/lib/composio/models/last_time_period.rb +40 -0
  39. data/lib/composio/models/member_info_res_dto.rb +324 -0
  40. data/lib/composio/models/{connection_with_app_data_created_at.rb → member_info_res_dto_created_at.rb} +1 -1
  41. data/lib/composio/models/member_res_dto.rb +16 -1
  42. data/lib/composio/models/member_res_dto_role.rb +36 -0
  43. data/lib/composio/models/open_api_spec_list_res_dto.rb +17 -74
  44. data/lib/composio/models/parameter.rb +248 -0
  45. data/lib/composio/models/plan.rb +38 -0
  46. data/lib/composio/models/role.rb +36 -0
  47. data/lib/composio/models/state.rb +41 -0
  48. data/lib/composio/models/status.rb +7 -4
  49. data/lib/composio/models/t_connection_count_dto.rb +236 -0
  50. data/lib/composio/models/time_period_req_dto.rb +216 -0
  51. data/lib/composio/models/top_entities_res_dto.rb +223 -0
  52. data/lib/composio/models/update_member_req_dto.rb +236 -0
  53. data/lib/composio/models/update_member_req_dto_role.rb +36 -0
  54. data/lib/composio/models/webhook_req_dto.rb +221 -0
  55. data/lib/composio/models/webhook_secret_res_dto.rb +221 -0
  56. data/lib/composio/version.rb +1 -1
  57. data/lib/composio.rb +43 -2
  58. data/spec/api/actions_api_spec.rb +13 -0
  59. data/spec/api/analytics_api_spec.rb +51 -0
  60. data/spec/api/apps_api_spec.rb +34 -0
  61. data/spec/api/connections_api_spec.rb +11 -0
  62. data/spec/api/event_logs_api_spec.rb +83 -0
  63. data/spec/api/logs_api_spec.rb +13 -1
  64. data/spec/api/payment_api_spec.rb +83 -0
  65. data/spec/models/action_analytics_dto_spec.rb +40 -0
  66. data/spec/models/action_by_app_dto_spec.rb +34 -0
  67. data/spec/models/action_by_status_dto_spec.rb +34 -0
  68. data/spec/models/action_get_nla_inputs_req_dto_spec.rb +28 -0
  69. data/spec/models/additional_info_spec.rb +28 -0
  70. data/spec/models/analytics_data_req_dto_spec.rb +32 -0
  71. data/spec/models/analytics_data_res_dto_spec.rb +52 -0
  72. data/spec/models/analytics_entity_data_dto_spec.rb +40 -0
  73. data/spec/models/api_key_res_dto_spec.rb +18 -0
  74. data/spec/models/app_name_count_dto_spec.rb +46 -0
  75. data/spec/models/client_unique_user_id_count_dto_spec.rb +34 -0
  76. data/spec/models/connected_account_response_dto_spec.rb +6 -0
  77. data/spec/models/connection_params_spec.rb +6 -0
  78. data/spec/models/connection_with_app_data_spec.rb +6 -0
  79. data/spec/models/connector_list_item_dto_spec.rb +6 -0
  80. data/spec/models/create_checkout_session_req_dto_spec.rb +28 -0
  81. data/spec/models/data_spec.rb +34 -0
  82. data/spec/models/entity_query_req_dto_spec.rb +28 -0
  83. data/spec/models/fetch_query_dto_spec.rb +34 -0
  84. data/spec/models/get_connection_info_response_dto_spec.rb +40 -0
  85. data/spec/models/get_logs_dto_spec.rb +1 -1
  86. data/spec/models/get_logs_dto_status_spec.rb +22 -0
  87. data/spec/models/ingest_data_dto_spec.rb +64 -0
  88. data/spec/models/ingest_data_response_dto_spec.rb +28 -0
  89. data/spec/models/integrations_with_counts_dto_spec.rb +58 -0
  90. data/spec/models/invite_member_req_dto_spec.rb +6 -0
  91. data/spec/models/last_time_period_spec.rb +22 -0
  92. data/spec/models/{connection_with_app_data_created_at_spec.rb → member_info_res_dto_created_at_spec.rb} +2 -2
  93. data/spec/models/member_info_res_dto_spec.rb +76 -0
  94. data/spec/models/member_res_dto_role_spec.rb +22 -0
  95. data/spec/models/member_res_dto_spec.rb +6 -0
  96. data/spec/models/open_api_spec_list_res_dto_spec.rb +5 -29
  97. data/spec/models/parameter_spec.rb +40 -0
  98. data/spec/models/plan_spec.rb +22 -0
  99. data/spec/models/role_spec.rb +22 -0
  100. data/spec/models/state_spec.rb +22 -0
  101. data/spec/models/t_connection_count_dto_spec.rb +34 -0
  102. data/spec/models/time_period_req_dto_spec.rb +28 -0
  103. data/spec/models/top_entities_res_dto_spec.rb +28 -0
  104. data/spec/models/update_member_req_dto_role_spec.rb +22 -0
  105. data/spec/models/update_member_req_dto_spec.rb +34 -0
  106. data/spec/models/webhook_req_dto_spec.rb +28 -0
  107. data/spec/models/webhook_secret_res_dto_spec.rb +28 -0
  108. metadata +215 -110
  109. data/spec/models/job_status_spec.rb +0 -22
@@ -0,0 +1,430 @@
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 PaymentApi
13
+ attr_accessor :api_client
14
+
15
+ def initialize(api_client = ApiClient.default)
16
+ @api_client = api_client
17
+ end
18
+
19
+ # Create checkout session
20
+ #
21
+ # @param plan [Plan]
22
+ # @param body [CreateCheckoutSessionReqDto]
23
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
24
+ def create_checkout_session(plan:, extra: {})
25
+ _body = {}
26
+ _body[:plan] = plan if plan != SENTINEL
27
+ extra[:create_checkout_session_req_dto] = _body if !_body.empty?
28
+ api_response = create_checkout_session_with_http_info_impl(extra)
29
+ api_response.data
30
+ end
31
+
32
+ # Create checkout session
33
+ #
34
+ # @param plan [Plan]
35
+ # @param body [CreateCheckoutSessionReqDto]
36
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
37
+ def create_checkout_session_with_http_info(plan:, extra: {})
38
+ _body = {}
39
+ _body[:plan] = plan if plan != SENTINEL
40
+ extra[:create_checkout_session_req_dto] = _body if !_body.empty?
41
+ create_checkout_session_with_http_info_impl(extra)
42
+ end
43
+
44
+ # Create checkout session
45
+ # @param [Hash] opts the optional parameters
46
+ # @option opts [CreateCheckoutSessionReqDto] :create_checkout_session_req_dto CreateCheckoutSessionReqDto
47
+ # @return [Object]
48
+ private def create_checkout_session_impl(opts = {})
49
+ data, _status_code, _headers = create_checkout_session_with_http_info(opts)
50
+ data
51
+ end
52
+
53
+ # Create checkout session
54
+ # @param [Hash] opts the optional parameters
55
+ # @option opts [CreateCheckoutSessionReqDto] :create_checkout_session_req_dto CreateCheckoutSessionReqDto
56
+ # @return [APIResponse] data is Object, status code, headers and response
57
+ private def create_checkout_session_with_http_info_impl(opts = {})
58
+ if @api_client.config.debugging
59
+ @api_client.config.logger.debug 'Calling API: PaymentApi.create_checkout_session ...'
60
+ end
61
+ # resource path
62
+ local_var_path = '/api/v1/payment/create-checkout-session'
63
+
64
+ # query parameters
65
+ query_params = opts[:query_params] || {}
66
+
67
+ # header parameters
68
+ header_params = opts[:header_params] || {}
69
+ # HTTP header 'Accept' (if needed)
70
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
71
+ # HTTP header 'Content-Type'
72
+ content_type = @api_client.select_header_content_type(['application/json'])
73
+ if !content_type.nil?
74
+ header_params['Content-Type'] = content_type
75
+ end
76
+
77
+ # form parameters
78
+ form_params = opts[:form_params] || {}
79
+
80
+ # http body (model)
81
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_checkout_session_req_dto'])
82
+
83
+ # return_type
84
+ return_type = opts[:debug_return_type] || 'Object'
85
+
86
+ # auth_names
87
+ auth_names = opts[:debug_auth_names] || ['api_key']
88
+
89
+ new_options = opts.merge(
90
+ :operation => :"PaymentApi.create_checkout_session",
91
+ :header_params => header_params,
92
+ :query_params => query_params,
93
+ :form_params => form_params,
94
+ :body => post_body,
95
+ :auth_names => auth_names,
96
+ :return_type => return_type
97
+ )
98
+
99
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug "API called: PaymentApi#create_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
102
+ end
103
+ APIResponse::new(data, status_code, headers, response)
104
+ end
105
+
106
+
107
+ # Get checkout session status
108
+ #
109
+ # @param session_id [String]
110
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
111
+ def get_checkout_session_status(session_id:, extra: {})
112
+ api_response = get_checkout_session_status_with_http_info_impl(session_id, extra)
113
+ api_response.data
114
+ end
115
+
116
+ # Get checkout session status
117
+ #
118
+ # @param session_id [String]
119
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
120
+ def get_checkout_session_status_with_http_info(session_id:, extra: {})
121
+ get_checkout_session_status_with_http_info_impl(session_id, extra)
122
+ end
123
+
124
+ # Get checkout session status
125
+ # @param session_id [String]
126
+ # @param [Hash] opts the optional parameters
127
+ # @return [Object]
128
+ private def get_checkout_session_status_impl(session_id, opts = {})
129
+ data, _status_code, _headers = get_checkout_session_status_with_http_info(session_id, opts)
130
+ data
131
+ end
132
+
133
+ # Get checkout session status
134
+ # @param session_id [String]
135
+ # @param [Hash] opts the optional parameters
136
+ # @return [APIResponse] data is Object, status code, headers and response
137
+ private def get_checkout_session_status_with_http_info_impl(session_id, opts = {})
138
+ if @api_client.config.debugging
139
+ @api_client.config.logger.debug 'Calling API: PaymentApi.get_checkout_session_status ...'
140
+ end
141
+ # verify the required parameter 'session_id' is set
142
+ if @api_client.config.client_side_validation && session_id.nil?
143
+ fail ArgumentError, "Missing the required parameter 'session_id' when calling PaymentApi.get_checkout_session_status"
144
+ end
145
+ pattern = Regexp.new(/[^\/#\?]+?/)
146
+ if @api_client.config.client_side_validation && session_id !~ pattern
147
+ fail ArgumentError, "invalid value for 'session_id' when calling PaymentApi.get_checkout_session_status, must conform to the pattern #{pattern}."
148
+ end
149
+
150
+ # resource path
151
+ local_var_path = '/api/v1/payment/checkout-session/{sessionId}/status'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))
152
+
153
+ # query parameters
154
+ query_params = opts[:query_params] || {}
155
+
156
+ # header parameters
157
+ header_params = opts[:header_params] || {}
158
+ # HTTP header 'Accept' (if needed)
159
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
160
+
161
+ # form parameters
162
+ form_params = opts[:form_params] || {}
163
+
164
+ # http body (model)
165
+ post_body = opts[:debug_body]
166
+
167
+ # return_type
168
+ return_type = opts[:debug_return_type] || 'Object'
169
+
170
+ # auth_names
171
+ auth_names = opts[:debug_auth_names] || ['api_key']
172
+
173
+ new_options = opts.merge(
174
+ :operation => :"PaymentApi.get_checkout_session_status",
175
+ :header_params => header_params,
176
+ :query_params => query_params,
177
+ :form_params => form_params,
178
+ :body => post_body,
179
+ :auth_names => auth_names,
180
+ :return_type => return_type
181
+ )
182
+
183
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
184
+ if @api_client.config.debugging
185
+ @api_client.config.logger.debug "API called: PaymentApi#get_checkout_session_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
186
+ end
187
+ APIResponse::new(data, status_code, headers, response)
188
+ end
189
+
190
+
191
+ # Get invoice
192
+ #
193
+ # @param invoice_id [String]
194
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
195
+ def get_invoice(invoice_id:, extra: {})
196
+ api_response = get_invoice_with_http_info_impl(invoice_id, extra)
197
+ api_response.data
198
+ end
199
+
200
+ # Get invoice
201
+ #
202
+ # @param invoice_id [String]
203
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
204
+ def get_invoice_with_http_info(invoice_id:, extra: {})
205
+ get_invoice_with_http_info_impl(invoice_id, extra)
206
+ end
207
+
208
+ # Get invoice
209
+ # @param invoice_id [String]
210
+ # @param [Hash] opts the optional parameters
211
+ # @return [Object]
212
+ private def get_invoice_impl(invoice_id, opts = {})
213
+ data, _status_code, _headers = get_invoice_with_http_info(invoice_id, opts)
214
+ data
215
+ end
216
+
217
+ # Get invoice
218
+ # @param invoice_id [String]
219
+ # @param [Hash] opts the optional parameters
220
+ # @return [APIResponse] data is Object, status code, headers and response
221
+ private def get_invoice_with_http_info_impl(invoice_id, opts = {})
222
+ if @api_client.config.debugging
223
+ @api_client.config.logger.debug 'Calling API: PaymentApi.get_invoice ...'
224
+ end
225
+ # verify the required parameter 'invoice_id' is set
226
+ if @api_client.config.client_side_validation && invoice_id.nil?
227
+ fail ArgumentError, "Missing the required parameter 'invoice_id' when calling PaymentApi.get_invoice"
228
+ end
229
+ pattern = Regexp.new(/[^\/#\?]+?/)
230
+ if @api_client.config.client_side_validation && invoice_id !~ pattern
231
+ fail ArgumentError, "invalid value for 'invoice_id' when calling PaymentApi.get_invoice, must conform to the pattern #{pattern}."
232
+ end
233
+
234
+ # resource path
235
+ local_var_path = '/api/v1/payment/invoices/{invoiceId}'.sub('{' + 'invoiceId' + '}', CGI.escape(invoice_id.to_s))
236
+
237
+ # query parameters
238
+ query_params = opts[:query_params] || {}
239
+
240
+ # header parameters
241
+ header_params = opts[:header_params] || {}
242
+ # HTTP header 'Accept' (if needed)
243
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
244
+
245
+ # form parameters
246
+ form_params = opts[:form_params] || {}
247
+
248
+ # http body (model)
249
+ post_body = opts[:debug_body]
250
+
251
+ # return_type
252
+ return_type = opts[:debug_return_type] || 'Object'
253
+
254
+ # auth_names
255
+ auth_names = opts[:debug_auth_names] || ['api_key']
256
+
257
+ new_options = opts.merge(
258
+ :operation => :"PaymentApi.get_invoice",
259
+ :header_params => header_params,
260
+ :query_params => query_params,
261
+ :form_params => form_params,
262
+ :body => post_body,
263
+ :auth_names => auth_names,
264
+ :return_type => return_type
265
+ )
266
+
267
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
268
+ if @api_client.config.debugging
269
+ @api_client.config.logger.debug "API called: PaymentApi#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
270
+ end
271
+ APIResponse::new(data, status_code, headers, response)
272
+ end
273
+
274
+
275
+ # Get invoices
276
+ #
277
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
278
+ def get_invoices(extra: {})
279
+ api_response = get_invoices_with_http_info_impl(extra)
280
+ api_response.data
281
+ end
282
+
283
+ # Get invoices
284
+ #
285
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
286
+ def get_invoices_with_http_info(extra: {})
287
+ get_invoices_with_http_info_impl(extra)
288
+ end
289
+
290
+ # Get invoices
291
+ # @param [Hash] opts the optional parameters
292
+ # @return [Object]
293
+ private def get_invoices_impl(opts = {})
294
+ data, _status_code, _headers = get_invoices_with_http_info(opts)
295
+ data
296
+ end
297
+
298
+ # Get invoices
299
+ # @param [Hash] opts the optional parameters
300
+ # @return [APIResponse] data is Object, status code, headers and response
301
+ private def get_invoices_with_http_info_impl(opts = {})
302
+ if @api_client.config.debugging
303
+ @api_client.config.logger.debug 'Calling API: PaymentApi.get_invoices ...'
304
+ end
305
+ # resource path
306
+ local_var_path = '/api/v1/payment/invoices'
307
+
308
+ # query parameters
309
+ query_params = opts[:query_params] || {}
310
+
311
+ # header parameters
312
+ header_params = opts[:header_params] || {}
313
+ # HTTP header 'Accept' (if needed)
314
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
315
+
316
+ # form parameters
317
+ form_params = opts[:form_params] || {}
318
+
319
+ # http body (model)
320
+ post_body = opts[:debug_body]
321
+
322
+ # return_type
323
+ return_type = opts[:debug_return_type] || 'Object'
324
+
325
+ # auth_names
326
+ auth_names = opts[:debug_auth_names] || ['api_key']
327
+
328
+ new_options = opts.merge(
329
+ :operation => :"PaymentApi.get_invoices",
330
+ :header_params => header_params,
331
+ :query_params => query_params,
332
+ :form_params => form_params,
333
+ :body => post_body,
334
+ :auth_names => auth_names,
335
+ :return_type => return_type
336
+ )
337
+
338
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
339
+ if @api_client.config.debugging
340
+ @api_client.config.logger.debug "API called: PaymentApi#get_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
341
+ end
342
+ APIResponse::new(data, status_code, headers, response)
343
+ end
344
+
345
+
346
+ # Handle stripe webhook
347
+ #
348
+ # @param body [Object]
349
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
350
+ def handle_stripe_webhook(body: SENTINEL, extra: {})
351
+ extra[:body] = body if body != SENTINEL
352
+ api_response = handle_stripe_webhook_with_http_info_impl(extra)
353
+ api_response.data
354
+ end
355
+
356
+ # Handle stripe webhook
357
+ #
358
+ # @param body [Object]
359
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
360
+ def handle_stripe_webhook_with_http_info(body: SENTINEL, extra: {})
361
+ extra[:body] = body if body != SENTINEL
362
+ handle_stripe_webhook_with_http_info_impl(extra)
363
+ end
364
+
365
+ # Handle stripe webhook
366
+ # @param [Hash] opts the optional parameters
367
+ # @option opts [Object] :body
368
+ # @return [Object]
369
+ private def handle_stripe_webhook_impl(opts = {})
370
+ data, _status_code, _headers = handle_stripe_webhook_with_http_info(opts)
371
+ data
372
+ end
373
+
374
+ # Handle stripe webhook
375
+ # @param [Hash] opts the optional parameters
376
+ # @option opts [Object] :body
377
+ # @return [APIResponse] data is Object, status code, headers and response
378
+ private def handle_stripe_webhook_with_http_info_impl(opts = {})
379
+ if @api_client.config.debugging
380
+ @api_client.config.logger.debug 'Calling API: PaymentApi.handle_stripe_webhook ...'
381
+ end
382
+ # resource path
383
+ local_var_path = '/api/v1/payment/webhook'
384
+
385
+ # query parameters
386
+ query_params = opts[:query_params] || {}
387
+
388
+ # header parameters
389
+ header_params = opts[:header_params] || {}
390
+ # HTTP header 'Accept' (if needed)
391
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
392
+ # HTTP header 'Content-Type'
393
+ content_type = @api_client.select_header_content_type(['application/json'])
394
+ if !content_type.nil?
395
+ header_params['Content-Type'] = content_type
396
+ end
397
+
398
+ # form parameters
399
+ form_params = opts[:form_params] || {}
400
+
401
+ # http body (model)
402
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
403
+
404
+ # return_type
405
+ return_type = opts[:debug_return_type] || 'Object'
406
+
407
+ # auth_names
408
+ auth_names = opts[:debug_auth_names] || ['api_key']
409
+
410
+ new_options = opts.merge(
411
+ :operation => :"PaymentApi.handle_stripe_webhook",
412
+ :header_params => header_params,
413
+ :query_params => query_params,
414
+ :form_params => form_params,
415
+ :body => post_body,
416
+ :auth_names => auth_names,
417
+ :return_type => return_type
418
+ )
419
+
420
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
421
+ if @api_client.config.debugging
422
+ @api_client.config.logger.debug "API called: PaymentApi#handle_stripe_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
423
+ end
424
+ APIResponse::new(data, status_code, headers, response)
425
+ end
426
+ end
427
+
428
+ # top-level client access to avoid having the user to insantiate their own API instances
429
+ Payment = PaymentApi::new
430
+ end
@@ -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
+ # Comprehensive trigger analytics data, presenting a breakdown by day, status, and provider for all triggers
14
+ class ActionAnalyticsDTO
15
+ # Date of the action
16
+ attr_accessor :date
17
+
18
+ attr_accessor :by_app
19
+
20
+ attr_accessor :by_status
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'date' => :'date',
26
+ :'by_app' => :'byApp',
27
+ :'by_status' => :'byStatus'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'date' => :'Date',
40
+ :'by_app' => :'ActionByAppDTO',
41
+ :'by_status' => :'ActionByStatusDTO'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::ActionAnalyticsDTO` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::ActionAnalyticsDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'date')
67
+ self.date = attributes[:'date']
68
+ end
69
+
70
+ if attributes.key?(:'by_app')
71
+ self.by_app = attributes[:'by_app']
72
+ end
73
+
74
+ if attributes.key?(:'by_status')
75
+ self.by_status = attributes[:'by_status']
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 @date.nil?
84
+ invalid_properties.push('invalid value for "date", date cannot be nil.')
85
+ end
86
+
87
+ if @by_app.nil?
88
+ invalid_properties.push('invalid value for "by_app", by_app cannot be nil.')
89
+ end
90
+
91
+ if @by_status.nil?
92
+ invalid_properties.push('invalid value for "by_status", by_status 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 @date.nil?
102
+ return false if @by_app.nil?
103
+ return false if @by_status.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
+ date == o.date &&
113
+ by_app == o.by_app &&
114
+ by_status == o.by_status
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
+ [date, by_app, by_status].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