wallee-ruby-sdk 2.2.4 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/lib/wallee-ruby-sdk.rb +46 -3
  4. data/lib/wallee-ruby-sdk/api/bank_account_service_api.rb +213 -0
  5. data/lib/wallee-ruby-sdk/api/bank_transaction_service_api.rb +213 -0
  6. data/lib/wallee-ruby-sdk/api/charge_bank_transaction_service_api.rb +213 -0
  7. data/lib/wallee-ruby-sdk/api/currency_bank_account_service_api.rb +213 -0
  8. data/lib/wallee-ruby-sdk/api/external_transfer_bank_transaction_service_api.rb +213 -0
  9. data/lib/wallee-ruby-sdk/api/internal_transfer_bank_transaction_service_api.rb +213 -0
  10. data/lib/wallee-ruby-sdk/api/payment_terminal_till_service_api.rb +71 -0
  11. data/lib/wallee-ruby-sdk/api/refund_bank_transaction_service_api.rb +213 -0
  12. data/lib/wallee-ruby-sdk/api/refund_recovery_bank_transaction_service_api.rb +213 -0
  13. data/lib/wallee-ruby-sdk/api/shopify_subscriber_service_api.rb +62 -0
  14. data/lib/wallee-ruby-sdk/api/token_service_api.rb +63 -0
  15. data/lib/wallee-ruby-sdk/api/transaction_terminal_service_api.rb +21 -32
  16. data/lib/wallee-ruby-sdk/api/web_app_service_api.rb +200 -0
  17. data/lib/wallee-ruby-sdk/api_client.rb +2 -1
  18. data/lib/wallee-ruby-sdk/models/abstract_payment_link_update.rb +15 -15
  19. data/lib/wallee-ruby-sdk/models/abstract_subscription_product_active.rb +11 -1
  20. data/lib/wallee-ruby-sdk/models/authenticated_card_data.rb +221 -0
  21. data/lib/wallee-ruby-sdk/models/{unencrypted_card_data.rb → authenticated_card_data_create.rb} +86 -12
  22. data/lib/wallee-ruby-sdk/models/bank_account.rb +291 -0
  23. data/lib/wallee-ruby-sdk/models/bank_account_environment.rb +35 -0
  24. data/lib/wallee-ruby-sdk/models/bank_account_state.rb +37 -0
  25. data/lib/wallee-ruby-sdk/models/bank_account_type.rb +227 -0
  26. data/lib/wallee-ruby-sdk/models/bank_transaction.rb +387 -0
  27. data/lib/wallee-ruby-sdk/models/bank_transaction_flow_direction.rb +35 -0
  28. data/lib/wallee-ruby-sdk/models/bank_transaction_source.rb +215 -0
  29. data/lib/wallee-ruby-sdk/models/bank_transaction_state.rb +35 -0
  30. data/lib/wallee-ruby-sdk/models/bank_transaction_type.rb +215 -0
  31. data/lib/wallee-ruby-sdk/models/card_authentication_response.rb +38 -0
  32. data/lib/wallee-ruby-sdk/models/card_authentication_version.rb +35 -0
  33. data/lib/wallee-ruby-sdk/models/card_cryptogram.rb +201 -0
  34. data/lib/wallee-ruby-sdk/models/card_cryptogram_create.rb +211 -0
  35. data/lib/wallee-ruby-sdk/models/card_cryptogram_type.rb +34 -0
  36. data/lib/wallee-ruby-sdk/models/cardholder_authentication.rb +231 -0
  37. data/lib/wallee-ruby-sdk/models/cardholder_authentication_create.rb +241 -0
  38. data/lib/wallee-ruby-sdk/models/charge_bank_transaction.rb +291 -0
  39. data/lib/wallee-ruby-sdk/models/currency_bank_account.rb +241 -0
  40. data/lib/wallee-ruby-sdk/models/debt_collection_case.rb +1 -1
  41. data/lib/wallee-ruby-sdk/models/debt_collection_case_create.rb +1 -1
  42. data/lib/wallee-ruby-sdk/models/external_transfer_bank_transaction.rb +251 -0
  43. data/lib/wallee-ruby-sdk/models/internal_transfer_bank_transaction.rb +231 -0
  44. data/lib/wallee-ruby-sdk/models/payment_adjustment.rb +231 -0
  45. data/lib/wallee-ruby-sdk/models/payment_adjustment_type.rb +215 -0
  46. data/lib/wallee-ruby-sdk/models/payment_contract.rb +1 -25
  47. data/lib/wallee-ruby-sdk/models/payment_link.rb +16 -40
  48. data/lib/wallee-ruby-sdk/models/payment_link_active.rb +15 -15
  49. data/lib/wallee-ruby-sdk/models/payment_link_address_handling_mode.rb +36 -0
  50. data/lib/wallee-ruby-sdk/models/payment_link_create.rb +16 -44
  51. data/lib/wallee-ruby-sdk/models/payment_link_update.rb +15 -15
  52. data/lib/wallee-ruby-sdk/models/payment_terminal.rb +11 -1
  53. data/lib/wallee-ruby-sdk/models/payment_terminal_address.rb +0 -60
  54. data/lib/wallee-ruby-sdk/models/payment_terminal_configuration_version.rb +11 -1
  55. data/lib/wallee-ruby-sdk/models/payment_terminal_location.rb +2 -22
  56. data/lib/wallee-ruby-sdk/models/payment_terminal_receipt_type.rb +215 -0
  57. data/lib/wallee-ruby-sdk/models/permission.rb +14 -4
  58. data/lib/wallee-ruby-sdk/models/recurring_indicator.rb +37 -0
  59. data/lib/wallee-ruby-sdk/models/refund_bank_transaction.rb +281 -0
  60. data/lib/wallee-ruby-sdk/models/refund_recovery_bank_transaction.rb +293 -0
  61. data/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb +26 -6
  62. data/lib/wallee-ruby-sdk/models/role.rb +1 -1
  63. data/lib/wallee-ruby-sdk/models/role_state.rb +37 -0
  64. data/lib/wallee-ruby-sdk/models/shopify_subscriber.rb +1 -1
  65. data/lib/wallee-ruby-sdk/models/shopify_subscriber_active.rb +241 -0
  66. data/lib/wallee-ruby-sdk/models/shopify_subscription.rb +11 -1
  67. data/lib/wallee-ruby-sdk/models/shopify_subscription_creation_request.rb +12 -2
  68. data/lib/wallee-ruby-sdk/models/shopify_subscription_model_billing_configuration.rb +11 -1
  69. data/lib/wallee-ruby-sdk/models/shopify_subscription_version.rb +11 -1
  70. data/lib/wallee-ruby-sdk/models/subscriber.rb +1 -1
  71. data/lib/wallee-ruby-sdk/models/subscriber_create.rb +1 -1
  72. data/lib/wallee-ruby-sdk/models/subscription_affiliate.rb +1 -25
  73. data/lib/wallee-ruby-sdk/models/subscription_affiliate_create.rb +1 -29
  74. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleted.rb +1 -25
  75. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleting.rb +1 -25
  76. data/lib/wallee-ruby-sdk/models/subscription_charge.rb +1 -1
  77. data/lib/wallee-ruby-sdk/models/subscription_charge_create.rb +1 -1
  78. data/lib/wallee-ruby-sdk/models/subscription_ledger_entry.rb +12 -2
  79. data/lib/wallee-ruby-sdk/models/subscription_ledger_entry_create.rb +1 -1
  80. data/lib/wallee-ruby-sdk/models/subscription_product.rb +11 -1
  81. data/lib/wallee-ruby-sdk/models/subscription_product_active.rb +11 -1
  82. data/lib/wallee-ruby-sdk/models/subscription_product_component.rb +1 -1
  83. data/lib/wallee-ruby-sdk/models/subscription_product_component_update.rb +1 -1
  84. data/lib/wallee-ruby-sdk/models/subscription_product_create.rb +11 -1
  85. data/lib/wallee-ruby-sdk/models/tax_calculation.rb +2 -2
  86. data/lib/wallee-ruby-sdk/models/terminal_receipt_fetch_request.rb +221 -0
  87. data/lib/wallee-ruby-sdk/models/terminal_receipt_format.rb +35 -0
  88. data/lib/wallee-ruby-sdk/models/token.rb +1 -25
  89. data/lib/wallee-ruby-sdk/models/token_create.rb +1 -29
  90. data/lib/wallee-ruby-sdk/models/tokenized_card_data.rb +211 -0
  91. data/lib/wallee-ruby-sdk/models/{unencrypted_card_data_create.rb → tokenized_card_data_create.rb} +60 -5
  92. data/lib/wallee-ruby-sdk/models/transaction.rb +64 -4
  93. data/lib/wallee-ruby-sdk/models/web_app_confirmation_request.rb +206 -0
  94. data/lib/wallee-ruby-sdk/models/web_app_confirmation_response.rb +231 -0
  95. data/lib/wallee-ruby-sdk/models/webhook_url.rb +11 -1
  96. data/lib/wallee-ruby-sdk/version.rb +1 -1
  97. data/test/condition_type_service_test.rb +22 -0
  98. metadata +50 -5
  99. data/lib/wallee-ruby-sdk/models/payment_terminal_contact_address.rb +0 -396
