lago_ruby 0.46.1.pre.beta → 0.48.0.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +12 -10
  4. data/docs/BillableMetricBaseInput.md +2 -0
  5. data/docs/BillableMetricCreateInputBillableMetric.md +2 -0
  6. data/docs/BillableMetricObject.md +2 -0
  7. data/docs/CouponObject.md +3 -1
  8. data/docs/CreditObjectItem.md +2 -2
  9. data/docs/EventInputEvent.md +2 -2
  10. data/docs/EventInputEventTimestamp.md +15 -0
  11. data/docs/EventObject.md +1 -1
  12. data/docs/SubscriptionCreateInputSubscription.md +2 -0
  13. data/docs/SubscriptionObject.md +2 -0
  14. data/docs/SubscriptionUpdateInputSubscription.md +2 -0
  15. data/docs/WebhookEndpoint.md +18 -0
  16. data/docs/WebhookEndpointCreateInput.md +18 -0
  17. data/docs/WebhookEndpointCreateInputWebhookEndpoint.md +20 -0
  18. data/docs/WebhookEndpointObject.md +26 -0
  19. data/docs/WebhookEndpointUpdateInput.md +18 -0
  20. data/docs/WebhookEndpointsApi.md +28 -28
  21. data/docs/WebhookEndpointsPaginated.md +20 -0
  22. data/lago_ruby.gemspec +2 -2
  23. data/lib/lago_ruby/api/add_ons_api.rb +2 -2
  24. data/lib/lago_ruby/api/billable_metrics_api.rb +2 -2
  25. data/lib/lago_ruby/api/coupons_api.rb +2 -2
  26. data/lib/lago_ruby/api/credit_notes_api.rb +2 -2
  27. data/lib/lago_ruby/api/customers_api.rb +2 -2
  28. data/lib/lago_ruby/api/events_api.rb +2 -2
  29. data/lib/lago_ruby/api/fees_api.rb +2 -2
  30. data/lib/lago_ruby/api/invoices_api.rb +2 -2
  31. data/lib/lago_ruby/api/organizations_api.rb +2 -2
  32. data/lib/lago_ruby/api/plans_api.rb +2 -2
  33. data/lib/lago_ruby/api/subscriptions_api.rb +2 -2
  34. data/lib/lago_ruby/api/taxes_api.rb +2 -2
  35. data/lib/lago_ruby/api/wallets_api.rb +2 -2
  36. data/lib/lago_ruby/api/webhook_endpoints_api.rb +35 -35
  37. data/lib/lago_ruby/api/webhooks_api.rb +2 -2
  38. data/lib/lago_ruby/api_client.rb +2 -2
  39. data/lib/lago_ruby/api_error.rb +2 -2
  40. data/lib/lago_ruby/configuration.rb +2 -2
  41. data/lib/lago_ruby/models/add_on.rb +2 -2
  42. data/lib/lago_ruby/models/add_on_base_input.rb +2 -2
  43. data/lib/lago_ruby/models/add_on_create_input.rb +2 -2
  44. data/lib/lago_ruby/models/add_on_create_input_add_on.rb +2 -2
  45. data/lib/lago_ruby/models/add_on_object.rb +2 -2
  46. data/lib/lago_ruby/models/add_on_update_input.rb +2 -2
  47. data/lib/lago_ruby/models/add_ons_paginated.rb +2 -2
  48. data/lib/lago_ruby/models/api_error_bad_request.rb +2 -2
  49. data/lib/lago_ruby/models/api_error_forbidden.rb +2 -2
  50. data/lib/lago_ruby/models/api_error_not_allowed.rb +2 -2
  51. data/lib/lago_ruby/models/api_error_not_found.rb +2 -2
  52. data/lib/lago_ruby/models/api_error_unauthorized.rb +2 -2
  53. data/lib/lago_ruby/models/api_error_unprocessable_entity.rb +2 -2
  54. data/lib/lago_ruby/models/applied_coupon.rb +2 -2
  55. data/lib/lago_ruby/models/applied_coupon_input.rb +2 -2
  56. data/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb +2 -2
  57. data/lib/lago_ruby/models/applied_coupon_object.rb +2 -2
  58. data/lib/lago_ruby/models/applied_coupon_object_extended.rb +2 -2
  59. data/lib/lago_ruby/models/applied_coupons_paginated.rb +2 -2
  60. data/lib/lago_ruby/models/base_applied_tax.rb +2 -2
  61. data/lib/lago_ruby/models/billable_metric.rb +2 -2
  62. data/lib/lago_ruby/models/billable_metric_base_input.rb +28 -5
  63. data/lib/lago_ruby/models/billable_metric_create_input.rb +2 -2
  64. data/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb +28 -5
  65. data/lib/lago_ruby/models/billable_metric_group.rb +2 -2
  66. data/lib/lago_ruby/models/billable_metric_group_values_inner.rb +2 -2
  67. data/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb +2 -2
  68. data/lib/lago_ruby/models/billable_metric_object.rb +28 -5
  69. data/lib/lago_ruby/models/billable_metric_update_input.rb +2 -2
  70. data/lib/lago_ruby/models/billable_metrics_paginated.rb +2 -2
  71. data/lib/lago_ruby/models/charge_object.rb +2 -2
  72. data/lib/lago_ruby/models/charge_object_properties.rb +2 -2
  73. data/lib/lago_ruby/models/charge_properties.rb +2 -2
  74. data/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb +2 -2
  75. data/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb +2 -2
  76. data/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb +2 -2
  77. data/lib/lago_ruby/models/country.rb +2 -2
  78. data/lib/lago_ruby/models/coupon.rb +2 -2
  79. data/lib/lago_ruby/models/coupon_base_input.rb +2 -2
  80. data/lib/lago_ruby/models/coupon_base_input_applies_to.rb +2 -2
  81. data/lib/lago_ruby/models/coupon_create_input.rb +2 -2
  82. data/lib/lago_ruby/models/coupon_create_input_coupon.rb +2 -2
  83. data/lib/lago_ruby/models/coupon_object.rb +16 -6
  84. data/lib/lago_ruby/models/coupon_update_input.rb +2 -2
  85. data/lib/lago_ruby/models/coupons_paginated.rb +2 -2
  86. data/lib/lago_ruby/models/credit_note.rb +2 -2
  87. data/lib/lago_ruby/models/credit_note_applied_tax_object.rb +2 -2
  88. data/lib/lago_ruby/models/credit_note_create_input.rb +2 -2
  89. data/lib/lago_ruby/models/credit_note_create_input_credit_note.rb +2 -2
  90. data/lib/lago_ruby/models/credit_note_create_input_credit_note_items_inner.rb +2 -2
  91. data/lib/lago_ruby/models/credit_note_item_object.rb +2 -2
  92. data/lib/lago_ruby/models/credit_note_item_object_fee.rb +2 -2
  93. data/lib/lago_ruby/models/credit_note_object.rb +2 -2
  94. data/lib/lago_ruby/models/credit_note_update_input.rb +2 -2
  95. data/lib/lago_ruby/models/credit_note_update_input_credit_note.rb +2 -2
  96. data/lib/lago_ruby/models/credit_notes.rb +2 -2
  97. data/lib/lago_ruby/models/credit_object.rb +2 -2
  98. data/lib/lago_ruby/models/credit_object_invoice.rb +2 -2
  99. data/lib/lago_ruby/models/credit_object_item.rb +13 -13
  100. data/lib/lago_ruby/models/currency.rb +2 -2
  101. data/lib/lago_ruby/models/customer.rb +2 -2
  102. data/lib/lago_ruby/models/customer_billing_configuration.rb +2 -2
  103. data/lib/lago_ruby/models/customer_charge_usage_object.rb +2 -2
  104. data/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb +2 -2
  105. data/lib/lago_ruby/models/customer_charge_usage_object_charge.rb +2 -2
  106. data/lib/lago_ruby/models/customer_charge_usage_object_groups_inner.rb +2 -2
  107. data/lib/lago_ruby/models/customer_create_input.rb +2 -2
  108. data/lib/lago_ruby/models/customer_create_input_customer.rb +2 -2
  109. data/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb +2 -2
  110. data/lib/lago_ruby/models/customer_metadata.rb +2 -2
  111. data/lib/lago_ruby/models/customer_object.rb +2 -2
  112. data/lib/lago_ruby/models/customer_object_extended.rb +2 -2
  113. data/lib/lago_ruby/models/customer_usage.rb +2 -2
  114. data/lib/lago_ruby/models/customer_usage_object.rb +2 -2
  115. data/lib/lago_ruby/models/customers_paginated.rb +2 -2
  116. data/lib/lago_ruby/models/event.rb +2 -2
  117. data/lib/lago_ruby/models/event_batch_input.rb +2 -2
  118. data/lib/lago_ruby/models/event_batch_input_event.rb +2 -2
  119. data/lib/lago_ruby/models/event_batch_input_event_properties.rb +2 -2
  120. data/lib/lago_ruby/models/event_estimate_fees_input.rb +2 -2
  121. data/lib/lago_ruby/models/event_estimate_fees_input_event.rb +2 -2
  122. data/lib/lago_ruby/models/event_input.rb +2 -2
  123. data/lib/lago_ruby/models/event_input_event.rb +3 -4
  124. data/lib/lago_ruby/models/event_input_event_timestamp.rb +105 -0
  125. data/lib/lago_ruby/models/event_object.rb +2 -2
  126. data/lib/lago_ruby/models/event_object_properties.rb +2 -2
  127. data/lib/lago_ruby/models/fee.rb +2 -2
  128. data/lib/lago_ruby/models/fee_applied_tax_object.rb +2 -2
  129. data/lib/lago_ruby/models/fee_object.rb +2 -2
  130. data/lib/lago_ruby/models/fee_object_item.rb +2 -2
  131. data/lib/lago_ruby/models/fee_update_input.rb +2 -2
  132. data/lib/lago_ruby/models/fee_update_input_fee.rb +2 -2
  133. data/lib/lago_ruby/models/fees.rb +2 -2
  134. data/lib/lago_ruby/models/fees_paginated.rb +2 -2
  135. data/lib/lago_ruby/models/get_customer_portal_url200_response.rb +2 -2
  136. data/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb +2 -2
  137. data/lib/lago_ruby/models/group_object.rb +2 -2
  138. data/lib/lago_ruby/models/group_properties_object.rb +2 -2
  139. data/lib/lago_ruby/models/group_properties_object_values.rb +2 -2
  140. data/lib/lago_ruby/models/groups_paginated.rb +2 -2
  141. data/lib/lago_ruby/models/invoice.rb +2 -2
  142. data/lib/lago_ruby/models/invoice_applied_tax_object.rb +2 -2
  143. data/lib/lago_ruby/models/invoice_metadata_object.rb +2 -2
  144. data/lib/lago_ruby/models/invoice_object.rb +2 -2
  145. data/lib/lago_ruby/models/invoice_object_customer.rb +2 -2
  146. data/lib/lago_ruby/models/invoice_object_extended.rb +2 -2
  147. data/lib/lago_ruby/models/invoice_one_off_create_input.rb +2 -2
  148. data/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb +2 -2
  149. data/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb +2 -2
  150. data/lib/lago_ruby/models/invoice_update_input.rb +2 -2
  151. data/lib/lago_ruby/models/invoice_update_input_invoice.rb +2 -2
  152. data/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb +2 -2
  153. data/lib/lago_ruby/models/invoices_paginated.rb +2 -2
  154. data/lib/lago_ruby/models/organization.rb +2 -2
  155. data/lib/lago_ruby/models/organization_billing_configuration.rb +2 -2
  156. data/lib/lago_ruby/models/organization_object.rb +2 -2
  157. data/lib/lago_ruby/models/organization_update_input.rb +2 -2
  158. data/lib/lago_ruby/models/organization_update_input_organization.rb +2 -2
  159. data/lib/lago_ruby/models/pagination_meta.rb +2 -2
  160. data/lib/lago_ruby/models/plan.rb +2 -2
  161. data/lib/lago_ruby/models/plan_create_input.rb +2 -2
  162. data/lib/lago_ruby/models/plan_create_input_plan.rb +2 -2
  163. data/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb +2 -2
  164. data/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb +2 -2
  165. data/lib/lago_ruby/models/plan_object.rb +2 -2
  166. data/lib/lago_ruby/models/plan_update_input.rb +2 -2
  167. data/lib/lago_ruby/models/plan_update_input_plan.rb +2 -2
  168. data/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb +2 -2
  169. data/lib/lago_ruby/models/plans_paginated.rb +2 -2
  170. data/lib/lago_ruby/models/subscription.rb +2 -2
  171. data/lib/lago_ruby/models/subscription_create_input.rb +2 -2
  172. data/lib/lago_ruby/models/subscription_create_input_subscription.rb +13 -3
  173. data/lib/lago_ruby/models/subscription_object.rb +13 -3
  174. data/lib/lago_ruby/models/subscription_update_input.rb +2 -2
  175. data/lib/lago_ruby/models/subscription_update_input_subscription.rb +13 -3
  176. data/lib/lago_ruby/models/subscriptions_paginated.rb +2 -2
  177. data/lib/lago_ruby/models/tax.rb +2 -2
  178. data/lib/lago_ruby/models/tax_base_input.rb +2 -2
  179. data/lib/lago_ruby/models/tax_create_input.rb +2 -2
  180. data/lib/lago_ruby/models/tax_create_input_tax.rb +2 -2
  181. data/lib/lago_ruby/models/tax_object.rb +2 -2
  182. data/lib/lago_ruby/models/tax_update_input.rb +2 -2
  183. data/lib/lago_ruby/models/taxes_paginated.rb +2 -2
  184. data/lib/lago_ruby/models/timezone.rb +2 -2
  185. data/lib/lago_ruby/models/wallet.rb +2 -2
  186. data/lib/lago_ruby/models/wallet_create_input.rb +2 -2
  187. data/lib/lago_ruby/models/wallet_create_input_wallet.rb +2 -2
  188. data/lib/lago_ruby/models/wallet_object.rb +2 -2
  189. data/lib/lago_ruby/models/wallet_transaction_create_input.rb +2 -2
  190. data/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb +2 -2
  191. data/lib/lago_ruby/models/wallet_transaction_object.rb +2 -2
  192. data/lib/lago_ruby/models/wallet_transactions.rb +2 -2
  193. data/lib/lago_ruby/models/wallet_transactions_paginated.rb +2 -2
  194. data/lib/lago_ruby/models/wallet_update_input.rb +2 -2
  195. data/lib/lago_ruby/models/wallet_update_input_wallet.rb +2 -2
  196. data/lib/lago_ruby/models/wallets_paginated.rb +2 -2
  197. data/lib/lago_ruby/models/webhook_endpoint.rb +221 -0
  198. data/lib/lago_ruby/models/webhook_endpoint_create_input.rb +214 -0
  199. data/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb +267 -0
  200. data/lib/lago_ruby/models/webhook_endpoint_object.rb +317 -0
  201. data/lib/lago_ruby/models/webhook_endpoint_update_input.rb +214 -0
  202. data/lib/lago_ruby/models/webhook_endpoints_paginated.rb +239 -0
  203. data/lib/lago_ruby/version.rb +3 -3
  204. data/lib/lago_ruby.rb +9 -7
  205. data/spec/api_client_spec.rb +2 -2
  206. data/spec/configuration_spec.rb +2 -2
  207. data/spec/models/event_input_event_timestamp_spec.rb +21 -0
  208. data/spec/models/{create_webhook_endpoint_request_spec.rb → webhook_endpoint_create_input_spec.rb} +8 -8
  209. data/spec/models/{create_webhook_endpoint_request_webhook_endpoint_spec.rb → webhook_endpoint_create_input_webhook_endpoint_spec.rb} +8 -8
  210. data/spec/models/{create_webhook_endpoint200_response_webhook_endpoint_spec.rb → webhook_endpoint_object_spec.rb} +8 -8
  211. data/spec/models/{create_webhook_endpoint200_response_spec.rb → webhook_endpoint_spec.rb} +8 -8
  212. data/spec/models/webhook_endpoint_update_input_spec.rb +34 -0
  213. data/spec/models/{find_all_webhook_endpoints200_response_spec.rb → webhook_endpoints_paginated_spec.rb} +8 -8
  214. data/spec/spec_helper.rb +2 -2
  215. metadata +172 -154
