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
@@ -0,0 +1,289 @@
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
+ # Based plan overrides.
18
+ class PlanOverridesObject
19
+ # The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
20
+ attr_accessor :amount_cents
21
+
22
+ attr_accessor :amount_currency
23
+
24
+ # The description on the plan.
25
+ attr_accessor :description
26
+
27
+ # Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name.
28
+ attr_accessor :invoice_display_name
29
+
30
+ # The name of the plan.
31
+ attr_accessor :name
32
+
33
+ # List of unique code used to identify the taxes.
34
+ attr_accessor :tax_codes
35
+
36
+ # The duration in days during which the base cost of the plan is offered for free.
37
+ attr_accessor :trial_period
38
+
39
+ # Additional usage-based charges for this plan.
40
+ attr_accessor :charges
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'amount_cents' => :'amount_cents',
46
+ :'amount_currency' => :'amount_currency',
47
+ :'description' => :'description',
48
+ :'invoice_display_name' => :'invoice_display_name',
49
+ :'name' => :'name',
50
+ :'tax_codes' => :'tax_codes',
51
+ :'trial_period' => :'trial_period',
52
+ :'charges' => :'charges'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'amount_cents' => :'Integer',
65
+ :'amount_currency' => :'Currency',
66
+ :'description' => :'String',
67
+ :'invoice_display_name' => :'String',
68
+ :'name' => :'String',
69
+ :'tax_codes' => :'Array<String>',
70
+ :'trial_period' => :'Float',
71
+ :'charges' => :'Array<PlanOverridesObjectChargesInner>'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::PlanOverridesObject` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::PlanOverridesObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'amount_cents')
97
+ self.amount_cents = attributes[:'amount_cents']
98
+ end
99
+
100
+ if attributes.key?(:'amount_currency')
101
+ self.amount_currency = attributes[:'amount_currency']
102
+ end
103
+
104
+ if attributes.key?(:'description')
105
+ self.description = attributes[:'description']
106
+ end
107
+
108
+ if attributes.key?(:'invoice_display_name')
109
+ self.invoice_display_name = attributes[:'invoice_display_name']
110
+ end
111
+
112
+ if attributes.key?(:'name')
113
+ self.name = attributes[:'name']
114
+ end
115
+
116
+ if attributes.key?(:'tax_codes')
117
+ if (value = attributes[:'tax_codes']).is_a?(Array)
118
+ self.tax_codes = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'trial_period')
123
+ self.trial_period = attributes[:'trial_period']
124
+ end
125
+
126
+ if attributes.key?(:'charges')
127
+ if (value = attributes[:'charges']).is_a?(Array)
128
+ self.charges = value
129
+ end
130
+ end
131
+ end
132
+
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properties with the reasons
135
+ def list_invalid_properties
136
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
137
+ invalid_properties = Array.new
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
145
+ true
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(o)
151
+ return true if self.equal?(o)
152
+ self.class == o.class &&
153
+ amount_cents == o.amount_cents &&
154
+ amount_currency == o.amount_currency &&
155
+ description == o.description &&
156
+ invoice_display_name == o.invoice_display_name &&
157
+ name == o.name &&
158
+ tax_codes == o.tax_codes &&
159
+ trial_period == o.trial_period &&
160
+ charges == o.charges
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [amount_cents, amount_currency, description, invoice_display_name, name, tax_codes, trial_period, charges].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def self._deserialize(type, value)
203
+ case type.to_sym
204
+ when :Time
205
+ Time.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :Boolean
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ # models (e.g. Pet) or oneOf
236
+ klass = LagoAPI.const_get(type)
237
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ if value.nil?
260
+ is_nullable = self.class.openapi_nullable.include?(attr)
261
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
262
+ end
263
+
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map { |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+
287
+ end
288
+
289
+ end
@@ -0,0 +1,278 @@
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 PlanOverridesObjectChargesInner
18
+ # Unique identifier of the charge created by Lago.
19
+ attr_accessor :id
20
+
21
+ # Unique identifier of the billable metric created by Lago.
22
+ attr_accessor :billable_metric_id
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
+
27
+ # The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
28
+ attr_accessor :min_amount_cents
29
+
30
+ attr_accessor :properties
31
+
32
+ # All charge information, sorted by groups.
33
+ attr_accessor :group_properties
34
+
35
+ # List of unique code used to identify the taxes.
36
+ attr_accessor :tax_codes
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'id' => :'id',
42
+ :'billable_metric_id' => :'billable_metric_id',
43
+ :'invoice_display_name' => :'invoice_display_name',
44
+ :'min_amount_cents' => :'min_amount_cents',
45
+ :'properties' => :'properties',
46
+ :'group_properties' => :'group_properties',
47
+ :'tax_codes' => :'tax_codes'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'id' => :'String',
60
+ :'billable_metric_id' => :'String',
61
+ :'invoice_display_name' => :'String',
62
+ :'min_amount_cents' => :'Integer',
63
+ :'properties' => :'ChargeObjectProperties',
64
+ :'group_properties' => :'Array<PlanCreateInputPlanChargesInnerGroupPropertiesInner>',
65
+ :'tax_codes' => :'Array<String>'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::PlanOverridesObjectChargesInner` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::PlanOverridesObjectChargesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'id')
91
+ self.id = attributes[:'id']
92
+ end
93
+
94
+ if attributes.key?(:'billable_metric_id')
95
+ self.billable_metric_id = attributes[:'billable_metric_id']
96
+ end
97
+
98
+ if attributes.key?(:'invoice_display_name')
99
+ self.invoice_display_name = attributes[:'invoice_display_name']
100
+ end
101
+
102
+ if attributes.key?(:'min_amount_cents')
103
+ self.min_amount_cents = attributes[:'min_amount_cents']
104
+ end
105
+
106
+ if attributes.key?(:'properties')
107
+ self.properties = attributes[:'properties']
108
+ end
109
+
110
+ if attributes.key?(:'group_properties')
111
+ if (value = attributes[:'group_properties']).is_a?(Array)
112
+ self.group_properties = value
113
+ end
114
+ end
115
+
116
+ if attributes.key?(:'tax_codes')
117
+ if (value = attributes[:'tax_codes']).is_a?(Array)
118
+ self.tax_codes = value
119
+ end
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ true
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ id == o.id &&
144
+ billable_metric_id == o.billable_metric_id &&
145
+ invoice_display_name == o.invoice_display_name &&
146
+ min_amount_cents == o.min_amount_cents &&
147
+ properties == o.properties &&
148
+ group_properties == o.group_properties &&
149
+ tax_codes == o.tax_codes
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param [Object] Object to be compared
154
+ def eql?(o)
155
+ self == o
156
+ end
157
+
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Integer] Hash code
160
+ def hash
161
+ [id, billable_metric_id, invoice_display_name, min_amount_cents, properties, group_properties, tax_codes].hash
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def self.build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ attributes = attributes.transform_keys(&:to_sym)
170
+ transformed_hash = {}
171
+ openapi_types.each_pair do |key, type|
172
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
173
+ transformed_hash["#{key}"] = nil
174
+ elsif type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[attribute_map[key]].is_a?(Array)
178
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
179
+ end
180
+ elsif !attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
182
+ end
183
+ end
184
+ new(transformed_hash)
185
+ end
186
+
187
+ # Deserializes the data based on type
188
+ # @param string type Data type
189
+ # @param string value Value to be deserialized
190
+ # @return [Object] Deserialized data
191
+ def self._deserialize(type, value)
192
+ case type.to_sym
193
+ when :Time
194
+ Time.parse(value)
195
+ when :Date
196
+ Date.parse(value)
197
+ when :String
198
+ value.to_s
199
+ when :Integer
200
+ value.to_i
201
+ when :Float
202
+ value.to_f
203
+ when :Boolean
204
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
+ true
206
+ else
207
+ false
208
+ end
209
+ when :Object
210
+ # generic object (usually a Hash), return directly
211
+ value
212
+ when /\AArray<(?<inner_type>.+)>\z/
213
+ inner_type = Regexp.last_match[:inner_type]
214
+ value.map { |v| _deserialize(inner_type, v) }
215
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
+ k_type = Regexp.last_match[:k_type]
217
+ v_type = Regexp.last_match[:v_type]
218
+ {}.tap do |hash|
219
+ value.each do |k, v|
220
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
+ end
222
+ end
223
+ else # model
224
+ # models (e.g. Pet) or oneOf
225
+ klass = LagoAPI.const_get(type)
226
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
227
+ end
228
+ end
229
+
230
+ # Returns the string representation of the object
231
+ # @return [String] String presentation of the object
232
+ def to_s
233
+ to_hash.to_s
234
+ end
235
+
236
+ # to_body is an alias to to_hash (backward compatibility)
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_body
239
+ to_hash
240
+ end
241
+
242
+ # Returns the object in the form of hash
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ if value.nil?
249
+ is_nullable = self.class.openapi_nullable.include?(attr)
250
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
251
+ end
252
+
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ # Outputs non-array value in the form of hash
259
+ # For object, use to_hash. Otherwise, just return the value
260
+ # @param [Object] value Any valid value
261
+ # @return [Hash] Returns the value in the form of hash
262
+ def _to_hash(value)
263
+ if value.is_a?(Array)
264
+ value.compact.map { |v| _to_hash(v) }
265
+ elsif value.is_a?(Hash)
266
+ {}.tap do |hash|
267
+ value.each { |k, v| hash[k] = _to_hash(v) }
268
+ end
269
+ elsif value.respond_to? :to_hash
270
+ value.to_hash
271
+ else
272
+ value
273
+ end
274
+ end
275
+
276
+ end
277
+
278
+ 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
 
@@ -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
 
@@ -308,7 +308,7 @@ module LagoAPI
308
308
  else # model
309
309
  # models (e.g. Pet) or oneOf
310
310
  klass = LagoAPI.const_get(type)
311
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
311
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
312
312
  end
313
313
  end
314
314
 
@@ -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
 
@@ -297,7 +297,7 @@ module LagoAPI
297
297
  else # model
298
298
  # models (e.g. Pet) or oneOf
299
299
  klass = LagoAPI.const_get(type)
300
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
300
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
301
301
  end
302
302
  end
303
303
 
@@ -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
 
@@ -184,7 +184,7 @@ module LagoAPI
184
184
  else # model
185
185
  # models (e.g. Pet) or oneOf
186
186
  klass = LagoAPI.const_get(type)
187
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
188
  end
189
189
  end
190
190
 
@@ -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
 
@@ -32,7 +32,7 @@ module LagoAPI
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'subscription' => :'SubscriptionObject'
35
+ :'subscription' => :'SubscriptionObjectExtended'
36
36
  }
37
37
  end
38
38
 
@@ -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