|
4 | 4 | * Stadia Maps Geospatial APIs |
5 | 5 | * The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications. |
6 | 6 | * |
7 | | - * The version of the OpenAPI document: 9.3.0 |
| 7 | + * The version of the OpenAPI document: 10.0.0 |
8 | 8 | * Contact: support@stadiamaps.com |
9 | 9 | * |
10 | 10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
@@ -163,6 +163,25 @@ export interface SearchStructuredRequest { |
163 | 163 | lang?: string; |
164 | 164 | } |
165 | 165 |
|
| 166 | +export interface SearchV2Request { |
| 167 | + text: string; |
| 168 | + focusPointLat?: number; |
| 169 | + focusPointLon?: number; |
| 170 | + layers?: Array<LayerId>; |
| 171 | + sources?: Array<SourceId>; |
| 172 | + boundaryGid?: string; |
| 173 | + boundaryCountry?: Array<string>; |
| 174 | + boundaryRectMinLat?: number; |
| 175 | + boundaryRectMinLon?: number; |
| 176 | + boundaryRectMaxLat?: number; |
| 177 | + boundaryRectMaxLon?: number; |
| 178 | + boundaryCircleLat?: number; |
| 179 | + boundaryCircleLon?: number; |
| 180 | + boundaryCircleRadius?: number; |
| 181 | + size?: number; |
| 182 | + lang?: string; |
| 183 | +} |
| 184 | + |
166 | 185 | /** |
167 | 186 | * |
168 | 187 | */ |
@@ -1064,4 +1083,127 @@ export class GeocodingApi extends runtime.BaseAPI { |
1064 | 1083 | ); |
1065 | 1084 | return await response.value(); |
1066 | 1085 | } |
| 1086 | + |
| 1087 | + /** |
| 1088 | + */ |
| 1089 | + async searchV2Raw( |
| 1090 | + requestParameters: SearchV2Request, |
| 1091 | + initOverrides?: RequestInit | runtime.InitOverrideFunction, |
| 1092 | + ): Promise<runtime.ApiResponse<GeocodeResponseEnvelopePropertiesV2>> { |
| 1093 | + if (requestParameters["text"] == null) { |
| 1094 | + throw new runtime.RequiredError( |
| 1095 | + "text", |
| 1096 | + 'Required parameter "text" was null or undefined when calling searchV2().', |
| 1097 | + ); |
| 1098 | + } |
| 1099 | + |
| 1100 | + const queryParameters: any = {}; |
| 1101 | + |
| 1102 | + if (requestParameters["text"] != null) { |
| 1103 | + queryParameters["text"] = requestParameters["text"]; |
| 1104 | + } |
| 1105 | + |
| 1106 | + if (requestParameters["focusPointLat"] != null) { |
| 1107 | + queryParameters["focus.point.lat"] = requestParameters["focusPointLat"]; |
| 1108 | + } |
| 1109 | + |
| 1110 | + if (requestParameters["focusPointLon"] != null) { |
| 1111 | + queryParameters["focus.point.lon"] = requestParameters["focusPointLon"]; |
| 1112 | + } |
| 1113 | + |
| 1114 | + if (requestParameters["layers"] != null) { |
| 1115 | + queryParameters["layers"] = requestParameters["layers"]!.join( |
| 1116 | + runtime.COLLECTION_FORMATS["csv"], |
| 1117 | + ); |
| 1118 | + } |
| 1119 | + |
| 1120 | + if (requestParameters["sources"] != null) { |
| 1121 | + queryParameters["sources"] = requestParameters["sources"]!.join( |
| 1122 | + runtime.COLLECTION_FORMATS["csv"], |
| 1123 | + ); |
| 1124 | + } |
| 1125 | + |
| 1126 | + if (requestParameters["boundaryGid"] != null) { |
| 1127 | + queryParameters["boundary.gid"] = requestParameters["boundaryGid"]; |
| 1128 | + } |
| 1129 | + |
| 1130 | + if (requestParameters["boundaryCountry"] != null) { |
| 1131 | + queryParameters["boundary.country"] = requestParameters[ |
| 1132 | + "boundaryCountry" |
| 1133 | + ]!.join(runtime.COLLECTION_FORMATS["csv"]); |
| 1134 | + } |
| 1135 | + |
| 1136 | + if (requestParameters["boundaryRectMinLat"] != null) { |
| 1137 | + queryParameters["boundary.rect.min_lat"] = |
| 1138 | + requestParameters["boundaryRectMinLat"]; |
| 1139 | + } |
| 1140 | + |
| 1141 | + if (requestParameters["boundaryRectMinLon"] != null) { |
| 1142 | + queryParameters["boundary.rect.min_lon"] = |
| 1143 | + requestParameters["boundaryRectMinLon"]; |
| 1144 | + } |
| 1145 | + |
| 1146 | + if (requestParameters["boundaryRectMaxLat"] != null) { |
| 1147 | + queryParameters["boundary.rect.max_lat"] = |
| 1148 | + requestParameters["boundaryRectMaxLat"]; |
| 1149 | + } |
| 1150 | + |
| 1151 | + if (requestParameters["boundaryRectMaxLon"] != null) { |
| 1152 | + queryParameters["boundary.rect.max_lon"] = |
| 1153 | + requestParameters["boundaryRectMaxLon"]; |
| 1154 | + } |
| 1155 | + |
| 1156 | + if (requestParameters["boundaryCircleLat"] != null) { |
| 1157 | + queryParameters["boundary.circle.lat"] = |
| 1158 | + requestParameters["boundaryCircleLat"]; |
| 1159 | + } |
| 1160 | + |
| 1161 | + if (requestParameters["boundaryCircleLon"] != null) { |
| 1162 | + queryParameters["boundary.circle.lon"] = |
| 1163 | + requestParameters["boundaryCircleLon"]; |
| 1164 | + } |
| 1165 | + |
| 1166 | + if (requestParameters["boundaryCircleRadius"] != null) { |
| 1167 | + queryParameters["boundary.circle.radius"] = |
| 1168 | + requestParameters["boundaryCircleRadius"]; |
| 1169 | + } |
| 1170 | + |
| 1171 | + if (requestParameters["size"] != null) { |
| 1172 | + queryParameters["size"] = requestParameters["size"]; |
| 1173 | + } |
| 1174 | + |
| 1175 | + if (requestParameters["lang"] != null) { |
| 1176 | + queryParameters["lang"] = requestParameters["lang"]; |
| 1177 | + } |
| 1178 | + |
| 1179 | + const headerParameters: runtime.HTTPHeaders = {}; |
| 1180 | + |
| 1181 | + if (this.configuration && this.configuration.apiKey) { |
| 1182 | + queryParameters["api_key"] = await this.configuration.apiKey("api_key"); // ApiKeyAuth authentication |
| 1183 | + } |
| 1184 | + |
| 1185 | + const response = await this.request( |
| 1186 | + { |
| 1187 | + path: `/geocoding/v2/search`, |
| 1188 | + method: "GET", |
| 1189 | + headers: headerParameters, |
| 1190 | + query: queryParameters, |
| 1191 | + }, |
| 1192 | + initOverrides, |
| 1193 | + ); |
| 1194 | + |
| 1195 | + return new runtime.JSONApiResponse(response, (jsonValue) => |
| 1196 | + GeocodeResponseEnvelopePropertiesV2FromJSON(jsonValue), |
| 1197 | + ); |
| 1198 | + } |
| 1199 | + |
| 1200 | + /** |
| 1201 | + */ |
| 1202 | + async searchV2( |
| 1203 | + requestParameters: SearchV2Request, |
| 1204 | + initOverrides?: RequestInit | runtime.InitOverrideFunction, |
| 1205 | + ): Promise<GeocodeResponseEnvelopePropertiesV2> { |
| 1206 | + const response = await this.searchV2Raw(requestParameters, initOverrides); |
| 1207 | + return await response.value(); |
| 1208 | + } |
1067 | 1209 | } |
0 commit comments