lago_ruby 0.49.0.pre.beta → 0.51.0.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +16 -6
  4. data/docs/CreditNoteCreateInputCreditNote.md +1 -1
  5. data/docs/CreditNoteEstimateInput.md +18 -0
  6. data/docs/CreditNoteEstimateInputCreditNote.md +20 -0
  7. data/docs/CreditNoteEstimateInputCreditNoteItemsInner.md +20 -0
  8. data/docs/CreditNoteEstimated.md +18 -0
  9. data/docs/CreditNoteEstimatedEstimatedCreditNote.md +38 -0
  10. data/docs/CreditNoteEstimatedEstimatedCreditNoteAppliedTaxesInner.md +32 -0
  11. data/docs/CreditNoteEstimatedEstimatedCreditNoteItemsInner.md +20 -0
  12. data/docs/CreditNoteItemObjectFee.md +2 -0
  13. data/docs/CreditNoteObject.md +2 -2
  14. data/docs/CreditNotesApi.md +72 -0
  15. data/docs/EventsApi.md +7 -6
  16. data/docs/FeeObject.md +2 -0
  17. data/docs/FeeObjectItem.md +2 -0
  18. data/docs/PlanOverridesObject.md +32 -0
  19. data/docs/PlanOverridesObjectChargesInner.md +28 -0
  20. data/docs/Subscription.md +1 -1
  21. data/docs/SubscriptionCreateInputSubscription.md +3 -1
  22. data/docs/SubscriptionObjectExtended.md +52 -0
  23. data/docs/SubscriptionUpdateInputSubscription.md +3 -1
  24. data/lago_ruby.gemspec +1 -1
  25. data/lib/lago_ruby/api/add_ons_api.rb +1 -1
  26. data/lib/lago_ruby/api/billable_metrics_api.rb +1 -1
  27. data/lib/lago_ruby/api/coupons_api.rb +1 -1
  28. data/lib/lago_ruby/api/credit_notes_api.rb +65 -1
  29. data/lib/lago_ruby/api/customers_api.rb +1 -1
  30. data/lib/lago_ruby/api/events_api.rb +6 -6
  31. data/lib/lago_ruby/api/fees_api.rb +1 -1
  32. data/lib/lago_ruby/api/invoices_api.rb +1 -1
  33. data/lib/lago_ruby/api/organizations_api.rb +1 -1
  34. data/lib/lago_ruby/api/plans_api.rb +1 -1
  35. data/lib/lago_ruby/api/subscriptions_api.rb +1 -1
  36. data/lib/lago_ruby/api/taxes_api.rb +1 -1
  37. data/lib/lago_ruby/api/wallets_api.rb +1 -1
  38. data/lib/lago_ruby/api/webhook_endpoints_api.rb +1 -1
  39. data/lib/lago_ruby/api/webhooks_api.rb +1 -1
  40. data/lib/lago_ruby/api_client.rb +11 -12
  41. data/lib/lago_ruby/api_error.rb +1 -1
  42. data/lib/lago_ruby/configuration.rb +1 -1
  43. data/lib/lago_ruby/models/add_on.rb +2 -2
  44. data/lib/lago_ruby/models/add_on_base_input.rb +2 -2
  45. data/lib/lago_ruby/models/add_on_create_input.rb +2 -2
  46. data/lib/lago_ruby/models/add_on_create_input_add_on.rb +2 -2
  47. data/lib/lago_ruby/models/add_on_object.rb +2 -2
  48. data/lib/lago_ruby/models/add_on_update_input.rb +2 -2
  49. data/lib/lago_ruby/models/add_ons_paginated.rb +2 -2
  50. data/lib/lago_ruby/models/api_error_bad_request.rb +2 -2
  51. data/lib/lago_ruby/models/api_error_forbidden.rb +2 -2
  52. data/lib/lago_ruby/models/api_error_not_allowed.rb +2 -2
  53. data/lib/lago_ruby/models/api_error_not_found.rb +2 -2
  54. data/lib/lago_ruby/models/api_error_unauthorized.rb +2 -2
  55. data/lib/lago_ruby/models/api_error_unprocessable_entity.rb +2 -2
  56. data/lib/lago_ruby/models/applied_coupon.rb +2 -2
  57. data/lib/lago_ruby/models/applied_coupon_input.rb +2 -2
  58. data/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb +2 -2
  59. data/lib/lago_ruby/models/applied_coupon_object.rb +2 -2
  60. data/lib/lago_ruby/models/applied_coupon_object_extended.rb +2 -2
  61. data/lib/lago_ruby/models/applied_coupons_paginated.rb +2 -2
  62. data/lib/lago_ruby/models/base_applied_tax.rb +2 -2
  63. data/lib/lago_ruby/models/billable_metric.rb +2 -2
  64. data/lib/lago_ruby/models/billable_metric_base_input.rb +2 -2
  65. data/lib/lago_ruby/models/billable_metric_create_input.rb +2 -2
  66. data/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb +2 -2
  67. data/lib/lago_ruby/models/billable_metric_group.rb +2 -2
  68. data/lib/lago_ruby/models/billable_metric_group_values_inner.rb +1 -1
  69. data/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb +2 -2
  70. data/lib/lago_ruby/models/billable_metric_object.rb +2 -2
  71. data/lib/lago_ruby/models/billable_metric_update_input.rb +2 -2
  72. data/lib/lago_ruby/models/billable_metrics_paginated.rb +2 -2
  73. data/lib/lago_ruby/models/charge_object.rb +2 -2
  74. data/lib/lago_ruby/models/charge_object_properties.rb +2 -2
  75. data/lib/lago_ruby/models/charge_properties.rb +2 -2
  76. data/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb +2 -2
  77. data/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb +2 -2
  78. data/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb +2 -2
  79. data/lib/lago_ruby/models/country.rb +1 -1
  80. data/lib/lago_ruby/models/coupon.rb +2 -2
  81. data/lib/lago_ruby/models/coupon_base_input.rb +2 -2
  82. data/lib/lago_ruby/models/coupon_base_input_applies_to.rb +2 -2
  83. data/lib/lago_ruby/models/coupon_create_input.rb +2 -2
  84. data/lib/lago_ruby/models/coupon_create_input_coupon.rb +2 -2
  85. data/lib/lago_ruby/models/coupon_object.rb +2 -2
  86. data/lib/lago_ruby/models/coupon_update_input.rb +2 -2
  87. data/lib/lago_ruby/models/coupons_paginated.rb +2 -2
  88. data/lib/lago_ruby/models/credit_note.rb +2 -2
  89. data/lib/lago_ruby/models/credit_note_applied_tax_object.rb +2 -2
  90. data/lib/lago_ruby/models/credit_note_create_input.rb +2 -2
  91. data/lib/lago_ruby/models/credit_note_create_input_credit_note.rb +3 -3
  92. data/lib/lago_ruby/models/credit_note_estimate_input.rb +221 -0
  93. data/lib/lago_ruby/models/credit_note_estimate_input_credit_note.rb +241 -0
  94. data/lib/lago_ruby/models/credit_note_estimate_input_credit_note_items_inner.rb +239 -0
  95. data/lib/lago_ruby/models/credit_note_estimated.rb +221 -0
  96. data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note.rb +387 -0
  97. data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner.rb +283 -0
  98. data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_items_inner.rb +235 -0
  99. data/lib/lago_ruby/models/credit_note_item_object.rb +2 -2
  100. data/lib/lago_ruby/models/credit_note_item_object_fee.rb +20 -3
  101. data/lib/lago_ruby/models/credit_note_object.rb +13 -13
  102. data/lib/lago_ruby/models/credit_note_update_input.rb +2 -2
  103. data/lib/lago_ruby/models/credit_note_update_input_credit_note.rb +2 -2
  104. data/lib/lago_ruby/models/credit_notes.rb +2 -2
  105. data/lib/lago_ruby/models/credit_object.rb +2 -2
  106. data/lib/lago_ruby/models/credit_object_invoice.rb +2 -2
  107. data/lib/lago_ruby/models/credit_object_item.rb +2 -2
  108. data/lib/lago_ruby/models/currency.rb +1 -1
  109. data/lib/lago_ruby/models/customer.rb +2 -2
  110. data/lib/lago_ruby/models/customer_billing_configuration.rb +2 -2
  111. data/lib/lago_ruby/models/customer_charge_usage_object.rb +2 -2
  112. data/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb +2 -2
  113. data/lib/lago_ruby/models/customer_charge_usage_object_charge.rb +2 -2
  114. data/lib/lago_ruby/models/customer_charge_usage_object_groups_inner.rb +2 -2
  115. data/lib/lago_ruby/models/customer_create_input.rb +2 -2
  116. data/lib/lago_ruby/models/customer_create_input_customer.rb +2 -2
  117. data/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb +2 -2
  118. data/lib/lago_ruby/models/customer_metadata.rb +2 -2
  119. data/lib/lago_ruby/models/customer_object.rb +2 -2
  120. data/lib/lago_ruby/models/customer_object_extended.rb +2 -2
  121. data/lib/lago_ruby/models/customer_past_usage.rb +2 -2
  122. data/lib/lago_ruby/models/customer_usage.rb +2 -2
  123. data/lib/lago_ruby/models/customer_usage_object.rb +2 -2
  124. data/lib/lago_ruby/models/customers_paginated.rb +2 -2
  125. data/lib/lago_ruby/models/event.rb +2 -2
  126. data/lib/lago_ruby/models/event_batch_input.rb +2 -2
  127. data/lib/lago_ruby/models/event_batch_input_event.rb +2 -2
  128. data/lib/lago_ruby/models/event_batch_input_event_properties.rb +2 -2
  129. data/lib/lago_ruby/models/event_estimate_fees_input.rb +2 -2
  130. data/lib/lago_ruby/models/event_estimate_fees_input_event.rb +2 -2
  131. data/lib/lago_ruby/models/event_input.rb +2 -2
  132. data/lib/lago_ruby/models/event_input_event.rb +2 -2
  133. data/lib/lago_ruby/models/event_input_event_timestamp.rb +1 -1
  134. data/lib/lago_ruby/models/event_object.rb +6 -22
  135. data/lib/lago_ruby/models/event_object_properties.rb +2 -2
  136. data/lib/lago_ruby/models/fee.rb +2 -2
  137. data/lib/lago_ruby/models/fee_applied_tax_object.rb +2 -2
  138. data/lib/lago_ruby/models/fee_object.rb +20 -3
  139. data/lib/lago_ruby/models/fee_object_item.rb +13 -3
  140. data/lib/lago_ruby/models/fee_update_input.rb +2 -2
  141. data/lib/lago_ruby/models/fee_update_input_fee.rb +2 -2
  142. data/lib/lago_ruby/models/fees.rb +2 -2
  143. data/lib/lago_ruby/models/fees_paginated.rb +2 -2
  144. data/lib/lago_ruby/models/get_customer_portal_url200_response.rb +2 -2
  145. data/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb +2 -2
  146. data/lib/lago_ruby/models/group_object.rb +2 -2
  147. data/lib/lago_ruby/models/group_properties_object.rb +2 -2
  148. data/lib/lago_ruby/models/group_properties_object_values.rb +2 -2
  149. data/lib/lago_ruby/models/groups_paginated.rb +2 -2
  150. data/lib/lago_ruby/models/invoice.rb +2 -2
  151. data/lib/lago_ruby/models/invoice_applied_tax_object.rb +2 -2
  152. data/lib/lago_ruby/models/invoice_metadata_object.rb +2 -2
  153. data/lib/lago_ruby/models/invoice_object.rb +2 -2
  154. data/lib/lago_ruby/models/invoice_object_customer.rb +2 -2
  155. data/lib/lago_ruby/models/invoice_object_extended.rb +2 -2
  156. data/lib/lago_ruby/models/invoice_one_off_create_input.rb +2 -2
  157. data/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb +2 -2
  158. data/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb +2 -2
  159. data/lib/lago_ruby/models/invoice_update_input.rb +2 -2
  160. data/lib/lago_ruby/models/invoice_update_input_invoice.rb +2 -2
  161. data/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb +2 -2
  162. data/lib/lago_ruby/models/invoices_paginated.rb +2 -2
  163. data/lib/lago_ruby/models/organization.rb +2 -2
  164. data/lib/lago_ruby/models/organization_billing_configuration.rb +2 -2
  165. data/lib/lago_ruby/models/organization_object.rb +2 -2
  166. data/lib/lago_ruby/models/organization_update_input.rb +2 -2
  167. data/lib/lago_ruby/models/organization_update_input_organization.rb +2 -2
  168. data/lib/lago_ruby/models/pagination_meta.rb +2 -2
  169. data/lib/lago_ruby/models/plan.rb +2 -2
  170. data/lib/lago_ruby/models/plan_create_input.rb +2 -2
  171. data/lib/lago_ruby/models/plan_create_input_plan.rb +2 -2
  172. data/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb +2 -2
  173. data/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb +2 -2
  174. data/lib/lago_ruby/models/plan_object.rb +2 -2
  175. data/lib/lago_ruby/models/plan_overrides_object.rb +289 -0
  176. data/lib/lago_ruby/models/plan_overrides_object_charges_inner.rb +268 -0
  177. data/lib/lago_ruby/models/plan_update_input.rb +2 -2
  178. data/lib/lago_ruby/models/plan_update_input_plan.rb +2 -2
  179. data/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb +2 -2
  180. data/lib/lago_ruby/models/plans_paginated.rb +2 -2
  181. data/lib/lago_ruby/models/subscription.rb +3 -3
  182. data/lib/lago_ruby/models/subscription_create_input.rb +2 -2
  183. data/lib/lago_ruby/models/subscription_create_input_subscription.rb +15 -6
  184. data/lib/lago_ruby/models/subscription_object.rb +2 -2
  185. data/lib/lago_ruby/models/subscription_object_extended.rb +507 -0
  186. data/lib/lago_ruby/models/subscription_update_input.rb +2 -2
  187. data/lib/lago_ruby/models/subscription_update_input_subscription.rb +15 -6
  188. data/lib/lago_ruby/models/subscriptions_paginated.rb +2 -2
  189. data/lib/lago_ruby/models/tax.rb +2 -2
  190. data/lib/lago_ruby/models/tax_base_input.rb +2 -2
  191. data/lib/lago_ruby/models/tax_create_input.rb +2 -2
  192. data/lib/lago_ruby/models/tax_create_input_tax.rb +2 -2
  193. data/lib/lago_ruby/models/tax_object.rb +2 -2
  194. data/lib/lago_ruby/models/tax_update_input.rb +2 -2
  195. data/lib/lago_ruby/models/taxes_paginated.rb +2 -2
  196. data/lib/lago_ruby/models/timezone.rb +1 -1
  197. data/lib/lago_ruby/models/wallet.rb +2 -2
  198. data/lib/lago_ruby/models/wallet_create_input.rb +2 -2
  199. data/lib/lago_ruby/models/wallet_create_input_wallet.rb +2 -2
  200. data/lib/lago_ruby/models/wallet_object.rb +2 -2
  201. data/lib/lago_ruby/models/wallet_transaction_create_input.rb +2 -2
  202. data/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb +2 -2
  203. data/lib/lago_ruby/models/wallet_transaction_object.rb +2 -2
  204. data/lib/lago_ruby/models/wallet_transactions.rb +2 -2
  205. data/lib/lago_ruby/models/wallet_transactions_paginated.rb +2 -2
  206. data/lib/lago_ruby/models/wallet_update_input.rb +2 -2
  207. data/lib/lago_ruby/models/wallet_update_input_wallet.rb +2 -2
  208. data/lib/lago_ruby/models/wallets_paginated.rb +2 -2
  209. data/lib/lago_ruby/models/webhook_endpoint.rb +2 -2
  210. data/lib/lago_ruby/models/webhook_endpoint_create_input.rb +2 -2
  211. data/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb +2 -2
  212. data/lib/lago_ruby/models/webhook_endpoint_object.rb +2 -2
  213. data/lib/lago_ruby/models/webhook_endpoint_update_input.rb +2 -2
  214. data/lib/lago_ruby/models/webhook_endpoints_paginated.rb +2 -2
  215. data/lib/lago_ruby/version.rb +2 -2
  216. data/lib/lago_ruby.rb +11 -2
  217. data/spec/api_client_spec.rb +1 -1
  218. data/spec/configuration_spec.rb +1 -1
  219. 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
  220. data/spec/models/credit_note_estimate_input_credit_note_spec.rb +42 -0
  221. data/spec/models/credit_note_estimate_input_spec.rb +36 -0
  222. data/spec/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner_spec.rb +78 -0
  223. data/spec/models/credit_note_estimated_estimated_credit_note_items_inner_spec.rb +42 -0
  224. data/spec/models/credit_note_estimated_estimated_credit_note_spec.rb +96 -0
  225. data/spec/models/credit_note_estimated_spec.rb +36 -0
  226. data/spec/models/plan_overrides_object_charges_inner_spec.rb +66 -0
  227. data/spec/models/plan_overrides_object_spec.rb +78 -0
  228. data/spec/models/subscription_object_extended_spec.rb +146 -0
  229. data/spec/spec_helper.rb +1 -1
  230. metadata +197 -159
