mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-16 13:04:34 +00:00
add vehicle api (#221)
* add vehicle api * Commit from GitHub Actions (Publish APIs & Clients) Co-authored-by: asim <asim@users.noreply.github.com>
This commit is contained in:
6
examples/vehicle/lookup/curl/lookupVehicle.sh
Executable file
6
examples/vehicle/lookup/curl/lookupVehicle.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/vehicle/Lookup" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"registration": "LC60OTA"
|
||||
}'
|
||||
16
examples/vehicle/lookup/go/lookupVehicle.go
Executable file
16
examples/vehicle/lookup/go/lookupVehicle.go
Executable file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/vehicle"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Lookup a UK vehicle by it's registration number
|
||||
func LookupVehicle() {
|
||||
vehicleService := vehicle.NewVehicleService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := vehicleService.Lookup(&vehicle.LookupRequest{
|
||||
Registration: "LC60OTA",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/vehicle/lookup/node/lookupVehicle.js
Executable file
12
examples/vehicle/lookup/node/lookupVehicle.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as vehicle from "m3o/vehicle";
|
||||
|
||||
// Lookup a UK vehicle by it's registration number
|
||||
async function LookupVehicle() {
|
||||
let vehicleService = new vehicle.VehicleService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await vehicleService.lookup({
|
||||
registration: "LC60OTA",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await LookupVehicle();
|
||||
Reference in New Issue
Block a user