ev-recharge-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 +92 -0
- data/lib/shell_ev/api_helper.rb +10 -0
- data/lib/shell_ev/client.rb +77 -0
- data/lib/shell_ev/configuration.rb +110 -0
- data/lib/shell_ev/controllers/base_controller.rb +66 -0
- data/lib/shell_ev/controllers/charging_controller.rb +216 -0
- data/lib/shell_ev/controllers/locations_controller.rb +352 -0
- data/lib/shell_ev/controllers/o_auth_authorization_controller.rb +42 -0
- data/lib/shell_ev/exceptions/api_exception.rb +10 -0
- data/lib/shell_ev/exceptions/bad_request_exception.rb +37 -0
- data/lib/shell_ev/exceptions/http401_error_response_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m400_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m401_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m404_error_response_error1_exception.rb +53 -0
- data/lib/shell_ev/exceptions/m405_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m429_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m500_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m503_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/not_found_exception.rb +37 -0
- data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +48 -0
- data/lib/shell_ev/exceptions/unauthorized_exception.rb +37 -0
- data/lib/shell_ev/http/auth/o_auth2.rb +90 -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/accessibility.rb +60 -0
- data/lib/shell_ev/models/accessibility_status_enum.rb +29 -0
- data/lib/shell_ev/models/active_response200_json.rb +78 -0
- data/lib/shell_ev/models/active_response200_json_status_enum.rb +23 -0
- data/lib/shell_ev/models/address.rb +81 -0
- data/lib/shell_ev/models/base_model.rb +62 -0
- data/lib/shell_ev/models/chargesession_start_body.rb +59 -0
- data/lib/shell_ev/models/connector_vo.rb +134 -0
- data/lib/shell_ev/models/connector_vo_connector_type_enum.rb +71 -0
- data/lib/shell_ev/models/connector_vo_updated_by_enum.rb +29 -0
- data/lib/shell_ev/models/coordinates.rb +70 -0
- data/lib/shell_ev/models/data_active.rb +153 -0
- data/lib/shell_ev/models/data_active_session_code_enum.rb +44 -0
- data/lib/shell_ev/models/data_active_session_state_enum.rb +35 -0
- data/lib/shell_ev/models/data_retrieve.rb +152 -0
- data/lib/shell_ev/models/data_retrieve_session_code_enum.rb +44 -0
- data/lib/shell_ev/models/data_retrieve_session_state_enum.rb +35 -0
- data/lib/shell_ev/models/electrical_properties.rb +81 -0
- data/lib/shell_ev/models/electrical_properties_power_type_enum.rb +26 -0
- data/lib/shell_ev/models/env_enum.rb +23 -0
- data/lib/shell_ev/models/evse_vo.rb +143 -0
- data/lib/shell_ev/models/evse_vo_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/evse_vo_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json.rb +78 -0
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json_status_enum.rb +23 -0
- data/lib/shell_ev/models/get_locations_list_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_locations_list_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_locations_list_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_markers_list_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_markers_list_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_markers_list_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_nearby_locations_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_nearby_locations_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_nearby_locations_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/inline_response202.rb +76 -0
- data/lib/shell_ev/models/inline_response2021.rb +58 -0
- data/lib/shell_ev/models/inline_response2021_status_enum.rb +23 -0
- data/lib/shell_ev/models/inline_response202_data.rb +48 -0
- data/lib/shell_ev/models/inline_response202_status_enum.rb +23 -0
- data/lib/shell_ev/models/location_respone_object.rb +172 -0
- data/lib/shell_ev/models/m400_error_response.rb +78 -0
- data/lib/shell_ev/models/m400_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m401_error_response.rb +78 -0
- data/lib/shell_ev/models/m401_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m404_error_response.rb +79 -0
- data/lib/shell_ev/models/m404_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m405_error_response.rb +78 -0
- data/lib/shell_ev/models/m405_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m429_error_response.rb +78 -0
- data/lib/shell_ev/models/m429_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m500_error_response.rb +78 -0
- data/lib/shell_ev/models/m500_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m503_error_response.rb +78 -0
- data/lib/shell_ev/models/m503_error_response_error.rb +80 -0
- data/lib/shell_ev/models/multi_location_marker.rb +126 -0
- data/lib/shell_ev/models/o_auth_provider_error_enum.rb +45 -0
- data/lib/shell_ev/models/o_auth_token.rb +100 -0
- data/lib/shell_ev/models/opening_hours_object.rb +70 -0
- data/lib/shell_ev/models/opening_hours_object_week_day_enum.rb +38 -0
- data/lib/shell_ev/models/response_base_status_enum.rb +26 -0
- data/lib/shell_ev/models/response_error401_all_of1.rb +57 -0
- data/lib/shell_ev/models/response_error401_all_of1_errors_items.rb +80 -0
- data/lib/shell_ev/models/single_location_marker.rb +157 -0
- data/lib/shell_ev/models/single_location_marker_authorization_methods_items_enum.rb +26 -0
- data/lib/shell_ev/models/single_location_marker_status_enum.rb +30 -0
- data/lib/shell_ev/models/stop_charge_session_request_body_json.rb +48 -0
- data/lib/shell_ev/models/success_response.rb +58 -0
- data/lib/shell_ev/models/tariff_vo.rb +111 -0
- data/lib/shell_ev/models/tariff_vo_updated_by_enum.rb +29 -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/utilities/union_type_lookup.rb +38 -0
- data/lib/shell_ev.rb +125 -0
- data/test/controllers/controller_test_base.rb +34 -0
- data/test/controllers/test_charging_controller.rb +78 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +224 -0
@@ -0,0 +1,352 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# LocationsController
|
8
|
+
class LocationsController < BaseController
|
9
|
+
# This API provides the list of all Shell Recharge locations. The list
|
10
|
+
# includes all Shell Recharge network and all locations available through
|
11
|
+
# our roaming partners.The end point provides flexible search criteria in
|
12
|
+
# order to get the list of Shell Recharge Network. The end point provides
|
13
|
+
# the details such as the exact location/address of the site along with the
|
14
|
+
# up-to-date status information of all the charging units in the site.
|
15
|
+
# Supported Search Options
|
16
|
+
# * Based on status of the Charging units. Eg : Available or Occupied
|
17
|
+
# * Based on available connector types.
|
18
|
+
# * Based on minimum Power output (in kW) available
|
19
|
+
# * Based on a specific charging unit ID (EVSE ID)
|
20
|
+
# @param [String] request_id Required parameter: A unique request id in GUID
|
21
|
+
# format. The value is written to the Shell API Platform audit log for end
|
22
|
+
# to end traceability of a request.
|
23
|
+
# @param [GetLocationsListEvseStatusEnum] evse_status Optional parameter:
|
24
|
+
# Filter by Locations that have the given status
|
25
|
+
# @param [GetLocationsListConnectorTypesEnum] connector_types Optional
|
26
|
+
# parameter: Filter by Locations that have Connectors with the set of
|
27
|
+
# Connector Types
|
28
|
+
# @param [Float] connector_min_power Optional parameter: Filter by Locations
|
29
|
+
# that have a Connector with at least this power output (in kW)
|
30
|
+
# @param [GetLocationsListAuthorizationMethodsEnum] authorization_methods
|
31
|
+
# Optional parameter: Filter by Locations that support the given
|
32
|
+
# Authorization Methods
|
33
|
+
# @param [TrueClass | FalseClass] with_operator_name Optional parameter:
|
34
|
+
# Return operator name in marker response object
|
35
|
+
# @param [String] evse_id Optional parameter: optional Standard EVSE
|
36
|
+
# (Electric Vehicle Supply Equipment) Id identifier (ISO-IEC-15118)
|
37
|
+
# @param [String] location_external_id Optional parameter: Filter by
|
38
|
+
# Locations with the given externalId. (Unique Location externalID provided
|
39
|
+
# by Shell Recharge)
|
40
|
+
# @param [String] evse_external_id Optional parameter: Filter by Locations
|
41
|
+
# that have an Evse with the given External Id. (Unique individual EVSE
|
42
|
+
# externalID provided by Shell Recharge)
|
43
|
+
# @param [Integer] page_number Optional parameter: Restrict the response
|
44
|
+
# list by providing a specific set of page Number. Set perPage parameter
|
45
|
+
# also when pageNumber is used.
|
46
|
+
# @param [Integer] per_page Optional parameter: Restrict the number of sites
|
47
|
+
# in reposne per page.
|
48
|
+
# @param [String] updated_since Optional parameter: ZonedDateTime as
|
49
|
+
# string
|
50
|
+
# @return [Array[LocationResponeObject]] response from the API call
|
51
|
+
def get_locations_list(request_id,
|
52
|
+
evse_status: nil,
|
53
|
+
connector_types: nil,
|
54
|
+
connector_min_power: nil,
|
55
|
+
authorization_methods: nil,
|
56
|
+
with_operator_name: nil,
|
57
|
+
evse_id: nil,
|
58
|
+
location_external_id: nil,
|
59
|
+
evse_external_id: nil,
|
60
|
+
page_number: nil,
|
61
|
+
per_page: nil,
|
62
|
+
updated_since: nil)
|
63
|
+
new_api_call_builder
|
64
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
65
|
+
'/locations/v1/ev',
|
66
|
+
Server::DEFAULT)
|
67
|
+
.header_param(new_parameter(request_id, key: 'RequestId'))
|
68
|
+
.query_param(new_parameter(evse_status, key: 'evseStatus'))
|
69
|
+
.query_param(new_parameter(connector_types, key: 'connectorTypes'))
|
70
|
+
.query_param(new_parameter(connector_min_power, key: 'connectorMinPower'))
|
71
|
+
.query_param(new_parameter(authorization_methods, key: 'authorizationMethods'))
|
72
|
+
.query_param(new_parameter(with_operator_name, key: 'withOperatorName'))
|
73
|
+
.query_param(new_parameter(evse_id, key: 'evseId'))
|
74
|
+
.query_param(new_parameter(location_external_id, key: 'locationExternalId'))
|
75
|
+
.query_param(new_parameter(evse_external_id, key: 'evseExternalId'))
|
76
|
+
.query_param(new_parameter(page_number, key: 'pageNumber'))
|
77
|
+
.query_param(new_parameter(per_page, key: 'perPage'))
|
78
|
+
.query_param(new_parameter(updated_since, key: 'updatedSince'))
|
79
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
80
|
+
.auth(Single.new('BearerAuth')))
|
81
|
+
.response(new_response_handler
|
82
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
83
|
+
.deserialize_into(LocationResponeObject.method(:from_hash))
|
84
|
+
.is_response_array(true)
|
85
|
+
.local_error('400',
|
86
|
+
'The server cannot or will not process the request due to'\
|
87
|
+
' something that is perceived to be a client error (e.g.,'\
|
88
|
+
' malformed request syntax, invalid request message framing, or'\
|
89
|
+
' deceptive request routing).',
|
90
|
+
BadRequestException)
|
91
|
+
.local_error('401',
|
92
|
+
'The request has not been applied because it lacks valid'\
|
93
|
+
' authentication credentials for the target resource.',
|
94
|
+
UnauthorizedException)
|
95
|
+
.local_error('404',
|
96
|
+
'Location Not Found',
|
97
|
+
NotFoundException))
|
98
|
+
.execute
|
99
|
+
end
|
100
|
+
|
101
|
+
# This API provides the details on a single Shell Recharge location.
|
102
|
+
# The query for a single location is to be made using the Unique Internal
|
103
|
+
# identifier used to refer to this Location by Shell Recharge. (Uid from
|
104
|
+
# List of locations API)
|
105
|
+
# @param [String] request_id Required parameter: A unique request id in GUID
|
106
|
+
# format. The value is written to the Shell API Platform audit log for end
|
107
|
+
# to end traceability of a request.
|
108
|
+
# @param [String] id Required parameter: Unique Uid of the location from
|
109
|
+
# List of locations API
|
110
|
+
# @return [LocationResponeObject] response from the API call
|
111
|
+
def get_location_by_id(request_id,
|
112
|
+
id)
|
113
|
+
new_api_call_builder
|
114
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
115
|
+
'/locations/v1/ev/{id}',
|
116
|
+
Server::DEFAULT)
|
117
|
+
.header_param(new_parameter(request_id, key: 'RequestId'))
|
118
|
+
.template_param(new_parameter(id, key: 'id')
|
119
|
+
.should_encode(true))
|
120
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
121
|
+
.auth(Single.new('BearerAuth')))
|
122
|
+
.response(new_response_handler
|
123
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
124
|
+
.deserialize_into(LocationResponeObject.method(:from_hash))
|
125
|
+
.local_error('400',
|
126
|
+
'The server cannot or will not process the request due to'\
|
127
|
+
' something that is perceived to be a client error (e.g.,'\
|
128
|
+
' malformed request syntax, invalid request message framing, or'\
|
129
|
+
' deceptive request routing).',
|
130
|
+
BadRequestException)
|
131
|
+
.local_error('401',
|
132
|
+
'The request has not been applied because it lacks valid'\
|
133
|
+
' authentication credentials for the target resource.',
|
134
|
+
UnauthorizedException)
|
135
|
+
.local_error('404',
|
136
|
+
'Location Not Found',
|
137
|
+
NotFoundException))
|
138
|
+
.execute
|
139
|
+
end
|
140
|
+
|
141
|
+
# This API provides the list of all near by Shell Recharge locations based
|
142
|
+
# on the latitude and longitude provided in the request.
|
143
|
+
# The list includes all Shell Recharge network and all sites available
|
144
|
+
# through our roaming partners.
|
145
|
+
# The end point provides the details such as the exact location/address of
|
146
|
+
# the site along with the up-to-date status information of all the charging
|
147
|
+
# units in the site.
|
148
|
+
# Supported Search Options
|
149
|
+
# * Based on latitude and longitude of the location. (Mandatory)
|
150
|
+
# * Based on status of the Charging units. Eg : Available or Occupied
|
151
|
+
# * Based on available connector types.
|
152
|
+
# * Based on minimum Power output (in kW) available
|
153
|
+
# @param [String] request_id Required parameter: A unique request id in GUID
|
154
|
+
# format. The value is written to the Shell API Platform audit log for end
|
155
|
+
# to end traceability of a request.
|
156
|
+
# @param [Float] latitude Required parameter: Latitude to get Shell Recharge
|
157
|
+
# Locations nearby
|
158
|
+
# @param [Float] longitude Required parameter: Longitude to get Shell
|
159
|
+
# Recharge Locations nearby
|
160
|
+
# @param [Float] limit Optional parameter: Maximum number of Locations to
|
161
|
+
# retrieve
|
162
|
+
# @param [String] location_external_id Optional parameter: Filter by
|
163
|
+
# Locations with the given externalId Identifier as given by the Shell
|
164
|
+
# Recharge Operator, unique for that Operator
|
165
|
+
# @param [String] evse_id Optional parameter: Filter by Locations that have
|
166
|
+
# an Evse with the given Evse Id
|
167
|
+
# @param [String] evse_external_id Optional parameter: Filter by Locations
|
168
|
+
# that have an Evse with the given External Id Identifier of the Evse as
|
169
|
+
# given by the Operator, unique for that Operator
|
170
|
+
# @param [String] operator_name Optional parameter: Filter by Locations that
|
171
|
+
# have the given operator
|
172
|
+
# @param [GetNearbyLocationsEvseStatusEnum] evse_status Optional parameter:
|
173
|
+
# Filter by Locations that have the given status
|
174
|
+
# @param [GetNearbyLocationsConnectorTypesEnum] connector_types Optional
|
175
|
+
# parameter: Filter by Locations that have Connectors with these Connector
|
176
|
+
# Types
|
177
|
+
# @param [Float] connector_min_power Optional parameter: Filter by Locations
|
178
|
+
# that have a Connector with at least this power output (in kW)
|
179
|
+
# @param [GetNearbyLocationsAuthorizationMethodsEnum] authorization_methods
|
180
|
+
# Optional parameter: Filter by Locations that support the given
|
181
|
+
# Authorization Methods
|
182
|
+
# @param [TrueClass | FalseClass] with_operator_name Optional parameter:
|
183
|
+
# Return operator name in marker object (only for marker type
|
184
|
+
# SingleChargePoint)
|
185
|
+
# @param [TrueClass | FalseClass] with_max_power Optional parameter: Return
|
186
|
+
# maximum power in kW across all locations grouped in this marker
|
187
|
+
# (disregarding availability)
|
188
|
+
# @return [LocationResponeObject] response from the API call
|
189
|
+
def get_nearby_locations(request_id,
|
190
|
+
latitude,
|
191
|
+
longitude,
|
192
|
+
limit: 25,
|
193
|
+
location_external_id: nil,
|
194
|
+
evse_id: nil,
|
195
|
+
evse_external_id: nil,
|
196
|
+
operator_name: nil,
|
197
|
+
evse_status: nil,
|
198
|
+
connector_types: nil,
|
199
|
+
connector_min_power: nil,
|
200
|
+
authorization_methods: nil,
|
201
|
+
with_operator_name: nil,
|
202
|
+
with_max_power: nil)
|
203
|
+
new_api_call_builder
|
204
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
205
|
+
'/locations/v1/ev/nearby',
|
206
|
+
Server::DEFAULT)
|
207
|
+
.header_param(new_parameter(request_id, key: 'RequestId'))
|
208
|
+
.query_param(new_parameter(latitude, key: 'latitude'))
|
209
|
+
.query_param(new_parameter(longitude, key: 'longitude'))
|
210
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
211
|
+
.query_param(new_parameter(location_external_id, key: 'locationExternalId'))
|
212
|
+
.query_param(new_parameter(evse_id, key: 'evseId'))
|
213
|
+
.query_param(new_parameter(evse_external_id, key: 'evseExternalId'))
|
214
|
+
.query_param(new_parameter(operator_name, key: 'operatorName'))
|
215
|
+
.query_param(new_parameter(evse_status, key: 'evseStatus'))
|
216
|
+
.query_param(new_parameter(connector_types, key: 'connectorTypes'))
|
217
|
+
.query_param(new_parameter(connector_min_power, key: 'connectorMinPower'))
|
218
|
+
.query_param(new_parameter(authorization_methods, key: 'authorizationMethods'))
|
219
|
+
.query_param(new_parameter(with_operator_name, key: 'withOperatorName'))
|
220
|
+
.query_param(new_parameter(with_max_power, key: 'withMaxPower'))
|
221
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
222
|
+
.auth(Single.new('BearerAuth')))
|
223
|
+
.response(new_response_handler
|
224
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
225
|
+
.deserialize_into(LocationResponeObject.method(:from_hash))
|
226
|
+
.local_error('400',
|
227
|
+
'The server cannot or will not process the request due to'\
|
228
|
+
' something that is perceived to be a client error (e.g.,'\
|
229
|
+
' malformed request syntax, invalid request message framing, or'\
|
230
|
+
' deceptive request routing).',
|
231
|
+
BadRequestException)
|
232
|
+
.local_error('401',
|
233
|
+
'The request has not been applied because it lacks valid'\
|
234
|
+
' authentication credentials for the target resource.',
|
235
|
+
UnauthorizedException)
|
236
|
+
.local_error('404',
|
237
|
+
'Location Not Found',
|
238
|
+
NotFoundException))
|
239
|
+
.execute
|
240
|
+
end
|
241
|
+
|
242
|
+
# This API, when given a set of bounds on the geographical front (East,West,
|
243
|
+
# North, South) will return a set of Markers that fall within the requested
|
244
|
+
# bounds. The API will automatically group locations at the same position on
|
245
|
+
# the map into one Marker.
|
246
|
+
# The API also provide further search options to filter the result set.
|
247
|
+
# * Based on status of the Charging units. Eg : Available or Occupied
|
248
|
+
# * Based on available connector types.
|
249
|
+
# * Based on minimum Power output (in kW) available
|
250
|
+
# @param [String] request_id Required parameter: A unique request id in GUID
|
251
|
+
# format. The value is written to the Shell API Platform audit log for end
|
252
|
+
# to end traceability of a request.
|
253
|
+
# @param [Float] west Required parameter: Longitude of the western bound to
|
254
|
+
# get the Shell Recharge Locations
|
255
|
+
# @param [Float] south Required parameter: Latitude of the southern bound to
|
256
|
+
# get the Shell Recharge Locations
|
257
|
+
# @param [Float] east Required parameter: Longitude of the eastern bound to
|
258
|
+
# get the Shell Recharge Locations
|
259
|
+
# @param [Float] north Required parameter: Latitude of the northern bound to
|
260
|
+
# get the Shell Recharge Locations
|
261
|
+
# @param [String] zoom Required parameter: Zoom level to show ex: (1: World,
|
262
|
+
# 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings)
|
263
|
+
# @param [GetMarkersListEvseStatusEnum] evse_status Optional parameter:
|
264
|
+
# Filter by Locations that have the given status
|
265
|
+
# @param [GetMarkersListConnectorTypesEnum] connector_types Optional
|
266
|
+
# parameter: Filter by Locations that have Connectors with the set of
|
267
|
+
# Connector Types
|
268
|
+
# @param [Float] connector_min_power Optional parameter: Filter by Locations
|
269
|
+
# that have a Connector with at least this power output (in kW)
|
270
|
+
# @param [GetMarkersListAuthorizationMethodsEnum] authorization_methods
|
271
|
+
# Optional parameter: Filter by Locations that support the given
|
272
|
+
# Authorization Methods
|
273
|
+
# @param [TrueClass | FalseClass] with_operator_name Optional parameter:
|
274
|
+
# Return operator name in marker object (only for marker type
|
275
|
+
# SingleChargePoint)
|
276
|
+
# @param [TrueClass | FalseClass] with_max_power Optional parameter: Return
|
277
|
+
# maximum power in kW across all locations grouped in this marker
|
278
|
+
# (disregarding availability)
|
279
|
+
# @param [String] location_external_id Optional parameter: Filter by
|
280
|
+
# Locations with the given externalId. (Unique Location externalID provided
|
281
|
+
# by Shell Recharge)
|
282
|
+
# @param [String] evse_id Optional parameter: Filter by Locations that have
|
283
|
+
# an Evse with the given Evse Id
|
284
|
+
# @param [String] evse_external_id Optional parameter: Filter by Locations
|
285
|
+
# that have an Evse with the given External Id Identifier of the Evse as
|
286
|
+
# given by the Operator, unique for that Operator
|
287
|
+
# @param [String] operator_name Optional parameter: Filter by Locations that
|
288
|
+
# have the given operator
|
289
|
+
# @return [Array[SingleLocationMarker | MultiLocationMarker]] response from the API call
|
290
|
+
def get_markers_list(request_id,
|
291
|
+
west,
|
292
|
+
south,
|
293
|
+
east,
|
294
|
+
north,
|
295
|
+
zoom,
|
296
|
+
evse_status: nil,
|
297
|
+
connector_types: nil,
|
298
|
+
connector_min_power: nil,
|
299
|
+
authorization_methods: nil,
|
300
|
+
with_operator_name: nil,
|
301
|
+
with_max_power: nil,
|
302
|
+
location_external_id: nil,
|
303
|
+
evse_id: nil,
|
304
|
+
evse_external_id: nil,
|
305
|
+
operator_name: nil)
|
306
|
+
new_api_call_builder
|
307
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
308
|
+
'/locations/v1/ev/markers',
|
309
|
+
Server::DEFAULT)
|
310
|
+
.header_param(new_parameter(request_id, key: 'RequestId'))
|
311
|
+
.query_param(new_parameter(west, key: 'west'))
|
312
|
+
.query_param(new_parameter(south, key: 'south'))
|
313
|
+
.query_param(new_parameter(east, key: 'east'))
|
314
|
+
.query_param(new_parameter(north, key: 'north'))
|
315
|
+
.query_param(new_parameter(zoom, key: 'zoom'))
|
316
|
+
.query_param(new_parameter(evse_status, key: 'evseStatus'))
|
317
|
+
.query_param(new_parameter(connector_types, key: 'connectorTypes'))
|
318
|
+
.query_param(new_parameter(connector_min_power, key: 'connectorMinPower'))
|
319
|
+
.query_param(new_parameter(authorization_methods, key: 'authorizationMethods'))
|
320
|
+
.query_param(new_parameter(with_operator_name, key: 'withOperatorName'))
|
321
|
+
.query_param(new_parameter(with_max_power, key: 'withMaxPower'))
|
322
|
+
.query_param(new_parameter(location_external_id, key: 'locationExternalId'))
|
323
|
+
.query_param(new_parameter(evse_id, key: 'evseId'))
|
324
|
+
.query_param(new_parameter(evse_external_id, key: 'evseExternalId'))
|
325
|
+
.query_param(new_parameter(operator_name, key: 'operatorName'))
|
326
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
327
|
+
.auth(Single.new('BearerAuth')))
|
328
|
+
.response(new_response_handler
|
329
|
+
.deserializer(proc do |response, should_symbolize|
|
330
|
+
APIHelper.deserialize_union_type(
|
331
|
+
UnionTypeLookUp.get(:MarkersResponse),
|
332
|
+
response, should_symbolize, true
|
333
|
+
)
|
334
|
+
end)
|
335
|
+
.is_response_array(true)
|
336
|
+
.local_error('400',
|
337
|
+
'The server cannot or will not process the request due to'\
|
338
|
+
' something that is perceived to be a client error (e.g.,'\
|
339
|
+
' malformed request syntax, invalid request message framing, or'\
|
340
|
+
' deceptive request routing).',
|
341
|
+
BadRequestException)
|
342
|
+
.local_error('401',
|
343
|
+
'The request has not been applied because it lacks valid'\
|
344
|
+
' authentication credentials for the target resource.',
|
345
|
+
UnauthorizedException)
|
346
|
+
.local_error('404',
|
347
|
+
'Location Not Found',
|
348
|
+
NotFoundException))
|
349
|
+
.execute
|
350
|
+
end
|
351
|
+
end
|
352
|
+
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
|
+
# OAuthAuthorizationController
|
8
|
+
class OAuthAuthorizationController < BaseController
|
9
|
+
# Create a new OAuth 2 token.
|
10
|
+
# @param [String] authorization Required parameter: Authorization header in
|
11
|
+
# Basic auth format
|
12
|
+
# @param [String] scope Optional parameter: Requested scopes as a
|
13
|
+
# space-delimited list.
|
14
|
+
# @param [Hash] _field_parameters Additional optional form parameters are
|
15
|
+
# supported by this endpoint.
|
16
|
+
# @return [OAuthToken] response from the API call
|
17
|
+
def request_token(authorization,
|
18
|
+
scope: nil,
|
19
|
+
_field_parameters: nil)
|
20
|
+
new_api_call_builder
|
21
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
22
|
+
'/v1/oauth/token',
|
23
|
+
Server::DEFAULT)
|
24
|
+
.form_param(new_parameter('client_credentials', key: 'grant_type'))
|
25
|
+
.header_param(new_parameter(authorization, key: 'Authorization'))
|
26
|
+
.form_param(new_parameter(scope, key: 'scope'))
|
27
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
28
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
29
|
+
.additional_form_params(_field_parameters))
|
30
|
+
.response(new_response_handler
|
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
|
+
.execute
|
40
|
+
end
|
41
|
+
end
|
42
|
+
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,37 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# BadRequest class.
|
8
|
+
class BadRequestException < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Error code
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :code
|
15
|
+
|
16
|
+
# Error desctiption in English
|
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,52 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# HTTP 401 Error Response class.
|
8
|
+
class HTTP401ErrorResponseException < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# A unique request id in GUID format. The value is written to the Shell API
|
13
|
+
# Platform audit log for end to end traceability of a request.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :request_id
|
16
|
+
|
17
|
+
# Indicates overall status of the request
|
18
|
+
# @return [ResponseBaseStatusEnum]
|
19
|
+
attr_accessor :status
|
20
|
+
|
21
|
+
# Details of error(s) encountered
|
22
|
+
# @return [Array[ResponseError401AllOf1ErrorsItems]]
|
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'] : nil
|
39
|
+
@status = hash.key?('Status') ? hash['Status'] : nil
|
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 << (ResponseError401AllOf1ErrorsItems.from_hash(structure) if structure)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
@errors = nil unless hash.key?('Errors')
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Bad Request
|
8
|
+
class M400ErrorResponseError1Exception < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Mandatory UUID (according to RFC 4122 standards) for requests and
|
13
|
+
# responses. This will be played back in the response from the request.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :request_id
|
16
|
+
|
17
|
+
# Indicates overall status of the request
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :status
|
20
|
+
|
21
|
+
# Indicates overall status of the request
|
22
|
+
# @return [Array[M400ErrorResponseError]]
|
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'] : nil
|
39
|
+
@status = hash.key?('Status') ? hash['Status'] : nil
|
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 << (M400ErrorResponseError.from_hash(structure) if structure)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
@errors = SKIP unless hash.key?('Errors')
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Unauthorized
|
8
|
+
class M401ErrorResponseError1Exception < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Mandatory UUID (according to RFC 4122 standards) for requests and
|
13
|
+
# responses. This will be played back in the response from the request.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :request_id
|
16
|
+
|
17
|
+
# Indicates overall status of the request
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :status
|
20
|
+
|
21
|
+
# Indicates overall status of the request
|
22
|
+
# @return [Array[M401ErrorResponseError]]
|
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'] : nil
|
39
|
+
@status = hash.key?('Status') ? hash['Status'] : nil
|
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 << (M401ErrorResponseError.from_hash(structure) if structure)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
@errors = SKIP unless hash.key?('Errors')
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Invalid charge token with given EmaId was not found. Backend HTTP 410 should
|
8
|
+
# be transformed to 404.
|
9
|
+
class M404ErrorResponseError1Exception < APIException
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Mandatory UUID (according to RFC 4122 standards) for requests and
|
14
|
+
# responses. This will be played back in the response from the request.
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :request_id
|
17
|
+
|
18
|
+
# Indicates overall status of the request
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :status
|
21
|
+
|
22
|
+
# Indicates overall status of the request
|
23
|
+
# @return [Array[M404ErrorResponseError]]
|
24
|
+
attr_accessor :errors
|
25
|
+
|
26
|
+
# The constructor.
|
27
|
+
# @param [String] The reason for raising an exception.
|
28
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
29
|
+
def initialize(reason, response)
|
30
|
+
super(reason, response)
|
31
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
32
|
+
unbox(hash)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Populates this object by extracting properties from a hash.
|
36
|
+
# @param [Hash] The deserialized response sent by the server in the
|
37
|
+
# response body.
|
38
|
+
def unbox(hash)
|
39
|
+
@request_id = hash.key?('RequestId') ? hash['RequestId'] : nil
|
40
|
+
@status = hash.key?('Status') ? hash['Status'] : nil
|
41
|
+
# Parameter is an array, so we need to iterate through it
|
42
|
+
@errors = nil
|
43
|
+
unless hash['Errors'].nil?
|
44
|
+
@errors = []
|
45
|
+
hash['Errors'].each do |structure|
|
46
|
+
@errors << (M404ErrorResponseError.from_hash(structure) if structure)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
@errors = SKIP unless hash.key?('Errors')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|