wallee-ruby-sdk 0.0.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (293) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +31 -0
  3. data/lib/wallee-ruby-sdk/version.rb +1 -1
  4. data/lib/wallee.rb +332 -0
  5. data/lib/wallee/api_client.rb +403 -0
  6. data/lib/wallee/api_error.rb +47 -0
  7. data/lib/wallee/configuration.rb +144 -0
  8. data/lib/wallee/models/account.rb +298 -0
  9. data/lib/wallee/models/account_create.rb +308 -0
  10. data/lib/wallee/models/account_state.rb +47 -0
  11. data/lib/wallee/models/account_type.rb +44 -0
  12. data/lib/wallee/models/account_update.rb +308 -0
  13. data/lib/wallee/models/address.rb +388 -0
  14. data/lib/wallee/models/address_create.rb +388 -0
  15. data/lib/wallee/models/application_user.rb +268 -0
  16. data/lib/wallee/models/application_user_create.rb +283 -0
  17. data/lib/wallee/models/application_user_create_with_mac_key.rb +278 -0
  18. data/lib/wallee/models/application_user_update.rb +278 -0
  19. data/lib/wallee/models/attachment_resource.rb +210 -0
  20. data/lib/wallee/models/charge.rb +318 -0
  21. data/lib/wallee/models/charge_attempt.rb +420 -0
  22. data/lib/wallee/models/charge_attempt_environment.rb +43 -0
  23. data/lib/wallee/models/charge_attempt_state.rb +44 -0
  24. data/lib/wallee/models/charge_flow.rb +270 -0
  25. data/lib/wallee/models/charge_flow_level.rb +318 -0
  26. data/lib/wallee/models/charge_flow_level_configuration.rb +288 -0
  27. data/lib/wallee/models/charge_flow_level_configuration_type.rb +222 -0
  28. data/lib/wallee/models/charge_flow_level_state.rb +44 -0
  29. data/lib/wallee/models/charge_state.rb +44 -0
  30. data/lib/wallee/models/charge_type.rb +44 -0
  31. data/lib/wallee/models/client_error.rb +238 -0
  32. data/lib/wallee/models/client_error_type.rb +44 -0
  33. data/lib/wallee/models/condition.rb +258 -0
  34. data/lib/wallee/models/condition_type.rb +222 -0
  35. data/lib/wallee/models/connector_invocation.rb +278 -0
  36. data/lib/wallee/models/connector_invocation_stage.rb +45 -0
  37. data/lib/wallee/models/creation_entity_state.rb +46 -0
  38. data/lib/wallee/models/criteria_operator.rb +50 -0
  39. data/lib/wallee/models/customers_presence.rb +44 -0
  40. data/lib/wallee/models/data_collection_type.rb +43 -0
  41. data/lib/wallee/models/database_translated_string.rb +222 -0
  42. data/lib/wallee/models/database_translated_string_create.rb +222 -0
  43. data/lib/wallee/models/database_translated_string_item.rb +218 -0
  44. data/lib/wallee/models/database_translated_string_item_create.rb +223 -0
  45. data/lib/wallee/models/delivery_indication.rb +318 -0
  46. data/lib/wallee/models/delivery_indication_decision_reason.rb +222 -0
  47. data/lib/wallee/models/delivery_indication_state.rb +45 -0
  48. data/lib/wallee/models/document_template.rb +278 -0
  49. data/lib/wallee/models/document_template_type.rb +242 -0
  50. data/lib/wallee/models/email_sender.rb +278 -0
  51. data/lib/wallee/models/email_sender_type.rb +232 -0
  52. data/lib/wallee/models/email_template.rb +324 -0
  53. data/lib/wallee/models/email_template_type.rb +288 -0
  54. data/lib/wallee/models/entity_query.rb +240 -0
  55. data/lib/wallee/models/entity_query_filter.rb +245 -0
  56. data/lib/wallee/models/entity_query_filter_type.rb +44 -0
  57. data/lib/wallee/models/entity_query_order_by.rb +208 -0
  58. data/lib/wallee/models/entity_query_order_by_type.rb +43 -0
  59. data/lib/wallee/models/entity_reference.rb +188 -0
  60. data/lib/wallee/models/failure_category.rb +46 -0
  61. data/lib/wallee/models/failure_reason.rb +244 -0
  62. data/lib/wallee/models/feature.rb +274 -0
  63. data/lib/wallee/models/gender.rb +43 -0
  64. data/lib/wallee/models/human_user.rb +318 -0
  65. data/lib/wallee/models/human_user_create.rb +328 -0
  66. data/lib/wallee/models/human_user_update.rb +328 -0
  67. data/lib/wallee/models/installment_calculated_plan.rb +242 -0
  68. data/lib/wallee/models/installment_calculated_slice.rb +220 -0
  69. data/lib/wallee/models/installment_payment.rb +280 -0
  70. data/lib/wallee/models/installment_payment_slice.rb +300 -0
  71. data/lib/wallee/models/installment_payment_slice_state.rb +48 -0
  72. data/lib/wallee/models/installment_payment_state.rb +49 -0
  73. data/lib/wallee/models/installment_plan_configuration.rb +362 -0
  74. data/lib/wallee/models/installment_plan_slice_configuration.rb +288 -0
  75. data/lib/wallee/models/label.rb +238 -0
  76. data/lib/wallee/models/label_descriptor.rb +274 -0
  77. data/lib/wallee/models/label_descriptor_category.rb +43 -0
  78. data/lib/wallee/models/label_descriptor_group.rb +232 -0
  79. data/lib/wallee/models/label_descriptor_type.rb +222 -0
  80. data/lib/wallee/models/legal_organization_form.rb +242 -0
  81. data/lib/wallee/models/line_item.rb +342 -0
  82. data/lib/wallee/models/line_item_attribute.rb +208 -0
  83. data/lib/wallee/models/line_item_attribute_create.rb +208 -0
  84. data/lib/wallee/models/line_item_create.rb +367 -0
  85. data/lib/wallee/models/line_item_reduction.rb +218 -0
  86. data/lib/wallee/models/line_item_reduction_create.rb +233 -0
  87. data/lib/wallee/models/line_item_type.rb +45 -0
  88. data/lib/wallee/models/localized_string.rb +218 -0
  89. data/lib/wallee/models/manual_task.rb +290 -0
  90. data/lib/wallee/models/manual_task_action.rb +230 -0
  91. data/lib/wallee/models/manual_task_action_style.rb +44 -0
  92. data/lib/wallee/models/manual_task_state.rb +44 -0
  93. data/lib/wallee/models/manual_task_type.rb +234 -0
  94. data/lib/wallee/models/one_click_payment_mode.rb +44 -0
  95. data/lib/wallee/models/payment_connector.rb +306 -0
  96. data/lib/wallee/models/payment_connector_configuration.rb +322 -0
  97. data/lib/wallee/models/payment_connector_feature.rb +218 -0
  98. data/lib/wallee/models/payment_method.rb +256 -0
  99. data/lib/wallee/models/payment_method_brand.rb +252 -0
  100. data/lib/wallee/models/payment_method_configuration.rb +328 -0
  101. data/lib/wallee/models/payment_primary_risk_taker.rb +44 -0
  102. data/lib/wallee/models/payment_processor.rb +278 -0
  103. data/lib/wallee/models/payment_processor_configuration.rb +258 -0
  104. data/lib/wallee/models/permission.rb +286 -0
  105. data/lib/wallee/models/persistable_currency_amount.rb +208 -0
  106. data/lib/wallee/models/persistable_currency_amount_update.rb +208 -0
  107. data/lib/wallee/models/product_fee_type.rb +44 -0
  108. data/lib/wallee/models/product_metered_fee.rb +278 -0
  109. data/lib/wallee/models/product_metered_fee_update.rb +288 -0
  110. data/lib/wallee/models/product_metered_tier_fee.rb +240 -0
  111. data/lib/wallee/models/product_metered_tier_fee_update.rb +250 -0
  112. data/lib/wallee/models/product_metered_tier_pricing.rb +43 -0
  113. data/lib/wallee/models/product_period_fee.rb +280 -0
  114. data/lib/wallee/models/product_period_fee_update.rb +290 -0
  115. data/lib/wallee/models/product_setup_fee.rb +294 -0
  116. data/lib/wallee/models/product_setup_fee_update.rb +304 -0
  117. data/lib/wallee/models/refund.rb +450 -0
  118. data/lib/wallee/models/refund_create.rb +470 -0
  119. data/lib/wallee/models/refund_state.rb +46 -0
  120. data/lib/wallee/models/refund_type.rb +45 -0
  121. data/lib/wallee/models/rendered_document.rb +230 -0
  122. data/lib/wallee/models/resource_path.rb +258 -0
  123. data/lib/wallee/models/resource_state.rb +44 -0
  124. data/lib/wallee/models/rest_country.rb +240 -0
  125. data/lib/wallee/models/rest_country_state.rb +228 -0
  126. data/lib/wallee/models/rest_currency.rb +218 -0
  127. data/lib/wallee/models/rest_language.rb +248 -0
  128. data/lib/wallee/models/scope.rb +302 -0
  129. data/lib/wallee/models/server_error.rb +218 -0
  130. data/lib/wallee/models/space.rb +330 -0
  131. data/lib/wallee/models/space_address.rb +318 -0
  132. data/lib/wallee/models/space_address_setter.rb +318 -0
  133. data/lib/wallee/models/space_create.rb +350 -0
  134. data/lib/wallee/models/space_reference.rb +258 -0
  135. data/lib/wallee/models/space_reference_state.rb +46 -0
  136. data/lib/wallee/models/space_update.rb +340 -0
  137. data/lib/wallee/models/space_view.rb +258 -0
  138. data/lib/wallee/models/static_value.rb +234 -0
  139. data/lib/wallee/models/subscriber.rb +332 -0
  140. data/lib/wallee/models/subscriber_active.rb +342 -0
  141. data/lib/wallee/models/subscriber_create.rb +347 -0
  142. data/lib/wallee/models/subscriber_update.rb +342 -0
  143. data/lib/wallee/models/subscription.rb +338 -0
  144. data/lib/wallee/models/subscription_change_request.rb +250 -0
  145. data/lib/wallee/models/subscription_charge.rb +390 -0
  146. data/lib/wallee/models/subscription_charge_create.rb +405 -0
  147. data/lib/wallee/models/subscription_charge_processing_type.rb +43 -0
  148. data/lib/wallee/models/subscription_charge_state.rb +46 -0
  149. data/lib/wallee/models/subscription_charge_type.rb +43 -0
  150. data/lib/wallee/models/subscription_create_request.rb +245 -0
  151. data/lib/wallee/models/subscription_ledger_entry.rb +350 -0
  152. data/lib/wallee/models/subscription_ledger_entry_create.rb +375 -0
  153. data/lib/wallee/models/subscription_ledger_entry_state.rb +44 -0
  154. data/lib/wallee/models/subscription_metric.rb +268 -0
  155. data/lib/wallee/models/subscription_metric_active.rb +278 -0
  156. data/lib/wallee/models/subscription_metric_create.rb +288 -0
  157. data/lib/wallee/models/subscription_metric_type.rb +232 -0
  158. data/lib/wallee/models/subscription_metric_update.rb +278 -0
  159. data/lib/wallee/models/subscription_metric_usage_report.rb +298 -0
  160. data/lib/wallee/models/subscription_metric_usage_report_create.rb +318 -0
  161. data/lib/wallee/models/subscription_pending.rb +348 -0
  162. data/lib/wallee/models/subscription_period_bill.rb +298 -0
  163. data/lib/wallee/models/subscription_period_bill_state.rb +43 -0
  164. data/lib/wallee/models/subscription_product.rb +300 -0
  165. data/lib/wallee/models/subscription_product_active.rb +310 -0
  166. data/lib/wallee/models/subscription_product_component.rb +298 -0
  167. data/lib/wallee/models/subscription_product_component_group.rb +258 -0
  168. data/lib/wallee/models/subscription_product_component_group_update.rb +268 -0
  169. data/lib/wallee/models/subscription_product_component_reference.rb +258 -0
  170. data/lib/wallee/models/subscription_product_component_reference_state.rb +45 -0
  171. data/lib/wallee/models/subscription_product_component_update.rb +308 -0
  172. data/lib/wallee/models/subscription_product_create.rb +315 -0
  173. data/lib/wallee/models/subscription_product_retirement.rb +258 -0
  174. data/lib/wallee/models/subscription_product_retirement_create.rb +263 -0
  175. data/lib/wallee/models/subscription_product_state.rb +46 -0
  176. data/lib/wallee/models/subscription_product_version.rb +390 -0
  177. data/lib/wallee/models/subscription_product_version_pending.rb +310 -0
  178. data/lib/wallee/models/subscription_product_version_retirement.rb +258 -0
  179. data/lib/wallee/models/subscription_product_version_retirement_create.rb +263 -0
  180. data/lib/wallee/models/subscription_product_version_state.rb +46 -0
  181. data/lib/wallee/models/subscription_state.rb +48 -0
  182. data/lib/wallee/models/subscription_suspension.rb +328 -0
  183. data/lib/wallee/models/subscription_suspension_action.rb +43 -0
  184. data/lib/wallee/models/subscription_suspension_create.rb +343 -0
  185. data/lib/wallee/models/subscription_suspension_reason.rb +44 -0
  186. data/lib/wallee/models/subscription_suspension_running.rb +328 -0
  187. data/lib/wallee/models/subscription_suspension_state.rb +43 -0
  188. data/lib/wallee/models/subscription_update.rb +348 -0
  189. data/lib/wallee/models/subscription_version.rb +370 -0
  190. data/lib/wallee/models/subscription_version_state.rb +47 -0
  191. data/lib/wallee/models/tax.rb +208 -0
  192. data/lib/wallee/models/tax_class.rb +258 -0
  193. data/lib/wallee/models/tax_create.rb +218 -0
  194. data/lib/wallee/models/tenant_database.rb +218 -0
  195. data/lib/wallee/models/token.rb +308 -0
  196. data/lib/wallee/models/token_create.rb +323 -0
  197. data/lib/wallee/models/token_update.rb +318 -0
  198. data/lib/wallee/models/token_version.rb +360 -0
  199. data/lib/wallee/models/token_version_state.rb +44 -0
  200. data/lib/wallee/models/transaction.rb +626 -0
  201. data/lib/wallee/models/transaction_aware_entity.rb +218 -0
  202. data/lib/wallee/models/transaction_completion.rb +390 -0
  203. data/lib/wallee/models/transaction_completion_mode.rb +44 -0
  204. data/lib/wallee/models/transaction_completion_state.rb +45 -0
  205. data/lib/wallee/models/transaction_create.rb +646 -0
  206. data/lib/wallee/models/transaction_group.rb +268 -0
  207. data/lib/wallee/models/transaction_group_state.rb +44 -0
  208. data/lib/wallee/models/transaction_invoice.rb +380 -0
  209. data/lib/wallee/models/transaction_invoice_replacement.rb +250 -0
  210. data/lib/wallee/models/transaction_invoice_state.rb +48 -0
  211. data/lib/wallee/models/transaction_line_item_update_request.rb +215 -0
  212. data/lib/wallee/models/transaction_line_item_version.rb +320 -0
  213. data/lib/wallee/models/transaction_pending.rb +636 -0
  214. data/lib/wallee/models/transaction_state.rb +51 -0
  215. data/lib/wallee/models/transaction_user_interface_type.rb +44 -0
  216. data/lib/wallee/models/transaction_void.rb +380 -0
  217. data/lib/wallee/models/transaction_void_mode.rb +43 -0
  218. data/lib/wallee/models/transaction_void_state.rb +45 -0
  219. data/lib/wallee/models/user.rb +248 -0
  220. data/lib/wallee/models/user_type.rb +45 -0
  221. data/lib/wallee/models/webhook_identity.rb +248 -0
  222. data/lib/wallee/models/webhook_listener.rb +300 -0
  223. data/lib/wallee/models/webhook_listener_create.rb +330 -0
  224. data/lib/wallee/models/webhook_listener_entity.rb +220 -0
  225. data/lib/wallee/models/webhook_listener_update.rb +310 -0
  226. data/lib/wallee/models/webhook_url.rb +258 -0
  227. data/lib/wallee/models/webhook_url_create.rb +273 -0
  228. data/lib/wallee/models/webhook_url_update.rb +268 -0
  229. data/lib/wallee/services/account_service_api.rb +372 -0
  230. data/lib/wallee/services/application_user_service_api.rb +372 -0
  231. data/lib/wallee/services/charge_attempt_service_api.rb +217 -0
  232. data/lib/wallee/services/charge_flow_level_service_api.rb +280 -0
  233. data/lib/wallee/services/charge_flow_service_api.rb +352 -0
  234. data/lib/wallee/services/condition_type_service_api.rb +143 -0
  235. data/lib/wallee/services/country_service_api.rb +85 -0
  236. data/lib/wallee/services/country_state_service_api.rb +143 -0
  237. data/lib/wallee/services/currency_service_api.rb +85 -0
  238. data/lib/wallee/services/delivery_indication_service_api.rb +341 -0
  239. data/lib/wallee/services/document_template_service_api.rb +217 -0
  240. data/lib/wallee/services/document_template_type_service_api.rb +143 -0
  241. data/lib/wallee/services/email_sender_service_api.rb +219 -0
  242. data/lib/wallee/services/email_sender_type_service_api.rb +143 -0
  243. data/lib/wallee/services/email_template_service_api.rb +217 -0
  244. data/lib/wallee/services/email_template_type_service_api.rb +143 -0
  245. data/lib/wallee/services/human_user_service_api.rb +372 -0
  246. data/lib/wallee/services/installment_payment_service_api.rb +287 -0
  247. data/lib/wallee/services/installment_payment_slice_service_api.rb +219 -0
  248. data/lib/wallee/services/installment_plan_calculation_service_api.rb +95 -0
  249. data/lib/wallee/services/installment_plan_configuration_service_api.rb +219 -0
  250. data/lib/wallee/services/installment_plan_slice_configuration_service_api.rb +219 -0
  251. data/lib/wallee/services/label_description_group_service_api.rb +143 -0
  252. data/lib/wallee/services/label_description_service_api.rb +143 -0
  253. data/lib/wallee/services/language_service_api.rb +85 -0
  254. data/lib/wallee/services/manual_task_service_api.rb +217 -0
  255. data/lib/wallee/services/payment_connector_configuration_service_api.rb +217 -0
  256. data/lib/wallee/services/payment_connector_service_api.rb +143 -0
  257. data/lib/wallee/services/payment_method_configuration_service_api.rb +217 -0
  258. data/lib/wallee/services/payment_method_service_api.rb +143 -0
  259. data/lib/wallee/services/payment_processor_configuration_service_api.rb +217 -0
  260. data/lib/wallee/services/payment_processor_service_api.rb +143 -0
  261. data/lib/wallee/services/permission_service_api.rb +143 -0
  262. data/lib/wallee/services/refund_service_api.rb +468 -0
  263. data/lib/wallee/services/space_service_api.rb +372 -0
  264. data/lib/wallee/services/static_value_service_api.rb +143 -0
  265. data/lib/wallee/services/subscriber_service_api.rb +402 -0
  266. data/lib/wallee/services/subscription_charge_service_api.rb +342 -0
  267. data/lib/wallee/services/subscription_ledger_entry_service_api.rb +279 -0
  268. data/lib/wallee/services/subscription_metric_service_api.rb +402 -0
  269. data/lib/wallee/services/subscription_metric_usage_service_api.rb +279 -0
  270. data/lib/wallee/services/subscription_period_bill_service_api.rb +217 -0
  271. data/lib/wallee/services/subscription_product_component_group_service_api.rb +402 -0
  272. data/lib/wallee/services/subscription_product_component_service_api.rb +402 -0
  273. data/lib/wallee/services/subscription_product_fee_tier_service_api.rb +402 -0
  274. data/lib/wallee/services/subscription_product_metered_fee_service_api.rb +402 -0
  275. data/lib/wallee/services/subscription_product_period_fee_service_api.rb +402 -0
  276. data/lib/wallee/services/subscription_product_retirement_service_api.rb +279 -0
  277. data/lib/wallee/services/subscription_product_service_api.rb +341 -0
  278. data/lib/wallee/services/subscription_product_setup_fee_service_api.rb +402 -0
  279. data/lib/wallee/services/subscription_product_version_retirement_service_api.rb +279 -0
  280. data/lib/wallee/services/subscription_product_version_service_api.rb +404 -0
  281. data/lib/wallee/services/subscription_service_api.rb +608 -0
  282. data/lib/wallee/services/subscription_suspension_service_api.rb +342 -0
  283. data/lib/wallee/services/subscription_version_service_api.rb +217 -0
  284. data/lib/wallee/services/token_service_api.rb +402 -0
  285. data/lib/wallee/services/token_version_service_api.rb +280 -0
  286. data/lib/wallee/services/transaction_completion_service_api.rb +343 -0
  287. data/lib/wallee/services/transaction_invoice_service_api.rb +473 -0
  288. data/lib/wallee/services/transaction_service_api.rb +1263 -0
  289. data/lib/wallee/services/transaction_void_service_api.rb +343 -0
  290. data/lib/wallee/services/webhook_listener_service_api.rb +402 -0
  291. data/lib/wallee/services/webhook_url_service_api.rb +402 -0
  292. data/lib/wallee/version.rb +24 -0
  293. metadata +292 -2
