ev-recharge-sdk 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +38 -21
- data/lib/shell_ev/client.rb +12 -8
- data/lib/shell_ev/configuration.rb +70 -19
- data/lib/shell_ev/controllers/base_controller.rb +9 -9
- data/lib/shell_ev/controllers/charging_controller.rb +121 -154
- data/lib/shell_ev/controllers/locations_controller.rb +226 -142
- data/lib/shell_ev/controllers/o_auth_authorization_controller.rb +8 -8
- data/lib/shell_ev/exceptions/bad_request_exception.rb +33 -18
- data/lib/shell_ev/exceptions/{m405_error_response_error1_exception.rb → internal_server_error_exception.rb} +31 -26
- data/lib/shell_ev/exceptions/not_found_exception.rb +36 -19
- data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +15 -15
- data/lib/shell_ev/exceptions/{m400_error_response_error1_exception.rb → serviceunavailable_exception.rb} +28 -28
- data/lib/shell_ev/exceptions/{m401_error_response_error1_exception.rb → too_many_requests_exception.rb} +28 -28
- data/lib/shell_ev/exceptions/unauthorized_exception.rb +32 -18
- data/lib/shell_ev/http/auth/o_auth2.rb +54 -10
- data/lib/shell_ev/models/accessibility.rb +1 -2
- data/lib/shell_ev/models/active_response200_json.rb +11 -13
- data/lib/shell_ev/models/address.rb +1 -3
- data/lib/shell_ev/models/bad_request_err_msg.rb +82 -0
- data/lib/shell_ev/models/{stop_charge_session_request_body_json.rb → charge_error.rb} +21 -10
- data/lib/shell_ev/models/charge_retrieve_state.rb +63 -0
- data/lib/shell_ev/models/chargesession_start_body.rb +7 -9
- data/lib/shell_ev/models/connector_vo.rb +4 -9
- data/lib/shell_ev/models/coordinates.rb +1 -2
- data/lib/shell_ev/models/data_active.rb +27 -45
- data/lib/shell_ev/models/data_retrieve.rb +31 -49
- data/lib/shell_ev/models/electrical_properties.rb +1 -3
- data/lib/shell_ev/models/evse_vo.rb +3 -8
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json.rb +11 -13
- data/lib/shell_ev/models/{get_markers_list_authorization_methods_enum.rb → get_ev_locations_authorization_methods_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_markers_list_connector_types_enum.rb → get_ev_locations_connector_types_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_markers_list_evse_status_enum.rb → get_ev_locations_evse_status_enum.rb} +4 -4
- data/lib/shell_ev/models/inline_response202.rb +9 -11
- data/lib/shell_ev/models/inline_response2021.rb +5 -6
- data/lib/shell_ev/models/inline_response202_data.rb +7 -5
- data/lib/shell_ev/models/internal_error_object.rb +70 -0
- data/lib/shell_ev/models/location_respone_object.rb +4 -11
- data/lib/shell_ev/models/{get_locations_list_authorization_methods_enum.rb → locations_markers_authorization_methods_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_locations_list_connector_types_enum.rb → locations_markers_connector_types_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_locations_list_evse_status_enum.rb → locations_markers_evse_status_enum.rb} +4 -4
- data/lib/shell_ev/models/multi_location_marker.rb +2 -6
- data/lib/shell_ev/models/{get_nearby_locations_authorization_methods_enum.rb → nearby_locations_authorization_methods_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_nearby_locations_connector_types_enum.rb → nearby_locations_connector_types_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_nearby_locations_evse_status_enum.rb → nearby_locations_evse_status_enum.rb} +4 -4
- data/lib/shell_ev/models/not_found_err_msg.rb +82 -0
- data/lib/shell_ev/models/o_auth_token.rb +2 -6
- data/lib/shell_ev/models/opening_hours_object.rb +1 -3
- data/lib/shell_ev/models/ratelimit_err_msg.rb +82 -0
- data/lib/shell_ev/models/response.rb +78 -0
- data/lib/shell_ev/models/serviceunavailable_err_msg.rb +82 -0
- data/lib/shell_ev/models/single_location_marker.rb +5 -11
- data/lib/shell_ev/models/single_location_marker_authorization_methods_items_enum.rb +1 -1
- data/lib/shell_ev/models/single_location_marker_response.rb +81 -0
- data/lib/shell_ev/models/tariff_vo.rb +3 -7
- data/lib/shell_ev/models/unauthorized_err_msg.rb +82 -0
- data/lib/shell_ev/utilities/file_wrapper.rb +9 -9
- data/lib/shell_ev/utilities/union_type_lookup.rb +3 -2
- data/lib/shell_ev.rb +40 -60
- data/test/controllers/controller_test_base.rb +0 -5
- data/test/controllers/test_charging_controller.rb +74 -17
- data/test/controllers/test_locations_controller.rb +65 -0
- metadata +31 -49
- data/lib/shell_ev/exceptions/http401_error_response_exception.rb +0 -52
- data/lib/shell_ev/exceptions/m404_error_response_error1_exception.rb +0 -53
- data/lib/shell_ev/exceptions/m429_error_response_error1_exception.rb +0 -52
- data/lib/shell_ev/exceptions/m500_error_response_error1_exception.rb +0 -52
- data/lib/shell_ev/exceptions/m503_error_response_error1_exception.rb +0 -52
- data/lib/shell_ev/models/data_active_session_code_enum.rb +0 -44
- data/lib/shell_ev/models/data_active_session_state_enum.rb +0 -35
- data/lib/shell_ev/models/data_retrieve_session_code_enum.rb +0 -44
- data/lib/shell_ev/models/data_retrieve_session_state_enum.rb +0 -35
- data/lib/shell_ev/models/env_enum.rb +0 -23
- data/lib/shell_ev/models/m400_error_response.rb +0 -78
- data/lib/shell_ev/models/m400_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m401_error_response.rb +0 -78
- data/lib/shell_ev/models/m401_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m404_error_response.rb +0 -79
- data/lib/shell_ev/models/m404_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m405_error_response.rb +0 -78
- data/lib/shell_ev/models/m405_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m429_error_response.rb +0 -78
- data/lib/shell_ev/models/m429_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m500_error_response.rb +0 -78
- data/lib/shell_ev/models/m500_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m503_error_response.rb +0 -78
- data/lib/shell_ev/models/m503_error_response_error.rb +0 -80
- data/lib/shell_ev/models/response_base_status_enum.rb +0 -26
- data/lib/shell_ev/models/response_error401_all_of1.rb +0 -57
- data/lib/shell_ev/models/response_error401_all_of1_errors_items.rb +0 -80
- data/lib/shell_ev/models/success_response.rb +0 -58
@@ -8,7 +8,7 @@ module ShellEv
|
|
8
8
|
class LocationsController < BaseController
|
9
9
|
# This API provides the list of all Shell Recharge locations. The list
|
10
10
|
# includes all Shell Recharge network and all locations available through
|
11
|
-
# our roaming partners.The end point provides flexible search criteria in
|
11
|
+
# our roaming partners. The end point provides flexible search criteria in
|
12
12
|
# order to get the list of Shell Recharge Network. The end point provides
|
13
13
|
# the details such as the exact location/address of the site along with the
|
14
14
|
# up-to-date status information of all the charging units in the site.
|
@@ -17,17 +17,21 @@ module ShellEv
|
|
17
17
|
# * Based on available connector types.
|
18
18
|
# * Based on minimum Power output (in kW) available
|
19
19
|
# * Based on a specific charging unit ID (EVSE ID)
|
20
|
-
# @param [String] request_id Required parameter:
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
20
|
+
# @param [UUID | String] request_id Required parameter: RequestId must be
|
21
|
+
# unique identifier value that can be used by the consumer to correlate each
|
22
|
+
# request /response .<br>Format.<br> Its canonical textual representation,
|
23
|
+
# the 16 octets of a UUID are represented as 32 hexadecimal (base-16)
|
24
|
+
# digits, displayed in five groups separated by hyphens, in the form
|
25
|
+
# 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
|
26
|
+
# hyphens) <br>
|
27
|
+
# @param [GetEVLocationsEvseStatusEnum] evse_status Optional parameter:
|
24
28
|
# Filter by Locations that have the given status
|
25
|
-
# @param [
|
29
|
+
# @param [GetEVLocationsConnectorTypesEnum] connector_types Optional
|
26
30
|
# parameter: Filter by Locations that have Connectors with the set of
|
27
31
|
# Connector Types
|
28
32
|
# @param [Float] connector_min_power Optional parameter: Filter by Locations
|
29
33
|
# that have a Connector with at least this power output (in kW)
|
30
|
-
# @param [
|
34
|
+
# @param [GetEVLocationsAuthorizationMethodsEnum] authorization_methods
|
31
35
|
# Optional parameter: Filter by Locations that support the given
|
32
36
|
# Authorization Methods
|
33
37
|
# @param [TrueClass | FalseClass] with_operator_name Optional parameter:
|
@@ -42,24 +46,32 @@ module ShellEv
|
|
42
46
|
# externalID provided by Shell Recharge)
|
43
47
|
# @param [Integer] page_number Optional parameter: Restrict the response
|
44
48
|
# list by providing a specific set of page Number. Set perPage parameter
|
45
|
-
# also when
|
49
|
+
# also when page Number is used.
|
46
50
|
# @param [Integer] per_page Optional parameter: Restrict the number of sites
|
47
|
-
# in
|
51
|
+
# in response per page.
|
48
52
|
# @param [String] updated_since Optional parameter: ZonedDateTime as
|
49
53
|
# string
|
50
|
-
# @
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
54
|
+
# @param [Array[String]] country Optional parameter: Filter by Locations
|
55
|
+
# that are at least in one of the given countries (specified using ISO
|
56
|
+
# 3166-1 alpha-3 codes)
|
57
|
+
# @param [Array[String]] exclude_country Optional parameter: Filter by
|
58
|
+
# Locations that are not in one of the given countries (specified using ISO
|
59
|
+
# 3166-1 alpha-3 codes)
|
60
|
+
# @return [Response] response from the API call
|
61
|
+
def get_ev_locations(request_id,
|
62
|
+
evse_status: nil,
|
63
|
+
connector_types: nil,
|
64
|
+
connector_min_power: nil,
|
65
|
+
authorization_methods: nil,
|
66
|
+
with_operator_name: nil,
|
67
|
+
evse_id: nil,
|
68
|
+
location_external_id: nil,
|
69
|
+
evse_external_id: nil,
|
70
|
+
page_number: nil,
|
71
|
+
per_page: nil,
|
72
|
+
updated_since: nil,
|
73
|
+
country: nil,
|
74
|
+
exclude_country: nil)
|
63
75
|
new_api_call_builder
|
64
76
|
.request(new_request_builder(HttpMethodEnum::GET,
|
65
77
|
'/locations/v1/ev',
|
@@ -76,25 +88,35 @@ module ShellEv
|
|
76
88
|
.query_param(new_parameter(page_number, key: 'pageNumber'))
|
77
89
|
.query_param(new_parameter(per_page, key: 'perPage'))
|
78
90
|
.query_param(new_parameter(updated_since, key: 'updatedSince'))
|
91
|
+
.query_param(new_parameter(country, key: 'country'))
|
92
|
+
.query_param(new_parameter(exclude_country, key: 'excludeCountry'))
|
79
93
|
.header_param(new_parameter('application/json', key: 'accept'))
|
80
94
|
.auth(Single.new('BearerAuth')))
|
81
95
|
.response(new_response_handler
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
96
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
97
|
+
.deserialize_into(Response.method(:from_hash))
|
98
|
+
.local_error('400',
|
99
|
+
'The server cannot or will not process the request due to'\
|
100
|
+
' something that is perceived to be a client error (e.g.,'\
|
101
|
+
' malformed request syntax, invalid request message framing, or'\
|
102
|
+
' deceptive request routing).',
|
103
|
+
BadRequestException)
|
104
|
+
.local_error('401',
|
105
|
+
'The request has not been applied because it lacks valid'\
|
106
|
+
' authentication credentials for the target resource.',
|
107
|
+
UnauthorizedException)
|
108
|
+
.local_error('404',
|
109
|
+
'Location Not Found',
|
110
|
+
NotFoundException)
|
111
|
+
.local_error('429',
|
112
|
+
'The Request reached maximum allocated rate limit',
|
113
|
+
TooManyRequestsException)
|
114
|
+
.local_error('500',
|
115
|
+
'Internal Server error',
|
116
|
+
InternalServerErrorException)
|
117
|
+
.local_error('503',
|
118
|
+
'Service unavailable',
|
119
|
+
ServiceunavailableException))
|
98
120
|
.execute
|
99
121
|
end
|
100
122
|
|
@@ -102,14 +124,24 @@ module ShellEv
|
|
102
124
|
# The query for a single location is to be made using the Unique Internal
|
103
125
|
# identifier used to refer to this Location by Shell Recharge. (Uid from
|
104
126
|
# List of locations API)
|
105
|
-
# @param [String] request_id Required parameter:
|
106
|
-
#
|
107
|
-
#
|
127
|
+
# @param [UUID | String] request_id Required parameter: RequestId must be
|
128
|
+
# unique identifier value that can be used by the consumer to correlate each
|
129
|
+
# request /response .<br>Format.<br> Its canonical textual representation,
|
130
|
+
# the 16 octets of a UUID are represented as 32 hexadecimal (base-16)
|
131
|
+
# digits, displayed in five groups separated by hyphens, in the form
|
132
|
+
# 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
|
133
|
+
# hyphens) <br>
|
108
134
|
# @param [String] id Required parameter: Unique Uid of the location from
|
109
135
|
# List of locations API
|
110
|
-
# @
|
111
|
-
|
112
|
-
|
136
|
+
# @param [String] provider_id Optional parameter: The provider id that you
|
137
|
+
# wish to see locations and tariffs for
|
138
|
+
# @param [String] since Optional parameter: to get the locations modified
|
139
|
+
# after a date
|
140
|
+
# @return [Response] response from the API call
|
141
|
+
def ev_locations_by_id(request_id,
|
142
|
+
id,
|
143
|
+
provider_id: nil,
|
144
|
+
since: nil)
|
113
145
|
new_api_call_builder
|
114
146
|
.request(new_request_builder(HttpMethodEnum::GET,
|
115
147
|
'/locations/v1/ev/{id}',
|
@@ -117,29 +149,40 @@ module ShellEv
|
|
117
149
|
.header_param(new_parameter(request_id, key: 'RequestId'))
|
118
150
|
.template_param(new_parameter(id, key: 'id')
|
119
151
|
.should_encode(true))
|
152
|
+
.query_param(new_parameter(provider_id, key: 'providerId'))
|
153
|
+
.query_param(new_parameter(since, key: 'since'))
|
120
154
|
.header_param(new_parameter('application/json', key: 'accept'))
|
121
155
|
.auth(Single.new('BearerAuth')))
|
122
156
|
.response(new_response_handler
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
157
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
158
|
+
.deserialize_into(Response.method(:from_hash))
|
159
|
+
.local_error('400',
|
160
|
+
'The server cannot or will not process the request due to'\
|
161
|
+
' something that is perceived to be a client error (e.g.,'\
|
162
|
+
' malformed request syntax, invalid request message framing, or'\
|
163
|
+
' deceptive request routing).',
|
164
|
+
BadRequestException)
|
165
|
+
.local_error('401',
|
166
|
+
'The request has not been applied because it lacks valid'\
|
167
|
+
' authentication credentials for the target resource.',
|
168
|
+
UnauthorizedException)
|
169
|
+
.local_error('404',
|
170
|
+
'Location Not Found',
|
171
|
+
NotFoundException)
|
172
|
+
.local_error('429',
|
173
|
+
'The Request reached maximum allocated rate limit',
|
174
|
+
TooManyRequestsException)
|
175
|
+
.local_error('500',
|
176
|
+
'Internal Server error',
|
177
|
+
InternalServerErrorException)
|
178
|
+
.local_error('503',
|
179
|
+
'Service unavailable',
|
180
|
+
ServiceunavailableException))
|
138
181
|
.execute
|
139
182
|
end
|
140
183
|
|
141
|
-
# This API provides the list of all
|
142
|
-
#
|
184
|
+
# This API provides the list of all nearby Shell Recharge locations based on
|
185
|
+
# the latitude and longitude provided in the request.
|
143
186
|
# The list includes all Shell Recharge network and all sites available
|
144
187
|
# through our roaming partners.
|
145
188
|
# The end point provides the details such as the exact location/address of
|
@@ -150,9 +193,13 @@ module ShellEv
|
|
150
193
|
# * Based on status of the Charging units. Eg : Available or Occupied
|
151
194
|
# * Based on available connector types.
|
152
195
|
# * Based on minimum Power output (in kW) available
|
153
|
-
# @param [String] request_id Required parameter:
|
154
|
-
#
|
155
|
-
#
|
196
|
+
# @param [UUID | String] request_id Required parameter: RequestId must be
|
197
|
+
# unique identifier value that can be used by the consumer to correlate each
|
198
|
+
# request /response .<br>Format.<br> Its canonical textual representation,
|
199
|
+
# the 16 octets of a UUID are represented as 32 hexadecimal (base-16)
|
200
|
+
# digits, displayed in five groups separated by hyphens, in the form
|
201
|
+
# 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
|
202
|
+
# hyphens) <br>
|
156
203
|
# @param [Float] latitude Required parameter: Latitude to get Shell Recharge
|
157
204
|
# Locations nearby
|
158
205
|
# @param [Float] longitude Required parameter: Longitude to get Shell
|
@@ -169,37 +216,45 @@ module ShellEv
|
|
169
216
|
# given by the Operator, unique for that Operator
|
170
217
|
# @param [String] operator_name Optional parameter: Filter by Locations that
|
171
218
|
# have the given operator
|
172
|
-
# @param [
|
219
|
+
# @param [NearbyLocationsEvseStatusEnum] evse_status Optional parameter:
|
173
220
|
# Filter by Locations that have the given status
|
174
|
-
# @param [
|
221
|
+
# @param [NearbyLocationsConnectorTypesEnum] connector_types Optional
|
175
222
|
# parameter: Filter by Locations that have Connectors with these Connector
|
176
223
|
# Types
|
177
224
|
# @param [Float] connector_min_power Optional parameter: Filter by Locations
|
178
225
|
# that have a Connector with at least this power output (in kW)
|
179
|
-
# @param [
|
226
|
+
# @param [NearbyLocationsAuthorizationMethodsEnum] authorization_methods
|
180
227
|
# Optional parameter: Filter by Locations that support the given
|
181
228
|
# Authorization Methods
|
182
229
|
# @param [TrueClass | FalseClass] with_operator_name Optional parameter:
|
183
|
-
# Return operator name in marker object (only for marker type
|
184
|
-
#
|
230
|
+
# Return operator name in marker object (only for marker type Single
|
231
|
+
# ChargePoint)
|
185
232
|
# @param [TrueClass | FalseClass] with_max_power Optional parameter: Return
|
186
233
|
# maximum power in kW across all locations grouped in this marker
|
187
234
|
# (disregarding availability)
|
188
|
-
# @
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
235
|
+
# @param [Array[String]] country Optional parameter: Filter by Locations
|
236
|
+
# that are at least in one of the given countries (specified using ISO
|
237
|
+
# 3166-1 alpha-3 codes)
|
238
|
+
# @param [Array[String]] exclude_country Optional parameter: Filter by
|
239
|
+
# Locations that are not in one of the given countries (specified using ISO
|
240
|
+
# 3166-1 alpha-3 codes)
|
241
|
+
# @return [Response] response from the API call
|
242
|
+
def nearby_locations(request_id,
|
243
|
+
latitude,
|
244
|
+
longitude,
|
245
|
+
limit: 25,
|
246
|
+
location_external_id: nil,
|
247
|
+
evse_id: nil,
|
248
|
+
evse_external_id: nil,
|
249
|
+
operator_name: nil,
|
250
|
+
evse_status: nil,
|
251
|
+
connector_types: nil,
|
252
|
+
connector_min_power: nil,
|
253
|
+
authorization_methods: nil,
|
254
|
+
with_operator_name: nil,
|
255
|
+
with_max_power: nil,
|
256
|
+
country: nil,
|
257
|
+
exclude_country: nil)
|
203
258
|
new_api_call_builder
|
204
259
|
.request(new_request_builder(HttpMethodEnum::GET,
|
205
260
|
'/locations/v1/ev/nearby',
|
@@ -218,24 +273,35 @@ module ShellEv
|
|
218
273
|
.query_param(new_parameter(authorization_methods, key: 'authorizationMethods'))
|
219
274
|
.query_param(new_parameter(with_operator_name, key: 'withOperatorName'))
|
220
275
|
.query_param(new_parameter(with_max_power, key: 'withMaxPower'))
|
276
|
+
.query_param(new_parameter(country, key: 'country'))
|
277
|
+
.query_param(new_parameter(exclude_country, key: 'excludeCountry'))
|
221
278
|
.header_param(new_parameter('application/json', key: 'accept'))
|
222
279
|
.auth(Single.new('BearerAuth')))
|
223
280
|
.response(new_response_handler
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
281
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
282
|
+
.deserialize_into(Response.method(:from_hash))
|
283
|
+
.local_error('400',
|
284
|
+
'The server cannot or will not process the request due to'\
|
285
|
+
' something that is perceived to be a client error (e.g.,'\
|
286
|
+
' malformed request syntax, invalid request message framing, or'\
|
287
|
+
' deceptive request routing).',
|
288
|
+
BadRequestException)
|
289
|
+
.local_error('401',
|
290
|
+
'The request has not been applied because it lacks valid'\
|
291
|
+
' authentication credentials for the target resource.',
|
292
|
+
UnauthorizedException)
|
293
|
+
.local_error('404',
|
294
|
+
'Location Not Found',
|
295
|
+
NotFoundException)
|
296
|
+
.local_error('429',
|
297
|
+
'The Request reached maximum allocated rate limit',
|
298
|
+
TooManyRequestsException)
|
299
|
+
.local_error('500',
|
300
|
+
'Internal Server error',
|
301
|
+
InternalServerErrorException)
|
302
|
+
.local_error('503',
|
303
|
+
'Service unavailable',
|
304
|
+
ServiceunavailableException))
|
239
305
|
.execute
|
240
306
|
end
|
241
307
|
|
@@ -247,9 +313,13 @@ module ShellEv
|
|
247
313
|
# * Based on status of the Charging units. Eg : Available or Occupied
|
248
314
|
# * Based on available connector types.
|
249
315
|
# * Based on minimum Power output (in kW) available
|
250
|
-
# @param [String] request_id Required parameter:
|
251
|
-
#
|
252
|
-
#
|
316
|
+
# @param [UUID | String] request_id Required parameter: RequestId must be
|
317
|
+
# unique identifier value that can be used by the consumer to correlate each
|
318
|
+
# request /response .<br>Format.<br> Its canonical textual representation,
|
319
|
+
# the 16 octets of a UUID are represented as 32 hexadecimal (base-16)
|
320
|
+
# digits, displayed in five groups separated by hyphens, in the form
|
321
|
+
# 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
|
322
|
+
# hyphens) <br>
|
253
323
|
# @param [Float] west Required parameter: Longitude of the western bound to
|
254
324
|
# get the Shell Recharge Locations
|
255
325
|
# @param [Float] south Required parameter: Latitude of the southern bound to
|
@@ -260,14 +330,14 @@ module ShellEv
|
|
260
330
|
# get the Shell Recharge Locations
|
261
331
|
# @param [String] zoom Required parameter: Zoom level to show ex: (1: World,
|
262
332
|
# 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings)
|
263
|
-
# @param [
|
333
|
+
# @param [LocationsMarkersEvseStatusEnum] evse_status Optional parameter:
|
264
334
|
# Filter by Locations that have the given status
|
265
|
-
# @param [
|
335
|
+
# @param [LocationsMarkersConnectorTypesEnum] connector_types Optional
|
266
336
|
# parameter: Filter by Locations that have Connectors with the set of
|
267
337
|
# Connector Types
|
268
338
|
# @param [Float] connector_min_power Optional parameter: Filter by Locations
|
269
339
|
# that have a Connector with at least this power output (in kW)
|
270
|
-
# @param [
|
340
|
+
# @param [LocationsMarkersAuthorizationMethodsEnum] authorization_methods
|
271
341
|
# Optional parameter: Filter by Locations that support the given
|
272
342
|
# Authorization Methods
|
273
343
|
# @param [TrueClass | FalseClass] with_operator_name Optional parameter:
|
@@ -286,23 +356,31 @@ module ShellEv
|
|
286
356
|
# given by the Operator, unique for that Operator
|
287
357
|
# @param [String] operator_name Optional parameter: Filter by Locations that
|
288
358
|
# have the given operator
|
289
|
-
# @
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
359
|
+
# @param [Array[String]] country Optional parameter: Filter by Locations
|
360
|
+
# that are at least in one of the given countries (specified using ISO
|
361
|
+
# 3166-1 alpha-3 codes)
|
362
|
+
# @param [Array[String]] exclude_country Optional parameter: Filter by
|
363
|
+
# Locations that are not in one of the given countries (specified using ISO
|
364
|
+
# 3166-1 alpha-3 codes)
|
365
|
+
# @return [SingleLocationMarkerResponse] response from the API call
|
366
|
+
def locations_markers(request_id,
|
367
|
+
west,
|
368
|
+
south,
|
369
|
+
east,
|
370
|
+
north,
|
371
|
+
zoom,
|
372
|
+
evse_status: nil,
|
373
|
+
connector_types: nil,
|
374
|
+
connector_min_power: nil,
|
375
|
+
authorization_methods: nil,
|
376
|
+
with_operator_name: nil,
|
377
|
+
with_max_power: nil,
|
378
|
+
location_external_id: nil,
|
379
|
+
evse_id: nil,
|
380
|
+
evse_external_id: nil,
|
381
|
+
operator_name: nil,
|
382
|
+
country: nil,
|
383
|
+
exclude_country: nil)
|
306
384
|
new_api_call_builder
|
307
385
|
.request(new_request_builder(HttpMethodEnum::GET,
|
308
386
|
'/locations/v1/ev/markers',
|
@@ -323,29 +401,35 @@ module ShellEv
|
|
323
401
|
.query_param(new_parameter(evse_id, key: 'evseId'))
|
324
402
|
.query_param(new_parameter(evse_external_id, key: 'evseExternalId'))
|
325
403
|
.query_param(new_parameter(operator_name, key: 'operatorName'))
|
404
|
+
.query_param(new_parameter(country, key: 'country'))
|
405
|
+
.query_param(new_parameter(exclude_country, key: 'excludeCountry'))
|
326
406
|
.header_param(new_parameter('application/json', key: 'accept'))
|
327
407
|
.auth(Single.new('BearerAuth')))
|
328
408
|
.response(new_response_handler
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
'
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
409
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
410
|
+
.deserialize_into(SingleLocationMarkerResponse.method(:from_hash))
|
411
|
+
.local_error('400',
|
412
|
+
'The server cannot or will not process the request due to'\
|
413
|
+
' something that is perceived to be a client error (e.g.,'\
|
414
|
+
' malformed request syntax, invalid request message framing, or'\
|
415
|
+
' deceptive request routing).',
|
416
|
+
BadRequestException)
|
417
|
+
.local_error('401',
|
418
|
+
'The request has not been applied because it lacks valid'\
|
419
|
+
' authentication credentials for the target resource.',
|
420
|
+
UnauthorizedException)
|
421
|
+
.local_error('404',
|
422
|
+
'Location Not Found',
|
423
|
+
NotFoundException)
|
424
|
+
.local_error('429',
|
425
|
+
'The Request reached maximum allocated rate limit',
|
426
|
+
TooManyRequestsException)
|
427
|
+
.local_error('500',
|
428
|
+
'Internal server error',
|
429
|
+
InternalServerErrorException)
|
430
|
+
.local_error('503',
|
431
|
+
'Service unavailable',
|
432
|
+
ServiceunavailableException))
|
349
433
|
.execute
|
350
434
|
end
|
351
435
|
end
|
@@ -28,14 +28,14 @@ module ShellEv
|
|
28
28
|
.header_param(new_parameter('application/json', key: 'accept'))
|
29
29
|
.additional_form_params(_field_parameters))
|
30
30
|
.response(new_response_handler
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
32
|
+
.deserialize_into(OAuthToken.method(:from_hash))
|
33
|
+
.local_error('400',
|
34
|
+
'OAuth 2 provider returned an error.',
|
35
|
+
OAuthProviderException)
|
36
|
+
.local_error('401',
|
37
|
+
'OAuth 2 provider says client authentication failed.',
|
38
|
+
OAuthProviderException))
|
39
39
|
.execute
|
40
40
|
end
|
41
41
|
end
|
@@ -9,29 +9,44 @@ module ShellEv
|
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
|
-
#
|
12
|
+
# requestId is unique identifier value that is attached to requests and
|
13
|
+
# messages that allow reference to a particular transaction or event chain.
|
13
14
|
# @return [String]
|
14
|
-
attr_accessor :
|
15
|
+
attr_accessor :request_id
|
15
16
|
|
16
|
-
#
|
17
|
+
# Status of the request
|
17
18
|
# @return [String]
|
18
|
-
attr_accessor :
|
19
|
+
attr_accessor :status
|
19
20
|
|
20
|
-
#
|
21
|
-
# @
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
# Exception details of the error
|
22
|
+
# @return [Array[BadRequestErrMsg]]
|
23
|
+
attr_accessor :errors
|
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
|
+
@request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
|
39
|
+
@status = hash.key?('status') ? hash['status'] : SKIP
|
40
|
+
# Parameter is an array, so we need to iterate through it
|
41
|
+
@errors = nil
|
42
|
+
unless hash['errors'].nil?
|
43
|
+
@errors = []
|
44
|
+
hash['errors'].each do |structure|
|
45
|
+
@errors << (BadRequestErrMsg.from_hash(structure) if structure)
|
46
|
+
end
|
47
|
+
end
|
28
48
|
|
29
|
-
|
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
|
49
|
+
@errors = SKIP unless hash.key?('errors')
|
35
50
|
end
|
36
51
|
end
|
37
52
|
end
|