cybersource_rest_client 0.0.86 → 0.0.87
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/lib/AuthenticationSDK/util/CertificateUtility.rb +14 -6
- data/lib/cybersource_rest_client/api/agent_capabilities_api.rb +24 -24
- data/lib/cybersource_rest_client/api/bin_lookup_api.rb +3 -3
- data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +6 -6
- data/lib/cybersource_rest_client/api/foreign_exchange_rates_api.rb +3 -3
- data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +9 -9
- data/lib/cybersource_rest_client/api/merchant_boarding_api.rb +3 -3
- data/lib/cybersource_rest_client/api/offers_api.rb +3 -3
- data/lib/cybersource_rest_client/api/search_transactions_api.rb +2 -2
- data/lib/cybersource_rest_client/api/transaction_details_api.rb +1 -1
- data/lib/cybersource_rest_client/api/transaction_query_api.rb +3 -3
- data/lib/cybersource_rest_client/api/visa_protect_risk_insights_api.rb +104 -0
- data/lib/cybersource_rest_client/models/inline_response_200_16.rb +2 -2
- data/lib/cybersource_rest_client/models/inline_response_200_17.rb +5 -5
- data/lib/cybersource_rest_client/models/inline_response_200_18.rb +5 -5
- data/lib/cybersource_rest_client/models/inline_response_200_4.rb +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_5.rb +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_10.rb +18 -93
- data/lib/cybersource_rest_client/models/inline_response_201_11.rb +103 -8
- data/lib/cybersource_rest_client/models/{inline_response_201_12_client_reference_information.rb → inline_response_201_11_client_reference_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_12_error_information.rb → inline_response_201_11_error_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_12_order_information.rb → inline_response_201_11_order_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_12_order_information_currency_conversion.rb → inline_response_201_11_order_information_currency_conversion.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_12_order_information_currency_conversion_offer.rb → inline_response_201_11_order_information_currency_conversion_offer.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_12_processor_information.rb → inline_response_201_11_processor_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_12.rb +110 -89
- data/lib/cybersource_rest_client/models/{inline_response_201_13_fulfillment_address.rb → inline_response_201_12_fulfillment_address.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_13_fulfillment_options.rb → inline_response_201_12_fulfillment_options.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_14_item.rb → inline_response_201_12_item.rb} +20 -20
- data/lib/cybersource_rest_client/models/inline_response_201_12_line_items.rb +256 -0
- data/lib/cybersource_rest_client/models/{inline_response_201_13_links.rb → inline_response_201_12_links.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_13_messages.rb → inline_response_201_12_messages.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_13_payment_provider.rb → inline_response_201_12_payment_provider.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_13_totals.rb → inline_response_201_12_totals.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_13.rb +61 -67
- data/lib/cybersource_rest_client/models/{inline_response_201_14_discounts.rb → inline_response_201_13_discounts.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_14_fulfillment.rb → inline_response_201_13_fulfillment.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_13_item.rb +19 -19
- data/lib/cybersource_rest_client/models/inline_response_201_13_line_items.rb +20 -51
- data/lib/cybersource_rest_client/models/{inline_response_201_14_order.rb → inline_response_201_13_order.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_14_payment.rb → inline_response_201_13_payment.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_14_ucp.rb → inline_response_201_13_ucp.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_14_ucp_capabilities.rb → inline_response_201_13_ucp_capabilities.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_3.rb +82 -39
- data/lib/cybersource_rest_client/models/{inline_response_201_5_error_information.rb → inline_response_201_3_error_information.rb} +3 -3
- data/lib/cybersource_rest_client/models/{inline_response_201_5_error_information_details.rb → inline_response_201_3_error_information_details.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_5_order_information.rb → inline_response_201_3_order_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/inline_response_201_3_order_information_amount_details.rb +315 -0
- data/lib/cybersource_rest_client/models/inline_response_201_3_processing_information.rb +189 -0
- data/lib/cybersource_rest_client/models/{inline_response_201_4_processing_information_routing.rb → inline_response_201_3_processing_information_routing.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_3_processor_information.rb +213 -0
- data/lib/cybersource_rest_client/models/inline_response_201_4.rb +41 -30
- data/lib/cybersource_rest_client/models/{inline_response_201_5__links.rb → inline_response_201_4__links.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_5__links_self.rb → inline_response_201_4__links_self.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_5_acquirer_information.rb → inline_response_201_4_acquirer_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_5_client_reference_information.rb → inline_response_201_4_client_reference_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_4_error_information.rb +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_4_error_information_details.rb +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_5_merchant_information.rb → inline_response_201_4_merchant_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_4_order_information_amount_details.rb +46 -97
- data/lib/cybersource_rest_client/models/{inline_response_201_5_payment_information.rb → inline_response_201_4_payment_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_5_payment_information_card.rb → inline_response_201_4_payment_information_card.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_4_processing_information.rb +59 -8
- data/lib/cybersource_rest_client/models/{inline_response_201_5_processing_information_payouts_options.rb → inline_response_201_4_processing_information_payouts_options.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_4_processor_information.rb +342 -7
- data/lib/cybersource_rest_client/models/{inline_response_201_5_processor_information_card_verification.rb → inline_response_201_4_processor_information_card_verification.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_5_transactions.rb → inline_response_201_4_transactions.rb} +7 -7
- data/lib/cybersource_rest_client/models/inline_response_201_5.rb +35 -68
- data/lib/cybersource_rest_client/models/{inline_response_201_6_payout_information.rb → inline_response_201_5_payout_information.rb} +3 -3
- data/lib/cybersource_rest_client/models/{inline_response_201_6_payout_information_pull_funds.rb → inline_response_201_5_payout_information_pull_funds.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_6_payout_information_push_funds.rb → inline_response_201_5_payout_information_push_funds.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_6.rb +59 -26
- data/lib/cybersource_rest_client/models/{inline_response_201_7_integration_information.rb → inline_response_201_6_integration_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_7_integration_information_tenant_configurations.rb → inline_response_201_6_integration_information_tenant_configurations.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_7_organization_information.rb → inline_response_201_6_organization_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_7_product_information_setups.rb → inline_response_201_6_product_information_setups.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_7_registration_information.rb → inline_response_201_6_registration_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_7_setups.rb → inline_response_201_6_setups.rb} +4 -4
- data/lib/cybersource_rest_client/models/{inline_response_201_7_setups_commerce_solutions.rb → inline_response_201_6_setups_commerce_solutions.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_7_setups_risk.rb → inline_response_201_6_setups_risk.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_201_7_setups_value_added_services.rb → inline_response_201_6_setups_value_added_services.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_7.rb +19 -78
- data/lib/cybersource_rest_client/models/{inline_response_201_8_key_information.rb → inline_response_201_7_key_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_8_key_information_error_information.rb → inline_response_201_7_key_information_error_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_8_key_information_error_information_details.rb → inline_response_201_7_key_information_error_information_details.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_201_8.rb +117 -25
- data/lib/cybersource_rest_client/models/inline_response_201_9.rb +68 -105
- data/lib/cybersource_rest_client/models/{inline_response_201_10_payloads.rb → inline_response_201_9_payloads.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_201_10_payloads_test_payload.rb → inline_response_201_9_payloads_test_payload.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_400_3.rb +1 -1
- data/lib/cybersource_rest_client/models/inline_response_400_4.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_post201_response_merchant_defined_field_values_with_definition.rb +11 -1
- data/lib/cybersource_rest_client/models/ucv1sessions_complete_mandate.rb +16 -5
- data/lib/cybersource_rest_client/models/ucv1sessions_data.rb +11 -1
- data/lib/cybersource_rest_client/models/ucv1sessions_data_acquirer_information.rb +196 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_aggregator_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ucv1sessions_data_consumer_authentication_information.rb +16 -5
- data/lib/cybersource_rest_client/models/{inline_response_201_14_line_items.rb → unified_risk_post201_response.rb} +28 -42
- data/lib/cybersource_rest_client/models/{inline_response_201_3_results.rb → unified_risk_post201_response_results.rb} +3 -3
- data/lib/cybersource_rest_client/models/unified_risk_post201_response_results_risk_insights.rb +291 -0
- data/lib/cybersource_rest_client/models/unified_risk_post201_response_results_risk_insights_client.rb +208 -0
- data/lib/cybersource_rest_client/models/unified_risk_post201_response_results_risk_insights_error.rb +202 -0
- data/lib/cybersource_rest_client/models/unified_risk_post201_response_results_risk_insights_packages.rb +190 -0
- data/lib/cybersource_rest_client/models/unified_risk_post201_response_results_risk_insights_packages_transaction_insights.rb +250 -0
- data/lib/cybersource_rest_client/models/unified_risk_post201_response_results_risk_insights_packages_transaction_insights_insights.rb +219 -0
- data/lib/cybersource_rest_client/models/unified_risk_post201_response_transaction_insights_insights_warnings.rb +214 -0
- data/lib/cybersource_rest_client/models/{unified_risk_labels_post400_response.rb → unified_risk_post400_response.rb} +2 -2
- data/lib/cybersource_rest_client/models/{unified_risk_labels_post400_response_errors.rb → unified_risk_post400_response_errors.rb} +1 -1
- data/lib/cybersource_rest_client/models/unifiedrisk_account.rb +190 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_acquirer.rb +302 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_acquirer_merchant_account.rb +234 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_acquirer_merchant_account_security_amount.rb +246 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_authentication.rb +402 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_authentication_challenge.rb +202 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_authorization.rb +212 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_browser.rb +420 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_customer.rb +403 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_customer_address.rb +279 -0
- data/lib/cybersource_rest_client/models/{inline_response_201_5_processing_information.rb → unifiedrisk_customer_personal_identification.rb} +99 -42
- data/lib/cybersource_rest_client/models/unifiedrisk_device.rb +681 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_device_point_of_sale.rb +344 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_initiating_party.rb +223 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant.rb +326 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_address.rb +328 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor.rb +389 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_annual_sales.rb +268 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_average_ticket_size.rb +246 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_monthly_sales.rb +268 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_hierarchy.rb +224 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_limit_value.rb +257 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_trading_address.rb +301 -0
- data/lib/cybersource_rest_client/models/{label_request.rb → unifiedrisk_order.rb} +60 -72
- data/lib/cybersource_rest_client/models/unifiedrisk_order_billing.rb +360 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_order_line_items.rb +262 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_order_shipping.rb +464 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_order_shipping_store.rb +251 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_order_shipping_store_address.rb +191 -0
- data/lib/cybersource_rest_client/models/{inline_response_201_3_results_risk_insights.rb → unifiedrisk_order_shipping_store_store_address.rb} +43 -43
- data/lib/cybersource_rest_client/models/unifiedrisk_partner.rb +214 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment.rb +423 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_approvals.rb +193 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_bank_account.rb +451 -0
- data/lib/cybersource_rest_client/models/{inline_response_201_5_order_information_amount_details.rb → unifiedrisk_payment_bank_account_balance_before.rb} +49 -56
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_bank_account_branch_address.rb +328 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_bank_account_credit_limit.rb +257 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_bank_account_financial_institution.rb +212 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_batch.rb +323 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_card.rb +461 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_card_par_details.rb +196 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_card_token_details.rb +380 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_check.rb +289 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_check_deposit_location.rb +279 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_counterparty.rb +287 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_counterparty_address.rb +279 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_counterparty_branch_address.rb +279 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_sdk.rb +268 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_token.rb +213 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification.rb +230 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification_additional.rb +256 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification_authentication.rb +232 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification_authentication_pin.rb +201 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification_authentication_three_ds.rb +190 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification_card_security.rb +199 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification_card_security_avs.rb +218 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification_card_security_cvv.rb +196 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_verification_digital.rb +212 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_wallet.rb +201 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_wire.rb +364 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb +308 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_risk_assessment_buyer_history.rb +276 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_risk_assessment_buyer_history_account_history.rb +207 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_risk_assessment_buyer_history_customer_account.rb +273 -0
- data/lib/cybersource_rest_client/models/{inline_response_201_14.rb → unifiedrisk_risk_assessment_buyer_history_customer_account_alertnate_authentication.rb} +59 -114
- data/lib/cybersource_rest_client/models/unifiedrisk_risk_assessment_vital4.rb +191 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_session.rb +202 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_terminal.rb +238 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_terminal_address.rb +301 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_terminal_capabilities.rb +234 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_third_party_risk.rb +708 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_third_party_risk_raw_data.rb +189 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction.rb +305 -12
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_additional_fees.rb +257 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_amount.rb +257 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_batch_details.rb +220 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_batch_details_batch_credits_amount.rb +246 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_batch_details_batch_debits_amount.rb +246 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_batch_details_file_credits.rb +246 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_batch_details_file_debits.rb +246 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_check_details.rb +190 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_check_details_deposited_cash_amount.rb +246 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_recurring_details.rb +341 -0
- data/lib/cybersource_rest_client/models/unifiedrisk_travel.rb +279 -0
- data/lib/cybersource_rest_client/models/vpri_request.rb +505 -0
- data/lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data.rb +190 -0
- data/lib/cybersource_rest_client/models/vpri_transaction_insights_additional_data_card_bin_data.rb +357 -0
- data/lib/cybersource_rest_client.rb +153 -61
- metadata +155 -63
- data/lib/cybersource_rest_client/api/transaction_risk_labeling_api.rb +0 -104
- data/lib/cybersource_rest_client/models/inline_response_201_5_processor_information.rb +0 -548
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CyberSource Merged Spec
|
|
3
|
+
|
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.38
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
module CyberSource
|
|
15
|
+
# Physical address of the terminal (branch, ATM, or POS device), used for geographic risk analysis and distance-to-home fraud detection
|
|
16
|
+
class UnifiedriskTerminalAddress
|
|
17
|
+
# First line of the terminal's physical address (street number and name), used for geographic risk analysis and terminal location verification
|
|
18
|
+
attr_accessor :address_line1
|
|
19
|
+
|
|
20
|
+
# Second line of the terminal's address for additional location details (building name, floor, suite)
|
|
21
|
+
attr_accessor :address_line2
|
|
22
|
+
|
|
23
|
+
# Third line of the terminal's address for further location details
|
|
24
|
+
attr_accessor :address_line3
|
|
25
|
+
|
|
26
|
+
# Type classification of the terminal address (e.g., BRANCH, ATM_INDOOR, ATM_OUTDOOR, KIOSK). Used for terminal risk profiling
|
|
27
|
+
attr_accessor :address_type
|
|
28
|
+
|
|
29
|
+
# ISO 3166-1 alpha-3 country code for the terminal's physical location (e.g., GBR, USA, AUS)
|
|
30
|
+
attr_accessor :country
|
|
31
|
+
|
|
32
|
+
# State, province, or region of the terminal's physical location, used for regional fraud pattern analysis
|
|
33
|
+
attr_accessor :administrative_area
|
|
34
|
+
|
|
35
|
+
# Geographic latitude coordinate of the terminal's physical location in decimal degrees, used for proximity and geolocation risk signals
|
|
36
|
+
attr_accessor :latitude
|
|
37
|
+
|
|
38
|
+
# Geographic longitude coordinate of the terminal's physical location in decimal degrees, used for proximity and geolocation risk signals
|
|
39
|
+
attr_accessor :longitude
|
|
40
|
+
|
|
41
|
+
# Postal code of the terminal's physical location, used for geographic risk clustering and distance-to-home fraud signals
|
|
42
|
+
attr_accessor :postal_code
|
|
43
|
+
|
|
44
|
+
# City or town of the terminal's physical location, used for regional risk analysis and cardholder distance calculation
|
|
45
|
+
attr_accessor :locality
|
|
46
|
+
|
|
47
|
+
# Complete concatenated address of the terminal as a single string, including all lines, locality, postcode, and country
|
|
48
|
+
attr_accessor :full_address
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
:'address_line1' => :'addressLine1',
|
|
54
|
+
:'address_line2' => :'addressLine2',
|
|
55
|
+
:'address_line3' => :'addressLine3',
|
|
56
|
+
:'address_type' => :'addressType',
|
|
57
|
+
:'country' => :'country',
|
|
58
|
+
:'administrative_area' => :'administrativeArea',
|
|
59
|
+
:'latitude' => :'latitude',
|
|
60
|
+
:'longitude' => :'longitude',
|
|
61
|
+
:'postal_code' => :'postalCode',
|
|
62
|
+
:'locality' => :'locality',
|
|
63
|
+
:'full_address' => :'fullAddress'
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Attribute mapping from JSON key to ruby-style variable name.
|
|
68
|
+
def self.json_map
|
|
69
|
+
{
|
|
70
|
+
:'address_line1' => :'address_line1',
|
|
71
|
+
:'address_line2' => :'address_line2',
|
|
72
|
+
:'address_line3' => :'address_line3',
|
|
73
|
+
:'address_type' => :'address_type',
|
|
74
|
+
:'country' => :'country',
|
|
75
|
+
:'administrative_area' => :'administrative_area',
|
|
76
|
+
:'latitude' => :'latitude',
|
|
77
|
+
:'longitude' => :'longitude',
|
|
78
|
+
:'postal_code' => :'postal_code',
|
|
79
|
+
:'locality' => :'locality',
|
|
80
|
+
:'full_address' => :'full_address'
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Attribute type mapping.
|
|
85
|
+
def self.swagger_types
|
|
86
|
+
{
|
|
87
|
+
:'address_line1' => :'String',
|
|
88
|
+
:'address_line2' => :'String',
|
|
89
|
+
:'address_line3' => :'String',
|
|
90
|
+
:'address_type' => :'String',
|
|
91
|
+
:'country' => :'String',
|
|
92
|
+
:'administrative_area' => :'String',
|
|
93
|
+
:'latitude' => :'Float',
|
|
94
|
+
:'longitude' => :'Float',
|
|
95
|
+
:'postal_code' => :'String',
|
|
96
|
+
:'locality' => :'String',
|
|
97
|
+
:'full_address' => :'String'
|
|
98
|
+
}
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Initializes the object
|
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
103
|
+
def initialize(attributes = {})
|
|
104
|
+
return unless attributes.is_a?(Hash)
|
|
105
|
+
|
|
106
|
+
# convert string to symbol for hash key
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
108
|
+
|
|
109
|
+
if attributes.has_key?(:'addressLine1')
|
|
110
|
+
self.address_line1 = attributes[:'addressLine1']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.has_key?(:'addressLine2')
|
|
114
|
+
self.address_line2 = attributes[:'addressLine2']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.has_key?(:'addressLine3')
|
|
118
|
+
self.address_line3 = attributes[:'addressLine3']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.has_key?(:'addressType')
|
|
122
|
+
self.address_type = attributes[:'addressType']
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.has_key?(:'country')
|
|
126
|
+
self.country = attributes[:'country']
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.has_key?(:'administrativeArea')
|
|
130
|
+
self.administrative_area = attributes[:'administrativeArea']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.has_key?(:'latitude')
|
|
134
|
+
self.latitude = attributes[:'latitude']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.has_key?(:'longitude')
|
|
138
|
+
self.longitude = attributes[:'longitude']
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.has_key?(:'postalCode')
|
|
142
|
+
self.postal_code = attributes[:'postalCode']
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.has_key?(:'locality')
|
|
146
|
+
self.locality = attributes[:'locality']
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.has_key?(:'fullAddress')
|
|
150
|
+
self.full_address = attributes[:'fullAddress']
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
155
|
+
# @return Array for valid properties with the reasons
|
|
156
|
+
def list_invalid_properties
|
|
157
|
+
invalid_properties = Array.new
|
|
158
|
+
invalid_properties
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Check to see if the all the properties in the model are valid
|
|
162
|
+
# @return true if the model is valid
|
|
163
|
+
def valid?
|
|
164
|
+
true
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Checks equality by comparing each attribute.
|
|
168
|
+
# @param [Object] Object to be compared
|
|
169
|
+
def ==(o)
|
|
170
|
+
return true if self.equal?(o)
|
|
171
|
+
self.class == o.class &&
|
|
172
|
+
address_line1 == o.address_line1 &&
|
|
173
|
+
address_line2 == o.address_line2 &&
|
|
174
|
+
address_line3 == o.address_line3 &&
|
|
175
|
+
address_type == o.address_type &&
|
|
176
|
+
country == o.country &&
|
|
177
|
+
administrative_area == o.administrative_area &&
|
|
178
|
+
latitude == o.latitude &&
|
|
179
|
+
longitude == o.longitude &&
|
|
180
|
+
postal_code == o.postal_code &&
|
|
181
|
+
locality == o.locality &&
|
|
182
|
+
full_address == o.full_address
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# @see the `==` method
|
|
186
|
+
# @param [Object] Object to be compared
|
|
187
|
+
def eql?(o)
|
|
188
|
+
self == o
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Calculates hash code according to all attributes.
|
|
192
|
+
# @return [Fixnum] Hash code
|
|
193
|
+
def hash
|
|
194
|
+
[address_line1, address_line2, address_line3, address_type, country, administrative_area, latitude, longitude, postal_code, locality, full_address].hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Builds the object from hash
|
|
198
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
199
|
+
# @return [Object] Returns the model itself
|
|
200
|
+
def build_from_hash(attributes)
|
|
201
|
+
return nil unless attributes.is_a?(Hash)
|
|
202
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
203
|
+
if type =~ /\AArray<(.*)>/i
|
|
204
|
+
# check to ensure the input is an array given that the the attribute
|
|
205
|
+
# is documented as an array but the input is not
|
|
206
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
207
|
+
self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
208
|
+
end
|
|
209
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
210
|
+
self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
211
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
self
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Deserializes the data based on type
|
|
218
|
+
# @param string type Data type
|
|
219
|
+
# @param string value Value to be deserialized
|
|
220
|
+
# @return [Object] Deserialized data
|
|
221
|
+
def _deserialize(type, value)
|
|
222
|
+
case type.to_sym
|
|
223
|
+
when :DateTime
|
|
224
|
+
DateTime.parse(value)
|
|
225
|
+
when :Date
|
|
226
|
+
Date.parse(value)
|
|
227
|
+
when :String
|
|
228
|
+
value.to_s
|
|
229
|
+
when :Integer
|
|
230
|
+
value.to_i
|
|
231
|
+
when :Float
|
|
232
|
+
value.to_f
|
|
233
|
+
when :BOOLEAN
|
|
234
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
235
|
+
true
|
|
236
|
+
else
|
|
237
|
+
false
|
|
238
|
+
end
|
|
239
|
+
when :Object
|
|
240
|
+
# generic object (usually a Hash), return directly
|
|
241
|
+
value
|
|
242
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
243
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
244
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
245
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
246
|
+
k_type = Regexp.last_match[:k_type]
|
|
247
|
+
v_type = Regexp.last_match[:v_type]
|
|
248
|
+
{}.tap do |hash|
|
|
249
|
+
value.each do |k, v|
|
|
250
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
else # model
|
|
254
|
+
temp_model = CyberSource.const_get(type).new
|
|
255
|
+
temp_model.build_from_hash(value)
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Returns the string representation of the object
|
|
260
|
+
# @return [String] String presentation of the object
|
|
261
|
+
def to_s
|
|
262
|
+
to_hash.to_s
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
|
267
|
+
def to_body
|
|
268
|
+
to_hash
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Returns the object in the form of hash
|
|
272
|
+
# @return [Hash] Returns the object in the form of hash
|
|
273
|
+
def to_hash
|
|
274
|
+
hash = {}
|
|
275
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
276
|
+
value = self.send(attr)
|
|
277
|
+
next if value.nil?
|
|
278
|
+
hash[param] = _to_hash(value)
|
|
279
|
+
end
|
|
280
|
+
hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Outputs non-array value in the form of hash
|
|
284
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
285
|
+
# @param [Object] value Any valid value
|
|
286
|
+
# @return [Hash] Returns the value in the form of hash
|
|
287
|
+
def _to_hash(value)
|
|
288
|
+
if value.is_a?(Array)
|
|
289
|
+
value.compact.map { |v| _to_hash(v) }
|
|
290
|
+
elsif value.is_a?(Hash)
|
|
291
|
+
{}.tap do |hash|
|
|
292
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
293
|
+
end
|
|
294
|
+
elsif value.respond_to? :to_hash
|
|
295
|
+
value.to_hash
|
|
296
|
+
else
|
|
297
|
+
value
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
end
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CyberSource Merged Spec
|
|
3
|
+
|
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.38
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
module CyberSource
|
|
15
|
+
class UnifiedriskTerminalCapabilities
|
|
16
|
+
# Card reading capabilities of the terminal performing the transaction. ISO 8583:93 bit 22-2; ISO 8583:2003 bit 27-1 CDFL CardOnFile Card information are stored on a file ICPY ICCProximity ICC contactle
|
|
17
|
+
attr_accessor :card_reading
|
|
18
|
+
|
|
19
|
+
# Card writing or output capabilities of the terminal performing the transaction. ISO 8583:93 bit 22-10, ISO 8583:2003 bit 27-8_9 ICPY ICCProximity ICC contactless proximity MGST MagneticStripe Magnetic
|
|
20
|
+
attr_accessor :card_writing
|
|
21
|
+
|
|
22
|
+
# Cardholder verification capabilities performing the transaction at the point of service. ISO 8583:93 bit 22-2, ISO 8583:2003-1 bit 27-2 APKI AccountDigitalSignature Account based digital signature NO
|
|
23
|
+
attr_accessor :cardholder_verification
|
|
24
|
+
|
|
25
|
+
# Capability of the terminal to go online OFLN OffLine Off-line only capable ONLN OnLine On-line only capable BOTH BothOnLineAndOffLine Both online and offline
|
|
26
|
+
attr_accessor :online
|
|
27
|
+
|
|
28
|
+
# If true then pin pad is inoperative
|
|
29
|
+
attr_accessor :pin_pad_inoperative
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'card_reading' => :'cardReading',
|
|
35
|
+
:'card_writing' => :'cardWriting',
|
|
36
|
+
:'cardholder_verification' => :'cardholderVerification',
|
|
37
|
+
:'online' => :'online',
|
|
38
|
+
:'pin_pad_inoperative' => :'pinPadInoperative'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute mapping from JSON key to ruby-style variable name.
|
|
43
|
+
def self.json_map
|
|
44
|
+
{
|
|
45
|
+
:'card_reading' => :'card_reading',
|
|
46
|
+
:'card_writing' => :'card_writing',
|
|
47
|
+
:'cardholder_verification' => :'cardholder_verification',
|
|
48
|
+
:'online' => :'online',
|
|
49
|
+
:'pin_pad_inoperative' => :'pin_pad_inoperative'
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.swagger_types
|
|
55
|
+
{
|
|
56
|
+
:'card_reading' => :'String',
|
|
57
|
+
:'card_writing' => :'String',
|
|
58
|
+
:'cardholder_verification' => :'String',
|
|
59
|
+
:'online' => :'String',
|
|
60
|
+
:'pin_pad_inoperative' => :'BOOLEAN'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Initializes the object
|
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
66
|
+
def initialize(attributes = {})
|
|
67
|
+
return unless attributes.is_a?(Hash)
|
|
68
|
+
|
|
69
|
+
# convert string to symbol for hash key
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
71
|
+
|
|
72
|
+
if attributes.has_key?(:'cardReading')
|
|
73
|
+
self.card_reading = attributes[:'cardReading']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.has_key?(:'cardWriting')
|
|
77
|
+
self.card_writing = attributes[:'cardWriting']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.has_key?(:'cardholderVerification')
|
|
81
|
+
self.cardholder_verification = attributes[:'cardholderVerification']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.has_key?(:'online')
|
|
85
|
+
self.online = attributes[:'online']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.has_key?(:'pinPadInoperative')
|
|
89
|
+
self.pin_pad_inoperative = attributes[:'pinPadInoperative']
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
invalid_properties = Array.new
|
|
97
|
+
invalid_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Check to see if the all the properties in the model are valid
|
|
101
|
+
# @return true if the model is valid
|
|
102
|
+
def valid?
|
|
103
|
+
true
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(o)
|
|
109
|
+
return true if self.equal?(o)
|
|
110
|
+
self.class == o.class &&
|
|
111
|
+
card_reading == o.card_reading &&
|
|
112
|
+
card_writing == o.card_writing &&
|
|
113
|
+
cardholder_verification == o.cardholder_verification &&
|
|
114
|
+
online == o.online &&
|
|
115
|
+
pin_pad_inoperative == o.pin_pad_inoperative
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# @see the `==` method
|
|
119
|
+
# @param [Object] Object to be compared
|
|
120
|
+
def eql?(o)
|
|
121
|
+
self == o
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Calculates hash code according to all attributes.
|
|
125
|
+
# @return [Fixnum] Hash code
|
|
126
|
+
def hash
|
|
127
|
+
[card_reading, card_writing, cardholder_verification, online, pin_pad_inoperative].hash
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Builds the object from hash
|
|
131
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
132
|
+
# @return [Object] Returns the model itself
|
|
133
|
+
def build_from_hash(attributes)
|
|
134
|
+
return nil unless attributes.is_a?(Hash)
|
|
135
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
136
|
+
if type =~ /\AArray<(.*)>/i
|
|
137
|
+
# check to ensure the input is an array given that the the attribute
|
|
138
|
+
# is documented as an array but the input is not
|
|
139
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
140
|
+
self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
141
|
+
end
|
|
142
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
143
|
+
self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
144
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
self
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Deserializes the data based on type
|
|
151
|
+
# @param string type Data type
|
|
152
|
+
# @param string value Value to be deserialized
|
|
153
|
+
# @return [Object] Deserialized data
|
|
154
|
+
def _deserialize(type, value)
|
|
155
|
+
case type.to_sym
|
|
156
|
+
when :DateTime
|
|
157
|
+
DateTime.parse(value)
|
|
158
|
+
when :Date
|
|
159
|
+
Date.parse(value)
|
|
160
|
+
when :String
|
|
161
|
+
value.to_s
|
|
162
|
+
when :Integer
|
|
163
|
+
value.to_i
|
|
164
|
+
when :Float
|
|
165
|
+
value.to_f
|
|
166
|
+
when :BOOLEAN
|
|
167
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
168
|
+
true
|
|
169
|
+
else
|
|
170
|
+
false
|
|
171
|
+
end
|
|
172
|
+
when :Object
|
|
173
|
+
# generic object (usually a Hash), return directly
|
|
174
|
+
value
|
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
|
181
|
+
{}.tap do |hash|
|
|
182
|
+
value.each do |k, v|
|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
else # model
|
|
187
|
+
temp_model = CyberSource.const_get(type).new
|
|
188
|
+
temp_model.build_from_hash(value)
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Returns the string representation of the object
|
|
193
|
+
# @return [String] String presentation of the object
|
|
194
|
+
def to_s
|
|
195
|
+
to_hash.to_s
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_body
|
|
201
|
+
to_hash
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the object in the form of hash
|
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
|
206
|
+
def to_hash
|
|
207
|
+
hash = {}
|
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
209
|
+
value = self.send(attr)
|
|
210
|
+
next if value.nil?
|
|
211
|
+
hash[param] = _to_hash(value)
|
|
212
|
+
end
|
|
213
|
+
hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Outputs non-array value in the form of hash
|
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
218
|
+
# @param [Object] value Any valid value
|
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
|
220
|
+
def _to_hash(value)
|
|
221
|
+
if value.is_a?(Array)
|
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
|
223
|
+
elsif value.is_a?(Hash)
|
|
224
|
+
{}.tap do |hash|
|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
226
|
+
end
|
|
227
|
+
elsif value.respond_to? :to_hash
|
|
228
|
+
value.to_hash
|
|
229
|
+
else
|
|
230
|
+
value
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
end
|