lago_ruby 0.48.0.pre.beta → 0.49.0.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -5
  3. data/docs/AddOnBaseInput.md +2 -0
  4. data/docs/AddOnCreateInputAddOn.md +2 -0
  5. data/docs/AddOnObject.md +2 -0
  6. data/docs/BillableMetricBaseInput.md +1 -1
  7. data/docs/BillableMetricCreateInputBillableMetric.md +1 -1
  8. data/docs/BillableMetricObject.md +1 -1
  9. data/docs/ChargeObject.md +2 -0
  10. data/docs/CreditNoteItemObjectFee.md +2 -0
  11. data/docs/CustomerChargeUsageObject.md +2 -0
  12. data/docs/CustomerChargeUsageObjectGroupsInner.md +2 -0
  13. data/docs/CustomerPastUsage.md +20 -0
  14. data/docs/CustomerUsageObject.md +2 -0
  15. data/docs/CustomersApi.md +82 -0
  16. data/docs/FeeObject.md +2 -0
  17. data/docs/FeeObjectItem.md +2 -0
  18. data/docs/GroupPropertiesObject.md +2 -0
  19. data/docs/InvoiceOneOffCreateInputInvoiceFeesInner.md +2 -0
  20. data/docs/PlanCreateInputPlan.md +3 -1
  21. data/docs/PlanCreateInputPlanChargesInner.md +2 -0
  22. data/docs/PlanObject.md +3 -1
  23. data/docs/PlanUpdateInputPlan.md +3 -1
  24. data/docs/PlanUpdateInputPlanChargesInner.md +2 -0
  25. data/docs/SubscriptionsApi.md +70 -0
  26. data/lago_ruby.gemspec +1 -1
  27. data/lib/lago_ruby/api/add_ons_api.rb +1 -1
  28. data/lib/lago_ruby/api/billable_metrics_api.rb +1 -1
  29. data/lib/lago_ruby/api/coupons_api.rb +1 -1
  30. data/lib/lago_ruby/api/credit_notes_api.rb +1 -1
  31. data/lib/lago_ruby/api/customers_api.rb +83 -1
  32. data/lib/lago_ruby/api/events_api.rb +1 -1
  33. data/lib/lago_ruby/api/fees_api.rb +1 -1
  34. data/lib/lago_ruby/api/invoices_api.rb +1 -1
  35. data/lib/lago_ruby/api/organizations_api.rb +1 -1
  36. data/lib/lago_ruby/api/plans_api.rb +1 -1
  37. data/lib/lago_ruby/api/subscriptions_api.rb +64 -1
  38. data/lib/lago_ruby/api/taxes_api.rb +1 -1
  39. data/lib/lago_ruby/api/wallets_api.rb +1 -1
  40. data/lib/lago_ruby/api/webhook_endpoints_api.rb +1 -1
  41. data/lib/lago_ruby/api/webhooks_api.rb +1 -1
  42. data/lib/lago_ruby/api_client.rb +3 -2
  43. data/lib/lago_ruby/api_error.rb +1 -1
  44. data/lib/lago_ruby/configuration.rb +2 -1
  45. data/lib/lago_ruby/models/add_on.rb +1 -1
  46. data/lib/lago_ruby/models/add_on_base_input.rb +12 -2
  47. data/lib/lago_ruby/models/add_on_create_input.rb +1 -1
  48. data/lib/lago_ruby/models/add_on_create_input_add_on.rb +12 -2
  49. data/lib/lago_ruby/models/add_on_object.rb +12 -2
  50. data/lib/lago_ruby/models/add_on_update_input.rb +1 -1
  51. data/lib/lago_ruby/models/add_ons_paginated.rb +1 -1
  52. data/lib/lago_ruby/models/api_error_bad_request.rb +1 -1
  53. data/lib/lago_ruby/models/api_error_forbidden.rb +1 -1
  54. data/lib/lago_ruby/models/api_error_not_allowed.rb +1 -1
  55. data/lib/lago_ruby/models/api_error_not_found.rb +1 -1
  56. data/lib/lago_ruby/models/api_error_unauthorized.rb +1 -1
  57. data/lib/lago_ruby/models/api_error_unprocessable_entity.rb +1 -1
  58. data/lib/lago_ruby/models/applied_coupon.rb +1 -1
  59. data/lib/lago_ruby/models/applied_coupon_input.rb +1 -1
  60. data/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb +1 -1
  61. data/lib/lago_ruby/models/applied_coupon_object.rb +1 -1
  62. data/lib/lago_ruby/models/applied_coupon_object_extended.rb +1 -1
  63. data/lib/lago_ruby/models/applied_coupons_paginated.rb +1 -1
  64. data/lib/lago_ruby/models/base_applied_tax.rb +1 -1
  65. data/lib/lago_ruby/models/billable_metric.rb +1 -1
  66. data/lib/lago_ruby/models/billable_metric_base_input.rb +4 -4
  67. data/lib/lago_ruby/models/billable_metric_create_input.rb +1 -1
  68. data/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb +4 -4
  69. data/lib/lago_ruby/models/billable_metric_group.rb +1 -1
  70. data/lib/lago_ruby/models/billable_metric_group_values_inner.rb +1 -1
  71. data/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb +1 -1
  72. data/lib/lago_ruby/models/billable_metric_object.rb +4 -4
  73. data/lib/lago_ruby/models/billable_metric_update_input.rb +1 -1
  74. data/lib/lago_ruby/models/billable_metrics_paginated.rb +1 -1
  75. data/lib/lago_ruby/models/charge_object.rb +12 -2
  76. data/lib/lago_ruby/models/charge_object_properties.rb +1 -1
  77. data/lib/lago_ruby/models/charge_properties.rb +1 -1
  78. data/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb +1 -1
  79. data/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb +1 -1
  80. data/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb +1 -1
  81. data/lib/lago_ruby/models/country.rb +1 -1
  82. data/lib/lago_ruby/models/coupon.rb +1 -1
  83. data/lib/lago_ruby/models/coupon_base_input.rb +1 -1
  84. data/lib/lago_ruby/models/coupon_base_input_applies_to.rb +1 -1
  85. data/lib/lago_ruby/models/coupon_create_input.rb +1 -1
  86. data/lib/lago_ruby/models/coupon_create_input_coupon.rb +1 -1
  87. data/lib/lago_ruby/models/coupon_object.rb +1 -1
  88. data/lib/lago_ruby/models/coupon_update_input.rb +1 -1
  89. data/lib/lago_ruby/models/coupons_paginated.rb +1 -1
  90. data/lib/lago_ruby/models/credit_note.rb +1 -1
  91. data/lib/lago_ruby/models/credit_note_applied_tax_object.rb +1 -1
  92. data/lib/lago_ruby/models/credit_note_create_input.rb +1 -1
  93. data/lib/lago_ruby/models/credit_note_create_input_credit_note.rb +1 -1
  94. data/lib/lago_ruby/models/credit_note_create_input_credit_note_items_inner.rb +1 -1
  95. data/lib/lago_ruby/models/credit_note_item_object.rb +1 -1
  96. data/lib/lago_ruby/models/credit_note_item_object_fee.rb +12 -2
  97. data/lib/lago_ruby/models/credit_note_object.rb +1 -1
  98. data/lib/lago_ruby/models/credit_note_update_input.rb +1 -1
  99. data/lib/lago_ruby/models/credit_note_update_input_credit_note.rb +1 -1
  100. data/lib/lago_ruby/models/credit_notes.rb +1 -1
  101. data/lib/lago_ruby/models/credit_object.rb +1 -1
  102. data/lib/lago_ruby/models/credit_object_invoice.rb +1 -1
  103. data/lib/lago_ruby/models/credit_object_item.rb +1 -1
  104. data/lib/lago_ruby/models/currency.rb +1 -1
  105. data/lib/lago_ruby/models/customer.rb +1 -1
  106. data/lib/lago_ruby/models/customer_billing_configuration.rb +1 -1
  107. data/lib/lago_ruby/models/customer_charge_usage_object.rb +19 -2
  108. data/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb +1 -1
  109. data/lib/lago_ruby/models/customer_charge_usage_object_charge.rb +1 -1
  110. data/lib/lago_ruby/models/customer_charge_usage_object_groups_inner.rb +12 -2
  111. data/lib/lago_ruby/models/customer_create_input.rb +1 -1
  112. data/lib/lago_ruby/models/customer_create_input_customer.rb +1 -1
  113. data/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb +1 -1
  114. data/lib/lago_ruby/models/customer_metadata.rb +1 -1
  115. data/lib/lago_ruby/models/customer_object.rb +1 -1
  116. data/lib/lago_ruby/models/customer_object_extended.rb +1 -1
  117. data/lib/lago_ruby/models/customer_past_usage.rb +239 -0
  118. data/lib/lago_ruby/models/customer_usage.rb +1 -1
  119. data/lib/lago_ruby/models/customer_usage_object.rb +13 -2
  120. data/lib/lago_ruby/models/customers_paginated.rb +1 -1
  121. data/lib/lago_ruby/models/event.rb +1 -1
  122. data/lib/lago_ruby/models/event_batch_input.rb +1 -1
  123. data/lib/lago_ruby/models/event_batch_input_event.rb +1 -1
  124. data/lib/lago_ruby/models/event_batch_input_event_properties.rb +1 -1
  125. data/lib/lago_ruby/models/event_estimate_fees_input.rb +1 -1
  126. data/lib/lago_ruby/models/event_estimate_fees_input_event.rb +1 -1
  127. data/lib/lago_ruby/models/event_input.rb +1 -1
  128. data/lib/lago_ruby/models/event_input_event.rb +1 -1
  129. data/lib/lago_ruby/models/event_input_event_timestamp.rb +1 -1
  130. data/lib/lago_ruby/models/event_object.rb +1 -1
  131. data/lib/lago_ruby/models/event_object_properties.rb +1 -1
  132. data/lib/lago_ruby/models/fee.rb +1 -1
  133. data/lib/lago_ruby/models/fee_applied_tax_object.rb +1 -1
  134. data/lib/lago_ruby/models/fee_object.rb +12 -2
  135. data/lib/lago_ruby/models/fee_object_item.rb +12 -2
  136. data/lib/lago_ruby/models/fee_update_input.rb +1 -1
  137. data/lib/lago_ruby/models/fee_update_input_fee.rb +1 -1
  138. data/lib/lago_ruby/models/fees.rb +1 -1
  139. data/lib/lago_ruby/models/fees_paginated.rb +1 -1
  140. data/lib/lago_ruby/models/get_customer_portal_url200_response.rb +1 -1
  141. data/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb +1 -1
  142. data/lib/lago_ruby/models/group_object.rb +1 -1
  143. data/lib/lago_ruby/models/group_properties_object.rb +12 -2
  144. data/lib/lago_ruby/models/group_properties_object_values.rb +1 -1
  145. data/lib/lago_ruby/models/groups_paginated.rb +1 -1
  146. data/lib/lago_ruby/models/invoice.rb +1 -1
  147. data/lib/lago_ruby/models/invoice_applied_tax_object.rb +1 -1
  148. data/lib/lago_ruby/models/invoice_metadata_object.rb +1 -1
  149. data/lib/lago_ruby/models/invoice_object.rb +1 -1
  150. data/lib/lago_ruby/models/invoice_object_customer.rb +1 -1
  151. data/lib/lago_ruby/models/invoice_object_extended.rb +1 -1
  152. data/lib/lago_ruby/models/invoice_one_off_create_input.rb +1 -1
  153. data/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb +1 -1
  154. data/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb +12 -2
  155. data/lib/lago_ruby/models/invoice_update_input.rb +1 -1
  156. data/lib/lago_ruby/models/invoice_update_input_invoice.rb +1 -1
  157. data/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb +1 -1
  158. data/lib/lago_ruby/models/invoices_paginated.rb +1 -1
  159. data/lib/lago_ruby/models/organization.rb +1 -1
  160. data/lib/lago_ruby/models/organization_billing_configuration.rb +1 -1
  161. data/lib/lago_ruby/models/organization_object.rb +1 -1
  162. data/lib/lago_ruby/models/organization_update_input.rb +1 -1
  163. data/lib/lago_ruby/models/organization_update_input_organization.rb +1 -1
  164. data/lib/lago_ruby/models/pagination_meta.rb +1 -1
  165. data/lib/lago_ruby/models/plan.rb +1 -1
  166. data/lib/lago_ruby/models/plan_create_input.rb +1 -1
  167. data/lib/lago_ruby/models/plan_create_input_plan.rb +12 -2
  168. data/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb +12 -2
  169. data/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb +1 -1
  170. data/lib/lago_ruby/models/plan_object.rb +12 -2
  171. data/lib/lago_ruby/models/plan_update_input.rb +1 -1
  172. data/lib/lago_ruby/models/plan_update_input_plan.rb +12 -2
  173. data/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb +12 -2
  174. data/lib/lago_ruby/models/plans_paginated.rb +1 -1
  175. data/lib/lago_ruby/models/subscription.rb +1 -1
  176. data/lib/lago_ruby/models/subscription_create_input.rb +1 -1
  177. data/lib/lago_ruby/models/subscription_create_input_subscription.rb +1 -1
  178. data/lib/lago_ruby/models/subscription_object.rb +1 -1
  179. data/lib/lago_ruby/models/subscription_update_input.rb +1 -1
  180. data/lib/lago_ruby/models/subscription_update_input_subscription.rb +1 -1
  181. data/lib/lago_ruby/models/subscriptions_paginated.rb +1 -1
  182. data/lib/lago_ruby/models/tax.rb +1 -1
  183. data/lib/lago_ruby/models/tax_base_input.rb +1 -1
  184. data/lib/lago_ruby/models/tax_create_input.rb +1 -1
  185. data/lib/lago_ruby/models/tax_create_input_tax.rb +1 -1
  186. data/lib/lago_ruby/models/tax_object.rb +1 -1
  187. data/lib/lago_ruby/models/tax_update_input.rb +1 -1
  188. data/lib/lago_ruby/models/taxes_paginated.rb +1 -1
  189. data/lib/lago_ruby/models/timezone.rb +1 -1
  190. data/lib/lago_ruby/models/wallet.rb +1 -1
  191. data/lib/lago_ruby/models/wallet_create_input.rb +1 -1
  192. data/lib/lago_ruby/models/wallet_create_input_wallet.rb +1 -1
  193. data/lib/lago_ruby/models/wallet_object.rb +1 -1
  194. data/lib/lago_ruby/models/wallet_transaction_create_input.rb +1 -1
  195. data/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb +1 -1
  196. data/lib/lago_ruby/models/wallet_transaction_object.rb +1 -1
  197. data/lib/lago_ruby/models/wallet_transactions.rb +1 -1
  198. data/lib/lago_ruby/models/wallet_transactions_paginated.rb +1 -1
  199. data/lib/lago_ruby/models/wallet_update_input.rb +1 -1
  200. data/lib/lago_ruby/models/wallet_update_input_wallet.rb +1 -1
  201. data/lib/lago_ruby/models/wallets_paginated.rb +1 -1
  202. data/lib/lago_ruby/models/webhook_endpoint.rb +1 -1
  203. data/lib/lago_ruby/models/webhook_endpoint_create_input.rb +1 -1
  204. data/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb +1 -1
  205. data/lib/lago_ruby/models/webhook_endpoint_object.rb +1 -1
  206. data/lib/lago_ruby/models/webhook_endpoint_update_input.rb +1 -1
  207. data/lib/lago_ruby/models/webhook_endpoints_paginated.rb +1 -1
  208. data/lib/lago_ruby/version.rb +2 -2
  209. data/lib/lago_ruby.rb +2 -1
  210. data/spec/api_client_spec.rb +1 -1
  211. data/spec/configuration_spec.rb +1 -1
  212. data/spec/models/customer_past_usage_spec.rb +42 -0
  213. data/spec/spec_helper.rb +1 -1
  214. metadata +155 -151
