@azure-rest/maps-search 2.0.0-beta.2 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +80 -90
  3. package/dist/browser/MapsSearch.d.ts +53 -0
  4. package/dist/browser/MapsSearch.d.ts.map +1 -0
  5. package/{dist-esm/src → dist/browser}/MapsSearch.js +1 -1
  6. package/dist/browser/MapsSearch.js.map +1 -0
  7. package/dist/browser/generated/clientDefinitions.d.ts +137 -0
  8. package/dist/browser/generated/clientDefinitions.d.ts.map +1 -0
  9. package/dist/browser/generated/clientDefinitions.js +4 -0
  10. package/dist/browser/generated/clientDefinitions.js.map +1 -0
  11. package/dist/browser/generated/index.d.ts +10 -0
  12. package/dist/browser/generated/index.d.ts.map +1 -0
  13. package/dist/browser/generated/index.js +12 -0
  14. package/dist/browser/generated/index.js.map +1 -0
  15. package/dist/browser/generated/isUnexpected.d.ts +7 -0
  16. package/dist/browser/generated/isUnexpected.d.ts.map +1 -0
  17. package/dist/browser/generated/isUnexpected.js +75 -0
  18. package/dist/browser/generated/isUnexpected.js.map +1 -0
  19. package/dist/browser/generated/logger.d.ts +2 -0
  20. package/dist/browser/generated/logger.d.ts.map +1 -0
  21. package/dist/browser/generated/logger.js.map +1 -0
  22. package/dist/browser/generated/mapsSearchClient.d.ts +15 -0
  23. package/dist/browser/generated/mapsSearchClient.d.ts.map +1 -0
  24. package/dist/browser/generated/mapsSearchClient.js +42 -0
  25. package/dist/browser/generated/mapsSearchClient.js.map +1 -0
  26. package/dist/browser/generated/models.d.ts +97 -0
  27. package/dist/browser/generated/models.d.ts.map +1 -0
  28. package/dist/browser/generated/models.js +4 -0
  29. package/dist/browser/generated/models.js.map +1 -0
  30. package/dist/browser/generated/outputModels.d.ts +298 -0
  31. package/dist/browser/generated/outputModels.d.ts.map +1 -0
  32. package/dist/browser/generated/outputModels.js +4 -0
  33. package/dist/browser/generated/outputModels.js.map +1 -0
  34. package/dist/browser/generated/parameters.d.ts +135 -0
  35. package/dist/browser/generated/parameters.d.ts.map +1 -0
  36. package/dist/browser/generated/parameters.js +4 -0
  37. package/dist/browser/generated/parameters.js.map +1 -0
  38. package/dist/browser/generated/responses.d.ts +255 -0
  39. package/dist/browser/generated/responses.d.ts.map +1 -0
  40. package/dist/browser/generated/responses.js +4 -0
  41. package/dist/browser/generated/responses.js.map +1 -0
  42. package/dist/browser/index.d.ts +4 -0
  43. package/dist/browser/index.d.ts.map +1 -0
  44. package/dist/browser/index.js +6 -0
  45. package/dist/browser/index.js.map +1 -0
  46. package/dist/browser/logger.d.ts +2 -0
  47. package/dist/browser/logger.d.ts.map +1 -0
  48. package/dist/browser/logger.js +5 -0
  49. package/dist/browser/package.json +3 -0
  50. package/dist/commonjs/MapsSearch.d.ts +53 -0
  51. package/dist/commonjs/MapsSearch.d.ts.map +1 -0
  52. package/dist/commonjs/MapsSearch.js +44 -0
  53. package/dist/commonjs/MapsSearch.js.map +1 -0
  54. package/dist/commonjs/generated/clientDefinitions.d.ts +137 -0
  55. package/dist/commonjs/generated/clientDefinitions.d.ts.map +1 -0
  56. package/dist/commonjs/generated/clientDefinitions.js +5 -0
  57. package/dist/commonjs/generated/clientDefinitions.js.map +1 -0
  58. package/dist/commonjs/generated/index.d.ts +10 -0
  59. package/dist/commonjs/generated/index.d.ts.map +1 -0
  60. package/dist/commonjs/generated/index.js +15 -0
  61. package/dist/commonjs/generated/index.js.map +1 -0
  62. package/dist/commonjs/generated/isUnexpected.d.ts +7 -0
  63. package/dist/commonjs/generated/isUnexpected.d.ts.map +1 -0
  64. package/dist/commonjs/generated/isUnexpected.js +78 -0
  65. package/dist/commonjs/generated/isUnexpected.js.map +1 -0
  66. package/dist/commonjs/generated/logger.d.ts +2 -0
  67. package/dist/commonjs/generated/logger.d.ts.map +1 -0
  68. package/dist/commonjs/generated/logger.js +8 -0
  69. package/dist/commonjs/generated/logger.js.map +1 -0
  70. package/dist/commonjs/generated/mapsSearchClient.d.ts +15 -0
  71. package/dist/commonjs/generated/mapsSearchClient.d.ts.map +1 -0
  72. package/dist/commonjs/generated/mapsSearchClient.js +45 -0
  73. package/dist/commonjs/generated/mapsSearchClient.js.map +1 -0
  74. package/dist/commonjs/generated/models.d.ts +97 -0
  75. package/dist/commonjs/generated/models.d.ts.map +1 -0
  76. package/dist/commonjs/generated/models.js +5 -0
  77. package/dist/commonjs/generated/models.js.map +1 -0
  78. package/dist/commonjs/generated/outputModels.d.ts +298 -0
  79. package/dist/commonjs/generated/outputModels.d.ts.map +1 -0
  80. package/dist/commonjs/generated/outputModels.js +5 -0
  81. package/dist/commonjs/generated/outputModels.js.map +1 -0
  82. package/dist/commonjs/generated/parameters.d.ts +135 -0
  83. package/dist/commonjs/generated/parameters.d.ts.map +1 -0
  84. package/dist/commonjs/generated/parameters.js +5 -0
  85. package/dist/commonjs/generated/parameters.js.map +1 -0
  86. package/dist/commonjs/generated/responses.d.ts +255 -0
  87. package/dist/commonjs/generated/responses.d.ts.map +1 -0
  88. package/dist/commonjs/generated/responses.js +5 -0
  89. package/dist/commonjs/generated/responses.js.map +1 -0
  90. package/dist/commonjs/index.d.ts +4 -0
  91. package/dist/commonjs/index.d.ts.map +1 -0
  92. package/dist/commonjs/index.js +9 -0
  93. package/dist/commonjs/index.js.map +1 -0
  94. package/dist/commonjs/logger.d.ts +2 -0
  95. package/dist/commonjs/logger.d.ts.map +1 -0
  96. package/dist/commonjs/logger.js +8 -0
  97. package/dist/commonjs/logger.js.map +1 -0
  98. package/dist/commonjs/package.json +3 -0
  99. package/dist/commonjs/tsdoc-metadata.json +11 -0
  100. package/dist/esm/MapsSearch.d.ts +53 -0
  101. package/dist/esm/MapsSearch.d.ts.map +1 -0
  102. package/dist/esm/MapsSearch.js +40 -0
  103. package/dist/esm/MapsSearch.js.map +1 -0
  104. package/dist/esm/generated/clientDefinitions.d.ts +137 -0
  105. package/dist/esm/generated/clientDefinitions.d.ts.map +1 -0
  106. package/dist/esm/generated/clientDefinitions.js +4 -0
  107. package/dist/esm/generated/clientDefinitions.js.map +1 -0
  108. package/dist/esm/generated/index.d.ts +10 -0
  109. package/dist/esm/generated/index.d.ts.map +1 -0
  110. package/dist/esm/generated/index.js +12 -0
  111. package/dist/esm/generated/index.js.map +1 -0
  112. package/dist/esm/generated/isUnexpected.d.ts +7 -0
  113. package/dist/esm/generated/isUnexpected.d.ts.map +1 -0
  114. package/dist/esm/generated/isUnexpected.js +75 -0
  115. package/dist/esm/generated/isUnexpected.js.map +1 -0
  116. package/dist/esm/generated/logger.d.ts +2 -0
  117. package/dist/esm/generated/logger.d.ts.map +1 -0
  118. package/dist/esm/generated/logger.js +5 -0
  119. package/dist/esm/generated/logger.js.map +1 -0
  120. package/dist/esm/generated/mapsSearchClient.d.ts +15 -0
  121. package/dist/esm/generated/mapsSearchClient.d.ts.map +1 -0
  122. package/dist/esm/generated/mapsSearchClient.js +42 -0
  123. package/dist/esm/generated/mapsSearchClient.js.map +1 -0
  124. package/dist/esm/generated/models.d.ts +97 -0
  125. package/dist/esm/generated/models.d.ts.map +1 -0
  126. package/dist/esm/generated/models.js +4 -0
  127. package/dist/esm/generated/models.js.map +1 -0
  128. package/dist/esm/generated/outputModels.d.ts +298 -0
  129. package/dist/esm/generated/outputModels.d.ts.map +1 -0
  130. package/dist/esm/generated/outputModels.js +4 -0
  131. package/dist/esm/generated/outputModels.js.map +1 -0
  132. package/dist/esm/generated/parameters.d.ts +135 -0
  133. package/dist/esm/generated/parameters.d.ts.map +1 -0
  134. package/dist/esm/generated/parameters.js +4 -0
  135. package/dist/esm/generated/parameters.js.map +1 -0
  136. package/dist/esm/generated/responses.d.ts +255 -0
  137. package/dist/esm/generated/responses.d.ts.map +1 -0
  138. package/dist/esm/generated/responses.js +4 -0
  139. package/dist/esm/generated/responses.js.map +1 -0
  140. package/dist/esm/index.d.ts +4 -0
  141. package/dist/esm/index.d.ts.map +1 -0
  142. package/dist/esm/index.js +6 -0
  143. package/dist/esm/index.js.map +1 -0
  144. package/dist/esm/logger.d.ts +2 -0
  145. package/dist/esm/logger.d.ts.map +1 -0
  146. package/dist/esm/logger.js +5 -0
  147. package/dist/esm/logger.js.map +1 -0
  148. package/dist/esm/package.json +3 -0
  149. package/dist/react-native/MapsSearch.d.ts +53 -0
  150. package/dist/react-native/MapsSearch.d.ts.map +1 -0
  151. package/dist/react-native/MapsSearch.js +40 -0
  152. package/dist/react-native/MapsSearch.js.map +1 -0
  153. package/dist/react-native/generated/clientDefinitions.d.ts +137 -0
  154. package/dist/react-native/generated/clientDefinitions.d.ts.map +1 -0
  155. package/dist/react-native/generated/clientDefinitions.js +4 -0
  156. package/dist/react-native/generated/clientDefinitions.js.map +1 -0
  157. package/dist/react-native/generated/index.d.ts +10 -0
  158. package/dist/react-native/generated/index.d.ts.map +1 -0
  159. package/dist/react-native/generated/index.js +12 -0
  160. package/dist/react-native/generated/index.js.map +1 -0
  161. package/dist/react-native/generated/isUnexpected.d.ts +7 -0
  162. package/dist/react-native/generated/isUnexpected.d.ts.map +1 -0
  163. package/dist/react-native/generated/isUnexpected.js +75 -0
  164. package/dist/react-native/generated/isUnexpected.js.map +1 -0
  165. package/dist/react-native/generated/logger.d.ts +2 -0
  166. package/dist/react-native/generated/logger.d.ts.map +1 -0
  167. package/dist/react-native/generated/logger.js +5 -0
  168. package/dist/react-native/generated/logger.js.map +1 -0
  169. package/dist/react-native/generated/mapsSearchClient.d.ts +15 -0
  170. package/dist/react-native/generated/mapsSearchClient.d.ts.map +1 -0
  171. package/dist/react-native/generated/mapsSearchClient.js +42 -0
  172. package/dist/react-native/generated/mapsSearchClient.js.map +1 -0
  173. package/dist/react-native/generated/models.d.ts +97 -0
  174. package/dist/react-native/generated/models.d.ts.map +1 -0
  175. package/dist/react-native/generated/models.js +4 -0
  176. package/dist/react-native/generated/models.js.map +1 -0
  177. package/dist/react-native/generated/outputModels.d.ts +298 -0
  178. package/dist/react-native/generated/outputModels.d.ts.map +1 -0
  179. package/dist/react-native/generated/outputModels.js +4 -0
  180. package/dist/react-native/generated/outputModels.js.map +1 -0
  181. package/dist/react-native/generated/parameters.d.ts +135 -0
  182. package/dist/react-native/generated/parameters.d.ts.map +1 -0
  183. package/dist/react-native/generated/parameters.js +4 -0
  184. package/dist/react-native/generated/parameters.js.map +1 -0
  185. package/dist/react-native/generated/responses.d.ts +255 -0
  186. package/dist/react-native/generated/responses.d.ts.map +1 -0
  187. package/dist/react-native/generated/responses.js +4 -0
  188. package/dist/react-native/generated/responses.js.map +1 -0
  189. package/dist/react-native/index.d.ts +4 -0
  190. package/dist/react-native/index.d.ts.map +1 -0
  191. package/dist/react-native/index.js +6 -0
  192. package/dist/react-native/index.js.map +1 -0
  193. package/dist/react-native/logger.d.ts +2 -0
  194. package/dist/react-native/logger.d.ts.map +1 -0
  195. package/dist/react-native/logger.js +5 -0
  196. package/dist/react-native/logger.js.map +1 -0
  197. package/dist/react-native/package.json +3 -0
  198. package/package.json +75 -54
  199. package/dist/index.js +0 -171
  200. package/dist/index.js.map +0 -1
  201. package/dist-esm/src/MapsSearch.js.map +0 -1
  202. package/dist-esm/src/index.js +0 -6
  203. package/dist-esm/src/index.js.map +0 -1
  204. package/review/maps-search.api.md +0 -549
  205. package/types/maps-search-rest.d.ts +0 -1066
  206. /package/{dist-esm/src → dist/browser/generated}/logger.js +0 -0
  207. /package/{dist-esm/src → dist/browser}/logger.js.map +0 -0
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = MapsSearch;
6
+ const tslib_1 = require("tslib");
7
+ const core_auth_1 = require("@azure/core-auth");
8
+ const maps_common_1 = require("@azure/maps-common");
9
+ const index_js_1 = tslib_1.__importDefault(require("./generated/index.js"));
10
+ const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
11
+ function MapsSearch(credential, clientIdOrOptions = {}, maybeOptions = {}) {
12
+ const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
13
+ /**
14
+ * maps service requires a header "ms-x-client-id", which is different from the standard Microsoft Entra ID.
15
+ * So we need to do our own implementation.
16
+ * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication
17
+ */
18
+ if ((0, core_auth_1.isTokenCredential)(credential)) {
19
+ const clientId = typeof clientIdOrOptions === "string" ? clientIdOrOptions : "";
20
+ if (!clientId) {
21
+ throw Error("Client id is needed for TokenCredential");
22
+ }
23
+ const client = (0, index_js_1.default)(undefined, options);
24
+ client.pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({
25
+ credential,
26
+ scopes: "https://atlas.microsoft.com/.default",
27
+ }));
28
+ client.pipeline.addPolicy((0, maps_common_1.createMapsClientIdPolicy)(clientId));
29
+ return client;
30
+ }
31
+ if ((0, core_auth_1.isSASCredential)(credential)) {
32
+ const client = (0, index_js_1.default)(undefined, options);
33
+ client.pipeline.addPolicy({
34
+ name: "mapsSASCredentialPolicy",
35
+ async sendRequest(request, next) {
36
+ request.headers.set("Authorization", `jwt-sas ${credential.signature}`);
37
+ return next(request);
38
+ },
39
+ });
40
+ return client;
41
+ }
42
+ return (0, index_js_1.default)(credential, options);
43
+ }
44
+ //# sourceMappingURL=MapsSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapsSearch.js","sourceRoot":"","sources":["../../src/MapsSearch.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqElC,6BAyCC;;AA1GD,gDAAsE;AACtE,oDAA8D;AAE9D,4EAAgD;AAChD,kEAA4E;AA6D5E,SAAwB,UAAU,CAChC,UAAqE,EACrE,oBAA4C,EAAE,EAC9C,eAA8B,EAAE;IAEhC,MAAM,OAAO,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAEzF;;;;OAIG;IACH,IAAI,IAAA,6BAAiB,EAAC,UAAU,CAAC,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,MAAM,GAAG,IAAA,kBAAY,EAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CACvB,IAAA,oDAA+B,EAAC;YAC9B,UAAU;YACV,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CACH,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAA,sCAAwB,EAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,IAAA,2BAAe,EAAC,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,IAAA,kBAAY,EAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACxB,IAAI,EAAE,yBAAyB;YAC/B,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;gBAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,WAAW,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;gBACxE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,IAAA,kBAAY,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport type { AzureKeyCredential, AzureSASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsSearchClient } from \"./generated/index.js\";\nimport createClient from \"./generated/index.js\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsSearchClient from a subscription key.\n *\n * @example\n * ```ts snippet:ReadmeSampleCreateClient_SubscriptionKey\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n * import MapsSearch from \"@azure-rest/maps-search\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsSearch(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Search Client\n */\nexport default function MapsSearch(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsSearchClient;\n/**\n * Creates an instance of MapsSearch from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts snippet:ReadmeSampleCreateClient_TokenCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import MapsSearch from \"@azure-rest/maps-search\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsSearch(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Search Client\n */\nexport default function MapsSearch(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsSearchClient;\n/**\n * Creates an instance of MapsSearch from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts snippet:ReadmeSampleCreateClient_SASToken\n * import { AzureSASCredential } from \"@azure/core-auth\";\n * import MapsSearch from \"@azure-rest/maps-search\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsSearch(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Search Client\n */\nexport default function MapsSearch(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsSearchClient;\nexport default function MapsSearch(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsSearchClient {\n const options = typeof clientIdOrOptions === \"string\" ? maybeOptions : clientIdOrOptions;\n\n /**\n * maps service requires a header \"ms-x-client-id\", which is different from the standard Microsoft Entra ID.\n * So we need to do our own implementation.\n * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication\n */\n if (isTokenCredential(credential)) {\n const clientId = typeof clientIdOrOptions === \"string\" ? clientIdOrOptions : \"\";\n if (!clientId) {\n throw Error(\"Client id is needed for TokenCredential\");\n }\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: \"https://atlas.microsoft.com/.default\",\n }),\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n\n if (isSASCredential(credential)) {\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy({\n name: \"mapsSASCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", `jwt-sas ${credential.signature}`);\n return next(request);\n },\n });\n return client;\n }\n\n return createClient(credential, options);\n}\n"]}
@@ -0,0 +1,137 @@
1
+ import { SearchGetGeocodingParameters, SearchGetGeocodingBatchParameters, SearchGetPolygonParameters, SearchGetReverseGeocodingParameters, SearchGetReverseGeocodingBatchParameters } from "./parameters.js";
2
+ import { SearchGetGeocoding200Response, SearchGetGeocodingDefaultResponse, SearchGetGeocodingBatch200Response, SearchGetGeocodingBatchDefaultResponse, SearchGetPolygon200Response, SearchGetPolygonDefaultResponse, SearchGetReverseGeocoding200Response, SearchGetReverseGeocodingDefaultResponse, SearchGetReverseGeocodingBatch200Response, SearchGetReverseGeocodingBatchDefaultResponse } from "./responses.js";
3
+ import { Client, StreamableMethod } from "@azure-rest/core-client";
4
+ export interface GetGeocoding {
5
+ /**
6
+ *
7
+ * The `Get Geocoding` API is an HTTP `GET` request that returns the longitude and latitude coordinates of the location being searched.
8
+ *
9
+ * In many cases, the complete search service might be too much, for instance if you are only interested in traditional geocoding. Search can also be accessed for address look up exclusively. The geocoding is performed by hitting the geocoding endpoint with just the address or partial address in question. The geocoding search index will be queried for everything above the street level data. No Point of Interest (POIs) will be returned. Note that the geocoder is very tolerant of typos and incomplete addresses. It will also handle everything from exact street addresses or street or intersections as well as higher level geographies such as city centers, counties and states. The response also returns detailed address properties such as street, postal code, municipality, and country/region information.
10
+ */
11
+ get(options?: SearchGetGeocodingParameters): StreamableMethod<SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse>;
12
+ }
13
+ export interface GetGeocodingBatch {
14
+ /**
15
+ *
16
+ * The `Get Geocoding Batch` API is an HTTP `POST` request that sends batches of up to **100** queries to the [Geocoding](/rest/api/maps/search/get-geocoding) API in a single request.
17
+ *
18
+ * ### Submit Synchronous Batch Request
19
+ * The Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to **100** for this API.
20
+ * ```
21
+ * POST https://atlas.microsoft.com/geocode:batch?api-version=2023-06-01
22
+ * ```
23
+ * ### POST Body for Batch Request
24
+ * To send the _geocoding_ queries you will use a `POST` request where the request body will contain the `batchItems` array in `json` format and the `Content-Type` header will be set to `application/json`. Here's a sample request body containing 2 _geocoding_ queries:
25
+ *
26
+ *
27
+ * ```
28
+ * {
29
+ * "batchItems": [
30
+ * {
31
+ * "addressLine": "One, Microsoft Way, Redmond, WA 98052",
32
+ * "top": 2
33
+ * },
34
+ * {
35
+ * "addressLine": "Pike Pl",
36
+ * "adminDistrict": "WA",
37
+ * "locality": "Seattle",
38
+ * "top": 3
39
+ * }
40
+ * ]
41
+ * }
42
+ * ```
43
+ *
44
+ * A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](/rest/api/maps/search/get-geocoding#uri-parameters).
45
+ *
46
+ *
47
+ * The batch should contain at least **1** query.
48
+ *
49
+ *
50
+ * ### Batch Response Model
51
+ * The batch response contains a `summary` component that indicates the `totalRequests` that were part of the original batch request and `successfulRequests` i.e. queries which were executed successfully. The batch response also includes a `batchItems` array which contains a response for each and every query in the batch request. The `batchItems` will contain the results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types:
52
+ *
53
+ * - [`GeocodingResponse`](/rest/api/maps/search/get-geocoding#geocodingresponse) - If the query completed successfully.
54
+ *
55
+ * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
56
+ *
57
+ *
58
+ *
59
+ */
60
+ post(options: SearchGetGeocodingBatchParameters): StreamableMethod<SearchGetGeocodingBatch200Response | SearchGetGeocodingBatchDefaultResponse>;
61
+ }
62
+ export interface GetPolygon {
63
+ /**
64
+ *
65
+ * The `Get Polygon` API is an HTTP `GET` request that supplies polygon data of a geographical area outline such as a city or a country region.
66
+ */
67
+ get(options: SearchGetPolygonParameters): StreamableMethod<SearchGetPolygon200Response | SearchGetPolygonDefaultResponse>;
68
+ }
69
+ export interface GetReverseGeocoding {
70
+ /**
71
+ *
72
+ * The `Get Reverse Geocoding` API is an HTTP `GET` request used to translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Useful in tracking applications where you receive a GPS feed from the device or asset and wish to know the address associated with the coordinates. This endpoint will return address information for a given coordinate.
73
+ */
74
+ get(options: SearchGetReverseGeocodingParameters): StreamableMethod<SearchGetReverseGeocoding200Response | SearchGetReverseGeocodingDefaultResponse>;
75
+ }
76
+ export interface GetReverseGeocodingBatch {
77
+ /**
78
+ *
79
+ * The `Get Reverse Geocoding Batch` API is an HTTP `POST` request that sends batches of up to **100** queries to [Reverse Geocoding](/rest/api/maps/search/get-reverse-geocoding) API using a single request.
80
+ *
81
+ * ### Submit Synchronous Batch Request
82
+ * The Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to **100** for this API.
83
+ * ```
84
+ * POST https://atlas.microsoft.com/reverseGeocode:batch?api-version=2023-06-01
85
+ * ```
86
+ * ### POST Body for Batch Request
87
+ * To send the _reverse geocoding_ queries you will use a `POST` request where the request body will contain the `batchItems` array in `json` format and the `Content-Type` header will be set to `application/json`. Here's a sample request body containing 2 _reverse geocoding_ queries:
88
+ *
89
+ *
90
+ * ```
91
+ * {
92
+ * "batchItems": [
93
+ * {
94
+ * "coordinates": [-122.128275, 47.639429],
95
+ * "resultTypes": ["Address", "PopulatedPlace"]
96
+ * },
97
+ * {
98
+ * "coordinates": [-122.341979399674, 47.6095253501216]
99
+ * }
100
+ * ]
101
+ * }
102
+ * ```
103
+ *
104
+ * A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](/rest/api/maps/search/get-reverse-geocoding#uri-parameters).
105
+ *
106
+ *
107
+ * The batch should contain at least **1** query.
108
+ *
109
+ *
110
+ * ### Batch Response Model
111
+ * The batch response contains a `summary` component that indicates the `totalRequests` that were part of the original batch request and `successfulRequests` i.e. queries which were executed successfully. The batch response also includes a `batchItems` array which contains a response for each and every query in the batch request. The `batchItems` will contain the results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types:
112
+ *
113
+ * - [`GeocodingResponse`](/rest/api/maps/search/get-reverse-geocoding#geocodingresponse) - If the query completed successfully.
114
+ *
115
+ * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
116
+ *
117
+ *
118
+ *
119
+ */
120
+ post(options: SearchGetReverseGeocodingBatchParameters): StreamableMethod<SearchGetReverseGeocodingBatch200Response | SearchGetReverseGeocodingBatchDefaultResponse>;
121
+ }
122
+ export interface Routes {
123
+ /** Resource for '/geocode' has methods for the following verbs: get */
124
+ (path: "/geocode"): GetGeocoding;
125
+ /** Resource for '/geocode:batch' has methods for the following verbs: post */
126
+ (path: "/geocode:batch"): GetGeocodingBatch;
127
+ /** Resource for '/search/polygon' has methods for the following verbs: get */
128
+ (path: "/search/polygon"): GetPolygon;
129
+ /** Resource for '/reverseGeocode' has methods for the following verbs: get */
130
+ (path: "/reverseGeocode"): GetReverseGeocoding;
131
+ /** Resource for '/reverseGeocode:batch' has methods for the following verbs: post */
132
+ (path: "/reverseGeocode:batch"): GetReverseGeocodingBatch;
133
+ }
134
+ export type MapsSearchClient = Client & {
135
+ path: Routes;
136
+ };
137
+ //# sourceMappingURL=clientDefinitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../../src/generated/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,4BAA4B,EAC5B,iCAAiC,EACjC,0BAA0B,EAC1B,mCAAmC,EACnC,wCAAwC,EACzC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,kCAAkC,EAClC,sCAAsC,EACtC,2BAA2B,EAC3B,+BAA+B,EAC/B,oCAAoC,EACpC,wCAAwC,EACxC,yCAAyC,EACzC,6CAA6C,EAC9C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,4BAA4B,GACrC,gBAAgB,CACjB,6BAA6B,GAAG,iCAAiC,CAClE,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,IAAI,CACF,OAAO,EAAE,iCAAiC,GACzC,gBAAgB,CACjB,kCAAkC,GAAG,sCAAsC,CAC5E,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,GAAG,CACD,OAAO,EAAE,0BAA0B,GAClC,gBAAgB,CACjB,2BAA2B,GAAG,+BAA+B,CAC9D,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,GAAG,CACD,OAAO,EAAE,mCAAmC,GAC3C,gBAAgB,CACf,oCAAoC,GACpC,wCAAwC,CAC3C,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,IAAI,CACF,OAAO,EAAE,wCAAwC,GAChD,gBAAgB,CACf,yCAAyC,GACzC,6CAA6C,CAChD,CAAC;CACH;AAED,MAAM,WAAW,MAAM;IACrB,uEAAuE;IACvE,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACjC,8EAA8E;IAC9E,CAAC,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;IAC5C,8EAA8E;IAC9E,CAAC,IAAI,EAAE,iBAAiB,GAAG,UAAU,CAAC;IACtC,8EAA8E;IAC9E,CAAC,IAAI,EAAE,iBAAiB,GAAG,mBAAmB,CAAC;IAC/C,qFAAqF;IACrF,CAAC,IAAI,EAAE,uBAAuB,GAAG,wBAAwB,CAAC;CAC3D;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=clientDefinitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../../src/generated/clientDefinitions.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n SearchGetGeocodingParameters,\n SearchGetGeocodingBatchParameters,\n SearchGetPolygonParameters,\n SearchGetReverseGeocodingParameters,\n SearchGetReverseGeocodingBatchParameters,\n} from \"./parameters.js\";\nimport {\n SearchGetGeocoding200Response,\n SearchGetGeocodingDefaultResponse,\n SearchGetGeocodingBatch200Response,\n SearchGetGeocodingBatchDefaultResponse,\n SearchGetPolygon200Response,\n SearchGetPolygonDefaultResponse,\n SearchGetReverseGeocoding200Response,\n SearchGetReverseGeocodingDefaultResponse,\n SearchGetReverseGeocodingBatch200Response,\n SearchGetReverseGeocodingBatchDefaultResponse,\n} from \"./responses.js\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetGeocoding {\n /**\n *\n * The `Get Geocoding` API is an HTTP `GET` request that returns the longitude and latitude coordinates of the location being searched.\n *\n * In many cases, the complete search service might be too much, for instance if you are only interested in traditional geocoding. Search can also be accessed for address look up exclusively. The geocoding is performed by hitting the geocoding endpoint with just the address or partial address in question. The geocoding search index will be queried for everything above the street level data. No Point of Interest (POIs) will be returned. Note that the geocoder is very tolerant of typos and incomplete addresses. It will also handle everything from exact street addresses or street or intersections as well as higher level geographies such as city centers, counties and states. The response also returns detailed address properties such as street, postal code, municipality, and country/region information.\n */\n get(\n options?: SearchGetGeocodingParameters,\n ): StreamableMethod<\n SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse\n >;\n}\n\nexport interface GetGeocodingBatch {\n /**\n *\n * The `Get Geocoding Batch` API is an HTTP `POST` request that sends batches of up to **100** queries to the [Geocoding](/rest/api/maps/search/get-geocoding) API in a single request.\n *\n * ### Submit Synchronous Batch Request\n * The Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to **100** for this API.\n * ```\n * POST https://atlas.microsoft.com/geocode:batch?api-version=2023-06-01\n * ```\n * ### POST Body for Batch Request\n * To send the _geocoding_ queries you will use a `POST` request where the request body will contain the `batchItems` array in `json` format and the `Content-Type` header will be set to `application/json`. Here's a sample request body containing 2 _geocoding_ queries:\n *\n *\n * ```\n * {\n * \"batchItems\": [\n * {\n * \"addressLine\": \"One, Microsoft Way, Redmond, WA 98052\",\n * \"top\": 2\n * },\n * {\n * \"addressLine\": \"Pike Pl\",\n * \"adminDistrict\": \"WA\",\n * \"locality\": \"Seattle\",\n * \"top\": 3\n * }\n * ]\n * }\n * ```\n *\n * A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](/rest/api/maps/search/get-geocoding#uri-parameters).\n *\n *\n * The batch should contain at least **1** query.\n *\n *\n * ### Batch Response Model\n * The batch response contains a `summary` component that indicates the `totalRequests` that were part of the original batch request and `successfulRequests` i.e. queries which were executed successfully. The batch response also includes a `batchItems` array which contains a response for each and every query in the batch request. The `batchItems` will contain the results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types:\n *\n * - [`GeocodingResponse`](/rest/api/maps/search/get-geocoding#geocodingresponse) - If the query completed successfully.\n *\n * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.\n *\n *\n *\n */\n post(\n options: SearchGetGeocodingBatchParameters,\n ): StreamableMethod<\n SearchGetGeocodingBatch200Response | SearchGetGeocodingBatchDefaultResponse\n >;\n}\n\nexport interface GetPolygon {\n /**\n *\n * The `Get Polygon` API is an HTTP `GET` request that supplies polygon data of a geographical area outline such as a city or a country region.\n */\n get(\n options: SearchGetPolygonParameters,\n ): StreamableMethod<\n SearchGetPolygon200Response | SearchGetPolygonDefaultResponse\n >;\n}\n\nexport interface GetReverseGeocoding {\n /**\n *\n * The `Get Reverse Geocoding` API is an HTTP `GET` request used to translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Useful in tracking applications where you receive a GPS feed from the device or asset and wish to know the address associated with the coordinates. This endpoint will return address information for a given coordinate.\n */\n get(\n options: SearchGetReverseGeocodingParameters,\n ): StreamableMethod<\n | SearchGetReverseGeocoding200Response\n | SearchGetReverseGeocodingDefaultResponse\n >;\n}\n\nexport interface GetReverseGeocodingBatch {\n /**\n *\n * The `Get Reverse Geocoding Batch` API is an HTTP `POST` request that sends batches of up to **100** queries to [Reverse Geocoding](/rest/api/maps/search/get-reverse-geocoding) API using a single request.\n *\n * ### Submit Synchronous Batch Request\n * The Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to **100** for this API.\n * ```\n * POST https://atlas.microsoft.com/reverseGeocode:batch?api-version=2023-06-01\n * ```\n * ### POST Body for Batch Request\n * To send the _reverse geocoding_ queries you will use a `POST` request where the request body will contain the `batchItems` array in `json` format and the `Content-Type` header will be set to `application/json`. Here's a sample request body containing 2 _reverse geocoding_ queries:\n *\n *\n * ```\n * {\n * \"batchItems\": [\n * {\n * \"coordinates\": [-122.128275, 47.639429],\n * \"resultTypes\": [\"Address\", \"PopulatedPlace\"]\n * },\n * {\n * \"coordinates\": [-122.341979399674, 47.6095253501216]\n * }\n * ]\n * }\n * ```\n *\n * A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](/rest/api/maps/search/get-reverse-geocoding#uri-parameters).\n *\n *\n * The batch should contain at least **1** query.\n *\n *\n * ### Batch Response Model\n * The batch response contains a `summary` component that indicates the `totalRequests` that were part of the original batch request and `successfulRequests` i.e. queries which were executed successfully. The batch response also includes a `batchItems` array which contains a response for each and every query in the batch request. The `batchItems` will contain the results in the exact same order the original queries were sent in the batch request. Each item is of one of the following types:\n *\n * - [`GeocodingResponse`](/rest/api/maps/search/get-reverse-geocoding#geocodingresponse) - If the query completed successfully.\n *\n * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.\n *\n *\n *\n */\n post(\n options: SearchGetReverseGeocodingBatchParameters,\n ): StreamableMethod<\n | SearchGetReverseGeocodingBatch200Response\n | SearchGetReverseGeocodingBatchDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/geocode' has methods for the following verbs: get */\n (path: \"/geocode\"): GetGeocoding;\n /** Resource for '/geocode:batch' has methods for the following verbs: post */\n (path: \"/geocode:batch\"): GetGeocodingBatch;\n /** Resource for '/search/polygon' has methods for the following verbs: get */\n (path: \"/search/polygon\"): GetPolygon;\n /** Resource for '/reverseGeocode' has methods for the following verbs: get */\n (path: \"/reverseGeocode\"): GetReverseGeocoding;\n /** Resource for '/reverseGeocode:batch' has methods for the following verbs: post */\n (path: \"/reverseGeocode:batch\"): GetReverseGeocodingBatch;\n}\n\nexport type MapsSearchClient = Client & {\n path: Routes;\n};\n"]}
@@ -0,0 +1,10 @@
1
+ import MapsSearchClient from "./mapsSearchClient.js";
2
+ export * from "./mapsSearchClient.js";
3
+ export * from "./parameters.js";
4
+ export * from "./responses.js";
5
+ export * from "./clientDefinitions.js";
6
+ export * from "./isUnexpected.js";
7
+ export * from "./models.js";
8
+ export * from "./outputModels.js";
9
+ export default MapsSearchClient;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAGA,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AAErD,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const tslib_1 = require("tslib");
6
+ const mapsSearchClient_js_1 = tslib_1.__importDefault(require("./mapsSearchClient.js"));
7
+ tslib_1.__exportStar(require("./mapsSearchClient.js"), exports);
8
+ tslib_1.__exportStar(require("./parameters.js"), exports);
9
+ tslib_1.__exportStar(require("./responses.js"), exports);
10
+ tslib_1.__exportStar(require("./clientDefinitions.js"), exports);
11
+ tslib_1.__exportStar(require("./isUnexpected.js"), exports);
12
+ tslib_1.__exportStar(require("./models.js"), exports);
13
+ tslib_1.__exportStar(require("./outputModels.js"), exports);
14
+ exports.default = mapsSearchClient_js_1.default;
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wFAAqD;AAErD,gEAAsC;AACtC,0DAAgC;AAChC,yDAA+B;AAC/B,iEAAuC;AACvC,4DAAkC;AAClC,sDAA4B;AAC5B,4DAAkC;AAElC,kBAAe,6BAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsSearchClient from \"./mapsSearchClient.js\";\n\nexport * from \"./mapsSearchClient.js\";\nexport * from \"./parameters.js\";\nexport * from \"./responses.js\";\nexport * from \"./clientDefinitions.js\";\nexport * from \"./isUnexpected.js\";\nexport * from \"./models.js\";\nexport * from \"./outputModels.js\";\n\nexport default MapsSearchClient;\n"]}
@@ -0,0 +1,7 @@
1
+ import { SearchGetGeocoding200Response, SearchGetGeocodingDefaultResponse, SearchGetGeocodingBatch200Response, SearchGetGeocodingBatchDefaultResponse, SearchGetPolygon200Response, SearchGetPolygonDefaultResponse, SearchGetReverseGeocoding200Response, SearchGetReverseGeocodingDefaultResponse, SearchGetReverseGeocodingBatch200Response, SearchGetReverseGeocodingBatchDefaultResponse } from "./responses.js";
2
+ export declare function isUnexpected(response: SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse): response is SearchGetGeocodingDefaultResponse;
3
+ export declare function isUnexpected(response: SearchGetGeocodingBatch200Response | SearchGetGeocodingBatchDefaultResponse): response is SearchGetGeocodingBatchDefaultResponse;
4
+ export declare function isUnexpected(response: SearchGetPolygon200Response | SearchGetPolygonDefaultResponse): response is SearchGetPolygonDefaultResponse;
5
+ export declare function isUnexpected(response: SearchGetReverseGeocoding200Response | SearchGetReverseGeocodingDefaultResponse): response is SearchGetReverseGeocodingDefaultResponse;
6
+ export declare function isUnexpected(response: SearchGetReverseGeocodingBatch200Response | SearchGetReverseGeocodingBatchDefaultResponse): response is SearchGetReverseGeocodingBatchDefaultResponse;
7
+ //# sourceMappingURL=isUnexpected.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUnexpected.d.ts","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,kCAAkC,EAClC,sCAAsC,EACtC,2BAA2B,EAC3B,+BAA+B,EAC/B,oCAAoC,EACpC,wCAAwC,EACxC,yCAAyC,EACzC,6CAA6C,EAC9C,MAAM,gBAAgB,CAAC;AAUxB,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,6BAA6B,GAAG,iCAAiC,GAC1E,QAAQ,IAAI,iCAAiC,CAAC;AACjD,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,kCAAkC,GAClC,sCAAsC,GACzC,QAAQ,IAAI,sCAAsC,CAAC;AACtD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,2BAA2B,GAAG,+BAA+B,GACtE,QAAQ,IAAI,+BAA+B,CAAC;AAC/C,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,oCAAoC,GACpC,wCAAwC,GAC3C,QAAQ,IAAI,wCAAwC,CAAC;AACxD,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,yCAAyC,GACzC,6CAA6C,GAChD,QAAQ,IAAI,6CAA6C,CAAC"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.isUnexpected = isUnexpected;
6
+ const responseMap = {
7
+ "GET /geocode": ["200"],
8
+ "POST /geocode:batch": ["200"],
9
+ "GET /search/polygon": ["200"],
10
+ "GET /reverseGeocode": ["200"],
11
+ "POST /reverseGeocode:batch": ["200"],
12
+ };
13
+ function isUnexpected(response) {
14
+ const lroOriginal = response.headers["x-ms-original-url"];
15
+ const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
16
+ const method = response.request.method;
17
+ let pathDetails = responseMap[`${method} ${url.pathname}`];
18
+ if (!pathDetails) {
19
+ pathDetails = getParametrizedPathSuccess(method, url.pathname);
20
+ }
21
+ return !pathDetails.includes(response.status);
22
+ }
23
+ function getParametrizedPathSuccess(method, path) {
24
+ var _a, _b, _c, _d;
25
+ const pathParts = path.split("/");
26
+ // Traverse list to match the longest candidate
27
+ // matchedLen: the length of candidate path
28
+ // matchedValue: the matched status code array
29
+ let matchedLen = -1, matchedValue = [];
30
+ // Iterate the responseMap to find a match
31
+ for (const [key, value] of Object.entries(responseMap)) {
32
+ // Extracting the path from the map key which is in format
33
+ // GET /path/foo
34
+ if (!key.startsWith(method)) {
35
+ continue;
36
+ }
37
+ const candidatePath = getPathFromMapKey(key);
38
+ // Get each part of the url path
39
+ const candidateParts = candidatePath.split("/");
40
+ // track if we have found a match to return the values found.
41
+ let found = true;
42
+ for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
43
+ if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
44
+ ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
45
+ const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
46
+ // If the current part of the candidate is a "template" part
47
+ // Try to use the suffix of pattern to match the path
48
+ // {guid} ==> $
49
+ // {guid}:export ==> :export$
50
+ const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
51
+ if (!isMatched) {
52
+ found = false;
53
+ break;
54
+ }
55
+ continue;
56
+ }
57
+ // If the candidate part is not a template and
58
+ // the parts don't match mark the candidate as not found
59
+ // to move on with the next candidate path.
60
+ if (candidateParts[i] !== pathParts[j]) {
61
+ found = false;
62
+ break;
63
+ }
64
+ }
65
+ // We finished evaluating the current candidate parts
66
+ // Update the matched value if and only if we found the longer pattern
67
+ if (found && candidatePath.length > matchedLen) {
68
+ matchedLen = candidatePath.length;
69
+ matchedValue = value;
70
+ }
71
+ }
72
+ return matchedValue;
73
+ }
74
+ function getPathFromMapKey(mapKey) {
75
+ const pathStart = mapKey.indexOf("/");
76
+ return mapKey.slice(pathStart);
77
+ }
78
+ //# sourceMappingURL=isUnexpected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA4ClC,oCA0BC;AAvDD,MAAM,WAAW,GAA6B;IAC5C,cAAc,EAAE,CAAC,KAAK,CAAC;IACvB,qBAAqB,EAAE,CAAC,KAAK,CAAC;IAC9B,qBAAqB,EAAE,CAAC,KAAK,CAAC;IAC9B,qBAAqB,EAAE,CAAC,KAAK,CAAC;IAC9B,4BAA4B,EAAE,CAAC,KAAK,CAAC;CACtC,CAAC;AAuBF,SAAgB,YAAY,CAC1B,QAUiD;IAOjD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,0BAA0B,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,0BAA0B,CAAC,MAAc,EAAE,IAAY;;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,+CAA+C;IAC/C,2CAA2C;IAC3C,8CAA8C;IAC9C,IAAI,UAAU,GAAG,CAAC,CAAC,EACjB,YAAY,GAAa,EAAE,CAAC;IAE9B,0CAA0C;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACvD,0DAA0D;QAC1D,gBAAgB;QAChB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,SAAS;QACX,CAAC;QACD,MAAM,aAAa,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC7C,gCAAgC;QAChC,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhD,6DAA6D;QAC7D,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,KACE,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3D,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAChB,CAAC,EAAE,EAAE,CAAC,EAAE,EACR,CAAC;YACD,IACE,CAAA,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,UAAU,CAAC,GAAG,CAAC;gBAClC,CAAA,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,OAAO,CAAC,GAAG,CAAC,MAAK,CAAC,CAAC,EACtC,CAAC;gBACD,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAC1B,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAC1C,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;gBAE3B,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n SearchGetGeocoding200Response,\n SearchGetGeocodingDefaultResponse,\n SearchGetGeocodingBatch200Response,\n SearchGetGeocodingBatchDefaultResponse,\n SearchGetPolygon200Response,\n SearchGetPolygonDefaultResponse,\n SearchGetReverseGeocoding200Response,\n SearchGetReverseGeocodingDefaultResponse,\n SearchGetReverseGeocodingBatch200Response,\n SearchGetReverseGeocodingBatchDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /geocode\": [\"200\"],\n \"POST /geocode:batch\": [\"200\"],\n \"GET /search/polygon\": [\"200\"],\n \"GET /reverseGeocode\": [\"200\"],\n \"POST /reverseGeocode:batch\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse,\n): response is SearchGetGeocodingDefaultResponse;\nexport function isUnexpected(\n response:\n | SearchGetGeocodingBatch200Response\n | SearchGetGeocodingBatchDefaultResponse,\n): response is SearchGetGeocodingBatchDefaultResponse;\nexport function isUnexpected(\n response: SearchGetPolygon200Response | SearchGetPolygonDefaultResponse,\n): response is SearchGetPolygonDefaultResponse;\nexport function isUnexpected(\n response:\n | SearchGetReverseGeocoding200Response\n | SearchGetReverseGeocodingDefaultResponse,\n): response is SearchGetReverseGeocodingDefaultResponse;\nexport function isUnexpected(\n response:\n | SearchGetReverseGeocodingBatch200Response\n | SearchGetReverseGeocodingBatchDefaultResponse,\n): response is SearchGetReverseGeocodingBatchDefaultResponse;\nexport function isUnexpected(\n response:\n | SearchGetGeocoding200Response\n | SearchGetGeocodingDefaultResponse\n | SearchGetGeocodingBatch200Response\n | SearchGetGeocodingBatchDefaultResponse\n | SearchGetPolygon200Response\n | SearchGetPolygonDefaultResponse\n | SearchGetReverseGeocoding200Response\n | SearchGetReverseGeocodingDefaultResponse\n | SearchGetReverseGeocodingBatch200Response\n | SearchGetReverseGeocodingBatchDefaultResponse,\n): response is\n | SearchGetGeocodingDefaultResponse\n | SearchGetGeocodingBatchDefaultResponse\n | SearchGetPolygonDefaultResponse\n | SearchGetReverseGeocodingDefaultResponse\n | SearchGetReverseGeocodingBatchDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (\n let i = candidateParts.length - 1, j = pathParts.length - 1;\n i >= 1 && j >= 1;\n i--, j--\n ) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.indexOf(\"}\") !== -1\n ) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(\n `${candidateParts[i]?.slice(start, end)}`,\n ).test(pathParts[j] || \"\");\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const logger: import("@azure/logger").AzureLogger;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/generated/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAAoC,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.logger = void 0;
6
+ const logger_1 = require("@azure/logger");
7
+ exports.logger = (0, logger_1.createClientLogger)("maps-search");
8
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/generated/logger.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,0CAAmD;AACtC,QAAA,MAAM,GAAG,IAAA,2BAAkB,EAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"maps-search\");\n"]}
@@ -0,0 +1,15 @@
1
+ import { ClientOptions } from "@azure-rest/core-client";
2
+ import { KeyCredential } from "@azure/core-auth";
3
+ import { MapsSearchClient } from "./clientDefinitions.js";
4
+ /** The optional parameters for the client */
5
+ export interface MapsSearchClientOptions extends ClientOptions {
6
+ /** The api version option of the client */
7
+ apiVersion?: string;
8
+ }
9
+ /**
10
+ * Initialize a new instance of `MapsSearchClient`
11
+ * @param credentials - uniquely identify client credential
12
+ * @param options - the parameter for all optional parameters
13
+ */
14
+ export default function createClient(credentials: KeyCredential, { apiVersion, ...options }?: MapsSearchClientOptions): MapsSearchClient;
15
+ //# sourceMappingURL=mapsSearchClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapsSearchClient.d.ts","sourceRoot":"","sources":["../../../src/generated/mapsSearchClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,6CAA6C;AAC7C,MAAM,WAAW,uBAAwB,SAAQ,aAAa;IAC5D,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAAW,EAAE,aAAa,EAC1B,EAAE,UAAyB,EAAE,GAAG,OAAO,EAAE,GAAE,uBAA4B,GACtE,gBAAgB,CA6ClB"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = createClient;
6
+ const tslib_1 = require("tslib");
7
+ const core_client_1 = require("@azure-rest/core-client");
8
+ const logger_js_1 = require("./logger.js");
9
+ /**
10
+ * Initialize a new instance of `MapsSearchClient`
11
+ * @param credentials - uniquely identify client credential
12
+ * @param options - the parameter for all optional parameters
13
+ */
14
+ function createClient(credentials, _a = {}) {
15
+ var _b, _c, _d, _e, _f, _g;
16
+ var { apiVersion = "2023-06-01" } = _a, options = tslib_1.__rest(_a, ["apiVersion"]);
17
+ const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `https://atlas.microsoft.com`;
18
+ const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.2`;
19
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
20
+ ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
21
+ : `${userAgentInfo}`;
22
+ options = Object.assign(Object.assign({}, options), { userAgentOptions: {
23
+ userAgentPrefix,
24
+ }, loggingOptions: {
25
+ logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger_js_1.logger.info,
26
+ }, credentials: {
27
+ apiKeyHeaderName: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.apiKeyHeaderName) !== null && _g !== void 0 ? _g : "subscription-key",
28
+ } });
29
+ const client = (0, core_client_1.getClient)(endpointUrl, credentials, options);
30
+ client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
31
+ client.pipeline.addPolicy({
32
+ name: "ClientApiVersionPolicy",
33
+ sendRequest: (req, next) => {
34
+ // Use the apiVersion defined in request url directly
35
+ // Append one if there is no apiVersion and we have one at client options
36
+ const url = new URL(req.url);
37
+ if (!url.searchParams.get("api-version") && apiVersion) {
38
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
39
+ }
40
+ return next(req);
41
+ },
42
+ });
43
+ return client;
44
+ }
45
+ //# sourceMappingURL=mapsSearchClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapsSearchClient.js","sourceRoot":"","sources":["../../../src/generated/mapsSearchClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAkBlC,+BAgDC;;AAhED,yDAAmE;AACnE,2CAAqC;AAUrC;;;;GAIG;AACH,SAAwB,YAAY,CAClC,WAA0B,EAC1B,KAAqE,EAAE;;QAAvE,EAAE,UAAU,GAAG,YAAY,OAA4C,EAAvC,OAAO,sBAAvC,cAAyC,CAAF;IAEvC,MAAM,WAAW,GACf,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,6BAA6B,CAAC;IACvE,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,kBAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,gBAAgB,EACd,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,gBAAgB,mCAAI,kBAAkB;SAC9D,GACF,CAAC;IACF,MAAM,MAAM,GAAG,IAAA,uBAAS,EACtB,WAAW,EACX,WAAW,EACX,OAAO,CACY,CAAC;IAEtB,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsSearchClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface MapsSearchClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `MapsSearchClient`\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n credentials: KeyCredential,\n { apiVersion = \"2023-06-01\", ...options }: MapsSearchClientOptions = {},\n): MapsSearchClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;\n const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n apiKeyHeaderName:\n options.credentials?.apiKeyHeaderName ?? \"subscription-key\",\n },\n };\n const client = getClient(\n endpointUrl,\n credentials,\n options,\n ) as MapsSearchClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
@@ -0,0 +1,97 @@
1
+ /** The list of address geocoding queries/requests to process. The list can contain a max of 100 queries and must contain at least 1 query. */
2
+ export interface GeocodingBatchRequestBody {
3
+ /** The list of queries to process. */
4
+ batchItems?: Array<GeocodingBatchRequestItem>;
5
+ }
6
+ /** Batch Query object */
7
+ export interface GeocodingBatchRequestItem {
8
+ /** id of the request which would show in corresponding batchItem */
9
+ optionalId?: string;
10
+ /** Maximum number of responses that will be returned. Default: 5, minimum: 1 and maximum: 20. */
11
+ top?: number;
12
+ /** A string that contains information about a location, such as an address or landmark name. */
13
+ query?: string;
14
+ /**
15
+ * The official street line of an address relative to the area, as specified by the locality, or postalCode, properties. Typical use of this element would be to provide a street address or any official address.
16
+ *
17
+ * **If query is given, should not use this parameter.**
18
+ */
19
+ addressLine?: string;
20
+ /**
21
+ * Signal for the geocoding result to an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) that is specified e.g. FR./
22
+ *
23
+ * **If query is given, should not use this parameter.**
24
+ */
25
+ countryRegion?: string;
26
+ /**
27
+ * A rectangular area on the earth defined as a bounding box object. The sides of the rectangles are defined by longitude and latitude values. For more information, see Location and Area Types. When you specify this parameter, the geographical area is taken into account when computing the results of a location query.
28
+ *
29
+ * Example: [lon1, lat1, lon2, lat2]
30
+ */
31
+ bbox?: Array<number>;
32
+ /** A string that specifies an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). This will alter Geopolitical disputed borders and labels to align with the specified user region. */
33
+ view?: string;
34
+ /** A point on the earth specified as a longitude and latitude. When you specify this parameter, the user’s location is taken into account and the results returned may be more relevant to the user. Example: [lon, lat] */
35
+ coordinates?: Array<number>;
36
+ /**
37
+ * The country subdivision portion of an address, such as WA.
38
+ *
39
+ * **If query is given, should not use this parameter.**
40
+ */
41
+ adminDistrict?: string;
42
+ /**
43
+ * The county for the structured address, such as King.
44
+ *
45
+ * **If query is given, should not use this parameter.**
46
+ */
47
+ adminDistrict2?: string;
48
+ /**
49
+ * The named area for the structured address.
50
+ *
51
+ * **If query is given, should not use this parameter.**
52
+ */
53
+ adminDistrict3?: string;
54
+ /**
55
+ * The locality portion of an address, such as Seattle.
56
+ *
57
+ * **If query is given, should not use this parameter.**
58
+ */
59
+ locality?: string;
60
+ /**
61
+ * The postal code portion of an address.
62
+ *
63
+ * **If query is given, should not use this parameter.**
64
+ */
65
+ postalCode?: string;
66
+ }
67
+ /** The list of reverse geocoding queries/requests to process. The list can contain a max of 100 queries and must contain at least 1 query. */
68
+ export interface ReverseGeocodingBatchRequestBody {
69
+ /** The list of queries to process. */
70
+ batchItems?: Array<ReverseGeocodingBatchRequestItem>;
71
+ }
72
+ /** Batch Query object */
73
+ export interface ReverseGeocodingBatchRequestItem {
74
+ /** id of the request which would show in corresponding batchItem */
75
+ optionalId?: string;
76
+ /** The coordinates of the location that you want to reverse geocode. Example: [lon,lat] */
77
+ coordinates?: Array<number>;
78
+ /**
79
+ * Specify entity types that you want in the response. Only the types you specify will be returned. If the point cannot be mapped to the entity types you specify, no location information is returned in the response.
80
+ * Default value is all possible entities.
81
+ * A comma separated list of entity types selected from the following options.
82
+ *
83
+ * - Address
84
+ * - Neighborhood
85
+ * - PopulatedPlace
86
+ * - Postcode1
87
+ * - AdminDivision1
88
+ * - AdminDivision2
89
+ * - CountryRegion
90
+ *
91
+ * These entity types are ordered from the most specific entity to the least specific entity. When entities of more than one entity type are found, only the most specific entity is returned. For example, if you specify Address and AdminDistrict1 as entity types and entities were found for both types, only the Address entity information is returned in the response.
92
+ */
93
+ resultTypes?: Array<"Address" | "Neighborhood" | "PopulatedPlace" | "Postcode1" | "AdminDivision1" | "AdminDivision2" | "CountryRegion">;
94
+ /** A string that specifies an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). This will alter Geopolitical disputed borders and labels to align with the specified user region. */
95
+ view?: string;
96
+ }
97
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/generated/models.ts"],"names":[],"mappings":"AAGA,8IAA8I;AAC9I,MAAM,WAAW,yBAAyB;IACxC,sCAAsC;IACtC,UAAU,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;CAC/C;AAED,yBAAyB;AACzB,MAAM,WAAW,yBAAyB;IACxC,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iGAAiG;IACjG,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,+NAA+N;IAC/N,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4NAA4N;IAC5N,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,8IAA8I;AAC9I,MAAM,WAAW,gCAAgC;IAC/C,sCAAsC;IACtC,UAAU,CAAC,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;CACtD;AAED,yBAAyB;AACzB,MAAM,WAAW,gCAAgC;IAC/C,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,KAAK,CACf,SAAS,GACT,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,CAClB,CAAC;IACF,+NAA+N;IAC/N,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/generated/models.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** The list of address geocoding queries/requests to process. The list can contain a max of 100 queries and must contain at least 1 query. */\nexport interface GeocodingBatchRequestBody {\n /** The list of queries to process. */\n batchItems?: Array<GeocodingBatchRequestItem>;\n}\n\n/** Batch Query object */\nexport interface GeocodingBatchRequestItem {\n /** id of the request which would show in corresponding batchItem */\n optionalId?: string;\n /** Maximum number of responses that will be returned. Default: 5, minimum: 1 and maximum: 20. */\n top?: number;\n /** A string that contains information about a location, such as an address or landmark name. */\n query?: string;\n /**\n * The official street line of an address relative to the area, as specified by the locality, or postalCode, properties. Typical use of this element would be to provide a street address or any official address.\n *\n * **If query is given, should not use this parameter.**\n */\n addressLine?: string;\n /**\n * Signal for the geocoding result to an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) that is specified e.g. FR./\n *\n * **If query is given, should not use this parameter.**\n */\n countryRegion?: string;\n /**\n * A rectangular area on the earth defined as a bounding box object. The sides of the rectangles are defined by longitude and latitude values. For more information, see Location and Area Types. When you specify this parameter, the geographical area is taken into account when computing the results of a location query.\n *\n * Example: [lon1, lat1, lon2, lat2]\n */\n bbox?: Array<number>;\n /** A string that specifies an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). This will alter Geopolitical disputed borders and labels to align with the specified user region. */\n view?: string;\n /** A point on the earth specified as a longitude and latitude. When you specify this parameter, the user’s location is taken into account and the results returned may be more relevant to the user. Example: [lon, lat] */\n coordinates?: Array<number>;\n /**\n * The country subdivision portion of an address, such as WA.\n *\n * **If query is given, should not use this parameter.**\n */\n adminDistrict?: string;\n /**\n * The county for the structured address, such as King.\n *\n * **If query is given, should not use this parameter.**\n */\n adminDistrict2?: string;\n /**\n * The named area for the structured address.\n *\n * **If query is given, should not use this parameter.**\n */\n adminDistrict3?: string;\n /**\n * The locality portion of an address, such as Seattle.\n *\n * **If query is given, should not use this parameter.**\n */\n locality?: string;\n /**\n * The postal code portion of an address.\n *\n * **If query is given, should not use this parameter.**\n */\n postalCode?: string;\n}\n\n/** The list of reverse geocoding queries/requests to process. The list can contain a max of 100 queries and must contain at least 1 query. */\nexport interface ReverseGeocodingBatchRequestBody {\n /** The list of queries to process. */\n batchItems?: Array<ReverseGeocodingBatchRequestItem>;\n}\n\n/** Batch Query object */\nexport interface ReverseGeocodingBatchRequestItem {\n /** id of the request which would show in corresponding batchItem */\n optionalId?: string;\n /** The coordinates of the location that you want to reverse geocode. Example: [lon,lat] */\n coordinates?: Array<number>;\n /**\n * Specify entity types that you want in the response. Only the types you specify will be returned. If the point cannot be mapped to the entity types you specify, no location information is returned in the response.\n * Default value is all possible entities.\n * A comma separated list of entity types selected from the following options.\n *\n * - Address\n * - Neighborhood\n * - PopulatedPlace\n * - Postcode1\n * - AdminDivision1\n * - AdminDivision2\n * - CountryRegion\n *\n * These entity types are ordered from the most specific entity to the least specific entity. When entities of more than one entity type are found, only the most specific entity is returned. For example, if you specify Address and AdminDistrict1 as entity types and entities were found for both types, only the Address entity information is returned in the response.\n */\n resultTypes?: Array<\n | \"Address\"\n | \"Neighborhood\"\n | \"PopulatedPlace\"\n | \"Postcode1\"\n | \"AdminDivision1\"\n | \"AdminDivision2\"\n | \"CountryRegion\"\n >;\n /** A string that specifies an [ISO 3166-1 Alpha-2 region/country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). This will alter Geopolitical disputed borders and labels to align with the specified user region. */\n view?: string;\n}\n"]}