-
Notifications
You must be signed in to change notification settings - Fork 123
/
V6GeocodingService.java
146 lines (139 loc) · 6.11 KB
/
V6GeocodingService.java
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package com.mapbox.api.geocoding.v6;
import com.mapbox.api.geocoding.v6.models.V6BatchResponse;
import com.mapbox.api.geocoding.v6.models.V6Response;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
/**
* Forward geocoding HTTP interface.
*/
interface V6GeocodingService {
/**
* Constructs the http call to the /forward endpoint.
*
* @param userAgent the user agent
* @param query {@link V6ForwardGeocodingRequestOptions#query()}
* @param accessToken {@link MapboxV6Geocoding#accessToken()}
* @param permanent {@link MapboxV6Geocoding#permanent()}
* @param autocomplete {@link V6ForwardGeocodingRequestOptions#autocomplete()}
* @param bbox {@link V6ForwardGeocodingRequestOptions#bbox()}
* @param country {@link V6ForwardGeocodingRequestOptions#country()}
* @param language {@link V6ForwardGeocodingRequestOptions#language()}
* @param limit {@link V6ForwardGeocodingRequestOptions#limit()}
* @param proximity {@link V6ForwardGeocodingRequestOptions#proximity()}
* @param types {@link V6ForwardGeocodingRequestOptions#types()}
* @param worldview {@link V6ForwardGeocodingRequestOptions#worldview()}
* @return A retrofit Call object
*/
@GET("/search/geocode/v6/forward")
Call<V6Response> forwardGeocoding(
@Header("User-Agent") String userAgent,
@Query("q") String query,
@Query("access_token") String accessToken,
@Query("permanent") Boolean permanent,
@Query("autocomplete") Boolean autocomplete,
@Query("bbox") String bbox,
@Query("country") String country,
@Query("language") String language,
@Query("limit") Integer limit,
@Query("proximity") String proximity,
@Query("types") String types,
@Query("worldview") String worldview
);
/**
* Constructs the http call to the /forward endpoint.
*
* @param userAgent the user agent
* @param accessToken {@link MapboxV6Geocoding#accessToken()}
* @param addressLine1 {@link V6StructuredInputQuery#addressLine1()}
* @param addressNumber {@link V6StructuredInputQuery#addressNumber()}
* @param street {@link V6StructuredInputQuery#street()}
* @param block {@link V6StructuredInputQuery#block()}
* @param place {@link V6StructuredInputQuery#place()}
* @param region {@link V6StructuredInputQuery#region()}
* @param postcode {@link V6StructuredInputQuery#postcode()}
* @param locality {@link V6StructuredInputQuery#locality()}
* @param neighborhood {@link V6StructuredInputQuery#neighborhood()}
* @param permanent {@link MapboxV6Geocoding#permanent()}
* @param autocomplete {@link V6ForwardGeocodingRequestOptions#autocomplete()}
* @param bbox {@link V6ForwardGeocodingRequestOptions#bbox()}
* @param country {@link V6ForwardGeocodingRequestOptions#country()}
* @param language {@link V6ForwardGeocodingRequestOptions#language()}
* @param limit {@link V6ForwardGeocodingRequestOptions#limit()}
* @param proximity {@link V6ForwardGeocodingRequestOptions#proximity()}
* @param types {@link V6ForwardGeocodingRequestOptions#types()}
* @param worldview {@link V6ForwardGeocodingRequestOptions#worldview()}
* @return A retrofit Call object
*/
@GET("/search/geocode/v6/forward")
Call<V6Response> structureInputForwardGeocoding(
@Header("User-Agent") String userAgent,
@Query("access_token") String accessToken,
@Query("address_line1") String addressLine1,
@Query("address_number") String addressNumber,
@Query("street") String street,
@Query("block") String block,
@Query("place") String place,
@Query("region") String region,
@Query("postcode") String postcode,
@Query("locality") String locality,
@Query("neighborhood") String neighborhood,
@Query("permanent") Boolean permanent,
@Query("autocomplete") Boolean autocomplete,
@Query("bbox") String bbox,
@Query("country") String country,
@Query("language") String language,
@Query("limit") Integer limit,
@Query("proximity") String proximity,
@Query("types") String types,
@Query("worldview") String worldview
);
/**
* Constructs the html call to the /reverse endpoint.
*
* @param userAgent the user agent
* @param accessToken {@link MapboxV6Geocoding#accessToken()}
* @param longitude {@link V6ReverseGeocodingRequestOptions#longitude()}
* @param latitude {@link V6ReverseGeocodingRequestOptions#latitude()}
* @param permanent {@link MapboxV6Geocoding#permanent()}
* @param country {@link V6ReverseGeocodingRequestOptions#country()}
* @param language {@link V6ReverseGeocodingRequestOptions#language()}
* @param limit {@link V6ReverseGeocodingRequestOptions#limit()}
* @param types {@link V6ReverseGeocodingRequestOptions#types()}
* @param worldview {@link V6ReverseGeocodingRequestOptions#worldview()}
* @return A retrofit Call object
*/
@GET("/search/geocode/v6/reverse")
Call<V6Response> reverseGeocoding(
@Header("User-Agent") String userAgent,
@Query("access_token") String accessToken,
@Query("longitude") Double longitude,
@Query("latitude") Double latitude,
@Query("permanent") Boolean permanent,
@Query("country") String country,
@Query("language") String language,
@Query("limit") Integer limit,
@Query("types") String types,
@Query("worldview") String worldview
);
/**
* Constructs the html call to the /batch endpoint.
*
* @param userAgent the user agent
* @param accessToken {@link MapboxV6BatchGeocoding#accessToken()}
* @param permanent {@link MapboxV6BatchGeocoding#permanent()}
* @param body json serialized {@link MapboxV6BatchGeocoding#requestOptions()}
* @return A retrofit Call object
*/
@POST("/search/geocode/v6/batch")
Call<V6BatchResponse> batchGeocoding(
@Header("User-Agent") String userAgent,
@Query("access_token") String accessToken,
@Query("permanent") Boolean permanent,
@Body RequestBody body
);
}