@@ -134,6 +134,9 @@ module Wallee
134
134
  #
135
135
  attr_accessor :invoice_merchant_reference
136
136
 
137
+ #
138
+ attr_accessor :java_enabled
139
+
137
140
  #
138
141
  attr_accessor :language
139
142
 
@@ -164,6 +167,15 @@ module Wallee
164
167
  # The refunded amount is the total amount which has been refunded so far.
165
168
  attr_accessor :refunded_amount
166
169
 
170
+ #
171
+ attr_accessor :screen_color_depth
172
+
173
+ #
174
+ attr_accessor :screen_height
175
+
176
+ #
177
+ attr_accessor :screen_width
178
+
167
179
  #
168
180
  attr_accessor :shipping_address
169
181
 
@@ -209,6 +221,12 @@ module Wallee
209
221
  # The version number indicates the version of the entity. The version is incremented whenever the entity is changed.
210
222
  attr_accessor :version
211
223
 
224
+ #
225
+ attr_accessor :window_height
226
+
227
+ #
228
+ attr_accessor :window_width
229
+
212
230
  # Attribute mapping from ruby-style variable name to JSON key.
213
231
  def self.attribute_map
214
232
  {
@@ -250,6 +268,7 @@ module Wallee
250
268
  :'internet_protocol_address' => :'internetProtocolAddress',
251
269
  :'internet_protocol_address_country' => :'internetProtocolAddressCountry',
252
270
  :'invoice_merchant_reference' => :'invoiceMerchantReference',
271
+ :'java_enabled' => :'javaEnabled',
253
272
  :'language' => :'language',
254
273
  :'line_items' => :'lineItems',
255
274
  :'linked_space_id' => :'linkedSpaceId',
@@ -260,6 +279,9 @@ module Wallee
260
279
  :'planned_purge_date' => :'plannedPurgeDate',
261
280
  :'processing_on' => :'processingOn',
262
281
  :'refunded_amount' => :'refundedAmount',
282
+ :'screen_color_depth' => :'screenColorDepth',
283
+ :'screen_height' => :'screenHeight',
284
+ :'screen_width' => :'screenWidth',
263
285
  :'shipping_address' => :'shippingAddress',
264
286
  :'shipping_method' => :'shippingMethod',
265
287
  :'space_view_id' => :'spaceViewId',
@@ -274,7 +296,9 @@ module Wallee
274
296
  :'user_agent_header' => :'userAgentHeader',
275
297
  :'user_failure_message' => :'userFailureMessage',
276
298
  :'user_interface_type' => :'userInterfaceType',
277
- :'version' => :'version'
299
+ :'version' => :'version',
300
+ :'window_height' => :'windowHeight',
301
+ :'window_width' => :'windowWidth'
278
302
  }
