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
@@ -23,12 +23,6 @@ module Wallee
23
23
  #
24
24
  attr_accessor :contact_address
25
25
 
26
- #
27
- attr_accessor :default_configuration
28
-
29
- #
30
- attr_accessor :delivery_address
31
-
32
26
  # The ID is the primary key of the entity. The ID identifies the entity uniquely.
33
27
  attr_accessor :id
34
28
 
@@ -51,8 +45,6 @@ module Wallee
51
45
  def self.attribute_map
52
46
  {
53
47
  :'contact_address' => :'contactAddress',
54
- :'default_configuration' => :'defaultConfiguration',
55
- :'delivery_address' => :'deliveryAddress',
56
48
  :'id' => :'id',
57
49
  :'linked_space_id' => :'linkedSpaceId',
58
50
  :'name' => :'name',
@@ -65,9 +57,7 @@ module Wallee
65
57
  # Attribute type mapping.
66
58
  def self.swagger_types
67
59
  {
68
- :'contact_address' => :'PaymentTerminalContactAddress',
69
- :'default_configuration' => :'PaymentTerminalConfiguration',
70
- :'delivery_address' => :'PaymentTerminalAddress',
60
+ :'contact_address' => :'PaymentTerminalAddress',
71
61
  :'id' => :'Integer',
72
62
  :'linked_space_id' => :'Integer',
73
63
  :'name' => :'String',
@@ -89,14 +79,6 @@ module Wallee
89
79
  self.contact_address = attributes[:'contactAddress']
90
80
  end
91
81
 
92
- if attributes.has_key?(:'defaultConfiguration')
93
- self.default_configuration = attributes[:'defaultConfiguration']
94
- end
95
-
96
- if attributes.has_key?(:'deliveryAddress')
97
- self.delivery_address = attributes[:'deliveryAddress']
98
- end
99
-
100
82
  if attributes.has_key?(:'id')
101
83
  self.id = attributes[:'id']
102
84
  end
@@ -156,8 +138,6 @@ module Wallee
156
138
  return true if self.equal?(o)
157
139
  self.class == o.class &&
158
140
  contact_address == o.contact_address &&
159
- default_configuration == o.default_configuration &&
160
- delivery_address == o.delivery_address &&
161
141
  id == o.id &&
162
142
  linked_space_id == o.linked_space_id &&
163
143
  name == o.name &&
@@ -175,7 +155,7 @@ module Wallee
175
155
  # Calculates hash code according to all attributes.
176
156
  # @return [Fixnum] Hash code
177
157
  def hash
178
- [contact_address, default_configuration, delivery_address, id, linked_space_id, name, planned_purge_date, state, version].hash
158
+ [contact_address, id, linked_space_id, name, planned_purge_date, state, version].hash
179
159
  end
180
160
 
181
161
  # Builds the object from hash
@@ -0,0 +1,215 @@
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 PaymentTerminalReceiptType
23
+ #
24
+ attr_accessor :description
25
+
26
+ # The ID is the primary key of the entity. The ID identifies the entity uniquely.
27
+ attr_accessor :id
28
+
29
+ #
30
+ attr_accessor :name
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'description' => :'description',
36
+ :'id' => :'id',
37
+ :'name' => :'name'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'description' => :'Hash<String, String>',
45
+ :'id' => :'Integer',
46
+ :'name' => :'Hash<String, 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?(:'description')
59
+ if (value = attributes[:'description']).is_a?(Hash)
60
+ self.description = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'id')
65
+ self.id = attributes[:'id']
66
+ end
67
+
68
+ if attributes.has_key?(:'name')
69
+ if (value = attributes[:'name']).is_a?(Hash)
70
+ self.name = value
71
+ end
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ description == o.description &&
94
+ id == o.id &&
95
+ name == o.name
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [description, id, name].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ temp_model = Wallee.const_get(type).new
168
+ temp_model.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ next if value.nil?
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map{ |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+ end
@@ -50,6 +50,9 @@ module Wallee
50
50
  #
51
51
  attr_accessor :two_factor_required
52
52
 
53
+ #
54
+ attr_accessor :web_app_enabled
55
+
53
56
  # Attribute mapping from ruby-style variable name to JSON key.
54
57
  def self.attribute_map
55
58
  {
@@ -62,7 +65,8 @@ module Wallee
62
65
  :'parent' => :'parent',
63
66
  :'path_to_root' => :'pathToRoot',
64
67
  :'title' => :'title',
65
- :'two_factor_required' => :'twoFactorRequired'
68
+ :'two_factor_required' => :'twoFactorRequired',
69
+ :'web_app_enabled' => :'webAppEnabled'
66
70
  }
67
71
  end
68
72
 
@@ -78,7 +82,8 @@ module Wallee
78
82
  :'parent' => :'Integer',
79
83
  :'path_to_root' => :'Array<Integer>',
80
84
  :'title' => :'Hash<String, String>',
81
- :'two_factor_required' => :'BOOLEAN'
85
+ :'two_factor_required' => :'BOOLEAN',
86
+ :'web_app_enabled' => :'BOOLEAN'
82
87
  }
83
88
  end
84
89
 
@@ -137,6 +142,10 @@ module Wallee
137
142
  if attributes.has_key?(:'twoFactorRequired')
138
143
  self.two_factor_required = attributes[:'twoFactorRequired']
139
144
  end
145
+
146
+ if attributes.has_key?(:'webAppEnabled')
147
+ self.web_app_enabled = attributes[:'webAppEnabled']
148
+ end
140
149
  end
141
150
 
142
151
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -166,7 +175,8 @@ module Wallee
166
175
  parent == o.parent &&
167
176
  path_to_root == o.path_to_root &&
168
177
  title == o.title &&
169
- two_factor_required == o.two_factor_required
178
+ two_factor_required == o.two_factor_required &&
179
+ web_app_enabled == o.web_app_enabled
170
180
  end
171
181
 
172
182
  # @see the `==` method
@@ -178,7 +188,7 @@ module Wallee
178
188
  # Calculates hash code according to all attributes.
179
189
  # @return [Fixnum] Hash code
180
190
  def hash
181
- [description, feature, group, id, leaf, name, parent, path_to_root, title, two_factor_required].hash
191
+ [description, feature, group, id, leaf, name, parent, path_to_root, title, two_factor_required, web_app_enabled].hash
182
192
  end
183
193
 
184
194
  # Builds the object from hash
@@ -0,0 +1,37 @@
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
+ class RecurringIndicator
22
+
23
+ REGULAR_TRANSACTION = 'REGULAR_TRANSACTION'.freeze
24
+ INITIAL_RECURRING_TRANSACTION = 'INITIAL_RECURRING_TRANSACTION'.freeze
25
+ MERCHANT_INITIATED_RECURRING_TRANSACTION = 'MERCHANT_INITIATED_RECURRING_TRANSACTION'.freeze
26
+ CUSTOMER_INITIATED_RECURRING_TRANSACTION = 'CUSTOMER_INITIATED_RECURRING_TRANSACTION'.freeze
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = RecurringIndicator.constants.select { |c| RecurringIndicator::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #RecurringIndicator" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,281 @@
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 RefundBankTransaction
23
+ # The ID is the primary key of the entity. The ID identifies the entity uniquely.
24
+ attr_accessor :id
25
+
26
+ # The linked space id holds the ID of the space to which the entity belongs to.
27
+ attr_accessor :linked_space_id
28
+
29
+ #
30
+ attr_accessor :linked_transaction
31
+
32
+ #
33
+ attr_accessor :bank_transaction
34
+
35
+ #
36
+ attr_accessor :language
37
+
38
+ #
39
+ attr_accessor :refund
40
+
41
+ # Specify the posting amount in the refund's currency.
42
+ attr_accessor :refund_currency_amount
43
+
44
+ #
45
+ attr_accessor :refund_currency_value_amount
46
+
47
+ #
48
+ attr_accessor :space_view_id
49
+
50
+ # The version number indicates the version of the entity. The version is incremented whenever the entity is changed.
51
+ attr_accessor :version
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'id' => :'id',
57
+ :'linked_space_id' => :'linkedSpaceId',
58
+ :'linked_transaction' => :'linkedTransaction',
59
+ :'bank_transaction' => :'bankTransaction',
60
+ :'language' => :'language',
61
+ :'refund' => :'refund',
62
+ :'refund_currency_amount' => :'refundCurrencyAmount',
63
+ :'refund_currency_value_amount' => :'refundCurrencyValueAmount',
64
+ :'space_view_id' => :'spaceViewId',
65
+ :'version' => :'version'
66
+ }
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.swagger_types
71
+ {
72
+ :'id' => :'Integer',
73
+ :'linked_space_id' => :'Integer',
74
+ :'linked_transaction' => :'Integer',
75
+ :'bank_transaction' => :'BankTransaction',
76
+ :'language' => :'String',
77
+ :'refund' => :'Refund',
78
+ :'refund_currency_amount' => :'Float',
79
+ :'refund_currency_value_amount' => :'Float',
80
+ :'space_view_id' => :'Integer',
81
+ :'version' => :'Integer'
82
+ }
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ return unless attributes.is_a?(Hash)
89
+
90
+ # convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
92
+
93
+ if attributes.has_key?(:'id')
94
+ self.id = attributes[:'id']
95
+ end
96
+
97
+ if attributes.has_key?(:'linkedSpaceId')
98
+ self.linked_space_id = attributes[:'linkedSpaceId']
99
+ end
100
+
101
+ if attributes.has_key?(:'linkedTransaction')
102
+ self.linked_transaction = attributes[:'linkedTransaction']
103
+ end
104
+
105
+ if attributes.has_key?(:'bankTransaction')
106
+ self.bank_transaction = attributes[:'bankTransaction']
107
+ end
108
+
109
+ if attributes.has_key?(:'language')
110
+ self.language = attributes[:'language']
111
+ end
112
+
113
+ if attributes.has_key?(:'refund')
114
+ self.refund = attributes[:'refund']
115
+ end
116
+
117
+ if attributes.has_key?(:'refundCurrencyAmount')
118
+ self.refund_currency_amount = attributes[:'refundCurrencyAmount']
119
+ end
120
+
121
+ if attributes.has_key?(:'refundCurrencyValueAmount')
122
+ self.refund_currency_value_amount = attributes[:'refundCurrencyValueAmount']
123
+ end
124
+
125
+ if attributes.has_key?(:'spaceViewId')
126
+ self.space_view_id = attributes[:'spaceViewId']
127
+ end
128
+
129
+ if attributes.has_key?(:'version')
130
+ self.version = attributes[:'version']
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = Array.new
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ true
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ id == o.id &&
153
+ linked_space_id == o.linked_space_id &&
154
+ linked_transaction == o.linked_transaction &&
155
+ bank_transaction == o.bank_transaction &&
156
+ language == o.language &&
157
+ refund == o.refund &&
158
+ refund_currency_amount == o.refund_currency_amount &&
159
+ refund_currency_value_amount == o.refund_currency_value_amount &&
160
+ space_view_id == o.space_view_id &&
161
+ version == o.version
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Fixnum] Hash code
172
+ def hash
173
+ [id, linked_space_id, linked_transaction, bank_transaction, language, refund, refund_currency_amount, refund_currency_value_amount, space_view_id, version].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ self.class.swagger_types.each_pair do |key, type|
182
+ if type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
186
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
187
+ end
188
+ elsif !attributes[self.class.attribute_map[key]].nil?
189
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :DateTime
203
+ DateTime.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :BOOLEAN
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ temp_model = Wallee.const_get(type).new
234
+ temp_model.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ next if value.nil?
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map{ |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+ end