UNPKG

ev-recharge-sdk

Version:

This API Product provides the option to manage charging at all public Shell Recharge locations. The end points provides control to start, stop and get status of the charging session.

424 lines 33.9 kB
"use strict"; /** * Shell EVLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ exports.__esModule = true; exports.LocationsController = void 0; var tslib_1 = require("tslib"); var getEVLocationsAuthorizationMethodsEnum_1 = require("../models/getEVLocationsAuthorizationMethodsEnum"); var getEVLocationsConnectorTypesEnum_1 = require("../models/getEVLocationsConnectorTypesEnum"); var getEVLocationsEvseStatusEnum_1 = require("../models/getEVLocationsEvseStatusEnum"); var nearbyLocationsConnectorTypesEnum_1 = require("../models/nearbyLocationsConnectorTypesEnum"); var response_1 = require("../models/response"); var singleLocationMarkerResponse_1 = require("../models/singleLocationMarkerResponse"); var schema_1 = require("../schema"); var baseController_1 = require("./baseController"); var badRequestError_1 = require("../errors/badRequestError"); var internalServerError_1 = require("../errors/internalServerError"); var notFoundError_1 = require("../errors/notFoundError"); var serviceunavailableError_1 = require("../errors/serviceunavailableError"); var tooManyRequestsError_1 = require("../errors/tooManyRequestsError"); var unauthorizedError_1 = require("../errors/unauthorizedError"); var LocationsController = /** @class */ (function (_super) { tslib_1.__extends(LocationsController, _super); function LocationsController() { return _super !== null && _super.apply(this, arguments) || this; } /** * 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) * * @param requestId RequestId must be unique identifier value * that can be used by the consumer to * correlate each request /response .<br>Format. * <br> 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) * <br> * @param evseStatus Filter by Locations that have the given * status * @param connectorTypes Filter by Locations that have Connectors * with the set of Connector Types * @param connectorMinPower Filter by Locations that have a Connector * with at least this power output (in kW) * @param authorizationMethods Filter by Locations that support the given * Authorization Methods * @param withOperatorName Return operator name in marker response * object * @param evseId optional Standard EVSE (Electric Vehicle * Supply Equipment) Id identifier (ISO-IEC- * 15118) * @param locationExternalId Filter by Locations with the given * externalId. (Unique Location externalID * provided by Shell Recharge) * @param evseExternalId Filter by Locations that have an Evse with * the given External Id. (Unique individual * EVSE externalID provided by Shell Recharge) * @param pageNumber Restrict the response list by providing a * specific set of page Number. Set perPage * parameter also when page Number is used. * @param perPage Restrict the number of sites in response * per page. * @param updatedSince ZonedDateTime as string * @param country Filter by Locations that are at least in * one of the given countries (specified using * ISO 3166-1 alpha-3 codes) * @param excludeCountry Filter by Locations that are not in one of * the given countries (specified using ISO * 3166-1 alpha-3 codes) * @return Response from the API call */ LocationsController.prototype.getEVLocations = function (requestId, evseStatus, connectorTypes, connectorMinPower, authorizationMethods, withOperatorName, evseId, locationExternalId, evseExternalId, pageNumber, perPage, updatedSince, country, excludeCountry, requestOptions) { return tslib_1.__awaiter(this, void 0, void 0, function () { var req, mapped; return tslib_1.__generator(this, function (_a) { req = this.createRequest('GET', '/locations'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_1.string)()], evseStatus: [evseStatus, (0, schema_1.optional)(getEVLocationsEvseStatusEnum_1.getEVLocationsEvseStatusEnumSchema)], connectorTypes: [ connectorTypes, (0, schema_1.optional)(getEVLocationsConnectorTypesEnum_1.getEVLocationsConnectorTypesEnumSchema), ], connectorMinPower: [connectorMinPower, (0, schema_1.optional)((0, schema_1.number)())], authorizationMethods: [ authorizationMethods, (0, schema_1.optional)(getEVLocationsAuthorizationMethodsEnum_1.getEVLocationsAuthorizationMethodsEnumSchema), ], withOperatorName: [withOperatorName, (0, schema_1.optional)((0, schema_1.boolean)())], evseId: [evseId, (0, schema_1.optional)((0, schema_1.string)())], locationExternalId: [locationExternalId, (0, schema_1.optional)((0, schema_1.string)())], evseExternalId: [evseExternalId, (0, schema_1.optional)((0, schema_1.string)())], pageNumber: [pageNumber, (0, schema_1.optional)((0, schema_1.number)())], perPage: [perPage, (0, schema_1.optional)((0, schema_1.number)())], updatedSince: [updatedSince, (0, schema_1.optional)((0, schema_1.string)())], country: [country, (0, schema_1.optional)((0, schema_1.array)((0, schema_1.string)()))], excludeCountry: [excludeCountry, (0, schema_1.optional)((0, schema_1.array)((0, schema_1.string)()))] }); req.header('RequestId', mapped.requestId); req.query('evseStatus', mapped.evseStatus); req.query('connectorTypes', mapped.connectorTypes); req.query('connectorMinPower', mapped.connectorMinPower); req.query('authorizationMethods', mapped.authorizationMethods); req.query('withOperatorName', mapped.withOperatorName); req.query('evseId', mapped.evseId); req.query('locationExternalId', mapped.locationExternalId); req.query('evseExternalId', mapped.evseExternalId); req.query('pageNumber', mapped.pageNumber); req.query('perPage', mapped.perPage); req.query('updatedSince', mapped.updatedSince); req.query('country', mapped.country); req.query('excludeCountry', mapped.excludeCountry); req.throwOn(400, badRequestError_1.BadRequestError, '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).'); req.throwOn(401, unauthorizedError_1.UnauthorizedError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(404, notFoundError_1.NotFoundError, 'Location Not Found'); req.throwOn(429, tooManyRequestsError_1.TooManyRequestsError, 'The Request reached maximum allocated rate limit'); req.throwOn(500, internalServerError_1.InternalServerError, 'Internal Server error'); req.throwOn(503, serviceunavailableError_1.ServiceunavailableError, 'Service unavailable'); req.authenticate([{ bearerAuth: true }]); return [2 /*return*/, req.callAsJson(response_1.responseSchema, requestOptions)]; }); }); }; /** * 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) * * @param requestId RequestId must be unique identifier value that can be used by the consumer to * correlate each request /response .<br>Format.<br> 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) <br> * @param id Unique Uid of the location from List of locations API * @param providerId The provider id that you wish to see locations and tariffs for * @param since to get the locations modified after a date * @return Response from the API call */ LocationsController.prototype.evLocationsByID = function (requestId, id, providerId, since, requestOptions) { return tslib_1.__awaiter(this, void 0, void 0, function () { var req, mapped; return tslib_1.__generator(this, function (_a) { req = this.createRequest('GET'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_1.string)()], id: [id, (0, schema_1.string)()], providerId: [providerId, (0, schema_1.optional)((0, schema_1.string)())], since: [since, (0, schema_1.optional)((0, schema_1.string)())] }); req.header('RequestId', mapped.requestId); req.query('providerId', mapped.providerId); req.query('since', mapped.since); req.appendTemplatePath(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["/locations/", ""], ["/locations/", ""])), mapped.id); req.throwOn(400, badRequestError_1.BadRequestError, '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).'); req.throwOn(401, unauthorizedError_1.UnauthorizedError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(404, notFoundError_1.NotFoundError, 'Location Not Found'); req.throwOn(429, tooManyRequestsError_1.TooManyRequestsError, 'The Request reached maximum allocated rate limit'); req.throwOn(500, internalServerError_1.InternalServerError, 'Internal Server error'); req.throwOn(503, serviceunavailableError_1.ServiceunavailableError, 'Service unavailable'); req.authenticate([{ bearerAuth: true }]); return [2 /*return*/, req.callAsJson(response_1.responseSchema, requestOptions)]; }); }); }; /** * 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 * * @param requestId RequestId must be unique identifier value * that can be used by the consumer to * correlate each request /response .<br>Format. * <br> 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) * <br> * @param latitude Latitude to get Shell Recharge Locations * nearby * @param longitude Longitude to get Shell Recharge Locations * nearby * @param limit Maximum number of Locations to retrieve * @param locationExternalId Filter by Locations with the given * externalId Identifier as given by the Shell * Recharge Operator, unique for that Operator * @param evseId Filter by Locations that have an Evse with * the given Evse Id * @param evseExternalId Filter by Locations that have an Evse with * the given External Id Identifier of the Evse * as given by the Operator, unique for that * Operator * @param operatorName Filter by Locations that have the given * operator * @param evseStatus Filter by Locations that have the given * status * @param connectorTypes Filter by Locations that have Connectors * with these Connector Types * @param connectorMinPower Filter by Locations that have a Connector * with at least this power output (in kW) * @param authorizationMethods Filter by Locations that support the given * Authorization Methods * @param withOperatorName Return operator name in marker object (only * for marker type Single ChargePoint) * @param withMaxPower Return maximum power in kW across all * locations grouped in this marker * (disregarding availability) * @param country Filter by Locations that are at least in * one of the given countries (specified using * ISO 3166-1 alpha-3 codes) * @param excludeCountry Filter by Locations that are not in one of * the given countries (specified using ISO * 3166-1 alpha-3 codes) * @return Response from the API call */ LocationsController.prototype.nearbyLocations = function (requestId, latitude, longitude, limit, locationExternalId, evseId, evseExternalId, operatorName, evseStatus, connectorTypes, connectorMinPower, authorizationMethods, withOperatorName, withMaxPower, country, excludeCountry, requestOptions) { return tslib_1.__awaiter(this, void 0, void 0, function () { var req, mapped; return tslib_1.__generator(this, function (_a) { req = this.createRequest('GET', '/locations/nearby'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_1.string)()], latitude: [latitude, (0, schema_1.number)()], longitude: [longitude, (0, schema_1.number)()], limit: [limit, (0, schema_1.optional)((0, schema_1.number)())], locationExternalId: [locationExternalId, (0, schema_1.optional)((0, schema_1.string)())], evseId: [evseId, (0, schema_1.optional)((0, schema_1.string)())], evseExternalId: [evseExternalId, (0, schema_1.optional)((0, schema_1.string)())], operatorName: [operatorName, (0, schema_1.optional)((0, schema_1.string)())], evseStatus: [evseStatus, (0, schema_1.optional)(getEVLocationsEvseStatusEnum_1.getEVLocationsEvseStatusEnumSchema)], connectorTypes: [ connectorTypes, (0, schema_1.optional)(nearbyLocationsConnectorTypesEnum_1.nearbyLocationsConnectorTypesEnumSchema), ], connectorMinPower: [connectorMinPower, (0, schema_1.optional)((0, schema_1.number)())], authorizationMethods: [ authorizationMethods, (0, schema_1.optional)(getEVLocationsAuthorizationMethodsEnum_1.getEVLocationsAuthorizationMethodsEnumSchema), ], withOperatorName: [withOperatorName, (0, schema_1.optional)((0, schema_1.boolean)())], withMaxPower: [withMaxPower, (0, schema_1.optional)((0, schema_1.boolean)())], country: [country, (0, schema_1.optional)((0, schema_1.array)((0, schema_1.string)()))], excludeCountry: [excludeCountry, (0, schema_1.optional)((0, schema_1.array)((0, schema_1.string)()))] }); req.header('RequestId', mapped.requestId); req.query('latitude', mapped.latitude); req.query('longitude', mapped.longitude); req.query('limit', mapped.limit); req.query('locationExternalId', mapped.locationExternalId); req.query('evseId', mapped.evseId); req.query('evseExternalId', mapped.evseExternalId); req.query('operatorName', mapped.operatorName); req.query('evseStatus', mapped.evseStatus); req.query('connectorTypes', mapped.connectorTypes); req.query('connectorMinPower', mapped.connectorMinPower); req.query('authorizationMethods', mapped.authorizationMethods); req.query('withOperatorName', mapped.withOperatorName); req.query('withMaxPower', mapped.withMaxPower); req.query('country', mapped.country); req.query('excludeCountry', mapped.excludeCountry); req.throwOn(400, badRequestError_1.BadRequestError, '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).'); req.throwOn(401, unauthorizedError_1.UnauthorizedError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(404, notFoundError_1.NotFoundError, 'Location Not Found'); req.throwOn(429, tooManyRequestsError_1.TooManyRequestsError, 'The Request reached maximum allocated rate limit'); req.throwOn(500, internalServerError_1.InternalServerError, 'Internal Server error'); req.throwOn(503, serviceunavailableError_1.ServiceunavailableError, 'Service unavailable'); req.authenticate([{ bearerAuth: true }]); return [2 /*return*/, req.callAsJson(response_1.responseSchema, requestOptions)]; }); }); }; /** * 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 * * @param requestId RequestId must be unique identifier value * that can be used by the consumer to * correlate each request /response .<br>Format. * <br> 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) * <br> * @param west Longitude of the western bound to get the * Shell Recharge Locations * @param south Latitude of the southern bound to get the * Shell Recharge Locations * @param east Longitude of the eastern bound to get the * Shell Recharge Locations * @param north Latitude of the northern bound to get the * Shell Recharge Locations * @param zoom Zoom level to show ex: (1: World, 5: * Landmass/continent, 10: City, 15: Streets, * 20: Buildings) * @param evseStatus Filter by Locations that have the given * status * @param connectorTypes Filter by Locations that have Connectors * with the set of Connector Types * @param connectorMinPower Filter by Locations that have a Connector * with at least this power output (in kW) * @param authorizationMethods Filter by Locations that support the given * Authorization Methods * @param withOperatorName Return operator name in marker object (only * for marker type SingleChargePoint) * @param withMaxPower Return maximum power in kW across all * locations grouped in this marker * (disregarding availability) * @param locationExternalId Filter by Locations with the given * externalId. (Unique Location externalID * provided by Shell Recharge) * @param evseId Filter by Locations that have an Evse with * the given Evse Id * @param evseExternalId Filter by Locations that have an Evse with * the given External Id Identifier of the Evse * as given by the Operator, unique for that * Operator * @param operatorName Filter by Locations that have the given * operator * @param country Filter by Locations that are at least in * one of the given countries (specified using * ISO 3166-1 alpha-3 codes) * @param excludeCountry Filter by Locations that are not in one of * the given countries (specified using ISO * 3166-1 alpha-3 codes) * @return Response from the API call */ LocationsController.prototype.locationsMarkers = function (requestId, west, south, east, north, zoom, evseStatus, connectorTypes, connectorMinPower, authorizationMethods, withOperatorName, withMaxPower, locationExternalId, evseId, evseExternalId, operatorName, country, excludeCountry, requestOptions) { return tslib_1.__awaiter(this, void 0, void 0, function () { var req, mapped; return tslib_1.__generator(this, function (_a) { req = this.createRequest('GET', '/locations/markers'); mapped = req.prepareArgs({ requestId: [requestId, (0, schema_1.string)()], west: [west, (0, schema_1.number)()], south: [south, (0, schema_1.number)()], east: [east, (0, schema_1.number)()], north: [north, (0, schema_1.number)()], zoom: [zoom, (0, schema_1.string)()], evseStatus: [evseStatus, (0, schema_1.optional)(getEVLocationsEvseStatusEnum_1.getEVLocationsEvseStatusEnumSchema)], connectorTypes: [ connectorTypes, (0, schema_1.optional)(getEVLocationsConnectorTypesEnum_1.getEVLocationsConnectorTypesEnumSchema), ], connectorMinPower: [connectorMinPower, (0, schema_1.optional)((0, schema_1.number)())], authorizationMethods: [ authorizationMethods, (0, schema_1.optional)(getEVLocationsAuthorizationMethodsEnum_1.getEVLocationsAuthorizationMethodsEnumSchema), ], withOperatorName: [withOperatorName, (0, schema_1.optional)((0, schema_1.boolean)())], withMaxPower: [withMaxPower, (0, schema_1.optional)((0, schema_1.boolean)())], locationExternalId: [locationExternalId, (0, schema_1.optional)((0, schema_1.string)())], evseId: [evseId, (0, schema_1.optional)((0, schema_1.string)())], evseExternalId: [evseExternalId, (0, schema_1.optional)((0, schema_1.string)())], operatorName: [operatorName, (0, schema_1.optional)((0, schema_1.string)())], country: [country, (0, schema_1.optional)((0, schema_1.array)((0, schema_1.string)()))], excludeCountry: [excludeCountry, (0, schema_1.optional)((0, schema_1.array)((0, schema_1.string)()))] }); req.header('RequestId', mapped.requestId); req.query('west', mapped.west); req.query('south', mapped.south); req.query('east', mapped.east); req.query('north', mapped.north); req.query('zoom', mapped.zoom); req.query('evseStatus', mapped.evseStatus); req.query('connectorTypes', mapped.connectorTypes); req.query('connectorMinPower', mapped.connectorMinPower); req.query('authorizationMethods', mapped.authorizationMethods); req.query('withOperatorName', mapped.withOperatorName); req.query('withMaxPower', mapped.withMaxPower); req.query('locationExternalId', mapped.locationExternalId); req.query('evseId', mapped.evseId); req.query('evseExternalId', mapped.evseExternalId); req.query('operatorName', mapped.operatorName); req.query('country', mapped.country); req.query('excludeCountry', mapped.excludeCountry); req.throwOn(400, badRequestError_1.BadRequestError, '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).'); req.throwOn(401, unauthorizedError_1.UnauthorizedError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(404, notFoundError_1.NotFoundError, 'Location Not Found'); req.throwOn(429, tooManyRequestsError_1.TooManyRequestsError, 'The Request reached maximum allocated rate limit'); req.throwOn(500, internalServerError_1.InternalServerError, 'Internal server error'); req.throwOn(503, serviceunavailableError_1.ServiceunavailableError, 'Service unavailable'); req.authenticate([{ bearerAuth: true }]); return [2 /*return*/, req.callAsJson(singleLocationMarkerResponse_1.singleLocationMarkerResponseSchema, requestOptions)]; }); }); }; return LocationsController; }(baseController_1.BaseController)); exports.LocationsController = LocationsController; var templateObject_1; //# sourceMappingURL=locationsController.js.map