digital-payments-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 +85 -0
- data/lib/shell_ev/api_helper.rb +10 -0
- data/lib/shell_ev/client.rb +86 -0
- data/lib/shell_ev/configuration.rb +104 -0
- data/lib/shell_ev/controllers/base_controller.rb +66 -0
- data/lib/shell_ev/controllers/digital_payment_enablement_controller.rb +56 -0
- data/lib/shell_ev/controllers/fueling_controller.rb +126 -0
- data/lib/shell_ev/controllers/partner_notification_controller.rb +95 -0
- data/lib/shell_ev/controllers/shell_api_platform_security_authentication_controller.rb +44 -0
- data/lib/shell_ev/controllers/station_locator_controller.rb +76 -0
- data/lib/shell_ev/exceptions/access_token_error_exception.rb +37 -0
- data/lib/shell_ev/exceptions/api_exception.rb +10 -0
- data/lib/shell_ev/exceptions/cancel_fueling_error_response_error_exception.rb +64 -0
- data/lib/shell_ev/exceptions/mpp_acces_token_error_response_exception.rb +44 -0
- data/lib/shell_ev/exceptions/payment_enablement_error_response_exception.rb +37 -0
- data/lib/shell_ev/exceptions/station_locator_bad_request_exception.rb +38 -0
- data/lib/shell_ev/exceptions/station_locator_forbidden_exception.rb +38 -0
- data/lib/shell_ev/exceptions/station_locator_internal_server_error_exception.rb +38 -0
- data/lib/shell_ev/exceptions/station_locator_not_found_exception.rb +38 -0
- data/lib/shell_ev/exceptions/station_locator_unauthorized_exception.rb +38 -0
- data/lib/shell_ev/http/auth/mpp_token.rb +42 -0
- data/lib/shell_ev/http/auth/o_auth_token_post.rb +44 -0
- data/lib/shell_ev/http/http_call_back.rb +10 -0
- data/lib/shell_ev/http/http_method_enum.rb +10 -0
- data/lib/shell_ev/http/http_request.rb +10 -0
- data/lib/shell_ev/http/http_response.rb +10 -0
- data/lib/shell_ev/models/access_token_response.rb +71 -0
- data/lib/shell_ev/models/around_location_array.rb +109 -0
- data/lib/shell_ev/models/around_location_array_data_items.rb +242 -0
- data/lib/shell_ev/models/around_location_array_data_items_loc.rb +99 -0
- data/lib/shell_ev/models/around_location_array_data_items_opening_hours_items.rb +148 -0
- data/lib/shell_ev/models/base_model.rb +62 -0
- data/lib/shell_ev/models/cancel_fueling_error_response.rb +92 -0
- data/lib/shell_ev/models/cancel_fueling_request.rb +61 -0
- data/lib/shell_ev/models/collecting_company.rb +50 -0
- data/lib/shell_ev/models/fault_response.rb +50 -0
- data/lib/shell_ev/models/fault_response_fault.rb +60 -0
- data/lib/shell_ev/models/fault_response_fault_detail.rb +50 -0
- data/lib/shell_ev/models/finalise_fueling_request.rb +181 -0
- data/lib/shell_ev/models/finalise_fueling_request_payment.rb +71 -0
- data/lib/shell_ev/models/finalise_fueling_request_products_items.rb +70 -0
- data/lib/shell_ev/models/loyalty_details.rb +59 -0
- data/lib/shell_ev/models/mobile_payment_registration_request.rb +134 -0
- data/lib/shell_ev/models/mpp_acces_token_response.rb +81 -0
- data/lib/shell_ev/models/mpp_error.rb +94 -0
- data/lib/shell_ev/models/mpp_token_request_body.rb +73 -0
- data/lib/shell_ev/models/oauth_token_post_request_body.rb +73 -0
- data/lib/shell_ev/models/partner_token_request_body.rb +73 -0
- data/lib/shell_ev/models/payment_details_items.rb +78 -0
- data/lib/shell_ev/models/payment_enablement_response.rb +48 -0
- data/lib/shell_ev/models/payment_properties.rb +169 -0
- data/lib/shell_ev/models/prepare_fueling_request.rb +183 -0
- data/lib/shell_ev/models/prepare_fueling_request_device_details_items.rb +95 -0
- data/lib/shell_ev/models/prepare_fueling_response.rb +66 -0
- data/lib/shell_ev/utilities/date_time_helper.rb +11 -0
- data/lib/shell_ev/utilities/file_wrapper.rb +16 -0
- data/lib/shell_ev.rb +85 -0
- data/test/controllers/controller_test_base.rb +29 -0
- data/test/controllers/test_fueling_controller.rb +61 -0
- data/test/controllers/test_partner_notification_controller.rb +60 -0
- data/test/controllers/test_shell_api_platform_security_authentication_controller.rb +36 -0
- data/test/controllers/test_station_locator_controller.rb +44 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +185 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# ShellAPIPlatformSecurityAuthenticationController
|
8
|
+
class ShellAPIPlatformSecurityAuthenticationController < BaseController
|
9
|
+
# To obtain APIGEE access token
|
10
|
+
# @param [String] grant_type Required parameter: In OAuth 2.0, the term
|
11
|
+
# grant typee refers to the way an application gets an access token. OAuth
|
12
|
+
# 2.0 defines several grant types, including the authorization code flow.
|
13
|
+
# @param [String] client_id Required parameter: After registering your app,
|
14
|
+
# you will receive a client ID and a client secret. The client ID is
|
15
|
+
# considered public information, and is used to build login URLs, or
|
16
|
+
# included in Javascript source code on a page.
|
17
|
+
# @param [String] client_secret Required parameter: After registering your
|
18
|
+
# app, you will receive a client ID and a client secret. The client ID is
|
19
|
+
# considered public information, and is used to build login URLs, or
|
20
|
+
# included in Javascript source code on a page. The client secret must be
|
21
|
+
# kept confidential.
|
22
|
+
# @return [AccessTokenResponse] response from the API call
|
23
|
+
def oauth_token_post(grant_type,
|
24
|
+
client_id,
|
25
|
+
client_secret)
|
26
|
+
new_api_call_builder
|
27
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
28
|
+
'/oauth/token',
|
29
|
+
Server::DEFAULT)
|
30
|
+
.form_param(new_parameter(grant_type, key: 'grant_type'))
|
31
|
+
.form_param(new_parameter(client_id, key: 'client_id'))
|
32
|
+
.form_param(new_parameter(client_secret, key: 'client_secret'))
|
33
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
34
|
+
.header_param(new_parameter('application/json', key: 'accept')))
|
35
|
+
.response(new_response_handler
|
36
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
37
|
+
.deserialize_into(AccessTokenResponse.method(:from_hash))
|
38
|
+
.local_error('401',
|
39
|
+
'Unauthorized',
|
40
|
+
AccessTokenErrorException))
|
41
|
+
.execute
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# StationLocatorController
|
8
|
+
class StationLocatorController < BaseController
|
9
|
+
# Returns all sites within specified radius of specified GPS location. Sites
|
10
|
+
# of all Types are returned. This call must be used when attempting to
|
11
|
+
# establish the station the user is located at as part of fuelling journey
|
12
|
+
# (i.e. user has to be within 300m of station to be considered located at
|
13
|
+
# the station). This API could also be used as a general query to find
|
14
|
+
# nearby Shell locations
|
15
|
+
# @param [String] m Required parameter: API Method to be executed
|
16
|
+
# @param [Float] lon Required parameter: The user’s current longitude
|
17
|
+
# @param [Float] lat Required parameter: The user’s current latitude
|
18
|
+
# @param [Float] radius Required parameter: The search radius in
|
19
|
+
# kilometers
|
20
|
+
# @param [String] offer_code Optional parameter: This enables requestor to
|
21
|
+
# specify locations that will honour the specified (advanced) offer code
|
22
|
+
# @param [Integer] n Optional parameter: This enables requestor to limit the
|
23
|
+
# number of locations that are returned and defaulted to a maximum of 250
|
24
|
+
# locations. Locations returned based on distance to User’s location
|
25
|
+
# as-the-crow-flies.
|
26
|
+
# @param [Array[String]] amenities Optional parameter: This enables
|
27
|
+
# requestor to filter locations based on one or more amenities (e.g. Filter
|
28
|
+
# locations so that only those with a Toilet are returned).
|
29
|
+
# @param [Array[String]] countries Optional parameter: This enables
|
30
|
+
# requestor to filter locations based on one or more Countries (i.e. by
|
31
|
+
# country codes).
|
32
|
+
# @return [AroundLocationArray] response from the API call
|
33
|
+
def stationlocator_v1_stations_get_around_location(m,
|
34
|
+
lon,
|
35
|
+
lat,
|
36
|
+
radius,
|
37
|
+
offer_code: nil,
|
38
|
+
n: nil,
|
39
|
+
amenities: nil,
|
40
|
+
countries: nil)
|
41
|
+
new_api_call_builder
|
42
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
43
|
+
'/SiteData/v1/stations/',
|
44
|
+
Server::DEFAULT)
|
45
|
+
.query_param(new_parameter(m, key: 'm'))
|
46
|
+
.query_param(new_parameter(lon, key: 'lon'))
|
47
|
+
.query_param(new_parameter(lat, key: 'lat'))
|
48
|
+
.query_param(new_parameter(radius, key: 'radius'))
|
49
|
+
.query_param(new_parameter(offer_code, key: 'offer_code'))
|
50
|
+
.query_param(new_parameter(n, key: 'n'))
|
51
|
+
.query_param(new_parameter(amenities, key: 'amenities'))
|
52
|
+
.query_param(new_parameter(countries, key: 'countries'))
|
53
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
54
|
+
.auth(Single.new('oAuthTokenPost')))
|
55
|
+
.response(new_response_handler
|
56
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
57
|
+
.deserialize_into(AroundLocationArray.method(:from_hash))
|
58
|
+
.local_error('400',
|
59
|
+
'Bad request',
|
60
|
+
StationLocatorBadRequestException)
|
61
|
+
.local_error('401',
|
62
|
+
'Unauthorized',
|
63
|
+
StationLocatorUnauthorizedException)
|
64
|
+
.local_error('403',
|
65
|
+
'Forbbiden',
|
66
|
+
StationLocatorForbiddenException)
|
67
|
+
.local_error('404',
|
68
|
+
'Not Found',
|
69
|
+
StationLocatorNotFoundException)
|
70
|
+
.local_error('500',
|
71
|
+
'Internal Server Error',
|
72
|
+
StationLocatorInternalServerErrorException))
|
73
|
+
.execute
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# AccessTokenError class.
|
8
|
+
class AccessTokenErrorException < 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_code
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :error
|
19
|
+
|
20
|
+
# The constructor.
|
21
|
+
# @param [String] The reason for raising an exception.
|
22
|
+
# @param [HttpResponse] 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] The deserialized response sent by the server in the
|
31
|
+
# response body.
|
32
|
+
def unbox(hash)
|
33
|
+
@error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP
|
34
|
+
@error = hash.key?('error') ? hash['error'] : SKIP
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Class for exceptions when there is a network error, status code error, etc.
|
8
|
+
class APIException < CoreLibrary::ApiException
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# # Digital Payments – Errors This section details the structure of the
|
8
|
+
# response Body vs. the different types of errors that could be returned when
|
9
|
+
# Digital Payments system responds with a 400 Response Code. | Error Code
|
10
|
+
# | Error Description | Suggested message to end user | |- |- |- | |
|
11
|
+
# 9342 | Transaction not cancelled, Txn number unknown | Oops sorry! We
|
12
|
+
# are unable to cancel the transaction. Please wait for the site to cancel the
|
13
|
+
# transaction before you retry | | 50004 | Transaction not cancelled,
|
14
|
+
# dispensing is already in progress | Transaction cannot be cancelled,
|
15
|
+
# fueling already in progress | | 50059 | Transaction not cancelable (not
|
16
|
+
# in a 'Processing state') | Transaction cannot be cancelled, fuel has
|
17
|
+
# already been dispensed |
|
18
|
+
class CancelFuelingErrorResponseErrorException < APIException
|
19
|
+
SKIP = Object.new
|
20
|
+
private_constant :SKIP
|
21
|
+
|
22
|
+
# The high level error code (e.g. missing data)
|
23
|
+
# @return [String]
|
24
|
+
attr_accessor :error_code
|
25
|
+
|
26
|
+
# The high level error message (e.g. mandatory fields have not been
|
27
|
+
# specified.
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :error_description
|
30
|
+
|
31
|
+
# Array of error objects. Majority of the time the errorCode and
|
32
|
+
# errorDescription will suffice
|
33
|
+
# @return [Array[MppError]]
|
34
|
+
attr_accessor :errors
|
35
|
+
|
36
|
+
# The constructor.
|
37
|
+
# @param [String] The reason for raising an exception.
|
38
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
39
|
+
def initialize(reason, response)
|
40
|
+
super(reason, response)
|
41
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
42
|
+
unbox(hash)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Populates this object by extracting properties from a hash.
|
46
|
+
# @param [Hash] The deserialized response sent by the server in the
|
47
|
+
# response body.
|
48
|
+
def unbox(hash)
|
49
|
+
@error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP
|
50
|
+
@error_description =
|
51
|
+
hash.key?('errorDescription') ? hash['errorDescription'] : SKIP
|
52
|
+
# Parameter is an array, so we need to iterate through it
|
53
|
+
@errors = nil
|
54
|
+
unless hash['errors'].nil?
|
55
|
+
@errors = []
|
56
|
+
hash['errors'].each do |structure|
|
57
|
+
@errors << (MppError.from_hash(structure) if structure)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
@errors = SKIP unless hash.key?('errors')
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# MppAccesTokenErrorResponse class.
|
8
|
+
class MppAccesTokenErrorResponseException < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# error code or short description
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :error
|
15
|
+
|
16
|
+
# error code or short description due to invalid request or invalid client
|
17
|
+
# ID
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :error_code
|
20
|
+
|
21
|
+
# Description of the error
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :error_description
|
24
|
+
|
25
|
+
# The constructor.
|
26
|
+
# @param [String] The reason for raising an exception.
|
27
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
28
|
+
def initialize(reason, response)
|
29
|
+
super(reason, response)
|
30
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
31
|
+
unbox(hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Populates this object by extracting properties from a hash.
|
35
|
+
# @param [Hash] The deserialized response sent by the server in the
|
36
|
+
# response body.
|
37
|
+
def unbox(hash)
|
38
|
+
@error = hash.key?('error') ? hash['error'] : nil
|
39
|
+
@error_code = hash.key?('error_code') ? hash['error_code'] : nil
|
40
|
+
@error_description =
|
41
|
+
hash.key?('error_description') ? hash['error_description'] : SKIP
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# PaymentEnablementErrorResponse class.
|
8
|
+
class PaymentEnablementErrorResponseException < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [Integer]
|
14
|
+
attr_accessor :code
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :message
|
19
|
+
|
20
|
+
# The constructor.
|
21
|
+
# @param [String] The reason for raising an exception.
|
22
|
+
# @param [HttpResponse] 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] The deserialized response sent by the server in the
|
31
|
+
# response body.
|
32
|
+
def unbox(hash)
|
33
|
+
@code = hash.key?('code') ? hash['code'] : SKIP
|
34
|
+
@message = hash.key?('message') ? hash['message'] : SKIP
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# StationLocatorBadRequest class.
|
8
|
+
class StationLocatorBadRequestException < 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_code
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :error_description
|
19
|
+
|
20
|
+
# The constructor.
|
21
|
+
# @param [String] The reason for raising an exception.
|
22
|
+
# @param [HttpResponse] 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] The deserialized response sent by the server in the
|
31
|
+
# response body.
|
32
|
+
def unbox(hash)
|
33
|
+
@error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP
|
34
|
+
@error_description =
|
35
|
+
hash.key?('errorDescription') ? hash['errorDescription'] : SKIP
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# StationLocatorForbidden class.
|
8
|
+
class StationLocatorForbiddenException < 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_code
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :error_description
|
19
|
+
|
20
|
+
# The constructor.
|
21
|
+
# @param [String] The reason for raising an exception.
|
22
|
+
# @param [HttpResponse] 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] The deserialized response sent by the server in the
|
31
|
+
# response body.
|
32
|
+
def unbox(hash)
|
33
|
+
@error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP
|
34
|
+
@error_description =
|
35
|
+
hash.key?('errorDescription') ? hash['errorDescription'] : SKIP
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# StationLocatorInternalServerError class.
|
8
|
+
class StationLocatorInternalServerErrorException < 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_code
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :error_description
|
19
|
+
|
20
|
+
# The constructor.
|
21
|
+
# @param [String] The reason for raising an exception.
|
22
|
+
# @param [HttpResponse] 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] The deserialized response sent by the server in the
|
31
|
+
# response body.
|
32
|
+
def unbox(hash)
|
33
|
+
@error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP
|
34
|
+
@error_description =
|
35
|
+
hash.key?('errorDescription') ? hash['errorDescription'] : SKIP
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# StationLocatorNotFound class.
|
8
|
+
class StationLocatorNotFoundException < 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_code
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :error_description
|
19
|
+
|
20
|
+
# The constructor.
|
21
|
+
# @param [String] The reason for raising an exception.
|
22
|
+
# @param [HttpResponse] 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] The deserialized response sent by the server in the
|
31
|
+
# response body.
|
32
|
+
def unbox(hash)
|
33
|
+
@error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP
|
34
|
+
@error_description =
|
35
|
+
hash.key?('errorDescription') ? hash['errorDescription'] : SKIP
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# StationLocatorUnauthorized class.
|
8
|
+
class StationLocatorUnauthorizedException < 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_code
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :error_description
|
19
|
+
|
20
|
+
# The constructor.
|
21
|
+
# @param [String] The reason for raising an exception.
|
22
|
+
# @param [HttpResponse] 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] The deserialized response sent by the server in the
|
31
|
+
# response body.
|
32
|
+
def unbox(hash)
|
33
|
+
@error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP
|
34
|
+
@error_description =
|
35
|
+
hash.key?('errorDescription') ? hash['errorDescription'] : SKIP
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Utility class for custom header authorization.
|
8
|
+
class MppToken < CoreLibrary::HeaderAuth
|
9
|
+
# Display error message on occurrence of authentication failure.
|
10
|
+
# @returns [String] The oAuth error message.
|
11
|
+
def error_message
|
12
|
+
'MppToken: authorization is undefined.'
|
13
|
+
end
|
14
|
+
|
15
|
+
# Initialization constructor.
|
16
|
+
def initialize(mpp_token_credentials)
|
17
|
+
auth_params = {}
|
18
|
+
auth_params['Authorization'] = mpp_token_credentials.authorization unless
|
19
|
+
mpp_token_credentials.nil? || mpp_token_credentials.authorization.nil?
|
20
|
+
|
21
|
+
super auth_params
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Data class for MppTokenCredentials.
|
26
|
+
# Data class for MppTokenCredentials.
|
27
|
+
class MppTokenCredentials
|
28
|
+
attr_reader :authorization
|
29
|
+
|
30
|
+
def initialize(authorization:)
|
31
|
+
raise ArgumentError, 'authorization cannot be nil' if authorization.nil?
|
32
|
+
|
33
|
+
@authorization = authorization
|
34
|
+
end
|
35
|
+
|
36
|
+
def clone_with(authorization: nil)
|
37
|
+
authorization ||= self.authorization
|
38
|
+
|
39
|
+
MppTokenCredentials.new(authorization: authorization)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Utility class for custom header authorization.
|
8
|
+
class OAuthTokenPost < CoreLibrary::HeaderAuth
|
9
|
+
# Display error message on occurrence of authentication failure.
|
10
|
+
# @returns [String] The oAuth error message.
|
11
|
+
def error_message
|
12
|
+
'OAuthTokenPost: x_apigee_authorization is undefined.'
|
13
|
+
end
|
14
|
+
|
15
|
+
# Initialization constructor.
|
16
|
+
def initialize(o_auth_token_post_credentials)
|
17
|
+
auth_params = {}
|
18
|
+
auth_params['X-Apigee-Authorization'] = o_auth_token_post_credentials.x_apigee_authorization unless
|
19
|
+
o_auth_token_post_credentials.nil? || o_auth_token_post_credentials.x_apigee_authorization.nil?
|
20
|
+
|
21
|
+
super auth_params
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Data class for OAuthTokenPostCredentials.
|
26
|
+
# Data class for OAuthTokenPostCredentials.
|
27
|
+
class OAuthTokenPostCredentials
|
28
|
+
attr_reader :x_apigee_authorization
|
29
|
+
|
30
|
+
def initialize(x_apigee_authorization:)
|
31
|
+
raise ArgumentError, 'x_apigee_authorization cannot be nil' if x_apigee_authorization.nil?
|
32
|
+
|
33
|
+
@x_apigee_authorization = x_apigee_authorization
|
34
|
+
end
|
35
|
+
|
36
|
+
def clone_with(x_apigee_authorization: nil)
|
37
|
+
x_apigee_authorization ||= self.x_apigee_authorization
|
38
|
+
|
39
|
+
OAuthTokenPostCredentials.new(
|
40
|
+
x_apigee_authorization: x_apigee_authorization
|
41
|
+
)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|