lago_ruby 0.49.0.pre.beta → 0.52.0.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (265) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +30 -6
  4. data/docs/AddOnCreateInputAddOn.md +1 -1
  5. data/docs/AnalyticsApi.md +299 -0
  6. data/docs/CreditNoteCreateInputCreditNote.md +1 -1
  7. data/docs/CreditNoteEstimateInput.md +18 -0
  8. data/docs/CreditNoteEstimateInputCreditNote.md +20 -0
  9. data/docs/CreditNoteEstimateInputCreditNoteItemsInner.md +20 -0
  10. data/docs/CreditNoteEstimated.md +18 -0
  11. data/docs/CreditNoteEstimatedEstimatedCreditNote.md +38 -0
  12. data/docs/CreditNoteEstimatedEstimatedCreditNoteAppliedTaxesInner.md +32 -0
  13. data/docs/CreditNoteEstimatedEstimatedCreditNoteItemsInner.md +20 -0
  14. data/docs/CreditNoteItemObjectFee.md +6 -4
  15. data/docs/CreditNoteObject.md +2 -2
  16. data/docs/CreditNotesApi.md +72 -0
  17. data/docs/CustomerChargeUsageObjectCharge.md +3 -1
  18. data/docs/CustomersApi.md +70 -0
  19. data/docs/EventsApi.md +7 -6
  20. data/docs/FeeObject.md +6 -4
  21. data/docs/FeeObjectItem.md +2 -0
  22. data/docs/GenerateCustomerCheckoutURL200Response.md +24 -0
  23. data/docs/GrossRevenueObject.md +22 -0
  24. data/docs/GrossRevenues.md +18 -0
  25. data/docs/InvoicedUsageObject.md +24 -0
  26. data/docs/InvoicedUsages.md +18 -0
  27. data/docs/MrrObject.md +22 -0
  28. data/docs/Mrrs.md +18 -0
  29. data/docs/OrganizationObject.md +2 -0
  30. data/docs/OrganizationUpdateInputOrganization.md +2 -0
  31. data/docs/OutstandingInvoiceObject.md +26 -0
  32. data/docs/OutstandingInvoices.md +18 -0
  33. data/docs/PlanOverridesObject.md +32 -0
  34. data/docs/PlanOverridesObjectChargesInner.md +30 -0
  35. data/docs/Subscription.md +1 -1
  36. data/docs/SubscriptionCreateInputSubscription.md +3 -1
  37. data/docs/SubscriptionObjectExtended.md +52 -0
  38. data/docs/SubscriptionUpdateInputSubscription.md +3 -1
  39. data/lago_ruby.gemspec +2 -2
  40. data/lib/lago_ruby/api/add_ons_api.rb +2 -2
  41. data/lib/lago_ruby/api/analytics_api.rb +268 -0
  42. data/lib/lago_ruby/api/billable_metrics_api.rb +2 -2
  43. data/lib/lago_ruby/api/coupons_api.rb +2 -2
  44. data/lib/lago_ruby/api/credit_notes_api.rb +66 -2
  45. data/lib/lago_ruby/api/customers_api.rb +65 -2
  46. data/lib/lago_ruby/api/events_api.rb +7 -7
  47. data/lib/lago_ruby/api/fees_api.rb +2 -2
  48. data/lib/lago_ruby/api/invoices_api.rb +2 -2
  49. data/lib/lago_ruby/api/organizations_api.rb +2 -2
  50. data/lib/lago_ruby/api/plans_api.rb +2 -2
  51. data/lib/lago_ruby/api/subscriptions_api.rb +2 -2
  52. data/lib/lago_ruby/api/taxes_api.rb +2 -2
  53. data/lib/lago_ruby/api/wallets_api.rb +2 -2
  54. data/lib/lago_ruby/api/webhook_endpoints_api.rb +2 -2
  55. data/lib/lago_ruby/api/webhooks_api.rb +2 -2
  56. data/lib/lago_ruby/api_client.rb +12 -13
  57. data/lib/lago_ruby/api_error.rb +2 -2
  58. data/lib/lago_ruby/configuration.rb +2 -2
  59. data/lib/lago_ruby/models/add_on.rb +3 -3
  60. data/lib/lago_ruby/models/add_on_base_input.rb +3 -3
  61. data/lib/lago_ruby/models/add_on_create_input.rb +3 -3
  62. data/lib/lago_ruby/models/add_on_create_input_add_on.rb +3 -3
  63. data/lib/lago_ruby/models/add_on_object.rb +3 -3
  64. data/lib/lago_ruby/models/add_on_update_input.rb +3 -3
  65. data/lib/lago_ruby/models/add_ons_paginated.rb +3 -3
  66. data/lib/lago_ruby/models/api_error_bad_request.rb +3 -3
  67. data/lib/lago_ruby/models/api_error_forbidden.rb +3 -3
  68. data/lib/lago_ruby/models/api_error_not_allowed.rb +3 -3
  69. data/lib/lago_ruby/models/api_error_not_found.rb +3 -3
  70. data/lib/lago_ruby/models/api_error_unauthorized.rb +3 -3
  71. data/lib/lago_ruby/models/api_error_unprocessable_entity.rb +3 -3
  72. data/lib/lago_ruby/models/applied_coupon.rb +3 -3
  73. data/lib/lago_ruby/models/applied_coupon_input.rb +3 -3
  74. data/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb +3 -3
  75. data/lib/lago_ruby/models/applied_coupon_object.rb +3 -3
  76. data/lib/lago_ruby/models/applied_coupon_object_extended.rb +3 -3
  77. data/lib/lago_ruby/models/applied_coupons_paginated.rb +3 -3
  78. data/lib/lago_ruby/models/base_applied_tax.rb +3 -3
  79. data/lib/lago_ruby/models/billable_metric.rb +3 -3
  80. data/lib/lago_ruby/models/billable_metric_base_input.rb +3 -3
  81. data/lib/lago_ruby/models/billable_metric_create_input.rb +3 -3
  82. data/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb +3 -3
  83. data/lib/lago_ruby/models/billable_metric_group.rb +3 -3
  84. data/lib/lago_ruby/models/billable_metric_group_values_inner.rb +2 -2
  85. data/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb +3 -3
  86. data/lib/lago_ruby/models/billable_metric_object.rb +3 -3
  87. data/lib/lago_ruby/models/billable_metric_update_input.rb +3 -3
  88. data/lib/lago_ruby/models/billable_metrics_paginated.rb +3 -3
  89. data/lib/lago_ruby/models/charge_object.rb +3 -3
  90. data/lib/lago_ruby/models/charge_object_properties.rb +3 -3
  91. data/lib/lago_ruby/models/charge_properties.rb +3 -3
  92. data/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb +3 -3
  93. data/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb +3 -3
  94. data/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb +3 -3
  95. data/lib/lago_ruby/models/country.rb +2 -2
  96. data/lib/lago_ruby/models/coupon.rb +3 -3
  97. data/lib/lago_ruby/models/coupon_base_input.rb +3 -3
  98. data/lib/lago_ruby/models/coupon_base_input_applies_to.rb +3 -3
  99. data/lib/lago_ruby/models/coupon_create_input.rb +3 -3
  100. data/lib/lago_ruby/models/coupon_create_input_coupon.rb +3 -3
  101. data/lib/lago_ruby/models/coupon_object.rb +3 -3
  102. data/lib/lago_ruby/models/coupon_update_input.rb +3 -3
  103. data/lib/lago_ruby/models/coupons_paginated.rb +3 -3
  104. data/lib/lago_ruby/models/credit_note.rb +3 -3
  105. data/lib/lago_ruby/models/credit_note_applied_tax_object.rb +3 -3
  106. data/lib/lago_ruby/models/credit_note_create_input.rb +3 -3
  107. data/lib/lago_ruby/models/credit_note_create_input_credit_note.rb +4 -4
  108. data/lib/lago_ruby/models/credit_note_estimate_input.rb +221 -0
  109. data/lib/lago_ruby/models/credit_note_estimate_input_credit_note.rb +241 -0
  110. data/lib/lago_ruby/models/credit_note_estimate_input_credit_note_items_inner.rb +239 -0
  111. data/lib/lago_ruby/models/credit_note_estimated.rb +221 -0
  112. data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note.rb +387 -0
  113. data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner.rb +283 -0
  114. data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_items_inner.rb +235 -0
  115. data/lib/lago_ruby/models/credit_note_item_object.rb +3 -3
  116. data/lib/lago_ruby/models/credit_note_item_object_fee.rb +25 -8
  117. data/lib/lago_ruby/models/credit_note_object.rb +14 -14
  118. data/lib/lago_ruby/models/credit_note_update_input.rb +3 -3
  119. data/lib/lago_ruby/models/credit_note_update_input_credit_note.rb +3 -3
  120. data/lib/lago_ruby/models/credit_notes.rb +3 -3
  121. data/lib/lago_ruby/models/credit_object.rb +3 -3
  122. data/lib/lago_ruby/models/credit_object_invoice.rb +3 -3
  123. data/lib/lago_ruby/models/credit_object_item.rb +3 -3
  124. data/lib/lago_ruby/models/currency.rb +2 -2
  125. data/lib/lago_ruby/models/customer.rb +3 -3
  126. data/lib/lago_ruby/models/customer_billing_configuration.rb +3 -3
  127. data/lib/lago_ruby/models/customer_charge_usage_object.rb +3 -3
  128. data/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb +3 -3
  129. data/lib/lago_ruby/models/customer_charge_usage_object_charge.rb +17 -7
  130. data/lib/lago_ruby/models/customer_charge_usage_object_groups_inner.rb +3 -3
  131. data/lib/lago_ruby/models/customer_create_input.rb +3 -3
  132. data/lib/lago_ruby/models/customer_create_input_customer.rb +3 -3
  133. data/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb +3 -3
  134. data/lib/lago_ruby/models/customer_metadata.rb +3 -3
  135. data/lib/lago_ruby/models/customer_object.rb +3 -3
  136. data/lib/lago_ruby/models/customer_object_extended.rb +3 -3
  137. data/lib/lago_ruby/models/customer_past_usage.rb +3 -3
  138. data/lib/lago_ruby/models/customer_usage.rb +3 -3
  139. data/lib/lago_ruby/models/customer_usage_object.rb +3 -3
  140. data/lib/lago_ruby/models/customers_paginated.rb +3 -3
  141. data/lib/lago_ruby/models/event.rb +3 -3
  142. data/lib/lago_ruby/models/event_batch_input.rb +3 -3
  143. data/lib/lago_ruby/models/event_batch_input_event.rb +3 -3
  144. data/lib/lago_ruby/models/event_batch_input_event_properties.rb +3 -3
  145. data/lib/lago_ruby/models/event_estimate_fees_input.rb +3 -3
  146. data/lib/lago_ruby/models/event_estimate_fees_input_event.rb +3 -3
  147. data/lib/lago_ruby/models/event_input.rb +3 -3
  148. data/lib/lago_ruby/models/event_input_event.rb +3 -3
  149. data/lib/lago_ruby/models/event_input_event_timestamp.rb +2 -2
  150. data/lib/lago_ruby/models/event_object.rb +7 -23
  151. data/lib/lago_ruby/models/event_object_properties.rb +3 -3
  152. data/lib/lago_ruby/models/fee.rb +3 -3
  153. data/lib/lago_ruby/models/fee_applied_tax_object.rb +3 -3
  154. data/lib/lago_ruby/models/fee_object.rb +25 -8
  155. data/lib/lago_ruby/models/fee_object_item.rb +14 -4
  156. data/lib/lago_ruby/models/fee_update_input.rb +3 -3
  157. data/lib/lago_ruby/models/fee_update_input_fee.rb +3 -3
  158. data/lib/lago_ruby/models/fees.rb +3 -3
  159. data/lib/lago_ruby/models/fees_paginated.rb +3 -3
  160. data/lib/lago_ruby/models/generate_customer_checkout_url200_response.rb +246 -0
  161. data/lib/lago_ruby/models/get_customer_portal_url200_response.rb +3 -3
  162. data/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb +3 -3
  163. data/lib/lago_ruby/models/gross_revenue_object.rb +241 -0
  164. data/lib/lago_ruby/models/gross_revenues.rb +223 -0
  165. data/lib/lago_ruby/models/group_object.rb +3 -3
  166. data/lib/lago_ruby/models/group_properties_object.rb +3 -3
  167. data/lib/lago_ruby/models/group_properties_object_values.rb +3 -3
  168. data/lib/lago_ruby/models/groups_paginated.rb +3 -3
  169. data/lib/lago_ruby/models/invoice.rb +3 -3
  170. data/lib/lago_ruby/models/invoice_applied_tax_object.rb +3 -3
  171. data/lib/lago_ruby/models/invoice_metadata_object.rb +3 -3
  172. data/lib/lago_ruby/models/invoice_object.rb +3 -3
  173. data/lib/lago_ruby/models/invoice_object_customer.rb +3 -3
  174. data/lib/lago_ruby/models/invoice_object_extended.rb +3 -3
  175. data/lib/lago_ruby/models/invoice_one_off_create_input.rb +3 -3
  176. data/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb +3 -3
  177. data/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb +3 -3
  178. data/lib/lago_ruby/models/invoice_update_input.rb +3 -3
  179. data/lib/lago_ruby/models/invoice_update_input_invoice.rb +3 -3
  180. data/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb +3 -3
  181. data/lib/lago_ruby/models/invoiced_usage_object.rb +265 -0
  182. data/lib/lago_ruby/models/invoiced_usages.rb +223 -0
  183. data/lib/lago_ruby/models/invoices_paginated.rb +3 -3
  184. data/lib/lago_ruby/models/mrr_object.rb +241 -0
  185. data/lib/lago_ruby/models/mrrs.rb +223 -0
  186. data/lib/lago_ruby/models/organization.rb +3 -3
  187. data/lib/lago_ruby/models/organization_billing_configuration.rb +3 -3
  188. data/lib/lago_ruby/models/organization_object.rb +13 -4
  189. data/lib/lago_ruby/models/organization_update_input.rb +3 -3
  190. data/lib/lago_ruby/models/organization_update_input_organization.rb +13 -4
  191. data/lib/lago_ruby/models/outstanding_invoice_object.rb +309 -0
  192. data/lib/lago_ruby/models/outstanding_invoices.rb +223 -0
  193. data/lib/lago_ruby/models/pagination_meta.rb +3 -3
  194. data/lib/lago_ruby/models/plan.rb +3 -3
  195. data/lib/lago_ruby/models/plan_create_input.rb +3 -3
  196. data/lib/lago_ruby/models/plan_create_input_plan.rb +3 -3
  197. data/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb +3 -3
  198. data/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb +3 -3
  199. data/lib/lago_ruby/models/plan_object.rb +3 -3
  200. data/lib/lago_ruby/models/plan_overrides_object.rb +289 -0
  201. data/lib/lago_ruby/models/plan_overrides_object_charges_inner.rb +278 -0
  202. data/lib/lago_ruby/models/plan_update_input.rb +3 -3
  203. data/lib/lago_ruby/models/plan_update_input_plan.rb +3 -3
  204. data/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb +3 -3
  205. data/lib/lago_ruby/models/plans_paginated.rb +3 -3
  206. data/lib/lago_ruby/models/subscription.rb +4 -4
  207. data/lib/lago_ruby/models/subscription_create_input.rb +3 -3
  208. data/lib/lago_ruby/models/subscription_create_input_subscription.rb +16 -7
  209. data/lib/lago_ruby/models/subscription_object.rb +3 -3
  210. data/lib/lago_ruby/models/subscription_object_extended.rb +507 -0
  211. data/lib/lago_ruby/models/subscription_update_input.rb +3 -3
  212. data/lib/lago_ruby/models/subscription_update_input_subscription.rb +16 -7
  213. data/lib/lago_ruby/models/subscriptions_paginated.rb +3 -3
  214. data/lib/lago_ruby/models/tax.rb +3 -3
  215. data/lib/lago_ruby/models/tax_base_input.rb +3 -3
  216. data/lib/lago_ruby/models/tax_create_input.rb +3 -3
  217. data/lib/lago_ruby/models/tax_create_input_tax.rb +3 -3
  218. data/lib/lago_ruby/models/tax_object.rb +3 -3
  219. data/lib/lago_ruby/models/tax_update_input.rb +3 -3
  220. data/lib/lago_ruby/models/taxes_paginated.rb +3 -3
  221. data/lib/lago_ruby/models/timezone.rb +2 -2
  222. data/lib/lago_ruby/models/wallet.rb +3 -3
  223. data/lib/lago_ruby/models/wallet_create_input.rb +3 -3
  224. data/lib/lago_ruby/models/wallet_create_input_wallet.rb +3 -3
  225. data/lib/lago_ruby/models/wallet_object.rb +3 -3
  226. data/lib/lago_ruby/models/wallet_transaction_create_input.rb +3 -3
  227. data/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb +3 -3
  228. data/lib/lago_ruby/models/wallet_transaction_object.rb +3 -3
  229. data/lib/lago_ruby/models/wallet_transactions.rb +3 -3
  230. data/lib/lago_ruby/models/wallet_transactions_paginated.rb +3 -3
  231. data/lib/lago_ruby/models/wallet_update_input.rb +3 -3
  232. data/lib/lago_ruby/models/wallet_update_input_wallet.rb +3 -3
  233. data/lib/lago_ruby/models/wallets_paginated.rb +3 -3
  234. data/lib/lago_ruby/models/webhook_endpoint.rb +3 -3
  235. data/lib/lago_ruby/models/webhook_endpoint_create_input.rb +3 -3
  236. data/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb +3 -3
  237. data/lib/lago_ruby/models/webhook_endpoint_object.rb +3 -3
  238. data/lib/lago_ruby/models/webhook_endpoint_update_input.rb +3 -3
  239. data/lib/lago_ruby/models/webhook_endpoints_paginated.rb +3 -3
  240. data/lib/lago_ruby/version.rb +3 -3
  241. data/lib/lago_ruby.rb +22 -3
  242. data/spec/api/analytics_api_spec.rb +85 -0
  243. data/spec/api_client_spec.rb +2 -2
  244. data/spec/configuration_spec.rb +2 -2
  245. data/spec/models/{credit_note_create_input_credit_note_items_inner_spec.rb → credit_note_estimate_input_credit_note_items_inner_spec.rb} +10 -8
  246. data/spec/models/credit_note_estimate_input_credit_note_spec.rb +42 -0
  247. data/spec/models/credit_note_estimate_input_spec.rb +36 -0
  248. data/spec/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner_spec.rb +78 -0
  249. data/spec/models/credit_note_estimated_estimated_credit_note_items_inner_spec.rb +42 -0
  250. data/spec/models/credit_note_estimated_estimated_credit_note_spec.rb +96 -0
  251. data/spec/models/credit_note_estimated_spec.rb +36 -0
  252. data/spec/models/generate_customer_checkout_url200_response_spec.rb +54 -0
  253. data/spec/models/gross_revenue_object_spec.rb +48 -0
  254. data/spec/models/gross_revenues_spec.rb +36 -0
  255. data/spec/models/invoiced_usage_object_spec.rb +54 -0
  256. data/spec/models/invoiced_usages_spec.rb +36 -0
  257. data/spec/models/mrr_object_spec.rb +48 -0
  258. data/spec/models/mrrs_spec.rb +36 -0
  259. data/spec/models/outstanding_invoice_object_spec.rb +64 -0
  260. data/spec/models/outstanding_invoices_spec.rb +36 -0
  261. data/spec/models/plan_overrides_object_charges_inner_spec.rb +66 -0
  262. data/spec/models/plan_overrides_object_spec.rb +78 -0
  263. data/spec/models/subscription_object_extended_spec.rb +146 -0
  264. data/spec/spec_helper.rb +2 -2
  265. metadata +237 -159
