1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
open Awso_geo_places
open Awso_async
module Io = Http.Io
let eval ?endpoint_url ?cfg endpoint input =
Io.bind (Io.resolve_cfg cfg)
(fun cfg ->
let meth = Endpoints.method_of_endpoint endpoint in
let uri = Endpoints.uri_of_endpoint endpoint input in
Io.map
(Io.call ?endpoint_url ~cfg ~service:Values.service meth
(Endpoints.to_request endpoint input) uri)
(fun resp_result -> Endpoints.of_response endpoint resp_result))
let autocomplete ?endpoint_url ?cfg input =
eval ?endpoint_url ?cfg Endpoints.Autocomplete input
let geocode ?endpoint_url ?cfg input =
eval ?endpoint_url ?cfg Endpoints.Geocode input
let get_place ?endpoint_url ?cfg input =
eval ?endpoint_url ?cfg Endpoints.GetPlace input
let reverse_geocode ?endpoint_url ?cfg input =
eval ?endpoint_url ?cfg Endpoints.ReverseGeocode input
let search_nearby ?endpoint_url ?cfg input =
eval ?endpoint_url ?cfg Endpoints.SearchNearby input
let search_text ?endpoint_url ?cfg input =
eval ?endpoint_url ?cfg Endpoints.SearchText input
let suggest ?endpoint_url ?cfg input =
eval ?endpoint_url ?cfg Endpoints.Suggest input