Generate clients (#206)

This commit is contained in:
Janos Dobronszki
2021-09-16 12:52:36 +01:00
committed by GitHub
parent 552c321dd7
commit d4d9c1c176
334 changed files with 9334 additions and 45 deletions

View File

@@ -0,0 +1,9 @@
curl "https://api.m3o.com/v1/geocoding/Lookup" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"address": "10 russell st",
"city": "london",
"country": "uk",
"postcode": "wc2b"
}'

View File

@@ -0,0 +1,19 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/geocoding"
"os"
)
// Lookup returns a geocoded address including normalized address and gps coordinates. All fields are optional, provide more to get more accurate results
func GeocodeAnAddress() {
geocodingService := geocoding.NewGeocodingService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := geocodingService.Lookup(&geocoding.LookupRequest{
Address: "10 russell st",
City: "london",
Country: "uk",
Postcode: "wc2b",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,17 @@
import * as geocoding from "m3o/geocoding";
// Lookup returns a geocoded address including normalized address and gps coordinates. All fields are optional, provide more to get more accurate results
async function GeocodeAnAddress() {
let geocodingService = new geocoding.GeocodingService(
process.env.MICRO_API_TOKEN
);
let rsp = await geocodingService.lookup({
address: "10 russell st",
city: "london",
country: "uk",
postcode: "wc2b",
});
console.log(rsp);
}
await GeocodeAnAddress();

View File

@@ -0,0 +1,7 @@
curl "https://api.m3o.com/v1/geocoding/Reverse" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"latitude": 51.5123064,
"longitude": -0.1216235
}'

View File

@@ -0,0 +1,17 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/geocoding"
"os"
)
// Reverse lookup an address from gps coordinates
func ReverseGeocodeLocation() {
geocodingService := geocoding.NewGeocodingService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := geocodingService.Reverse(&geocoding.ReverseRequest{
Latitude: 51.5123064,
Longitude: -0.1216235,
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,15 @@
import * as geocoding from "m3o/geocoding";
// Reverse lookup an address from gps coordinates
async function ReverseGeocodeLocation() {
let geocodingService = new geocoding.GeocodingService(
process.env.MICRO_API_TOKEN
);
let rsp = await geocodingService.reverse({
latitude: 51.5123064,
longitude: -0.1216235,
});
console.log(rsp);
}
await ReverseGeocodeLocation();