Vehicle
Handles Vehicle related requests with IMS web services.
Parameters
Expansion: A set of expansion to be used for
Vehicle
API.
The expansion includes userByRole
, health
, devices
.
Concrete Example
Retrieve the list of all associated vehicles
To fetch the list of vehicles associated with the current user, use following snippet.
let service = VehicleService()
service.getAllVehicles(expansions: expansions,
then: { result in
guard !result.value.empty else {
// error
return
}
completionHandler(.success(result.value))
})
Retrieve the vehicle by vehicle identity
Parameters
vehicleIdentity:
An identity of the requested vehicle.expansions
: An expansionplate
: plate in string
To fetch the vehicle by vehicleIdentity
associated with the current user, use following snippet.
let service = VehicleService()
service.getVehicleFor(vehicleIdentity: vehicleIdentity,
expansions: expansions,
plate: plate,
then: { result in
guard !result.value.empty else {
// error
return
}
completionHandler(.success(result.value))
})
Last updated