@@ -7,6 +7,7 @@ All URIs are relative to *https://api.getlago.com/api/v1*
7
7
  | [**create_subscription**](SubscriptionsApi.md#create_subscription) | **POST** /subscriptions | Assign a plan to a customer |
8
8
  | [**destroy_subscription**](SubscriptionsApi.md#destroy_subscription) | **DELETE** /subscriptions/{external_id} | Terminate a subscription |
9
9
  | [**find_all_subscriptions**](SubscriptionsApi.md#find_all_subscriptions) | **GET** /subscriptions | List all subscriptions |
10
+ | [**find_subscription**](SubscriptionsApi.md#find_subscription) | **GET** /subscriptions/{external_id} | Retrieve a subscription |
10
11
  | [**update_subscription**](SubscriptionsApi.md#update_subscription) | **PUT** /subscriptions/{external_id} | Update a subscription |
11
12
 
12
13
 
@@ -231,6 +232,75 @@ end
231
232
  - **Accept**: application/json
232
233
 
233
234
 
235
+ ## find_subscription
236
+
237
+ > <Subscription> find_subscription(external_id)
238
+
239
+ Retrieve a subscription
240
+
241
+ This endpoint retrieves a specific subscription.
242
+
243
+ ### Examples
244
+
245
+ ```ruby
246
+ require 'time'
247
+ require 'lago_ruby'
248
+ # setup authorization
249
+ LagoAPI.configure do |config|
250
+ # Configure Bearer authorization: bearerAuth
251
+ config.access_token = 'YOUR_BEARER_TOKEN'
252
+ end
253
+
254
+ api_instance = LagoAPI::SubscriptionsApi.new
255
+ external_id = '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba' # String | External ID of the existing subscription
256
+
257
+ begin
258
+ # Retrieve a subscription
259
+ result = api_instance.find_subscription(external_id)
260
+ p result
261
+ rescue LagoAPI::ApiError => e
262
+ puts "Error when calling SubscriptionsApi->find_subscription: #{e}"
263
+ end
264
+ ```
265
+
266
+ #### Using the find_subscription_with_http_info variant
267
+
268
+ This returns an Array which contains the response data, status code and headers.
269
+
270
+ > <Array(<Subscription>, Integer, Hash)> find_subscription_with_http_info(external_id)
271
+
272
+ ```ruby
273
+ begin
274
+ # Retrieve a subscription
275
+ data, status_code, headers = api_instance.find_subscription_with_http_info(external_id)
276
+ p status_code # => 2xx
277
+ p headers # => { ... }
278
+ p data # => <Subscription>
279
+ rescue LagoAPI::ApiError => e
280
+ puts "Error when calling SubscriptionsApi->find_subscription_with_http_info: #{e}"
281
+ end
282
+ ```
283
+
284
+ ### Parameters
285
+
286
+ | Name | Type | Description | Notes |
287
+ | ---- | ---- | ----------- | ----- |
288
+ | **external_id** | **String** | External ID of the existing subscription | |
289
+
290
+ ### Return type
291
+
292
+ [**Subscription**](Subscription.md)
293
+
294
+ ### Authorization
295
+
296
+ [bearerAuth](../README.md#bearerAuth)
297
+
298
+ ### HTTP request headers
299
+
300
+ - **Content-Type**: Not defined
301
+ - **Accept**: application/json
302
+
303
+
234
304
  ## update_subscription
235
305
 
236
306
  > <Subscription> update_subscription(external_id, subscription_update_input)
data/lago_ruby.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
7
7
 
8
- The version of the OpenAPI document: 0.48.0-beta
8
+ The version of the OpenAPI document: 0.49.0-beta
9
9
  Contact: tech@getlago.com
10
10
  Generated by: https://openapi-generator.tech
11
11
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -219,6 +219,88 @@ module LagoAPI
219
219
  return data, status_code, headers
220
220
  end
221
221
 
222
+ # Retrieve customer past usage
223
+ # This endpoint enables the retrieval of the usage-based billing data for a customer within past periods.
224
+ # @param external_customer_id [String] The customer external unique identifier (provided by your own application).
225
+ # @param external_subscription_id [String] The unique identifier of the subscription within your application.
226
+ # @param [Hash] opts the optional parameters
227
+ # @option opts [Integer] :page Page number.
228
+ # @option opts [Integer] :per_page Number of records per page.
229
+ # @option opts [String] :billable_metric_code Billable metric code filter to apply to the charge usage
230
+ # @option opts [Integer] :periods_count Number of past billing period to returns in the result
231
+ # @return [CustomerPastUsage]
232
+ def find_all_customer_past_usage(external_customer_id, external_subscription_id, opts = {})
233
+ data, _status_code, _headers = find_all_customer_past_usage_with_http_info(external_customer_id, external_subscription_id, opts)
234
+ data
235
+ end
236
+
237
+ # Retrieve customer past usage
238
+ # This endpoint enables the retrieval of the usage-based billing data for a customer within past periods.
239
+ # @param external_customer_id [String] The customer external unique identifier (provided by your own application).
240
+ # @param external_subscription_id [String] The unique identifier of the subscription within your application.
241
+ # @param [Hash] opts the optional parameters
242
+ # @option opts [Integer] :page Page number.
243
+ # @option opts [Integer] :per_page Number of records per page.
244
+ # @option opts [String] :billable_metric_code Billable metric code filter to apply to the charge usage
245
+ # @option opts [Integer] :periods_count Number of past billing period to returns in the result
246
+ # @return [Array<(CustomerPastUsage, Integer, Hash)>] CustomerPastUsage data, response status code and response headers
247
+ def find_all_customer_past_usage_with_http_info(external_customer_id, external_subscription_id, opts = {})
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug 'Calling API: CustomersApi.find_all_customer_past_usage ...'
250
+ end
251
+ # verify the required parameter 'external_customer_id' is set
252
+ if @api_client.config.client_side_validation && external_customer_id.nil?
253
+ fail ArgumentError, "Missing the required parameter 'external_customer_id' when calling CustomersApi.find_all_customer_past_usage"
254
+ end
255
+ # verify the required parameter 'external_subscription_id' is set
256
+ if @api_client.config.client_side_validation && external_subscription_id.nil?
257
+ fail ArgumentError, "Missing the required parameter 'external_subscription_id' when calling CustomersApi.find_all_customer_past_usage"
258
+ end
259
+ # resource path
260
+ local_var_path = '/customers/{external_customer_id}/past_usage'.sub('{' + 'external_customer_id' + '}', CGI.escape(external_customer_id.to_s))
261
+
262
+ # query parameters
263
+ query_params = opts[:query_params] || {}
264
+ query_params[:'external_subscription_id'] = external_subscription_id
265
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
266
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
267
+ query_params[:'billable_metric_code'] = opts[:'billable_metric_code'] if !opts[:'billable_metric_code'].nil?
268
+ query_params[:'periods_count'] = opts[:'periods_count'] if !opts[:'periods_count'].nil?
269
+
270
+ # header parameters
271
+ header_params = opts[:header_params] || {}
272
+ # HTTP header 'Accept' (if needed)
273
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
274
+
275
+ # form parameters
276
+ form_params = opts[:form_params] || {}
277
+
278
+ # http body (model)
279
+ post_body = opts[:debug_body]
280
+
281
+ # return_type
282
+ return_type = opts[:debug_return_type] || 'CustomerPastUsage'
283
+
284
+ # auth_names
285
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
286
+
287
+ new_options = opts.merge(
288
+ :operation => :"CustomersApi.find_all_customer_past_usage",
289
+ :header_params => header_params,
290
+ :query_params => query_params,
291
+ :form_params => form_params,
292
+ :body => post_body,
293
+ :auth_names => auth_names,
294
+ :return_type => return_type
295
+ )
296
+
297
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
298
+ if @api_client.config.debugging
299
+ @api_client.config.logger.debug "API called: CustomersApi#find_all_customer_past_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
300
+ end
301
+ return data, status_code, headers
302
+ end
303
+
222
304
  # List all customers
223
305
  # This endpoint retrieves all existing customers.
224
306
  # @param [Hash] opts the optional parameters
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -229,6 +229,69 @@ module LagoAPI
229
229
  return data, status_code, headers
230
230
  end
231
231
 
232
+ # Retrieve a subscription
233
+ # This endpoint retrieves a specific subscription.
234
+ # @param external_id [String] External ID of the existing subscription
235
+ # @param [Hash] opts the optional parameters
236
+ # @return [Subscription]
237
+ def find_subscription(external_id, opts = {})
238
+ data, _status_code, _headers = find_subscription_with_http_info(external_id, opts)
239
+ data
240
+ end
241
+
242
+ # Retrieve a subscription
243
+ # This endpoint retrieves a specific subscription.
244
+ # @param external_id [String] External ID of the existing subscription
245
+ # @param [Hash] opts the optional parameters
246
+ # @return [Array<(Subscription, Integer, Hash)>] Subscription data, response status code and response headers
247
+ def find_subscription_with_http_info(external_id, opts = {})
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug 'Calling API: SubscriptionsApi.find_subscription ...'
250
+ end
251
+ # verify the required parameter 'external_id' is set
252
+ if @api_client.config.client_side_validation && external_id.nil?
253
+ fail ArgumentError, "Missing the required parameter 'external_id' when calling SubscriptionsApi.find_subscription"
254
+ end
255
+ # resource path
256
+ local_var_path = '/subscriptions/{external_id}'.sub('{' + 'external_id' + '}', CGI.escape(external_id.to_s))
257
+
258
+ # query parameters
259
+ query_params = opts[:query_params] || {}
260
+
261
+ # header parameters
262
+ header_params = opts[:header_params] || {}
263
+ # HTTP header 'Accept' (if needed)
264
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
265
+
266
+ # form parameters
267
+ form_params = opts[:form_params] || {}
268
+
269
+ # http body (model)
270
+ post_body = opts[:debug_body]
271
+
272
+ # return_type
273
+ return_type = opts[:debug_return_type] || 'Subscription'
274
+
275
+ # auth_names
276
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
277
+
278
+ new_options = opts.merge(
279
+ :operation => :"SubscriptionsApi.find_subscription",
280
+ :header_params => header_params,
281
+ :query_params => query_params,
282
+ :form_params => form_params,
283
+ :body => post_body,
284
+ :auth_names => auth_names,
285
+ :return_type => return_type
286
+ )
287
+
288
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug "API called: SubscriptionsApi#find_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
291
+ end
292
+ return data, status_code, headers
293
+ end
294
+
232
295
  # Update a subscription
233
296
  # This endpoint allows you to update a subscription.
234
297
  # @param external_id [String] External ID of the existing subscription
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -17,6 +17,7 @@ require 'tempfile'
17
17
  require 'time'
18
18
  require 'typhoeus'
19
19
 
20
+
20
21
  module LagoAPI
21
22
  class ApiClient
22
23
  # The Configuration object holding settings to be used in the API client.
@@ -222,7 +223,7 @@ module LagoAPI
222
223
  return nil if body.nil? || body.empty?
223
224
 
224
225
  # return response body directly for String return type
225
- return body if return_type == 'String'
226
+ return body.to_s if return_type == 'String'
226
227
 
227
228
  # ensuring a default content type
228
229
  content_type = response.headers['Content-Type'] || 'application/json'
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -293,5 +293,6 @@ module LagoAPI
293
293
  url
294
294
  end
295
295
 
296
+
296
297
  end
297
298
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -18,6 +18,9 @@ module LagoAPI
18
18
  # The name of the add-on.
19
19
  attr_accessor :name
20
20
 
21
+ # Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
22
+ attr_accessor :invoice_display_name
23
+
21
24
  # Unique code used to identify the add-on.
22
25
  attr_accessor :code
23
26
 
@@ -36,6 +39,7 @@ module LagoAPI
36
39
  def self.attribute_map
37
40
  {
38
41
  :'name' => :'name',
42
+ :'invoice_display_name' => :'invoice_display_name',
39
43
  :'code' => :'code',
40
44
  :'amount_cents' => :'amount_cents',
41
45
  :'amount_currency' => :'amount_currency',
@@ -53,6 +57,7 @@ module LagoAPI
53
57
  def self.openapi_types
54
58
  {
55
59
  :'name' => :'String',
60
+ :'invoice_display_name' => :'String',
56
61
  :'code' => :'String',
57
62
  :'amount_cents' => :'Integer',
58
63
  :'amount_currency' => :'Currency',
@@ -87,6 +92,10 @@ module LagoAPI
87
92
  self.name = attributes[:'name']
88
93
  end
89
94
 
95
+ if attributes.key?(:'invoice_display_name')
96
+ self.invoice_display_name = attributes[:'invoice_display_name']
97
+ end
98
+
90
99
  if attributes.key?(:'code')
91
100
  self.code = attributes[:'code']
92
101
  end
@@ -131,6 +140,7 @@ module LagoAPI
131
140
  return true if self.equal?(o)
132
141
  self.class == o.class &&
133
142
  name == o.name &&
143
+ invoice_display_name == o.invoice_display_name &&
134
144
  code == o.code &&
135
145
  amount_cents == o.amount_cents &&
136
146
  amount_currency == o.amount_currency &&
@@ -147,7 +157,7 @@ module LagoAPI
147
157
  # Calculates hash code according to all attributes.
148
158
  # @return [Integer] Hash code
149
159
  def hash
150
- [name, code, amount_cents, amount_currency, description, tax_codes].hash
160
+ [name, invoice_display_name, code, amount_cents, amount_currency, description, tax_codes].hash
151
161
  end
152
162
 
153
163
  # Builds the object from hash
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -18,6 +18,9 @@ module LagoAPI
18
18
  # The name of the add-on.
19
19
  attr_accessor :name
20
20
 
21
+ # Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
22
+ attr_accessor :invoice_display_name
23
+
21
24
  # Unique code used to identify the add-on.
22
25
  attr_accessor :code
23
26
 
@@ -36,6 +39,7 @@ module LagoAPI
36
39
  def self.attribute_map
37
40
  {
38
41
  :'name' => :'name',
42
+ :'invoice_display_name' => :'invoice_display_name',
39
43
  :'code' => :'code',
40
44
  :'amount_cents' => :'amount_cents',
41
45
  :'amount_currency' => :'amount_currency',
@@ -53,6 +57,7 @@ module LagoAPI
53
57
  def self.openapi_types
54
58
  {
55
59
  :'name' => :'String',
60
+ :'invoice_display_name' => :'String',
56
61
  :'code' => :'String',
57
62
  :'amount_cents' => :'Integer',
58
63
  :'amount_currency' => :'Currency',
@@ -96,6 +101,10 @@ module LagoAPI
96
101
  self.name = nil
97
102
  end
98
103
 
104
+ if attributes.key?(:'invoice_display_name')
105
+ self.invoice_display_name = attributes[:'invoice_display_name']
106
+ end
107
+
99
108
  if attributes.key?(:'code')
100
109
  self.code = attributes[:'code']
101
110
  else
@@ -166,6 +175,7 @@ module LagoAPI
166
175
  return true if self.equal?(o)
167
176
  self.class == o.class &&
168
177
  name == o.name &&
178
+ invoice_display_name == o.invoice_display_name &&
169
179
  code == o.code &&
170
180
  amount_cents == o.amount_cents &&
171
181
  amount_currency == o.amount_currency &&
@@ -182,7 +192,7 @@ module LagoAPI
182
192
  # Calculates hash code according to all attributes.
183
193
  # @return [Integer] Hash code
184
194
  def hash
185
- [name, code, amount_cents, amount_currency, description, tax_codes].hash
195
+ [name, invoice_display_name, code, amount_cents, amount_currency, description, tax_codes].hash
186
196
  end
187
197
 
188
198
  # Builds the object from hash
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
5
 
6
- The version of the OpenAPI document: 0.48.0-beta
6
+ The version of the OpenAPI document: 0.49.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -21,6 +21,9 @@ module LagoAPI
21
21
  # The name of the add-on.
22
22
  attr_accessor :name
23
23
 
24
+ # Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
25
+ attr_accessor :invoice_display_name
26
+
24
27
  # Unique code used to identify the add-on.
25
28
  attr_accessor :code
26
29
 
@@ -43,6 +46,7 @@ module LagoAPI
43
46
  {
44
47
  :'lago_id' => :'lago_id',
45
48
  :'name' => :'name',
49
+ :'invoice_display_name' => :'invoice_display_name',
46
50
  :'code' => :'code',
47
51
  :'amount_cents' => :'amount_cents',
48
52
  :'amount_currency' => :'amount_currency',
@@ -62,6 +66,7 @@ module LagoAPI
62
66
  {
63
67
  :'lago_id' => :'String',
64
68
  :'name' => :'String',
69
+ :'invoice_display_name' => :'String',
65
70
  :'code' => :'String',
66
71
  :'amount_cents' => :'Integer',
67
72
  :'amount_currency' => :'Currency',
@@ -105,6 +110,10 @@ module LagoAPI
105
110
  self.name = nil
106
111
  end
107
112
 
113
+ if attributes.key?(:'invoice_display_name')
114
+ self.invoice_display_name = attributes[:'invoice_display_name']
115
+ end
116
+
108
117
  if attributes.key?(:'code')
109
118
  self.code = attributes[:'code']
110
119
  else
@@ -192,6 +201,7 @@ module LagoAPI
192
201
  self.class == o.class &&
193
202
  lago_id == o.lago_id &&
194
203
  name == o.name &&
204
+ invoice_display_name == o.invoice_display_name &&
195
205
  code == o.code &&
196
206
  amount_cents == o.amount_cents &&
197
207
  amount_currency == o.amount_currency &&
@@ -209,7 +219,7 @@ module LagoAPI
209
219
  # Calculates hash code according to all attributes.
210
220
  # @return [Integer] Hash code
211
221
  def hash
212
- [lago_id, name, code, amount_cents, amount_currency, description, created_at, taxes].hash
222
+ [lago_id, name, invoice_display_name, code, amount_cents, amount_currency, description, created_at, taxes].hash
213
223
  end
214
224
 
215
225
  # Builds the object from hash