@@ -3,10 +3,10 @@
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.49.0-beta
6
+ The version of the OpenAPI document: 0.51.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0-SNAPSHOT
9
+ OpenAPI Generator version: 7.2.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -166,7 +166,7 @@ module LagoAPI
166
166
  else # model
167
167
  # models (e.g. Pet) or oneOf
168
168
  klass = LagoAPI.const_get(type)
169
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
170
  end
171
171
  end
172
172
 
@@ -3,10 +3,10 @@
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.49.0-beta
6
+ The version of the OpenAPI document: 0.51.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0-SNAPSHOT
9
+ OpenAPI Generator version: 7.2.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -36,6 +36,8 @@ module LagoAPI
36
36
  # The start date for the subscription, allowing for the creation of subscriptions that can begin in the past or future. Please note that it cannot be used to update the start date of a pending subscription or schedule an upgrade/downgrade. The start_date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
37
37
  attr_accessor :subscription_at
38
38
 
39
+ attr_accessor :plan_overrides
40
+
39
41
  class EnumAttributeValidator
40
42
  attr_reader :datatype
41
43
  attr_reader :allowable_values
@@ -67,7 +69,8 @@ module LagoAPI
67
69
  :'external_id' => :'external_id',
68
70
  :'billing_time' => :'billing_time',
