@azure-rest/maps-search 2.0.0-alpha.20241111.1 → 2.0.0-alpha.20241113.1

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.
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var coreAuth = require('@azure/core-auth');
6
6
  var mapsCommon = require('@azure/maps-common');
7
+ var tslib = require('tslib');
7
8
  var coreClient = require('@azure-rest/core-client');
8
9
  var logger$1 = require('@azure/logger');
9
10
  var coreRestPipeline = require('@azure/core-rest-pipeline');
@@ -19,22 +20,35 @@ const logger = logger$1.createClientLogger("maps-search");
19
20
  * @param credentials - uniquely identify client credential
20
21
  * @param options - the parameter for all optional parameters
21
22
  */
22
- function createClient(credentials, options = {}) {
23
- var _a, _b, _c, _d, _e, _f;
24
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `https://atlas.microsoft.com`;
25
- options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2023-06-01";
26
- const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.1`;
23
+ function createClient(credentials, _a = {}) {
24
+ var _b, _c, _d, _e, _f, _g;
25
+ var { apiVersion = "2023-06-01" } = _a, options = tslib.__rest(_a, ["apiVersion"]);
26
+ const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `https://atlas.microsoft.com`;
27
+ const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.2`;
27
28
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
28
29
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
29
30
  : `${userAgentInfo}`;
30
31
  options = Object.assign(Object.assign({}, options), { userAgentOptions: {
31
- userAgentPrefix
32
+ userAgentPrefix,
32
33
  }, loggingOptions: {
33
- logger: (_d = (_c = options.loggingOptions) === null || _c === void 0 ? void 0 : _c.logger) !== null && _d !== void 0 ? _d : logger.info
34
+ logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
34
35
  }, credentials: {
35
- apiKeyHeaderName: (_f = (_e = options.credentials) === null || _e === void 0 ? void 0 : _e.apiKeyHeaderName) !== null && _f !== void 0 ? _f : "subscription-key"
36
+ apiKeyHeaderName: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.apiKeyHeaderName) !== null && _g !== void 0 ? _g : "subscription-key",
36
37
  } });
37
- const client = coreClient.getClient(baseUrl, credentials, options);
38
+ const client = coreClient.getClient(endpointUrl, credentials, options);
39
+ client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
40
+ client.pipeline.addPolicy({
41
+ name: "ClientApiVersionPolicy",
42
+ sendRequest: (req, next) => {
43
+ // Use the apiVersion defined in request url directly
44
+ // Append one if there is no apiVersion and we have one at client options
45
+ const url = new URL(req.url);
46
+ if (!url.searchParams.get("api-version") && apiVersion) {
47
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
48
+ }
49
+ return next(req);
50
+ },
51
+ });
38
52
  return client;
39
53
  }
40
54
 
@@ -45,7 +59,7 @@ const responseMap = {
45
59
  "POST /geocode:batch": ["200"],
46
60
  "GET /search/polygon": ["200"],
47
61
  "GET /reverseGeocode": ["200"],
48
- "POST /reverseGeocode:batch": ["200"]
62
+ "POST /reverseGeocode:batch": ["200"],
49
63
  };
50
64
  function isUnexpected(response) {
51
65
  const lroOriginal = response.headers["x-ms-original-url"];
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/logger.ts","../src/generated/mapsSearchClient.ts","../src/generated/isUnexpected.ts","../src/MapsSearch.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"maps-search\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"../logger\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsSearchClient } from \"./clientDefinitions\";\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 options: ClientOptions = {}\n): MapsSearchClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"2023-06-01\";\n const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.1`;\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\n const client = getClient(baseUrl, credentials, options) as MapsSearchClient;\n\n return client;\n}\n","// 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\";\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","// 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\";\nimport createClient from \"./generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsSearchClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\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\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\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\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\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","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport MapsSearch from \"./MapsSearch\";\n\nexport * from \"./generated\";\nexport default MapsSearch;\n"],"names":["createClientLogger","getClient","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsClientIdPolicy","isSASCredential"],"mappings":";;;;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,aAAa,CAAC;;ACJvD;AACA;AAOA;;;;AAIG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,UAAyB,EAAE,EAAA;;IAE3B,MAAM,OAAO,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,6BAA6B;IAChE,OAAO,CAAC,UAAU,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,YAAY;IACvD,MAAM,aAAa,GAAG,CAAA,sCAAA,CAAwC;IAC9D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAA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CAAC,OAAO,CAAC;aACrB;AACF,SAAA,CAAC;AACF,QAAA,OAAO,MAAM;;AAGf,IAAA,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC;AAC1C;;AC/GA;AACA;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../generated/logger.ts","../generated/mapsSearchClient.ts","../generated/isUnexpected.ts","../src/MapsSearch.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"maps-search\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsSearchClient } from \"./clientDefinitions\";\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","// 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\";\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","// 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\";\nimport createClient from \"../generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsSearchClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\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\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\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\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\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","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport MapsSearch from \"./MapsSearch\";\n\nexport * from \"../generated\";\nexport default MapsSearch;\n"],"names":["createClientLogger","__rest","getClient","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsClientIdPolicy","isSASCredential"],"mappings":";;;;;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,aAAa,CAAC;;ACJvD;AACA;AAaA;;;;AAIG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,KAAqE,EAAE,EAAA;;QAAvE,EAAE,UAAU,GAAG,YAAY,EAAA,GAAA,EAA4C,EAAvC,OAAO,GAAAC,YAAA,CAAA,EAAA,EAAvC,cAAyC,CAAF;AAEvC,IAAA,MAAM,WAAW,GACf,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,OAAO,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,OAAO,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,6BAA6B;IACtE,MAAM,aAAa,GAAG,CAAA,sCAAA,CAAwC;IAC9D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC;UACjD,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAI,CAAA,EAAA,aAAa,CAAE;AAChE,UAAE,CAAA,EAAG,aAAa,CAAA,CAAE;AACxB,IAAA,OAAO,GACF,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACV,EAAA,EAAA,gBAAgB,EAAE;YAChB,eAAe;AAChB,SAAA,EACD,cAAc,EAAE;YACd,MAAM,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,OAAO,CAAC,cAAc,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,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E,OAAO,CAAC;AACtD,QAAA,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;AACxB,YAAA,IAAI,EAAE,yBAAyB;AAC/B,YAAA,MAAM,WAAW,CAAC,OAAO,EAAE,IAAI,EAAA;AAC7B,gBAAA,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAA,QAAA,EAAW,UAAU,CAAC,SAAS,CAAA,CAAE,CAAC;AACvE,gBAAA,OAAO,IAAI,CAAC,OAAO,CAAC;aACrB;AACF,SAAA,CAAC;AACF,QAAA,OAAO,MAAM;;AAGf,IAAA,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC;AAC1C;;AC/GA;AACA;;;;;"}
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
  import { isSASCredential, isTokenCredential } from "@azure/core-auth";
4
4
  import { createMapsClientIdPolicy } from "@azure/maps-common";
5
- import createClient from "./generated";
5
+ import createClient from "../generated";
6
6
  import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
