wallee-ruby-sdk 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +21 -11
  3. data/lib/wallee-ruby-sdk/models/abstract_debt_collection_case_update.rb +270 -0
  4. data/lib/wallee-ruby-sdk/models/abstract_payment_link_update.rb +302 -0
  5. data/lib/wallee-ruby-sdk/models/abstract_subscription_affiliate_update.rb +230 -0
  6. data/lib/wallee-ruby-sdk/models/abstract_transaction_pending.rb +14 -4
  7. data/lib/wallee-ruby-sdk/models/criteria_operator.rb +1 -0
  8. data/lib/wallee-ruby-sdk/models/debt_collection_case.rb +502 -0
  9. data/lib/wallee-ruby-sdk/models/debt_collection_case_create.rb +310 -0
  10. data/lib/wallee-ruby-sdk/models/debt_collection_case_document.rb +300 -0
  11. data/lib/wallee-ruby-sdk/models/debt_collection_case_source.rb +232 -0
  12. data/lib/wallee-ruby-sdk/models/debt_collection_case_state.rb +48 -0
  13. data/lib/wallee-ruby-sdk/models/debt_collection_case_update.rb +300 -0
  14. data/lib/wallee-ruby-sdk/models/debt_collection_environment.rb +43 -0
  15. data/lib/wallee-ruby-sdk/models/debt_collection_receipt.rb +288 -0
  16. data/lib/wallee-ruby-sdk/models/debt_collection_receipt_source.rb +222 -0
  17. data/lib/wallee-ruby-sdk/models/debt_collector.rb +222 -0
  18. data/lib/wallee-ruby-sdk/models/debt_collector_condition.rb +258 -0
  19. data/lib/wallee-ruby-sdk/models/debt_collector_condition_type.rb +222 -0
  20. data/lib/wallee-ruby-sdk/models/debt_collector_configuration.rb +302 -0
  21. data/lib/wallee-ruby-sdk/models/document_template_type.rb +1 -11
  22. data/lib/wallee-ruby-sdk/models/entity_export_request.rb +215 -0
  23. data/lib/wallee-ruby-sdk/models/entity_query.rb +1 -1
  24. data/lib/wallee-ruby-sdk/models/entity_query_order_by.rb +10 -0
  25. data/lib/wallee-ruby-sdk/models/environment.rb +43 -0
  26. data/lib/wallee-ruby-sdk/models/metric_usage.rb +232 -0
  27. data/lib/wallee-ruby-sdk/models/payment_connector.rb +23 -1
  28. data/lib/wallee-ruby-sdk/models/payment_contract.rb +338 -0
  29. data/lib/wallee-ruby-sdk/models/payment_contract_state.rb +46 -0
  30. data/lib/wallee-ruby-sdk/models/payment_contract_type.rb +232 -0
  31. data/lib/wallee-ruby-sdk/models/payment_link.rb +382 -0
  32. data/lib/wallee-ruby-sdk/models/payment_link_active.rb +342 -0
  33. data/lib/wallee-ruby-sdk/models/payment_link_create.rb +337 -0
  34. data/lib/wallee-ruby-sdk/models/payment_link_protection_mode.rb +43 -0
  35. data/lib/wallee-ruby-sdk/models/payment_link_update.rb +332 -0
  36. data/lib/wallee-ruby-sdk/models/payment_method.rb +13 -1
  37. data/lib/wallee-ruby-sdk/models/payment_processor_configuration.rb +11 -1
  38. data/lib/wallee-ruby-sdk/models/refund.rb +11 -1
  39. data/lib/wallee-ruby-sdk/models/rest_address_format.rb +234 -0
  40. data/lib/wallee-ruby-sdk/models/rest_address_format_field.rb +51 -0
  41. data/lib/wallee-ruby-sdk/models/rest_country.rb +11 -1
  42. data/lib/wallee-ruby-sdk/models/subscription.rb +11 -1
  43. data/lib/wallee-ruby-sdk/models/subscription_affiliate.rb +290 -0
  44. data/lib/wallee-ruby-sdk/models/subscription_affiliate_create.rb +255 -0
  45. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleted.rb +290 -0
  46. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleting.rb +290 -0
  47. data/lib/wallee-ruby-sdk/models/subscription_affiliate_inactive.rb +260 -0
  48. data/lib/wallee-ruby-sdk/models/subscription_affiliate_update.rb +260 -0
  49. data/lib/wallee-ruby-sdk/models/subscription_change_request.rb +2 -2
  50. data/lib/wallee-ruby-sdk/models/subscription_create_request.rb +2 -2
  51. data/lib/wallee-ruby-sdk/models/subscription_pending.rb +11 -1
  52. data/lib/wallee-ruby-sdk/models/tokenizationn_mode.rb +44 -0
  53. data/lib/wallee-ruby-sdk/models/transaction.rb +63 -3
  54. data/lib/wallee-ruby-sdk/models/transaction_create.rb +41 -1
  55. data/lib/wallee-ruby-sdk/models/transaction_environment_selection_strategy.rb +43 -0
  56. data/lib/wallee-ruby-sdk/models/transaction_invoice.rb +11 -1
  57. data/lib/wallee-ruby-sdk/models/transaction_pending.rb +11 -1
  58. data/lib/wallee-ruby-sdk/models/unencrypted_card_data.rb +228 -0
  59. data/lib/wallee-ruby-sdk/models/unencrypted_card_data_create.rb +233 -0
  60. data/lib/wallee-ruby-sdk/models/webhook_listener_entity.rb +1 -11
  61. data/lib/wallee-ruby-sdk/services/account_service_api.rb +2 -2
  62. data/lib/wallee-ruby-sdk/services/application_user_service_api.rb +2 -2
  63. data/lib/wallee-ruby-sdk/services/card_processing_service_api.rb +176 -0
  64. data/lib/wallee-ruby-sdk/services/charge_attempt_service_api.rb +2 -2
  65. data/lib/wallee-ruby-sdk/services/charge_flow_level_service_api.rb +4 -4
  66. data/lib/wallee-ruby-sdk/services/charge_flow_service_api.rb +6 -6
  67. data/lib/wallee-ruby-sdk/services/condition_type_service_api.rb +4 -4
  68. data/lib/wallee-ruby-sdk/services/country_service_api.rb +2 -2
  69. data/lib/wallee-ruby-sdk/services/country_state_service_api.rb +4 -4
  70. data/lib/wallee-ruby-sdk/services/currency_service_api.rb +2 -2
  71. data/lib/wallee-ruby-sdk/services/debt_collection_case_service_api.rb +800 -0
  72. data/lib/wallee-ruby-sdk/services/debt_collector_configuration_service_api.rb +217 -0
  73. data/lib/wallee-ruby-sdk/services/debt_collector_service_api.rb +143 -0
  74. data/lib/wallee-ruby-sdk/services/delivery_indication_service_api.rb +6 -6
  75. data/lib/wallee-ruby-sdk/services/document_template_service_api.rb +2 -2
  76. data/lib/wallee-ruby-sdk/services/document_template_type_service_api.rb +4 -4
  77. data/lib/wallee-ruby-sdk/services/human_user_service_api.rb +59 -2
  78. data/lib/wallee-ruby-sdk/services/installment_payment_service_api.rb +4 -4
  79. data/lib/wallee-ruby-sdk/services/installment_payment_slice_service_api.rb +2 -2
  80. data/lib/wallee-ruby-sdk/services/installment_plan_calculation_service_api.rb +2 -2
  81. data/lib/wallee-ruby-sdk/services/installment_plan_configuration_service_api.rb +2 -2
  82. data/lib/wallee-ruby-sdk/services/installment_plan_slice_configuration_service_api.rb +2 -2
  83. data/lib/wallee-ruby-sdk/services/label_description_group_service_api.rb +4 -4
  84. data/lib/wallee-ruby-sdk/services/label_description_service_api.rb +4 -4
  85. data/lib/wallee-ruby-sdk/services/language_service_api.rb +2 -2
  86. data/lib/wallee-ruby-sdk/services/legal_organization_form_service_api.rb +201 -0
  87. data/lib/wallee-ruby-sdk/services/manual_task_service_api.rb +2 -2
  88. data/lib/wallee-ruby-sdk/services/mertic_usage_service_api.rb +100 -0
  89. data/lib/wallee-ruby-sdk/services/payment_connector_configuration_service_api.rb +2 -2
  90. data/lib/wallee-ruby-sdk/services/payment_connector_service_api.rb +4 -4
  91. data/lib/wallee-ruby-sdk/services/payment_link_service_api.rb +402 -0
  92. data/lib/wallee-ruby-sdk/services/payment_method_configuration_service_api.rb +2 -2
  93. data/lib/wallee-ruby-sdk/services/payment_method_service_api.rb +4 -4
  94. data/lib/wallee-ruby-sdk/services/payment_processor_configuration_service_api.rb +2 -2
  95. data/lib/wallee-ruby-sdk/services/payment_processor_service_api.rb +4 -4
  96. data/lib/wallee-ruby-sdk/services/permission_service_api.rb +4 -4
  97. data/lib/wallee-ruby-sdk/services/refund_service_api.rb +10 -10
  98. data/lib/wallee-ruby-sdk/services/space_service_api.rb +2 -2
  99. data/lib/wallee-ruby-sdk/services/static_value_service_api.rb +4 -4
  100. data/lib/wallee-ruby-sdk/services/subscriber_service_api.rb +2 -2
  101. data/lib/wallee-ruby-sdk/services/subscription_affiliate_service_api.rb +402 -0
  102. data/lib/wallee-ruby-sdk/services/subscription_charge_service_api.rb +4 -4
  103. data/lib/wallee-ruby-sdk/services/subscription_ledger_entry_service_api.rb +2 -2
  104. data/lib/wallee-ruby-sdk/services/subscription_metric_service_api.rb +2 -2
  105. data/lib/wallee-ruby-sdk/services/subscription_metric_usage_service_api.rb +2 -2
  106. data/lib/wallee-ruby-sdk/services/subscription_period_bill_service_api.rb +2 -2
  107. data/lib/wallee-ruby-sdk/services/subscription_product_component_group_service_api.rb +2 -2
  108. data/lib/wallee-ruby-sdk/services/subscription_product_component_service_api.rb +2 -2
  109. data/lib/wallee-ruby-sdk/services/subscription_product_fee_tier_service_api.rb +2 -2
  110. data/lib/wallee-ruby-sdk/services/subscription_product_metered_fee_service_api.rb +2 -2
  111. data/lib/wallee-ruby-sdk/services/subscription_product_period_fee_service_api.rb +2 -2
  112. data/lib/wallee-ruby-sdk/services/subscription_product_retirement_service_api.rb +2 -2
  113. data/lib/wallee-ruby-sdk/services/subscription_product_service_api.rb +2 -2
  114. data/lib/wallee-ruby-sdk/services/subscription_product_setup_fee_service_api.rb +2 -2
  115. data/lib/wallee-ruby-sdk/services/subscription_product_version_retirement_service_api.rb +2 -2
  116. data/lib/wallee-ruby-sdk/services/subscription_product_version_service_api.rb +2 -2
  117. data/lib/wallee-ruby-sdk/services/subscription_service_api.rb +12 -12
  118. data/lib/wallee-ruby-sdk/services/subscription_suspension_service_api.rb +2 -2
  119. data/lib/wallee-ruby-sdk/services/subscription_version_service_api.rb +2 -2
  120. data/lib/wallee-ruby-sdk/services/token_service_api.rb +2 -2
  121. data/lib/wallee-ruby-sdk/services/token_version_service_api.rb +4 -4
  122. data/lib/wallee-ruby-sdk/services/transaction_completion_service_api.rb +6 -6
  123. data/lib/wallee-ruby-sdk/services/transaction_invoice_service_api.rb +6 -6
  124. data/lib/wallee-ruby-sdk/services/transaction_service_api.rb +143 -18
  125. data/lib/wallee-ruby-sdk/services/transaction_void_service_api.rb +6 -6
  126. data/lib/wallee-ruby-sdk/services/user_account_role_service_api.rb +6 -6
  127. data/lib/wallee-ruby-sdk/services/user_space_role_service_api.rb +9 -9
  128. data/lib/wallee-ruby-sdk/services/webhook_listener_service_api.rb +2 -2
  129. data/lib/wallee-ruby-sdk/services/webhook_url_service_api.rb +2 -2
  130. data/lib/wallee-ruby-sdk/version.rb +1 -1
  131. data/lib/wallee-ruby-sdk.rb +47 -0
  132. metadata +50 -3
