data-and-reporting-sdk 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -16
- data/lib/shell_data_reporting_ap_is/controllers/base_controller.rb +9 -9
- data/lib/shell_data_reporting_ap_is/controllers/customer_controller.rb +210 -210
- data/lib/shell_data_reporting_ap_is/controllers/invoice_controller.rb +221 -221
- data/lib/shell_data_reporting_ap_is/controllers/o_auth_authorization_controller.rb +9 -9
- data/lib/shell_data_reporting_ap_is/controllers/transaction_controller.rb +354 -354
- data/lib/shell_data_reporting_ap_is/exceptions/default_error_exception.rb +15 -15
- data/lib/shell_data_reporting_ap_is/exceptions/error_object_exception.rb +15 -15
- data/lib/shell_data_reporting_ap_is/exceptions/error_user_access_error1_exception.rb +15 -15
- data/lib/shell_data_reporting_ap_is/exceptions/o_auth_provider_exception.rb +15 -15
- data/lib/shell_data_reporting_ap_is/http/auth/bearer_token.rb +54 -10
- data/lib/shell_data_reporting_ap_is/models/account_access.rb +3 -8
- data/lib/shell_data_reporting_ap_is/models/account_request.rb +17 -26
- data/lib/shell_data_reporting_ap_is/models/account_response.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/account_response_accounts_items.rb +29 -53
- data/lib/shell_data_reporting_ap_is/models/accounts.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/address.rb +4 -11
- data/lib/shell_data_reporting_ap_is/models/audit_request.rb +17 -25
- data/lib/shell_data_reporting_ap_is/models/audit_response.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/audit_response_audits_items.rb +50 -63
- data/lib/shell_data_reporting_ap_is/models/bank_account.rb +5 -13
- data/lib/shell_data_reporting_ap_is/models/base_model.rb +76 -28
- data/lib/shell_data_reporting_ap_is/models/bonus_configuration.rb +9 -18
- data/lib/shell_data_reporting_ap_is/models/bonus_history.rb +14 -29
- data/lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb +3 -9
- data/lib/shell_data_reporting_ap_is/models/card_exceptions.rb +8 -19
- data/lib/shell_data_reporting_ap_is/models/card_group_request.rb +6 -12
- data/lib/shell_data_reporting_ap_is/models/card_group_response.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/card_group_response_card_groups_items.rb +10 -20
- data/lib/shell_data_reporting_ap_is/models/card_type_request.rb +3 -7
- data/lib/shell_data_reporting_ap_is/models/card_type_response.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/card_type_response_customer_card_types_items.rb +15 -31
- data/lib/shell_data_reporting_ap_is/models/card_type_response_error.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/card_usage_restrictions.rb +5 -10
- data/lib/shell_data_reporting_ap_is/models/card_usage_summary_request.rb +3 -8
- data/lib/shell_data_reporting_ap_is/models/card_usage_summary_response.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/col_co_access.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/current_volume.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/customer_contract.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/customer_detail_request.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/customer_detail_response.rb +31 -45
- data/lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb +5 -12
- data/lib/shell_data_reporting_ap_is/models/customer_price_list_response.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/default_error_fault.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/delivery_addresses.rb +7 -18
- data/lib/shell_data_reporting_ap_is/models/eid_access.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/eid_document.rb +11 -16
- data/lib/shell_data_reporting_ap_is/models/eid_document_response.rb +3 -8
- data/lib/shell_data_reporting_ap_is/models/eid_download_req.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/eid_search_req.rb +10 -15
- data/lib/shell_data_reporting_ap_is/models/eid_search_request.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/error_details.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/error_status.rb +11 -2
- data/lib/shell_data_reporting_ap_is/models/error_user_access_error.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/exception_product.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/exception_site_location.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/fee_item.rb +35 -71
- data/lib/shell_data_reporting_ap_is/models/fee_item_summary_all_of0.rb +5 -11
- data/lib/shell_data_reporting_ap_is/models/fee_rule_location.rb +4 -10
- data/lib/shell_data_reporting_ap_is/models/fee_rule_product.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/fee_summary_response.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/fees_fee_rule_tiers.rb +3 -7
- data/lib/shell_data_reporting_ap_is/models/finance_currency.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/fleetmanagement_v1_user_loggedinuser_request.rb +104 -0
- data/lib/shell_data_reporting_ap_is/models/fuel_consumption_card.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb +9 -20
- data/lib/shell_data_reporting_ap_is/models/fuel_consumption_request.rb +7 -14
- data/lib/shell_data_reporting_ap_is/models/fuel_consumption_response.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/invoice_dates_response_data.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/invoice_download_req.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/invoice_search_details.rb +86 -107
- data/lib/shell_data_reporting_ap_is/models/invoice_search_request.rb +5 -7
- data/lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb +21 -31
- data/lib/shell_data_reporting_ap_is/models/invoice_search_response.rb +2 -7
- data/lib/shell_data_reporting_ap_is/models/invoice_summary_request_filters.rb +21 -31
- data/lib/shell_data_reporting_ap_is/models/invoice_summary_response.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/invoices_summaries.rb +5 -10
- data/lib/shell_data_reporting_ap_is/models/last_statement_of_account.rb +39 -48
- data/lib/shell_data_reporting_ap_is/models/logged_in_user_request.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/logged_in_user_response.rb +12 -25
- data/lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb +21 -32
- data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request_accounts_items.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_response.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_response_transactions_items.rb +70 -122
- data/lib/shell_data_reporting_ap_is/models/o_auth_token.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/past_statement_of_accounts.rb +11 -22
- data/lib/shell_data_reporting_ap_is/models/payer_access.rb +3 -8
- data/lib/shell_data_reporting_ap_is/models/payer_details.rb +49 -92
- data/lib/shell_data_reporting_ap_is/models/payer_request.rb +9 -12
- data/lib/shell_data_reporting_ap_is/models/payer_response.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/payers.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/payments_since_last_soa.rb +8 -17
- data/lib/shell_data_reporting_ap_is/models/pin_advice_types.rb +5 -6
- data/lib/shell_data_reporting_ap_is/models/price_list.rb +25 -45
- data/lib/shell_data_reporting_ap_is/models/price_trans_summary_request.rb +28 -44
- data/lib/shell_data_reporting_ap_is/models/price_transaction_request.rb +41 -59
- data/lib/shell_data_reporting_ap_is/models/priced_request_data.rb +20 -46
- data/lib/shell_data_reporting_ap_is/models/priced_response_data.rb +91 -201
- data/lib/shell_data_reporting_ap_is/models/priced_trans_summary_response.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb +22 -28
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_items_location_items.rb +11 -2
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_request_v2.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_response_transactions_items.rb +91 -141
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/pricing_current_volume.rb +3 -6
- data/lib/shell_data_reporting_ap_is/models/pricing_history.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/purchase_categories.rb +1 -4
- data/lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb +6 -14
- data/lib/shell_data_reporting_ap_is/models/recent_transaction_request.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/recent_transactions.rb +29 -60
- data/lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/role.rb +3 -6
- data/lib/shell_data_reporting_ap_is/models/search_doc_req.rb +19 -27
- data/lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb +9 -16
- data/lib/shell_data_reporting_ap_is/models/search_documents_request.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/search_documents_response.rb +3 -7
- data/lib/shell_data_reporting_ap_is/models/search_soa_req.rb +4 -11
- data/lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb +11 -18
- data/lib/shell_data_reporting_ap_is/models/search_statement_of_account_request.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/search_statement_of_account_response.rb +2 -7
- data/lib/shell_data_reporting_ap_is/models/site_location.rb +11 -2
- data/lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/statement_of_account_response.rb +1 -3
- data/lib/shell_data_reporting_ap_is/models/tier.rb +8 -12
- data/lib/shell_data_reporting_ap_is/models/transaction_exceptions.rb +47 -92
- data/lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb +12 -21
- data/lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/transaction_fees_request.rb +21 -33
- data/lib/shell_data_reporting_ap_is/models/transaction_fees_response.rb +2 -6
- data/lib/shell_data_reporting_ap_is/models/update_odometer.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/update_odometer_reference.rb +1 -2
- data/lib/shell_data_reporting_ap_is/models/update_odometer_request.rb +3 -8
- data/lib/shell_data_reporting_ap_is/models/update_odometer_response.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/usage_summary.rb +6 -14
- data/lib/shell_data_reporting_ap_is/models/volume_based_bonus_request.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/volume_based_bonus_response.rb +2 -4
- data/lib/shell_data_reporting_ap_is/models/volume_based_pricing_request.rb +2 -5
- data/lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb +2 -5
- data/lib/shell_data_reporting_ap_is/utilities/file_wrapper.rb +9 -9
- data/lib/shell_data_reporting_ap_is/utilities/union_type_lookup.rb +35 -0
- data/lib/shell_data_reporting_ap_is.rb +3 -0
- data/test/controllers/controller_test_base.rb +0 -5
- data/test/controllers/test_invoice_controller.rb +1 -1
- data/test/controllers/test_transaction_controller.rb +83 -75
- metadata +12 -16
@@ -11,21 +11,21 @@ module ShellDataReportingApIs
|
|
11
11
|
|
12
12
|
# Error object
|
13
13
|
# @return [DefaultErrorFault]
|
14
|
-
attr_accessor :fault
|
15
|
-
|
16
|
-
# The constructor.
|
17
|
-
# @param [String] The reason for raising an exception.
|
18
|
-
# @param [HttpResponse] The HttpReponse of the API call.
|
19
|
-
def initialize(reason, response)
|
20
|
-
super(reason, response)
|
21
|
-
hash = APIHelper.json_deserialize(@response.raw_body)
|
22
|
-
unbox(hash)
|
23
|
-
end
|
24
|
-
|
25
|
-
# Populates this object by extracting properties from a hash.
|
26
|
-
# @param [Hash] The deserialized response sent by the server in the
|
27
|
-
# response body.
|
28
|
-
def unbox(hash)
|
14
|
+
attr_accessor :fault
|
15
|
+
|
16
|
+
# The constructor.
|
17
|
+
# @param [String] The reason for raising an exception.
|
18
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
19
|
+
def initialize(reason, response)
|
20
|
+
super(reason, response)
|
21
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
22
|
+
unbox(hash)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Populates this object by extracting properties from a hash.
|
26
|
+
# @param [Hash] The deserialized response sent by the server in the
|
27
|
+
# response body.
|
28
|
+
def unbox(hash)
|
29
29
|
@fault = DefaultErrorFault.from_hash(hash['fault']) if hash['fault']
|
30
30
|
end
|
31
31
|
end
|
@@ -22,21 +22,21 @@ module ShellDataReportingApIs
|
|
22
22
|
# Indicates overall status of the request. Allowed values: SUCCES, FAILED,
|
23
23
|
# PARTIAL_SUCCESS
|
24
24
|
# @return [Array[ErrorDetails]]
|
25
|
-
attr_accessor :errors
|
26
|
-
|
27
|
-
# The constructor.
|
28
|
-
# @param [String] The reason for raising an exception.
|
29
|
-
# @param [HttpResponse] The HttpReponse of the API call.
|
30
|
-
def initialize(reason, response)
|
31
|
-
super(reason, response)
|
32
|
-
hash = APIHelper.json_deserialize(@response.raw_body)
|
33
|
-
unbox(hash)
|
34
|
-
end
|
35
|
-
|
36
|
-
# Populates this object by extracting properties from a hash.
|
37
|
-
# @param [Hash] The deserialized response sent by the server in the
|
38
|
-
# response body.
|
39
|
-
def unbox(hash)
|
25
|
+
attr_accessor :errors
|
26
|
+
|
27
|
+
# The constructor.
|
28
|
+
# @param [String] The reason for raising an exception.
|
29
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
30
|
+
def initialize(reason, response)
|
31
|
+
super(reason, response)
|
32
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
33
|
+
unbox(hash)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Populates this object by extracting properties from a hash.
|
37
|
+
# @param [Hash] The deserialized response sent by the server in the
|
38
|
+
# response body.
|
39
|
+
def unbox(hash)
|
40
40
|
@request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP
|
41
41
|
@status = hash.key?('Status') ? hash['Status'] : SKIP
|
42
42
|
# Parameter is an array, so we need to iterate through it
|
@@ -11,21 +11,21 @@ module ShellDataReportingApIs
|
|
11
11
|
|
12
12
|
# TODO: Write general description for this method
|
13
13
|
# @return [ErrorUserAccessError]
|
14
|
-
attr_accessor :error
|
15
|
-
|
16
|
-
# The constructor.
|
17
|
-
# @param [String] The reason for raising an exception.
|
18
|
-
# @param [HttpResponse] The HttpReponse of the API call.
|
19
|
-
def initialize(reason, response)
|
20
|
-
super(reason, response)
|
21
|
-
hash = APIHelper.json_deserialize(@response.raw_body)
|
22
|
-
unbox(hash)
|
23
|
-
end
|
24
|
-
|
25
|
-
# Populates this object by extracting properties from a hash.
|
26
|
-
# @param [Hash] The deserialized response sent by the server in the
|
27
|
-
# response body.
|
28
|
-
def unbox(hash)
|
14
|
+
attr_accessor :error
|
15
|
+
|
16
|
+
# The constructor.
|
17
|
+
# @param [String] The reason for raising an exception.
|
18
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
19
|
+
def initialize(reason, response)
|
20
|
+
super(reason, response)
|
21
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
22
|
+
unbox(hash)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Populates this object by extracting properties from a hash.
|
26
|
+
# @param [Hash] The deserialized response sent by the server in the
|
27
|
+
# response body.
|
28
|
+
def unbox(hash)
|
29
29
|
@error = ErrorUserAccessError.from_hash(hash['Error']) if hash['Error']
|
30
30
|
end
|
31
31
|
end
|
@@ -24,21 +24,21 @@ module ShellDataReportingApIs
|
|
24
24
|
# about the error, used to provide the client developer with additional
|
25
25
|
# information about the error.
|
26
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)
|
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
42
|
@error = hash.key?('error') ? hash['error'] : nil
|
43
43
|
@error_description =
|
44
44
|
hash.key?('error_description') ? hash['error_description'] : SKIP
|
@@ -15,23 +15,27 @@ module ShellDataReportingApIs
|
|
15
15
|
|
16
16
|
# Initialization constructor.
|
17
17
|
def initialize(bearer_token_credentials, config)
|
18
|
-
auth_params = {}
|
19
18
|
@_o_auth_client_id = bearer_token_credentials.o_auth_client_id unless
|
20
19
|
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_client_id.nil?
|
21
20
|
@_o_auth_client_secret = bearer_token_credentials.o_auth_client_secret unless
|
22
21
|
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_client_secret.nil?
|
23
22
|
@_o_auth_token = bearer_token_credentials.o_auth_token unless
|
24
23
|
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_token.nil?
|
24
|
+
@_o_auth_clock_skew = bearer_token_credentials.o_auth_clock_skew unless
|
25
|
+
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_clock_skew.nil?
|
26
|
+
@_o_auth_token_provider = bearer_token_credentials.o_auth_token_provider unless
|
27
|
+
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_token_provider.nil?
|
28
|
+
@_o_auth_on_token_update = bearer_token_credentials.o_auth_on_token_update unless
|
29
|
+
bearer_token_credentials.nil? || bearer_token_credentials.o_auth_on_token_update.nil?
|
25
30
|
@_o_auth_api = OAuthAuthorizationController.new(config)
|
26
|
-
|
27
|
-
|
28
|
-
super auth_params
|
31
|
+
super({})
|
29
32
|
end
|
30
33
|
|
31
34
|
# Validates the oAuth token.
|
32
35
|
# @return [Boolean] true if the token is present and not expired.
|
33
36
|
def valid
|
34
|
-
|
37
|
+
@_o_auth_token = get_token_from_provider
|
38
|
+
@_o_auth_token.is_a?(OAuthToken) && !token_expired?(@_o_auth_token)
|
35
39
|
end
|
36
40
|
|
37
41
|
# Builds the basic auth header for endpoints in the OAuth Authorization Controller.
|
@@ -58,32 +62,72 @@ module ShellDataReportingApIs
|
|
58
62
|
# @param [OAuthToken] token The oAuth token instance.
|
59
63
|
# @return [Boolean] true if the token's expiry exist and also the token is expired, false otherwise.
|
60
64
|
def token_expired?(token)
|
61
|
-
token.respond_to?('expiry') && AuthHelper.token_expired?(token.expiry)
|
65
|
+
token.respond_to?('expiry') && AuthHelper.token_expired?(token.expiry, @_o_auth_clock_skew)
|
66
|
+
end
|
67
|
+
|
68
|
+
def apply(http_request)
|
69
|
+
auth_params = { 'Authorization' => "Bearer #{@_o_auth_token.access_token}" }
|
70
|
+
AuthHelper.apply(auth_params, http_request.method(:add_header))
|
71
|
+
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
# This provides the OAuth Token from either the user configured callbacks or from default provider.
|
76
|
+
# @return [OAuthToken] The fetched oauth token.
|
77
|
+
def get_token_from_provider
|
78
|
+
return @_o_auth_token if @_o_auth_token && !token_expired?(@_o_auth_token)
|
79
|
+
|
80
|
+
if @_o_auth_token_provider
|
81
|
+
o_auth_token = @_o_auth_token_provider.call(@_o_auth_token, self)
|
82
|
+
@_o_auth_on_token_update&.call(o_auth_token)
|
83
|
+
return o_auth_token
|
84
|
+
end
|
85
|
+
begin
|
86
|
+
o_auth_token = fetch_token
|
87
|
+
@_o_auth_on_token_update&.call(o_auth_token)
|
88
|
+
o_auth_token
|
89
|
+
rescue ApiException
|
90
|
+
@_o_auth_token
|
91
|
+
end
|
62
92
|
end
|
63
93
|
end
|
64
94
|
|
65
95
|
# Data class for BearerTokenCredentials.
|
66
96
|
class BearerTokenCredentials
|
67
|
-
attr_reader :o_auth_client_id, :o_auth_client_secret, :o_auth_token
|
97
|
+
attr_reader :o_auth_client_id, :o_auth_client_secret, :o_auth_token,
|
98
|
+
:o_auth_token_provider, :o_auth_on_token_update,
|
99
|
+
:o_auth_clock_skew
|
68
100
|
|
69
|
-
def initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_token: nil
|
101
|
+
def initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_token: nil,
|
102
|
+
o_auth_token_provider: nil, o_auth_on_token_update: nil,
|
103
|
+
o_auth_clock_skew: nil)
|
70
104
|
raise ArgumentError, 'o_auth_client_id cannot be nil' if o_auth_client_id.nil?
|
71
105
|
raise ArgumentError, 'o_auth_client_secret cannot be nil' if o_auth_client_secret.nil?
|
72
106
|
|
73
107
|
@o_auth_client_id = o_auth_client_id
|
74
108
|
@o_auth_client_secret = o_auth_client_secret
|
75
109
|
@o_auth_token = o_auth_token
|
110
|
+
@o_auth_token_provider = o_auth_token_provider
|
111
|
+
@o_auth_on_token_update = o_auth_on_token_update
|
112
|
+
@o_auth_clock_skew = o_auth_clock_skew
|
76
113
|
end
|
77
114
|
|
78
115
|
def clone_with(o_auth_client_id: nil, o_auth_client_secret: nil,
|
79
|
-
o_auth_token: nil
|
116
|
+
o_auth_token: nil, o_auth_token_provider: nil,
|
117
|
+
o_auth_on_token_update: nil, o_auth_clock_skew: nil)
|
80
118
|
o_auth_client_id ||= self.o_auth_client_id
|
81
119
|
o_auth_client_secret ||= self.o_auth_client_secret
|
82
120
|
o_auth_token ||= self.o_auth_token
|
121
|
+
o_auth_token_provider ||= self.o_auth_token_provider
|
122
|
+
o_auth_on_token_update ||= self.o_auth_on_token_update
|
123
|
+
o_auth_clock_skew ||= self.o_auth_clock_skew
|
83
124
|
|
84
125
|
BearerTokenCredentials.new(o_auth_client_id: o_auth_client_id,
|
85
126
|
o_auth_client_secret: o_auth_client_secret,
|
86
|
-
o_auth_token: o_auth_token
|
127
|
+
o_auth_token: o_auth_token,
|
128
|
+
o_auth_token_provider: o_auth_token_provider,
|
129
|
+
o_auth_on_token_update: o_auth_on_token_update,
|
130
|
+
o_auth_clock_skew: o_auth_clock_skew)
|
87
131
|
end
|
88
132
|
end
|
89
133
|
end
|
@@ -82,14 +82,9 @@ module ShellDataReportingApIs
|
|
82
82
|
]
|
83
83
|
end
|
84
84
|
|
85
|
-
def initialize(colco_id = SKIP,
|
86
|
-
|
87
|
-
|
88
|
-
payer_number = SKIP,
|
89
|
-
payer_name = SKIP,
|
90
|
-
account_id = SKIP,
|
91
|
-
account_number = SKIP,
|
92
|
-
account_name = SKIP)
|
85
|
+
def initialize(colco_id = SKIP, colco_code = SKIP, payer_id = SKIP,
|
86
|
+
payer_number = SKIP, payer_name = SKIP, account_id = SKIP,
|
87
|
+
account_number = SKIP, account_name = SKIP)
|
93
88
|
@colco_id = colco_id unless colco_id == SKIP
|
94
89
|
@colco_code = colco_code unless colco_code == SKIP
|
95
90
|
@payer_id = payer_id unless payer_id == SKIP
|
@@ -13,12 +13,12 @@ module ShellDataReportingApIs
|
|
13
13
|
# Optional if StatusList is passed, else mandatory.
|
14
14
|
# Ignored if StatusList is passed.
|
15
15
|
# Allowed values:
|
16
|
-
# •
|
17
|
-
# •
|
18
|
-
# •
|
19
|
-
# •
|
20
|
-
# •
|
21
|
-
# •
|
16
|
+
# • ALL
|
17
|
+
# • ACTIVE
|
18
|
+
# • BLOCKED
|
19
|
+
# • CANCELLED
|
20
|
+
# • CREDITLOCK
|
21
|
+
# • DELINQUENCYLOCK
|
22
22
|
# @return [String]
|
23
23
|
attr_accessor :status
|
24
24
|
|
@@ -100,11 +100,11 @@ module ShellDataReportingApIs
|
|
100
100
|
# Optional
|
101
101
|
# Multiple statuses are allowed to be included in the search criteria.
|
102
102
|
# Allowed values:
|
103
|
-
# •
|
104
|
-
# •
|
105
|
-
# •
|
106
|
-
# •
|
107
|
-
# •
|
103
|
+
# • ACTIVE
|
104
|
+
# • BLOCKED
|
105
|
+
# • CANCELLED
|
106
|
+
# • CREDITLOCK
|
107
|
+
# • DELINQUENCYLOCK
|
108
108
|
# @return [Array[String]]
|
109
109
|
attr_accessor :status_list
|
110
110
|
|
@@ -167,21 +167,12 @@ module ShellDataReportingApIs
|
|
167
167
|
]
|
168
168
|
end
|
169
169
|
|
170
|
-
def initialize(status = SKIP,
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
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)
|
170
|
+
def initialize(status = SKIP, include_card_summary = true, payer_id = SKIP,
|
171
|
+
payer_number = SKIP, page_size = SKIP, request_id = SKIP,
|
172
|
+
col_co_code = SKIP, col_co_country_code = SKIP,
|
173
|
+
current_page = SKIP, invoice_points_only = false,
|
174
|
+
col_co_id = SKIP, return_tolls_customer_id = SKIP,
|
175
|
+
accounts = SKIP, account_name = SKIP, status_list = SKIP)
|
185
176
|
@status = status unless status == SKIP
|
186
177
|
@include_card_summary = include_card_summary unless include_card_summary == SKIP
|
187
178
|
@payer_id = payer_id unless payer_id == SKIP
|
@@ -64,12 +64,8 @@ module ShellDataReportingApIs
|
|
64
64
|
[]
|
65
65
|
end
|
66
66
|
|
67
|
-
def initialize(accounts = SKIP,
|
68
|
-
|
69
|
-
row_count = SKIP,
|
70
|
-
total_pages = SKIP,
|
71
|
-
error = SKIP,
|
72
|
-
request_id = SKIP)
|
67
|
+
def initialize(accounts = SKIP, current_page = SKIP, row_count = SKIP,
|
68
|
+
total_pages = SKIP, error = SKIP, request_id = SKIP)
|
73
69
|
@accounts = accounts unless accounts == SKIP
|
74
70
|
@current_page = current_page unless current_page == SKIP
|
75
71
|
@row_count = row_count unless row_count == SKIP
|
@@ -32,10 +32,10 @@ module ShellDataReportingApIs
|
|
32
32
|
# Billing/Invoice frequency. The frequency in which the transactions will be
|
33
33
|
# considered for invoicing in a bulling run
|
34
34
|
# E.g.:
|
35
|
-
# 1
|
36
|
-
# 2
|
37
|
-
# 3
|
38
|
-
# 4
|
35
|
+
# 1 Daily (all days)
|
36
|
+
# 2 Daily (only working days)
|
37
|
+
# 3 Weekly - Monday
|
38
|
+
# 4 Weekly – Tuesday
|
39
39
|
# Etc.
|
40
40
|
# @return [String]
|
41
41
|
attr_accessor :billing_frequency_type
|
@@ -46,10 +46,10 @@ module ShellDataReportingApIs
|
|
46
46
|
attr_accessor :billing_frequency_type_id
|
47
47
|
|
48
48
|
# Frequency at which the billing process is triggered. E.g.:
|
49
|
-
# 1
|
50
|
-
# 2
|
51
|
-
# 3
|
52
|
-
# 4
|
49
|
+
# 1 Daily (all days)
|
50
|
+
# 2 Daily (only working days)
|
51
|
+
# 3 Weekly - Monday
|
52
|
+
# 4 Weekly – Tuesday
|
53
53
|
# Etc.
|
54
54
|
# @return [String]
|
55
55
|
attr_accessor :billing_run_frequency
|
@@ -435,60 +435,36 @@ module ShellDataReportingApIs
|
|
435
435
|
]
|
436
436
|
end
|
437
437
|
|
438
|
-
def initialize(account_full_name = SKIP,
|
439
|
-
|
440
|
-
|
441
|
-
account_short_name = SKIP,
|
442
|
-
best_of_indicator = SKIP,
|
443
|
-
billing_frequency_type = SKIP,
|
438
|
+
def initialize(account_full_name = SKIP, account_id = SKIP,
|
439
|
+
account_number = SKIP, account_short_name = SKIP,
|
440
|
+
best_of_indicator = SKIP, billing_frequency_type = SKIP,
|
444
441
|
billing_frequency_type_id = SKIP,
|
445
442
|
billing_run_frequency = SKIP,
|
446
443
|
billing_run_frequency_type_id = SKIP,
|
447
|
-
col_co_country_code = SKIP,
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
day2_run = SKIP,
|
452
|
-
day3_run = SKIP,
|
453
|
-
day4_run = SKIP,
|
454
|
-
frequency_type = SKIP,
|
455
|
-
gross_amount = SKIP,
|
456
|
-
international_pos_language_code = SKIP,
|
444
|
+
col_co_country_code = SKIP, currency_code = SKIP,
|
445
|
+
currency_symbol = SKIP, day1_run = SKIP, day2_run = SKIP,
|
446
|
+
day3_run = SKIP, day4_run = SKIP, frequency_type = SKIP,
|
447
|
+
gross_amount = SKIP, international_pos_language_code = SKIP,
|
457
448
|
international_pos_language_id = SKIP,
|
458
|
-
invoice_account_id = SKIP,
|
459
|
-
invoice_account_number = SKIP,
|
449
|
+
invoice_account_id = SKIP, invoice_account_number = SKIP,
|
460
450
|
invoice_account_short_name = SKIP,
|
461
|
-
invoice_distribution_methods = SKIP,
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
paid_amount = SKIP,
|
472
|
-
status = SKIP,
|
473
|
-
status_reason = SKIP,
|
474
|
-
total_active_card_groups = SKIP,
|
475
|
-
total_active_cards = SKIP,
|
476
|
-
total_blocked_cards = SKIP,
|
477
|
-
total_cancelled_cards = SKIP,
|
478
|
-
total_cards = SKIP,
|
479
|
-
total_expired_cards = SKIP,
|
480
|
-
total_fraud_cards = SKIP,
|
481
|
-
total_new_cards = SKIP,
|
451
|
+
invoice_distribution_methods = SKIP, is_international = SKIP,
|
452
|
+
is_invoice_point = SKIP, last_modified_date = SKIP,
|
453
|
+
local_currency_code = SKIP, local_currency_symbol = SKIP,
|
454
|
+
local_pos_language_code = SKIP, local_pos_language_id = SKIP,
|
455
|
+
net_amount = SKIP, outstanding_balance = SKIP,
|
456
|
+
paid_amount = SKIP, status = SKIP, status_reason = SKIP,
|
457
|
+
total_active_card_groups = SKIP, total_active_cards = SKIP,
|
458
|
+
total_blocked_cards = SKIP, total_cancelled_cards = SKIP,
|
459
|
+
total_cards = SKIP, total_expired_cards = SKIP,
|
460
|
+
total_fraud_cards = SKIP, total_new_cards = SKIP,
|
482
461
|
total_renewal_pending_cards = SKIP,
|
483
462
|
total_replaced_cards = SKIP,
|
484
463
|
total_temporary_block_cards_by_customer = SKIP,
|
485
464
|
total_temporary_block_cards_by_shell = SKIP,
|
486
|
-
vat_amount = SKIP,
|
487
|
-
|
488
|
-
|
489
|
-
tolls_colco_country_type_id = SKIP,
|
490
|
-
contracts = SKIP,
|
491
|
-
is_consortium_member = SKIP)
|
465
|
+
vat_amount = SKIP, is_partner_card = SKIP,
|
466
|
+
tolls_customer_id = SKIP, tolls_colco_country_type_id = SKIP,
|
467
|
+
contracts = SKIP, is_consortium_member = SKIP)
|
492
468
|
@account_full_name = account_full_name unless account_full_name == SKIP
|
493
469
|
@account_id = account_id unless account_id == SKIP
|
494
470
|
@account_number = account_number unless account_number == SKIP
|
@@ -43,8 +43,7 @@ module ShellDataReportingApIs
|
|
43
43
|
]
|
44
44
|
end
|
45
45
|
|
46
|
-
def initialize(account_id = SKIP,
|
47
|
-
account_number = SKIP)
|
46
|
+
def initialize(account_id = SKIP, account_number = SKIP)
|
48
47
|
@account_id = account_id unless account_id == SKIP
|
49
48
|
@account_number = account_number unless account_number == SKIP
|
50
49
|
end
|
@@ -111,17 +111,10 @@ module ShellDataReportingApIs
|
|
111
111
|
]
|
112
112
|
end
|
113
113
|
|
114
|
-
def initialize(address_id = SKIP,
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
zip_code = SKIP,
|
119
|
-
city = SKIP,
|
120
|
-
region_id = SKIP,
|
121
|
-
country_iso_code = SKIP,
|
122
|
-
country = SKIP,
|
123
|
-
telephone = SKIP,
|
124
|
-
email_address = SKIP,
|
114
|
+
def initialize(address_id = SKIP, address_line1 = SKIP,
|
115
|
+
address_line2 = SKIP, address_line3 = SKIP, zip_code = SKIP,
|
116
|
+
city = SKIP, region_id = SKIP, country_iso_code = SKIP,
|
117
|
+
country = SKIP, telephone = SKIP, email_address = SKIP,
|
125
118
|
fax = SKIP)
|
126
119
|
@address_id = address_id unless address_id == SKIP
|
127
120
|
@address_line1 = address_line1 unless address_line1 == SKIP
|
@@ -10,14 +10,14 @@ module ShellDataReportingApIs
|
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
12
|
# Status of requests to be fetched.
|
13
|
-
# •
|
14
|
-
# •
|
15
|
-
# •
|
16
|
-
# •
|
17
|
-
# •
|
18
|
-
# •
|
19
|
-
# •
|
20
|
-
# •
|
13
|
+
# • Success
|
14
|
+
# • Failed
|
15
|
+
# • InProgress
|
16
|
+
# • Submitted
|
17
|
+
# • Rejected
|
18
|
+
# • PendingApproval
|
19
|
+
# • All
|
20
|
+
# • MailedToCSC
|
21
21
|
# Optional
|
22
22
|
# If not passed “All” will be considered as the default value.
|
23
23
|
# @return [String]
|
@@ -83,10 +83,10 @@ module ShellDataReportingApIs
|
|
83
83
|
attr_accessor :requested_operation
|
84
84
|
|
85
85
|
# Allowed Sorting Options:
|
86
|
-
# 1.
|
87
|
-
# 2.
|
88
|
-
# 3.
|
89
|
-
# 4.
|
86
|
+
# 1. SubmittedDateDescending
|
87
|
+
# 2. SubmittedDateAscending
|
88
|
+
# 3. AccountNumberAscending
|
89
|
+
# 4. AccountNumberDescending
|
90
90
|
# Optional: Default value is 1
|
91
91
|
# Example value to be passed: 1,3
|
92
92
|
# @return [String]
|
@@ -185,19 +185,11 @@ module ShellDataReportingApIs
|
|
185
185
|
]
|
186
186
|
end
|
187
187
|
|
188
|
-
def initialize(status = SKIP,
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
col_co_id = SKIP,
|
194
|
-
accounts = SKIP,
|
195
|
-
page_size = SKIP,
|
196
|
-
requested_operation = SKIP,
|
197
|
-
sort_order = SKIP,
|
198
|
-
search_text = SKIP,
|
199
|
-
current_page = SKIP,
|
200
|
-
from_date = SKIP,
|
188
|
+
def initialize(status = SKIP, payer_number = SKIP, payer_id = SKIP,
|
189
|
+
account_number = SKIP, col_co_code = SKIP, col_co_id = SKIP,
|
190
|
+
accounts = SKIP, page_size = SKIP,
|
191
|
+
requested_operation = SKIP, sort_order = SKIP,
|
192
|
+
search_text = SKIP, current_page = SKIP, from_date = SKIP,
|
201
193
|
to_date = SKIP)
|
202
194
|
@status = status unless status == SKIP
|
203
195
|
@payer_number = payer_number unless payer_number == SKIP
|
@@ -64,12 +64,8 @@ module ShellDataReportingApIs
|
|
64
64
|
[]
|
65
65
|
end
|
66
66
|
|
67
|
-
def initialize(audits = SKIP,
|
68
|
-
|
69
|
-
row_count = SKIP,
|
70
|
-
total_pages = SKIP,
|
71
|
-
error = SKIP,
|
72
|
-
request_id = SKIP)
|
67
|
+
def initialize(audits = SKIP, current_page = SKIP, row_count = SKIP,
|
68
|
+
total_pages = SKIP, error = SKIP, request_id = SKIP)
|
73
69
|
@audits = audits unless audits == SKIP
|
74
70
|
@current_page = current_page unless current_page == SKIP
|
75
71
|
@row_count = row_count unless row_count == SKIP
|