apimatic-ak-sdk 0.0.1
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 +190 -0
- data/bin/console +15 -0
- data/lib/akoya/api_helper.rb +10 -0
- data/lib/akoya/client.rb +117 -0
- data/lib/akoya/configuration.rb +195 -0
- data/lib/akoya/controllers/account_information_controller.rb +93 -0
- data/lib/akoya/controllers/balances_controller.rb +92 -0
- data/lib/akoya/controllers/base_controller.rb +65 -0
- data/lib/akoya/controllers/customers_controller.rb +112 -0
- data/lib/akoya/controllers/investments_controller.rb +95 -0
- data/lib/akoya/controllers/payments_controller.rb +70 -0
- data/lib/akoya/controllers/statements_controller.rb +158 -0
- data/lib/akoya/controllers/tokens_controller.rb +122 -0
- data/lib/akoya/controllers/transactions_controller.rb +108 -0
- data/lib/akoya/exceptions/api_exception.rb +21 -0
- data/lib/akoya/exceptions/error_entity_exception.rb +54 -0
- data/lib/akoya/exceptions/error_response_exception.rb +53 -0
- data/lib/akoya/http/api_response.rb +19 -0
- data/lib/akoya/http/auth/basic_auth.rb +62 -0
- data/lib/akoya/http/auth/bearer_auth.rb +53 -0
- data/lib/akoya/http/http_call_back.rb +10 -0
- data/lib/akoya/http/http_method_enum.rb +10 -0
- data/lib/akoya/http/http_request.rb +10 -0
- data/lib/akoya/http/http_response.rb +10 -0
- data/lib/akoya/http/proxy_settings.rb +22 -0
- data/lib/akoya/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/akoya/logging/sdk_logger.rb +17 -0
- data/lib/akoya/models/account.rb +86 -0
- data/lib/akoya/models/account_category.rb +50 -0
- data/lib/akoya/models/account_contact_entity.rb +132 -0
- data/lib/akoya/models/account_holder_entity.rb +178 -0
- data/lib/akoya/models/account_holder_relationship.rb +110 -0
- data/lib/akoya/models/account_holder_relationship_account_holder_entity.rb +110 -0
- data/lib/akoya/models/account_information.rb +335 -0
- data/lib/akoya/models/action.rb +48 -0
- data/lib/akoya/models/address.rb +144 -0
- data/lib/akoya/models/akoya_account_info_product.rb +88 -0
- data/lib/akoya/models/an_array_of_statements.rb +95 -0
- data/lib/akoya/models/an_investment_holding.rb +493 -0
- data/lib/akoya/models/annual_increase_type.rb +40 -0
- data/lib/akoya/models/annuity_account.rb +370 -0
- data/lib/akoya/models/annuity_account_info.rb +86 -0
- data/lib/akoya/models/annuity_balance_details.rb +87 -0
- data/lib/akoya/models/annuity_balances.rb +477 -0
- data/lib/akoya/models/annuity_product_type.rb +36 -0
- data/lib/akoya/models/annuity_value_basis.rb +36 -0
- data/lib/akoya/models/array_of_account_payment_networks.rb +85 -0
- data/lib/akoya/models/asset_class.rb +95 -0
- data/lib/akoya/models/asset_class_an_investment_holding.rb +85 -0
- data/lib/akoya/models/asset_class_asset_class.rb +56 -0
- data/lib/akoya/models/asset_class_citi_bank_investment_holdings.rb +86 -0
- data/lib/akoya/models/balance_type.rb +37 -0
- data/lib/akoya/models/balance_type_investment_balance_list.rb +36 -0
- data/lib/akoya/models/balances.rb +88 -0
- data/lib/akoya/models/base_model.rb +110 -0
- data/lib/akoya/models/business_customer_entity.rb +127 -0
- data/lib/akoya/models/business_customer_entity_account_holder_entity.rb +126 -0
- data/lib/akoya/models/business_customer_entity_customer.rb +126 -0
- data/lib/akoya/models/call_type.rb +44 -0
- data/lib/akoya/models/citi_bank_investment.rb +535 -0
- data/lib/akoya/models/citi_bank_investment_details.rb +75 -0
- data/lib/akoya/models/citi_bank_investment_holdings.rb +210 -0
- data/lib/akoya/models/compounding_period.rb +56 -0
- data/lib/akoya/models/contribution_entity.rb +266 -0
- data/lib/akoya/models/coupon_mature_frequency.rb +48 -0
- data/lib/akoya/models/currency.rb +108 -0
- data/lib/akoya/models/currency_citi_bank_investment_holdings.rb +86 -0
- data/lib/akoya/models/currency_entity.rb +109 -0
- data/lib/akoya/models/current_customer.rb +75 -0
- data/lib/akoya/models/customer.rb +164 -0
- data/lib/akoya/models/customer_current_customer.rb +164 -0
- data/lib/akoya/models/customer_name.rb +127 -0
- data/lib/akoya/models/customer_name_account_holder_entity.rb +127 -0
- data/lib/akoya/models/customer_name_customer.rb +127 -0
- data/lib/akoya/models/debit_credit_memo.rb +37 -0
- data/lib/akoya/models/debt_class.rb +44 -0
- data/lib/akoya/models/debt_security.rb +137 -0
- data/lib/akoya/models/debt_security_entity.rb +216 -0
- data/lib/akoya/models/debt_type.rb +36 -0
- data/lib/akoya/models/delivery_address.rb +153 -0
- data/lib/akoya/models/deposit_account.rb +375 -0
- data/lib/akoya/models/deposit_account_info.rb +86 -0
- data/lib/akoya/models/deposit_balance_details.rb +87 -0
- data/lib/akoya/models/deposit_balances.rb +438 -0
- data/lib/akoya/models/deposit_transaction.rb +369 -0
- data/lib/akoya/models/deposit_transaction_details.rb +87 -0
- data/lib/akoya/models/domicile.rb +85 -0
- data/lib/akoya/models/equity_grant.rb +199 -0
- data/lib/akoya/models/error_entity_account_information.rb +97 -0
- data/lib/akoya/models/error_entity_annuity_account.rb +97 -0
- data/lib/akoya/models/error_entity_annuity_balances.rb +97 -0
- data/lib/akoya/models/error_entity_citi_bank_investment.rb +97 -0
- data/lib/akoya/models/error_entity_deposit_account.rb +97 -0
- data/lib/akoya/models/error_entity_deposit_balances.rb +97 -0
- data/lib/akoya/models/error_entity_insurance_account.rb +97 -0
- data/lib/akoya/models/error_entity_insurance_balances.rb +97 -0
- data/lib/akoya/models/error_entity_investment_account.rb +97 -0
- data/lib/akoya/models/error_entity_investment_balances.rb +97 -0
- data/lib/akoya/models/error_entity_line_of_credit_balances.rb +97 -0
- data/lib/akoya/models/error_entity_loan_account.rb +97 -0
- data/lib/akoya/models/error_entity_loan_balances.rb +97 -0
- data/lib/akoya/models/error_entity_us_bank_investment.rb +97 -0
- data/lib/akoya/models/fi_asset_class.rb +95 -0
- data/lib/akoya/models/fi_asset_class_an_investment_holding.rb +85 -0
- data/lib/akoya/models/fi_attribute.rb +95 -0
- data/lib/akoya/models/fi_attribute_entity.rb +95 -0
- data/lib/akoya/models/frequency.rb +56 -0
- data/lib/akoya/models/hateoas_link.rb +105 -0
- data/lib/akoya/models/held_in_account.rb +44 -0
- data/lib/akoya/models/holding_sub_type.rb +36 -0
- data/lib/akoya/models/holding_type.rb +56 -0
- data/lib/akoya/models/income_type.rb +41 -0
- data/lib/akoya/models/industry_code.rb +85 -0
- data/lib/akoya/models/insurance_account.rb +349 -0
- data/lib/akoya/models/insurance_account_info.rb +87 -0
- data/lib/akoya/models/insurance_balance_details.rb +87 -0
- data/lib/akoya/models/insurance_balances.rb +420 -0
- data/lib/akoya/models/insurance_transaction.rb +351 -0
- data/lib/akoya/models/insurance_transaction_details.rb +87 -0
- data/lib/akoya/models/interest_rate_type.rb +36 -0
- data/lib/akoya/models/inv401_k_source.rb +56 -0
- data/lib/akoya/models/inv401_k_source_open_order_entity.rb +57 -0
- data/lib/akoya/models/inv401_k_surce.rb +56 -0
- data/lib/akoya/models/investment_account.rb +411 -0
- data/lib/akoya/models/investment_account_annuity_balance.rb +87 -0
- data/lib/akoya/models/investment_account_deposit_balance.rb +87 -0
- data/lib/akoya/models/investment_account_info.rb +87 -0
- data/lib/akoya/models/investment_account_insurance_balance.rb +87 -0
- data/lib/akoya/models/investment_account_loan_balance.rb +86 -0
- data/lib/akoya/models/investment_account_loc_balance.rb +86 -0
- data/lib/akoya/models/investment_balance_details.rb +87 -0
- data/lib/akoya/models/investment_balance_list.rb +148 -0
- data/lib/akoya/models/investment_balances.rb +525 -0
- data/lib/akoya/models/investment_details.rb +88 -0
- data/lib/akoya/models/investment_loan_entity.rb +271 -0
- data/lib/akoya/models/investment_transaction.rb +783 -0
- data/lib/akoya/models/investment_transaction_details.rb +87 -0
- data/lib/akoya/models/investments.rb +88 -0
- data/lib/akoya/models/line_item.rb +156 -0
- data/lib/akoya/models/line_of_credit_balances.rb +601 -0
- data/lib/akoya/models/links.rb +95 -0
- data/lib/akoya/models/loan_account.rb +417 -0
- data/lib/akoya/models/loan_account_info.rb +86 -0
- data/lib/akoya/models/loan_balance_details.rb +86 -0
- data/lib/akoya/models/loan_balances.rb +556 -0
- data/lib/akoya/models/loan_payment_frequency.rb +68 -0
- data/lib/akoya/models/loan_transaction.rb +360 -0
- data/lib/akoya/models/loan_transaction_details.rb +87 -0
- data/lib/akoya/models/loc_account_info.rb +86 -0
- data/lib/akoya/models/loc_balance_details.rb +86 -0
- data/lib/akoya/models/loc_transaction.rb +372 -0
- data/lib/akoya/models/loc_transaction_details.rb +86 -0
- data/lib/akoya/models/mnext.rb +84 -0
- data/lib/akoya/models/mode.rb +36 -0
- data/lib/akoya/models/mutual_fund_security.rb +99 -0
- data/lib/akoya/models/mutual_fund_security_entity.rb +150 -0
- data/lib/akoya/models/mutual_fund_type.rb +40 -0
- data/lib/akoya/models/obtain_tokens.rb +99 -0
- data/lib/akoya/models/open_order_entity.rb +228 -0
- data/lib/akoya/models/option_security.rb +125 -0
- data/lib/akoya/models/option_security_entity.rb +127 -0
- data/lib/akoya/models/option_type.rb +36 -0
- data/lib/akoya/models/order_duration.rb +40 -0
- data/lib/akoya/models/order_type.rb +60 -0
- data/lib/akoya/models/other_security_entity.rb +77 -0
- data/lib/akoya/models/paginated_array.rb +75 -0
- data/lib/akoya/models/payment_details.rb +142 -0
- data/lib/akoya/models/payment_frequency.rb +56 -0
- data/lib/akoya/models/payment_frequency_annuity_account.rb +44 -0
- data/lib/akoya/models/payment_frequency_annuity_balances.rb +44 -0
- data/lib/akoya/models/payment_network_supported_by_account.rb +129 -0
- data/lib/akoya/models/pension_source_entity.rb +143 -0
- data/lib/akoya/models/period_certain_guarantee.rb +48 -0
- data/lib/akoya/models/policy_premium_term.rb +36 -0
- data/lib/akoya/models/position_type.rb +36 -0
- data/lib/akoya/models/postion_type.rb +36 -0
- data/lib/akoya/models/prev.rb +84 -0
- data/lib/akoya/models/refresh_tokens.rb +103 -0
- data/lib/akoya/models/secured.rb +36 -0
- data/lib/akoya/models/security_id_type.rb +52 -0
- data/lib/akoya/models/security_id_type_investment_transaction.rb +52 -0
- data/lib/akoya/models/security_type.rb +56 -0
- data/lib/akoya/models/statement_entity.rb +136 -0
- data/lib/akoya/models/status.rb +56 -0
- data/lib/akoya/models/status_deposit_transaction.rb +44 -0
- data/lib/akoya/models/status_insurance_transaction.rb +44 -0
- data/lib/akoya/models/status_investment_transaction.rb +44 -0
- data/lib/akoya/models/status_loan_transaction.rb +44 -0
- data/lib/akoya/models/status_loc_transaction.rb +44 -0
- data/lib/akoya/models/status_statement_entity.rb +40 -0
- data/lib/akoya/models/status_transaction.rb +44 -0
- data/lib/akoya/models/stock_security_entity.rb +137 -0
- data/lib/akoya/models/stock_type.rb +56 -0
- data/lib/akoya/models/sub_account.rb +44 -0
- data/lib/akoya/models/sub_account_fund.rb +44 -0
- data/lib/akoya/models/sub_account_sec.rb +44 -0
- data/lib/akoya/models/sweep_security_entity.rb +118 -0
- data/lib/akoya/models/tax_lot.rb +137 -0
- data/lib/akoya/models/tax_lot_an_investment_holding.rb +139 -0
- data/lib/akoya/models/telephone.rb +95 -0
- data/lib/akoya/models/telephone_number.rb +95 -0
- data/lib/akoya/models/token_example_response.rb +101 -0
- data/lib/akoya/models/transaction.rb +328 -0
- data/lib/akoya/models/transaction_reason.rb +41 -0
- data/lib/akoya/models/transaction_type.rb +84 -0
- data/lib/akoya/models/transaction_type_insurance_transaction.rb +44 -0
- data/lib/akoya/models/transaction_type_investment_transaction.rb +192 -0
- data/lib/akoya/models/transaction_type_loan_transaction.rb +44 -0
- data/lib/akoya/models/transaction_type_loc_transaction.rb +84 -0
- data/lib/akoya/models/transactions_entity.rb +98 -0
- data/lib/akoya/models/transfer_action.rb +36 -0
- data/lib/akoya/models/type.rb +44 -0
- data/lib/akoya/models/type_hateoas_link.rb +52 -0
- data/lib/akoya/models/type_telephone_number.rb +44 -0
- data/lib/akoya/models/unit_type.rb +36 -0
- data/lib/akoya/models/unit_type_open_order_entity.rb +36 -0
- data/lib/akoya/models/us_bank_investment.rb +535 -0
- data/lib/akoya/models/us_bank_investment_details.rb +75 -0
- data/lib/akoya/models/us_bank_investment_holdings.rb +403 -0
- data/lib/akoya/models/vesting.rb +135 -0
- data/lib/akoya/models/vesting_entity.rb +185 -0
- data/lib/akoya/models/x_akoya_interaction_type.rb +36 -0
- data/lib/akoya/utilities/date_time_helper.rb +11 -0
- data/lib/akoya/utilities/file_wrapper.rb +28 -0
- data/lib/akoya/utilities/union_type_lookup.rb +91 -0
- data/lib/akoya.rb +250 -0
- metadata +312 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
# TokensController
|
|
8
|
+
class TokensController < BaseController
|
|
9
|
+
# The token endpoint is used to **obtain** tokens during authorization or to
|
|
10
|
+
# **refresh** tokens without having to go through authorization again. In
|
|
11
|
+
# each successful token response, you will receive a new `id_token` and a
|
|
12
|
+
# new `refresh_token`.
|
|
13
|
+
# > ⚠️ Please note!
|
|
14
|
+
# >
|
|
15
|
+
# > Use the correct schema (detailed below) for the type of token request
|
|
16
|
+
# you're making. The initial token request and the refresh token requests
|
|
17
|
+
# require different security schemas and parameters.
|
|
18
|
+
# ## Obtain tokens
|
|
19
|
+
# To obtain the initial set of tokens or to reauthorize, you will need the
|
|
20
|
+
# following:
|
|
21
|
+
# - `grant_type` must be set to `authorization_code`.
|
|
22
|
+
# - `redirect_uri` must be the same as your app's registered `redirect_uri`.
|
|
23
|
+
# - `code` is the authorization code from the end-user's authentication
|
|
24
|
+
# flow. See: [Get authorization
|
|
25
|
+
# code](https://docs.akoya.com/reference/get-authorization-code).
|
|
26
|
+
# - **Security**: Include Basic Auth in the header of the call. Select
|
|
27
|
+
# "Basic Auth" in Try it and use your `client_id` and `client_secret` as
|
|
28
|
+
# username & password.
|
|
29
|
+
# ## Refresh tokens
|
|
30
|
+
# Refresh token expiration times are set by the provider.
|
|
31
|
+
# - `grant_type` must be set to `refresh_token`.
|
|
32
|
+
# - `refresh_token` must be set to the refresh token received in the most
|
|
33
|
+
# recent, previous obtain or refresh token call for your end-user.
|
|
34
|
+
# - **Security**: Include your `client_id` and `client_secret` **in the body
|
|
35
|
+
# of the request**. Remove any information from "Basic Auth" (username and
|
|
36
|
+
# password) in Try it.
|
|
37
|
+
# ## Responses
|
|
38
|
+
# Token requests return a new set of tokens. If refreshing or reauthorizing
|
|
39
|
+
# tokens, they will replace the tokens from your previous, successful obtain
|
|
40
|
+
# or refresh token call.
|
|
41
|
+
# The `id_token` (JWT) is a short-lived token. It's used as the **bearer
|
|
42
|
+
# token** for data calls. To ensure data calls are secure, the `id_token`
|
|
43
|
+
# must be renewed regularly. To retrieve a new `id_token`, use the refresh
|
|
44
|
+
# token request. [Read more about
|
|
45
|
+
# tokens](https://docs.akoya.com/docs/token-flow).
|
|
46
|
+
# @param [String] grant_type Required parameter: Set to `authorization_code`
|
|
47
|
+
# to indicate an authorization code will be returned
|
|
48
|
+
# @param [String] redirect_uri Required parameter: URI where user will be
|
|
49
|
+
# redirected after end-users authorization is complete. It must be the same
|
|
50
|
+
# as the URI called in the authorization request
|
|
51
|
+
# @param [String] code Required parameter: Authorization code from
|
|
52
|
+
# end-user's authentication.
|
|
53
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
54
|
+
def get_token(grant_type,
|
|
55
|
+
redirect_uri,
|
|
56
|
+
code)
|
|
57
|
+
@api_call
|
|
58
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
59
|
+
'/token',
|
|
60
|
+
Server::DEFAULT1)
|
|
61
|
+
.form_param(new_parameter(grant_type, key: 'grant_type')
|
|
62
|
+
.is_required(true))
|
|
63
|
+
.form_param(new_parameter(redirect_uri, key: 'redirect_uri')
|
|
64
|
+
.is_required(true))
|
|
65
|
+
.form_param(new_parameter(code, key: 'code')
|
|
66
|
+
.is_required(true))
|
|
67
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
|
68
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
69
|
+
.auth(Single.new('basicAuth')))
|
|
70
|
+
.response(new_response_handler
|
|
71
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
72
|
+
.deserialize_into(TokenExampleResponse.method(:from_hash))
|
|
73
|
+
.is_api_response(true)
|
|
74
|
+
.local_error('400',
|
|
75
|
+
'Bad Request',
|
|
76
|
+
ErrorResponseException)
|
|
77
|
+
.local_error('401',
|
|
78
|
+
'Unauthorized',
|
|
79
|
+
ErrorResponseException))
|
|
80
|
+
.execute
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# This request revokes tokens granted on behalf of the end-user.
|
|
84
|
+
# - **Security**: Include your `client_id` and `client_secret` **in the body
|
|
85
|
+
# of the request**. Remove any information from "Basic Auth" (username and
|
|
86
|
+
# password) in Try it.
|
|
87
|
+
# @param [String] client_id Required parameter: Client ID
|
|
88
|
+
# @param [String] client_secret Required parameter: Client secret
|
|
89
|
+
# @param [String] token Required parameter: Refresh token
|
|
90
|
+
# @param [String] token_type_hint Required parameter: Accepts
|
|
91
|
+
# `refresh_token`
|
|
92
|
+
# @param [String] akoya_id Optional parameter: Deprecated. Do not use. Trace
|
|
93
|
+
# ID for troubleshooting. Required until deprecated October 1, 2021. Akoya
|
|
94
|
+
# will automatically generate an ID and return it in the response header
|
|
95
|
+
# `x-akoya-interaction-id`
|
|
96
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
97
|
+
def revoke_token(client_id,
|
|
98
|
+
client_secret,
|
|
99
|
+
token,
|
|
100
|
+
token_type_hint,
|
|
101
|
+
akoya_id: nil)
|
|
102
|
+
@api_call
|
|
103
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
104
|
+
'/revoke',
|
|
105
|
+
Server::DEFAULT1)
|
|
106
|
+
.form_param(new_parameter(client_id, key: 'client_id')
|
|
107
|
+
.is_required(true))
|
|
108
|
+
.form_param(new_parameter(client_secret, key: 'client_secret')
|
|
109
|
+
.is_required(true))
|
|
110
|
+
.form_param(new_parameter(token, key: 'token')
|
|
111
|
+
.is_required(true))
|
|
112
|
+
.form_param(new_parameter(token_type_hint, key: 'token_type_hint')
|
|
113
|
+
.is_required(true))
|
|
114
|
+
.header_param(new_parameter(akoya_id, key: 'akoyaId'))
|
|
115
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')))
|
|
116
|
+
.response(new_response_handler
|
|
117
|
+
.is_response_void(true)
|
|
118
|
+
.is_api_response(true))
|
|
119
|
+
.execute
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
# TransactionsController
|
|
8
|
+
class TransactionsController < BaseController
|
|
9
|
+
# The transactions API allows you to retrieve transaction history of
|
|
10
|
+
# consumer-permissioned accounts.
|
|
11
|
+
# > 🛑
|
|
12
|
+
# >
|
|
13
|
+
# > The *id_token* should be used as the bearer token with this call.
|
|
14
|
+
# For more information on how to paginate transaction results, please see:
|
|
15
|
+
# [Pagination](https://docs.akoya.com/v2/docs/pagination)
|
|
16
|
+
# Use the `mode` query param to receive FDX-aligned, standardized data
|
|
17
|
+
# values (Beta). For example:
|
|
18
|
+
# `https://sandbox-products.ddp.akoya.com/transactions/v2/mikomo?mode=standa
|
|
19
|
+
# rd`
|
|
20
|
+
# `mode` is available in both sandbox and production.
|
|
21
|
+
# `mode` is supported by a subset of providers. Log into the [Data Recipient
|
|
22
|
+
# Hub](https://recipient.ddp.akoya.com/login) and click
|
|
23
|
+
# [here](https://recipient.ddp.akoya.com/support/article/kA0Uw00000015GzKAI)
|
|
24
|
+
# to view a list of all providers supporting the `mode` parameter.
|
|
25
|
+
# @param [String] version Required parameter: Akoya major version number. Do
|
|
26
|
+
# not use minor version numbers. For instance, use v2 and not v2.2
|
|
27
|
+
# @param [String] provider_id Required parameter: Id of provider
|
|
28
|
+
# @param [String] account_id Required parameter: Account Identifier
|
|
29
|
+
# @param [DateTime] start_time Optional parameter: ISO 8601 date format in
|
|
30
|
+
# UTC time zone. If blank, the default value (current date - 15 calendar
|
|
31
|
+
# days) is used. If a value is specified, endTime is required.
|
|
32
|
+
# @param [DateTime] end_time Optional parameter: ISO 8601 date format in UTC
|
|
33
|
+
# time zone. If blank, the default value (current date) is used. If a value
|
|
34
|
+
# is specified, startTime is required.
|
|
35
|
+
# @param [String] offset Optional parameter: The number of items to skip
|
|
36
|
+
# before the first in the response. The default is 0.
|
|
37
|
+
# @param [Integer] limit Optional parameter: The maximum number of items to
|
|
38
|
+
# be returned in the response. The default is 50.
|
|
39
|
+
# @param [XAkoyaInteractionType] x_akoya_interaction_type Optional
|
|
40
|
+
# parameter: Optional but recommended header to include with each data
|
|
41
|
+
# request. Allowed values are `user` or `batch`. `user` indicates a
|
|
42
|
+
# request is prompted by an end-user action. `batch` indicates the request
|
|
43
|
+
# is part of a batch process.
|
|
44
|
+
# @param [Mode] mode Optional parameter: BETA. Default is raw. Use standard
|
|
45
|
+
# for FDX-aligned, standardized data values.
|
|
46
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
47
|
+
def get_transactions(version,
|
|
48
|
+
provider_id,
|
|
49
|
+
account_id,
|
|
50
|
+
start_time: nil,
|
|
51
|
+
end_time: nil,
|
|
52
|
+
offset: '0',
|
|
53
|
+
limit: 50,
|
|
54
|
+
x_akoya_interaction_type: nil,
|
|
55
|
+
mode: nil)
|
|
56
|
+
@api_call
|
|
57
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
58
|
+
'/transactions/{version}/{providerId}/{accountId}',
|
|
59
|
+
Server::DEFAULT)
|
|
60
|
+
.template_param(new_parameter(version, key: 'version')
|
|
61
|
+
.is_required(true)
|
|
62
|
+
.should_encode(true))
|
|
63
|
+
.template_param(new_parameter(provider_id, key: 'providerId')
|
|
64
|
+
.is_required(true)
|
|
65
|
+
.should_encode(true))
|
|
66
|
+
.template_param(new_parameter(account_id, key: 'accountId')
|
|
67
|
+
.is_required(true)
|
|
68
|
+
.should_encode(true))
|
|
69
|
+
.query_param(new_parameter(start_time, key: 'startTime'))
|
|
70
|
+
.query_param(new_parameter(end_time, key: 'endTime'))
|
|
71
|
+
.query_param(new_parameter(offset, key: 'offset'))
|
|
72
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
73
|
+
.header_param(new_parameter(x_akoya_interaction_type, key: 'x-akoya-interaction-type'))
|
|
74
|
+
.query_param(new_parameter(mode, key: 'mode'))
|
|
75
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
76
|
+
.auth(Single.new('bearerAuth')))
|
|
77
|
+
.response(new_response_handler
|
|
78
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
79
|
+
.deserialize_into(TransactionsEntity.method(:from_hash))
|
|
80
|
+
.is_api_response(true)
|
|
81
|
+
.local_error('400',
|
|
82
|
+
'Bad Request',
|
|
83
|
+
ErrorEntityException)
|
|
84
|
+
.local_error('401',
|
|
85
|
+
'602 - Customer not authorized',
|
|
86
|
+
ErrorEntityException)
|
|
87
|
+
.local_error('404',
|
|
88
|
+
'701 - Account not found',
|
|
89
|
+
ErrorEntityException)
|
|
90
|
+
.local_error('406',
|
|
91
|
+
'1203 - Content Type not Supported',
|
|
92
|
+
ErrorEntityException)
|
|
93
|
+
.local_error('429',
|
|
94
|
+
'1207 - Too many requests',
|
|
95
|
+
ErrorEntityException)
|
|
96
|
+
.local_error('500',
|
|
97
|
+
'500 - Internal server error',
|
|
98
|
+
ErrorEntityException)
|
|
99
|
+
.local_error('501',
|
|
100
|
+
'1106 - Version not supported or not implemented',
|
|
101
|
+
ErrorEntityException)
|
|
102
|
+
.local_error('503',
|
|
103
|
+
'503 - System is down for maintenance',
|
|
104
|
+
ErrorEntityException))
|
|
105
|
+
.execute
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
# Class for exceptions when there is a network error, status code error, etc.
|
|
8
|
+
class APIException < CoreLibrary::ApiException
|
|
9
|
+
# Provides a human-readable string representation of the object.
|
|
10
|
+
def to_s
|
|
11
|
+
class_name = self.class.name.split('::').last
|
|
12
|
+
"<#{class_name} status_code: #{@response_code}, reason: #{@reason}>"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
16
|
+
def inspect
|
|
17
|
+
class_name = self.class.name.split('::').last
|
|
18
|
+
"<#{class_name} status_code: #{@response_code.inspect}, reason: #{@reason.inspect}>"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
# An error entity which can be used at the API level for error responses or at
|
|
8
|
+
# the account level to indicate a problem specific to a particular account.
|
|
9
|
+
class ErrorEntityException < APIException
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Long term persistent identifier which can be used to trace error condition
|
|
14
|
+
# back to log information
|
|
15
|
+
# @return [Integer]
|
|
16
|
+
attr_accessor :code
|
|
17
|
+
|
|
18
|
+
# End user displayable information which might help the customer diagnose an
|
|
19
|
+
# error
|
|
20
|
+
# @return [String]
|
|
21
|
+
attr_accessor :message
|
|
22
|
+
|
|
23
|
+
# The constructor.
|
|
24
|
+
# @param [String] reason The reason for raising an exception.
|
|
25
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
26
|
+
def initialize(reason, response)
|
|
27
|
+
super(reason, response)
|
|
28
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
29
|
+
unbox(hash)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Populates this object by extracting properties from a hash.
|
|
33
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
34
|
+
# response body.
|
|
35
|
+
def unbox(hash)
|
|
36
|
+
return nil unless hash
|
|
37
|
+
|
|
38
|
+
@code = hash.key?('code') ? hash['code'] : SKIP
|
|
39
|
+
@message = hash.key?('message') ? hash['message'] : SKIP
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Provides a human-readable string representation of the object.
|
|
43
|
+
def to_s
|
|
44
|
+
class_name = self.class.name.split('::').last
|
|
45
|
+
"<#{class_name} code: #{@code}, message: #{@message}>"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
49
|
+
def inspect
|
|
50
|
+
class_name = self.class.name.split('::').last
|
|
51
|
+
"<#{class_name} code: #{@code.inspect}, message: #{@message.inspect}>"
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
# Error response class.
|
|
8
|
+
class ErrorResponseException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :error
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :error_description
|
|
19
|
+
|
|
20
|
+
# The constructor.
|
|
21
|
+
# @param [String] reason The reason for raising an exception.
|
|
22
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
23
|
+
def initialize(reason, response)
|
|
24
|
+
super(reason, response)
|
|
25
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
26
|
+
unbox(hash)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Populates this object by extracting properties from a hash.
|
|
30
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
31
|
+
# response body.
|
|
32
|
+
def unbox(hash)
|
|
33
|
+
return nil unless hash
|
|
34
|
+
|
|
35
|
+
@error = hash.key?('error') ? hash['error'] : SKIP
|
|
36
|
+
@error_description =
|
|
37
|
+
hash.key?('error_description') ? hash['error_description'] : SKIP
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Provides a human-readable string representation of the object.
|
|
41
|
+
def to_s
|
|
42
|
+
class_name = self.class.name.split('::').last
|
|
43
|
+
"<#{class_name} error: #{@error}, error_description: #{@error_description}>"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
47
|
+
def inspect
|
|
48
|
+
class_name = self.class.name.split('::').last
|
|
49
|
+
"<#{class_name} error: #{@error.inspect}, error_description:"\
|
|
50
|
+
" #{@error_description.inspect}>"
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
# Http response received.
|
|
8
|
+
class ApiResponse < CoreLibrary::ApiResponse
|
|
9
|
+
# The constructor
|
|
10
|
+
# @param [HttpResponse] http_response The original, raw response from the api.
|
|
11
|
+
# @param [Object] data The data field specified for the response.
|
|
12
|
+
# @param [Array<String>] errors Any errors returned by the server.
|
|
13
|
+
def initialize(http_response,
|
|
14
|
+
data: nil,
|
|
15
|
+
errors: nil)
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
# Utility class for basic authorization.
|
|
8
|
+
class BasicAuth < CoreLibrary::HeaderAuth
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
# Display error message on occurrence of authentication failure.
|
|
11
|
+
# @returns [String] The oAuth error message.
|
|
12
|
+
def error_message
|
|
13
|
+
'BasicAuth: username or password is undefined.'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Initialization constructor.
|
|
17
|
+
def initialize(basic_auth_credentials)
|
|
18
|
+
auth_params = {}
|
|
19
|
+
unless basic_auth_credentials.nil? ||
|
|
20
|
+
basic_auth_credentials.username.nil? ||
|
|
21
|
+
basic_auth_credentials.password.nil?
|
|
22
|
+
auth_params['Authorization'] =
|
|
23
|
+
"Basic #{AuthHelper.get_base64_encoded_value(basic_auth_credentials.username,
|
|
24
|
+
basic_auth_credentials.password)}"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
super auth_params
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Data class for BasicAuthCredentials.
|
|
32
|
+
class BasicAuthCredentials
|
|
33
|
+
attr_reader :username, :password
|
|
34
|
+
|
|
35
|
+
def initialize(username:, password:)
|
|
36
|
+
raise ArgumentError, 'username cannot be nil' if username.nil?
|
|
37
|
+
raise ArgumentError, 'password cannot be nil' if password.nil?
|
|
38
|
+
|
|
39
|
+
@username = username
|
|
40
|
+
@password = password
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.from_env
|
|
44
|
+
username = ENV['BASIC_AUTH_USERNAME']
|
|
45
|
+
password = ENV['BASIC_AUTH_PASSWORD']
|
|
46
|
+
all_nil = [
|
|
47
|
+
username,
|
|
48
|
+
password
|
|
49
|
+
].all?(&:nil?)
|
|
50
|
+
return nil if all_nil
|
|
51
|
+
|
|
52
|
+
new(username: username, password: password)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def clone_with(username: nil, password: nil)
|
|
56
|
+
username ||= self.username
|
|
57
|
+
password ||= self.password
|
|
58
|
+
|
|
59
|
+
BasicAuthCredentials.new(username: username, password: password)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
# Utility class for OAuth 2 authorization and token management.
|
|
8
|
+
class BearerAuth < CoreLibrary::HeaderAuth
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
# Display error message on occurrence of authentication failure.
|
|
11
|
+
# @returns [String] The oAuth error message.
|
|
12
|
+
def error_message
|
|
13
|
+
'BearerAuth: access_token is undefined.'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Initialization constructor.
|
|
17
|
+
def initialize(bearer_auth_credentials)
|
|
18
|
+
auth_params = {}
|
|
19
|
+
@_access_token = bearer_auth_credentials.access_token unless
|
|
20
|
+
bearer_auth_credentials.nil? || bearer_auth_credentials.access_token.nil?
|
|
21
|
+
auth_params[:Authorization] = "Bearer #{@_access_token}" unless @_access_token.nil?
|
|
22
|
+
|
|
23
|
+
super auth_params
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Data class for BearerAuthCredentials.
|
|
28
|
+
class BearerAuthCredentials
|
|
29
|
+
attr_reader :access_token
|
|
30
|
+
|
|
31
|
+
def initialize(access_token:)
|
|
32
|
+
raise ArgumentError, 'access_token cannot be nil' if access_token.nil?
|
|
33
|
+
|
|
34
|
+
@access_token = access_token
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def self.from_env
|
|
38
|
+
access_token = ENV['BEARER_AUTH_ACCESS_TOKEN']
|
|
39
|
+
all_nil = [
|
|
40
|
+
access_token
|
|
41
|
+
].all?(&:nil?)
|
|
42
|
+
return nil if all_nil
|
|
43
|
+
|
|
44
|
+
new(access_token: access_token)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def clone_with(access_token: nil)
|
|
48
|
+
access_token ||= self.access_token
|
|
49
|
+
|
|
50
|
+
BearerAuthCredentials.new(access_token: access_token)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# akoya
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Akoya
|
|
7
|
+
##
|
|
8
|
+
# ProxySettings encapsulates HTTP proxy configuration for Faraday,
|
|
9
|
+
# including optional basic authentication.
|
|
10
|
+
#
|
|
11
|
+
class ProxySettings < CoreLibrary::ProxySettings
|
|
12
|
+
def self.from_env
|
|
13
|
+
address = ENV['PROXY_ADDRESS']
|
|
14
|
+
port = ENV['PROXY_PORT']
|
|
15
|
+
username = ENV['PROXY_USERNAME']
|
|
16
|
+
password = ENV['PROXY_PASSWORD']
|
|
17
|
+
return nil if address.nil? || address.strip.empty?
|
|
18
|
+
|
|
19
|
+
new(address: address, port: port, username: username, password: password)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|