wallee-ruby-sdk 6.3.0 → 7.0.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +68 -19
- data/LICENSE +1 -1
- data/README.md +451 -108
- data/lib/wallee-ruby-sdk/api_client.rb +1 -1
- data/lib/wallee-ruby-sdk/models/abstract_o_auth_client_update.rb +340 -0
- data/lib/wallee-ruby-sdk/models/abstract_role_update.rb +13 -1
- data/lib/wallee-ruby-sdk/models/abstract_walleejoin_partnership.rb +330 -0
- data/lib/wallee-ruby-sdk/models/{payment_terminal_preparing.rb → account_create_with_owner.rb} +63 -34
- data/lib/wallee-ruby-sdk/models/authenticated_card_data_create.rb +30 -1
- data/lib/wallee-ruby-sdk/models/bank_payment_type.rb +50 -0
- data/lib/wallee-ruby-sdk/models/basic_address.rb +266 -0
- data/lib/wallee-ruby-sdk/models/boarding_strategy_information_request.rb +247 -0
- data/lib/wallee-ruby-sdk/models/{express_checkout_session_create.rb → charge_attempt_lookup_result.rb} +16 -20
- data/lib/wallee-ruby-sdk/models/charge_attempt_projection.rb +560 -0
- data/lib/wallee-ruby-sdk/models/{express_checkout_shipping_option.rb → create_fulfillment_request.rb} +25 -50
- data/lib/wallee-ruby-sdk/models/delivery_days_range.rb +60 -0
- data/lib/wallee-ruby-sdk/models/delivery_destination.rb +51 -0
- data/lib/wallee-ruby-sdk/models/dunning_case_level.rb +403 -0
- data/lib/wallee-ruby-sdk/models/dunning_case_level_list_response.rb +253 -0
- data/lib/wallee-ruby-sdk/models/dunning_case_level_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/{express_checkout_session_state.rb → dunning_case_level_state.rb} +7 -7
- data/lib/wallee-ruby-sdk/models/extended_rest_o_auth_client.rb +425 -0
- data/lib/wallee-ruby-sdk/models/fulfillment.rb +428 -0
- data/lib/wallee-ruby-sdk/models/fulfillment_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/fulfillment_state.rb +52 -0
- data/lib/wallee-ruby-sdk/models/identity_info.rb +279 -0
- data/lib/wallee-ruby-sdk/models/invoice_processor.rb +51 -0
- data/lib/wallee-ruby-sdk/models/invoice_reconciliation_record.rb +633 -0
- data/lib/wallee-ruby-sdk/models/invoice_reconciliation_record_invoice_link.rb +278 -0
- data/lib/wallee-ruby-sdk/models/invoice_reconciliation_record_invoice_link_list_response.rb +253 -0
- data/lib/wallee-ruby-sdk/models/invoice_reconciliation_record_invoice_link_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/invoice_reconciliation_record_list_response.rb +253 -0
- data/lib/wallee-ruby-sdk/models/invoice_reconciliation_record_rejection_status.rb +51 -0
- data/lib/wallee-ruby-sdk/models/invoice_reconciliation_record_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/invoice_reconciliation_record_state.rb +53 -0
- data/lib/wallee-ruby-sdk/models/{express_checkout_wallet_type.rb → invoice_reconciliation_record_type.rb} +3 -3
- data/lib/wallee-ruby-sdk/models/invoice_reimbursement.rb +463 -0
- data/lib/wallee-ruby-sdk/models/invoice_reimbursement_list_response.rb +253 -0
- data/lib/wallee-ruby-sdk/models/invoice_reimbursement_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/invoice_reimbursement_state.rb +54 -0
- data/lib/wallee-ruby-sdk/models/legal_form.rb +83 -0
- data/lib/wallee-ruby-sdk/models/merchant_application_data_dto.rb +275 -0
- data/lib/wallee-ruby-sdk/models/merchant_application_state.rb +50 -0
- data/lib/wallee-ruby-sdk/models/merchant_application_status_dto.rb +284 -0
- data/lib/wallee-ruby-sdk/models/merchant_bank_details_dto.rb +253 -0
- data/lib/wallee-ruby-sdk/models/merchant_company_details_dto.rb +331 -0
- data/lib/wallee-ruby-sdk/models/merchant_contract_revenue_dto.rb +261 -0
- data/lib/wallee-ruby-sdk/models/merchant_ecommerce_details_dto.rb +348 -0
- data/lib/wallee-ruby-sdk/models/merchant_payment_channels_dto.rb +263 -0
- data/lib/wallee-ruby-sdk/models/merchant_related_persons_dto.rb +243 -0
- data/lib/wallee-ruby-sdk/models/o_auth_client.rb +397 -0
- data/lib/wallee-ruby-sdk/models/o_auth_client_create.rb +365 -0
- data/lib/wallee-ruby-sdk/models/{user_space_role_list_response.rb → o_auth_client_list_response.rb} +4 -4
- data/lib/wallee-ruby-sdk/models/o_auth_client_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/o_auth_client_update.rb +374 -0
- data/lib/wallee-ruby-sdk/models/o_auth_consent.rb +321 -0
- data/lib/wallee-ruby-sdk/models/{user_account_role_list_response.rb → o_auth_consent_list_response.rb} +4 -4
- data/lib/wallee-ruby-sdk/models/o_auth_consent_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/{user_account_role.rb → o_auth_user.rb} +56 -29
- data/lib/wallee-ruby-sdk/models/{express_checkout_create_response.rb → payment_facilitator_pricing_profile_dto.rb} +16 -16
- data/lib/wallee-ruby-sdk/models/payment_facilitator_pricing_profile_state.rb +53 -0
- data/lib/wallee-ruby-sdk/models/payment_initiation_advice_file.rb +337 -0
- data/lib/wallee-ruby-sdk/models/payment_initiation_advice_file_state.rb +55 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal.rb +37 -1
- data/lib/wallee-ruby-sdk/models/payment_terminal_activation_status.rb +301 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal_activation_status_detail_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal_address_create.rb +511 -0
- data/lib/wallee-ruby-sdk/models/{payment_terminal_create.rb → payment_terminal_creation_request.rb} +88 -62
- data/lib/wallee-ruby-sdk/models/payment_terminal_location.rb +1 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal_location_crud_model.rb +398 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal_location_crud_model_rest_api_create.rb +359 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal_location_list_response.rb +253 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal_location_version_state.rb +2 -1
- data/lib/wallee-ruby-sdk/models/payout_account_info.rb +257 -0
- data/lib/wallee-ruby-sdk/models/person_salutation.rb +54 -0
- data/lib/wallee-ruby-sdk/models/pricing_history_dto.rb +266 -0
- data/lib/wallee-ruby-sdk/models/product_metered_fee.rb +11 -1
- data/lib/wallee-ruby-sdk/models/product_metered_fee_update.rb +11 -1
- data/lib/wallee-ruby-sdk/models/refund.rb +13 -1
- data/lib/wallee-ruby-sdk/models/refund_create.rb +13 -1
- data/lib/wallee-ruby-sdk/models/refund_days_range.rb +51 -0
- data/lib/wallee-ruby-sdk/models/refund_percentage_range.rb +56 -0
- data/lib/wallee-ruby-sdk/models/related_person.rb +329 -0
- data/lib/wallee-ruby-sdk/models/representative_info.rb +239 -0
- data/lib/wallee-ruby-sdk/models/rest_member.rb +284 -0
- data/lib/wallee-ruby-sdk/models/{user_space_role.rb → rest_o_auth_client_secret.rb} +38 -37
- data/lib/wallee-ruby-sdk/models/{express_checkout_session.rb → rest_o_auth_client_secret_created.rb} +27 -52
- data/lib/wallee-ruby-sdk/models/role.rb +13 -1
- data/lib/wallee-ruby-sdk/models/role_create.rb +13 -1
- data/lib/wallee-ruby-sdk/models/{abstract_payment_terminal_update.rb → role_ref.rb} +18 -27
- data/lib/wallee-ruby-sdk/models/role_update.rb +13 -1
- data/lib/wallee-ruby-sdk/models/sales_channel.rb +15 -230
- data/lib/wallee-ruby-sdk/models/scope.rb +28 -16
- data/lib/wallee-ruby-sdk/models/secret_key_state.rb +51 -0
- data/lib/wallee-ruby-sdk/models/setter.rb +618 -0
- data/lib/wallee-ruby-sdk/models/sole_proprietor_ownership_type.rb +51 -0
- data/lib/wallee-ruby-sdk/models/sole_proprietorship_info.rb +261 -0
- data/lib/wallee-ruby-sdk/models/state_list_response.rb +253 -0
- data/lib/wallee-ruby-sdk/models/store_trial_subscription_request.rb +273 -0
- data/lib/wallee-ruby-sdk/models/store_trial_subscription_request_setter.rb +307 -0
- data/lib/wallee-ruby-sdk/models/subscription_component_group_configuration_request.rb +249 -0
- data/lib/wallee-ruby-sdk/models/subscription_component_group_configuration_request_setter.rb +249 -0
- data/lib/wallee-ruby-sdk/models/subscription_product_dto.rb +239 -0
- data/lib/wallee-ruby-sdk/models/tokenized_card_data_create.rb +30 -1
- data/lib/wallee-ruby-sdk/models/tracking_number_request.rb +230 -0
- data/lib/wallee-ruby-sdk/models/transaction_completion.rb +13 -1
- data/lib/wallee-ruby-sdk/models/transaction_completion_details.rb +26 -4
- data/lib/wallee-ruby-sdk/models/transaction_overview.rb +1144 -0
- data/lib/wallee-ruby-sdk/models/transaction_projection.rb +1135 -0
- data/lib/wallee-ruby-sdk/models/transaction_user_interface_type.rb +2 -1
- data/lib/wallee-ruby-sdk/models/walleejoin_admin_partner_configuration_request_dto.rb +360 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_admin_partner_configuration_response_dto.rb +351 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_admin_pricing_type.rb +51 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_create_partnership_api_request_dto.rb +266 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_partnership.rb +357 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_partnership_create.rb +337 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_partnership_response_dto.rb +342 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_partnership_response_dto_list_response.rb +253 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_partnership_response_dto_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_partnership_state.rb +51 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_partnership_type.rb +50 -0
- data/lib/wallee-ruby-sdk/models/walleejoin_partnership_update.rb +364 -0
- data/lib/wallee-ruby-sdk/models/wallet_type.rb +40 -1
- data/lib/wallee-ruby-sdk/models/web_ui_account_theme.rb +230 -0
- data/lib/wallee-ruby-sdk/service/accounts_service.rb +16 -9
- data/lib/wallee-ruby-sdk/service/analytics_queries_service.rb +8 -8
- data/lib/wallee-ruby-sdk/service/bank_accounts_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/bank_transactions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/boarding_subscription_strategy_service.rb +181 -0
- data/lib/wallee-ruby-sdk/service/charge_attempts_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/charge_bank_transactions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/charge_flow_levels_service.rb +4 -4
- data/lib/wallee-ruby-sdk/service/charge_flows_level_payment_links_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/charge_flows_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/consumed_resources_service.rb +1 -1
- data/lib/wallee-ruby-sdk/service/countries_service.rb +15 -6
- data/lib/wallee-ruby-sdk/service/currency_bank_accounts_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/customer_addresses_service.rb +7 -7
- data/lib/wallee-ruby-sdk/service/customer_comments_service.rb +8 -8
- data/lib/wallee-ruby-sdk/service/customers_service.rb +11 -11
- data/lib/wallee-ruby-sdk/service/debt_collection_cases_service.rb +12 -12
- data/lib/wallee-ruby-sdk/service/debt_collector_configurations_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/delivery_indications_service.rb +5 -5
- data/lib/wallee-ruby-sdk/service/document_templates_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/dunning_case_levels_service.rb +291 -0
- data/lib/wallee-ruby-sdk/service/dunning_cases_service.rb +5 -5
- data/lib/wallee-ruby-sdk/service/dunning_flow_levels_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/dunning_flows_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/external_transfer_bank_transactions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/fulfillments_service.rb +355 -0
- data/lib/wallee-ruby-sdk/service/internal_transfer_bank_transactions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/invoice_reconciliation_record_invoice_links_service.rb +453 -0
- data/lib/wallee-ruby-sdk/service/invoice_reconciliation_records_service.rb +433 -0
- data/lib/wallee-ruby-sdk/service/invoice_reimbursements_service.rb +450 -0
- data/lib/wallee-ruby-sdk/service/join_admin_partner_configuration_service.rb +306 -0
- data/lib/wallee-ruby-sdk/service/join_partnership_service.rb +586 -0
- data/lib/wallee-ruby-sdk/service/manual_tasks_service.rb +5 -5
- data/lib/wallee-ruby-sdk/service/members_service.rb +215 -0
- data/lib/wallee-ruby-sdk/service/merchant_applications_service.rb +334 -0
- data/lib/wallee-ruby-sdk/service/o_auth_clients_service.rb +611 -0
- data/lib/wallee-ruby-sdk/service/o_auth_consents_service.rb +332 -0
- data/lib/wallee-ruby-sdk/service/payment_connector_configurations_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/payment_links_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/payment_method_configurations_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/payment_processor_configurations_service.rb +85 -6
- data/lib/wallee-ruby-sdk/service/payment_terminal_transaction_summaries_service.rb +4 -4
- data/lib/wallee-ruby-sdk/service/payment_terminals_service.rb +475 -22
- data/lib/wallee-ruby-sdk/service/payment_web_apps_service.rb +11 -11
- data/lib/wallee-ruby-sdk/service/refund_bank_transactions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/refund_comments_service.rb +8 -8
- data/lib/wallee-ruby-sdk/service/refund_recovery_bank_transactions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/refunds_service.rb +7 -7
- data/lib/wallee-ruby-sdk/service/spaces_service.rb +10 -3
- data/lib/wallee-ruby-sdk/service/subscribers_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_affiliates_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_charges_service.rb +5 -5
- data/lib/wallee-ruby-sdk/service/subscription_ledger_entries_service.rb +4 -4
- data/lib/wallee-ruby-sdk/service/subscription_metric_usage_reports_service.rb +4 -4
- data/lib/wallee-ruby-sdk/service/subscription_metrics_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_period_bills_service.rb +4 -4
- data/lib/wallee-ruby-sdk/service/subscription_product_component_groups_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_product_components_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_product_metered_fee_tiers_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_product_metered_fees_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_product_period_fees_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_product_retirements_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/subscription_product_setup_fees_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_product_version_retirements_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/subscription_product_versions_service.rb +7 -7
- data/lib/wallee-ruby-sdk/service/subscription_products_service.rb +6 -6
- data/lib/wallee-ruby-sdk/service/subscription_suspensions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/subscription_versions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/subscriptions_service.rb +13 -13
- data/lib/wallee-ruby-sdk/service/terminal_locations_service.rb +276 -0
- data/lib/wallee-ruby-sdk/service/token_versions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/tokens_service.rb +8 -8
- data/lib/wallee-ruby-sdk/service/transaction_client_platforms_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/transaction_comments_service.rb +8 -8
- data/lib/wallee-ruby-sdk/service/transaction_completions_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/transaction_invoice_comments_service.rb +8 -8
- data/lib/wallee-ruby-sdk/service/transaction_invoices_service.rb +86 -8
- data/lib/wallee-ruby-sdk/service/transaction_line_item_versions_service.rb +4 -4
- data/lib/wallee-ruby-sdk/service/transaction_voids_service.rb +3 -3
- data/lib/wallee-ruby-sdk/service/transactions_service.rb +179 -37
- data/lib/wallee-ruby-sdk/service/web_apps_service.rb +2 -2
- data/lib/wallee-ruby-sdk/service/web_ui_account_theme_service.rb +245 -0
- data/lib/wallee-ruby-sdk/service/webhook_listeners_service.rb +9 -9
- data/lib/wallee-ruby-sdk/service/webhook_urls_service.rb +9 -9
- data/lib/wallee-ruby-sdk/version.rb +1 -1
- data/lib/wallee-ruby-sdk.rb +115 -17
- data/test/test_querying.rb +11 -0
- metadata +117 -19
- data/lib/wallee-ruby-sdk/service/application_users_roles_service.rb +0 -478
- data/lib/wallee-ruby-sdk/service/express_checkout_service.rb +0 -107
- data/lib/wallee-ruby-sdk/service/human_users_roles_service.rb +0 -478
- data/lib/wallee-ruby-sdk/service/single_sign_on_users_roles_service.rb +0 -478
data/lib/wallee-ruby-sdk/models/{payment_terminal_create.rb → payment_terminal_creation_request.rb}
RENAMED
|
@@ -24,34 +24,30 @@ require 'date'
|
|
|
24
24
|
require 'time'
|
|
25
25
|
|
|
26
26
|
module WalleeRubySdk
|
|
27
|
-
class
|
|
28
|
-
# The
|
|
29
|
-
attr_accessor :
|
|
30
|
-
|
|
31
|
-
# The unique identifier of the terminal, that is displayed on the device.
|
|
32
|
-
attr_accessor :identifier
|
|
27
|
+
class PaymentTerminalCreationRequest
|
|
28
|
+
# The environment used to create the payment terminal (TEST/PRODUCTION).
|
|
29
|
+
attr_accessor :environment
|
|
33
30
|
|
|
34
31
|
# The configuration that is assigned to the terminal and determines how it works.
|
|
35
|
-
attr_accessor :
|
|
32
|
+
attr_accessor :configuration
|
|
36
33
|
|
|
37
|
-
# The
|
|
38
|
-
attr_accessor :
|
|
34
|
+
# The name used to identify the payment terminal.
|
|
35
|
+
attr_accessor :name
|
|
39
36
|
|
|
40
|
-
#
|
|
37
|
+
# The ID assigned by the external system to this payment terminal
|
|
41
38
|
attr_accessor :external_id
|
|
42
39
|
|
|
43
|
-
# The
|
|
44
|
-
attr_accessor :
|
|
40
|
+
# The physical location where the terminal is used.
|
|
41
|
+
attr_accessor :location
|
|
45
42
|
|
|
46
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
44
|
def self.attribute_map
|
|
48
45
|
{
|
|
46
|
+
:'environment' => :'environment',
|
|
47
|
+
:'configuration' => :'configuration',
|
|
49
48
|
:'name' => :'name',
|
|
50
|
-
:'identifier' => :'identifier',
|
|
51
|
-
:'configuration_version' => :'configurationVersion',
|
|
52
|
-
:'location_version' => :'locationVersion',
|
|
53
49
|
:'external_id' => :'externalId',
|
|
54
|
-
:'
|
|
50
|
+
:'location' => :'location'
|
|
55
51
|
}
|
|
56
52
|
end
|
|
57
53
|
|
|
@@ -68,12 +64,11 @@ module WalleeRubySdk
|
|
|
68
64
|
# Attribute type mapping.
|
|
69
65
|
def self.openapi_types
|
|
70
66
|
{
|
|
67
|
+
:'environment' => :'String',
|
|
68
|
+
:'configuration' => :'Integer',
|
|
71
69
|
:'name' => :'String',
|
|
72
|
-
:'identifier' => :'String',
|
|
73
|
-
:'configuration_version' => :'Integer',
|
|
74
|
-
:'location_version' => :'Integer',
|
|
75
70
|
:'external_id' => :'String',
|
|
76
|
-
:'
|
|
71
|
+
:'location' => :'Integer'
|
|
77
72
|
}
|
|
78
73
|
end
|
|
79
74
|
|
|
@@ -83,43 +78,38 @@ module WalleeRubySdk
|
|
|
83
78
|
])
|
|
84
79
|
end
|
|
85
80
|
|
|
86
|
-
# List of class defined in allOf (OpenAPI v3)
|
|
87
|
-
def self.openapi_all_of
|
|
88
|
-
[
|
|
89
|
-
:'AbstractPaymentTerminalUpdate'
|
|
90
|
-
]
|
|
91
|
-
end
|
|
92
|
-
|
|
93
81
|
# Initializes the object
|
|
94
82
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
83
|
def initialize(attributes = {})
|
|
96
84
|
if (!attributes.is_a?(Hash))
|
|
97
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `WalleeRubySdk::
|
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `WalleeRubySdk::PaymentTerminalCreationRequest` initialize method"
|
|
98
86
|
end
|
|
99
87
|
|
|
100
88
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
89
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
102
90
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
91
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
104
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `WalleeRubySdk::
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `WalleeRubySdk::PaymentTerminalCreationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
105
93
|
end
|
|
106
94
|
h[k.to_sym] = v
|
|
107
95
|
}
|
|
108
96
|
|
|
109
|
-
if attributes.key?(:'
|
|
110
|
-
self.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if attributes.key?(:'identifier')
|
|
114
|
-
self.identifier = attributes[:'identifier']
|
|
97
|
+
if attributes.key?(:'environment')
|
|
98
|
+
self.environment = attributes[:'environment']
|
|
99
|
+
else
|
|
100
|
+
self.environment = nil
|
|
115
101
|
end
|
|
116
102
|
|
|
117
|
-
if attributes.key?(:'
|
|
118
|
-
self.
|
|
103
|
+
if attributes.key?(:'configuration')
|
|
104
|
+
self.configuration = attributes[:'configuration']
|
|
105
|
+
else
|
|
106
|
+
self.configuration = nil
|
|
119
107
|
end
|
|
120
108
|
|
|
121
|
-
if attributes.key?(:'
|
|
122
|
-
self.
|
|
109
|
+
if attributes.key?(:'name')
|
|
110
|
+
self.name = attributes[:'name']
|
|
111
|
+
else
|
|
112
|
+
self.name = nil
|
|
123
113
|
end
|
|
124
114
|
|
|
125
115
|
if attributes.key?(:'external_id')
|
|
@@ -128,10 +118,10 @@ module WalleeRubySdk
|
|
|
128
118
|
self.external_id = nil
|
|
129
119
|
end
|
|
130
120
|
|
|
131
|
-
if attributes.key?(:'
|
|
132
|
-
self.
|
|
121
|
+
if attributes.key?(:'location')
|
|
122
|
+
self.location = attributes[:'location']
|
|
133
123
|
else
|
|
134
|
-
self.
|
|
124
|
+
self.location = nil
|
|
135
125
|
end
|
|
136
126
|
end
|
|
137
127
|
|
|
@@ -140,16 +130,29 @@ module WalleeRubySdk
|
|
|
140
130
|
def list_invalid_properties
|
|
141
131
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
142
132
|
invalid_properties = Array.new
|
|
143
|
-
if
|
|
144
|
-
invalid_properties.push('invalid value for "
|
|
133
|
+
if @environment.nil?
|
|
134
|
+
invalid_properties.push('invalid value for "environment", environment cannot be nil.')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
pattern = Regexp.new(/^(TEST|PRODUCTION)$/)
|
|
138
|
+
if @environment !~ pattern
|
|
139
|
+
invalid_properties.push("invalid value for \"environment\", must conform to the pattern #{pattern}.")
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if @configuration.nil?
|
|
143
|
+
invalid_properties.push('invalid value for "configuration", configuration cannot be nil.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if @name.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
145
148
|
end
|
|
146
149
|
|
|
147
150
|
if @external_id.nil?
|
|
148
151
|
invalid_properties.push('invalid value for "external_id", external_id cannot be nil.')
|
|
149
152
|
end
|
|
150
153
|
|
|
151
|
-
if @
|
|
152
|
-
invalid_properties.push('invalid value for "
|
|
154
|
+
if @location.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "location", location cannot be nil.')
|
|
153
156
|
end
|
|
154
157
|
|
|
155
158
|
invalid_properties
|
|
@@ -159,12 +162,40 @@ module WalleeRubySdk
|
|
|
159
162
|
# @return true if the model is valid
|
|
160
163
|
def valid?
|
|
161
164
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
162
|
-
return false if
|
|
165
|
+
return false if @environment.nil?
|
|
166
|
+
return false if @environment !~ Regexp.new(/^(TEST|PRODUCTION)$/)
|
|
167
|
+
return false if @configuration.nil?
|
|
168
|
+
return false if @name.nil?
|
|
163
169
|
return false if @external_id.nil?
|
|
164
|
-
return false if @
|
|
170
|
+
return false if @location.nil?
|
|
165
171
|
true
|
|
166
172
|
end
|
|
167
173
|
|
|
174
|
+
# Custom attribute writer method with validation
|
|
175
|
+
# @param [Object] environment Value to be assigned
|
|
176
|
+
def environment=(environment)
|
|
177
|
+
if environment.nil?
|
|
178
|
+
fail ArgumentError, 'environment cannot be nil'
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
pattern = Regexp.new(/^(TEST|PRODUCTION)$/)
|
|
182
|
+
if environment !~ pattern
|
|
183
|
+
fail ArgumentError, "invalid value for \"environment\", must conform to the pattern #{pattern}."
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
@environment = environment
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] configuration Value to be assigned
|
|
191
|
+
def configuration=(configuration)
|
|
192
|
+
if configuration.nil?
|
|
193
|
+
fail ArgumentError, 'configuration cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@configuration = configuration
|
|
197
|
+
end
|
|
198
|
+
|
|
168
199
|
# Custom attribute writer method with validation
|
|
169
200
|
# @param [Object] name Value to be assigned
|
|
170
201
|
def name=(name)
|
|
@@ -172,10 +203,6 @@ module WalleeRubySdk
|
|
|
172
203
|
fail ArgumentError, 'name cannot be nil'
|
|
173
204
|
end
|
|
174
205
|
|
|
175
|
-
if name.to_s.length > 100
|
|
176
|
-
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
|
|
177
|
-
end
|
|
178
|
-
|
|
179
206
|
@name = name
|
|
180
207
|
end
|
|
181
208
|
|
|
@@ -190,13 +217,13 @@ module WalleeRubySdk
|
|
|
190
217
|
end
|
|
191
218
|
|
|
192
219
|
# Custom attribute writer method with validation
|
|
193
|
-
# @param [Object]
|
|
194
|
-
def
|
|
195
|
-
if
|
|
196
|
-
fail ArgumentError, '
|
|
220
|
+
# @param [Object] location Value to be assigned
|
|
221
|
+
def location=(location)
|
|
222
|
+
if location.nil?
|
|
223
|
+
fail ArgumentError, 'location cannot be nil'
|
|
197
224
|
end
|
|
198
225
|
|
|
199
|
-
@
|
|
226
|
+
@location = location
|
|
200
227
|
end
|
|
201
228
|
|
|
202
229
|
# Checks equality by comparing each attribute.
|
|
@@ -204,12 +231,11 @@ module WalleeRubySdk
|
|
|
204
231
|
def ==(o)
|
|
205
232
|
return true if self.equal?(o)
|
|
206
233
|
self.class == o.class &&
|
|
234
|
+
environment == o.environment &&
|
|
235
|
+
configuration == o.configuration &&
|
|
207
236
|
name == o.name &&
|
|
208
|
-
identifier == o.identifier &&
|
|
209
|
-
configuration_version == o.configuration_version &&
|
|
210
|
-
location_version == o.location_version &&
|
|
211
237
|
external_id == o.external_id &&
|
|
212
|
-
|
|
238
|
+
location == o.location
|
|
213
239
|
end
|
|
214
240
|
|
|
215
241
|
# @see the `==` method
|
|
@@ -221,7 +247,7 @@ module WalleeRubySdk
|
|
|
221
247
|
# Calculates hash code according to all attributes.
|
|
222
248
|
# @return [Integer] Hash code
|
|
223
249
|
def hash
|
|
224
|
-
[
|
|
250
|
+
[environment, configuration, name, external_id, location].hash
|
|
225
251
|
end
|
|
226
252
|
|
|
227
253
|
# Builds the object from hash
|
|
@@ -28,6 +28,7 @@ module WalleeRubySdk
|
|
|
28
28
|
# The ID of the space this object belongs to.
|
|
29
29
|
attr_accessor :linked_space_id
|
|
30
30
|
|
|
31
|
+
# The production merchant identifier assigned to the location.
|
|
31
32
|
attr_accessor :production_merchant_id
|
|
32
33
|
|
|
33
34
|
# The name used to identify the payment terminal location.
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
# Wallee AG Ruby SDK
|
|
3
|
+
#
|
|
4
|
+
# This library allows to interact with the Wallee AG payment service.
|
|
5
|
+
#
|
|
6
|
+
# Copyright owner: Wallee AG
|
|
7
|
+
# Website: https://en.wallee.com
|
|
8
|
+
# Developer email: ecosystem-team@wallee.com
|
|
9
|
+
#
|
|
10
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
# you may not use this file except in compliance with the License.
|
|
12
|
+
# You may obtain a copy of the License at
|
|
13
|
+
#
|
|
14
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
#
|
|
16
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
# See the License for the specific language governing permissions and
|
|
20
|
+
# limitations under the License.
|
|
21
|
+
=end
|
|
22
|
+
|
|
23
|
+
require 'date'
|
|
24
|
+
require 'time'
|
|
25
|
+
|
|
26
|
+
module WalleeRubySdk
|
|
27
|
+
class PaymentTerminalLocationCrudModel
|
|
28
|
+
# The production merchant identifier assigned to the location.
|
|
29
|
+
attr_accessor :production_merchant_id
|
|
30
|
+
|
|
31
|
+
attr_accessor :address
|
|
32
|
+
|
|
33
|
+
# The name used to identify the payment terminal location.
|
|
34
|
+
attr_accessor :name
|
|
35
|
+
|
|
36
|
+
# The date and time when the object is planned to be permanently removed. If the value is empty, the object will not be removed.
|
|
37
|
+
attr_accessor :planned_purge_date
|
|
38
|
+
|
|
39
|
+
# A client-generated nonce which uniquely identifies some action to be executed. Subsequent requests with the same external ID do not execute the action again, but return the original result.
|
|
40
|
+
attr_accessor :external_id
|
|
41
|
+
|
|
42
|
+
attr_accessor :contact_address
|
|
43
|
+
|
|
44
|
+
# Whether changes to the location are applied to terminals immediately.
|
|
45
|
+
attr_accessor :version_applied_immediately
|
|
46
|
+
|
|
47
|
+
# A unique identifier for the object.
|
|
48
|
+
attr_accessor :id
|
|
49
|
+
|
|
50
|
+
attr_accessor :state
|
|
51
|
+
|
|
52
|
+
# The version is used for optimistic locking and incremented whenever the object is updated.
|
|
53
|
+
attr_accessor :version
|
|
54
|
+
|
|
55
|
+
class EnumAttributeValidator
|
|
56
|
+
attr_reader :datatype
|
|
57
|
+
attr_reader :allowable_values
|
|
58
|
+
|
|
59
|
+
def initialize(datatype, allowable_values)
|
|
60
|
+
@allowable_values = allowable_values.map do |value|
|
|
61
|
+
case datatype.to_s
|
|
62
|
+
when /Integer/i
|
|
63
|
+
value.to_i
|
|
64
|
+
when /Float/i
|
|
65
|
+
value.to_f
|
|
66
|
+
else
|
|
67
|
+
value
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def valid?(value)
|
|
73
|
+
!value || allowable_values.include?(value)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
78
|
+
def self.attribute_map
|
|
79
|
+
{
|
|
80
|
+
:'production_merchant_id' => :'productionMerchantId',
|
|
81
|
+
:'address' => :'address',
|
|
82
|
+
:'name' => :'name',
|
|
83
|
+
:'planned_purge_date' => :'plannedPurgeDate',
|
|
84
|
+
:'external_id' => :'externalId',
|
|
85
|
+
:'contact_address' => :'contactAddress',
|
|
86
|
+
:'version_applied_immediately' => :'versionAppliedImmediately',
|
|
87
|
+
:'id' => :'id',
|
|
88
|
+
:'state' => :'state',
|
|
89
|
+
:'version' => :'version'
|
|
90
|
+
}
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Returns attribute mapping this model knows about
|
|
94
|
+
def self.acceptable_attribute_map
|
|
95
|
+
attribute_map
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Returns all the JSON keys this model knows about
|
|
99
|
+
def self.acceptable_attributes
|
|
100
|
+
acceptable_attribute_map.values
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Attribute type mapping.
|
|
104
|
+
def self.openapi_types
|
|
105
|
+
{
|
|
106
|
+
:'production_merchant_id' => :'String',
|
|
107
|
+
:'address' => :'PaymentTerminalAddress',
|
|
108
|
+
:'name' => :'String',
|
|
109
|
+
:'planned_purge_date' => :'Time',
|
|
110
|
+
:'external_id' => :'String',
|
|
111
|
+
:'contact_address' => :'PaymentTerminalAddress',
|
|
112
|
+
:'version_applied_immediately' => :'Boolean',
|
|
113
|
+
:'id' => :'Integer',
|
|
114
|
+
:'state' => :'PaymentTerminalLocationState',
|
|
115
|
+
:'version' => :'Integer'
|
|
116
|
+
}
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# List of attributes with nullable: true
|
|
120
|
+
def self.openapi_nullable
|
|
121
|
+
Set.new([
|
|
122
|
+
])
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Initializes the object
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
def initialize(attributes = {})
|
|
128
|
+
if (!attributes.is_a?(Hash))
|
|
129
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `WalleeRubySdk::PaymentTerminalLocationCrudModel` initialize method"
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
133
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
134
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
135
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
136
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `WalleeRubySdk::PaymentTerminalLocationCrudModel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
137
|
+
end
|
|
138
|
+
h[k.to_sym] = v
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'production_merchant_id')
|
|
142
|
+
self.production_merchant_id = attributes[:'production_merchant_id']
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'address')
|
|
146
|
+
self.address = attributes[:'address']
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'name')
|
|
150
|
+
self.name = attributes[:'name']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'planned_purge_date')
|
|
154
|
+
self.planned_purge_date = attributes[:'planned_purge_date']
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'external_id')
|
|
158
|
+
self.external_id = attributes[:'external_id']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'contact_address')
|
|
162
|
+
self.contact_address = attributes[:'contact_address']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'version_applied_immediately')
|
|
166
|
+
self.version_applied_immediately = attributes[:'version_applied_immediately']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'id')
|
|
170
|
+
self.id = attributes[:'id']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'state')
|
|
174
|
+
self.state = attributes[:'state']
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'version')
|
|
178
|
+
self.version = attributes[:'version']
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
183
|
+
# @return Array for valid properties with the reasons
|
|
184
|
+
def list_invalid_properties
|
|
185
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
186
|
+
invalid_properties = Array.new
|
|
187
|
+
if !@production_merchant_id.nil? && @production_merchant_id.to_s.length > 15
|
|
188
|
+
invalid_properties.push('invalid value for "production_merchant_id", the character length must be smaller than or equal to 15.')
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if !@production_merchant_id.nil? && @production_merchant_id.to_s.length < 15
|
|
192
|
+
invalid_properties.push('invalid value for "production_merchant_id", the character length must be great than or equal to 15.')
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
pattern = Regexp.new(/([0-9a-zA-Z])+/)
|
|
196
|
+
if !@production_merchant_id.nil? && @production_merchant_id !~ pattern
|
|
197
|
+
invalid_properties.push("invalid value for \"production_merchant_id\", must conform to the pattern #{pattern}.")
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if !@name.nil? && @name.to_s.length > 100
|
|
201
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
invalid_properties
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Check to see if the all the properties in the model are valid
|
|
208
|
+
# @return true if the model is valid
|
|
209
|
+
def valid?
|
|
210
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
211
|
+
return false if !@production_merchant_id.nil? && @production_merchant_id.to_s.length > 15
|
|
212
|
+
return false if !@production_merchant_id.nil? && @production_merchant_id.to_s.length < 15
|
|
213
|
+
return false if !@production_merchant_id.nil? && @production_merchant_id !~ Regexp.new(/([0-9a-zA-Z])+/)
|
|
214
|
+
return false if !@name.nil? && @name.to_s.length > 100
|
|
215
|
+
true
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] production_merchant_id Value to be assigned
|
|
220
|
+
def production_merchant_id=(production_merchant_id)
|
|
221
|
+
if production_merchant_id.nil?
|
|
222
|
+
fail ArgumentError, 'production_merchant_id cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if production_merchant_id.to_s.length > 15
|
|
226
|
+
fail ArgumentError, 'invalid value for "production_merchant_id", the character length must be smaller than or equal to 15.'
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if production_merchant_id.to_s.length < 15
|
|
230
|
+
fail ArgumentError, 'invalid value for "production_merchant_id", the character length must be great than or equal to 15.'
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
pattern = Regexp.new(/([0-9a-zA-Z])+/)
|
|
234
|
+
if production_merchant_id !~ pattern
|
|
235
|
+
fail ArgumentError, "invalid value for \"production_merchant_id\", must conform to the pattern #{pattern}."
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@production_merchant_id = production_merchant_id
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method with validation
|
|
242
|
+
# @param [Object] name Value to be assigned
|
|
243
|
+
def name=(name)
|
|
244
|
+
if name.nil?
|
|
245
|
+
fail ArgumentError, 'name cannot be nil'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if name.to_s.length > 100
|
|
249
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
@name = name
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Checks equality by comparing each attribute.
|
|
256
|
+
# @param [Object] Object to be compared
|
|
257
|
+
def ==(o)
|
|
258
|
+
return true if self.equal?(o)
|
|
259
|
+
self.class == o.class &&
|
|
260
|
+
production_merchant_id == o.production_merchant_id &&
|
|
261
|
+
address == o.address &&
|
|
262
|
+
name == o.name &&
|
|
263
|
+
planned_purge_date == o.planned_purge_date &&
|
|
264
|
+
external_id == o.external_id &&
|
|
265
|
+
contact_address == o.contact_address &&
|
|
266
|
+
version_applied_immediately == o.version_applied_immediately &&
|
|
267
|
+
id == o.id &&
|
|
268
|
+
state == o.state &&
|
|
269
|
+
version == o.version
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# @see the `==` method
|
|
273
|
+
# @param [Object] Object to be compared
|
|
274
|
+
def eql?(o)
|
|
275
|
+
self == o
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Calculates hash code according to all attributes.
|
|
279
|
+
# @return [Integer] Hash code
|
|
280
|
+
def hash
|
|
281
|
+
[production_merchant_id, address, name, planned_purge_date, external_id, contact_address, version_applied_immediately, id, state, version].hash
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Builds the object from hash
|
|
285
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
286
|
+
# @return [Object] Returns the model itself
|
|
287
|
+
def self.build_from_hash(attributes)
|
|
288
|
+
return nil unless attributes.is_a?(Hash)
|
|
289
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
290
|
+
transformed_hash = {}
|
|
291
|
+
openapi_types.each_pair do |key, type|
|
|
292
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
293
|
+
transformed_hash["#{key}"] = nil
|
|
294
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
295
|
+
# check to ensure the input is an array given that the attribute
|
|
296
|
+
# is documented as an array but the input is not
|
|
297
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
298
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
299
|
+
end
|
|
300
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
301
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
302
|
+
end
|
|
303
|
+
end
|
|
304
|
+
new(transformed_hash)
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
# Deserializes the data based on type
|
|
308
|
+
# @param string type Data type
|
|
309
|
+
# @param string value Value to be deserialized
|
|
310
|
+
# @return [Object] Deserialized data
|
|
311
|
+
def self._deserialize(type, value)
|
|
312
|
+
case type.to_sym
|
|
313
|
+
when :Time
|
|
314
|
+
Time.parse(value)
|
|
315
|
+
when :Date
|
|
316
|
+
Date.parse(value)
|
|
317
|
+
when :String
|
|
318
|
+
value.to_s
|
|
319
|
+
when :Integer
|
|
320
|
+
value.to_i
|
|
321
|
+
when :Float
|
|
322
|
+
value.to_f
|
|
323
|
+
when :Boolean
|
|
324
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
325
|
+
true
|
|
326
|
+
else
|
|
327
|
+
false
|
|
328
|
+
end
|
|
329
|
+
when :Object
|
|
330
|
+
# generic object (usually a Hash), return directly
|
|
331
|
+
value
|
|
332
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
333
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
334
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
335
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
336
|
+
k_type = Regexp.last_match[:k_type]
|
|
337
|
+
v_type = Regexp.last_match[:v_type]
|
|
338
|
+
{}.tap do |hash|
|
|
339
|
+
value.each do |k, v|
|
|
340
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
341
|
+
end
|
|
342
|
+
end
|
|
343
|
+
else # model
|
|
344
|
+
# models (e.g. Pet) or oneOf
|
|
345
|
+
klass = WalleeRubySdk.const_get(type)
|
|
346
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
# Returns the string representation of the object
|
|
351
|
+
# @return [String] String presentation of the object
|
|
352
|
+
def to_s
|
|
353
|
+
to_hash.to_s
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
357
|
+
# @return [Hash] Returns the object in the form of hash
|
|
358
|
+
def to_body
|
|
359
|
+
to_hash
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
# Returns the object in the form of hash
|
|
363
|
+
# @return [Hash] Returns the object in the form of hash
|
|
364
|
+
def to_hash
|
|
365
|
+
hash = {}
|
|
366
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
367
|
+
value = self.send(attr)
|
|
368
|
+
if value.nil?
|
|
369
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
370
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
hash[param] = _to_hash(value)
|
|
374
|
+
end
|
|
375
|
+
hash
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Outputs non-array value in the form of hash
|
|
379
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
380
|
+
# @param [Object] value Any valid value
|
|
381
|
+
# @return [Hash] Returns the value in the form of hash
|
|
382
|
+
def _to_hash(value)
|
|
383
|
+
if value.is_a?(Array)
|
|
384
|
+
value.compact.map { |v| _to_hash(v) }
|
|
385
|
+
elsif value.is_a?(Hash)
|
|
386
|
+
{}.tap do |hash|
|
|
387
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
388
|
+
end
|
|
389
|
+
elsif value.respond_to? :to_hash
|
|
390
|
+
value.to_hash
|
|
391
|
+
else
|
|
392
|
+
value
|
|
393
|
+
end
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
end
|