69
71
  :'ending_at' => :'ending_at',
70
- :'subscription_at' => :'subscription_at'
72
+ :'subscription_at' => :'subscription_at',
73
+ :'plan_overrides' => :'plan_overrides'
71
74
  }
72
75
  end
73
76
 
@@ -85,7 +88,8 @@ module LagoAPI
85
88
  :'external_id' => :'String',
86
89
  :'billing_time' => :'String',
87
90
  :'ending_at' => :'Time',
88
- :'subscription_at' => :'Time'
91
+ :'subscription_at' => :'Time',
92
+ :'plan_overrides' => :'PlanOverridesObject'
89
93
  }
90
94
  end
91
95
 
@@ -143,6 +147,10 @@ module LagoAPI
143
147
  if attributes.key?(:'subscription_at')
144
148
  self.subscription_at = attributes[:'subscription_at']
145
149
  end
150
+
151
+ if attributes.key?(:'plan_overrides')
152
+ self.plan_overrides = attributes[:'plan_overrides']
153
+ end
146
154
  end
147
155
 
148
156
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -198,7 +206,8 @@ module LagoAPI
198
206
  external_id == o.external_id &&
199
207
  billing_time == o.billing_time &&
200
208
  ending_at == o.ending_at &&
201
- subscription_at == o.subscription_at
209
+ subscription_at == o.subscription_at &&
210
+ plan_overrides == o.plan_overrides
202
211
  end
