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:
Asim Aslam
2021-10-04 12:14:31 +01:00
committed by GitHub
parent ec9fc27f24
commit 9b6010372e
22 changed files with 884 additions and 1 deletions

View 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"
}'

View 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)
}

View 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();