card-management-sdk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +88 -0
- data/lib/shell_card_management_ap_is/api_helper.rb +10 -0
- data/lib/shell_card_management_ap_is/client.rb +85 -0
- data/lib/shell_card_management_ap_is/configuration.rb +117 -0
- data/lib/shell_card_management_ap_is/controllers/base_controller.rb +66 -0
- data/lib/shell_card_management_ap_is/controllers/card_controller.rb +1047 -0
- data/lib/shell_card_management_ap_is/controllers/customer_controller.rb +538 -0
- data/lib/shell_card_management_ap_is/controllers/o_auth_authorization_controller.rb +42 -0
- data/lib/shell_card_management_ap_is/controllers/restriction_controller.rb +496 -0
- data/lib/shell_card_management_ap_is/exceptions/api_exception.rb +10 -0
- data/lib/shell_card_management_ap_is/exceptions/default_error_exception.rb +32 -0
- data/lib/shell_card_management_ap_is/exceptions/error_object_exception.rb +54 -0
- data/lib/shell_card_management_ap_is/exceptions/error_user_access_error1_exception.rb +32 -0
- data/lib/shell_card_management_ap_is/exceptions/o_auth_provider_exception.rb +48 -0
- data/lib/shell_card_management_ap_is/http/auth/basic_auth.rb +50 -0
- data/lib/shell_card_management_ap_is/http/auth/bearer_token.rb +89 -0
- data/lib/shell_card_management_ap_is/http/http_call_back.rb +10 -0
- data/lib/shell_card_management_ap_is/http/http_method_enum.rb +10 -0
- data/lib/shell_card_management_ap_is/http/http_request.rb +10 -0
- data/lib/shell_card_management_ap_is/http/http_response.rb +10 -0
- data/lib/shell_card_management_ap_is/models/account_access.rb +128 -0
- data/lib/shell_card_management_ap_is/models/account_request.rb +252 -0
- data/lib/shell_card_management_ap_is/models/account_response.rb +111 -0
- data/lib/shell_card_management_ap_is/models/account_response_accounts_items.rb +750 -0
- data/lib/shell_card_management_ap_is/models/account_restriction_request.rb +131 -0
- data/lib/shell_card_management_ap_is/models/account_restriction_response.rb +60 -0
- data/lib/shell_card_management_ap_is/models/account_velocity_limit.rb +145 -0
- data/lib/shell_card_management_ap_is/models/accounts.rb +65 -0
- data/lib/shell_card_management_ap_is/models/address.rb +174 -0
- data/lib/shell_card_management_ap_is/models/audit_request.rb +256 -0
- data/lib/shell_card_management_ap_is/models/audit_response.rb +111 -0
- data/lib/shell_card_management_ap_is/models/audit_response_audits_items.rb +450 -0
- data/lib/shell_card_management_ap_is/models/auto_renew_card_request.rb +111 -0
- data/lib/shell_card_management_ap_is/models/auto_renew_card_request_auto_renew_cards_items.rb +98 -0
- data/lib/shell_card_management_ap_is/models/auto_renew_card_response.rb +92 -0
- data/lib/shell_card_management_ap_is/models/auto_renew_card_response_data_items.rb +64 -0
- data/lib/shell_card_management_ap_is/models/bank_account.rb +192 -0
- data/lib/shell_card_management_ap_is/models/base_model.rb +62 -0
- data/lib/shell_card_management_ap_is/models/bundle_restriction.rb +166 -0
- data/lib/shell_card_management_ap_is/models/cancel_card_request.rb +107 -0
- data/lib/shell_card_management_ap_is/models/cancel_card_response.rb +127 -0
- data/lib/shell_card_management_ap_is/models/card.rb +696 -0
- data/lib/shell_card_management_ap_is/models/card_block_schedule.rb +65 -0
- data/lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb +159 -0
- data/lib/shell_card_management_ap_is/models/card_delivery_contact.rb +230 -0
- data/lib/shell_card_management_ap_is/models/card_detail.rb +661 -0
- data/lib/shell_card_management_ap_is/models/card_detail_auto_renew_enum.rb +28 -0
- data/lib/shell_card_management_ap_is/models/card_details_request.rb +260 -0
- data/lib/shell_card_management_ap_is/models/card_details_response.rb +1058 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_card_block_schedules_items_all_of0.rb +60 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_card_delivery_address.rb +227 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_fuel_sets_items.rb +58 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_international_pos_language_code_enum.rb +118 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_international_pos_language_id_enum.rb +118 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_local_pos_language_code_enum.rb +118 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_local_pos_language_id_enum.rb +118 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_non_fuel_sets_items.rb +58 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_pin_delivery_address.rb +231 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_pin_type_enum.rb +23 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_reissue_setting_enum.rb +26 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_renewed_card_reissue_setting_enum.rb +25 -0
- data/lib/shell_card_management_ap_is/models/card_details_response_status_id_enum.rb +83 -0
- data/lib/shell_card_management_ap_is/models/card_group_request.rb +178 -0
- data/lib/shell_card_management_ap_is/models/card_group_response.rb +109 -0
- data/lib/shell_card_management_ap_is/models/card_group_response_card_groups_items.rb +301 -0
- data/lib/shell_card_management_ap_is/models/card_move_request.rb +163 -0
- data/lib/shell_card_management_ap_is/models/card_move_request_cards_items.rb +80 -0
- data/lib/shell_card_management_ap_is/models/card_move_response.rb +112 -0
- data/lib/shell_card_management_ap_is/models/card_move_response_error_cards_items.rb +112 -0
- data/lib/shell_card_management_ap_is/models/card_move_response_successful_requests_items.rb +97 -0
- data/lib/shell_card_management_ap_is/models/card_search_response.rb +126 -0
- data/lib/shell_card_management_ap_is/models/card_summary_request.rb +52 -0
- data/lib/shell_card_management_ap_is/models/card_summary_response.rb +82 -0
- data/lib/shell_card_management_ap_is/models/card_type_request.rb +145 -0
- data/lib/shell_card_management_ap_is/models/card_type_response.rb +79 -0
- data/lib/shell_card_management_ap_is/models/card_type_response_customer_card_types_items.rb +470 -0
- data/lib/shell_card_management_ap_is/models/card_type_response_error.rb +60 -0
- data/lib/shell_card_management_ap_is/models/card_usage_restrictions.rb +281 -0
- data/lib/shell_card_management_ap_is/models/col_co_access.rb +88 -0
- data/lib/shell_card_management_ap_is/models/create_bundle_request.rb +167 -0
- data/lib/shell_card_management_ap_is/models/create_bundle_request_restrictions.rb +147 -0
- data/lib/shell_card_management_ap_is/models/create_bundle_response.rb +98 -0
- data/lib/shell_card_management_ap_is/models/create_bundle_response_data_items.rb +125 -0
- data/lib/shell_card_management_ap_is/models/create_bundle_response_data_items_cards_items.rb +50 -0
- data/lib/shell_card_management_ap_is/models/create_card_group_request.rb +161 -0
- data/lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb +84 -0
- data/lib/shell_card_management_ap_is/models/create_card_group_response.rb +130 -0
- data/lib/shell_card_management_ap_is/models/create_card_group_response_error_cards_items.rb +81 -0
- data/lib/shell_card_management_ap_is/models/create_card_group_response_successful_requests_items.rb +71 -0
- data/lib/shell_card_management_ap_is/models/create_card_response.rb +65 -0
- data/lib/shell_card_management_ap_is/models/customer_contract.rb +63 -0
- data/lib/shell_card_management_ap_is/models/customer_detail_request.rb +123 -0
- data/lib/shell_card_management_ap_is/models/customer_detail_response.rb +437 -0
- data/lib/shell_card_management_ap_is/models/day_time_restrictions.rb +162 -0
- data/lib/shell_card_management_ap_is/models/default_error_fault.rb +60 -0
- data/lib/shell_card_management_ap_is/models/default_error_fault_detail.rb +50 -0
- data/lib/shell_card_management_ap_is/models/delete_bundle_request.rb +126 -0
- data/lib/shell_card_management_ap_is/models/delete_bundle_response.rb +60 -0
- data/lib/shell_card_management_ap_is/models/delivery_address_update.rb +112 -0
- data/lib/shell_card_management_ap_is/models/delivery_address_update_references.rb +102 -0
- data/lib/shell_card_management_ap_is/models/delivery_address_update_request.rb +129 -0
- data/lib/shell_card_management_ap_is/models/delivery_address_update_response.rb +94 -0
- data/lib/shell_card_management_ap_is/models/delivery_addresses.rb +258 -0
- data/lib/shell_card_management_ap_is/models/eid_access.rb +75 -0
- data/lib/shell_card_management_ap_is/models/error_details.rb +81 -0
- data/lib/shell_card_management_ap_is/models/error_status.rb +60 -0
- data/lib/shell_card_management_ap_is/models/error_user_access.rb +50 -0
- data/lib/shell_card_management_ap_is/models/error_user_access_error.rb +60 -0
- data/lib/shell_card_management_ap_is/models/finance_currency.rb +98 -0
- data/lib/shell_card_management_ap_is/models/generate_pin_key_response.rb +60 -0
- data/lib/shell_card_management_ap_is/models/invoice_distribution_method.rb +99 -0
- data/lib/shell_card_management_ap_is/models/location_restrictions.rb +125 -0
- data/lib/shell_card_management_ap_is/models/location_restrictions_country_restrictions.rb +65 -0
- data/lib/shell_card_management_ap_is/models/location_restrictions_network_restrictions_items.rb +77 -0
- data/lib/shell_card_management_ap_is/models/location_restrictions_partner_site_restrictions_items.rb +95 -0
- data/lib/shell_card_management_ap_is/models/location_restrictions_shell_site_restrictions_items.rb +95 -0
- data/lib/shell_card_management_ap_is/models/logged_in_user_request.rb +107 -0
- data/lib/shell_card_management_ap_is/models/logged_in_user_response.rb +394 -0
- data/lib/shell_card_management_ap_is/models/o_auth_provider_error_enum.rb +45 -0
- data/lib/shell_card_management_ap_is/models/o_auth_token.rb +100 -0
- data/lib/shell_card_management_ap_is/models/order_card_enquiry.rb +502 -0
- data/lib/shell_card_management_ap_is/models/order_card_enquiry_req.rb +208 -0
- data/lib/shell_card_management_ap_is/models/order_card_enquiry_req_reference_type_enum.rb +32 -0
- data/lib/shell_card_management_ap_is/models/order_card_enquiry_request.rb +51 -0
- data/lib/shell_card_management_ap_is/models/order_card_enquiry_response.rb +79 -0
- data/lib/shell_card_management_ap_is/models/order_card_request.rb +60 -0
- data/lib/shell_card_management_ap_is/models/order_card_response.rb +90 -0
- data/lib/shell_card_management_ap_is/models/payer_access.rb +147 -0
- data/lib/shell_card_management_ap_is/models/payer_details.rb +1412 -0
- data/lib/shell_card_management_ap_is/models/payer_request.rb +126 -0
- data/lib/shell_card_management_ap_is/models/payer_response.rb +115 -0
- data/lib/shell_card_management_ap_is/models/payers.rb +109 -0
- data/lib/shell_card_management_ap_is/models/pin_advice_types.rb +80 -0
- data/lib/shell_card_management_ap_is/models/pin_delivery_contact.rb +242 -0
- data/lib/shell_card_management_ap_is/models/pin_delivery_details.rb +169 -0
- data/lib/shell_card_management_ap_is/models/pin_reminder_card_details.rb +137 -0
- data/lib/shell_card_management_ap_is/models/pin_reminder_reference.rb +99 -0
- data/lib/shell_card_management_ap_is/models/pin_reminder_request.rb +135 -0
- data/lib/shell_card_management_ap_is/models/pin_reminder_response.rb +90 -0
- data/lib/shell_card_management_ap_is/models/product_all_of0.rb +62 -0
- data/lib/shell_card_management_ap_is/models/product_group.rb +116 -0
- data/lib/shell_card_management_ap_is/models/product_restrictions.rb +66 -0
- data/lib/shell_card_management_ap_is/models/purchase_categories.rb +114 -0
- data/lib/shell_card_management_ap_is/models/purchase_category1_all_of0.rb +140 -0
- data/lib/shell_card_management_ap_is/models/purchase_category_request.rb +114 -0
- data/lib/shell_card_management_ap_is/models/purchase_category_response.rb +69 -0
- data/lib/shell_card_management_ap_is/models/replace_card_settings.rb +641 -0
- data/lib/shell_card_management_ap_is/models/restriction_card_request.rb +115 -0
- data/lib/shell_card_management_ap_is/models/restriction_card_request_cards_items.rb +220 -0
- data/lib/shell_card_management_ap_is/models/restriction_card_response.rb +91 -0
- data/lib/shell_card_management_ap_is/models/restriction_card_response_data_items.rb +240 -0
- data/lib/shell_card_management_ap_is/models/restriction_search_card_request.rb +50 -0
- data/lib/shell_card_management_ap_is/models/restriction_search_card_request_filters.rb +177 -0
- data/lib/shell_card_management_ap_is/models/restriction_search_card_request_filters_cards_items.rb +63 -0
- data/lib/shell_card_management_ap_is/models/restriction_search_card_response.rb +79 -0
- data/lib/shell_card_management_ap_is/models/restriction_search_card_response_data_items.rb +514 -0
- data/lib/shell_card_management_ap_is/models/role.rb +102 -0
- data/lib/shell_card_management_ap_is/models/schedule_card_block_cards_items.rb +249 -0
- data/lib/shell_card_management_ap_is/models/schedule_card_block_request.rb +77 -0
- data/lib/shell_card_management_ap_is/models/schedule_card_block_response.rb +91 -0
- data/lib/shell_card_management_ap_is/models/schedule_card_block_response_data_items.rb +89 -0
- data/lib/shell_card_management_ap_is/models/search_account_limit_request.rb +50 -0
- data/lib/shell_card_management_ap_is/models/search_account_limit_request_filters.rb +118 -0
- data/lib/shell_card_management_ap_is/models/search_account_limit_response.rb +70 -0
- data/lib/shell_card_management_ap_is/models/search_account_limit_response_data.rb +106 -0
- data/lib/shell_card_management_ap_is/models/search_card.rb +66 -0
- data/lib/shell_card_management_ap_is/models/search_card_request.rb +72 -0
- data/lib/shell_card_management_ap_is/models/search_card_response_restrictions.rb +99 -0
- data/lib/shell_card_management_ap_is/models/search_product_restriction.rb +78 -0
- data/lib/shell_card_management_ap_is/models/search_request.rb +724 -0
- data/lib/shell_card_management_ap_is/models/submitted_card.rb +183 -0
- data/lib/shell_card_management_ap_is/models/summary_of_bundle_request.rb +50 -0
- data/lib/shell_card_management_ap_is/models/summary_of_bundle_response.rb +79 -0
- data/lib/shell_card_management_ap_is/models/summary_of_bundle_response_data_items.rb +123 -0
- data/lib/shell_card_management_ap_is/models/summary_of_bundle_response_data_items_card_bundles_items.rb +86 -0
- data/lib/shell_card_management_ap_is/models/summary_request.rb +598 -0
- data/lib/shell_card_management_ap_is/models/summary_response.rb +184 -0
- data/lib/shell_card_management_ap_is/models/summaryof_bundle.rb +126 -0
- data/lib/shell_card_management_ap_is/models/update_bundle_request.rb +194 -0
- data/lib/shell_card_management_ap_is/models/update_bundle_response.rb +70 -0
- data/lib/shell_card_management_ap_is/models/update_card.rb +316 -0
- data/lib/shell_card_management_ap_is/models/update_card_group_request.rb +258 -0
- data/lib/shell_card_management_ap_is/models/update_card_group_response.rb +130 -0
- data/lib/shell_card_management_ap_is/models/update_card_group_response_move_card_references_items.rb +77 -0
- data/lib/shell_card_management_ap_is/models/update_card_renewal_address.rb +163 -0
- data/lib/shell_card_management_ap_is/models/update_card_status_request.rb +124 -0
- data/lib/shell_card_management_ap_is/models/update_card_status_response.rb +133 -0
- data/lib/shell_card_management_ap_is/models/update_m_pay_reg_status_request.rb +112 -0
- data/lib/shell_card_management_ap_is/models/update_m_pay_reg_status_request_m_pay_requests_items.rb +105 -0
- data/lib/shell_card_management_ap_is/models/update_m_pay_reg_status_response.rb +60 -0
- data/lib/shell_card_management_ap_is/models/url_enum.rb +23 -0
- data/lib/shell_card_management_ap_is/models/usage_restrictions.rb +311 -0
- data/lib/shell_card_management_ap_is/utilities/date_time_helper.rb +11 -0
- data/lib/shell_card_management_ap_is/utilities/file_wrapper.rb +16 -0
- data/lib/shell_card_management_ap_is.rb +288 -0
- metadata +283 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
# shell_card_management_ap_is
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellCardManagementApIs
|
7
|
+
# OAuth 2 Authorization endpoint exception.
|
8
|
+
class OAuthProviderException < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Gets or sets error code.
|
13
|
+
# @return [OAuthProviderErrorEnum]
|
14
|
+
attr_accessor :error
|
15
|
+
|
16
|
+
# Gets or sets human-readable text providing additional information on
|
17
|
+
# error.
|
18
|
+
# Used to assist the client developer in understanding the error that
|
19
|
+
# occurred.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :error_description
|
22
|
+
|
23
|
+
# Gets or sets a URI identifying a human-readable web page with information
|
24
|
+
# about the error, used to provide the client developer with additional
|
25
|
+
# information about the error.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :error_uri
|
28
|
+
|
29
|
+
# The constructor.
|
30
|
+
# @param [String] The reason for raising an exception.
|
31
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
32
|
+
def initialize(reason, response)
|
33
|
+
super(reason, response)
|
34
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
35
|
+
unbox(hash)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Populates this object by extracting properties from a hash.
|
39
|
+
# @param [Hash] The deserialized response sent by the server in the
|
40
|
+
# response body.
|
41
|
+
def unbox(hash)
|
42
|
+
@error = hash.key?('error') ? hash['error'] : nil
|
43
|
+
@error_description =
|
44
|
+
hash.key?('error_description') ? hash['error_description'] : SKIP
|
45
|
+
@error_uri = hash.key?('error_uri') ? hash['error_uri'] : SKIP
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# shell_card_management_ap_is
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellCardManagementApIs
|
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 clone_with(username: nil, password: nil)
|
44
|
+
username ||= self.username
|
45
|
+
password ||= self.password
|
46
|
+
|
47
|
+
BasicAuthCredentials.new(username: username, password: password)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# shell_card_management_ap_is
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellCardManagementApIs
|
7
|
+
# Utility class for OAuth 2 authorization and token management.
|
8
|
+
class BearerToken < 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
|
+
'BearerToken: OAuthToken is undefined or expired.'
|
14
|
+
end
|
15
|
+
|
16
|
+
# Initialization constructor.
|
17
|
+
def initialize(bearer_token_credentials, config)
|
18
|
+
auth_params = {}
|
19
|
+
@_o_auth_client_id = bearer_token_credentials.o_auth_client_id unless
|
20
|
+
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_client_id.nil?
|
21
|
+
@_o_auth_client_secret = bearer_token_credentials.o_auth_client_secret unless
|
22
|
+
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_client_secret.nil?
|
23
|
+
@_o_auth_token = bearer_token_credentials.o_auth_token unless
|
24
|
+
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_token.nil?
|
25
|
+
@_o_auth_api = OAuthAuthorizationController.new(config)
|
26
|
+
auth_params['Authorization'] = "Bearer #{@_o_auth_token.access_token}" unless @_o_auth_token.nil?
|
27
|
+
|
28
|
+
super auth_params
|
29
|
+
end
|
30
|
+
|
31
|
+
# Validates the oAuth token.
|
32
|
+
# @return [Boolean] true if the token is present and not expired.
|
33
|
+
def valid
|
34
|
+
!@_o_auth_token.nil? && !token_expired?(@_o_auth_token)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Builds the basic auth header for endpoints in the OAuth Authorization Controller.
|
38
|
+
# @return [String] The value of the Authentication header.
|
39
|
+
def build_basic_auth_header
|
40
|
+
"Basic #{AuthHelper.get_base64_encoded_value(@_o_auth_client_id, @_o_auth_client_secret)}"
|
41
|
+
end
|
42
|
+
|
43
|
+
# Fetches the token.
|
44
|
+
# @param [Hash] additional_params Any additional form parameters.
|
45
|
+
# @return [OAuthToken] The oAuth token instance.
|
46
|
+
def fetch_token(additional_params: nil)
|
47
|
+
token = @_o_auth_api.request_token_bearer_token(
|
48
|
+
build_basic_auth_header,
|
49
|
+
_field_parameters: additional_params
|
50
|
+
)
|
51
|
+
if token.respond_to?('expires_in') && !token.expires_in.nil?
|
52
|
+
token.expiry = AuthHelper.get_token_expiry(token.expires_in, Time.now.utc.to_i)
|
53
|
+
end
|
54
|
+
token
|
55
|
+
end
|
56
|
+
|
57
|
+
# Checks if OAuth token has expired.
|
58
|
+
# @param [OAuthToken] token The oAuth token instance.
|
59
|
+
# @return [Boolean] true if the token's expiry exist and also the token is expired, false otherwise.
|
60
|
+
def token_expired?(token)
|
61
|
+
token.respond_to?('expiry') && AuthHelper.token_expired?(token.expiry)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Data class for BearerTokenCredentials.
|
66
|
+
class BearerTokenCredentials
|
67
|
+
attr_reader :o_auth_client_id, :o_auth_client_secret, :o_auth_token
|
68
|
+
|
69
|
+
def initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_token: nil)
|
70
|
+
raise ArgumentError, 'o_auth_client_id cannot be nil' if o_auth_client_id.nil?
|
71
|
+
raise ArgumentError, 'o_auth_client_secret cannot be nil' if o_auth_client_secret.nil?
|
72
|
+
|
73
|
+
@o_auth_client_id = o_auth_client_id
|
74
|
+
@o_auth_client_secret = o_auth_client_secret
|
75
|
+
@o_auth_token = o_auth_token
|
76
|
+
end
|
77
|
+
|
78
|
+
def clone_with(o_auth_client_id: nil, o_auth_client_secret: nil,
|
79
|
+
o_auth_token: nil)
|
80
|
+
o_auth_client_id ||= self.o_auth_client_id
|
81
|
+
o_auth_client_secret ||= self.o_auth_client_secret
|
82
|
+
o_auth_token ||= self.o_auth_token
|
83
|
+
|
84
|
+
BearerTokenCredentials.new(o_auth_client_id: o_auth_client_id,
|
85
|
+
o_auth_client_secret: o_auth_client_secret,
|
86
|
+
o_auth_token: o_auth_token)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# shell_card_management_ap_is
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellCardManagementApIs
|
7
|
+
# HttpCallBack allows defining callables for pre and post API calls.
|
8
|
+
class HttpCallBack < CoreLibrary::HttpCallback
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# shell_card_management_ap_is
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellCardManagementApIs
|
7
|
+
# AccountAccess Model.
|
8
|
+
class AccountAccess < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Collecting company id.
|
13
|
+
# @return [Integer]
|
14
|
+
attr_accessor :colco_id
|
15
|
+
|
16
|
+
# Collecting company code.
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :colco_code
|
19
|
+
|
20
|
+
# Payer Id to which the user has access
|
21
|
+
# @return [Integer]
|
22
|
+
attr_accessor :payer_id
|
23
|
+
|
24
|
+
# Payer Number to which the user has access
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :payer_number
|
27
|
+
|
28
|
+
# Name of the Payer to which the user has access
|
29
|
+
# @return [String]
|
30
|
+
attr_accessor :payer_name
|
31
|
+
|
32
|
+
# Account Id to which the user has access
|
33
|
+
# @return [Integer]
|
34
|
+
attr_accessor :account_id
|
35
|
+
|
36
|
+
# Account Number to which the user has access
|
37
|
+
# @return [String]
|
38
|
+
attr_accessor :account_number
|
39
|
+
|
40
|
+
# Name of the Account to which the user has access
|
41
|
+
# @return [String]
|
42
|
+
attr_accessor :account_name
|
43
|
+
|
44
|
+
# A mapping from model property names to API property names.
|
45
|
+
def self.names
|
46
|
+
@_hash = {} if @_hash.nil?
|
47
|
+
@_hash['colco_id'] = 'ColcoId'
|
48
|
+
@_hash['colco_code'] = 'ColcoCode'
|
49
|
+
@_hash['payer_id'] = 'PayerId'
|
50
|
+
@_hash['payer_number'] = 'PayerNumber'
|
51
|
+
@_hash['payer_name'] = 'PayerName'
|
52
|
+
@_hash['account_id'] = 'AccountId'
|
53
|
+
@_hash['account_number'] = 'AccountNumber'
|
54
|
+
@_hash['account_name'] = 'AccountName'
|
55
|
+
@_hash
|
56
|
+
end
|
57
|
+
|
58
|
+
# An array for optional fields
|
59
|
+
def self.optionals
|
60
|
+
%w[
|
61
|
+
colco_id
|
62
|
+
colco_code
|
63
|
+
payer_id
|
64
|
+
payer_number
|
65
|
+
payer_name
|
66
|
+
account_id
|
67
|
+
account_number
|
68
|
+
account_name
|
69
|
+
]
|
70
|
+
end
|
71
|
+
|
72
|
+
# An array for nullable fields
|
73
|
+
def self.nullables
|
74
|
+
%w[
|
75
|
+
colco_id
|
76
|
+
colco_code
|
77
|
+
payer_id
|
78
|
+
payer_number
|
79
|
+
payer_name
|
80
|
+
account_id
|
81
|
+
account_name
|
82
|
+
]
|
83
|
+
end
|
84
|
+
|
85
|
+
def initialize(colco_id = SKIP,
|
86
|
+
colco_code = SKIP,
|
87
|
+
payer_id = SKIP,
|
88
|
+
payer_number = SKIP,
|
89
|
+
payer_name = SKIP,
|
90
|
+
account_id = SKIP,
|
91
|
+
account_number = SKIP,
|
92
|
+
account_name = SKIP)
|
93
|
+
@colco_id = colco_id unless colco_id == SKIP
|
94
|
+
@colco_code = colco_code unless colco_code == SKIP
|
95
|
+
@payer_id = payer_id unless payer_id == SKIP
|
96
|
+
@payer_number = payer_number unless payer_number == SKIP
|
97
|
+
@payer_name = payer_name unless payer_name == SKIP
|
98
|
+
@account_id = account_id unless account_id == SKIP
|
99
|
+
@account_number = account_number unless account_number == SKIP
|
100
|
+
@account_name = account_name unless account_name == SKIP
|
101
|
+
end
|
102
|
+
|
103
|
+
# Creates an instance of the object from a hash.
|
104
|
+
def self.from_hash(hash)
|
105
|
+
return nil unless hash
|
106
|
+
|
107
|
+
# Extract variables from the hash.
|
108
|
+
colco_id = hash.key?('ColcoId') ? hash['ColcoId'] : SKIP
|
109
|
+
colco_code = hash.key?('ColcoCode') ? hash['ColcoCode'] : SKIP
|
110
|
+
payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
|
111
|
+
payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
|
112
|
+
payer_name = hash.key?('PayerName') ? hash['PayerName'] : SKIP
|
113
|
+
account_id = hash.key?('AccountId') ? hash['AccountId'] : SKIP
|
114
|
+
account_number = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
|
115
|
+
account_name = hash.key?('AccountName') ? hash['AccountName'] : SKIP
|
116
|
+
|
117
|
+
# Create object from extracted values.
|
118
|
+
AccountAccess.new(colco_id,
|
119
|
+
colco_code,
|
120
|
+
payer_id,
|
121
|
+
payer_number,
|
122
|
+
payer_name,
|
123
|
+
account_id,
|
124
|
+
account_number,
|
125
|
+
account_name)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,252 @@
|
|
1
|
+
# shell_card_management_ap_is
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellCardManagementApIs
|
7
|
+
# AccountRequest Model.
|
8
|
+
class AccountRequest < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Account Status.
|
13
|
+
# Optional if StatusList is passed, else mandatory.
|
14
|
+
# Ignored if StatusList is passed.
|
15
|
+
# Allowed values:
|
16
|
+
# • ALL
|
17
|
+
# • ACTIVE
|
18
|
+
# • BLOCKED
|
19
|
+
# • CANCELLED
|
20
|
+
# • CREDITLOCK
|
21
|
+
# • DELINQUENCYLOCK
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :status
|
24
|
+
|
25
|
+
# Include card summary details in the response.
|
26
|
+
# When passed as false, the card summary related parameters on response will
|
27
|
+
# be set to null.
|
28
|
+
# Optional – default value: true.
|
29
|
+
# @return [TrueClass | FalseClass]
|
30
|
+
attr_accessor :include_card_summary
|
31
|
+
|
32
|
+
# Payer id of the customer.
|
33
|
+
# Optional if PayerNumber is passed, else Mandatory.
|
34
|
+
# @return [Integer]
|
35
|
+
attr_accessor :payer_id
|
36
|
+
|
37
|
+
# PayerNumber of the customer.
|
38
|
+
# Optional if PayerId is passed, else Mandatory.
|
39
|
+
# @return [String]
|
40
|
+
attr_accessor :payer_number
|
41
|
+
|
42
|
+
# Page Size – Number of records to show on a page.
|
43
|
+
# Optional
|
44
|
+
# Default value 50
|
45
|
+
# @return [Integer]
|
46
|
+
attr_accessor :page_size
|
47
|
+
|
48
|
+
# API Request Id
|
49
|
+
# @return [String]
|
50
|
+
attr_accessor :request_id
|
51
|
+
|
52
|
+
# Collecting Company Code (Shell Code) of the selected payer.
|
53
|
+
# ColCoCode or ColCoCountryCode is Mandatory for serviced OUs such as
|
54
|
+
# Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other
|
55
|
+
# countries if ColCoID is provided.
|
56
|
+
# @return [Integer]
|
57
|
+
attr_accessor :col_co_code
|
58
|
+
|
59
|
+
# The 2-character ISO Code for the customer and card owning country.
|
60
|
+
# ColCoCode or ColCoCountryCode is Mandatory for serviced OUs such as
|
61
|
+
# Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other
|
62
|
+
# countries if ColCoID is provided.
|
63
|
+
# @return [String]
|
64
|
+
attr_accessor :col_co_country_code
|
65
|
+
|
66
|
+
# Page Number (as shown to the users)
|
67
|
+
# Optional
|
68
|
+
# Default value 1
|
69
|
+
# @return [Integer]
|
70
|
+
attr_accessor :current_page
|
71
|
+
|
72
|
+
# Optional – default value: false.
|
73
|
+
# When passed as true, the API will return accounts that are configured as
|
74
|
+
# Invoice Point only.
|
75
|
+
# @return [TrueClass | FalseClass]
|
76
|
+
attr_accessor :invoice_points_only
|
77
|
+
|
78
|
+
# Collecting Company Id (in GFN) of the selected payer.
|
79
|
+
# Optional if ColCoCode or ColCoCountryCode is passed else Mandatory.
|
80
|
+
# @return [Integer]
|
81
|
+
attr_accessor :col_co_id
|
82
|
+
|
83
|
+
# Return e-Toll Customer details When True.
|
84
|
+
# @return [TrueClass | FalseClass]
|
85
|
+
attr_accessor :return_tolls_customer_id
|
86
|
+
|
87
|
+
# Return e-Toll Customer details When True.
|
88
|
+
# @return [Array[Accounts]]
|
89
|
+
attr_accessor :accounts
|
90
|
+
|
91
|
+
# Account Name of the customer.
|
92
|
+
# Optional.
|
93
|
+
# Minimum of 4 characters should be provided else not considered.
|
94
|
+
# Accounts those have the entered value at any part of the Name will be
|
95
|
+
# returned.
|
96
|
+
# @return [String]
|
97
|
+
attr_accessor :account_name
|
98
|
+
|
99
|
+
# Account Statuses.
|
100
|
+
# Optional
|
101
|
+
# Multiple statuses are allowed to be included in the search criteria.
|
102
|
+
# Allowed values:
|
103
|
+
# • ACTIVE
|
104
|
+
# • BLOCKED
|
105
|
+
# • CANCELLED
|
106
|
+
# • CREDITLOCK
|
107
|
+
# • DELINQUENCYLOCK
|
108
|
+
# @return [Array[String]]
|
109
|
+
attr_accessor :status_list
|
110
|
+
|
111
|
+
# A mapping from model property names to API property names.
|
112
|
+
def self.names
|
113
|
+
@_hash = {} if @_hash.nil?
|
114
|
+
@_hash['status'] = 'Status'
|
115
|
+
@_hash['include_card_summary'] = 'IncludeCardSummary'
|
116
|
+
@_hash['payer_id'] = 'PayerId'
|
117
|
+
@_hash['payer_number'] = 'PayerNumber'
|
118
|
+
@_hash['page_size'] = 'PageSize'
|
119
|
+
@_hash['request_id'] = 'RequestId'
|
120
|
+
@_hash['col_co_code'] = 'ColCoCode'
|
121
|
+
@_hash['col_co_country_code'] = 'ColCoCountryCode'
|
122
|
+
@_hash['current_page'] = 'CurrentPage'
|
123
|
+
@_hash['invoice_points_only'] = 'InvoicePointsOnly'
|
124
|
+
@_hash['col_co_id'] = 'ColCoId'
|
125
|
+
@_hash['return_tolls_customer_id'] = 'ReturnTollsCustomerId'
|
126
|
+
@_hash['accounts'] = 'Accounts'
|
127
|
+
@_hash['account_name'] = 'AccountName'
|
128
|
+
@_hash['status_list'] = 'StatusList'
|
129
|
+
@_hash
|
130
|
+
end
|
131
|
+
|
132
|
+
# An array for optional fields
|
133
|
+
def self.optionals
|
134
|
+
%w[
|
135
|
+
status
|
136
|
+
include_card_summary
|
137
|
+
payer_id
|
138
|
+
payer_number
|
139
|
+
page_size
|
140
|
+
request_id
|
141
|
+
col_co_code
|
142
|
+
col_co_country_code
|
143
|
+
current_page
|
144
|
+
invoice_points_only
|
145
|
+
col_co_id
|
146
|
+
return_tolls_customer_id
|
147
|
+
accounts
|
148
|
+
account_name
|
149
|
+
status_list
|
150
|
+
]
|
151
|
+
end
|
152
|
+
|
153
|
+
# An array for nullable fields
|
154
|
+
def self.nullables
|
155
|
+
%w[
|
156
|
+
status
|
157
|
+
payer_id
|
158
|
+
payer_number
|
159
|
+
page_size
|
160
|
+
request_id
|
161
|
+
col_co_code
|
162
|
+
col_co_country_code
|
163
|
+
current_page
|
164
|
+
invoice_points_only
|
165
|
+
col_co_id
|
166
|
+
account_name
|
167
|
+
]
|
168
|
+
end
|
169
|
+
|
170
|
+
def initialize(status = SKIP,
|
171
|
+
include_card_summary = true,
|
172
|
+
payer_id = SKIP,
|
173
|
+
payer_number = SKIP,
|
174
|
+
page_size = SKIP,
|
175
|
+
request_id = SKIP,
|
176
|
+
col_co_code = SKIP,
|
177
|
+
col_co_country_code = SKIP,
|
178
|
+
current_page = SKIP,
|
179
|
+
invoice_points_only = false,
|
180
|
+
col_co_id = SKIP,
|
181
|
+
return_tolls_customer_id = SKIP,
|
182
|
+
accounts = SKIP,
|
183
|
+
account_name = SKIP,
|
184
|
+
status_list = SKIP)
|
185
|
+
@status = status unless status == SKIP
|
186
|
+
@include_card_summary = include_card_summary unless include_card_summary == SKIP
|
187
|
+
@payer_id = payer_id unless payer_id == SKIP
|
188
|
+
@payer_number = payer_number unless payer_number == SKIP
|
189
|
+
@page_size = page_size unless page_size == SKIP
|
190
|
+
@request_id = request_id unless request_id == SKIP
|
191
|
+
@col_co_code = col_co_code unless col_co_code == SKIP
|
192
|
+
@col_co_country_code = col_co_country_code unless col_co_country_code == SKIP
|
193
|
+
@current_page = current_page unless current_page == SKIP
|
194
|
+
@invoice_points_only = invoice_points_only unless invoice_points_only == SKIP
|
195
|
+
@col_co_id = col_co_id unless col_co_id == SKIP
|
196
|
+
@return_tolls_customer_id = return_tolls_customer_id unless return_tolls_customer_id == SKIP
|
197
|
+
@accounts = accounts unless accounts == SKIP
|
198
|
+
@account_name = account_name unless account_name == SKIP
|
199
|
+
@status_list = status_list unless status_list == SKIP
|
200
|
+
end
|
201
|
+
|
202
|
+
# Creates an instance of the object from a hash.
|
203
|
+
def self.from_hash(hash)
|
204
|
+
return nil unless hash
|
205
|
+
|
206
|
+
# Extract variables from the hash.
|
207
|
+
status = hash.key?('Status') ? hash['Status'] : SKIP
|
208
|
+
include_card_summary = hash['IncludeCardSummary'] ||= true
|
209
|
+
payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
|
210
|
+
payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
|
211
|
+
page_size = hash.key?('PageSize') ? hash['PageSize'] : SKIP
|
212
|
+
request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP
|
213
|
+
col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
|
214
|
+
col_co_country_code =
|
215
|
+
hash.key?('ColCoCountryCode') ? hash['ColCoCountryCode'] : SKIP
|
216
|
+
current_page = hash.key?('CurrentPage') ? hash['CurrentPage'] : SKIP
|
217
|
+
invoice_points_only = hash['InvoicePointsOnly'] ||= false
|
218
|
+
col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
|
219
|
+
return_tolls_customer_id =
|
220
|
+
hash.key?('ReturnTollsCustomerId') ? hash['ReturnTollsCustomerId'] : SKIP
|
221
|
+
# Parameter is an array, so we need to iterate through it
|
222
|
+
accounts = nil
|
223
|
+
unless hash['Accounts'].nil?
|
224
|
+
accounts = []
|
225
|
+
hash['Accounts'].each do |structure|
|
226
|
+
accounts << (Accounts.from_hash(structure) if structure)
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
accounts = SKIP unless hash.key?('Accounts')
|
231
|
+
account_name = hash.key?('AccountName') ? hash['AccountName'] : SKIP
|
232
|
+
status_list = hash.key?('StatusList') ? hash['StatusList'] : SKIP
|
233
|
+
|
234
|
+
# Create object from extracted values.
|
235
|
+
AccountRequest.new(status,
|
236
|
+
include_card_summary,
|
237
|
+
payer_id,
|
238
|
+
payer_number,
|
239
|
+
page_size,
|
240
|
+
request_id,
|
241
|
+
col_co_code,
|
242
|
+
col_co_country_code,
|
243
|
+
current_page,
|
244
|
+
invoice_points_only,
|
245
|
+
col_co_id,
|
246
|
+
return_tolls_customer_id,
|
247
|
+
accounts,
|
248
|
+
account_name,
|
249
|
+
status_list)
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|