Class: ShellEv::LocationsController

Inherits:
BaseController show all
Defined in:
lib/shell_ev/controllers/locations_controller.rb

Overview

LocationsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from ShellEv::BaseController

Instance Method Details

#ev_locations_by_id(request_id, id, provider_id: nil, since: nil) ⇒ Response

This API provides the details on a single Shell Recharge location. The query for a single location is to be made using the Unique Internal identifier used to refer to this Location by Shell Recharge. (Uid from List of locations API) unique identifier value that can be used by the consumer to correlate each request /response .
Format.
Its canonical textual representation, the 16 octets of a UUID are represented as 32 hexadecimal (base-16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4 hyphens)
List of locations API wish to see locations and tariffs for after a date

Parameters:

  • request_id (UUID | String)

    Required parameter: RequestId must be

  • id (String)

    Required parameter: Unique Uid of the location from

  • provider_id (String) (defaults to: nil)

    Optional parameter: The provider id that you

  • since (String) (defaults to: nil)

    Optional parameter: to get the locations modified

Returns:

  • (Response)

    response from the API call



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/shell_ev/controllers/locations_controller.rb', line 141

def ev_locations_by_id(request_id,
                       id,
                       provider_id: nil,
                       since: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/locations/v1/ev/{id}',
                                 Server::DEFAULT)
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .template_param(new_parameter(id, key: 'id')
                                .should_encode(true))
               .query_param(new_parameter(provider_id, key: 'providerId'))
               .query_param(new_parameter(since, key: 'since'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('BearerAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Response.method(:from_hash))
                .local_error('400',
                             'The server cannot or will not process the request due to'\
                              ' something that is perceived to be a client error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).',
                             BadRequestException)
                .local_error('401',
                             'The request has not been applied because it lacks valid'\
                              ' authentication credentials for the target resource.',
                             UnauthorizedException)
                .local_error('404',
                             'Location Not Found',
                             NotFoundException)
                .local_error('429',
                             'The Request reached maximum allocated rate limit',
                             TooManyRequestsException)
                .local_error('500',
                             'Internal Server error',
                             InternalServerErrorException)
                .local_error('503',
                             'Service unavailable',
                             ServiceunavailableException))
    .execute
end

#get_ev_locations(request_id, evse_status: nil, connector_types: nil, connector_min_power: nil, authorization_methods: nil, with_operator_name: nil, evse_id: nil, location_external_id: nil, evse_external_id: nil, page_number: nil, per_page: nil, updated_since: nil, country: nil, exclude_country: nil) ⇒ Response

This API provides the list of all Shell Recharge locations. The list includes all Shell Recharge network and all locations available through our roaming partners. The end point provides flexible search criteria in order to get the list of Shell Recharge Network. The end point provides the details such as the exact location/address of the site along with the up-to-date status information of all the charging units in the site. Supported Search Options

  • Based on status of the Charging units. Eg : Available or Occupied

  • Based on available connector types.

  • Based on minimum Power output (in kW) available

  • Based on a specific charging unit ID (EVSE ID)

unique identifier value that can be used by the consumer to correlate each request /response .
Format.
Its canonical textual representation, the 16 octets of a UUID are represented as 32 hexadecimal (base-16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4 hyphens)
Filter by Locations that have the given status parameter: Filter by Locations that have Connectors with the set of Connector Types that have a Connector with at least this power output (in kW) Optional parameter: Filter by Locations that support the given Authorization Methods Return operator name in marker response object (Electric Vehicle Supply Equipment) Id identifier (ISO-IEC-15118) Locations with the given externalId. (Unique Location externalID provided by Shell Recharge) that have an Evse with the given External Id. (Unique individual EVSE externalID provided by Shell Recharge) list by providing a specific set of page Number. Set perPage parameter also when page Number is used. in response per page. string that are at least in one of the given countries (specified using ISO 3166-1 alpha-3 codes) Locations that are not in one of the given countries (specified using ISO 3166-1 alpha-3 codes)

Parameters:

  • request_id (UUID | String)

    Required parameter: RequestId must be

  • evse_status (GetEVLocationsEvseStatusEnum) (defaults to: nil)

    Optional parameter:

  • connector_types (GetEVLocationsConnectorTypesEnum) (defaults to: nil)

    Optional

  • connector_min_power (Float) (defaults to: nil)

    Optional parameter: Filter by Locations

  • authorization_methods (GetEVLocationsAuthorizationMethodsEnum) (defaults to: nil)
  • with_operator_name (TrueClass | FalseClass) (defaults to: nil)

    Optional parameter:

  • evse_id (String) (defaults to: nil)

    Optional parameter: optional Standard EVSE

  • location_external_id (String) (defaults to: nil)

    Optional parameter: Filter by

  • evse_external_id (String) (defaults to: nil)

    Optional parameter: Filter by Locations

  • page_number (Integer) (defaults to: nil)

    Optional parameter: Restrict the response

  • per_page (Integer) (defaults to: nil)

    Optional parameter: Restrict the number of sites

  • updated_since (String) (defaults to: nil)

    Optional parameter: ZonedDateTime as

  • country (Array[String]) (defaults to: nil)

    Optional parameter: Filter by Locations

  • exclude_country (Array[String]) (defaults to: nil)

    Optional parameter: Filter by

Returns:

  • (Response)

    response from the API call



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/shell_ev/controllers/locations_controller.rb', line 61

def get_ev_locations(request_id,
                     evse_status: nil,
                     connector_types: nil,
                     connector_min_power: nil,
                     authorization_methods: nil,
                     with_operator_name: nil,
                     evse_id: nil,
                     location_external_id: nil,
                     evse_external_id: nil,
                     page_number: nil,
                     per_page: nil,
                     updated_since: nil,
                     country: nil,
                     exclude_country: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/locations/v1/ev',
                                 Server::DEFAULT)
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .query_param(new_parameter(evse_status, key: 'evseStatus'))
               .query_param(new_parameter(connector_types, key: 'connectorTypes'))
               .query_param(new_parameter(connector_min_power, key: 'connectorMinPower'))
               .query_param(new_parameter(authorization_methods, key: 'authorizationMethods'))
               .query_param(new_parameter(with_operator_name, key: 'withOperatorName'))
               .query_param(new_parameter(evse_id, key: 'evseId'))
               .query_param(new_parameter(location_external_id, key: 'locationExternalId'))
               .query_param(new_parameter(evse_external_id, key: 'evseExternalId'))
               .query_param(new_parameter(page_number, key: 'pageNumber'))
               .query_param(new_parameter(per_page, key: 'perPage'))
               .query_param(new_parameter(updated_since, key: 'updatedSince'))
               .query_param(new_parameter(country, key: 'country'))
               .query_param(new_parameter(exclude_country, key: 'excludeCountry'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('BearerAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Response.method(:from_hash))
                .local_error('400',
                             'The server cannot or will not process the request due to'\
                              ' something that is perceived to be a client error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).',
                             BadRequestException)
                .local_error('401',
                             'The request has not been applied because it lacks valid'\
                              ' authentication credentials for the target resource.',
                             UnauthorizedException)
                .local_error('404',
                             'Location Not Found',
                             NotFoundException)
                .local_error('429',
                             'The Request reached maximum allocated rate limit',
                             TooManyRequestsException)
                .local_error('500',
                             'Internal Server error',
                             InternalServerErrorException)
                .local_error('503',
                             'Service unavailable',
                             ServiceunavailableException))
    .execute
end

#locations_markers(request_id, west, south, east, north, zoom, evse_status: nil, connector_types: nil, connector_min_power: nil, authorization_methods: nil, with_operator_name: nil, with_max_power: nil, location_external_id: nil, evse_id: nil, evse_external_id: nil, operator_name: nil, country: nil, exclude_country: nil) ⇒ SingleLocationMarkerResponse

This API, when given a set of bounds on the geographical front (East,West, North, South) will return a set of Markers that fall within the requested bounds. The API will automatically group locations at the same position on the map into one Marker. The API also provide further search options to filter the result set.

* Based on status of the Charging units. Eg : Available or Occupied
* Based on available connector types.
* Based on minimum Power output (in kW) available

unique identifier value that can be used by the consumer to correlate each request /response .
Format.
Its canonical textual representation, the 16 octets of a UUID are represented as 32 hexadecimal (base-16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4 hyphens)
get the Shell Recharge Locations get the Shell Recharge Locations get the Shell Recharge Locations get the Shell Recharge Locations 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings) Filter by Locations that have the given status parameter: Filter by Locations that have Connectors with the set of Connector Types that have a Connector with at least this power output (in kW) Optional parameter: Filter by Locations that support the given Authorization Methods Return operator name in marker object (only for marker type SingleChargePoint) maximum power in kW across all locations grouped in this marker (disregarding availability) Locations with the given externalId. (Unique Location externalID provided by Shell Recharge) an Evse with the given Evse Id that have an Evse with the given External Id Identifier of the Evse as given by the Operator, unique for that Operator have the given operator that are at least in one of the given countries (specified using ISO 3166-1 alpha-3 codes) Locations that are not in one of the given countries (specified using ISO 3166-1 alpha-3 codes)

Parameters:

  • request_id (UUID | String)

    Required parameter: RequestId must be

  • west (Float)

    Required parameter: Longitude of the western bound to

  • south (Float)

    Required parameter: Latitude of the southern bound to

  • east (Float)

    Required parameter: Longitude of the eastern bound to

  • north (Float)

    Required parameter: Latitude of the northern bound to

  • zoom (String)

    Required parameter: Zoom level to show ex: (1: World,

  • evse_status (LocationsMarkersEvseStatusEnum) (defaults to: nil)

    Optional parameter:

  • connector_types (LocationsMarkersConnectorTypesEnum) (defaults to: nil)

    Optional

  • connector_min_power (Float) (defaults to: nil)

    Optional parameter: Filter by Locations

  • authorization_methods (LocationsMarkersAuthorizationMethodsEnum) (defaults to: nil)
  • with_operator_name (TrueClass | FalseClass) (defaults to: nil)

    Optional parameter:

  • with_max_power (TrueClass | FalseClass) (defaults to: nil)

    Optional parameter: Return

  • location_external_id (String) (defaults to: nil)

    Optional parameter: Filter by

  • evse_id (String) (defaults to: nil)

    Optional parameter: Filter by Locations that have

  • evse_external_id (String) (defaults to: nil)

    Optional parameter: Filter by Locations

  • operator_name (String) (defaults to: nil)

    Optional parameter: Filter by Locations that

  • country (Array[String]) (defaults to: nil)

    Optional parameter: Filter by Locations

  • exclude_country (Array[String]) (defaults to: nil)

    Optional parameter: Filter by

Returns:



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/shell_ev/controllers/locations_controller.rb', line 366

def locations_markers(request_id,
                      west,
                      south,
                      east,
                      north,
                      zoom,
                      evse_status: nil,
                      connector_types: nil,
                      connector_min_power: nil,
                      authorization_methods: nil,
                      with_operator_name: nil,
                      with_max_power: nil,
                      location_external_id: nil,
                      evse_id: nil,
                      evse_external_id: nil,
                      operator_name: nil,
                      country: nil,
                      exclude_country: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/locations/v1/ev/markers',
                                 Server::DEFAULT)
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .query_param(new_parameter(west, key: 'west'))
               .query_param(new_parameter(south, key: 'south'))
               .query_param(new_parameter(east, key: 'east'))
               .query_param(new_parameter(north, key: 'north'))
               .query_param(new_parameter(zoom, key: 'zoom'))
               .query_param(new_parameter(evse_status, key: 'evseStatus'))
               .query_param(new_parameter(connector_types, key: 'connectorTypes'))
               .query_param(new_parameter(connector_min_power, key: 'connectorMinPower'))
               .query_param(new_parameter(authorization_methods, key: 'authorizationMethods'))
               .query_param(new_parameter(with_operator_name, key: 'withOperatorName'))
               .query_param(new_parameter(with_max_power, key: 'withMaxPower'))
               .query_param(new_parameter(location_external_id, key: 'locationExternalId'))
               .query_param(new_parameter(evse_id, key: 'evseId'))
               .query_param(new_parameter(evse_external_id, key: 'evseExternalId'))
               .query_param(new_parameter(operator_name, key: 'operatorName'))
               .query_param(new_parameter(country, key: 'country'))
               .query_param(new_parameter(exclude_country, key: 'excludeCountry'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('BearerAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SingleLocationMarkerResponse.method(:from_hash))
                .local_error('400',
                             'The server cannot or will not process the request due to'\
                              ' something that is perceived to be a client error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).',
                             BadRequestException)
                .local_error('401',
                             'The request has not been applied because it lacks valid'\
                              ' authentication credentials for the target resource.',
                             UnauthorizedException)
                .local_error('404',
                             'Location Not Found',
                             NotFoundException)
                .local_error('429',
                             'The Request reached maximum allocated rate limit',
                             TooManyRequestsException)
                .local_error('500',
                             'Internal server error',
                             InternalServerErrorException)
                .local_error('503',
                             'Service unavailable',
                             ServiceunavailableException))
    .execute
end

#nearby_locations(request_id, latitude, longitude, limit: 25, location_external_id: nil, evse_id: nil, evse_external_id: nil, operator_name: nil, evse_status: nil, connector_types: nil, connector_min_power: nil, authorization_methods: nil, with_operator_name: nil, with_max_power: nil, country: nil, exclude_country: nil) ⇒ Response

This API provides the list of all nearby Shell Recharge locations based on the latitude and longitude provided in the request. The list includes all Shell Recharge network and all sites available through our roaming partners. The end point provides the details such as the exact location/address of the site along with the up-to-date status information of all the charging units in the site. Supported Search Options

  • Based on latitude and longitude of the location. (Mandatory)

  • Based on status of the Charging units. Eg : Available or Occupied

  • Based on available connector types.

  • Based on minimum Power output (in kW) available

unique identifier value that can be used by the consumer to correlate each request /response .
Format.
Its canonical textual representation, the 16 octets of a UUID are represented as 32 hexadecimal (base-16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4 hyphens)
Locations nearby Recharge Locations nearby retrieve Locations with the given externalId Identifier as given by the Shell Recharge Operator, unique for that Operator an Evse with the given Evse Id that have an Evse with the given External Id Identifier of the Evse as given by the Operator, unique for that Operator have the given operator Filter by Locations that have the given status parameter: Filter by Locations that have Connectors with these Connector Types that have a Connector with at least this power output (in kW) Optional parameter: Filter by Locations that support the given Authorization Methods Return operator name in marker object (only for marker type Single ChargePoint) maximum power in kW across all locations grouped in this marker (disregarding availability) that are at least in one of the given countries (specified using ISO 3166-1 alpha-3 codes) Locations that are not in one of the given countries (specified using ISO 3166-1 alpha-3 codes)

Parameters:

  • request_id (UUID | String)

    Required parameter: RequestId must be

  • latitude (Float)

    Required parameter: Latitude to get Shell Recharge

  • longitude (Float)

    Required parameter: Longitude to get Shell

  • limit (Float) (defaults to: 25)

    Optional parameter: Maximum number of Locations to

  • location_external_id (String) (defaults to: nil)

    Optional parameter: Filter by

  • evse_id (String) (defaults to: nil)

    Optional parameter: Filter by Locations that have

  • evse_external_id (String) (defaults to: nil)

    Optional parameter: Filter by Locations

  • operator_name (String) (defaults to: nil)

    Optional parameter: Filter by Locations that

  • evse_status (NearbyLocationsEvseStatusEnum) (defaults to: nil)

    Optional parameter:

  • connector_types (NearbyLocationsConnectorTypesEnum) (defaults to: nil)

    Optional

  • connector_min_power (Float) (defaults to: nil)

    Optional parameter: Filter by Locations

  • authorization_methods (NearbyLocationsAuthorizationMethodsEnum) (defaults to: nil)
  • with_operator_name (TrueClass | FalseClass) (defaults to: nil)

    Optional parameter:

  • with_max_power (TrueClass | FalseClass) (defaults to: nil)

    Optional parameter: Return

  • country (Array[String]) (defaults to: nil)

    Optional parameter: Filter by Locations

  • exclude_country (Array[String]) (defaults to: nil)

    Optional parameter: Filter by

Returns:

  • (Response)

    response from the API call



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/shell_ev/controllers/locations_controller.rb', line 242

def nearby_locations(request_id,
                     latitude,
                     longitude,
                     limit: 25,
                     location_external_id: nil,
                     evse_id: nil,
                     evse_external_id: nil,
                     operator_name: nil,
                     evse_status: nil,
                     connector_types: nil,
                     connector_min_power: nil,
                     authorization_methods: nil,
                     with_operator_name: nil,
                     with_max_power: nil,
                     country: nil,
                     exclude_country: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/locations/v1/ev/nearby',
                                 Server::DEFAULT)
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .query_param(new_parameter(latitude, key: 'latitude'))
               .query_param(new_parameter(longitude, key: 'longitude'))
               .query_param(new_parameter(limit, key: 'limit'))
               .query_param(new_parameter(location_external_id, key: 'locationExternalId'))
               .query_param(new_parameter(evse_id, key: 'evseId'))
               .query_param(new_parameter(evse_external_id, key: 'evseExternalId'))
               .query_param(new_parameter(operator_name, key: 'operatorName'))
               .query_param(new_parameter(evse_status, key: 'evseStatus'))
               .query_param(new_parameter(connector_types, key: 'connectorTypes'))
               .query_param(new_parameter(connector_min_power, key: 'connectorMinPower'))
               .query_param(new_parameter(authorization_methods, key: 'authorizationMethods'))
               .query_param(new_parameter(with_operator_name, key: 'withOperatorName'))
               .query_param(new_parameter(with_max_power, key: 'withMaxPower'))
               .query_param(new_parameter(country, key: 'country'))
               .query_param(new_parameter(exclude_country, key: 'excludeCountry'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('BearerAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Response.method(:from_hash))
                .local_error('400',
                             'The server cannot or will not process the request due to'\
                              ' something that is perceived to be a client error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).',
                             BadRequestException)
                .local_error('401',
                             'The request has not been applied because it lacks valid'\
                              ' authentication credentials for the target resource.',
                             UnauthorizedException)
                .local_error('404',
                             'Location Not Found',
                             NotFoundException)
                .local_error('429',
                             'The Request reached maximum allocated rate limit',
                             TooManyRequestsException)
                .local_error('500',
                             'Internal Server error',
                             InternalServerErrorException)
                .local_error('503',
                             'Service unavailable',
                             ServiceunavailableException))
    .execute
end