279
303
  end
280
304
 
@@ -319,6 +343,7 @@ module Wallee
319
343
  :'internet_protocol_address' => :'String',
320
344
  :'internet_protocol_address_country' => :'String',
321
345
  :'invoice_merchant_reference' => :'String',
346
+ :'java_enabled' => :'BOOLEAN',
322
347
  :'language' => :'String',
323
348
  :'line_items' => :'Array<LineItem>',
324
349
  :'linked_space_id' => :'Integer',
@@ -329,6 +354,9 @@ module Wallee
329
354
  :'planned_purge_date' => :'DateTime',
330
355
  :'processing_on' => :'DateTime',
331
356
  :'refunded_amount' => :'Float',
357
+ :'screen_color_depth' => :'String',
358
+ :'screen_height' => :'String',
359
+ :'screen_width' => :'String',
332
360
  :'shipping_address' => :'Address',
333
361
  :'shipping_method' => :'String',
334
362
  :'space_view_id' => :'Integer',
@@ -343,7 +371,9 @@ module Wallee
343
371
  :'user_agent_header' => :'String',
344
372
  :'user_failure_message' => :'String',
345
373
  :'user_interface_type' => :'TransactionUserInterfaceType',
346
- :'version' => :'Integer'
374
+ :'version' => :'Integer',
375
+ :'window_height' => :'String',
376
+ :'window_width' => :'String'
347
377
  }
348
378
  end
349
379
 
@@ -511,6 +541,10 @@ module Wallee
511
541
  self.invoice_merchant_reference = attributes[:'invoiceMerchantReference']
512
542
  end
513
543
 