7
7
  export default function MapsSearch(credential, clientIdOrOptions = {}, maybeOptions = {}) {
8
8
  const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"MapsSearch.js","sourceRoot":"","sources":["../../src/MapsSearch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AA6D5E,MAAM,CAAC,OAAO,UAAU,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,iBAAiB,CAAC,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,YAAY,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CACvB,+BAA+B,CAAC;YAC9B,UAAU;YACV,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CACH,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,YAAY,CAAC,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,YAAY,CAAC,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\";\nimport createClient from \"./generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsSearchClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\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\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\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\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\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"]}
1
+ {"version":3,"file":"MapsSearch.js","sourceRoot":"","sources":["../../src/MapsSearch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AA6D5E,MAAM,CAAC,OAAO,UAAU,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,iBAAiB,CAAC,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,YAAY,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CACvB,+BAA+B,CAAC;YAC9B,UAAU;YACV,MAAM,EAAE,sCAAsC;SAC/C,CAAC,CACH,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,YAAY,CAAC,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,YAAY,CAAC,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\";\nimport createClient from \"../generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsSearchClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\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\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\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\n * import MapsSearch from \"@azure-rest/maps-search\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\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"]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import MapsSearch from "./MapsSearch";
4
- export * from "./generated";
4
+ export * from "../generated";
5
5
  export default MapsSearch;
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAc,aAAa,CAAC;AAC5B,eAAe,UAAU,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport MapsSearch from \"./MapsSearch\";\n\nexport * from \"./generated\";\nexport default MapsSearch;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAc,cAAc,CAAC;AAC7B,eAAe,UAAU,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport MapsSearch from \"./MapsSearch\";\n\nexport * from \"../generated\";\nexport default MapsSearch;\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure-rest/maps-search",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "2.0.0-alpha.20241111.1",
5
+ "version": "2.0.0-alpha.20241113.1",
6
6
  "description": "A generated SDK for MapsSearchClient.",
7
7
  "keywords": [
8
8
  "node",
@@ -7,7 +7,7 @@
7
7
  import type { AzureKeyCredential } from '@azure/core-auth';
8
8
  import type { AzureSASCredential } from '@azure/core-auth';
9
9
  import { Client } from '@azure-rest/core-client';
10
- import type { ClientOptions } from '@azure-rest/core-client';
10
+ import { ClientOptions } from '@azure-rest/core-client';
11
11
  import { HttpResponse } from '@azure-rest/core-client';
12
12
  import { RawHttpHeaders } from '@azure/core-rest-pipeline';
13
13
  import { RequestParameters } from '@azure-rest/core-client';
@@ -346,6 +346,11 @@ export type MapsSearchClient = Client & {
346
346
  path: Routes;
347
347
  };
348
348
 
349
+ // @public
350
+ export interface MapsSearchClientOptions extends ClientOptions {
351
+ apiVersion?: string;
352
+ }
353
+
349
354
  // @public
350
355
  export interface ReverseGeocodingBatchRequestBody {
351
356
  batchItems?: Array<ReverseGeocodingBatchRequestItem>;
@@ -1,7 +1,7 @@
1
1
  import type { AzureKeyCredential } from '@azure/core-auth';
2
2
  import type { AzureSASCredential } from '@azure/core-auth';
3
3
  import { Client } from '@azure-rest/core-client';
4
- import type { ClientOptions } from '@azure-rest/core-client';
4
+ import { ClientOptions } from '@azure-rest/core-client';
5
5
  import { HttpResponse } from '@azure-rest/core-client';
6
6
  import { RawHttpHeaders } from '@azure/core-rest-pipeline';
7
7
  import { RequestParameters } from '@azure-rest/core-client';
@@ -186,7 +186,7 @@ export declare interface GeocodingBatchRequestItem {
186
186
  */
187
187
  addressLine?: string;
188
188
  /**
189
- * Restrict 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. This will limit the search to the specified region.
189
+ * 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./
190
190
  *
191
191
  * **If query is given, should not use this parameter.**
192
192
  */
@@ -401,25 +401,18 @@ export declare interface GeometryCopyrightOutput {
401
401
 
402
402
  export declare interface GetGeocoding {
403
403
  /**
404
- * **Geocoding**
405
404
  *
406
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
405
+ * The `Get Geocoding` API is an HTTP `GET` request that returns the longitude and latitude coordinates of the location being searched.
407
406
  *
408
- * 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, states etc.
407
+ * 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.
409
408
  */
410
409
  get(options?: SearchGetGeocodingParameters): StreamableMethod<SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse>;
411
410
  }
412
411
 
413
412
  export declare interface GetGeocodingBatch {
414
413
  /**
415
- * **Geocoding Batch API**
416
414
  *
417
- *
418
- * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
419
- *
420
- *
421
- *
422
- * The Geocoding Batch API sends batches of queries to [Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.
415
+ * 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.
423
416
  *
424
417
  * ### Submit Synchronous Batch Request
425
418
  * 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.
@@ -447,7 +440,7 @@ export declare interface GetGeocodingBatch {
447
440
  * }
448
441
  * ```
449
442
  *
450
- * A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding#uri-parameters).
443
+ * A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](/rest/api/maps/search/get-geocoding#uri-parameters).
451
444
  *
452
445
  *
453
446
  * The batch should contain at least **1** query.
@@ -456,7 +449,7 @@ export declare interface GetGeocodingBatch {
456
449
  * ### Batch Response Model
457
450
  * 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:
458
451
  *
459
- * - [`GeocodingResponse`](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding#geocodingresponse) - If the query completed successfully.
452
+ * - [`GeocodingResponse`](/rest/api/maps/search/get-geocoding#geocodingresponse) - If the query completed successfully.
460
453
  *
461
454
  * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
462
455
  *
@@ -468,36 +461,24 @@ export declare interface GetGeocodingBatch {
468
461
 
469
462
  export declare interface GetPolygon {
470
463
  /**
471
- * **Get Polygon**
472
464
  *
473
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
474
- *
475
- * Supplies polygon data of a geographical area outline such as a city or a country region.
465
+ * 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.
476
466
  */
477
467
  get(options: SearchGetPolygonParameters): StreamableMethod<SearchGetPolygon200Response | SearchGetPolygonDefaultResponse>;
478
468
  }
479
469
 
480
470
  export declare interface GetReverseGeocoding {
481
471
  /**
482
- * **Reverse Geocoding**
483
- *
484
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
485
472
  *
486
- * Translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Most often this is needed in tracking applications where you receive a GPS feed from the device or asset and wish to know what address where the coordinate is located. This endpoint will return address information for a given coordinate.
473
+ * 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.
487
474
  */
488
475
  get(options: SearchGetReverseGeocodingParameters): StreamableMethod<SearchGetReverseGeocoding200Response | SearchGetReverseGeocodingDefaultResponse>;
489
476
  }
490
477
 
491
478
  export declare interface GetReverseGeocodingBatch {
492
479
  /**
493
- * **Reverse Geocoding Batch API**
494
- *
495
- *
496
- * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
497
480
  *
498
- *
499
- *
500
- * The Reverse Geocoding Batch API sends batches of queries to [Reverse Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.
481
+ * 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.
501
482
  *
502
483
  * ### Submit Synchronous Batch Request
503
484
  * 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.
@@ -522,7 +503,7 @@ export declare interface GetReverseGeocodingBatch {
522
503
  * }
523
504
  * ```
524
505
  *
525
- * A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding#uri-parameters).
506
+ * A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](/rest/api/maps/search/get-reverse-geocoding#uri-parameters).
526
507
  *
527
508
  *
528
509
  * The batch should contain at least **1** query.
@@ -531,7 +512,7 @@ export declare interface GetReverseGeocodingBatch {
531
512
  * ### Batch Response Model
532
513
  * 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:
533
514
  *
534
- * - [`GeocodingResponse`](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding#geocodingresponse) - If the query completed successfully.
515
+ * - [`GeocodingResponse`](/rest/api/maps/search/get-reverse-geocoding#geocodingresponse) - If the query completed successfully.
535
516
  *
536
517
  * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
537
518
  *
@@ -622,6 +603,12 @@ export declare type MapsSearchClient = Client & {
622
603
  path: Routes;
623
604
  };
624
605
 
606
+ /** The optional parameters for the client */
607
+ export declare interface MapsSearchClientOptions extends ClientOptions {
608
+ /** The api version option of the client */
609
+ apiVersion?: string;
610
+ }
611
+
625
612
  /** 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. */
626
613
  export declare interface ReverseGeocodingBatchRequestBody {
627
614
  /** The list of queries to process. */
@@ -673,11 +660,10 @@ export declare interface SearchGetGeocoding200Headers {
673
660
  }
674
661
 
675
662
  /**
676
- * **Geocoding**
677
663
  *
678
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
664
+ * The `Get Geocoding` API is an HTTP `GET` request that returns the longitude and latitude coordinates of the location being searched.
679
665
  *
680
- * 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, states etc.
666
+ * 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.
681
667
  */
682
668
  export declare interface SearchGetGeocoding200Response extends HttpResponse {
683
669
  status: "200";
@@ -686,14 +672,8 @@ export declare interface SearchGetGeocoding200Response extends HttpResponse {
686
672
  }
687
673
 
688
674
  /**
689
- * **Geocoding Batch API**
690
- *
691
- *
692
- * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
693
- *
694
- *
695
675
  *
696
- * The Geocoding Batch API sends batches of queries to [Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.
676
+ * 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.
697
677
  *
698
678
  * ### Submit Synchronous Batch Request
699
679
  * 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.
@@ -721,7 +701,7 @@ export declare interface SearchGetGeocoding200Response extends HttpResponse {
721
701
  * }
722
702
  * ```
723
703
  *
724
- * A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding#uri-parameters).
704
+ * A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](/rest/api/maps/search/get-geocoding#uri-parameters).
725
705
  *
726
706
  *
727
707
  * The batch should contain at least **1** query.
@@ -730,7 +710,7 @@ export declare interface SearchGetGeocoding200Response extends HttpResponse {
730
710
  * ### Batch Response Model
731
711
  * 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:
732
712
  *
733
- * - [`GeocodingResponse`](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding#geocodingresponse) - If the query completed successfully.
713
+ * - [`GeocodingResponse`](/rest/api/maps/search/get-geocoding#geocodingresponse) - If the query completed successfully.
734
714
  *
735
715
  * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
736
716
  *
@@ -748,14 +728,8 @@ export declare interface SearchGetGeocodingBatchBodyParam {
748
728
  }
749
729
 
750
730
  /**
751
- * **Geocoding Batch API**
752
731
  *
753
- *
754
- * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
755
- *
756
- *
757
- *
758
- * The Geocoding Batch API sends batches of queries to [Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.
732
+ * 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.
759
733
  *
760
734
  * ### Submit Synchronous Batch Request
761
735
  * 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.
@@ -783,7 +757,7 @@ export declare interface SearchGetGeocodingBatchBodyParam {
783
757
  * }
784
758
  * ```
785
759
  *
786
- * A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding#uri-parameters).
760
+ * A _geocoding_ batchItem object can accept any of the supported _geocoding_ [URI parameters](/rest/api/maps/search/get-geocoding#uri-parameters).
787
761
  *
788
762
  *
789
763
  * The batch should contain at least **1** query.
@@ -792,7 +766,7 @@ export declare interface SearchGetGeocodingBatchBodyParam {
792
766
  * ### Batch Response Model
793
767
  * 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:
794
768
  *
795
- * - [`GeocodingResponse`](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding#geocodingresponse) - If the query completed successfully.
769
+ * - [`GeocodingResponse`](/rest/api/maps/search/get-geocoding#geocodingresponse) - If the query completed successfully.
796
770
  *
797
771
  * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
798
772
  *
@@ -812,11 +786,10 @@ export declare interface SearchGetGeocodingBatchMediaTypesParam {
812
786
  export declare type SearchGetGeocodingBatchParameters = SearchGetGeocodingBatchMediaTypesParam & SearchGetGeocodingBatchBodyParam & RequestParameters;
813
787
 
814
788
  /**
815
- * **Geocoding**
816
789
  *
817
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
790
+ * The `Get Geocoding` API is an HTTP `GET` request that returns the longitude and latitude coordinates of the location being searched.
818
791
  *
819
- * 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, states etc.
792
+ * 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.
820
793
  */
821
794
  export declare interface SearchGetGeocodingDefaultResponse extends HttpResponse {
822
795
  status: string;
@@ -841,7 +814,7 @@ export declare interface SearchGetGeocodingQueryParamProperties {
841
814
  */
842
815
  addressLine?: string;
843
816
  /**
844
- * Restrict 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. This will limit the search to the specified region.
817
+ * 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./
845
818
  *
846
819
  * **If query is given, should not use this parameter.**
847
820
  */
@@ -893,11 +866,8 @@ export declare interface SearchGetGeocodingQueryParamProperties {
893
866
  }
894
867
 
895
868
  /**
896
- * **Get Polygon**
897
869
  *
898
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
899
- *
900
- * Supplies polygon data of a geographical area outline such as a city or a country region.
870
+ * 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.
901
871
  */
902
872
  export declare interface SearchGetPolygon200Response extends HttpResponse {
903
873
  status: "200";
@@ -905,11 +875,8 @@ export declare interface SearchGetPolygon200Response extends HttpResponse {
905
875
  }
906
876
 
907
877
  /**
908
- * **Get Polygon**
909
- *
910
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
911
878
  *
912
- * Supplies polygon data of a geographical area outline such as a city or a country region.
879
+ * 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.
913
880
  */
914
881
  export declare interface SearchGetPolygonDefaultResponse extends HttpResponse {
915
882
  status: string;
@@ -931,18 +898,15 @@ export declare interface SearchGetPolygonQueryParamProperties {
931
898
  * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.
932
899
  */
933
900
  view?: string;
934
- /** The geopolitical concept to return a boundary for. */
901
+ /** The geopolitical concept to return a boundary for. If not specified, the default is `countryRegion` result type. */
935
902
  resultType?: "countryRegion" | "adminDistrict" | "adminDistrict2" | "postalCode" | "postalCode2" | "postalCode3" | "postalCode4" | "neighborhood" | "locality";
936
- /** Resolution determines the amount of points to send back. */
903
+ /** Resolution determines the amount of points to send back. If not specified, the default is medium resolution. */
937
904
  resolution?: "small" | "medium" | "large" | "huge";
938
905
  }
939
906
 
940
907
  /**
941
- * **Reverse Geocoding**
942
908
  *
943
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
944
- *
945
- * Translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Most often this is needed in tracking applications where you receive a GPS feed from the device or asset and wish to know what address where the coordinate is located. This endpoint will return address information for a given coordinate.
909
+ * 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.
946
910
  */
947
911
  export declare interface SearchGetReverseGeocoding200Response extends HttpResponse {
948
912
  status: "200";
@@ -950,14 +914,8 @@ export declare interface SearchGetReverseGeocoding200Response extends HttpRespon
950
914
  }
951
915
 
952
916
  /**
953
- * **Reverse Geocoding Batch API**
954
- *
955
917
  *
956
- * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
957
- *
958
- *
959
- *
960
- * The Reverse Geocoding Batch API sends batches of queries to [Reverse Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.
918
+ * 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.
961
919
  *
962
920
  * ### Submit Synchronous Batch Request
963
921
  * 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.
@@ -982,7 +940,7 @@ export declare interface SearchGetReverseGeocoding200Response extends HttpRespon
982
940
  * }
983
941
  * ```
984
942
  *
985
- * A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding#uri-parameters).
943
+ * A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](/rest/api/maps/search/get-reverse-geocoding#uri-parameters).
986
944
  *
987
945
  *
988
946
  * The batch should contain at least **1** query.
@@ -991,7 +949,7 @@ export declare interface SearchGetReverseGeocoding200Response extends HttpRespon
991
949
  * ### Batch Response Model
992
950
  * 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:
993
951
  *
994
- * - [`GeocodingResponse`](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding#geocodingresponse) - If the query completed successfully.
952
+ * - [`GeocodingResponse`](/rest/api/maps/search/get-reverse-geocoding#geocodingresponse) - If the query completed successfully.
995
953
  *
996
954
  * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
997
955
  *
@@ -1009,14 +967,8 @@ export declare interface SearchGetReverseGeocodingBatchBodyParam {
1009
967
  }
1010
968
 
1011
969
  /**
1012
- * **Reverse Geocoding Batch API**
1013
- *
1014
970
  *
1015
- * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
1016
- *
1017
- *
1018
- *
1019
- * The Reverse Geocoding Batch API sends batches of queries to [Reverse Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.
971
+ * 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.
1020
972
  *
1021
973
  * ### Submit Synchronous Batch Request
1022
974
  * 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.
@@ -1041,7 +993,7 @@ export declare interface SearchGetReverseGeocodingBatchBodyParam {
1041
993
  * }
1042
994
  * ```
1043
995
  *
1044
- * A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding#uri-parameters).
996
+ * A _reverse geocoding_ batchItem object can accept any of the supported _reverse geocoding_ [URI parameters](/rest/api/maps/search/get-reverse-geocoding#uri-parameters).
1045
997
  *
1046
998
  *
1047
999
  * The batch should contain at least **1** query.
@@ -1050,7 +1002,7 @@ export declare interface SearchGetReverseGeocodingBatchBodyParam {
1050
1002
  * ### Batch Response Model
1051
1003
  * 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:
1052
1004
  *
1053
- * - [`GeocodingResponse`](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding#geocodingresponse) - If the query completed successfully.
1005
+ * - [`GeocodingResponse`](/rest/api/maps/search/get-reverse-geocoding#geocodingresponse) - If the query completed successfully.
1054
1006
  *
1055
1007
  * - `Error` - If the query failed. The response will contain a `code` and a `message` in this case.
1056
1008
  *
@@ -1070,11 +1022,8 @@ export declare interface SearchGetReverseGeocodingBatchMediaTypesParam {
1070
1022
  export declare type SearchGetReverseGeocodingBatchParameters = SearchGetReverseGeocodingBatchMediaTypesParam & SearchGetReverseGeocodingBatchBodyParam & RequestParameters;
1071
1023
 
1072
1024
  /**
1073
- * **Reverse Geocoding**
1074
- *
1075
- * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
1076
1025
  *
1077
- * Translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Most often this is needed in tracking applications where you receive a GPS feed from the device or asset and wish to know what address where the coordinate is located. This endpoint will return address information for a given coordinate.
1026
+ * 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.
1078
1027
  */
1079
1028
  export declare interface SearchGetReverseGeocodingDefaultResponse extends HttpResponse {
1080
1029
  status: string;
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export {};
4
- //# sourceMappingURL=clientDefinitions.js.map
@@ -1 +0,0 @@
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\";\nimport {\n SearchGetGeocoding200Response,\n SearchGetGeocodingDefaultResponse,\n SearchGetGeocodingBatch200Response,\n SearchGetGeocodingBatchDefaultResponse,\n SearchGetPolygon200Response,\n SearchGetPolygonDefaultResponse,\n SearchGetReverseGeocoding200Response,\n SearchGetReverseGeocodingDefaultResponse,\n SearchGetReverseGeocodingBatch200Response,\n SearchGetReverseGeocodingBatchDefaultResponse\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetGeocoding {\n /**\n * **Geocoding**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\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, states etc.\n */\n get(\n options?: SearchGetGeocodingParameters\n ): StreamableMethod<\n SearchGetGeocoding200Response | SearchGetGeocodingDefaultResponse\n >;\n}\n\nexport interface GetGeocodingBatch {\n /**\n * **Geocoding Batch API**\n *\n *\n * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n *\n * The Geocoding Batch API sends batches of queries to [Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.\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](https://docs.microsoft.com/rest/api/maps/search-v2/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`](https://docs.microsoft.com/rest/api/maps/search-v2/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 * **Get Polygon**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * 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 * **Reverse Geocoding**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Most often this is needed in tracking applications where you receive a GPS feed from the device or asset and wish to know what address where the coordinate is located. 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 * **Reverse Geocoding Batch API**\n *\n *\n * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n *\n * The Reverse Geocoding Batch API sends batches of queries to [Reverse Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.\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](https://docs.microsoft.com/rest/api/maps/search-v2/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`](https://docs.microsoft.com/rest/api/maps/search-v2/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"]}
@@ -1,12 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import MapsSearchClient from "./mapsSearchClient";
4
- export * from "./mapsSearchClient";
5
- export * from "./parameters";
6
- export * from "./responses";
7
- export * from "./clientDefinitions";
8
- export * from "./isUnexpected";
9
- export * from "./models";
10
- export * from "./outputModels";
11
- export default MapsSearchClient;
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAE/B,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsSearchClient from \"./mapsSearchClient\";\n\nexport * from \"./mapsSearchClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\n\nexport default MapsSearchClient;\n"]}
@@ -1,75 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- const responseMap = {
4
- "GET /geocode": ["200"],
5
- "POST /geocode:batch": ["200"],
6
- "GET /search/polygon": ["200"],
7
- "GET /reverseGeocode": ["200"],
8
- "POST /reverseGeocode:batch": ["200"]
9
- };
10
- export function isUnexpected(response) {
11
- const lroOriginal = response.headers["x-ms-original-url"];
12
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
13
- const method = response.request.method;
14
- let pathDetails = responseMap[`${method} ${url.pathname}`];
15
- if (!pathDetails) {
16
- pathDetails = getParametrizedPathSuccess(method, url.pathname);
17
- }
18
- return !pathDetails.includes(response.status);
19
- }
20
- function getParametrizedPathSuccess(method, path) {
21
- var _a, _b, _c, _d;
22
- const pathParts = path.split("/");
23
- // Traverse list to match the longest candidate
24
- // matchedLen: the length of candidate path
25
- // matchedValue: the matched status code array
26
- let matchedLen = -1, matchedValue = [];
27
- // Iterate the responseMap to find a match
28
- for (const [key, value] of Object.entries(responseMap)) {
29
- // Extracting the path from the map key which is in format
30
- // GET /path/foo
31
- if (!key.startsWith(method)) {
32
- continue;
33
- }
34
- const candidatePath = getPathFromMapKey(key);
35
- // Get each part of the url path
36
- const candidateParts = candidatePath.split("/");
37
- // track if we have found a match to return the values found.
38
- let found = true;
39
- for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
40
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
41
- ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
42
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
43
- // If the current part of the candidate is a "template" part
44
- // Try to use the suffix of pattern to match the path
45
- // {guid} ==> $
46
- // {guid}:export ==> :export$
47
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
48
- if (!isMatched) {
49
- found = false;
50
- break;
51
- }
52
- continue;
53
- }
54
- // If the candidate part is not a template and
55
- // the parts don't match mark the candidate as not found
56
- // to move on with the next candidate path.
57
- if (candidateParts[i] !== pathParts[j]) {
58
- found = false;
59
- break;
60
- }
61
- }
62
- // We finished evaluating the current candidate parts
63
- // Update the matched value if and only if we found the longer pattern
64
- if (found && candidatePath.length > matchedLen) {
65
- matchedLen = candidatePath.length;
66
- matchedValue = value;
67
- }
68
- }
69
- return matchedValue;
70
- }
71
- function getPathFromMapKey(mapKey) {
72
- const pathStart = mapKey.indexOf("/");
73
- return mapKey.slice(pathStart);
74
- }
75
- //# sourceMappingURL=isUnexpected.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAelC,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,MAAM,UAAU,YAAY,CAC1B,QAUiD;IAOjD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAA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Ac;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\";\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"]}
@@ -1,28 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { getClient } from "@azure-rest/core-client";
4
- import { logger } from "../logger";
5
- /**
6
- * Initialize a new instance of `MapsSearchClient`
7
- * @param credentials - uniquely identify client credential
8
- * @param options - the parameter for all optional parameters
9
- */
10
- export default function createClient(credentials, options = {}) {
11
- var _a, _b, _c, _d, _e, _f;
12
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `https://atlas.microsoft.com`;
13
- options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2023-06-01";
14
- const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.1`;
15
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
16
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
17
- : `${userAgentInfo}`;
18
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
19
- userAgentPrefix
20
- }, loggingOptions: {
21
- logger: (_d = (_c = options.loggingOptions) === null || _c === void 0 ? void 0 : _c.logger) !== null && _d !== void 0 ? _d : logger.info
22
- }, credentials: {
23
- apiKeyHeaderName: (_f = (_e = options.credentials) === null || _e === void 0 ? void 0 : _e.apiKeyHeaderName) !== null && _f !== void 0 ? _f : "subscription-key"
24
- } });
25
- const client = getClient(baseUrl, credentials, options);
26
- return client;
27
- }
28
- //# sourceMappingURL=mapsSearchClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mapsSearchClient.js","sourceRoot":"","sources":["../../../src/generated/mapsSearchClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA0B,EAC1B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,6BAA6B,CAAC;IACjE,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,YAAY,CAAC;IACxD,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,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,gBAAgB,EACd,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,gBAAgB,mCAAI,kBAAkB;SAC9D,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAqB,CAAC;IAE5E,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\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsSearchClient } from \"./clientDefinitions\";\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 options: ClientOptions = {}\n): MapsSearchClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"2023-06-01\";\n const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.1`;\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\n const client = getClient(baseUrl, credentials, options) as MapsSearchClient;\n\n return client;\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export {};
4
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
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 * Restrict 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. This will limit the search to the specified region.\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"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export {};
4
- //# sourceMappingURL=outputModels.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../../src/generated/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** This object is returned from a successful Geocoding call */\nexport interface GeocodingResponseOutput {\n /** The type of a FeatureCollection object must be FeatureCollection. */\n type?: \"FeatureCollection\";\n features?: Array<FeaturesItemOutput>;\n /** The is the link to the next page of the features returned. If it's the last page, no this field. */\n nextLink?: string;\n}\n\nexport interface FeaturesItemOutput {\n /** The type of a feature must be Feature. */\n type?: \"Feature\";\n /** ID for feature returned */\n id?: string;\n properties?: FeaturesItemPropertiesOutput;\n /** A valid `GeoJSON Point` geometry type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details. */\n geometry: GeoJsonPointOutput;\n /** Bounding box. Projection used - EPSG:3857. Please refer to [RFC 7946](https://datatracker.ietf.org/doc/html/rfc7946#section-5) for details. */\n bbox?: Array<number>;\n}\n\nexport interface FeaturesItemPropertiesOutput {\n /**\n * One of:\n * * Address\n * * RoadBlock\n * * RoadIntersection\n * * Neighborhood\n * * PopulatedPlace\n * * Postcode1\n * * AdminDivision1\n * * AdminDivision2\n * * CountryRegion\n */\n type?: string;\n /**\n * The level of confidence that the geocoded location result is a match. Use this value with the match code to determine for more complete information about the match.\n *\n * The confidence of a geocoded location is based on many factors including the relative importance of the geocoded location and the user’s location, if specified.\n */\n confidence?: \"High\" | \"Medium\" | \"Low\";\n /**\n * One or more match code values that represent the geocoding level for each location in the response.\n *\n * For example, a geocoded location with match codes of `Good` and `Ambiguous` means that more than one geocode location was found for the location information and that the geocode service did not have search up-hierarchy to find a match.\n *\n * Similarly, a geocoded location with match codes of `Ambiguous` and `UpHierarchy` implies that a geocode location could not be found that matched all the provided location information, so the geocode service had to search up-hierarchy and found multiple matches at that level. An example of up an `Ambiguous` and `UpHierarchy` result is when you provide complete address information, but the geocode service cannot locate a match for the street address and instead returns information for more than one RoadBlock value.\n *\n * The possible values are:\n *\n * `Good`: The location has only one match or all returned matches are considered strong matches. For example, a query for New York returns several Good matches.\n *\n * `Ambiguous`: The location is one of a set of possible matches. For example, when you query for the street address 128 Main St., the response may return two locations for 128 North Main St. and 128 South Main St. because there is not enough information to determine which option to choose.\n *\n * `UpHierarchy`: The location represents a move up the geographic hierarchy. This occurs when a match for the location request was not found, so a less precise result is returned. For example, if a match for the requested address cannot be found, then a match code of `UpHierarchy` with a RoadBlock entity type may be returned.\n */\n matchCodes?: Array<\"Good\" | \"Ambiguous\" | \"UpHierarchy\">;\n /** The address of the result */\n address?: AddressOutput;\n /** A collection of geocode points that differ in how they were calculated and their suggested use. */\n geocodePoints?: Array<GeocodePointsItemOutput>;\n}\n\n/** The address of the result */\nexport interface AddressOutput {\n /** AddressLine that includes Street Name and Number */\n addressLine?: string;\n /** locality property */\n locality?: string;\n /** neighborhood property */\n neighborhood?: string;\n /** The subdivision name in the country or region for an address. This element is typically treated as the first order administrative subdivision, but in some cases it also contains the second, third, or fourth order subdivision in a country, dependency, or region. */\n adminDistricts?: Array<AddressAdminDistrictsItemOutput>;\n /** Postal Code property */\n postalCode?: string;\n countryRegion?: AddressCountryRegionOutput;\n /** Formatted Address property */\n formattedAddress?: string;\n /** The address of the result. */\n intersection?: IntersectionOutput;\n}\n\nexport interface AddressAdminDistrictsItemOutput {\n /**\n * The name for the corresponding adminDistrict field,\n * For adminDistrict[0], this could be full name of state such as Washington,\n * For adminDistrict[1], this could be the full name of the county\n */\n name?: string;\n /**\n * The short name for the corresponding adminDistrict field,\n * For adminDistrict[0], this could be short name of state such as WA,\n * For adminDistrict[1], this could be the short name of the county\n */\n shortName?: string;\n}\n\nexport interface AddressCountryRegionOutput {\n /** ISO of country/region */\n ISO?: string;\n /** name of country/region */\n name?: string;\n}\n\n/** The address of the result. */\nexport interface IntersectionOutput {\n /** Primary street for the location. */\n baseStreet?: string;\n /** The first intersecting street. */\n secondaryStreet1?: string;\n /** If any, the second intersecting street. */\n secondaryStreet2?: string;\n /** Type of intersection. */\n intersectionType?: string;\n /** Complete name of the intersection. */\n displayName?: string;\n}\n\nexport interface GeocodePointsItemOutput {\n /** A valid `GeoJSON Point` geometry type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details. */\n geometry?: GeoJsonPointOutput;\n /** The method that was used to compute the geocode point. */\n calculationMethod?:\n | \"Interpolation\"\n | \"InterpolationOffset\"\n | \"Parcel\"\n | \"Rooftop\";\n /**\n * The best use for the geocode point.\n * Each geocode point is defined as a `Route` point, a `Display` point or both.\n * Use `Route` points if you are creating a route to the location. Use `Display` points if you are showing the location on a map. For example, if the location is a park, a `Route` point may specify an entrance to the park where you can enter with a car, and a `Display` point may be a point that specifies the center of the park.\n */\n usageTypes?: Array<\"Display\" | \"Route\">;\n}\n\n/** A valid `GeoJSON Point` geometry type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details. */\nexport interface GeoJsonPointOutput\n extends GeoJsonGeometryOutputParent,\n GeoJsonPointDataOutput {\n type: \"Point\";\n}\n\n/** A valid `GeoJSON` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1) for details. */\nexport interface GeoJsonGeometryOutputParent extends GeoJsonObjectOutputParent {\n type:\n | \"GeoJsonGeometry\"\n | \"Point\"\n | \"MultiPoint\"\n | \"LineString\"\n | \"MultiLineString\"\n | \"Polygon\"\n | \"MultiPolygon\"\n | \"GeometryCollection\";\n}\n\n/** A valid `GeoJSON` object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3) for details. */\nexport interface GeoJsonObjectOutputParent {\n /** Bounding box. Projection used - EPSG:3857. Please refer to [RFC 7946](https://datatracker.ietf.org/doc/html/rfc7946#section-5) for details. */\n bbox?: Array<number>;\n type:\n | \"GeoJsonObject\"\n | \"GeoJsonGeometry\"\n | \"Point\"\n | \"Feature\"\n | \"Boundary\"\n | \"MultiPoint\"\n | \"LineString\"\n | \"MultiLineString\"\n | \"Polygon\"\n | \"MultiPolygon\"\n | \"GeometryCollection\"\n | \"FeatureCollection\";\n}\n\n/** Data contained by a `GeoJson Point`. */\nexport interface GeoJsonPointDataOutput {\n /** A `Position` is an array of numbers with two or more elements. The first two elements are _longitude_ and _latitude_, precisely in that order. _Altitude/Elevation_ is an optional third element. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.1) for details. */\n coordinates: Array<number>;\n}\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */\nexport interface ErrorResponseOutput {\n /** The error object. */\n error?: ErrorDetailOutput;\n}\n\n/** The error detail. */\nexport interface ErrorDetailOutput {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: Array<ErrorDetailOutput>;\n /** The error additional info. */\n readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: Record<string, unknown>;\n}\n\n/** This object is returned from a successful Geocoding Batch service call. */\nexport interface GeocodingBatchResponseOutput {\n /** Summary for the batch request */\n summary?: GeocodingBatchResponseSummaryOutput;\n /** Array containing the batch results. */\n batchItems?: Array<GeocodingBatchResponseItemOutput>;\n /** The is the link to the next page of the features returned. If it's the last page, no this field. */\n nextLink?: string;\n}\n\n/** Summary for the batch request */\nexport interface GeocodingBatchResponseSummaryOutput {\n /** Number of successful requests in the batch */\n successfulRequests?: number;\n /** Total number of requests in the batch */\n totalRequests?: number;\n}\n\nexport interface GeocodingBatchResponseItemOutput {\n /** id of the batchItem which would be the same as the id in the request */\n optionalId?: string;\n /** The type of a FeatureCollection object must be FeatureCollection. */\n type?: \"FeatureCollection\";\n features?: Array<FeaturesItemOutput>;\n /** The is the link to the next page of the features returned. If it's the last page, no this field. */\n nextLink?: string;\n /** The error detail. */\n error?: ErrorDetailOutput;\n}\n\n/**\n * `GeoJSON GeocodingFeature` object that describe the boundaries of a geographical area. Geometry of the feature is described with `GeoJSON GeometryCollection`.\n *\n * Please note, the service typically returns a GeometryCollection with Polygon or MultiPolygon sub-types.\n */\nexport interface BoundaryOutput\n extends GeoJsonFeatureOutputParent,\n BoundaryPropertiesOutput {\n type: \"Boundary\";\n}\n\n/** A valid `GeoJSON Feature` object type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.2) for details. */\nexport interface GeoJsonFeatureOutputParent\n extends GeoJsonObjectOutputParent,\n GeoJsonFeatureDataOutput {\n type: \"Feature\" | \"Boundary\";\n}\n\nexport interface GeoJsonFeatureDataOutput {\n /** A valid `GeoJSON` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1) for details. */\n geometry: GeoJsonGeometryOutput;\n /** Properties can contain any additional metadata about the `Feature`. Value can be any JSON object or a JSON null value */\n properties?: Record<string, unknown>;\n /** Identifier for the feature. */\n id?: string;\n /** The type of the feature. The value depends on the data model the current feature is part of. Some data models may have an empty value. */\n featureType?: string;\n}\n\n/** Properties of a Boundary object. */\nexport interface BoundaryPropertiesOutput {\n /** The name associated with the geographical area. */\n name?: string;\n /** The copyright string. */\n copyright?: string;\n /** A URL that lists many of the data providers for Azure Maps and their related copyright information. */\n copyrightURL?: string;\n /** A collection of copyright information for each geometry of the Boundary object in the same order they appear. */\n geometriesCopyright?: Array<GeometryCopyrightOutput>;\n}\n\n/** Copyright information of a geometry of a Boundary object. */\nexport interface GeometryCopyrightOutput {\n /** The name of the data provider */\n sourceName?: string;\n /** The copyright string for the data provider */\n copyright?: string;\n}\n\n/** A valid `GeoJSON MultiPoint` geometry type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.3) for details. */\nexport interface GeoJsonMultiPointOutput\n extends GeoJsonGeometryOutputParent,\n GeoJsonMultiPointDataOutput {\n type: \"MultiPoint\";\n}\n\n/** Data contained by a `GeoJson MultiPoint`. */\nexport interface GeoJsonMultiPointDataOutput {\n /** Coordinates for the `GeoJson MultiPoint` geometry. */\n coordinates: Array<Array<number>>;\n}\n\n/** A valid `GeoJSON LineString` geometry type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for details. */\nexport interface GeoJsonLineStringOutput\n extends GeoJsonGeometryOutputParent,\n GeoJsonLineStringDataOutput {\n type: \"LineString\";\n}\n\nexport interface GeoJsonLineStringDataOutput {\n /** Coordinates for the `GeoJson LineString` geometry. */\n coordinates: Array<Array<number>>;\n}\n\n/** A valid `GeoJSON MultiLineString` geometry type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.5) for details. */\nexport interface GeoJsonMultiLineStringOutput\n extends GeoJsonGeometryOutputParent,\n GeoJsonMultiLineStringDataOutput {\n type: \"MultiLineString\";\n}\n\nexport interface GeoJsonMultiLineStringDataOutput {\n /** Coordinates for the `GeoJson MultiLineString` geometry. */\n coordinates: Array<Array<Array<number>>>;\n}\n\n/** A valid `GeoJSON Polygon` geometry type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.6) for details. */\nexport interface GeoJsonPolygonOutput\n extends GeoJsonGeometryOutputParent,\n GeoJsonPolygonDataOutput {\n type: \"Polygon\";\n}\n\nexport interface GeoJsonPolygonDataOutput {\n /** Coordinates for the `GeoJson Polygon` geometry type. */\n coordinates: Array<Array<Array<number>>>;\n}\n\n/** A valid `GeoJSON MultiPolygon` object type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.7) for details. */\nexport interface GeoJsonMultiPolygonOutput\n extends GeoJsonGeometryOutputParent,\n GeoJsonMultiPolygonDataOutput {\n type: \"MultiPolygon\";\n}\n\nexport interface GeoJsonMultiPolygonDataOutput {\n /** Contains a list of valid `GeoJSON Polygon` objects. **Note** that coordinates in GeoJSON are in x, y order (longitude, latitude). */\n coordinates: Array<Array<Array<Array<number>>>>;\n}\n\n/** A valid `GeoJSON GeometryCollection` object type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.8) for details. */\nexport interface GeoJsonGeometryCollectionOutput\n extends GeoJsonGeometryOutputParent,\n GeoJsonGeometryCollectionDataOutput {\n type: \"GeometryCollection\";\n}\n\nexport interface GeoJsonGeometryCollectionDataOutput {\n /** Contains a list of valid `GeoJSON` geometry objects. **Note** that coordinates in GeoJSON are in x, y order (longitude, latitude). */\n geometries: Array<GeoJsonGeometryOutput>;\n}\n\n/** A valid `GeoJSON FeatureCollection` object type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. */\nexport interface GeoJsonFeatureCollectionOutput\n extends GeoJsonObjectOutputParent,\n GeoJsonFeatureCollectionDataOutput {\n type: \"FeatureCollection\";\n}\n\nexport interface GeoJsonFeatureCollectionDataOutput {\n /** Contains a list of valid `GeoJSON Feature` objects. */\n features: Array<GeoJsonFeatureOutput>;\n}\n\n/** A valid `GeoJSON` geometry object. The type must be one of the seven valid GeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1) for details. */\nexport type GeoJsonGeometryOutput =\n | GeoJsonGeometryOutputParent\n | GeoJsonPointOutput\n | GeoJsonMultiPointOutput\n | GeoJsonLineStringOutput\n | GeoJsonMultiLineStringOutput\n | GeoJsonPolygonOutput\n | GeoJsonMultiPolygonOutput\n | GeoJsonGeometryCollectionOutput;\n/** A valid `GeoJSON` object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3) for details. */\nexport type GeoJsonObjectOutput =\n | GeoJsonGeometryOutput\n | GeoJsonPointOutput\n | GeoJsonFeatureOutput\n | BoundaryOutput\n | GeoJsonMultiPointOutput\n | GeoJsonLineStringOutput\n | GeoJsonMultiLineStringOutput\n | GeoJsonPolygonOutput\n | GeoJsonMultiPolygonOutput\n | GeoJsonGeometryCollectionOutput\n | GeoJsonFeatureCollectionOutput;\n/** A valid `GeoJSON Feature` object type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.2) for details. */\nexport type GeoJsonFeatureOutput = GeoJsonFeatureOutputParent | BoundaryOutput;\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export {};
4
- //# sourceMappingURL=parameters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/generated/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport {\n GeocodingBatchRequestBody,\n ReverseGeocodingBatchRequestBody\n} from \"./models\";\n\nexport interface SearchGetGeocodingQueryParamProperties {\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 * Restrict 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. This will limit the search to the specified region.\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. 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 /**\n * A string that represents 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. By default, the View parameter is set to “Auto” even if you haven’t defined it in the request.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\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: &coordinates=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\nexport interface SearchGetGeocodingQueryParam {\n queryParameters?: SearchGetGeocodingQueryParamProperties;\n}\n\nexport type SearchGetGeocodingParameters = SearchGetGeocodingQueryParam &\n RequestParameters;\n\nexport interface SearchGetGeocodingBatchBodyParam {\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. */\n body: GeocodingBatchRequestBody;\n}\n\nexport interface SearchGetGeocodingBatchMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchGetGeocodingBatchParameters = SearchGetGeocodingBatchMediaTypesParam &\n SearchGetGeocodingBatchBodyParam &\n RequestParameters;\n\nexport interface SearchGetPolygonQueryParamProperties {\n /** A point on the earth specified as a longitude and latitude. Example: &coordinates=lon,lat */\n coordinates: Array<number>;\n /**\n * A string that represents 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. By default, the View parameter is set to “Auto” even if you haven’t defined it in the request.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?: string;\n /** The geopolitical concept to return a boundary for. */\n resultType?:\n | \"countryRegion\"\n | \"adminDistrict\"\n | \"adminDistrict2\"\n | \"postalCode\"\n | \"postalCode2\"\n | \"postalCode3\"\n | \"postalCode4\"\n | \"neighborhood\"\n | \"locality\";\n /** Resolution determines the amount of points to send back. */\n resolution?: \"small\" | \"medium\" | \"large\" | \"huge\";\n}\n\nexport interface SearchGetPolygonQueryParam {\n queryParameters: SearchGetPolygonQueryParamProperties;\n}\n\nexport type SearchGetPolygonParameters = SearchGetPolygonQueryParam &\n RequestParameters;\n\nexport interface SearchGetReverseGeocodingQueryParamProperties {\n /** The coordinates of the location that you want to reverse geocode. Example: &coordinates=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 /**\n * A string that represents 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. By default, the View parameter is set to “Auto” even if you haven’t defined it in the request.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?: string;\n}\n\nexport interface SearchGetReverseGeocodingQueryParam {\n queryParameters: SearchGetReverseGeocodingQueryParamProperties;\n}\n\nexport type SearchGetReverseGeocodingParameters = SearchGetReverseGeocodingQueryParam &\n RequestParameters;\n\nexport interface SearchGetReverseGeocodingBatchBodyParam {\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. */\n body: ReverseGeocodingBatchRequestBody;\n}\n\nexport interface SearchGetReverseGeocodingBatchMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchGetReverseGeocodingBatchParameters = SearchGetReverseGeocodingBatchMediaTypesParam &\n SearchGetReverseGeocodingBatchBodyParam &\n RequestParameters;\n"]}
@@ -1,51 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { LroEngine } from "@azure/core-lro";
4
- /**
5
- * Helper function that builds a Poller object to help polling a long running operation.
6
- * @param client - Client to use for sending the request to get additional pages.
7
- * @param initialResponse - The initial response.
8
- * @param options - Options to set a resume state or custom polling interval.
9
- * @returns - A poller object to poll for operation state updates and eventually get the final response.
10
- */
11
- export function getLongRunningPoller(client, initialResponse, options = {}) {
12
- const poller = {
13
- requestMethod: initialResponse.request.method,
14
- requestPath: initialResponse.request.url,
15
- sendInitialRequest: async () => {
16
- // In the case of Rest Clients we are building the LRO poller object from a response that's the reason
17
- // we are not triggering the initial request here, just extracting the information from the
18
- // response we were provided.
19
- return getLroResponse(initialResponse);
20
- },
21
- sendPollRequest: async (path) => {
22
- // This is the callback that is going to be called to poll the service
23
- // to get the latest status. We use the client provided and the polling path
24
- // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
25
- // depending on the lro pattern that the service implements. If non is provided we default to the initial path.
26
- const response = await client
27
- .pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url)
28
- .get();
29
- const lroResponse = getLroResponse(response);
30
- lroResponse.rawResponse.headers["x-ms-original-url"] =
31
- initialResponse.request.url;
32
- return lroResponse;
33
- }
34
- };
35
- return new LroEngine(poller, options);
36
- }
37
- /**
38
- * Converts a Rest Client response to a response that the LRO engine knows about
39
- * @param response - a rest client http response
40
- * @returns - An LRO response that the LRO engine can work with
41
- */
42
- function getLroResponse(response) {
43
- if (Number.isNaN(response.status)) {
44
- throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
45
- }
46
- return {
47
- flatResponse: response,
48
- rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body })
49
- };
50
- }
51
- //# sourceMappingURL=pollingHelper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../../src/generated/pollingHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,SAAS,EAKV,MAAM,iBAAiB,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,eAAwB,EACxB,UAAkE,EAAE;IA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corporation.\n// Licensed under the MIT License.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollerLike,\n PollOperationState\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] =\n initialResponse.request.url;\n return lroResponse;\n }\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO engine knows about\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO engine can work with\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult\n): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(\n `Status code of the response is not a number. Value: ${response.status}`\n );\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body\n }\n };\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export {};
4
- //# sourceMappingURL=responses.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/generated/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { HttpResponse } from \"@azure-rest/core-client\";\nimport {\n GeocodingResponseOutput,\n ErrorResponseOutput,\n GeocodingBatchResponseOutput,\n BoundaryOutput\n} from \"./outputModels\";\n\nexport interface SearchGetGeocoding200Headers {\n /** request id. */\n \"x-ms-request-id\"?: string;\n}\n\n/**\n * **Geocoding**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\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, states etc.\n */\nexport interface SearchGetGeocoding200Response extends HttpResponse {\n status: \"200\";\n body: GeocodingResponseOutput;\n headers: RawHttpHeaders & SearchGetGeocoding200Headers;\n}\n\n/**\n * **Geocoding**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\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, states etc.\n */\nexport interface SearchGetGeocodingDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n * **Geocoding Batch API**\n *\n *\n * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n *\n * The Geocoding Batch API sends batches of queries to [Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.\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](https://docs.microsoft.com/rest/api/maps/search-v2/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`](https://docs.microsoft.com/rest/api/maps/search-v2/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 */\nexport interface SearchGetGeocodingBatch200Response extends HttpResponse {\n status: \"200\";\n body: GeocodingBatchResponseOutput;\n}\n\n/**\n * **Geocoding Batch API**\n *\n *\n * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n *\n * The Geocoding Batch API sends batches of queries to [Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.\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](https://docs.microsoft.com/rest/api/maps/search-v2/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`](https://docs.microsoft.com/rest/api/maps/search-v2/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 */\nexport interface SearchGetGeocodingBatchDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n * **Get Polygon**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Supplies polygon data of a geographical area outline such as a city or a country region.\n */\nexport interface SearchGetPolygon200Response extends HttpResponse {\n status: \"200\";\n body: BoundaryOutput;\n}\n\n/**\n * **Get Polygon**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Supplies polygon data of a geographical area outline such as a city or a country region.\n */\nexport interface SearchGetPolygonDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n * **Reverse Geocoding**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Most often this is needed in tracking applications where you receive a GPS feed from the device or asset and wish to know what address where the coordinate is located. This endpoint will return address information for a given coordinate.\n */\nexport interface SearchGetReverseGeocoding200Response extends HttpResponse {\n status: \"200\";\n body: GeocodingResponseOutput;\n}\n\n/**\n * **Reverse Geocoding**\n *\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Translate a coordinate (example: 37.786505, -122.3862) into a human understandable street address. Most often this is needed in tracking applications where you receive a GPS feed from the device or asset and wish to know what address where the coordinate is located. This endpoint will return address information for a given coordinate.\n */\nexport interface SearchGetReverseGeocodingDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/**\n * **Reverse Geocoding Batch API**\n *\n *\n * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n *\n * The Reverse Geocoding Batch API sends batches of queries to [Reverse Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.\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](https://docs.microsoft.com/rest/api/maps/search-v2/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`](https://docs.microsoft.com/rest/api/maps/search-v2/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 */\nexport interface SearchGetReverseGeocodingBatch200Response\n extends HttpResponse {\n status: \"200\";\n body: GeocodingBatchResponseOutput;\n}\n\n/**\n * **Reverse Geocoding Batch API**\n *\n *\n * **Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n *\n * The Reverse Geocoding Batch API sends batches of queries to [Reverse Geocoding API](https://docs.microsoft.com/rest/api/maps/search-v2/get-reverse-geocoding) using just a single API call. The API allows caller to batch up to **100** queries.\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](https://docs.microsoft.com/rest/api/maps/search-v2/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`](https://docs.microsoft.com/rest/api/maps/search-v2/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 */\nexport interface SearchGetReverseGeocodingBatchDefaultResponse\n extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n"]}