@@ -0,0 +1,214 @@
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.48.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 WebhookEndpointUpdateInput
18
+ attr_accessor :webhook_endpoint
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'webhook_endpoint' => :'webhook_endpoint'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'webhook_endpoint' => :'WebhookEndpointCreateInputWebhookEndpoint'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::WebhookEndpointUpdateInput` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::WebhookEndpointUpdateInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'webhook_endpoint')
61
+ self.webhook_endpoint = attributes[:'webhook_endpoint']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ warn '[DEPRECATED] the `valid?` method is obsolete'
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ webhook_endpoint == o.webhook_endpoint
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Integer] Hash code
96
+ def hash
97
+ [webhook_endpoint].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def self.build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ attributes = attributes.transform_keys(&:to_sym)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
110
+ elsif type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
115
+ end
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
118
+ end
119
+ end
120
+ new(transformed_hash)
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def self._deserialize(type, value)
128
+ case type.to_sym
129
+ when :Time
130
+ Time.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :Boolean
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ # models (e.g. Pet) or oneOf
161
+ klass = LagoAPI.const_get(type)
162
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
163
+ end
164
+ end
165
+
166
+ # Returns the string representation of the object
167
+ # @return [String] String presentation of the object
168
+ def to_s
169
+ to_hash.to_s
170
+ end
171
+
172
+ # to_body is an alias to to_hash (backward compatibility)
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = self.send(attr)
184
+ if value.nil?
185
+ is_nullable = self.class.openapi_nullable.include?(attr)
186
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
187
+ end
188
+
189
+ hash[param] = _to_hash(value)
190
+ end
191
+ hash
192
+ end
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.compact.map { |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to? :to_hash
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end
211
+
212
+ end
213
+
214
+ end
@@ -0,0 +1,239 @@
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.48.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 WebhookEndpointsPaginated
18
+ attr_accessor :webhook_endpoints
19
+
20
+ attr_accessor :meta
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'webhook_endpoints' => :'webhook_endpoints',
26
+ :'meta' => :'meta'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'webhook_endpoints' => :'Array<WebhookEndpointObject>',
39
+ :'meta' => :'PaginationMeta'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LagoAPI::WebhookEndpointsPaginated` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LagoAPI::WebhookEndpointsPaginated`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'webhook_endpoints')
65
+ if (value = attributes[:'webhook_endpoints']).is_a?(Array)
66
+ self.webhook_endpoints = value
67
+ end
68
+ else
69
+ self.webhook_endpoints = nil
70
+ end
71
+
72
+ if attributes.key?(:'meta')
73
+ self.meta = attributes[:'meta']
74
+ else
75
+ self.meta = nil
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ if @webhook_endpoints.nil?
85
+ invalid_properties.push('invalid value for "webhook_endpoints", webhook_endpoints cannot be nil.')
86
+ end
87
+
88
+ if @meta.nil?
89
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @webhook_endpoints.nil?
100
+ return false if @meta.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ webhook_endpoints == o.webhook_endpoints &&
110
+ meta == o.meta
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [webhook_endpoints, meta].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def self._deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = LagoAPI.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -3,13 +3,13 @@
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.46.1-beta
6
+ The version of the OpenAPI document: 0.48.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  module LagoAPI
14
- VERSION = '0.46.1-beta'
14
+ VERSION = '0.48.0-beta'
15
15
  end
data/lib/lago_ruby.rb CHANGED
@@ -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.46.1-beta
6
+ The version of the OpenAPI document: 0.48.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -62,10 +62,6 @@ require 'lago_ruby/models/coupon_create_input_coupon'
62
62
  require 'lago_ruby/models/coupon_object'
63
63
  require 'lago_ruby/models/coupon_update_input'
64
64
  require 'lago_ruby/models/coupons_paginated'
65
- require 'lago_ruby/models/create_webhook_endpoint200_response'
66
- require 'lago_ruby/models/create_webhook_endpoint200_response_webhook_endpoint'
67
- require 'lago_ruby/models/create_webhook_endpoint_request'
68
- require 'lago_ruby/models/create_webhook_endpoint_request_webhook_endpoint'
69
65
  require 'lago_ruby/models/credit_note'
70
66
  require 'lago_ruby/models/credit_note_applied_tax_object'
71
67
  require 'lago_ruby/models/credit_note_create_input'
@@ -104,6 +100,7 @@ require 'lago_ruby/models/event_estimate_fees_input'
104
100
  require 'lago_ruby/models/event_estimate_fees_input_event'
105
101
  require 'lago_ruby/models/event_input'
106
102
  require 'lago_ruby/models/event_input_event'
103
+ require 'lago_ruby/models/event_input_event_timestamp'
107
104
  require 'lago_ruby/models/event_object'
108
105
  require 'lago_ruby/models/event_object_properties'
109
106
  require 'lago_ruby/models/fee'
@@ -114,7 +111,6 @@ require 'lago_ruby/models/fee_update_input'
114
111
  require 'lago_ruby/models/fee_update_input_fee'
115
112
  require 'lago_ruby/models/fees'
116
113
  require 'lago_ruby/models/fees_paginated'
117
- require 'lago_ruby/models/find_all_webhook_endpoints200_response'
118
114
  require 'lago_ruby/models/get_customer_portal_url200_response'
119
115
  require 'lago_ruby/models/get_customer_portal_url200_response_customer'
120
116
  require 'lago_ruby/models/group_object'
@@ -177,6 +173,12 @@ require 'lago_ruby/models/wallet_transactions_paginated'
177
173
  require 'lago_ruby/models/wallet_update_input'
178
174
  require 'lago_ruby/models/wallet_update_input_wallet'
179
175
  require 'lago_ruby/models/wallets_paginated'
176
+ require 'lago_ruby/models/webhook_endpoint'
177
+ require 'lago_ruby/models/webhook_endpoint_create_input'
178
+ require 'lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint'
179
+ require 'lago_ruby/models/webhook_endpoint_object'
180
+ require 'lago_ruby/models/webhook_endpoint_update_input'
181
+ require 'lago_ruby/models/webhook_endpoints_paginated'
180
182
 
181
183
  # APIs
182
184
  require 'lago_ruby/api/add_ons_api'
@@ -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.46.1-beta
6
+ The version of the OpenAPI document: 0.48.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.46.1-beta
6
+ The version of the OpenAPI document: 0.48.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,21 @@
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.48.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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for LagoAPI::EventInputEventTimestamp
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe LagoAPI::EventInputEventTimestamp do
21
+ 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.45.0-beta
6
+ The version of the OpenAPI document: 0.48.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -14,15 +14,15 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for LagoAPI::CreateWebhookEndpointRequest
17
+ # Unit tests for LagoAPI::WebhookEndpointCreateInput
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe LagoAPI::CreateWebhookEndpointRequest do
21
- let(:instance) { LagoAPI::CreateWebhookEndpointRequest.new }
20
+ describe LagoAPI::WebhookEndpointCreateInput do
21
+ let(:instance) { LagoAPI::WebhookEndpointCreateInput.new }
22
22
 
23
- describe 'test an instance of CreateWebhookEndpointRequest' do
24
- it 'should create an instance of CreateWebhookEndpointRequest' do
25
- expect(instance).to be_instance_of(LagoAPI::CreateWebhookEndpointRequest)
23
+ describe 'test an instance of WebhookEndpointCreateInput' do
24
+ it 'should create an instance of WebhookEndpointCreateInput' do
25
+ expect(instance).to be_instance_of(LagoAPI::WebhookEndpointCreateInput)
26
26
  end
27
27
  end
28
28
  describe 'test attribute "webhook_endpoint"' do
@@ -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.45.0-beta
6
+ The version of the OpenAPI document: 0.48.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -14,15 +14,15 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for LagoAPI::CreateWebhookEndpointRequestWebhookEndpoint
17
+ # Unit tests for LagoAPI::WebhookEndpointCreateInputWebhookEndpoint
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe LagoAPI::CreateWebhookEndpointRequestWebhookEndpoint do
21
- let(:instance) { LagoAPI::CreateWebhookEndpointRequestWebhookEndpoint.new }
20
+ describe LagoAPI::WebhookEndpointCreateInputWebhookEndpoint do
21
+ let(:instance) { LagoAPI::WebhookEndpointCreateInputWebhookEndpoint.new }
22
22
 
23
- describe 'test an instance of CreateWebhookEndpointRequestWebhookEndpoint' do
24
- it 'should create an instance of CreateWebhookEndpointRequestWebhookEndpoint' do
25
- expect(instance).to be_instance_of(LagoAPI::CreateWebhookEndpointRequestWebhookEndpoint)
23
+ describe 'test an instance of WebhookEndpointCreateInputWebhookEndpoint' do
24
+ it 'should create an instance of WebhookEndpointCreateInputWebhookEndpoint' do
25
+ expect(instance).to be_instance_of(LagoAPI::WebhookEndpointCreateInputWebhookEndpoint)
26
26
  end
27
27
  end
28
28
  describe 'test attribute "webhook_url"' do
@@ -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.45.0-beta
6
+ The version of the OpenAPI document: 0.48.0-beta
7
7
  Contact: tech@getlago.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 7.1.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -14,15 +14,15 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for LagoAPI::CreateWebhookEndpoint200ResponseWebhookEndpoint
17
+ # Unit tests for LagoAPI::WebhookEndpointObject
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe LagoAPI::CreateWebhookEndpoint200ResponseWebhookEndpoint do
21
- let(:instance) { LagoAPI::CreateWebhookEndpoint200ResponseWebhookEndpoint.new }
20
+ describe LagoAPI::WebhookEndpointObject do
21
+ let(:instance) { LagoAPI::WebhookEndpointObject.new }
22
22
 
23
- describe 'test an instance of CreateWebhookEndpoint200ResponseWebhookEndpoint' do
24
- it 'should create an instance of CreateWebhookEndpoint200ResponseWebhookEndpoint' do
25
- expect(instance).to be_instance_of(LagoAPI::CreateWebhookEndpoint200ResponseWebhookEndpoint)
23
+ describe 'test an instance of WebhookEndpointObject' do
24
+ it 'should create an instance of WebhookEndpointObject' do
25
+ expect(instance).to be_instance_of(LagoAPI::WebhookEndpointObject)
26
26
  end
27
27
  end
28
28
  describe 'test attribute "lago_id"' do