@@ -0,0 +1,232 @@
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 PaymentContractType
27
+ #
28
+ attr_accessor :description
29
+
30
+ #
31
+ attr_accessor :feature
32
+
33
+ # The ID is the primary key of the entity. The ID identifies the entity uniquely.
34
+ attr_accessor :id
35
+
36
+ #
37
+ attr_accessor :name
38
+
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'description' => :'description',
44
+ :'feature' => :'feature',
45
+ :'id' => :'id',
46
+ :'name' => :'name'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'description' => :'Hash<String, String>',
54
+ :'feature' => :'Feature',
55
+ :'id' => :'Integer',
56
+ :'name' => :'Hash<String, 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?(:'description')
69
+ if (value = attributes[:'description']).is_a?(Array)
70
+ self.description = value
71
+ end
72
+ end
73
+
74
+ if attributes.has_key?(:'feature')
75
+ self.feature = attributes[:'feature']
76
+ end
77
+
78
+ if attributes.has_key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.has_key?(:'name')
83
+ if (value = attributes[:'name']).is_a?(Array)
84
+ self.name = value
85
+ end
86
+ end
87
+
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properies with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ return invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ return true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ description == o.description &&
109
+ feature == o.feature &&
110
+ id == o.id &&
111
+ name == o.name
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
+ [description, feature, id, name].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 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
+
232
+ end
@@ -0,0 +1,382 @@
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
+ # The payment link defines an URL to automatically create transactions.
26
+ class PaymentLink
27
+ # The allowed payment method configurations restrict the payment methods which can be used with this payment link.
28
+ attr_accessor :allowed_payment_method_configurations
29
+
30
+ # The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page.
31
+ attr_accessor :applied_space_view
32
+
33
+ # The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction.
34
+ attr_accessor :available_from
35
+
36
+ # The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction.
37
+ attr_accessor :available_until
38
+
39
+ # By making the billing address required the transaction can only be created when a billing address is provided within the request.
40
+ attr_accessor :billing_address_required
41
+
42
+ # The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'.
43
+ attr_accessor :currency
44
+
45
+ # The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity.
46
+ attr_accessor :external_id
47
+
48
+ # The ID is the primary key of the entity. The ID identifies the entity uniquely.
49
+ attr_accessor :id
50
+
51
+ # The language defines the language of the payment page. If no language is provided it can be provided through the request parameter.
52
+ attr_accessor :language
53
+
54
+ # The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters.
55
+ attr_accessor :line_items
56
+
57
+ # The linked space id holds the ID of the space to which the entity belongs to.
58
+ attr_accessor :linked_space_id
59
+
60
+ # The maximal number of transactions limits the number of transactions which can be created with this payment link.
61
+ attr_accessor :maximal_number_of_transactions
62
+
63
+ # The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive.
64
+ attr_accessor :name
65
+
66
+ # The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed.
67
+ attr_accessor :planned_purge_date
68
+
69
+ # The protection mode determines if the payment link is protected against tampering and in what way.
70
+ attr_accessor :protection_mode
71
+
72
+ # By making the shipping address required the transaction can only be created when a shipping address is provided within the request.
73
+ attr_accessor :shipping_address_required
74
+
75
+ #
76
+ attr_accessor :state
77
+
78
+ # The URL defines the URL to which the user has to be forwarded to initialize the payment.
79
+ attr_accessor :url
80
+
81
+ # The version number indicates the version of the entity. The version is incremented whenever the entity is changed.
82
+ attr_accessor :version
83
+
84
+
85
+ # Attribute mapping from ruby-style variable name to JSON key.
86
+ def self.attribute_map
87
+ {
88
+ :'allowed_payment_method_configurations' => :'allowedPaymentMethodConfigurations',
89
+ :'applied_space_view' => :'appliedSpaceView',
90
+ :'available_from' => :'availableFrom',
91
+ :'available_until' => :'availableUntil',
92
+ :'billing_address_required' => :'billingAddressRequired',
93
+ :'currency' => :'currency',
94
+ :'external_id' => :'externalId',
95
+ :'id' => :'id',
96
+ :'language' => :'language',
97
+ :'line_items' => :'lineItems',
98
+ :'linked_space_id' => :'linkedSpaceId',
99
+ :'maximal_number_of_transactions' => :'maximalNumberOfTransactions',
100
+ :'name' => :'name',
101
+ :'planned_purge_date' => :'plannedPurgeDate',
102
+ :'protection_mode' => :'protectionMode',
103
+ :'shipping_address_required' => :'shippingAddressRequired',
104
+ :'state' => :'state',
105
+ :'url' => :'url',
106
+ :'version' => :'version'
107
+ }
108
+ end
109
+
110
+ # Attribute type mapping.
111
+ def self.swagger_types
112
+ {
113
+ :'allowed_payment_method_configurations' => :'Array<PaymentMethodConfiguration>',
114
+ :'applied_space_view' => :'Integer',
115
+ :'available_from' => :'DateTime',
116
+ :'available_until' => :'DateTime',
117
+ :'billing_address_required' => :'BOOLEAN',
118
+ :'currency' => :'String',
119
+ :'external_id' => :'String',
120
+ :'id' => :'Integer',
121
+ :'language' => :'String',
122
+ :'line_items' => :'Array<LineItem>',
123
+ :'linked_space_id' => :'Integer',
124
+ :'maximal_number_of_transactions' => :'Integer',
125
+ :'name' => :'String',
126
+ :'planned_purge_date' => :'DateTime',
127
+ :'protection_mode' => :'PaymentLinkProtectionMode',
128
+ :'shipping_address_required' => :'BOOLEAN',
129
+ :'state' => :'CreationEntityState',
130
+ :'url' => :'String',
131
+ :'version' => :'Integer'
132
+ }
133
+ end
134
+
135
+ # Initializes the object
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ def initialize(attributes = {})
138
+ return unless attributes.is_a?(Hash)
139
+
140
+ # convert string to symbol for hash key
141
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
142
+
143
+ if attributes.has_key?(:'allowedPaymentMethodConfigurations')
144
+ if (value = attributes[:'allowedPaymentMethodConfigurations']).is_a?(Array)
145
+ self.allowed_payment_method_configurations = value
146
+ end
147
+ end
148
+
149
+ if attributes.has_key?(:'appliedSpaceView')
150
+ self.applied_space_view = attributes[:'appliedSpaceView']
151
+ end
152
+
153
+ if attributes.has_key?(:'availableFrom')
154
+ self.available_from = attributes[:'availableFrom']
155
+ end
156
+
157
+ if attributes.has_key?(:'availableUntil')
158
+ self.available_until = attributes[:'availableUntil']
159
+ end
160
+
161
+ if attributes.has_key?(:'billingAddressRequired')
162
+ self.billing_address_required = attributes[:'billingAddressRequired']
163
+ end
164
+
165
+ if attributes.has_key?(:'currency')
166
+ self.currency = attributes[:'currency']
167
+ end
168
+
169
+ if attributes.has_key?(:'externalId')
170
+ self.external_id = attributes[:'externalId']
171
+ end
172
+
173
+ if attributes.has_key?(:'id')
174
+ self.id = attributes[:'id']
175
+ end
176
+
177
+ if attributes.has_key?(:'language')
178
+ self.language = attributes[:'language']
179
+ end
180
+
181
+ if attributes.has_key?(:'lineItems')
182
+ if (value = attributes[:'lineItems']).is_a?(Array)
183
+ self.line_items = value
184
+ end
185
+ end
186
+
187
+ if attributes.has_key?(:'linkedSpaceId')
188
+ self.linked_space_id = attributes[:'linkedSpaceId']
189
+ end
190
+
191
+ if attributes.has_key?(:'maximalNumberOfTransactions')
192
+ self.maximal_number_of_transactions = attributes[:'maximalNumberOfTransactions']
193
+ end
194
+
195
+ if attributes.has_key?(:'name')
196
+ self.name = attributes[:'name']
197
+ end
198
+
199
+ if attributes.has_key?(:'plannedPurgeDate')
200
+ self.planned_purge_date = attributes[:'plannedPurgeDate']
201
+ end
202
+
203
+ if attributes.has_key?(:'protectionMode')
204
+ self.protection_mode = attributes[:'protectionMode']
205
+ end
206
+
207
+ if attributes.has_key?(:'shippingAddressRequired')
208
+ self.shipping_address_required = attributes[:'shippingAddressRequired']
209
+ end
210
+
211
+ if attributes.has_key?(:'state')
212
+ self.state = attributes[:'state']
213
+ end
214
+
215
+ if attributes.has_key?(:'url')
216
+ self.url = attributes[:'url']
217
+ end
218
+
219
+ if attributes.has_key?(:'version')
220
+ self.version = attributes[:'version']
221
+ end
222
+
223
+ end
224
+
225
+ # Show invalid properties with the reasons. Usually used together with valid?
226
+ # @return Array for valid properies with the reasons
227
+ def list_invalid_properties
228
+ invalid_properties = Array.new
229
+ return invalid_properties
230
+ end
231
+
232
+ # Check to see if the all the properties in the model are valid
233
+ # @return true if the model is valid
234
+ def valid?
235
+ return true
236
+ end
237
+
238
+ # Checks equality by comparing each attribute.
239
+ # @param [Object] Object to be compared
240
+ def ==(o)
241
+ return true if self.equal?(o)
242
+ self.class == o.class &&
243
+ allowed_payment_method_configurations == o.allowed_payment_method_configurations &&
244
+ applied_space_view == o.applied_space_view &&
245
+ available_from == o.available_from &&
246
+ available_until == o.available_until &&
247
+ billing_address_required == o.billing_address_required &&
248
+ currency == o.currency &&
249
+ external_id == o.external_id &&
250
+ id == o.id &&
251
+ language == o.language &&
252
+ line_items == o.line_items &&
253
+ linked_space_id == o.linked_space_id &&
254
+ maximal_number_of_transactions == o.maximal_number_of_transactions &&
255
+ name == o.name &&
256
+ planned_purge_date == o.planned_purge_date &&
257
+ protection_mode == o.protection_mode &&
258
+ shipping_address_required == o.shipping_address_required &&
259
+ state == o.state &&
260
+ url == o.url &&
261
+ version == o.version
262
+ end
263
+
264
+ # @see the `==` method
265
+ # @param [Object] Object to be compared
266
+ def eql?(o)
267
+ self == o
268
+ end
269
+
270
+ # Calculates hash code according to all attributes.
271
+ # @return [Fixnum] Hash code
272
+ def hash
273
+ [allowed_payment_method_configurations, applied_space_view, available_from, available_until, billing_address_required, currency, external_id, id, language, line_items, linked_space_id, maximal_number_of_transactions, name, planned_purge_date, protection_mode, shipping_address_required, state, url, version].hash
274
+ end
275
+
276
+ # Builds the object from hash
277
+ # @param [Hash] attributes Model attributes in the form of hash
278
+ # @return [Object] Returns the model itself
279
+ def build_from_hash(attributes)
280
+ return nil unless attributes.is_a?(Hash)
281
+ self.class.swagger_types.each_pair do |key, type|
282
+ if type =~ /\AArray<(.*)>/i
283
+ # check to ensure the input is an array given that the the attribute
284
+ # is documented as an array but the input is not
285
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
286
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
287
+ end
288
+ elsif !attributes[self.class.attribute_map[key]].nil?
289
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
290
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
291
+ end
292
+
293
+ self
294
+ end
295
+
296
+ # Deserializes the data based on type
297
+ # @param string type Data type
298
+ # @param string value Value to be deserialized
299
+ # @return [Object] Deserialized data
300
+ def _deserialize(type, value)
301
+ case type.to_sym
302
+ when :DateTime
303
+ DateTime.parse(value)
304
+ when :Date
305
+ Date.parse(value)
306
+ when :String
307
+ value.to_s
308
+ when :Integer
309
+ value.to_i
310
+ when :Float
311
+ value.to_f
312
+ when :BOOLEAN
313
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
314
+ true
315
+ else
316
+ false
317
+ end
318
+ when :Object
319
+ # generic object (usually a Hash), return directly
320
+ value
321
+ when /\AArray<(?<inner_type>.+)>\z/
322
+ inner_type = Regexp.last_match[:inner_type]
323
+ value.map { |v| _deserialize(inner_type, v) }
324
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
325
+ k_type = Regexp.last_match[:k_type]
326
+ v_type = Regexp.last_match[:v_type]
327
+ {}.tap do |hash|
328
+ value.each do |k, v|
329
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
330
+ end
331
+ end
332
+ else # model
333
+ temp_model = Wallee.const_get(type).new
334
+ temp_model.build_from_hash(value)
335
+ end
336
+ end
337
+
338
+ # Returns the string representation of the object
339
+ # @return [String] String presentation of the object
340
+ def to_s
341
+ to_hash.to_s
342
+ end
343
+
344
+ # to_body is an alias to to_hash (backward compatibility)
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_body
347
+ to_hash
348
+ end
349
+
350
+ # Returns the object in the form of hash
351
+ # @return [Hash] Returns the object in the form of hash
352
+ def to_hash
353
+ hash = {}
354
+ self.class.attribute_map.each_pair do |attr, param|
355
+ value = self.send(attr)
356
+ next if value.nil?
357
+ hash[param] = _to_hash(value)
358
+ end
359
+ hash
360
+ end
361
+
362
+ # Outputs non-array value in the form of hash
363
+ # For object, use to_hash. Otherwise, just return the value
364
+ # @param [Object] value Any valid value
365
+ # @return [Hash] Returns the value in the form of hash
366
+ def _to_hash(value)
367
+ if value.is_a?(Array)
368
+ value.compact.map{ |v| _to_hash(v) }
369
+ elsif value.is_a?(Hash)
370
+ {}.tap do |hash|
371
+ value.each { |k, v| hash[k] = _to_hash(v) }
372
+ end
373
+ elsif value.respond_to? :to_hash
374
+ value.to_hash
375
+ else
376
+ value
377
+ end
378
+ end
379
+
380
+ end
381
+
382
+ end