544
+ if attributes.has_key?(:'javaEnabled')
545
+ self.java_enabled = attributes[:'javaEnabled']
546
+ end
547
+
514
548
  if attributes.has_key?(:'language')
515
549
  self.language = attributes[:'language']
516
550
  end
@@ -555,6 +589,18 @@ module Wallee
555
589
  self.refunded_amount = attributes[:'refundedAmount']
556
590
  end
557
591
 
592
+ if attributes.has_key?(:'screenColorDepth')
593
+ self.screen_color_depth = attributes[:'screenColorDepth']
594
+ end
595
+
596
+ if attributes.has_key?(:'screenHeight')
597
+ self.screen_height = attributes[:'screenHeight']
598
+ end
599
+
600
+ if attributes.has_key?(:'screenWidth')
601
+ self.screen_width = attributes[:'screenWidth']
602
+ end
603
+
558
604
  if attributes.has_key?(:'shippingAddress')
559
605
  self.shipping_address = attributes[:'shippingAddress']
560
606
  end
@@ -614,6 +660,14 @@ module Wallee
614
660
  if attributes.has_key?(:'version')
615
661
  self.version = attributes[:'version']
616
662
  end
663
+
664
+ if attributes.has_key?(:'windowHeight')
665
+ self.window_height = attributes[:'windowHeight']
666
+ end
667
+
668
+ if attributes.has_key?(:'windowWidth')
669
+ self.window_width = attributes[:'windowWidth']
670
+ end
617
671
  end
618
672
 
619
673
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -804,6 +858,7 @@ module Wallee
804
858
  internet_protocol_address == o.internet_protocol_address &&
805
859
  internet_protocol_address_country == o.internet_protocol_address_country &&
806
860
  invoice_merchant_reference == o.invoice_merchant_reference &&
861
+ java_enabled == o.java_enabled &&
807
862
  language == o.language &&
808
863
  line_items == o.line_items &&
809
864
  linked_space_id == o.linked_space_id &&
@@ -814,6 +869,9 @@ module Wallee
814
869
  planned_purge_date == o.planned_purge_date &&
815
870
  processing_on == o.processing_on &&
816
871
  refunded_amount == o.refunded_amount &&
872
+ screen_color_depth == o.screen_color_depth &&
873
+ screen_height == o.screen_height &&
874
+ screen_width == o.screen_width &&
817
875
  shipping_address == o.shipping_address &&
818
876
  shipping_method == o.shipping_method &&
819
877
  space_view_id == o.space_view_id &&
@@ -828,7 +886,9 @@ module Wallee
828
886
  user_agent_header == o.user_agent_header &&
829
887
  user_failure_message == o.user_failure_message &&
830
888
  user_interface_type == o.user_interface_type &&
831
- version == o.version
889
+ version == o.version &&
890
+ window_height == o.window_height &&
891
+ window_width == o.window_width
832
892
  end
833
893
 
834
894
  # @see the `==` method
@@ -840,7 +900,7 @@ module Wallee
840
900
  # Calculates hash code according to all attributes.
841
901
  # @return [Fixnum] Hash code
842
902
  def hash
843
- [accept_header, accept_language_header, allowed_payment_method_brands, allowed_payment_method_configurations, authorization_amount, authorization_environment, authorization_sales_channel, authorization_timeout_on, authorized_on, auto_confirmation_enabled, billing_address, charge_retry_enabled, completed_amount, completed_on, completion_behavior, completion_timeout_on, confirmed_by, confirmed_on, created_by, created_on, currency, customer_email_address, customer_id, customers_presence, delivery_decision_made_on, device_session_identifier, emails_disabled, end_of_life, environment, environment_selection_strategy, failed_on, failed_url, failure_reason, group, id, internet_protocol_address, internet_protocol_address_country, invoice_merchant_reference, language, line_items, linked_space_id, merchant_reference, meta_data, parent, payment_connector_configuration, planned_purge_date, processing_on, refunded_amount, shipping_address, shipping_method, space_view_id, state, success_url, terminal, time_zone, token, tokenization_mode, total_applied_fees, total_settled_amount, user_agent_header, user_failure_message, user_interface_type, version].hash
903
+ [accept_header, accept_language_header, allowed_payment_method_brands, allowed_payment_method_configurations, authorization_amount, authorization_environment, authorization_sales_channel, authorization_timeout_on, authorized_on, auto_confirmation_enabled, billing_address, charge_retry_enabled, completed_amount, completed_on, completion_behavior, completion_timeout_on, confirmed_by, confirmed_on, created_by, created_on, currency, customer_email_address, customer_id, customers_presence, delivery_decision_made_on, device_session_identifier, emails_disabled, end_of_life, environment, environment_selection_strategy, failed_on, failed_url, failure_reason, group, id, internet_protocol_address, internet_protocol_address_country, invoice_merchant_reference, java_enabled, language, line_items, linked_space_id, merchant_reference, meta_data, parent, payment_connector_configuration, planned_purge_date, processing_on, refunded_amount, screen_color_depth, screen_height, screen_width, shipping_address, shipping_method, space_view_id, state, success_url, terminal, time_zone, token, tokenization_mode, total_applied_fees, total_settled_amount, user_agent_header, user_failure_message, user_interface_type, version, window_height, window_width].hash
844
904
  end