@@ -0,0 +1,268 @@
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.1.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
+ # 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
+
24
+ # 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.
25
+ attr_accessor :min_amount_cents
26
+
27
+ attr_accessor :properties
28
+
29
+ # All charge information, sorted by groups.
30
+ attr_accessor :group_properties
31
+
32
+ # List of unique code used to identify the taxes.
33
+ attr_accessor :tax_codes
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'id' => :'id',
39
+ :'invoice_display_name' => :'invoice_display_name',
40
+ :'min_amount_cents' => :'min_amount_cents',
41
+ :'properties' => :'properties',
42
+ :'group_properties' => :'group_properties',
43
+ :'tax_codes' => :'tax_codes'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'id' => :'String',
56
+ :'invoice_display_name' => :'String',
57
+ :'min_amount_cents' => :'Integer',
58
+ :'properties' => :'ChargeObjectProperties',
59
+ :'group_properties' => :'Array<PlanCreateInputPlanChargesInnerGroupPropertiesInner>',
60
+ :'tax_codes' => :'Array<String>'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::PlanOverridesObjectChargesInner` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ 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
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'id')
86
+ self.id = attributes[:'id']
87
+ end
88
+
89
+ if attributes.key?(:'invoice_display_name')
90
+ self.invoice_display_name = attributes[:'invoice_display_name']
91
+ end
92
+
93
+ if attributes.key?(:'min_amount_cents')
94
+ self.min_amount_cents = attributes[:'min_amount_cents']
95
+ end
96
+
97
+ if attributes.key?(:'properties')
98
+ self.properties = attributes[:'properties']
99
+ end
100
+
101
+ if attributes.key?(:'group_properties')
102
+ if (value = attributes[:'group_properties']).is_a?(Array)
103
+ self.group_properties = value
104
+ end
105
+ end
106
+
107
+ if attributes.key?(:'tax_codes')
108
+ if (value = attributes[:'tax_codes']).is_a?(Array)
109
+ self.tax_codes = value
110
+ end
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ true
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ id == o.id &&
135
+ invoice_display_name == o.invoice_display_name &&
136
+ min_amount_cents == o.min_amount_cents &&
137
+ properties == o.properties &&
138
+ group_properties == o.group_properties &&
139
+ tax_codes == o.tax_codes
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ def hash
151
+ [id, invoice_display_name, min_amount_cents, properties, group_properties, tax_codes].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def self.build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ attributes = attributes.transform_keys(&:to_sym)
160
+ transformed_hash = {}
161
+ openapi_types.each_pair do |key, type|
162
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = nil
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[attribute_map[key]].is_a?(Array)
168
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
169
+ end
170
+ elsif !attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
172
+ end
173
+ end
174
+ new(transformed_hash)
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def self._deserialize(type, value)
182
+ case type.to_sym
183
+ when :Time
184
+ Time.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :Boolean
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ # models (e.g. Pet) or oneOf
215
+ klass = LagoAPI.const_get(type)
216
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ is_nullable = self.class.openapi_nullable.include?(attr)
240
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
+ end
242
+
243
+ hash[param] = _to_hash(value)
244
+ end
245
+ hash
246
+ end
247
+
248
+ # Outputs non-array value in the form of hash
249
+ # For object, use to_hash. Otherwise, just return the value
250
+ # @param [Object] value Any valid value
251
+ # @return [Hash] Returns the value in the form of hash
252
+ def _to_hash(value)
253
+ if value.is_a?(Array)
254
+ value.compact.map { |v| _to_hash(v) }
255
+ elsif value.is_a?(Hash)
256
+ {}.tap do |hash|
257
+ value.each { |k, v| hash[k] = _to_hash(v) }
258
+ end
259
+ elsif value.respond_to? :to_hash
260
+ value.to_hash
261
+ else
262
+ value
263
+ end
264
+ end
265
+
266
+ end
267
+
268
+ 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.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
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -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,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.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
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -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,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.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
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -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,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.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
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -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,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.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
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -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
 
@@ -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.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
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -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,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.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
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -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,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.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
9
  OpenAPI Generator version: 7.1.0-SNAPSHOT
@@ -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