/// <summary> /// Sets up HTTP methods mappings. /// </summary> /// <param name="service">Service handling requests</param> public DefaultModule(DefaultService service) : base("/") { Get["/v4/geocoding/reverse"] = parameters => { var lat = Parameters.ValueOf <double?>(parameters, Context.Request, "lat", ParameterType.Query); var lng = Parameters.ValueOf <double?>(parameters, Context.Request, "lng", ParameterType.Query); var withinCountry = Parameters.ValueOf <string>(parameters, Context.Request, "withinCountry", ParameterType.Query); Preconditions.IsNotNull(lat, "Required parameter: 'lat' is missing at 'GeocodingReverseSearch'"); Preconditions.IsNotNull(lng, "Required parameter: 'lng' is missing at 'GeocodingReverseSearch'"); return(service.GeocodingReverseSearch(Context, lat, lng, withinCountry)); }; Get["/v4/geocoding/search"] = parameters => { var query = Parameters.ValueOf <string>(parameters, Context.Request, "query", ParameterType.Query); var focusLat = Parameters.ValueOf <double?>(parameters, Context.Request, "focusLat", ParameterType.Query); var focusLng = Parameters.ValueOf <double?>(parameters, Context.Request, "focusLng", ParameterType.Query); var withinCountry = Parameters.ValueOf <string>(parameters, Context.Request, "withinCountry", ParameterType.Query); Preconditions.IsNotNull(query, "Required parameter: 'query' is missing at 'GeocodingSearch'"); return(service.GeocodingSearch(Context, query, focusLat, focusLng, withinCountry)); }; Get["/v4/map-info"] = parameters => { return(service.MapInfo(Context)); }; Post["/v4/routes"] = parameters => { var requestRoutes = this.Bind <RequestRoutes>(); Preconditions.IsNotNull(requestRoutes, "Required parameter: 'requestRoutes' is missing at 'Routes'"); return(service.Routes(Context, requestRoutes)); }; Post["/v4/supported-locations"] = parameters => { var requestSupportedLocations = this.Bind <RequestSupportedLocations>(); Preconditions.IsNotNull(requestSupportedLocations, "Required parameter: 'requestSupportedLocations' is missing at 'SupportedLocations'"); return(service.SupportedLocations(Context, requestSupportedLocations)); }; Post["/v4/time-filter"] = parameters => { var requestTimeFilter = this.Bind <RequestTimeFilter>(); Preconditions.IsNotNull(requestTimeFilter, "Required parameter: 'requestTimeFilter' is missing at 'TimeFilter'"); return(service.TimeFilter(Context, requestTimeFilter)); }; Post["/v4/time-filter/fast"] = parameters => { var requestTimeFilterFast = this.Bind <RequestTimeFilterFast>(); Preconditions.IsNotNull(requestTimeFilterFast, "Required parameter: 'requestTimeFilterFast' is missing at 'TimeFilterFast'"); return(service.TimeFilterFast(Context, requestTimeFilterFast)); }; Post["/v4/time-filter/postcode-districts"] = parameters => { var requestTimeFilterPostcodeDistricts = this.Bind <RequestTimeFilterPostcodeDistricts>(); Preconditions.IsNotNull(requestTimeFilterPostcodeDistricts, "Required parameter: 'requestTimeFilterPostcodeDistricts' is missing at 'TimeFilterPostcodeDistricts'"); return(service.TimeFilterPostcodeDistricts(Context, requestTimeFilterPostcodeDistricts)); }; Post["/v4/time-filter/postcode-sectors"] = parameters => { var requestTimeFilterPostcodeSectors = this.Bind <RequestTimeFilterPostcodeSectors>(); Preconditions.IsNotNull(requestTimeFilterPostcodeSectors, "Required parameter: 'requestTimeFilterPostcodeSectors' is missing at 'TimeFilterPostcodeSectors'"); return(service.TimeFilterPostcodeSectors(Context, requestTimeFilterPostcodeSectors)); }; Post["/v4/time-filter/postcodes"] = parameters => { var requestTimeFilterPostcodes = this.Bind <RequestTimeFilterPostcodes>(); Preconditions.IsNotNull(requestTimeFilterPostcodes, "Required parameter: 'requestTimeFilterPostcodes' is missing at 'TimeFilterPostcodes'"); return(service.TimeFilterPostcodes(Context, requestTimeFilterPostcodes)); }; Post["/v4/time-map"] = parameters => { var requestTimeMap = this.Bind <RequestTimeMap>(); Preconditions.IsNotNull(requestTimeMap, "Required parameter: 'requestTimeMap' is missing at 'TimeMap'"); return(service.TimeMap(Context, requestTimeMap)); }; }