845
905
 
846
906
  # Builds the object from hash
@@ -0,0 +1,206 @@
1
+ =begin
2
+ The wallee API allows an easy interaction with the wallee web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require 'date'
19
+
20
+ module Wallee
21
+ #
22
+ class WebAppConfirmationRequest
23
+ # The user returns to the web app after granting the permission. The HTTP request contains the code. Provide it here to confirm the web app installation.
24
+ attr_accessor :code
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'code' => :'code'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'code' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'code')
49
+ self.code = attributes[:'code']
50
+ end
51
+ end
52
+
53
+ # Show invalid properties with the reasons. Usually used together with valid?
54
+ # @return Array for valid properties with the reasons
55
+ def list_invalid_properties
56
+ invalid_properties = Array.new
57
+ if !@code.nil? && @code.to_s.length > 100
58
+ invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 100.')
59
+ end
60
+
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ return false if !@code.nil? && @code.to_s.length > 100
68
+ true
69
+ end
70
+
71
+ # Custom attribute writer method with validation
72
+ # @param [Object] code Value to be assigned
73
+ def code=(code)
74
+ if !code.nil? && code.to_s.length > 100
75
+ fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 100.'
76
+ end
77
+
78
+ @code = code
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
+ code == o.code
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [code].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ temp_model = Wallee.const_get(type).new
159
+ temp_model.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ next if value.nil?
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map{ |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+ end
@@ -0,0 +1,231 @@
1
+ =begin
2
+ The wallee API allows an easy interaction with the wallee web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require 'date'
19
+
20
+ module Wallee
21
+ # The confirmation response provides the details about the installation of the web app.
22
+ class WebAppConfirmationResponse
23
+ # The access code grants permissions to the web service API according to the OAuth standard.
24
+ attr_accessor :access_token
25
+
26
+ # The scope contains the permissions granted to the web app within the space.
27
+ attr_accessor :scope
28
+
29
+ # This is the space into which the web app is installed into.
30
+ attr_accessor :space
31
+
32
+ # The state contains the state parameter content provided when initiating the app installation.
33
+ attr_accessor :state
34
+
35
+ # The token type indicates the type of the access token. The type determines the authentication mechanism to use for accessing the web service API.
36
+ attr_accessor :token_type
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'access_token' => :'access_token',
42
+ :'scope' => :'scope',
43
+ :'space' => :'space',
44
+ :'state' => :'state',
45
+ :'token_type' => :'token_type'
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+ :'access_token' => :'String',
53
+ :'scope' => :'String',
54
+ :'space' => :'Space',
55
+ :'state' => :'String',
56
+ :'token_type' => :'String'
57
+ }
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ return unless attributes.is_a?(Hash)
64
+
65
+ # convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
67
+
68
+ if attributes.has_key?(:'access_token')
69
+ self.access_token = attributes[:'access_token']
70
+ end
71
+
72
+ if attributes.has_key?(:'scope')
73
+ self.scope = attributes[:'scope']
74
+ end
75
+
76
+ if attributes.has_key?(:'space')
77
+ self.space = attributes[:'space']
78
+ end
79
+
80
+ if attributes.has_key?(:'state')
81
+ self.state = attributes[:'state']
82
+ end
83
+
84
+ if attributes.has_key?(:'token_type')
85
+ self.token_type = attributes[:'token_type']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ access_token == o.access_token &&
108
+ scope == o.scope &&
109
+ space == o.space &&
110
+ state == o.state &&
111
+ token_type == o.token_type
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Fixnum] Hash code
122
+ def hash
123
+ [access_token, scope, space, state, token_type].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.swagger_types.each_pair do |key, type|
132
+ if type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :DateTime
153
+ DateTime.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :BOOLEAN
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ temp_model = Wallee.const_get(type).new
184
+ temp_model.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ next if value.nil?
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map{ |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+ end