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.
- checksums.yaml +4 -4
- data/Gemfile.lock +31 -0
- data/lib/wallee-ruby-sdk/version.rb +1 -1
- data/lib/wallee.rb +332 -0
- data/lib/wallee/api_client.rb +403 -0
- data/lib/wallee/api_error.rb +47 -0
- data/lib/wallee/configuration.rb +144 -0
- data/lib/wallee/models/account.rb +298 -0
- data/lib/wallee/models/account_create.rb +308 -0
- data/lib/wallee/models/account_state.rb +47 -0
- data/lib/wallee/models/account_type.rb +44 -0
- data/lib/wallee/models/account_update.rb +308 -0
- data/lib/wallee/models/address.rb +388 -0
- data/lib/wallee/models/address_create.rb +388 -0
- data/lib/wallee/models/application_user.rb +268 -0
- data/lib/wallee/models/application_user_create.rb +283 -0
- data/lib/wallee/models/application_user_create_with_mac_key.rb +278 -0
- data/lib/wallee/models/application_user_update.rb +278 -0
- data/lib/wallee/models/attachment_resource.rb +210 -0
- data/lib/wallee/models/charge.rb +318 -0
- data/lib/wallee/models/charge_attempt.rb +420 -0
- data/lib/wallee/models/charge_attempt_environment.rb +43 -0
- data/lib/wallee/models/charge_attempt_state.rb +44 -0
- data/lib/wallee/models/charge_flow.rb +270 -0
- data/lib/wallee/models/charge_flow_level.rb +318 -0
- data/lib/wallee/models/charge_flow_level_configuration.rb +288 -0
- data/lib/wallee/models/charge_flow_level_configuration_type.rb +222 -0
- data/lib/wallee/models/charge_flow_level_state.rb +44 -0
- data/lib/wallee/models/charge_state.rb +44 -0
- data/lib/wallee/models/charge_type.rb +44 -0
- data/lib/wallee/models/client_error.rb +238 -0
- data/lib/wallee/models/client_error_type.rb +44 -0
- data/lib/wallee/models/condition.rb +258 -0
- data/lib/wallee/models/condition_type.rb +222 -0
- data/lib/wallee/models/connector_invocation.rb +278 -0
- data/lib/wallee/models/connector_invocation_stage.rb +45 -0
- data/lib/wallee/models/creation_entity_state.rb +46 -0
- data/lib/wallee/models/criteria_operator.rb +50 -0
- data/lib/wallee/models/customers_presence.rb +44 -0
- data/lib/wallee/models/data_collection_type.rb +43 -0
- data/lib/wallee/models/database_translated_string.rb +222 -0
- data/lib/wallee/models/database_translated_string_create.rb +222 -0
- data/lib/wallee/models/database_translated_string_item.rb +218 -0
- data/lib/wallee/models/database_translated_string_item_create.rb +223 -0
- data/lib/wallee/models/delivery_indication.rb +318 -0
- data/lib/wallee/models/delivery_indication_decision_reason.rb +222 -0
- data/lib/wallee/models/delivery_indication_state.rb +45 -0
- data/lib/wallee/models/document_template.rb +278 -0
- data/lib/wallee/models/document_template_type.rb +242 -0
- data/lib/wallee/models/email_sender.rb +278 -0
- data/lib/wallee/models/email_sender_type.rb +232 -0
- data/lib/wallee/models/email_template.rb +324 -0
- data/lib/wallee/models/email_template_type.rb +288 -0
- data/lib/wallee/models/entity_query.rb +240 -0
- data/lib/wallee/models/entity_query_filter.rb +245 -0
- data/lib/wallee/models/entity_query_filter_type.rb +44 -0
- data/lib/wallee/models/entity_query_order_by.rb +208 -0
- data/lib/wallee/models/entity_query_order_by_type.rb +43 -0
- data/lib/wallee/models/entity_reference.rb +188 -0
- data/lib/wallee/models/failure_category.rb +46 -0
- data/lib/wallee/models/failure_reason.rb +244 -0
- data/lib/wallee/models/feature.rb +274 -0
- data/lib/wallee/models/gender.rb +43 -0
- data/lib/wallee/models/human_user.rb +318 -0
- data/lib/wallee/models/human_user_create.rb +328 -0
- data/lib/wallee/models/human_user_update.rb +328 -0
- data/lib/wallee/models/installment_calculated_plan.rb +242 -0
- data/lib/wallee/models/installment_calculated_slice.rb +220 -0
- data/lib/wallee/models/installment_payment.rb +280 -0
- data/lib/wallee/models/installment_payment_slice.rb +300 -0
- data/lib/wallee/models/installment_payment_slice_state.rb +48 -0
- data/lib/wallee/models/installment_payment_state.rb +49 -0
- data/lib/wallee/models/installment_plan_configuration.rb +362 -0
- data/lib/wallee/models/installment_plan_slice_configuration.rb +288 -0
- data/lib/wallee/models/label.rb +238 -0
- data/lib/wallee/models/label_descriptor.rb +274 -0
- data/lib/wallee/models/label_descriptor_category.rb +43 -0
- data/lib/wallee/models/label_descriptor_group.rb +232 -0
- data/lib/wallee/models/label_descriptor_type.rb +222 -0
- data/lib/wallee/models/legal_organization_form.rb +242 -0
- data/lib/wallee/models/line_item.rb +342 -0
- data/lib/wallee/models/line_item_attribute.rb +208 -0
- data/lib/wallee/models/line_item_attribute_create.rb +208 -0
- data/lib/wallee/models/line_item_create.rb +367 -0
- data/lib/wallee/models/line_item_reduction.rb +218 -0
- data/lib/wallee/models/line_item_reduction_create.rb +233 -0
- data/lib/wallee/models/line_item_type.rb +45 -0
- data/lib/wallee/models/localized_string.rb +218 -0
- data/lib/wallee/models/manual_task.rb +290 -0
- data/lib/wallee/models/manual_task_action.rb +230 -0
- data/lib/wallee/models/manual_task_action_style.rb +44 -0
- data/lib/wallee/models/manual_task_state.rb +44 -0
- data/lib/wallee/models/manual_task_type.rb +234 -0
- data/lib/wallee/models/one_click_payment_mode.rb +44 -0
- data/lib/wallee/models/payment_connector.rb +306 -0
- data/lib/wallee/models/payment_connector_configuration.rb +322 -0
- data/lib/wallee/models/payment_connector_feature.rb +218 -0
- data/lib/wallee/models/payment_method.rb +256 -0
- data/lib/wallee/models/payment_method_brand.rb +252 -0
- data/lib/wallee/models/payment_method_configuration.rb +328 -0
- data/lib/wallee/models/payment_primary_risk_taker.rb +44 -0
- data/lib/wallee/models/payment_processor.rb +278 -0
- data/lib/wallee/models/payment_processor_configuration.rb +258 -0
- data/lib/wallee/models/permission.rb +286 -0
- data/lib/wallee/models/persistable_currency_amount.rb +208 -0
- data/lib/wallee/models/persistable_currency_amount_update.rb +208 -0
- data/lib/wallee/models/product_fee_type.rb +44 -0
- data/lib/wallee/models/product_metered_fee.rb +278 -0
- data/lib/wallee/models/product_metered_fee_update.rb +288 -0
- data/lib/wallee/models/product_metered_tier_fee.rb +240 -0
- data/lib/wallee/models/product_metered_tier_fee_update.rb +250 -0
- data/lib/wallee/models/product_metered_tier_pricing.rb +43 -0
- data/lib/wallee/models/product_period_fee.rb +280 -0
- data/lib/wallee/models/product_period_fee_update.rb +290 -0
- data/lib/wallee/models/product_setup_fee.rb +294 -0
- data/lib/wallee/models/product_setup_fee_update.rb +304 -0
- data/lib/wallee/models/refund.rb +450 -0
- data/lib/wallee/models/refund_create.rb +470 -0
- data/lib/wallee/models/refund_state.rb +46 -0
- data/lib/wallee/models/refund_type.rb +45 -0
- data/lib/wallee/models/rendered_document.rb +230 -0
- data/lib/wallee/models/resource_path.rb +258 -0
- data/lib/wallee/models/resource_state.rb +44 -0
- data/lib/wallee/models/rest_country.rb +240 -0
- data/lib/wallee/models/rest_country_state.rb +228 -0
- data/lib/wallee/models/rest_currency.rb +218 -0
- data/lib/wallee/models/rest_language.rb +248 -0
- data/lib/wallee/models/scope.rb +302 -0
- data/lib/wallee/models/server_error.rb +218 -0
- data/lib/wallee/models/space.rb +330 -0
- data/lib/wallee/models/space_address.rb +318 -0
- data/lib/wallee/models/space_address_setter.rb +318 -0
- data/lib/wallee/models/space_create.rb +350 -0
- data/lib/wallee/models/space_reference.rb +258 -0
- data/lib/wallee/models/space_reference_state.rb +46 -0
- data/lib/wallee/models/space_update.rb +340 -0
- data/lib/wallee/models/space_view.rb +258 -0
- data/lib/wallee/models/static_value.rb +234 -0
- data/lib/wallee/models/subscriber.rb +332 -0
- data/lib/wallee/models/subscriber_active.rb +342 -0
- data/lib/wallee/models/subscriber_create.rb +347 -0
- data/lib/wallee/models/subscriber_update.rb +342 -0
- data/lib/wallee/models/subscription.rb +338 -0
- data/lib/wallee/models/subscription_change_request.rb +250 -0
- data/lib/wallee/models/subscription_charge.rb +390 -0
- data/lib/wallee/models/subscription_charge_create.rb +405 -0
- data/lib/wallee/models/subscription_charge_processing_type.rb +43 -0
- data/lib/wallee/models/subscription_charge_state.rb +46 -0
- data/lib/wallee/models/subscription_charge_type.rb +43 -0
- data/lib/wallee/models/subscription_create_request.rb +245 -0
- data/lib/wallee/models/subscription_ledger_entry.rb +350 -0
- data/lib/wallee/models/subscription_ledger_entry_create.rb +375 -0
- data/lib/wallee/models/subscription_ledger_entry_state.rb +44 -0
- data/lib/wallee/models/subscription_metric.rb +268 -0
- data/lib/wallee/models/subscription_metric_active.rb +278 -0
- data/lib/wallee/models/subscription_metric_create.rb +288 -0
- data/lib/wallee/models/subscription_metric_type.rb +232 -0
- data/lib/wallee/models/subscription_metric_update.rb +278 -0
- data/lib/wallee/models/subscription_metric_usage_report.rb +298 -0
- data/lib/wallee/models/subscription_metric_usage_report_create.rb +318 -0
- data/lib/wallee/models/subscription_pending.rb +348 -0
- data/lib/wallee/models/subscription_period_bill.rb +298 -0
- data/lib/wallee/models/subscription_period_bill_state.rb +43 -0
- data/lib/wallee/models/subscription_product.rb +300 -0
- data/lib/wallee/models/subscription_product_active.rb +310 -0
- data/lib/wallee/models/subscription_product_component.rb +298 -0
- data/lib/wallee/models/subscription_product_component_group.rb +258 -0
- data/lib/wallee/models/subscription_product_component_group_update.rb +268 -0
- data/lib/wallee/models/subscription_product_component_reference.rb +258 -0
- data/lib/wallee/models/subscription_product_component_reference_state.rb +45 -0
- data/lib/wallee/models/subscription_product_component_update.rb +308 -0
- data/lib/wallee/models/subscription_product_create.rb +315 -0
- data/lib/wallee/models/subscription_product_retirement.rb +258 -0
- data/lib/wallee/models/subscription_product_retirement_create.rb +263 -0
- data/lib/wallee/models/subscription_product_state.rb +46 -0
- data/lib/wallee/models/subscription_product_version.rb +390 -0
- data/lib/wallee/models/subscription_product_version_pending.rb +310 -0
- data/lib/wallee/models/subscription_product_version_retirement.rb +258 -0
- data/lib/wallee/models/subscription_product_version_retirement_create.rb +263 -0
- data/lib/wallee/models/subscription_product_version_state.rb +46 -0
- data/lib/wallee/models/subscription_state.rb +48 -0
- data/lib/wallee/models/subscription_suspension.rb +328 -0
- data/lib/wallee/models/subscription_suspension_action.rb +43 -0
- data/lib/wallee/models/subscription_suspension_create.rb +343 -0
- data/lib/wallee/models/subscription_suspension_reason.rb +44 -0
- data/lib/wallee/models/subscription_suspension_running.rb +328 -0
- data/lib/wallee/models/subscription_suspension_state.rb +43 -0
- data/lib/wallee/models/subscription_update.rb +348 -0
- data/lib/wallee/models/subscription_version.rb +370 -0
- data/lib/wallee/models/subscription_version_state.rb +47 -0
- data/lib/wallee/models/tax.rb +208 -0
- data/lib/wallee/models/tax_class.rb +258 -0
- data/lib/wallee/models/tax_create.rb +218 -0
- data/lib/wallee/models/tenant_database.rb +218 -0
- data/lib/wallee/models/token.rb +308 -0
- data/lib/wallee/models/token_create.rb +323 -0
- data/lib/wallee/models/token_update.rb +318 -0
- data/lib/wallee/models/token_version.rb +360 -0
- data/lib/wallee/models/token_version_state.rb +44 -0
- data/lib/wallee/models/transaction.rb +626 -0
- data/lib/wallee/models/transaction_aware_entity.rb +218 -0
- data/lib/wallee/models/transaction_completion.rb +390 -0
- data/lib/wallee/models/transaction_completion_mode.rb +44 -0
- data/lib/wallee/models/transaction_completion_state.rb +45 -0
- data/lib/wallee/models/transaction_create.rb +646 -0
- data/lib/wallee/models/transaction_group.rb +268 -0
- data/lib/wallee/models/transaction_group_state.rb +44 -0
- data/lib/wallee/models/transaction_invoice.rb +380 -0
- data/lib/wallee/models/transaction_invoice_replacement.rb +250 -0
- data/lib/wallee/models/transaction_invoice_state.rb +48 -0
- data/lib/wallee/models/transaction_line_item_update_request.rb +215 -0
- data/lib/wallee/models/transaction_line_item_version.rb +320 -0
- data/lib/wallee/models/transaction_pending.rb +636 -0
- data/lib/wallee/models/transaction_state.rb +51 -0
- data/lib/wallee/models/transaction_user_interface_type.rb +44 -0
- data/lib/wallee/models/transaction_void.rb +380 -0
- data/lib/wallee/models/transaction_void_mode.rb +43 -0
- data/lib/wallee/models/transaction_void_state.rb +45 -0
- data/lib/wallee/models/user.rb +248 -0
- data/lib/wallee/models/user_type.rb +45 -0
- data/lib/wallee/models/webhook_identity.rb +248 -0
- data/lib/wallee/models/webhook_listener.rb +300 -0
- data/lib/wallee/models/webhook_listener_create.rb +330 -0
- data/lib/wallee/models/webhook_listener_entity.rb +220 -0
- data/lib/wallee/models/webhook_listener_update.rb +310 -0
- data/lib/wallee/models/webhook_url.rb +258 -0
- data/lib/wallee/models/webhook_url_create.rb +273 -0
- data/lib/wallee/models/webhook_url_update.rb +268 -0
- data/lib/wallee/services/account_service_api.rb +372 -0
- data/lib/wallee/services/application_user_service_api.rb +372 -0
- data/lib/wallee/services/charge_attempt_service_api.rb +217 -0
- data/lib/wallee/services/charge_flow_level_service_api.rb +280 -0
- data/lib/wallee/services/charge_flow_service_api.rb +352 -0
- data/lib/wallee/services/condition_type_service_api.rb +143 -0
- data/lib/wallee/services/country_service_api.rb +85 -0
- data/lib/wallee/services/country_state_service_api.rb +143 -0
- data/lib/wallee/services/currency_service_api.rb +85 -0
- data/lib/wallee/services/delivery_indication_service_api.rb +341 -0
- data/lib/wallee/services/document_template_service_api.rb +217 -0
- data/lib/wallee/services/document_template_type_service_api.rb +143 -0
- data/lib/wallee/services/email_sender_service_api.rb +219 -0
- data/lib/wallee/services/email_sender_type_service_api.rb +143 -0
- data/lib/wallee/services/email_template_service_api.rb +217 -0
- data/lib/wallee/services/email_template_type_service_api.rb +143 -0
- data/lib/wallee/services/human_user_service_api.rb +372 -0
- data/lib/wallee/services/installment_payment_service_api.rb +287 -0
- data/lib/wallee/services/installment_payment_slice_service_api.rb +219 -0
- data/lib/wallee/services/installment_plan_calculation_service_api.rb +95 -0
- data/lib/wallee/services/installment_plan_configuration_service_api.rb +219 -0
- data/lib/wallee/services/installment_plan_slice_configuration_service_api.rb +219 -0
- data/lib/wallee/services/label_description_group_service_api.rb +143 -0
- data/lib/wallee/services/label_description_service_api.rb +143 -0
- data/lib/wallee/services/language_service_api.rb +85 -0
- data/lib/wallee/services/manual_task_service_api.rb +217 -0
- data/lib/wallee/services/payment_connector_configuration_service_api.rb +217 -0
- data/lib/wallee/services/payment_connector_service_api.rb +143 -0
- data/lib/wallee/services/payment_method_configuration_service_api.rb +217 -0
- data/lib/wallee/services/payment_method_service_api.rb +143 -0
- data/lib/wallee/services/payment_processor_configuration_service_api.rb +217 -0
- data/lib/wallee/services/payment_processor_service_api.rb +143 -0
- data/lib/wallee/services/permission_service_api.rb +143 -0
- data/lib/wallee/services/refund_service_api.rb +468 -0
- data/lib/wallee/services/space_service_api.rb +372 -0
- data/lib/wallee/services/static_value_service_api.rb +143 -0
- data/lib/wallee/services/subscriber_service_api.rb +402 -0
- data/lib/wallee/services/subscription_charge_service_api.rb +342 -0
- data/lib/wallee/services/subscription_ledger_entry_service_api.rb +279 -0
- data/lib/wallee/services/subscription_metric_service_api.rb +402 -0
- data/lib/wallee/services/subscription_metric_usage_service_api.rb +279 -0
- data/lib/wallee/services/subscription_period_bill_service_api.rb +217 -0
- data/lib/wallee/services/subscription_product_component_group_service_api.rb +402 -0
- data/lib/wallee/services/subscription_product_component_service_api.rb +402 -0
- data/lib/wallee/services/subscription_product_fee_tier_service_api.rb +402 -0
- data/lib/wallee/services/subscription_product_metered_fee_service_api.rb +402 -0
- data/lib/wallee/services/subscription_product_period_fee_service_api.rb +402 -0
- data/lib/wallee/services/subscription_product_retirement_service_api.rb +279 -0
- data/lib/wallee/services/subscription_product_service_api.rb +341 -0
- data/lib/wallee/services/subscription_product_setup_fee_service_api.rb +402 -0
- data/lib/wallee/services/subscription_product_version_retirement_service_api.rb +279 -0
- data/lib/wallee/services/subscription_product_version_service_api.rb +404 -0
- data/lib/wallee/services/subscription_service_api.rb +608 -0
- data/lib/wallee/services/subscription_suspension_service_api.rb +342 -0
- data/lib/wallee/services/subscription_version_service_api.rb +217 -0
- data/lib/wallee/services/token_service_api.rb +402 -0
- data/lib/wallee/services/token_version_service_api.rb +280 -0
- data/lib/wallee/services/transaction_completion_service_api.rb +343 -0
- data/lib/wallee/services/transaction_invoice_service_api.rb +473 -0
- data/lib/wallee/services/transaction_service_api.rb +1263 -0
- data/lib/wallee/services/transaction_void_service_api.rb +343 -0
- data/lib/wallee/services/webhook_listener_service_api.rb +402 -0
- data/lib/wallee/services/webhook_url_service_api.rb +402 -0
- data/lib/wallee/version.rb +24 -0
- metadata +292 -2
@@ -0,0 +1,268 @@
|
|
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 TransactionGroup
|
27
|
+
#
|
28
|
+
attr_accessor :begin_date
|
29
|
+
|
30
|
+
#
|
31
|
+
attr_accessor :customer_id
|
32
|
+
|
33
|
+
#
|
34
|
+
attr_accessor :end_date
|
35
|
+
|
36
|
+
# The ID is the primary key of the entity. The ID identifies the entity uniquely.
|
37
|
+
attr_accessor :id
|
38
|
+
|
39
|
+
# The linked space id holds the ID of the space to which the entity belongs to.
|
40
|
+
attr_accessor :linked_space_id
|
41
|
+
|
42
|
+
# The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed.
|
43
|
+
attr_accessor :planned_purge_date
|
44
|
+
|
45
|
+
#
|
46
|
+
attr_accessor :state
|
47
|
+
|
48
|
+
# The version number indicates the version of the entity. The version is incremented whenever the entity is changed.
|
49
|
+
attr_accessor :version
|
50
|
+
|
51
|
+
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
+
def self.attribute_map
|
54
|
+
{
|
55
|
+
:'begin_date' => :'beginDate',
|
56
|
+
:'customer_id' => :'customerId',
|
57
|
+
:'end_date' => :'endDate',
|
58
|
+
:'id' => :'id',
|
59
|
+
:'linked_space_id' => :'linkedSpaceId',
|
60
|
+
:'planned_purge_date' => :'plannedPurgeDate',
|
61
|
+
:'state' => :'state',
|
62
|
+
:'version' => :'version'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# Attribute type mapping.
|
67
|
+
def self.swagger_types
|
68
|
+
{
|
69
|
+
:'begin_date' => :'DateTime',
|
70
|
+
:'customer_id' => :'String',
|
71
|
+
:'end_date' => :'DateTime',
|
72
|
+
:'id' => :'Integer',
|
73
|
+
:'linked_space_id' => :'Integer',
|
74
|
+
:'planned_purge_date' => :'DateTime',
|
75
|
+
:'state' => :'TransactionGroupState',
|
76
|
+
:'version' => :'Integer'
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
# Initializes the object
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
def initialize(attributes = {})
|
83
|
+
return unless attributes.is_a?(Hash)
|
84
|
+
|
85
|
+
# convert string to symbol for hash key
|
86
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
87
|
+
|
88
|
+
if attributes.has_key?(:'beginDate')
|
89
|
+
self.begin_date = attributes[:'beginDate']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.has_key?(:'customerId')
|
93
|
+
self.customer_id = attributes[:'customerId']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.has_key?(:'endDate')
|
97
|
+
self.end_date = attributes[:'endDate']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.has_key?(:'id')
|
101
|
+
self.id = attributes[:'id']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.has_key?(:'linkedSpaceId')
|
105
|
+
self.linked_space_id = attributes[:'linkedSpaceId']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.has_key?(:'plannedPurgeDate')
|
109
|
+
self.planned_purge_date = attributes[:'plannedPurgeDate']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.has_key?(:'state')
|
113
|
+
self.state = attributes[:'state']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.has_key?(:'version')
|
117
|
+
self.version = attributes[:'version']
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
123
|
+
# @return Array for valid properies with the reasons
|
124
|
+
def list_invalid_properties
|
125
|
+
invalid_properties = Array.new
|
126
|
+
return invalid_properties
|
127
|
+
end
|
128
|
+
|
129
|
+
# Check to see if the all the properties in the model are valid
|
130
|
+
# @return true if the model is valid
|
131
|
+
def valid?
|
132
|
+
return true
|
133
|
+
end
|
134
|
+
|
135
|
+
# Checks equality by comparing each attribute.
|
136
|
+
# @param [Object] Object to be compared
|
137
|
+
def ==(o)
|
138
|
+
return true if self.equal?(o)
|
139
|
+
self.class == o.class &&
|
140
|
+
begin_date == o.begin_date &&
|
141
|
+
customer_id == o.customer_id &&
|
142
|
+
end_date == o.end_date &&
|
143
|
+
id == o.id &&
|
144
|
+
linked_space_id == o.linked_space_id &&
|
145
|
+
planned_purge_date == o.planned_purge_date &&
|
146
|
+
state == o.state &&
|
147
|
+
version == o.version
|
148
|
+
end
|
149
|
+
|
150
|
+
# @see the `==` method
|
151
|
+
# @param [Object] Object to be compared
|
152
|
+
def eql?(o)
|
153
|
+
self == o
|
154
|
+
end
|
155
|
+
|
156
|
+
# Calculates hash code according to all attributes.
|
157
|
+
# @return [Fixnum] Hash code
|
158
|
+
def hash
|
159
|
+
[begin_date, customer_id, end_date, id, linked_space_id, planned_purge_date, state, version].hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Builds the object from hash
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
164
|
+
# @return [Object] Returns the model itself
|
165
|
+
def build_from_hash(attributes)
|
166
|
+
return nil unless attributes.is_a?(Hash)
|
167
|
+
self.class.swagger_types.each_pair do |key, type|
|
168
|
+
if type =~ /\AArray<(.*)>/i
|
169
|
+
# check to ensure the input is an array given that the the attribute
|
170
|
+
# is documented as an array but the input is not
|
171
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
172
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
173
|
+
end
|
174
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
175
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
176
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
177
|
+
end
|
178
|
+
|
179
|
+
self
|
180
|
+
end
|
181
|
+
|
182
|
+
# Deserializes the data based on type
|
183
|
+
# @param string type Data type
|
184
|
+
# @param string value Value to be deserialized
|
185
|
+
# @return [Object] Deserialized data
|
186
|
+
def _deserialize(type, value)
|
187
|
+
case type.to_sym
|
188
|
+
when :DateTime
|
189
|
+
DateTime.parse(value)
|
190
|
+
when :Date
|
191
|
+
Date.parse(value)
|
192
|
+
when :String
|
193
|
+
value.to_s
|
194
|
+
when :Integer
|
195
|
+
value.to_i
|
196
|
+
when :Float
|
197
|
+
value.to_f
|
198
|
+
when :BOOLEAN
|
199
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
200
|
+
true
|
201
|
+
else
|
202
|
+
false
|
203
|
+
end
|
204
|
+
when :Object
|
205
|
+
# generic object (usually a Hash), return directly
|
206
|
+
value
|
207
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
208
|
+
inner_type = Regexp.last_match[:inner_type]
|
209
|
+
value.map { |v| _deserialize(inner_type, v) }
|
210
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
211
|
+
k_type = Regexp.last_match[:k_type]
|
212
|
+
v_type = Regexp.last_match[:v_type]
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each do |k, v|
|
215
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
else # model
|
219
|
+
temp_model = Wallee.const_get(type).new
|
220
|
+
temp_model.build_from_hash(value)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the string representation of the object
|
225
|
+
# @return [String] String presentation of the object
|
226
|
+
def to_s
|
227
|
+
to_hash.to_s
|
228
|
+
end
|
229
|
+
|
230
|
+
# to_body is an alias to to_hash (backward compatibility)
|
231
|
+
# @return [Hash] Returns the object in the form of hash
|
232
|
+
def to_body
|
233
|
+
to_hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Returns the object in the form of hash
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
238
|
+
def to_hash
|
239
|
+
hash = {}
|
240
|
+
self.class.attribute_map.each_pair do |attr, param|
|
241
|
+
value = self.send(attr)
|
242
|
+
next if value.nil?
|
243
|
+
hash[param] = _to_hash(value)
|
244
|
+
end
|
245
|
+
hash
|
246
|
+
end
|
247
|
+
|
248
|
+
# Outputs non-array value in the form of hash
|
249
|
+
# For object, use to_hash. Otherwise, just return the value
|
250
|
+
# @param [Object] value Any valid value
|
251
|
+
# @return [Hash] Returns the value in the form of hash
|
252
|
+
def _to_hash(value)
|
253
|
+
if value.is_a?(Array)
|
254
|
+
value.compact.map{ |v| _to_hash(v) }
|
255
|
+
elsif value.is_a?(Hash)
|
256
|
+
{}.tap do |hash|
|
257
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
258
|
+
end
|
259
|
+
elsif value.respond_to? :to_hash
|
260
|
+
value.to_hash
|
261
|
+
else
|
262
|
+
value
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
end
|
267
|
+
|
268
|
+
end
|
@@ -0,0 +1,44 @@
|
|
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
|
+
class TransactionGroupState
|
26
|
+
|
27
|
+
PENDING = "PENDING".freeze
|
28
|
+
FAILED = "FAILED".freeze
|
29
|
+
SUCCESSFUL = "SUCCESSFUL".freeze
|
30
|
+
|
31
|
+
# Builds the object from hash
|
32
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
33
|
+
# @return [Object] Returns the model itself
|
34
|
+
def build_from_hash(value)
|
35
|
+
|
36
|
+
consantValues = TransactionGroupState.constants.select{|c| c.to_s == value}
|
37
|
+
raise "Invalid ENUM value #{value} for class #TransactionGroupState" if consantValues.empty?
|
38
|
+
|
39
|
+
value
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,380 @@
|
|
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 transaction invoice represents the invoice document for a particular transaction.
|
26
|
+
class TransactionInvoice
|
27
|
+
# The ID is the primary key of the entity. The ID identifies the entity uniquely.
|
28
|
+
attr_accessor :id
|
29
|
+
|
30
|
+
# The linked space id holds the ID of the space to which the entity belongs to.
|
31
|
+
attr_accessor :linked_space_id
|
32
|
+
|
33
|
+
#
|
34
|
+
attr_accessor :linked_transaction
|
35
|
+
|
36
|
+
#
|
37
|
+
attr_accessor :amount
|
38
|
+
|
39
|
+
#
|
40
|
+
attr_accessor :completion
|
41
|
+
|
42
|
+
# The date on which the invoice is created on.
|
43
|
+
attr_accessor :created_on
|
44
|
+
|
45
|
+
# The date on which the invoice is marked as derecognized.
|
46
|
+
attr_accessor :derecognized_on
|
47
|
+
|
48
|
+
# The date on which the invoice should be paid on.
|
49
|
+
attr_accessor :due_on
|
50
|
+
|
51
|
+
#
|
52
|
+
attr_accessor :external_id
|
53
|
+
|
54
|
+
#
|
55
|
+
attr_accessor :language
|
56
|
+
|
57
|
+
#
|
58
|
+
attr_accessor :line_items
|
59
|
+
|
60
|
+
#
|
61
|
+
attr_accessor :merchant_reference
|
62
|
+
|
63
|
+
# The outstanding amount indicates how much the buyer owes the merchant. A negative amount indicates that the invoice is overpaid.
|
64
|
+
attr_accessor :outstanding_amount
|
65
|
+
|
66
|
+
# The date on which the invoice is marked as paid. Eventually this date lags behind of the actual paid date.
|
67
|
+
attr_accessor :paid_on
|
68
|
+
|
69
|
+
# The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed.
|
70
|
+
attr_accessor :planned_purge_date
|
71
|
+
|
72
|
+
#
|
73
|
+
attr_accessor :space_view_id
|
74
|
+
|
75
|
+
#
|
76
|
+
attr_accessor :state
|
77
|
+
|
78
|
+
#
|
79
|
+
attr_accessor :tax_amount
|
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
|
+
:'id' => :'id',
|
89
|
+
:'linked_space_id' => :'linkedSpaceId',
|
90
|
+
:'linked_transaction' => :'linkedTransaction',
|
91
|
+
:'amount' => :'amount',
|
92
|
+
:'completion' => :'completion',
|
93
|
+
:'created_on' => :'createdOn',
|
94
|
+
:'derecognized_on' => :'derecognizedOn',
|
95
|
+
:'due_on' => :'dueOn',
|
96
|
+
:'external_id' => :'externalId',
|
97
|
+
:'language' => :'language',
|
98
|
+
:'line_items' => :'lineItems',
|
99
|
+
:'merchant_reference' => :'merchantReference',
|
100
|
+
:'outstanding_amount' => :'outstandingAmount',
|
101
|
+
:'paid_on' => :'paidOn',
|
102
|
+
:'planned_purge_date' => :'plannedPurgeDate',
|
103
|
+
:'space_view_id' => :'spaceViewId',
|
104
|
+
:'state' => :'state',
|
105
|
+
:'tax_amount' => :'taxAmount',
|
106
|
+
:'version' => :'version'
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
110
|
+
# Attribute type mapping.
|
111
|
+
def self.swagger_types
|
112
|
+
{
|
113
|
+
:'id' => :'Integer',
|
114
|
+
:'linked_space_id' => :'Integer',
|
115
|
+
:'linked_transaction' => :'Integer',
|
116
|
+
:'amount' => :'Float',
|
117
|
+
:'completion' => :'TransactionCompletion',
|
118
|
+
:'created_on' => :'DateTime',
|
119
|
+
:'derecognized_on' => :'DateTime',
|
120
|
+
:'due_on' => :'DateTime',
|
121
|
+
:'external_id' => :'String',
|
122
|
+
:'language' => :'String',
|
123
|
+
:'line_items' => :'Array<LineItem>',
|
124
|
+
:'merchant_reference' => :'String',
|
125
|
+
:'outstanding_amount' => :'Float',
|
126
|
+
:'paid_on' => :'DateTime',
|
127
|
+
:'planned_purge_date' => :'DateTime',
|
128
|
+
:'space_view_id' => :'Integer',
|
129
|
+
:'state' => :'TransactionInvoiceState',
|
130
|
+
:'tax_amount' => :'Float',
|
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?(:'id')
|
144
|
+
self.id = attributes[:'id']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.has_key?(:'linkedSpaceId')
|
148
|
+
self.linked_space_id = attributes[:'linkedSpaceId']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.has_key?(:'linkedTransaction')
|
152
|
+
self.linked_transaction = attributes[:'linkedTransaction']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.has_key?(:'amount')
|
156
|
+
self.amount = attributes[:'amount']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.has_key?(:'completion')
|
160
|
+
self.completion = attributes[:'completion']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.has_key?(:'createdOn')
|
164
|
+
self.created_on = attributes[:'createdOn']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.has_key?(:'derecognizedOn')
|
168
|
+
self.derecognized_on = attributes[:'derecognizedOn']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.has_key?(:'dueOn')
|
172
|
+
self.due_on = attributes[:'dueOn']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.has_key?(:'externalId')
|
176
|
+
self.external_id = attributes[:'externalId']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.has_key?(:'language')
|
180
|
+
self.language = attributes[:'language']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.has_key?(:'lineItems')
|
184
|
+
if (value = attributes[:'lineItems']).is_a?(Array)
|
185
|
+
self.line_items = value
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.has_key?(:'merchantReference')
|
190
|
+
self.merchant_reference = attributes[:'merchantReference']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.has_key?(:'outstandingAmount')
|
194
|
+
self.outstanding_amount = attributes[:'outstandingAmount']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.has_key?(:'paidOn')
|
198
|
+
self.paid_on = attributes[:'paidOn']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.has_key?(:'plannedPurgeDate')
|
202
|
+
self.planned_purge_date = attributes[:'plannedPurgeDate']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.has_key?(:'spaceViewId')
|
206
|
+
self.space_view_id = attributes[:'spaceViewId']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.has_key?(:'state')
|
210
|
+
self.state = attributes[:'state']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.has_key?(:'taxAmount')
|
214
|
+
self.tax_amount = attributes[:'taxAmount']
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.has_key?(:'version')
|
218
|
+
self.version = attributes[:'version']
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
224
|
+
# @return Array for valid properies with the reasons
|
225
|
+
def list_invalid_properties
|
226
|
+
invalid_properties = Array.new
|
227
|
+
return invalid_properties
|
228
|
+
end
|
229
|
+
|
230
|
+
# Check to see if the all the properties in the model are valid
|
231
|
+
# @return true if the model is valid
|
232
|
+
def valid?
|
233
|
+
return true
|
234
|
+
end
|
235
|
+
|
236
|
+
# Checks equality by comparing each attribute.
|
237
|
+
# @param [Object] Object to be compared
|
238
|
+
def ==(o)
|
239
|
+
return true if self.equal?(o)
|
240
|
+
self.class == o.class &&
|
241
|
+
id == o.id &&
|
242
|
+
linked_space_id == o.linked_space_id &&
|
243
|
+
linked_transaction == o.linked_transaction &&
|
244
|
+
amount == o.amount &&
|
245
|
+
completion == o.completion &&
|
246
|
+
created_on == o.created_on &&
|
247
|
+
derecognized_on == o.derecognized_on &&
|
248
|
+
due_on == o.due_on &&
|
249
|
+
external_id == o.external_id &&
|
250
|
+
language == o.language &&
|
251
|
+
line_items == o.line_items &&
|
252
|
+
merchant_reference == o.merchant_reference &&
|
253
|
+
outstanding_amount == o.outstanding_amount &&
|
254
|
+
paid_on == o.paid_on &&
|
255
|
+
planned_purge_date == o.planned_purge_date &&
|
256
|
+
space_view_id == o.space_view_id &&
|
257
|
+
state == o.state &&
|
258
|
+
tax_amount == o.tax_amount &&
|
259
|
+
version == o.version
|
260
|
+
end
|
261
|
+
|
262
|
+
# @see the `==` method
|
263
|
+
# @param [Object] Object to be compared
|
264
|
+
def eql?(o)
|
265
|
+
self == o
|
266
|
+
end
|
267
|
+
|
268
|
+
# Calculates hash code according to all attributes.
|
269
|
+
# @return [Fixnum] Hash code
|
270
|
+
def hash
|
271
|
+
[id, linked_space_id, linked_transaction, amount, completion, created_on, derecognized_on, due_on, external_id, language, line_items, merchant_reference, outstanding_amount, paid_on, planned_purge_date, space_view_id, state, tax_amount, version].hash
|
272
|
+
end
|
273
|
+
|
274
|
+
# Builds the object from hash
|
275
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
276
|
+
# @return [Object] Returns the model itself
|
277
|
+
def build_from_hash(attributes)
|
278
|
+
return nil unless attributes.is_a?(Hash)
|
279
|
+
self.class.swagger_types.each_pair do |key, type|
|
280
|
+
if type =~ /\AArray<(.*)>/i
|
281
|
+
# check to ensure the input is an array given that the the attribute
|
282
|
+
# is documented as an array but the input is not
|
283
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
284
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
285
|
+
end
|
286
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
287
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
288
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
289
|
+
end
|
290
|
+
|
291
|
+
self
|
292
|
+
end
|
293
|
+
|
294
|
+
# Deserializes the data based on type
|
295
|
+
# @param string type Data type
|
296
|
+
# @param string value Value to be deserialized
|
297
|
+
# @return [Object] Deserialized data
|
298
|
+
def _deserialize(type, value)
|
299
|
+
case type.to_sym
|
300
|
+
when :DateTime
|
301
|
+
DateTime.parse(value)
|
302
|
+
when :Date
|
303
|
+
Date.parse(value)
|
304
|
+
when :String
|
305
|
+
value.to_s
|
306
|
+
when :Integer
|
307
|
+
value.to_i
|
308
|
+
when :Float
|
309
|
+
value.to_f
|
310
|
+
when :BOOLEAN
|
311
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
312
|
+
true
|
313
|
+
else
|
314
|
+
false
|
315
|
+
end
|
316
|
+
when :Object
|
317
|
+
# generic object (usually a Hash), return directly
|
318
|
+
value
|
319
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
320
|
+
inner_type = Regexp.last_match[:inner_type]
|
321
|
+
value.map { |v| _deserialize(inner_type, v) }
|
322
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
323
|
+
k_type = Regexp.last_match[:k_type]
|
324
|
+
v_type = Regexp.last_match[:v_type]
|
325
|
+
{}.tap do |hash|
|
326
|
+
value.each do |k, v|
|
327
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
328
|
+
end
|
329
|
+
end
|
330
|
+
else # model
|
331
|
+
temp_model = Wallee.const_get(type).new
|
332
|
+
temp_model.build_from_hash(value)
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
# Returns the string representation of the object
|
337
|
+
# @return [String] String presentation of the object
|
338
|
+
def to_s
|
339
|
+
to_hash.to_s
|
340
|
+
end
|
341
|
+
|
342
|
+
# to_body is an alias to to_hash (backward compatibility)
|
343
|
+
# @return [Hash] Returns the object in the form of hash
|
344
|
+
def to_body
|
345
|
+
to_hash
|
346
|
+
end
|
347
|
+
|
348
|
+
# Returns the object in the form of hash
|
349
|
+
# @return [Hash] Returns the object in the form of hash
|
350
|
+
def to_hash
|
351
|
+
hash = {}
|
352
|
+
self.class.attribute_map.each_pair do |attr, param|
|
353
|
+
value = self.send(attr)
|
354
|
+
next if value.nil?
|
355
|
+
hash[param] = _to_hash(value)
|
356
|
+
end
|
357
|
+
hash
|
358
|
+
end
|
359
|
+
|
360
|
+
# Outputs non-array value in the form of hash
|
361
|
+
# For object, use to_hash. Otherwise, just return the value
|
362
|
+
# @param [Object] value Any valid value
|
363
|
+
# @return [Hash] Returns the value in the form of hash
|
364
|
+
def _to_hash(value)
|
365
|
+
if value.is_a?(Array)
|
366
|
+
value.compact.map{ |v| _to_hash(v) }
|
367
|
+
elsif value.is_a?(Hash)
|
368
|
+
{}.tap do |hash|
|
369
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
370
|
+
end
|
371
|
+
elsif value.respond_to? :to_hash
|
372
|
+
value.to_hash
|
373
|
+
else
|
374
|
+
value
|
375
|
+
end
|
376
|
+
end
|
377
|
+
|
378
|
+
end
|
379
|
+
|
380
|
+
end
|