@@ -0,0 +1,208 @@
1
+ =begin
2
+ Wallee API: 1.0.0
3
+
4
+ The wallee API allows an easy interaction with the wallee web service.
5
+
6
+
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module Wallee
25
+ #
26
+ class LineItemAttributeCreate
27
+ #
28
+ attr_accessor :label
29
+
30
+ #
31
+ attr_accessor :value
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'label' => :'label',
38
+ :'value' => :'value'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'label' => :'String',
46
+ :'value' => :'String'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
+
58
+ if attributes.has_key?(:'label')
59
+ self.label = attributes[:'label']
60
+ end
61
+
62
+ if attributes.has_key?(:'value')
63
+ self.value = attributes[:'value']
64
+ end
65
+
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properies with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ return invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ return true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ label == o.label &&
87
+ value == o.value
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [label, value].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.swagger_types.each_pair do |key, type|
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ temp_model = Wallee.const_get(type).new
160
+ temp_model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ next if value.nil?
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map{ |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+
206
+ end
207
+
208
+ end
@@ -0,0 +1,367 @@
1
+ =begin
2
+ Wallee API: 1.0.0
3
+
4
+ The wallee API allows an easy interaction with the wallee web service.
5
+
6
+
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module Wallee
25
+ #
26
+ class LineItemCreate
27
+ # The aggregated tax rate is the sum of all tax rates of the line item.
28
+ attr_accessor :aggregated_tax_rate
29
+
30
+ #
31
+ attr_accessor :amount_excluding_tax
32
+
33
+ #
34
+ attr_accessor :amount_including_tax
35
+
36
+ #
37
+ attr_accessor :attributes
38
+
39
+ #
40
+ attr_accessor :name
41
+
42
+ #
43
+ attr_accessor :quantity
44
+
45
+ #
46
+ attr_accessor :shipping_required
47
+
48
+ #
49
+ attr_accessor :sku
50
+
51
+ #
52
+ attr_accessor :tax_amount
53
+
54
+ #
55
+ attr_accessor :tax_amount_per_unit
56
+
57
+ #
58
+ attr_accessor :taxes
59
+
60
+ #
61
+ attr_accessor :type
62
+
63
+ # The unique id identifies the line item within the set of line items associated with the transaction.
64
+ attr_accessor :unique_id
65
+
66
+ #
67
+ attr_accessor :unit_price_excluding_tax
68
+
69
+ #
70
+ attr_accessor :unit_price_including_tax
71
+
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'aggregated_tax_rate' => :'aggregatedTaxRate',
77
+ :'amount_excluding_tax' => :'amountExcludingTax',
78
+ :'amount_including_tax' => :'amountIncludingTax',
79
+ :'attributes' => :'attributes',
80
+ :'name' => :'name',
81
+ :'quantity' => :'quantity',
82
+ :'shipping_required' => :'shippingRequired',
83
+ :'sku' => :'sku',
84
+ :'tax_amount' => :'taxAmount',
85
+ :'tax_amount_per_unit' => :'taxAmountPerUnit',
86
+ :'taxes' => :'taxes',
87
+ :'type' => :'type',
88
+ :'unique_id' => :'uniqueId',
89
+ :'unit_price_excluding_tax' => :'unitPriceExcludingTax',
90
+ :'unit_price_including_tax' => :'unitPriceIncludingTax'
91
+ }
92
+ end
93
+
94
+ # Attribute type mapping.
95
+ def self.swagger_types
96
+ {
97
+ :'aggregated_tax_rate' => :'Float',
98
+ :'amount_excluding_tax' => :'Float',
99
+ :'amount_including_tax' => :'Float',
100
+ :'attributes' => :'Hash<String, LineItemAttributeCreate>',
101
+ :'name' => :'String',
102
+ :'quantity' => :'Float',
103
+ :'shipping_required' => :'BOOLEAN',
104
+ :'sku' => :'String',
105
+ :'tax_amount' => :'Float',
106
+ :'tax_amount_per_unit' => :'Float',
107
+ :'taxes' => :'Array<TaxCreate>',
108
+ :'type' => :'LineItemType',
109
+ :'unique_id' => :'String',
110
+ :'unit_price_excluding_tax' => :'Float',
111
+ :'unit_price_including_tax' => :'Float'
112
+ }
113
+ end
114
+
115
+ # Initializes the object
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ def initialize(attributes = {})
118
+ return unless attributes.is_a?(Hash)
119
+
120
+ # convert string to symbol for hash key
121
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
122
+
123
+ if attributes.has_key?(:'aggregatedTaxRate')
124
+ self.aggregated_tax_rate = attributes[:'aggregatedTaxRate']
125
+ end
126
+
127
+ if attributes.has_key?(:'amountExcludingTax')
128
+ self.amount_excluding_tax = attributes[:'amountExcludingTax']
129
+ end
130
+
131
+ if attributes.has_key?(:'amountIncludingTax')
132
+ self.amount_including_tax = attributes[:'amountIncludingTax']
133
+ end
134
+
135
+ if attributes.has_key?(:'attributes')
136
+ if (value = attributes[:'attributes']).is_a?(Array)
137
+ self.attributes = value
138
+ end
139
+ end
140
+
141
+ if attributes.has_key?(:'name')
142
+ self.name = attributes[:'name']
143
+ end
144
+
145
+ if attributes.has_key?(:'quantity')
146
+ self.quantity = attributes[:'quantity']
147
+ end
148
+
149
+ if attributes.has_key?(:'shippingRequired')
150
+ self.shipping_required = attributes[:'shippingRequired']
151
+ end
152
+
153
+ if attributes.has_key?(:'sku')
154
+ self.sku = attributes[:'sku']
155
+ end
156
+
157
+ if attributes.has_key?(:'taxAmount')
158
+ self.tax_amount = attributes[:'taxAmount']
159
+ end
160
+
161
+ if attributes.has_key?(:'taxAmountPerUnit')
162
+ self.tax_amount_per_unit = attributes[:'taxAmountPerUnit']
163
+ end
164
+
165
+ if attributes.has_key?(:'taxes')
166
+ if (value = attributes[:'taxes']).is_a?(Array)
167
+ self.taxes = value
168
+ end
169
+ end
170
+
171
+ if attributes.has_key?(:'type')
172
+ self.type = attributes[:'type']
173
+ end
174
+
175
+ if attributes.has_key?(:'uniqueId')
176
+ self.unique_id = attributes[:'uniqueId']
177
+ end
178
+
179
+ if attributes.has_key?(:'unitPriceExcludingTax')
180
+ self.unit_price_excluding_tax = attributes[:'unitPriceExcludingTax']
181
+ end
182
+
183
+ if attributes.has_key?(:'unitPriceIncludingTax')
184
+ self.unit_price_including_tax = attributes[:'unitPriceIncludingTax']
185
+ end
186
+
187
+ end
188
+
189
+ # Show invalid properties with the reasons. Usually used together with valid?
190
+ # @return Array for valid properies with the reasons
191
+ def list_invalid_properties
192
+ invalid_properties = Array.new
193
+ if @amount_including_tax.nil?
194
+ invalid_properties.push("invalid value for 'amount_including_tax', amount_including_tax cannot be nil.")
195
+ end
196
+
197
+ if @name.nil?
198
+ invalid_properties.push("invalid value for 'name', name cannot be nil.")
199
+ end
200
+
201
+ if @quantity.nil?
202
+ invalid_properties.push("invalid value for 'quantity', quantity cannot be nil.")
203
+ end
204
+
205
+ if @type.nil?
206
+ invalid_properties.push("invalid value for 'type', type cannot be nil.")
207
+ end
208
+
209
+ if @unique_id.nil?
210
+ invalid_properties.push("invalid value for 'unique_id', unique_id cannot be nil.")
211
+ end
212
+
213
+ return invalid_properties
214
+ end
215
+
216
+ # Check to see if the all the properties in the model are valid
217
+ # @return true if the model is valid
218
+ def valid?
219
+ return false if @amount_including_tax.nil?
220
+ return false if @name.nil?
221
+ return false if @quantity.nil?
222
+ return false if @type.nil?
223
+ return false if @unique_id.nil?
224
+ return true
225
+ end
226
+
227
+ # Checks equality by comparing each attribute.
228
+ # @param [Object] Object to be compared
229
+ def ==(o)
230
+ return true if self.equal?(o)
231
+ self.class == o.class &&
232
+ aggregated_tax_rate == o.aggregated_tax_rate &&
233
+ amount_excluding_tax == o.amount_excluding_tax &&
234
+ amount_including_tax == o.amount_including_tax &&
235
+ attributes == o.attributes &&
236
+ name == o.name &&
237
+ quantity == o.quantity &&
238
+ shipping_required == o.shipping_required &&
239
+ sku == o.sku &&
240
+ tax_amount == o.tax_amount &&
241
+ tax_amount_per_unit == o.tax_amount_per_unit &&
242
+ taxes == o.taxes &&
243
+ type == o.type &&
244
+ unique_id == o.unique_id &&
245
+ unit_price_excluding_tax == o.unit_price_excluding_tax &&
246
+ unit_price_including_tax == o.unit_price_including_tax
247
+ end
248
+
249
+ # @see the `==` method
250
+ # @param [Object] Object to be compared
251
+ def eql?(o)
252
+ self == o
253
+ end
254
+
255
+ # Calculates hash code according to all attributes.
256
+ # @return [Fixnum] Hash code
257
+ def hash
258
+ [aggregated_tax_rate, amount_excluding_tax, amount_including_tax, attributes, name, quantity, shipping_required, sku, tax_amount, tax_amount_per_unit, taxes, type, unique_id, unit_price_excluding_tax, unit_price_including_tax].hash
259
+ end
260
+
261
+ # Builds the object from hash
262
+ # @param [Hash] attributes Model attributes in the form of hash
263
+ # @return [Object] Returns the model itself
264
+ def build_from_hash(attributes)
265
+ return nil unless attributes.is_a?(Hash)
266
+ self.class.swagger_types.each_pair do |key, type|
267
+ if type =~ /\AArray<(.*)>/i
268
+ # check to ensure the input is an array given that the the attribute
269
+ # is documented as an array but the input is not
270
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
271
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
272
+ end
273
+ elsif !attributes[self.class.attribute_map[key]].nil?
274
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
275
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
276
+ end
277
+
278
+ self
279
+ end
280
+
281
+ # Deserializes the data based on type
282
+ # @param string type Data type
283
+ # @param string value Value to be deserialized
284
+ # @return [Object] Deserialized data
285
+ def _deserialize(type, value)
286
+ case type.to_sym
287
+ when :DateTime
288
+ DateTime.parse(value)
289
+ when :Date
290
+ Date.parse(value)
291
+ when :String
292
+ value.to_s
293
+ when :Integer
294
+ value.to_i
295
+ when :Float
296
+ value.to_f
297
+ when :BOOLEAN
298
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
299
+ true
300
+ else
301
+ false
302
+ end
303
+ when :Object
304
+ # generic object (usually a Hash), return directly
305
+ value
306
+ when /\AArray<(?<inner_type>.+)>\z/
307
+ inner_type = Regexp.last_match[:inner_type]
308
+ value.map { |v| _deserialize(inner_type, v) }
309
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
310
+ k_type = Regexp.last_match[:k_type]
311
+ v_type = Regexp.last_match[:v_type]
312
+ {}.tap do |hash|
313
+ value.each do |k, v|
314
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
315
+ end
316
+ end
317
+ else # model
318
+ temp_model = Wallee.const_get(type).new
319
+ temp_model.build_from_hash(value)
320
+ end
321
+ end
322
+
323
+ # Returns the string representation of the object
324
+ # @return [String] String presentation of the object
325
+ def to_s
326
+ to_hash.to_s
327
+ end
328
+
329
+ # to_body is an alias to to_hash (backward compatibility)
330
+ # @return [Hash] Returns the object in the form of hash
331
+ def to_body
332
+ to_hash
333
+ end
334
+
335
+ # Returns the object in the form of hash
336
+ # @return [Hash] Returns the object in the form of hash
337
+ def to_hash
338
+ hash = {}
339
+ self.class.attribute_map.each_pair do |attr, param|
340
+ value = self.send(attr)
341
+ next if value.nil?
342
+ hash[param] = _to_hash(value)
343
+ end
344
+ hash
345
+ end
346
+
347
+ # Outputs non-array value in the form of hash
348
+ # For object, use to_hash. Otherwise, just return the value
349
+ # @param [Object] value Any valid value
350
+ # @return [Hash] Returns the value in the form of hash
351
+ def _to_hash(value)
352
+ if value.is_a?(Array)
353
+ value.compact.map{ |v| _to_hash(v) }
354
+ elsif value.is_a?(Hash)
355
+ {}.tap do |hash|
356
+ value.each { |k, v| hash[k] = _to_hash(v) }
357
+ end
358
+ elsif value.respond_to? :to_hash
359
+ value.to_hash
360
+ else
361
+ value
362
+ end
363
+ end
364
+
365
+ end
366
+
367
+ end