203
212
 
204
213
  # @see the `==` method
@@ -210,7 +219,7 @@ module LagoAPI
210
219
  # Calculates hash code according to all attributes.
211
220
  # @return [Integer] Hash code
212
221
  def hash
213
- [external_customer_id, plan_code, name, external_id, billing_time, ending_at, subscription_at].hash
222
+ [external_customer_id, plan_code, name, external_id, billing_time, ending_at, subscription_at, plan_overrides].hash
214
223
  end
215
224
 
216
225
  # Builds the object from hash
@@ -275,7 +284,7 @@ module LagoAPI
275
284
  else # model
276
285
  # models (e.g. Pet) or oneOf
277
286
  klass = LagoAPI.const_get(type)
278
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
287
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
279
288
  end
280
289
  end
281
290
 
@@ -3,10 +3,10 @@
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.49.0-beta
6
+ The version of the OpenAPI document: 0.51.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0-SNAPSHOT
9
+ OpenAPI Generator version: 7.2.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -436,7 +436,7 @@ module LagoAPI
436
436
  else # model
437
437
  # models (e.g. Pet) or oneOf
438
438
  klass = LagoAPI.const_get(type)
439
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
439
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
440
440
  end
441
441
  end
442
442
 
@@ -0,0 +1,507 @@
1
+ =begin
2
+ #Lago API documentation
3
+
4
+ #Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
5
+
6
+ The version of the OpenAPI document: 0.51.0-beta
7
+ Contact: tech@getlago.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.2.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module LagoAPI
17
+ class SubscriptionObjectExtended
18
+ # Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system
19
+ attr_accessor :lago_id
20
+
21
+ # The subscription external unique identifier (provided by your own application).
22
+ attr_accessor :external_id
23
+
24
+ # Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
25
+ attr_accessor :lago_customer_id
26
+
27
+ # The customer external unique identifier (provided by your own application).
28
+ attr_accessor :external_customer_id
29
+
30
+ # The billing time for the subscription, which can be set as either `anniversary` or `calendar`. If not explicitly provided, it will default to `calendar`. The billing time determines the timing of recurring billing cycles for the subscription. By specifying `anniversary`, the billing cycle will be based on the specific date the subscription started (billed fully), while `calendar` sets the billing cycle at the first day of the week/month/year (billed with proration).
31
+ attr_accessor :billing_time
32
+
33
+ # The display name of the subscription on an invoice. This field allows for customization of the subscription's name for billing purposes, especially useful when a single customer has multiple subscriptions using the same plan.
34
+ attr_accessor :name
35
+
36
+ # The unique code representing the plan to be attached to the customer. This code must correspond to the `code` property of one of the active plans.
37
+ attr_accessor :plan_code
38
+
39
+ # The status of the subscription, which can have the following values: - `pending`: a previous subscription has been downgraded, and the current one is awaiting automatic activation at the end of the billing period. - `active`: the subscription is currently active and applied to the customer. - `terminated`: the subscription is no longer active. - `canceled`: the subscription has been stopped before its activation. This can occur when two consecutive downgrades have been applied to a customer or when a subscription with a pending status is terminated.
40
+ attr_accessor :status
41
+
42
+ # The creation date of the subscription, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). This date provides a timestamp indicating when the subscription was initially created.
43
+ attr_accessor :created_at
44
+
45
+ # The cancellation date of the subscription. This field is not null when the subscription is `canceled`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
46
+ attr_accessor :canceled_at
47
+
48
+ # The effective start date of the subscription. This field can be null if the subscription is `pending` or `canceled`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
49
+ attr_accessor :started_at
50
+
51
+ # The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC).
52
+ attr_accessor :ending_at
53
+
54
+ # The anniversary date and time of the initial subscription. This date serves as the basis for billing subscriptions with `anniversary` billing time. The `anniversary_date` should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
55
+ attr_accessor :subscription_at
56
+
57
+ # The termination date of the subscription. This field is not null when the subscription is `terminated`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC)
58
+ attr_accessor :terminated_at
59
+
60
+ # The code identifying the previous plan associated with this subscription.
61
+ attr_accessor :previous_plan_code
62
+
63
+ # The code identifying the next plan in the case of a downgrade.
64
+ attr_accessor :next_plan_code
65
+
66
+ # The date when the plan will be downgraded, represented in ISO 8601 date format.
67
+ attr_accessor :downgrade_plan_date
68
+
69
+ attr_accessor :plan
70
+
71
+ class EnumAttributeValidator
72
+ attr_reader :datatype
73
+ attr_reader :allowable_values
74
+
75
+ def initialize(datatype, allowable_values)
76
+ @allowable_values = allowable_values.map do |value|
77
+ case datatype.to_s
78
+ when /Integer/i
79
+ value.to_i
80
+ when /Float/i
81
+ value.to_f
82
+ else
83
+ value
84
+ end
85
+ end
86
+ end
87
+
88
+ def valid?(value)
89
+ !value || allowable_values.include?(value)
90
+ end
91
+ end
92
+
93
+ # Attribute mapping from ruby-style variable name to JSON key.
94
+ def self.attribute_map
95
+ {
96
+ :'lago_id' => :'lago_id',
97
+ :'external_id' => :'external_id',
98
+ :'lago_customer_id' => :'lago_customer_id',
99
+ :'external_customer_id' => :'external_customer_id',
100
+ :'billing_time' => :'billing_time',
101
+ :'name' => :'name',
102
+ :'plan_code' => :'plan_code',
103
+ :'status' => :'status',
104
+ :'created_at' => :'created_at',
105
+ :'canceled_at' => :'canceled_at',
106
+ :'started_at' => :'started_at',
107
+ :'ending_at' => :'ending_at',
108
+ :'subscription_at' => :'subscription_at',
109
+ :'terminated_at' => :'terminated_at',
110
+ :'previous_plan_code' => :'previous_plan_code',
111
+ :'next_plan_code' => :'next_plan_code',
112
+ :'downgrade_plan_date' => :'downgrade_plan_date',
113
+ :'plan' => :'plan'
114
+ }
115
+ end
116
+
117
+ # Returns all the JSON keys this model knows about
118
+ def self.acceptable_attributes
119
+ attribute_map.values
120
+ end
121
+
122
+ # Attribute type mapping.
123
+ def self.openapi_types
124
+ {
125
+ :'lago_id' => :'String',
126
+ :'external_id' => :'String',
127
+ :'lago_customer_id' => :'String',
128
+ :'external_customer_id' => :'String',
129
+ :'billing_time' => :'String',
130
+ :'name' => :'String',
131
+ :'plan_code' => :'String',
132
+ :'status' => :'String',
133
+ :'created_at' => :'Time',
134
+ :'canceled_at' => :'Time',
135
+ :'started_at' => :'Time',
136
+ :'ending_at' => :'Time',
137
+ :'subscription_at' => :'Time',
138
+ :'terminated_at' => :'Time',
139
+ :'previous_plan_code' => :'String',
140
+ :'next_plan_code' => :'String',
141
+ :'downgrade_plan_date' => :'Time',
142
+ :'plan' => :'PlanObject'
143
+ }
144
+ end
145
+
146
+ # List of attributes with nullable: true
147
+ def self.openapi_nullable
148
+ Set.new([
149
+ :'name',
150
+ :'canceled_at',
151
+ :'started_at',
152
+ :'terminated_at',
153
+ :'previous_plan_code',
154
+ :'next_plan_code',
155
+ :'downgrade_plan_date',
156
+ ])
157
+ end
158
+
159
+ # List of class defined in allOf (OpenAPI v3)
160
+ def self.openapi_all_of
161
+ [
162
+ :'SubscriptionObject'
163
+ ]
164
+ end
165
+
166
+ # Initializes the object
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ def initialize(attributes = {})
169
+ if (!attributes.is_a?(Hash))
170
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::SubscriptionObjectExtended` initialize method"
171
+ end
172
+
173
+ # check to see if the attribute exists and convert string to symbol for hash key
174
+ attributes = attributes.each_with_object({}) { |(k, v), h|
175
+ if (!self.class.attribute_map.key?(k.to_sym))
176
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::SubscriptionObjectExtended`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
177
+ end
178
+ h[k.to_sym] = v
179
+ }
180
+
181
+ if attributes.key?(:'lago_id')
182
+ self.lago_id = attributes[:'lago_id']
183
+ else
184
+ self.lago_id = nil
185
+ end
186
+
187
+ if attributes.key?(:'external_id')
188
+ self.external_id = attributes[:'external_id']
189
+ else
190
+ self.external_id = nil
191
+ end
192
+
193
+ if attributes.key?(:'lago_customer_id')
194
+ self.lago_customer_id = attributes[:'lago_customer_id']
195
+ else
196
+ self.lago_customer_id = nil
197
+ end
198
+
199
+ if attributes.key?(:'external_customer_id')
200
+ self.external_customer_id = attributes[:'external_customer_id']
201
+ else
202
+ self.external_customer_id = nil
203
+ end
204
+
205
+ if attributes.key?(:'billing_time')
206
+ self.billing_time = attributes[:'billing_time']
207
+ else
208
+ self.billing_time = nil
209
+ end
210
+
211
+ if attributes.key?(:'name')
212
+ self.name = attributes[:'name']
213
+ end
214
+
215
+ if attributes.key?(:'plan_code')
216
+ self.plan_code = attributes[:'plan_code']
217
+ else
218
+ self.plan_code = nil
219
+ end
220
+
221
+ if attributes.key?(:'status')
222
+ self.status = attributes[:'status']
223
+ else
224
+ self.status = nil
225
+ end
226
+
227
+ if attributes.key?(:'created_at')
228
+ self.created_at = attributes[:'created_at']
229
+ else
230
+ self.created_at = nil
231
+ end
232
+
233
+ if attributes.key?(:'canceled_at')
234
+ self.canceled_at = attributes[:'canceled_at']
235
+ end
236
+
237
+ if attributes.key?(:'started_at')
238
+ self.started_at = attributes[:'started_at']
239
+ end
240
+
241
+ if attributes.key?(:'ending_at')
242
+ self.ending_at = attributes[:'ending_at']
243
+ end
244
+
245
+ if attributes.key?(:'subscription_at')
246
+ self.subscription_at = attributes[:'subscription_at']
247
+ else
248
+ self.subscription_at = nil
249
+ end
250
+
251
+ if attributes.key?(:'terminated_at')
252
+ self.terminated_at = attributes[:'terminated_at']
253
+ end
254
+
255
+ if attributes.key?(:'previous_plan_code')
256
+ self.previous_plan_code = attributes[:'previous_plan_code']
257
+ end
258
+
259
+ if attributes.key?(:'next_plan_code')
260
+ self.next_plan_code = attributes[:'next_plan_code']
261
+ end
262
+
263
+ if attributes.key?(:'downgrade_plan_date')
264
+ self.downgrade_plan_date = attributes[:'downgrade_plan_date']
265
+ end
266
+
267
+ if attributes.key?(:'plan')
268
+ self.plan = attributes[:'plan']
269
+ end
270
+ end
271
+
272
+ # Show invalid properties with the reasons. Usually used together with valid?
273
+ # @return Array for valid properties with the reasons
274
+ def list_invalid_properties
275
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
276
+ invalid_properties = Array.new
277
+ if @lago_id.nil?
278
+ invalid_properties.push('invalid value for "lago_id", lago_id cannot be nil.')
279
+ end
280
+
281
+ if @external_id.nil?
282
+ invalid_properties.push('invalid value for "external_id", external_id cannot be nil.')
283
+ end
284
+
285
+ if @lago_customer_id.nil?
286
+ invalid_properties.push('invalid value for "lago_customer_id", lago_customer_id cannot be nil.')
287
+ end
288
+
289
+ if @external_customer_id.nil?
290
+ invalid_properties.push('invalid value for "external_customer_id", external_customer_id cannot be nil.')
291
+ end
292
+
293
+ if @billing_time.nil?
294
+ invalid_properties.push('invalid value for "billing_time", billing_time cannot be nil.')
295
+ end
296
+
297
+ if @plan_code.nil?
298
+ invalid_properties.push('invalid value for "plan_code", plan_code cannot be nil.')
299
+ end
300
+
301
+ if @status.nil?
302
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
303
+ end
304
+
305
+ if @created_at.nil?
306
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
307
+ end
308
+
309
+ if @subscription_at.nil?
310
+ invalid_properties.push('invalid value for "subscription_at", subscription_at cannot be nil.')
311
+ end
312
+
313
+ invalid_properties
314
+ end
315
+
316
+ # Check to see if the all the properties in the model are valid
317
+ # @return true if the model is valid
318
+ def valid?
319
+ warn '[DEPRECATED] the `valid?` method is obsolete'
320
+ return false if @lago_id.nil?
321
+ return false if @external_id.nil?
322
+ return false if @lago_customer_id.nil?
323
+ return false if @external_customer_id.nil?
324
+ return false if @billing_time.nil?
325
+ billing_time_validator = EnumAttributeValidator.new('String', ["calendar", "anniversary"])
326
+ return false unless billing_time_validator.valid?(@billing_time)
327
+ return false if @plan_code.nil?
328
+ return false if @status.nil?
329
+ status_validator = EnumAttributeValidator.new('String', ["active", "pending", "terminated", "canceled"])
330
+ return false unless status_validator.valid?(@status)
331
+ return false if @created_at.nil?
332
+ return false if @subscription_at.nil?
333
+ true
334
+ end
335
+
336
+ # Custom attribute writer method checking allowed values (enum).
337
+ # @param [Object] billing_time Object to be assigned
338
+ def billing_time=(billing_time)
339
+ validator = EnumAttributeValidator.new('String', ["calendar", "anniversary"])
340
+ unless validator.valid?(billing_time)
341
+ fail ArgumentError, "invalid value for \"billing_time\", must be one of #{validator.allowable_values}."
342
+ end
343
+ @billing_time = billing_time
344
+ end
345
+
346
+ # Custom attribute writer method checking allowed values (enum).
347
+ # @param [Object] status Object to be assigned
348
+ def status=(status)
349
+ validator = EnumAttributeValidator.new('String', ["active", "pending", "terminated", "canceled"])
350
+ unless validator.valid?(status)
351
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
352
+ end
353
+ @status = status
354
+ end
355
+
356
+ # Checks equality by comparing each attribute.
357
+ # @param [Object] Object to be compared
358
+ def ==(o)
359
+ return true if self.equal?(o)
360
+ self.class == o.class &&
361
+ lago_id == o.lago_id &&
362
+ external_id == o.external_id &&
363
+ lago_customer_id == o.lago_customer_id &&
364
+ external_customer_id == o.external_customer_id &&
365
+ billing_time == o.billing_time &&
366
+ name == o.name &&
367
+ plan_code == o.plan_code &&
368
+ status == o.status &&
369
+ created_at == o.created_at &&
370
+ canceled_at == o.canceled_at &&
371
+ started_at == o.started_at &&
372
+ ending_at == o.ending_at &&
373
+ subscription_at == o.subscription_at &&
374
+ terminated_at == o.terminated_at &&
375
+ previous_plan_code == o.previous_plan_code &&
376
+ next_plan_code == o.next_plan_code &&
377
+ downgrade_plan_date == o.downgrade_plan_date &&
378
+ plan == o.plan
379
+ end
380
+
381
+ # @see the `==` method
382
+ # @param [Object] Object to be compared
383
+ def eql?(o)
384
+ self == o
385
+ end
386
+
387
+ # Calculates hash code according to all attributes.
388
+ # @return [Integer] Hash code
389
+ def hash
390
+ [lago_id, external_id, lago_customer_id, external_customer_id, billing_time, name, plan_code, status, created_at, canceled_at, started_at, ending_at, subscription_at, terminated_at, previous_plan_code, next_plan_code, downgrade_plan_date, plan].hash
391
+ end
392
+
393
+ # Builds the object from hash
394
+ # @param [Hash] attributes Model attributes in the form of hash
395
+ # @return [Object] Returns the model itself
396
+ def self.build_from_hash(attributes)
397
+ return nil unless attributes.is_a?(Hash)
398
+ attributes = attributes.transform_keys(&:to_sym)
399
+ transformed_hash = {}
400
+ openapi_types.each_pair do |key, type|
401
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
402
+ transformed_hash["#{key}"] = nil
403
+ elsif type =~ /\AArray<(.*)>/i
404
+ # check to ensure the input is an array given that the attribute
405
+ # is documented as an array but the input is not
406
+ if attributes[attribute_map[key]].is_a?(Array)
407
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
408
+ end
409
+ elsif !attributes[attribute_map[key]].nil?
410
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
411
+ end
412
+ end
413
+ new(transformed_hash)
414
+ end
415
+
416
+ # Deserializes the data based on type
417
+ # @param string type Data type
418
+ # @param string value Value to be deserialized
419
+ # @return [Object] Deserialized data
420
+ def self._deserialize(type, value)
421
+ case type.to_sym
422
+ when :Time
423
+ Time.parse(value)
424
+ when :Date
425
+ Date.parse(value)
426
+ when :String
427
+ value.to_s
428
+ when :Integer
429
+ value.to_i
430
+ when :Float
431
+ value.to_f
432
+ when :Boolean
433
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
434
+ true
435
+ else
436
+ false
437
+ end
438
+ when :Object
439
+ # generic object (usually a Hash), return directly
440
+ value
441
+ when /\AArray<(?<inner_type>.+)>\z/
442
+ inner_type = Regexp.last_match[:inner_type]
443
+ value.map { |v| _deserialize(inner_type, v) }
444
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
445
+ k_type = Regexp.last_match[:k_type]
446
+ v_type = Regexp.last_match[:v_type]
447
+ {}.tap do |hash|
448
+ value.each do |k, v|
449
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
450
+ end
451
+ end
452
+ else # model
453
+ # models (e.g. Pet) or oneOf
454
+ klass = LagoAPI.const_get(type)
455
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
456
+ end
457
+ end
458
+
459
+ # Returns the string representation of the object
460
+ # @return [String] String presentation of the object
461
+ def to_s
462
+ to_hash.to_s
463
+ end
464
+
465
+ # to_body is an alias to to_hash (backward compatibility)
466
+ # @return [Hash] Returns the object in the form of hash
467
+ def to_body
468
+ to_hash
469
+ end
470
+
471
+ # Returns the object in the form of hash
472
+ # @return [Hash] Returns the object in the form of hash
473
+ def to_hash
474
+ hash = {}
475
+ self.class.attribute_map.each_pair do |attr, param|
476
+ value = self.send(attr)
477
+ if value.nil?
478
+ is_nullable = self.class.openapi_nullable.include?(attr)
479
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
480
+ end
481
+
482
+ hash[param] = _to_hash(value)
483
+ end
484
+ hash
485
+ end
486
+
487
+ # Outputs non-array value in the form of hash
488
+ # For object, use to_hash. Otherwise, just return the value
489
+ # @param [Object] value Any valid value
490
+ # @return [Hash] Returns the value in the form of hash
491
+ def _to_hash(value)
492
+ if value.is_a?(Array)
493
+ value.compact.map { |v| _to_hash(v) }
494
+ elsif value.is_a?(Hash)
495
+ {}.tap do |hash|
496
+ value.each { |k, v| hash[k] = _to_hash(v) }
497
+ end
498
+ elsif value.respond_to? :to_hash
499
+ value.to_hash
500
+ else
501
+ value
502
+ end
503
+ end
504
+
505
+ end
506
+
507
+ end
@@ -3,10 +3,10 @@
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.49.0-beta
6
+ The version of the OpenAPI document: 0.51.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.1.0-SNAPSHOT
9
+ OpenAPI Generator version: 7.2.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -166,7 +166,7 @@ module LagoAPI
166
166
  else # model
167
167
  # models (e.g. Pet) or oneOf
168
168
  klass = LagoAPI.const_get(type)
169
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
170
  end
171
171
  end
172
172