Vehicle

Handles Vehicle related requests with IMS web services.

Required Information

*Identity: In order to fetch driving summary data, the application must have a valid user (represented by the Identity). That user must be active.

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(identity: identity)
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 expansion

  • plate: plate in string

To fetch the vehicle by vehicleIdentity associated with the current user, use following snippet.

let service = VehicleService(identity: identity)
service.getVehicleFor(vehicleIdentity: vehicleIdentity,
                      expansions: expansions,
                      plate: plate,
                      then: { result in
    guard !result.value.empty else {
        // error
        return
    }
    completionHandler(.success(result.value))
})

Last updated