pnz-payments-sdk 1.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 +7 -0
- data/LICENSE +28 -0
- data/README.md +98 -0
- data/lib/account_and_transaction_api_specification/api_helper.rb +10 -0
- data/lib/account_and_transaction_api_specification/client.rb +114 -0
- data/lib/account_and_transaction_api_specification/configuration.rb +127 -0
- data/lib/account_and_transaction_api_specification/controllers/accounts_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/balances_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/base_controller.rb +66 -0
- data/lib/account_and_transaction_api_specification/controllers/beneficiaries_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/direct_debits_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/offers_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/party_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/scheduled_payments_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/standing_orders_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/statements_controller.rb +421 -0
- data/lib/account_and_transaction_api_specification/controllers/transactions_controller.rb +170 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_balances400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_balances403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_balances500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_balances503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_beneficiaries400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_beneficiaries403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_beneficiaries500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_beneficiaries503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_direct_debits400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_direct_debits403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_direct_debits500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_direct_debits503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_offers400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_offers403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_offers500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_offers503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_party400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_party403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_party500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_party503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_scheduled_payments400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_scheduled_payments403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_scheduled_payments500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_scheduled_payments503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_standing_orders400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_standing_orders403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_standing_orders500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_standing_orders503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements_transactions400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements_transactions403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements_transactions500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements_transactions503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_transactions400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_transactions403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_transactions500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_transactions503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/api_exception.rb +21 -0
- data/lib/account_and_transaction_api_specification/exceptions/balances400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/balances403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/balances500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/balances503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/beneficiaries400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/beneficiaries403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/beneficiaries500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/beneficiaries503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/direct_debits400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/direct_debits403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/direct_debits500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/direct_debits503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/offers400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/offers403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/offers500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/offers503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/party400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/party403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/party500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/party503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/scheduled_payments400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/scheduled_payments403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/scheduled_payments500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/scheduled_payments503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/standing_orders400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/standing_orders403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/standing_orders500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/standing_orders503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/statements400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/statements403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/statements500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/statements503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/transactions400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/transactions403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/transactions500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/transactions503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/http/auth/o_auth2.rb +43 -0
- data/lib/account_and_transaction_api_specification/http/http_call_back.rb +10 -0
- data/lib/account_and_transaction_api_specification/http/http_method_enum.rb +10 -0
- data/lib/account_and_transaction_api_specification/http/http_request.rb +10 -0
- data/lib/account_and_transaction_api_specification/http/http_response.rb +10 -0
- data/lib/account_and_transaction_api_specification/models/account.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent_model.rb +60 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent_pos_tresponse.rb +86 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent_response.rb +86 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent_response_model.rb +120 -0
- data/lib/account_and_transaction_api_specification/models/account_access_status_enum.rb +29 -0
- data/lib/account_and_transaction_api_specification/models/account_model.rb +137 -0
- data/lib/account_and_transaction_api_specification/models/account_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/account_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/account_scheme_model_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/account_sub_type_enum.rb +41 -0
- data/lib/account_and_transaction_api_specification/models/account_type_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/address.rb +137 -0
- data/lib/account_and_transaction_api_specification/models/address_type_enum.rb +20 -0
- data/lib/account_and_transaction_api_specification/models/address_type_option_enum.rb +41 -0
- data/lib/account_and_transaction_api_specification/models/amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/authorisation_type_enum.rb +26 -0
- data/lib/account_and_transaction_api_specification/models/balance.rb +82 -0
- data/lib/account_and_transaction_api_specification/models/balance_model.rb +136 -0
- data/lib/account_and_transaction_api_specification/models/balance_model_type_enum.rb +47 -0
- data/lib/account_and_transaction_api_specification/models/balances_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/balances_response_data.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/bank_transaction_code.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/base_model.rb +110 -0
- data/lib/account_and_transaction_api_specification/models/becs_remittance.rb +109 -0
- data/lib/account_and_transaction_api_specification/models/beneficiaries_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/beneficiaries_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/beneficiary_model.rb +110 -0
- data/lib/account_and_transaction_api_specification/models/card_instrument.rb +97 -0
- data/lib/account_and_transaction_api_specification/models/card_scheme_name_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/consent.rb +145 -0
- data/lib/account_and_transaction_api_specification/models/credit_debit_indicator_enum.rb +24 -0
- data/lib/account_and_transaction_api_specification/models/credit_line.rb +82 -0
- data/lib/account_and_transaction_api_specification/models/credit_line_type_enum.rb +26 -0
- data/lib/account_and_transaction_api_specification/models/creditor_account.rb +102 -0
- data/lib/account_and_transaction_api_specification/models/creditor_agent.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/creditor_reference.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/currency_exchange.rb +147 -0
- data/lib/account_and_transaction_api_specification/models/data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/debtor_account.rb +102 -0
- data/lib/account_and_transaction_api_specification/models/debtor_agent.rb +70 -0
- data/lib/account_and_transaction_api_specification/models/debtor_reference.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/delivery_address.rb +138 -0
- data/lib/account_and_transaction_api_specification/models/direct_debit_model.rb +146 -0
- data/lib/account_and_transaction_api_specification/models/direct_debit_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/direct_debit_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/direct_debit_status_code_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/error.rb +92 -0
- data/lib/account_and_transaction_api_specification/models/error_code_enum.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/error_response.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/fee.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/final_payment_amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/first_payment_amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/geo_location.rb +72 -0
- data/lib/account_and_transaction_api_specification/models/get_account_offers_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_party_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_party_response_data.rb +62 -0
- data/lib/account_and_transaction_api_specification/models/get_account_scheduled_payments_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statement_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statement_response_data.rb +62 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statement_transactions_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statement_transactions_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statements_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statements_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/get_offers_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_offers_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/get_party_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_scheduled_payments_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_scheduled_payments_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/get_statements_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_statements_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/instructed_amount.rb +73 -0
- data/lib/account_and_transaction_api_specification/models/links.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/merchant_details.rb +75 -0
- data/lib/account_and_transaction_api_specification/models/meta.rb +112 -0
- data/lib/account_and_transaction_api_specification/models/meta_data.rb +112 -0
- data/lib/account_and_transaction_api_specification/models/next_payment_amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/offer_model.rb +199 -0
- data/lib/account_and_transaction_api_specification/models/offer_type_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/party_model.rb +144 -0
- data/lib/account_and_transaction_api_specification/models/party_type_enum.rb +26 -0
- data/lib/account_and_transaction_api_specification/models/payment_context_code_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/permission_enum.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/postal_address.rb +138 -0
- data/lib/account_and_transaction_api_specification/models/previous_payment_amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/proprietary_bank_transaction_code.rb +70 -0
- data/lib/account_and_transaction_api_specification/models/reference.rb +95 -0
- data/lib/account_and_transaction_api_specification/models/risk.rb +164 -0
- data/lib/account_and_transaction_api_specification/models/scheduled_payment_model.rb +155 -0
- data/lib/account_and_transaction_api_specification/models/scheduled_type_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/scheme_name_enum.rb +21 -0
- data/lib/account_and_transaction_api_specification/models/servicer.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/standing_order_model.rb +289 -0
- data/lib/account_and_transaction_api_specification/models/standing_order_status_code_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/standing_orders_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/standing_orders_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/statement.rb +313 -0
- data/lib/account_and_transaction_api_specification/models/statement_amount.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/statement_amount_type_enum.rb +83 -0
- data/lib/account_and_transaction_api_specification/models/statement_benefit.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/statement_benefit_type_enum.rb +29 -0
- data/lib/account_and_transaction_api_specification/models/statement_date_time.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/statement_date_time_type_enum.rb +41 -0
- data/lib/account_and_transaction_api_specification/models/statement_fee.rb +80 -0
- data/lib/account_and_transaction_api_specification/models/statement_fee_type_enum.rb +59 -0
- data/lib/account_and_transaction_api_specification/models/statement_interest.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/statement_interest_type_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/statement_model.rb +313 -0
- data/lib/account_and_transaction_api_specification/models/statement_rate.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/statement_rate_type_enum.rb +47 -0
- data/lib/account_and_transaction_api_specification/models/statement_type_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/statement_value.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/statement_value_type_enum.rb +41 -0
- data/lib/account_and_transaction_api_specification/models/transaction_model.rb +333 -0
- data/lib/account_and_transaction_api_specification/models/transaction_reference.rb +95 -0
- data/lib/account_and_transaction_api_specification/models/transaction_status_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/transactions_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/transactions_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/utilities/date_time_helper.rb +11 -0
- data/lib/account_and_transaction_api_specification/utilities/file_wrapper.rb +28 -0
- data/lib/account_and_transaction_api_specification.rb +439 -0
- data/test/controllers/controller_test_base.rb +29 -0
- data/test/controllers/test_accounts_controller.rb +45 -0
- data/test/controllers/test_balances_controller.rb +45 -0
- data/test/controllers/test_beneficiaries_controller.rb +45 -0
- data/test/controllers/test_direct_debits_controller.rb +45 -0
- data/test/controllers/test_offers_controller.rb +45 -0
- data/test/controllers/test_party_controller.rb +45 -0
- data/test/controllers/test_scheduled_payments_controller.rb +45 -0
- data/test/controllers/test_standing_orders_controller.rb +45 -0
- data/test/controllers/test_statements_controller.rb +49 -0
- data/test/controllers/test_transactions_controller.rb +49 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +349 -0
@@ -0,0 +1,313 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module AccountAndTransactionApiSpecification
|
8
|
+
# Statement Model.
|
9
|
+
class Statement < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# A unique and immutable identifier used to identify the account resource.
|
14
|
+
# This identifier has no meaning to the account owner.
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :account_id
|
17
|
+
|
18
|
+
# Unique identifier for the statement resource within an servicing
|
19
|
+
# institution. This identifier is both unique and immutable.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :statement_id
|
22
|
+
|
23
|
+
# Unique reference for the statement. This reference may be optionally
|
24
|
+
# populated if available.
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :statement_reference
|
27
|
+
|
28
|
+
# Statement type, in a coded form.
|
29
|
+
# @return [StatementTypeEnum]
|
30
|
+
attr_accessor :type
|
31
|
+
|
32
|
+
# Date and time at which the statement period starts.
|
33
|
+
# All dates in the JSON payloads are represented in ISO 8601 date-time
|
34
|
+
# format.
|
35
|
+
# All date-time fields in responses must include the timezone. An example is
|
36
|
+
# below:
|
37
|
+
# 2017-04-05T10:43:07+00:00
|
38
|
+
# @return [DateTime]
|
39
|
+
attr_accessor :start_date_time
|
40
|
+
|
41
|
+
# Date and time at which the statement period ends.
|
42
|
+
# All dates in the JSON payloads are represented in ISO 8601 date-time
|
43
|
+
# format.
|
44
|
+
# All date-time fields in responses must include the timezone. An example is
|
45
|
+
# below:
|
46
|
+
# 2017-04-05T10:43:07+00:00
|
47
|
+
# @return [DateTime]
|
48
|
+
attr_accessor :end_date_time
|
49
|
+
|
50
|
+
# Date and time at which the resource was created.
|
51
|
+
# All dates in the JSON payloads are represented in ISO 8601 date-time
|
52
|
+
# format.
|
53
|
+
# All date-time fields in responses must include the timezone. An example is
|
54
|
+
# below:
|
55
|
+
# 2017-04-05T10:43:07+00:00
|
56
|
+
# @return [DateTime]
|
57
|
+
attr_accessor :creation_date_time
|
58
|
+
|
59
|
+
# Other descriptions that may be available for the statement resource.
|
60
|
+
# @return [Array[String]]
|
61
|
+
attr_accessor :statement_description
|
62
|
+
|
63
|
+
# Set of elements used to provide details of a benefit or reward amount for
|
64
|
+
# the statement resource.
|
65
|
+
# @return [Array[StatementBenefit]]
|
66
|
+
attr_accessor :statement_benefit
|
67
|
+
|
68
|
+
# Set of elements used to provide details of a fee for the statement
|
69
|
+
# resource.
|
70
|
+
# @return [Array[StatementFee]]
|
71
|
+
attr_accessor :statement_fee
|
72
|
+
|
73
|
+
# Set of elements used to provide details of a generic interest amount
|
74
|
+
# related to the statement resource.
|
75
|
+
# @return [Array[StatementInterest]]
|
76
|
+
attr_accessor :statement_interest
|
77
|
+
|
78
|
+
# Set of elements used to provide details of a generic date time for the
|
79
|
+
# statement resource.
|
80
|
+
# @return [Array[StatementDateTime]]
|
81
|
+
attr_accessor :statement_date_time
|
82
|
+
|
83
|
+
# Set of elements used to provide details of a generic rate related to the
|
84
|
+
# statement resource.
|
85
|
+
# @return [Array[StatementRate]]
|
86
|
+
attr_accessor :statement_rate
|
87
|
+
|
88
|
+
# Set of elements used to provide details of a generic number value related
|
89
|
+
# to the statement resource.
|
90
|
+
# @return [Array[StatementValue]]
|
91
|
+
attr_accessor :statement_value
|
92
|
+
|
93
|
+
# Set of elements used to provide details of a generic amount for the
|
94
|
+
# statement resource.
|
95
|
+
# @return [Array[StatementAmount]]
|
96
|
+
attr_accessor :statement_amount
|
97
|
+
|
98
|
+
# A mapping from model property names to API property names.
|
99
|
+
def self.names
|
100
|
+
@_hash = {} if @_hash.nil?
|
101
|
+
@_hash['account_id'] = 'AccountId'
|
102
|
+
@_hash['statement_id'] = 'StatementId'
|
103
|
+
@_hash['statement_reference'] = 'StatementReference'
|
104
|
+
@_hash['type'] = 'Type'
|
105
|
+
@_hash['start_date_time'] = 'StartDateTime'
|
106
|
+
@_hash['end_date_time'] = 'EndDateTime'
|
107
|
+
@_hash['creation_date_time'] = 'CreationDateTime'
|
108
|
+
@_hash['statement_description'] = 'StatementDescription'
|
109
|
+
@_hash['statement_benefit'] = 'StatementBenefit'
|
110
|
+
@_hash['statement_fee'] = 'StatementFee'
|
111
|
+
@_hash['statement_interest'] = 'StatementInterest'
|
112
|
+
@_hash['statement_date_time'] = 'StatementDateTime'
|
113
|
+
@_hash['statement_rate'] = 'StatementRate'
|
114
|
+
@_hash['statement_value'] = 'StatementValue'
|
115
|
+
@_hash['statement_amount'] = 'StatementAmount'
|
116
|
+
@_hash
|
117
|
+
end
|
118
|
+
|
119
|
+
# An array for optional fields
|
120
|
+
def self.optionals
|
121
|
+
%w[
|
122
|
+
statement_id
|
123
|
+
statement_reference
|
124
|
+
statement_description
|
125
|
+
statement_benefit
|
126
|
+
statement_fee
|
127
|
+
statement_interest
|
128
|
+
statement_date_time
|
129
|
+
statement_rate
|
130
|
+
statement_value
|
131
|
+
statement_amount
|
132
|
+
]
|
133
|
+
end
|
134
|
+
|
135
|
+
# An array for nullable fields
|
136
|
+
def self.nullables
|
137
|
+
[]
|
138
|
+
end
|
139
|
+
|
140
|
+
def initialize(account_id = nil, type = nil, start_date_time = nil,
|
141
|
+
end_date_time = nil, creation_date_time = nil,
|
142
|
+
statement_id = SKIP, statement_reference = SKIP,
|
143
|
+
statement_description = SKIP, statement_benefit = SKIP,
|
144
|
+
statement_fee = SKIP, statement_interest = SKIP,
|
145
|
+
statement_date_time = SKIP, statement_rate = SKIP,
|
146
|
+
statement_value = SKIP, statement_amount = SKIP)
|
147
|
+
@account_id = account_id
|
148
|
+
@statement_id = statement_id unless statement_id == SKIP
|
149
|
+
@statement_reference = statement_reference unless statement_reference == SKIP
|
150
|
+
@type = type
|
151
|
+
@start_date_time = start_date_time
|
152
|
+
@end_date_time = end_date_time
|
153
|
+
@creation_date_time = creation_date_time
|
154
|
+
@statement_description = statement_description unless statement_description == SKIP
|
155
|
+
@statement_benefit = statement_benefit unless statement_benefit == SKIP
|
156
|
+
@statement_fee = statement_fee unless statement_fee == SKIP
|
157
|
+
@statement_interest = statement_interest unless statement_interest == SKIP
|
158
|
+
@statement_date_time = statement_date_time unless statement_date_time == SKIP
|
159
|
+
@statement_rate = statement_rate unless statement_rate == SKIP
|
160
|
+
@statement_value = statement_value unless statement_value == SKIP
|
161
|
+
@statement_amount = statement_amount unless statement_amount == SKIP
|
162
|
+
end
|
163
|
+
|
164
|
+
# Creates an instance of the object from a hash.
|
165
|
+
def self.from_hash(hash)
|
166
|
+
return nil unless hash
|
167
|
+
|
168
|
+
# Extract variables from the hash.
|
169
|
+
account_id = hash.key?('AccountId') ? hash['AccountId'] : nil
|
170
|
+
type = hash.key?('Type') ? hash['Type'] : nil
|
171
|
+
start_date_time = if hash.key?('StartDateTime')
|
172
|
+
(DateTimeHelper.from_rfc3339(hash['StartDateTime']) if hash['StartDateTime'])
|
173
|
+
end
|
174
|
+
end_date_time = if hash.key?('EndDateTime')
|
175
|
+
(DateTimeHelper.from_rfc3339(hash['EndDateTime']) if hash['EndDateTime'])
|
176
|
+
end
|
177
|
+
creation_date_time = if hash.key?('CreationDateTime')
|
178
|
+
(DateTimeHelper.from_rfc3339(hash['CreationDateTime']) if hash['CreationDateTime'])
|
179
|
+
end
|
180
|
+
statement_id = hash.key?('StatementId') ? hash['StatementId'] : SKIP
|
181
|
+
statement_reference =
|
182
|
+
hash.key?('StatementReference') ? hash['StatementReference'] : SKIP
|
183
|
+
statement_description =
|
184
|
+
hash.key?('StatementDescription') ? hash['StatementDescription'] : SKIP
|
185
|
+
# Parameter is an array, so we need to iterate through it
|
186
|
+
statement_benefit = nil
|
187
|
+
unless hash['StatementBenefit'].nil?
|
188
|
+
statement_benefit = []
|
189
|
+
hash['StatementBenefit'].each do |structure|
|
190
|
+
statement_benefit << (StatementBenefit.from_hash(structure) if structure)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
statement_benefit = SKIP unless hash.key?('StatementBenefit')
|
195
|
+
# Parameter is an array, so we need to iterate through it
|
196
|
+
statement_fee = nil
|
197
|
+
unless hash['StatementFee'].nil?
|
198
|
+
statement_fee = []
|
199
|
+
hash['StatementFee'].each do |structure|
|
200
|
+
statement_fee << (StatementFee.from_hash(structure) if structure)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
statement_fee = SKIP unless hash.key?('StatementFee')
|
205
|
+
# Parameter is an array, so we need to iterate through it
|
206
|
+
statement_interest = nil
|
207
|
+
unless hash['StatementInterest'].nil?
|
208
|
+
statement_interest = []
|
209
|
+
hash['StatementInterest'].each do |structure|
|
210
|
+
statement_interest << (StatementInterest.from_hash(structure) if structure)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
statement_interest = SKIP unless hash.key?('StatementInterest')
|
215
|
+
# Parameter is an array, so we need to iterate through it
|
216
|
+
statement_date_time = nil
|
217
|
+
unless hash['StatementDateTime'].nil?
|
218
|
+
statement_date_time = []
|
219
|
+
hash['StatementDateTime'].each do |structure|
|
220
|
+
statement_date_time << (StatementDateTime.from_hash(structure) if structure)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
statement_date_time = SKIP unless hash.key?('StatementDateTime')
|
225
|
+
# Parameter is an array, so we need to iterate through it
|
226
|
+
statement_rate = nil
|
227
|
+
unless hash['StatementRate'].nil?
|
228
|
+
statement_rate = []
|
229
|
+
hash['StatementRate'].each do |structure|
|
230
|
+
statement_rate << (StatementRate.from_hash(structure) if structure)
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
statement_rate = SKIP unless hash.key?('StatementRate')
|
235
|
+
# Parameter is an array, so we need to iterate through it
|
236
|
+
statement_value = nil
|
237
|
+
unless hash['StatementValue'].nil?
|
238
|
+
statement_value = []
|
239
|
+
hash['StatementValue'].each do |structure|
|
240
|
+
statement_value << (StatementValue.from_hash(structure) if structure)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
statement_value = SKIP unless hash.key?('StatementValue')
|
245
|
+
# Parameter is an array, so we need to iterate through it
|
246
|
+
statement_amount = nil
|
247
|
+
unless hash['StatementAmount'].nil?
|
248
|
+
statement_amount = []
|
249
|
+
hash['StatementAmount'].each do |structure|
|
250
|
+
statement_amount << (StatementAmount.from_hash(structure) if structure)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
statement_amount = SKIP unless hash.key?('StatementAmount')
|
255
|
+
|
256
|
+
# Create object from extracted values.
|
257
|
+
Statement.new(account_id,
|
258
|
+
type,
|
259
|
+
start_date_time,
|
260
|
+
end_date_time,
|
261
|
+
creation_date_time,
|
262
|
+
statement_id,
|
263
|
+
statement_reference,
|
264
|
+
statement_description,
|
265
|
+
statement_benefit,
|
266
|
+
statement_fee,
|
267
|
+
statement_interest,
|
268
|
+
statement_date_time,
|
269
|
+
statement_rate,
|
270
|
+
statement_value,
|
271
|
+
statement_amount)
|
272
|
+
end
|
273
|
+
|
274
|
+
def to_custom_start_date_time
|
275
|
+
DateTimeHelper.to_rfc3339(start_date_time)
|
276
|
+
end
|
277
|
+
|
278
|
+
def to_custom_end_date_time
|
279
|
+
DateTimeHelper.to_rfc3339(end_date_time)
|
280
|
+
end
|
281
|
+
|
282
|
+
def to_custom_creation_date_time
|
283
|
+
DateTimeHelper.to_rfc3339(creation_date_time)
|
284
|
+
end
|
285
|
+
|
286
|
+
# Provides a human-readable string representation of the object.
|
287
|
+
def to_s
|
288
|
+
class_name = self.class.name.split('::').last
|
289
|
+
"<#{class_name} account_id: #{@account_id}, statement_id: #{@statement_id},"\
|
290
|
+
" statement_reference: #{@statement_reference}, type: #{@type}, start_date_time:"\
|
291
|
+
" #{@start_date_time}, end_date_time: #{@end_date_time}, creation_date_time:"\
|
292
|
+
" #{@creation_date_time}, statement_description: #{@statement_description},"\
|
293
|
+
" statement_benefit: #{@statement_benefit}, statement_fee: #{@statement_fee},"\
|
294
|
+
" statement_interest: #{@statement_interest}, statement_date_time: #{@statement_date_time},"\
|
295
|
+
" statement_rate: #{@statement_rate}, statement_value: #{@statement_value},"\
|
296
|
+
" statement_amount: #{@statement_amount}>"
|
297
|
+
end
|
298
|
+
|
299
|
+
# Provides a debugging-friendly string with detailed object information.
|
300
|
+
def inspect
|
301
|
+
class_name = self.class.name.split('::').last
|
302
|
+
"<#{class_name} account_id: #{@account_id.inspect}, statement_id: #{@statement_id.inspect},"\
|
303
|
+
" statement_reference: #{@statement_reference.inspect}, type: #{@type.inspect},"\
|
304
|
+
" start_date_time: #{@start_date_time.inspect}, end_date_time: #{@end_date_time.inspect},"\
|
305
|
+
" creation_date_time: #{@creation_date_time.inspect}, statement_description:"\
|
306
|
+
" #{@statement_description.inspect}, statement_benefit: #{@statement_benefit.inspect},"\
|
307
|
+
" statement_fee: #{@statement_fee.inspect}, statement_interest:"\
|
308
|
+
" #{@statement_interest.inspect}, statement_date_time: #{@statement_date_time.inspect},"\
|
309
|
+
" statement_rate: #{@statement_rate.inspect}, statement_value: #{@statement_value.inspect},"\
|
310
|
+
" statement_amount: #{@statement_amount.inspect}>"
|
311
|
+
end
|
312
|
+
end
|
313
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AccountAndTransactionApiSpecification
|
7
|
+
# Set of elements used to provide details of a generic amount for the
|
8
|
+
# statement resource.
|
9
|
+
class StatementAmount < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Amount of money of the cash balance.
|
14
|
+
# @return [Amount]
|
15
|
+
attr_accessor :amount
|
16
|
+
|
17
|
+
# Indicates whether the balance is a credit or a debit balance. Usage: A
|
18
|
+
# zero balance is considered to be a credit balance.
|
19
|
+
# @return [CreditDebitIndicatorEnum]
|
20
|
+
attr_accessor :credit_debit_indicator
|
21
|
+
|
22
|
+
# Amount type, in a coded form.
|
23
|
+
# @return [StatementAmountTypeEnum]
|
24
|
+
attr_accessor :type
|
25
|
+
|
26
|
+
# A mapping from model property names to API property names.
|
27
|
+
def self.names
|
28
|
+
@_hash = {} if @_hash.nil?
|
29
|
+
@_hash['amount'] = 'Amount'
|
30
|
+
@_hash['credit_debit_indicator'] = 'CreditDebitIndicator'
|
31
|
+
@_hash['type'] = 'Type'
|
32
|
+
@_hash
|
33
|
+
end
|
34
|
+
|
35
|
+
# An array for optional fields
|
36
|
+
def self.optionals
|
37
|
+
[]
|
38
|
+
end
|
39
|
+
|
40
|
+
# An array for nullable fields
|
41
|
+
def self.nullables
|
42
|
+
[]
|
43
|
+
end
|
44
|
+
|
45
|
+
def initialize(amount = nil, credit_debit_indicator = nil, type = nil)
|
46
|
+
@amount = amount
|
47
|
+
@credit_debit_indicator = credit_debit_indicator
|
48
|
+
@type = type
|
49
|
+
end
|
50
|
+
|
51
|
+
# Creates an instance of the object from a hash.
|
52
|
+
def self.from_hash(hash)
|
53
|
+
return nil unless hash
|
54
|
+
|
55
|
+
# Extract variables from the hash.
|
56
|
+
amount = Amount.from_hash(hash['Amount']) if hash['Amount']
|
57
|
+
credit_debit_indicator =
|
58
|
+
hash.key?('CreditDebitIndicator') ? hash['CreditDebitIndicator'] : nil
|
59
|
+
type = hash.key?('Type') ? hash['Type'] : nil
|
60
|
+
|
61
|
+
# Create object from extracted values.
|
62
|
+
StatementAmount.new(amount,
|
63
|
+
credit_debit_indicator,
|
64
|
+
type)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Provides a human-readable string representation of the object.
|
68
|
+
def to_s
|
69
|
+
class_name = self.class.name.split('::').last
|
70
|
+
"<#{class_name} amount: #{@amount}, credit_debit_indicator: #{@credit_debit_indicator},"\
|
71
|
+
" type: #{@type}>"
|
72
|
+
end
|
73
|
+
|
74
|
+
# Provides a debugging-friendly string with detailed object information.
|
75
|
+
def inspect
|
76
|
+
class_name = self.class.name.split('::').last
|
77
|
+
"<#{class_name} amount: #{@amount.inspect}, credit_debit_indicator:"\
|
78
|
+
" #{@credit_debit_indicator.inspect}, type: #{@type.inspect}>"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AccountAndTransactionApiSpecification
|
7
|
+
# Amount type, in a coded form.
|
8
|
+
class StatementAmountTypeEnum
|
9
|
+
STATEMENT_AMOUNT_TYPE_ENUM = [
|
10
|
+
# TODO: Write general description for ARREARSCLOSINGBALANCE
|
11
|
+
ARREARSCLOSINGBALANCE = 'ArrearsClosingBalance'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for AVAILABLEBALANCE
|
14
|
+
AVAILABLEBALANCE = 'AvailableBalance'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for AVERAGEBALANCEWHENINCREDIT
|
17
|
+
AVERAGEBALANCEWHENINCREDIT = 'AverageBalanceWhenInCredit'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for AVERAGEBALANCEWHENINDEBIT
|
20
|
+
AVERAGEBALANCEWHENINDEBIT = 'AverageBalanceWhenInDebit'.freeze,
|
21
|
+
|
22
|
+
# TODO: Write general description for AVERAGEDAILYBALANCE
|
23
|
+
AVERAGEDAILYBALANCE = 'AverageDailyBalance'.freeze,
|
24
|
+
|
25
|
+
# TODO: Write general description for BALANCETRANSFERCLOSINGBALANCE
|
26
|
+
BALANCETRANSFERCLOSINGBALANCE = 'BalanceTransferClosingBalance'.freeze,
|
27
|
+
|
28
|
+
# TODO: Write general description for CASHCLOSINGBALANCE
|
29
|
+
CASHCLOSINGBALANCE = 'CashClosingBalance'.freeze,
|
30
|
+
|
31
|
+
# TODO: Write general description for CLOSINGBALANCE
|
32
|
+
CLOSINGBALANCE = 'ClosingBalance'.freeze,
|
33
|
+
|
34
|
+
# TODO: Write general description for CREDITLIMIT
|
35
|
+
CREDITLIMIT = 'CreditLimit'.freeze,
|
36
|
+
|
37
|
+
# TODO: Write general description for CURRENTPAYMENT
|
38
|
+
CURRENTPAYMENT = 'CurrentPayment'.freeze,
|
39
|
+
|
40
|
+
# TODO: Write general description for DIRECTDEBITPAYMENTDUE
|
41
|
+
DIRECTDEBITPAYMENTDUE = 'DirectDebitPaymentDue'.freeze,
|
42
|
+
|
43
|
+
# TODO: Write general description for MINIMUMPAYMENTDUE
|
44
|
+
MINIMUMPAYMENTDUE = 'MinimumPaymentDue'.freeze,
|
45
|
+
|
46
|
+
# TODO: Write general description for PREVIOUSCLOSINGBALANCE
|
47
|
+
PREVIOUSCLOSINGBALANCE = 'PreviousClosingBalance'.freeze,
|
48
|
+
|
49
|
+
# TODO: Write general description for PREVIOUSPAYMENT
|
50
|
+
PREVIOUSPAYMENT = 'PreviousPayment'.freeze,
|
51
|
+
|
52
|
+
# TODO: Write general description for PURCHASECLOSINGBALANCE
|
53
|
+
PURCHASECLOSINGBALANCE = 'PurchaseClosingBalance'.freeze,
|
54
|
+
|
55
|
+
# TODO: Write general description for STARTINGBALANCE
|
56
|
+
STARTINGBALANCE = 'StartingBalance'.freeze,
|
57
|
+
|
58
|
+
# TODO: Write general description for TOTALADJUSTMENTS
|
59
|
+
TOTALADJUSTMENTS = 'TotalAdjustments'.freeze,
|
60
|
+
|
61
|
+
# TODO: Write general description for TOTALCASHADVANCES
|
62
|
+
TOTALCASHADVANCES = 'TotalCashAdvances'.freeze,
|
63
|
+
|
64
|
+
# TODO: Write general description for TOTALCHARGES
|
65
|
+
TOTALCHARGES = 'TotalCharges'.freeze,
|
66
|
+
|
67
|
+
# TODO: Write general description for TOTALCREDITS
|
68
|
+
TOTALCREDITS = 'TotalCredits'.freeze,
|
69
|
+
|
70
|
+
# TODO: Write general description for TOTALDEBITS
|
71
|
+
TOTALDEBITS = 'TotalDebits'.freeze,
|
72
|
+
|
73
|
+
# TODO: Write general description for TOTALPURCHASES
|
74
|
+
TOTALPURCHASES = 'TotalPurchases'.freeze
|
75
|
+
].freeze
|
76
|
+
|
77
|
+
def self.validate(value)
|
78
|
+
return false if value.nil?
|
79
|
+
|
80
|
+
STATEMENT_AMOUNT_TYPE_ENUM.include?(value)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AccountAndTransactionApiSpecification
|
7
|
+
# Set of elements used to provide details of a benefit or reward amount for
|
8
|
+
# the statement resource.
|
9
|
+
class StatementBenefit < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Amount of money of the cash balance.
|
14
|
+
# @return [Amount]
|
15
|
+
attr_accessor :amount
|
16
|
+
|
17
|
+
# Benefit type, in a coded form.
|
18
|
+
# @return [StatementBenefitTypeEnum]
|
19
|
+
attr_accessor :type
|
20
|
+
|
21
|
+
# A mapping from model property names to API property names.
|
22
|
+
def self.names
|
23
|
+
@_hash = {} if @_hash.nil?
|
24
|
+
@_hash['amount'] = 'Amount'
|
25
|
+
@_hash['type'] = 'Type'
|
26
|
+
@_hash
|
27
|
+
end
|
28
|
+
|
29
|
+
# An array for optional fields
|
30
|
+
def self.optionals
|
31
|
+
[]
|
32
|
+
end
|
33
|
+
|
34
|
+
# An array for nullable fields
|
35
|
+
def self.nullables
|
36
|
+
[]
|
37
|
+
end
|
38
|
+
|
39
|
+
def initialize(amount = nil, type = nil)
|
40
|
+
@amount = amount
|
41
|
+
@type = type
|
42
|
+
end
|
43
|
+
|
44
|
+
# Creates an instance of the object from a hash.
|
45
|
+
def self.from_hash(hash)
|
46
|
+
return nil unless hash
|
47
|
+
|
48
|
+
# Extract variables from the hash.
|
49
|
+
amount = Amount.from_hash(hash['Amount']) if hash['Amount']
|
50
|
+
type = hash.key?('Type') ? hash['Type'] : nil
|
51
|
+
|
52
|
+
# Create object from extracted values.
|
53
|
+
StatementBenefit.new(amount,
|
54
|
+
type)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Provides a human-readable string representation of the object.
|
58
|
+
def to_s
|
59
|
+
class_name = self.class.name.split('::').last
|
60
|
+
"<#{class_name} amount: #{@amount}, type: #{@type}>"
|
61
|
+
end
|
62
|
+
|
63
|
+
# Provides a debugging-friendly string with detailed object information.
|
64
|
+
def inspect
|
65
|
+
class_name = self.class.name.split('::').last
|
66
|
+
"<#{class_name} amount: #{@amount.inspect}, type: #{@type.inspect}>"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AccountAndTransactionApiSpecification
|
7
|
+
# Benefit type, in a coded form.
|
8
|
+
class StatementBenefitTypeEnum
|
9
|
+
STATEMENT_BENEFIT_TYPE_ENUM = [
|
10
|
+
# TODO: Write general description for CASHBACK
|
11
|
+
CASHBACK = 'Cashback'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for INSURANCE
|
14
|
+
INSURANCE = 'Insurance'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for TRAVELDISCOUNT
|
17
|
+
TRAVELDISCOUNT = 'TravelDiscount'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for TRAVELINSURANCE
|
20
|
+
TRAVELINSURANCE = 'TravelInsurance'.freeze
|
21
|
+
].freeze
|
22
|
+
|
23
|
+
def self.validate(value)
|
24
|
+
return false if value.nil?
|
25
|
+
|
26
|
+
STATEMENT_BENEFIT_TYPE_ENUM.include?(value)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module AccountAndTransactionApiSpecification
|
8
|
+
# Set of elements used to provide details of a generic date time for the
|
9
|
+
# statement resource.
|
10
|
+
class StatementDateTime < BaseModel
|
11
|
+
SKIP = Object.new
|
12
|
+
private_constant :SKIP
|
13
|
+
|
14
|
+
# Date and time associated with the date time type.
|
15
|
+
# All dates in the JSON payloads are represented in ISO 8601 date-time
|
16
|
+
# format.
|
17
|
+
# All date-time fields in responses must include the timezone. An example is
|
18
|
+
# below:
|
19
|
+
# 2017-04-05T10:43:07+00:00
|
20
|
+
# @return [DateTime]
|
21
|
+
attr_accessor :date_time
|
22
|
+
|
23
|
+
# Date time type, in a coded form.
|
24
|
+
# @return [StatementDateTimeTypeEnum]
|
25
|
+
attr_accessor :type
|
26
|
+
|
27
|
+
# A mapping from model property names to API property names.
|
28
|
+
def self.names
|
29
|
+
@_hash = {} if @_hash.nil?
|
30
|
+
@_hash['date_time'] = 'DateTime'
|
31
|
+
@_hash['type'] = 'Type'
|
32
|
+
@_hash
|
33
|
+
end
|
34
|
+
|
35
|
+
# An array for optional fields
|
36
|
+
def self.optionals
|
37
|
+
[]
|
38
|
+
end
|
39
|
+
|
40
|
+
# An array for nullable fields
|
41
|
+
def self.nullables
|
42
|
+
[]
|
43
|
+
end
|
44
|
+
|
45
|
+
def initialize(date_time = nil, type = nil)
|
46
|
+
@date_time = date_time
|
47
|
+
@type = type
|
48
|
+
end
|
49
|
+
|
50
|
+
# Creates an instance of the object from a hash.
|
51
|
+
def self.from_hash(hash)
|
52
|
+
return nil unless hash
|
53
|
+
|
54
|
+
# Extract variables from the hash.
|
55
|
+
date_time = if hash.key?('DateTime')
|
56
|
+
(DateTimeHelper.from_rfc3339(hash['DateTime']) if hash['DateTime'])
|
57
|
+
end
|
58
|
+
type = hash.key?('Type') ? hash['Type'] : nil
|
59
|
+
|
60
|
+
# Create object from extracted values.
|
61
|
+
StatementDateTime.new(date_time,
|
62
|
+
type)
|
63
|
+
end
|
64
|
+
|
65
|
+
def to_custom_date_time
|
66
|
+
DateTimeHelper.to_rfc3339(date_time)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Provides a human-readable string representation of the object.
|
70
|
+
def to_s
|
71
|
+
class_name = self.class.name.split('::').last
|
72
|
+
"<#{class_name} date_time: #{@date_time}, type: #{@type}>"
|
73
|
+
end
|
74
|
+
|
75
|
+
# Provides a debugging-friendly string with detailed object information.
|
76
|
+
def inspect
|
77
|
+
class_name = self.class.name.split('::').last
|
78
|
+
"<#{class_name} date_time: #{@date_time.inspect}, type: #{@type.inspect}>"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|