@azure-rest/maps-search 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +216 -0
- package/dist/index.js +218 -0
- package/dist/index.js.map +1 -0
- package/dist-esm/src/MapsSearch.js +29 -0
- package/dist-esm/src/MapsSearch.js.map +1 -0
- package/dist-esm/src/createBatchItems.js +16 -0
- package/dist-esm/src/createBatchItems.js.map +1 -0
- package/dist-esm/src/generated/clientDefinitions.js +4 -0
- package/dist-esm/src/generated/clientDefinitions.js.map +1 -0
- package/dist-esm/src/generated/index.js +13 -0
- package/dist-esm/src/generated/index.js.map +1 -0
- package/dist-esm/src/generated/isUnexpected.js +89 -0
- package/dist-esm/src/generated/isUnexpected.js.map +1 -0
- package/dist-esm/src/generated/mapsSearchClient.js +25 -0
- package/dist-esm/src/generated/mapsSearchClient.js.map +1 -0
- package/dist-esm/src/generated/models.js +4 -0
- package/dist-esm/src/generated/models.js.map +1 -0
- package/dist-esm/src/generated/outputModels.js +4 -0
- package/dist-esm/src/generated/outputModels.js.map +1 -0
- package/dist-esm/src/generated/parameters.js +4 -0
- package/dist-esm/src/generated/parameters.js.map +1 -0
- package/dist-esm/src/generated/pollingHelper.js +51 -0
- package/dist-esm/src/generated/pollingHelper.js.map +1 -0
- package/dist-esm/src/generated/responses.js +4 -0
- package/dist-esm/src/generated/responses.js.map +1 -0
- package/dist-esm/src/index.js +7 -0
- package/dist-esm/src/index.js.map +1 -0
- package/package.json +132 -0
- package/review/maps-search.api.md +1522 -0
|
@@ -0,0 +1 @@
|
|
|
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 SearchInsideGeometryRequest,\n SearchAlongRouteRequest,\n BatchRequest\n} from \"./models\";\n\nexport interface SearchListPolygonsQueryParamProperties {\n /** Comma separated list of geometry UUIDs, previously retrieved from an Online Search request. */\n geometries: Array<string>;\n}\n\nexport interface SearchListPolygonsQueryParam {\n queryParameters: SearchListPolygonsQueryParamProperties;\n}\n\nexport type SearchListPolygonsParameters = SearchListPolygonsQueryParam &\n RequestParameters;\n\nexport interface SearchFuzzySearchQueryParamProperties {\n /** The applicable query string (e.g., \"seattle\", \"pizza\"). Can _also_ be specified as a comma separated string composed by latitude followed by longitude (e.g., \"47.641268, -122.125679\"). Must be properly URL encoded. */\n query: string;\n /** Boolean. If the typeahead flag is set, the query will be interpreted as a partial input and the search will enter predictive mode */\n typeahead?: boolean;\n /** Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100 */\n limit?: number;\n /** Starting offset of the returned results within the full result set. Default: 0, minimum: 0 and maximum: 1900 */\n ofs?: number;\n /**\n * A comma-separated list of category set IDs which could be used to restrict the result to specific Points of Interest categories. ID order does not matter. When multiple category identifiers are provided, only POIs that belong to (at least) one of the categories from the provided list will be returned. The list of supported categories can be discovered using [POI Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples:\n *\n * * **categorySet=7315** (Search Points of Interest from category Restaurant)\n *\n * * **categorySet=7315025,7315017** (Search Points of Interest of category either Italian or French Restaurant)\n */\n categorySet?: Array<number>;\n /** Comma separated string of country codes, e.g. FR,ES. This will limit the search to the specified countries */\n countrySet?: Array<string>;\n /** Latitude where results should be biased. E.g. 37.337 */\n lat?: number;\n /** Longitude where results should be biased. E.g. -121.89 */\n lon?: number;\n /** The radius in meters to for the results to be constrained to the defined area */\n radius?: number;\n /** Top left position of the bounding box. E.g. 37.553,-122.453 */\n topLeft?: string;\n /** Bottom right position of the bounding box. E.g. 37.553,-122.453 */\n btmRight?: string;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * Indexes for which extended postal codes should be included in the results.\n *\n * Available indexes are:\n *\n * **Addr** = Address ranges\n *\n * **Geo** = Geographies\n *\n * **PAD** = Point Addresses\n *\n * **POI** = Points of Interest\n *\n * **Str** = Streets\n *\n * **XStr** = Cross Streets (intersections)\n *\n * Value should be a comma separated list of index types (in any order) or **None** for no indexes.\n *\n * By default extended postal codes are included for all indexes except Geo. Extended postal code lists for geographies can be quite long so they have to be explicitly requested when needed.\n *\n * Usage examples:\n *\n * extendedPostalCodesFor=POI\n *\n * extendedPostalCodesFor=PAD,Addr,POI\n *\n * extendedPostalCodesFor=None\n *\n * Extended postal code is returned as an **extendedPostalCode** property of an address. Availability is region-dependent.\n */\n extendedPostalCodesFor?: Array<\n \"Addr\" | \"Geo\" | \"PAD\" | \"POI\" | \"Str\" | \"Xstr\"\n >;\n /**\n * Minimum fuzziness level to be used. Default: 1, minimum: 1 and maximum: 4\n *\n * * Level 1 has no spell checking.\n *\n * * Level 2 uses normal n-gram spell checking. For example, query \"restrant\" can be matched to \"restaurant.\"\n *\n * * Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell checking is for \"rstrnt\" to \"restaurant\" matching. Shingle spell checking is for \"mountainview\" to \"mountain view\" matching.\n *\n * * Level 4 doesn’t add any more spell checking functions.\n *\n *\n *\n * The search engine will start looking for a match on the level defined by minFuzzyLevel, and will stop searching at the level specified by maxFuzzyLevel.\n */\n minFuzzyLevel?: number;\n /**\n * Maximum fuzziness level to be used. Default: 2, minimum: 1 and maximum: 4\n *\n * * Level 1 has no spell checking.\n *\n * * Level 2 uses normal n-gram spell checking. For example, query \"restrant\" can be matched to \"restaurant.\"\n *\n * * Level 3 uses sound-like spell checking, and shingle spell checking. Sound-like spell checking is for \"rstrnt\" to \"restaurant\" matching. Shingle spell checking is for \"mountainview\" to \"mountain view\" matching.\n *\n * * Level 4 doesn’t add any more spell checking functions.\n *\n *\n *\n * The search engine will start looking for a match on the level defined by minFuzzyLevel, and will stop searching at the level specified by maxFuzzyLevel.\n */\n maxFuzzyLevel?: number;\n /** A comma separated list of indexes which should be utilized for the search. Item order does not matter. Available indexes are: Addr = Address range interpolation, Geo = Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross Streets (intersections) */\n idxSet?: Array<\"Addr\" | \"Geo\" | \"PAD\" | \"POI\" | \"Str\" | \"Xstr\">;\n /**\n * A comma-separated list of brand names which could be used to restrict the result to specific brands. Item order does not matter. When multiple brands are provided, only results that belong to (at least) one of the provided list will be returned. Brands that contain a \",\" in their name should be put into quotes.\n *\n * Usage examples:\n *\n * brandSet=Foo\n *\n * brandSet=Foo,Bar\n *\n * brandSet=\"A,B,C Comma\",Bar\n */\n brandSet?: Array<string>;\n /**\n * A comma-separated list of connector types which could be used to restrict the result to Electric Vehicle Station supporting specific connector types. Item order does not matter. When multiple connector types are provided, only results that belong to (at least) one of the provided list will be returned.\n *\n * Available connector types are:\n * * `StandardHouseholdCountrySpecific` - These are the standard household connectors for a certain region. They are all AC single phase and the standard Voltage and standard Amperage. See also: [Plug & socket types - World Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets).\n * * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 standard. Also called Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a cable and plug attached to the charging point.\n * * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a socket set into the charging point.\n * * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 standard. Also called Scame after the original manufacturer. Mostly used in combination with up to 240V single phase or up to 420V three phase infrastructure.\n * * `Chademo` - CHAdeMO connector named after an association formed by the Tokyo Electric Power Company and industrial partners. Because of this is is also known as the TEPCO's connector. It supports fast DC charging.\n * * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined in the IEC 60309 standard. It is sometime referred to as by some combination of the standard, the color and the fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * * `IEC60309DCWhite` - Industrial White connector is a DC connector defined in the IEC 60309 standard.\n * * `Tesla` - The Tesla connector is the regionally specific Tesla Supercharger connector. I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n *\n * Usage examples:\n *\n * connectorSet=IEC62196Type2CableAttached\n * connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached\n */\n connectorSet?: Array<\n | \"StandardHouseholdCountrySpecific\"\n | \"IEC62196Type1\"\n | \"IEC62196Type1CCS\"\n | \"IEC62196Type2CableAttached\"\n | \"IEC62196Type2Outlet\"\n | \"IEC62196Type2CCS\"\n | \"IEC62196Type3\"\n | \"Chademo\"\n | \"IEC60309AC1PhaseBlue\"\n | \"IEC60309DCWhite\"\n | \"Tesla\"\n >;\n /**\n * Specifies the level of filtering performed on geographies. Narrows the search for specified geography entity types, e.g. return only municipality. The resulting response will contain the geography ID as well as the entity type matched. If you provide more than one entity as a comma separated list, endpoint will return the 'smallest entity available'. Returned Geometry ID can be used to get the geometry of that geography via [Get Search Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) API. The following parameters are ignored when entityType is set:\n *\n * * heading\n * * number\n * * returnRoadUse\n * * returnSpeedLimit\n * * roadUse\n * * returnMatchType\n */\n entityType?:\n | \"Country\"\n | \"CountrySubdivision\"\n | \"CountrySecondarySubdivision\"\n | \"CountryTertiarySubdivision\"\n | \"Municipality\"\n | \"MunicipalitySubdivision\"\n | \"Neighbourhood\"\n | \"PostalCodeArea\";\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n /**\n * Hours of operation for a POI (Points of Interest). The availability of hours of operation will vary based on the data available. If not passed, then no opening hours information will be returned.\n * Supported value: nextSevenDays\n */\n openingHours?: \"nextSevenDays\";\n}\n\nexport interface SearchFuzzySearchQueryParam {\n queryParameters: SearchFuzzySearchQueryParamProperties;\n}\n\nexport type SearchFuzzySearchParameters = SearchFuzzySearchQueryParam &\n RequestParameters;\n\nexport interface SearchSearchPointOfInterestQueryParamProperties {\n /** The POI name to search for (e.g., \"statue of liberty\", \"starbucks\"), must be properly URL encoded. */\n query: string;\n /** Boolean. If the typeahead flag is set, the query will be interpreted as a partial input and the search will enter predictive mode */\n typeahead?: boolean;\n /** Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100 */\n limit?: number;\n /** Starting offset of the returned results within the full result set. Default: 0, minimum: 0 and maximum: 1900 */\n ofs?: number;\n /**\n * A comma-separated list of category set IDs which could be used to restrict the result to specific Points of Interest categories. ID order does not matter. When multiple category identifiers are provided, only POIs that belong to (at least) one of the categories from the provided list will be returned. The list of supported categories can be discovered using [POI Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples:\n *\n * * **categorySet=7315** (Search Points of Interest from category Restaurant)\n *\n * * **categorySet=7315025,7315017** (Search Points of Interest of category either Italian or French Restaurant)\n */\n categorySet?: Array<number>;\n /** Comma separated string of country codes, e.g. FR,ES. This will limit the search to the specified countries */\n countrySet?: Array<string>;\n /** Latitude where results should be biased. E.g. 37.337 */\n lat?: number;\n /** Longitude where results should be biased. E.g. -121.89 */\n lon?: number;\n /** The radius in meters to for the results to be constrained to the defined area */\n radius?: number;\n /** Top left position of the bounding box. E.g. 37.553,-122.453 */\n topLeft?: string;\n /** Bottom right position of the bounding box. E.g. 37.553,-122.453 */\n btmRight?: string;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * Indexes for which extended postal codes should be included in the results.\n *\n * Available indexes are:\n *\n * **POI** = Points of Interest\n *\n * Value should be **POI** or **None** to disable extended postal codes.\n *\n * By default extended postal codes are included.\n *\n * Usage examples:\n *\n * extendedPostalCodesFor=POI\n *\n * extendedPostalCodesFor=None\n *\n * Extended postal code is returned as an **extendedPostalCode** property of an address. Availability is region-dependent.\n */\n extendedPostalCodesFor?: Array<\"POI\" | \"None\">;\n /**\n * A comma-separated list of brand names which could be used to restrict the result to specific brands. Item order does not matter. When multiple brands are provided, only results that belong to (at least) one of the provided list will be returned. Brands that contain a \",\" in their name should be put into quotes.\n *\n * Usage examples:\n *\n * brandSet=Foo\n *\n * brandSet=Foo,Bar\n *\n * brandSet=\"A,B,C Comma\",Bar\n */\n brandSet?: Array<string>;\n /**\n * A comma-separated list of connector types which could be used to restrict the result to Electric Vehicle Station supporting specific connector types. Item order does not matter. When multiple connector types are provided, only results that belong to (at least) one of the provided list will be returned.\n *\n * Available connector types are:\n * * `StandardHouseholdCountrySpecific` - These are the standard household connectors for a certain region. They are all AC single phase and the standard Voltage and standard Amperage. See also: [Plug & socket types - World Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets).\n * * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 standard. Also called Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a cable and plug attached to the charging point.\n * * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a socket set into the charging point.\n * * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 standard. Also called Scame after the original manufacturer. Mostly used in combination with up to 240V single phase or up to 420V three phase infrastructure.\n * * `Chademo` - CHAdeMO connector named after an association formed by the Tokyo Electric Power Company and industrial partners. Because of this is is also known as the TEPCO's connector. It supports fast DC charging.\n * * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined in the IEC 60309 standard. It is sometime referred to as by some combination of the standard, the color and the fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * * `IEC60309DCWhite` - Industrial White connector is a DC connector defined in the IEC 60309 standard.\n * * `Tesla` - The Tesla connector is the regionally specific Tesla Supercharger connector. I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n *\n * Usage examples:\n *\n * connectorSet=IEC62196Type2CableAttached\n * connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached\n */\n connectorSet?: Array<\n | \"StandardHouseholdCountrySpecific\"\n | \"IEC62196Type1\"\n | \"IEC62196Type1CCS\"\n | \"IEC62196Type2CableAttached\"\n | \"IEC62196Type2Outlet\"\n | \"IEC62196Type2CCS\"\n | \"IEC62196Type3\"\n | \"Chademo\"\n | \"IEC60309AC1PhaseBlue\"\n | \"IEC60309DCWhite\"\n | \"Tesla\"\n >;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n /**\n * Hours of operation for a POI (Points of Interest). The availability of hours of operation will vary based on the data available. If not passed, then no opening hours information will be returned.\n * Supported value: nextSevenDays\n */\n openingHours?: \"nextSevenDays\";\n}\n\nexport interface SearchSearchPointOfInterestQueryParam {\n queryParameters: SearchSearchPointOfInterestQueryParamProperties;\n}\n\nexport type SearchSearchPointOfInterestParameters = SearchSearchPointOfInterestQueryParam &\n RequestParameters;\n\nexport interface SearchSearchNearbyPointOfInterestQueryParamProperties {\n /** Latitude where results should be biased. E.g. 37.337. */\n lat: number;\n /** Longitude where results should be biased. E.g. -121.89. */\n lon: number;\n /** Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100 */\n limit?: number;\n /** Starting offset of the returned results within the full result set. Default: 0, minimum: 0 and maximum: 1900 */\n ofs?: number;\n /**\n * A comma-separated list of category set IDs which could be used to restrict the result to specific Points of Interest categories. ID order does not matter. When multiple category identifiers are provided, only POIs that belong to (at least) one of the categories from the provided list will be returned. The list of supported categories can be discovered using [POI Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples:\n *\n * * **categorySet=7315** (Search Points of Interest from category Restaurant)\n *\n * * **categorySet=7315025,7315017** (Search Points of Interest of category either Italian or French Restaurant)\n */\n categorySet?: Array<number>;\n /** Comma separated string of country codes, e.g. FR,ES. This will limit the search to the specified countries */\n countrySet?: Array<string>;\n /** The radius in meters to for the results to be constrained to the defined area, Min value is 1, Max Value is 50000. */\n radius?: number;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * Indexes for which extended postal codes should be included in the results.\n *\n * Available indexes are:\n *\n * **Addr** = Address ranges\n *\n * **Geo** = Geographies\n *\n * **PAD** = Point Addresses\n *\n * **POI** = Points of Interest\n *\n * **Str** = Streets\n *\n * **XStr** = Cross Streets (intersections)\n *\n * Value should be a comma separated list of index types (in any order) or **None** for no indexes.\n *\n * By default extended postal codes are included for all indexes except Geo. Extended postal code lists for geographies can be quite long so they have to be explicitly requested when needed.\n *\n * Usage examples:\n *\n * extendedPostalCodesFor=POI\n *\n * extendedPostalCodesFor=PAD,Addr,POI\n *\n * extendedPostalCodesFor=None\n *\n * Extended postal code is returned as an **extendedPostalCode** property of an address. Availability is region-dependent.\n */\n extendedPostalCodesFor?: Array<\n \"Addr\" | \"Geo\" | \"PAD\" | \"POI\" | \"Str\" | \"Xstr\"\n >;\n /**\n * A comma-separated list of brand names which could be used to restrict the result to specific brands. Item order does not matter. When multiple brands are provided, only results that belong to (at least) one of the provided list will be returned. Brands that contain a \",\" in their name should be put into quotes.\n *\n * Usage examples:\n *\n * brandSet=Foo\n *\n * brandSet=Foo,Bar\n *\n * brandSet=\"A,B,C Comma\",Bar\n */\n brandSet?: Array<string>;\n /**\n * A comma-separated list of connector types which could be used to restrict the result to Electric Vehicle Station supporting specific connector types. Item order does not matter. When multiple connector types are provided, only results that belong to (at least) one of the provided list will be returned.\n *\n * Available connector types are:\n * * `StandardHouseholdCountrySpecific` - These are the standard household connectors for a certain region. They are all AC single phase and the standard Voltage and standard Amperage. See also: [Plug & socket types - World Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets).\n * * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 standard. Also called Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a cable and plug attached to the charging point.\n * * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a socket set into the charging point.\n * * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 standard. Also called Scame after the original manufacturer. Mostly used in combination with up to 240V single phase or up to 420V three phase infrastructure.\n * * `Chademo` - CHAdeMO connector named after an association formed by the Tokyo Electric Power Company and industrial partners. Because of this is is also known as the TEPCO's connector. It supports fast DC charging.\n * * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined in the IEC 60309 standard. It is sometime referred to as by some combination of the standard, the color and the fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * * `IEC60309DCWhite` - Industrial White connector is a DC connector defined in the IEC 60309 standard.\n * * `Tesla` - The Tesla connector is the regionally specific Tesla Supercharger connector. I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n *\n * Usage examples:\n *\n * connectorSet=IEC62196Type2CableAttached\n * connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached\n */\n connectorSet?: Array<\n | \"StandardHouseholdCountrySpecific\"\n | \"IEC62196Type1\"\n | \"IEC62196Type1CCS\"\n | \"IEC62196Type2CableAttached\"\n | \"IEC62196Type2Outlet\"\n | \"IEC62196Type2CCS\"\n | \"IEC62196Type3\"\n | \"Chademo\"\n | \"IEC60309AC1PhaseBlue\"\n | \"IEC60309DCWhite\"\n | \"Tesla\"\n >;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n}\n\nexport interface SearchSearchNearbyPointOfInterestQueryParam {\n queryParameters: SearchSearchNearbyPointOfInterestQueryParamProperties;\n}\n\nexport type SearchSearchNearbyPointOfInterestParameters = SearchSearchNearbyPointOfInterestQueryParam &\n RequestParameters;\n\nexport interface SearchSearchPointOfInterestCategoryQueryParamProperties {\n /** The POI category to search for (e.g., \"AIRPORT\", \"RESTAURANT\"), must be properly URL encoded. Supported main categories can be requested by calling [Get Search POI Category Tree API](https://aka.ms/AzureMapsPOICategoryTree). List of available categories can also be found [here](https://docs.microsoft.com/azure/azure-maps/supported-search-categories). We recommend to use POI Search Category Tree API to request the supported categories. */\n query: string;\n /** Boolean. If the typeahead flag is set, the query will be interpreted as a partial input and the search will enter predictive mode */\n typeahead?: boolean;\n /** Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100 */\n limit?: number;\n /** Starting offset of the returned results within the full result set. Default: 0, minimum: 0 and maximum: 1900 */\n ofs?: number;\n /**\n * A comma-separated list of category set IDs which could be used to restrict the result to specific Points of Interest categories. ID order does not matter. When multiple category identifiers are provided, only POIs that belong to (at least) one of the categories from the provided list will be returned. The list of supported categories can be discovered using [POI Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples:\n *\n * * **categorySet=7315** (Search Points of Interest from category Restaurant)\n *\n * * **categorySet=7315025,7315017** (Search Points of Interest of category either Italian or French Restaurant)\n */\n categorySet?: Array<number>;\n /** Comma separated string of country codes, e.g. FR,ES. This will limit the search to the specified countries */\n countrySet?: Array<string>;\n /** Latitude where results should be biased. E.g. 37.337 */\n lat?: number;\n /** Longitude where results should be biased. E.g. -121.89 */\n lon?: number;\n /** The radius in meters to for the results to be constrained to the defined area */\n radius?: number;\n /** Top left position of the bounding box. E.g. 37.553,-122.453 */\n topLeft?: string;\n /** Bottom right position of the bounding box. E.g. 37.553,-122.453 */\n btmRight?: string;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * Indexes for which extended postal codes should be included in the results.\n *\n * Available indexes are:\n *\n * **Addr** = Address ranges\n *\n * **Geo** = Geographies\n *\n * **PAD** = Point Addresses\n *\n * **POI** = Points of Interest\n *\n * **Str** = Streets\n *\n * **XStr** = Cross Streets (intersections)\n *\n * Value should be a comma separated list of index types (in any order) or **None** for no indexes.\n *\n * By default extended postal codes are included for all indexes except Geo. Extended postal code lists for geographies can be quite long so they have to be explicitly requested when needed.\n *\n * Usage examples:\n *\n * extendedPostalCodesFor=POI\n *\n * extendedPostalCodesFor=PAD,Addr,POI\n *\n * extendedPostalCodesFor=None\n *\n * Extended postal code is returned as an **extendedPostalCode** property of an address. Availability is region-dependent.\n */\n extendedPostalCodesFor?: Array<\n \"Addr\" | \"Geo\" | \"PAD\" | \"POI\" | \"Str\" | \"Xstr\"\n >;\n /**\n * A comma-separated list of brand names which could be used to restrict the result to specific brands. Item order does not matter. When multiple brands are provided, only results that belong to (at least) one of the provided list will be returned. Brands that contain a \",\" in their name should be put into quotes.\n *\n * Usage examples:\n *\n * brandSet=Foo\n *\n * brandSet=Foo,Bar\n *\n * brandSet=\"A,B,C Comma\",Bar\n */\n brandSet?: Array<string>;\n /**\n * A comma-separated list of connector types which could be used to restrict the result to Electric Vehicle Station supporting specific connector types. Item order does not matter. When multiple connector types are provided, only results that belong to (at least) one of the provided list will be returned.\n *\n * Available connector types are:\n * * `StandardHouseholdCountrySpecific` - These are the standard household connectors for a certain region. They are all AC single phase and the standard Voltage and standard Amperage. See also: [Plug & socket types - World Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets).\n * * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 standard. Also called Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a cable and plug attached to the charging point.\n * * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a socket set into the charging point.\n * * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 standard. Also called Scame after the original manufacturer. Mostly used in combination with up to 240V single phase or up to 420V three phase infrastructure.\n * * `Chademo` - CHAdeMO connector named after an association formed by the Tokyo Electric Power Company and industrial partners. Because of this is is also known as the TEPCO's connector. It supports fast DC charging.\n * * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined in the IEC 60309 standard. It is sometime referred to as by some combination of the standard, the color and the fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * * `IEC60309DCWhite` - Industrial White connector is a DC connector defined in the IEC 60309 standard.\n * * `Tesla` - The Tesla connector is the regionally specific Tesla Supercharger connector. I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n *\n * Usage examples:\n *\n * connectorSet=IEC62196Type2CableAttached\n * connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached\n */\n connectorSet?: Array<\n | \"StandardHouseholdCountrySpecific\"\n | \"IEC62196Type1\"\n | \"IEC62196Type1CCS\"\n | \"IEC62196Type2CableAttached\"\n | \"IEC62196Type2Outlet\"\n | \"IEC62196Type2CCS\"\n | \"IEC62196Type3\"\n | \"Chademo\"\n | \"IEC60309AC1PhaseBlue\"\n | \"IEC60309DCWhite\"\n | \"Tesla\"\n >;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n /**\n * Hours of operation for a POI (Points of Interest). The availability of hours of operation will vary based on the data available. If not passed, then no opening hours information will be returned.\n * Supported value: nextSevenDays\n */\n openingHours?: \"nextSevenDays\";\n}\n\nexport interface SearchSearchPointOfInterestCategoryQueryParam {\n queryParameters: SearchSearchPointOfInterestCategoryQueryParamProperties;\n}\n\nexport type SearchSearchPointOfInterestCategoryParameters = SearchSearchPointOfInterestCategoryQueryParam &\n RequestParameters;\n\nexport interface SearchGetPointOfInterestCategoryTreeQueryParamProperties {\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, except NGT and NGT-Latn. Language tag is case insensitive. When data in specified language is not available for a specific field, default language is used (English).\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n}\n\nexport interface SearchGetPointOfInterestCategoryTreeQueryParam {\n queryParameters?: SearchGetPointOfInterestCategoryTreeQueryParamProperties;\n}\n\nexport type SearchGetPointOfInterestCategoryTreeParameters = SearchGetPointOfInterestCategoryTreeQueryParam &\n RequestParameters;\n\nexport interface SearchSearchAddressQueryParamProperties {\n /** The address to search for (e.g., \"1 Microsoft way, Redmond, WA\"), must be properly URL encoded. */\n query: string;\n /** Boolean. If the typeahead flag is set, the query will be interpreted as a partial input and the search will enter predictive mode */\n typeahead?: boolean;\n /** Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100 */\n limit?: number;\n /** Starting offset of the returned results within the full result set. Default: 0, minimum: 0 and maximum: 1900 */\n ofs?: number;\n /** Comma separated string of country codes, e.g. FR,ES. This will limit the search to the specified countries */\n countrySet?: Array<string>;\n /** Latitude where results should be biased. E.g. 37.337 */\n lat?: number;\n /** Longitude where results should be biased. E.g. -121.89 */\n lon?: number;\n /** The radius in meters to for the results to be constrained to the defined area */\n radius?: number;\n /** Top left position of the bounding box. E.g. 37.553,-122.453 */\n topLeft?: string;\n /** Bottom right position of the bounding box. E.g. 37.553,-122.453 */\n btmRight?: string;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * Indexes for which extended postal codes should be included in the results.\n *\n * Available indexes are:\n *\n * **Addr** = Address ranges\n *\n * **Geo** = Geographies\n *\n * **PAD** = Point Addresses\n *\n * **POI** = Points of Interest\n *\n * **Str** = Streets\n *\n * **XStr** = Cross Streets (intersections)\n *\n * Value should be a comma separated list of index types (in any order) or **None** for no indexes.\n *\n * By default extended postal codes are included for all indexes except Geo. Extended postal code lists for geographies can be quite long so they have to be explicitly requested when needed.\n *\n * Usage examples:\n *\n * extendedPostalCodesFor=POI\n *\n * extendedPostalCodesFor=PAD,Addr,POI\n *\n * extendedPostalCodesFor=None\n *\n * Extended postal code is returned as an **extendedPostalCode** property of an address. Availability is region-dependent.\n */\n extendedPostalCodesFor?: Array<\n \"Addr\" | \"Geo\" | \"PAD\" | \"POI\" | \"Str\" | \"Xstr\"\n >;\n /**\n * Specifies the level of filtering performed on geographies. Narrows the search for specified geography entity types, e.g. return only municipality. The resulting response will contain the geography ID as well as the entity type matched. If you provide more than one entity as a comma separated list, endpoint will return the 'smallest entity available'. Returned Geometry ID can be used to get the geometry of that geography via [Get Search Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) API. The following parameters are ignored when entityType is set:\n *\n * * heading\n * * number\n * * returnRoadUse\n * * returnSpeedLimit\n * * roadUse\n * * returnMatchType\n */\n entityType?:\n | \"Country\"\n | \"CountrySubdivision\"\n | \"CountrySecondarySubdivision\"\n | \"CountryTertiarySubdivision\"\n | \"Municipality\"\n | \"MunicipalitySubdivision\"\n | \"Neighbourhood\"\n | \"PostalCodeArea\";\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n}\n\nexport interface SearchSearchAddressQueryParam {\n queryParameters: SearchSearchAddressQueryParamProperties;\n}\n\nexport type SearchSearchAddressParameters = SearchSearchAddressQueryParam &\n RequestParameters;\n\nexport interface SearchReverseSearchAddressQueryParamProperties {\n /** The applicable query specified as a comma separated string composed by latitude followed by longitude e.g. \"47.641268,-122.125679\". */\n query: Array<number>;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /** Boolean. To enable return of the posted speed limit */\n returnSpeedLimit?: boolean;\n /** The directional heading of the vehicle in degrees, for travel along a segment of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can include upto one decimal place */\n heading?: number;\n /** The radius in meters to for the results to be constrained to the defined area */\n radius?: number;\n /** Street number as a string. If a number is sent in along with the request, the response may include the side of the street (Left/Right) and also an offset position for that number */\n number?: string;\n /** Boolean. To enable return of the road use array for reverse geocodes at street level */\n returnRoadUse?: boolean;\n /** To restrict reverse geocodes to a certain type of road use. The road use array for reverse geocodes can be one or more of LimitedAccess, Arterial, Terminal, Ramp, Rotary, LocalStreet */\n roadUse?: Array<\n | \"LimitedAccess\"\n | \"Arterial\"\n | \"Terminal\"\n | \"Ramp\"\n | \"Rotary\"\n | \"LocalStreet\"\n >;\n /**\n * Format of newlines in the formatted address.\n *\n * If true, the address will contain newlines.\n * If false, newlines will be converted to commas.\n */\n allowFreeformNewline?: boolean;\n /** Include information on the type of match the geocoder achieved in the response. */\n returnMatchType?: boolean;\n /**\n * Specifies the level of filtering performed on geographies. Narrows the search for specified geography entity types, e.g. return only municipality. The resulting response will contain the geography ID as well as the entity type matched. If you provide more than one entity as a comma separated list, endpoint will return the 'smallest entity available'. Returned Geometry ID can be used to get the geometry of that geography via [Get Search Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) API. The following parameters are ignored when entityType is set:\n *\n * * heading\n * * number\n * * returnRoadUse\n * * returnSpeedLimit\n * * roadUse\n * * returnMatchType\n */\n entityType?:\n | \"Country\"\n | \"CountrySubdivision\"\n | \"CountrySecondarySubdivision\"\n | \"CountryTertiarySubdivision\"\n | \"Municipality\"\n | \"MunicipalitySubdivision\"\n | \"Neighbourhood\"\n | \"PostalCodeArea\";\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n}\n\nexport interface SearchReverseSearchAddressQueryParam {\n queryParameters: SearchReverseSearchAddressQueryParamProperties;\n}\n\nexport type SearchReverseSearchAddressParameters = SearchReverseSearchAddressQueryParam &\n RequestParameters;\n\nexport interface SearchReverseSearchCrossStreetAddressQueryParamProperties {\n /** The applicable query specified as a comma separated string composed by latitude followed by longitude e.g. \"47.641268,-122.125679\". */\n query: Array<number>;\n /** Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100 */\n limit?: number;\n /** The directional heading of the vehicle in degrees, for travel along a segment of roadway. 0 is North, 90 is East and so on, values range from -360 to 360. The precision can include upto one decimal place */\n heading?: number;\n /** The radius in meters to for the results to be constrained to the defined area */\n radius?: number;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n}\n\nexport interface SearchReverseSearchCrossStreetAddressQueryParam {\n queryParameters: SearchReverseSearchCrossStreetAddressQueryParamProperties;\n}\n\nexport type SearchReverseSearchCrossStreetAddressParameters = SearchReverseSearchCrossStreetAddressQueryParam &\n RequestParameters;\n\nexport interface SearchSearchStructuredAddressQueryParamProperties {\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /** The 2 or 3 letter [ISO3166-1](https://www.iso.org/iso-3166-country-codes.html) country code portion of an address. E.g. US. */\n countryCode: string;\n /** Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100 */\n limit?: number;\n /** Starting offset of the returned results within the full result set. Default: 0, minimum: 0 and maximum: 1900 */\n ofs?: number;\n /** The street number portion of an address */\n streetNumber?: string;\n /** The street name portion of an address */\n streetName?: string;\n /** The cross street name for the structured address */\n crossStreet?: string;\n /** The municipality portion of an address */\n municipality?: string;\n /** The municipality subdivision (sub/super city) for the structured address */\n municipalitySubdivision?: string;\n /** The named area for the structured address */\n countryTertiarySubdivision?: string;\n /** The county for the structured address */\n countrySecondarySubdivision?: string;\n /** The country subdivision portion of an address */\n countrySubdivision?: string;\n /** The postal code portion of an address */\n postalCode?: string;\n /**\n * Indexes for which extended postal codes should be included in the results.\n *\n * Available indexes are:\n *\n * **Addr** = Address ranges\n *\n * **Geo** = Geographies\n *\n * **PAD** = Point Addresses\n *\n * **POI** = Points of Interest\n *\n * **Str** = Streets\n *\n * **XStr** = Cross Streets (intersections)\n *\n * Value should be a comma separated list of index types (in any order) or **None** for no indexes.\n *\n * By default extended postal codes are included for all indexes except Geo. Extended postal code lists for geographies can be quite long so they have to be explicitly requested when needed.\n *\n * Usage examples:\n *\n * extendedPostalCodesFor=POI\n *\n * extendedPostalCodesFor=PAD,Addr,POI\n *\n * extendedPostalCodesFor=None\n *\n * Extended postal code is returned as an **extendedPostalCode** property of an address. Availability is region-dependent.\n */\n extendedPostalCodesFor?: Array<\n \"Addr\" | \"Geo\" | \"PAD\" | \"POI\" | \"Str\" | \"Xstr\"\n >;\n /**\n * Specifies the level of filtering performed on geographies. Narrows the search for specified geography entity types, e.g. return only municipality. The resulting response will contain the geography ID as well as the entity type matched. If you provide more than one entity as a comma separated list, endpoint will return the 'smallest entity available'. Returned Geometry ID can be used to get the geometry of that geography via [Get Search Polygon](https://docs.microsoft.com/rest/api/maps/search/getsearchpolygon) API. The following parameters are ignored when entityType is set:\n *\n * * heading\n * * number\n * * returnRoadUse\n * * returnSpeedLimit\n * * roadUse\n * * returnMatchType\n */\n entityType?:\n | \"Country\"\n | \"CountrySubdivision\"\n | \"CountrySecondarySubdivision\"\n | \"CountryTertiarySubdivision\"\n | \"Municipality\"\n | \"MunicipalitySubdivision\"\n | \"Neighbourhood\"\n | \"PostalCodeArea\";\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n}\n\nexport interface SearchSearchStructuredAddressQueryParam {\n queryParameters: SearchSearchStructuredAddressQueryParamProperties;\n}\n\nexport type SearchSearchStructuredAddressParameters = SearchSearchStructuredAddressQueryParam &\n RequestParameters;\n\nexport interface SearchSearchInsideGeometryBodyParam {\n /** This represents the geometry for one or more geographical features (parks, state boundary etc.) to search in and should be a GeoJSON compliant type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946) for details. */\n body: SearchInsideGeometryRequest;\n}\n\nexport interface SearchSearchInsideGeometryQueryParamProperties {\n /** The POI name to search for (e.g., \"statue of liberty\", \"starbucks\", \"pizza\"). Must be properly URL encoded. */\n query: string;\n /** Maximum number of responses that will be returned. Default: 10, minimum: 1 and maximum: 100 */\n limit?: number;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * A comma-separated list of category set IDs which could be used to restrict the result to specific Points of Interest categories. ID order does not matter. When multiple category identifiers are provided, only POIs that belong to (at least) one of the categories from the provided list will be returned. The list of supported categories can be discovered using [POI Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples:\n *\n * * **categorySet=7315** (Search Points of Interest from category Restaurant)\n *\n * * **categorySet=7315025,7315017** (Search Points of Interest of category either Italian or French Restaurant)\n */\n categorySet?: Array<number>;\n /**\n * Indexes for which extended postal codes should be included in the results.\n *\n * Available indexes are:\n *\n * **Addr** = Address ranges\n *\n * **Geo** = Geographies\n *\n * **PAD** = Point Addresses\n *\n * **POI** = Points of Interest\n *\n * **Str** = Streets\n *\n * **XStr** = Cross Streets (intersections)\n *\n * Value should be a comma separated list of index types (in any order) or **None** for no indexes.\n *\n * By default extended postal codes are included for all indexes except Geo. Extended postal code lists for geographies can be quite long so they have to be explicitly requested when needed.\n *\n * Usage examples:\n *\n * extendedPostalCodesFor=POI\n *\n * extendedPostalCodesFor=PAD,Addr,POI\n *\n * extendedPostalCodesFor=None\n *\n * Extended postal code is returned as an **extendedPostalCode** property of an address. Availability is region-dependent.\n */\n extendedPostalCodesFor?: Array<\n \"Addr\" | \"Geo\" | \"PAD\" | \"POI\" | \"Str\" | \"Xstr\"\n >;\n /** A comma separated list of indexes which should be utilized for the search. Item order does not matter. Available indexes are: Addr = Address range interpolation, Geo = Geographies, PAD = Point Addresses, POI = Points of interest, Str = Streets, Xstr = Cross Streets (intersections) */\n idxSet?: Array<\"Addr\" | \"Geo\" | \"PAD\" | \"POI\" | \"Str\" | \"Xstr\">;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n /**\n * Hours of operation for a POI (Points of Interest). The availability of hours of operation will vary based on the data available. If not passed, then no opening hours information will be returned.\n * Supported value: nextSevenDays\n */\n openingHours?: \"nextSevenDays\";\n}\n\nexport interface SearchSearchInsideGeometryQueryParam {\n queryParameters: SearchSearchInsideGeometryQueryParamProperties;\n}\n\nexport interface SearchSearchInsideGeometryMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchSearchInsideGeometryParameters = SearchSearchInsideGeometryQueryParam &\n SearchSearchInsideGeometryMediaTypesParam &\n SearchSearchInsideGeometryBodyParam &\n RequestParameters;\n\nexport interface SearchSearchAlongRouteBodyParam {\n /** This represents the route to search along and should be a valid `GeoJSON LineString` type. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for details. */\n body: SearchAlongRouteRequest;\n}\n\nexport interface SearchSearchAlongRouteQueryParamProperties {\n /** The POI name to search for (e.g., \"statue of liberty\", \"starbucks\", \"pizza\"). Must be properly URL encoded. */\n query: string;\n /** Maximum detour time of the point of interest in seconds. Max value is 3600 seconds */\n maxDetourTime: number;\n /** Maximum number of responses that will be returned. Default value is 10. Max value is 20 */\n limit?: number;\n /**\n * A comma-separated list of brand names which could be used to restrict the result to specific brands. Item order does not matter. When multiple brands are provided, only results that belong to (at least) one of the provided list will be returned. Brands that contain a \",\" in their name should be put into quotes.\n *\n * Usage examples:\n *\n * brandSet=Foo\n *\n * brandSet=Foo,Bar\n *\n * brandSet=\"A,B,C Comma\",Bar\n */\n brandSet?: Array<string>;\n /**\n * A comma-separated list of category set IDs which could be used to restrict the result to specific Points of Interest categories. ID order does not matter. When multiple category identifiers are provided, only POIs that belong to (at least) one of the categories from the provided list will be returned. The list of supported categories can be discovered using [POI Categories API](https://aka.ms/AzureMapsPOICategoryTree). Usage examples:\n *\n * * **categorySet=7315** (Search Points of Interest from category Restaurant)\n *\n * * **categorySet=7315025,7315017** (Search Points of Interest of category either Italian or French Restaurant)\n */\n categorySet?: Array<number>;\n /**\n * A comma-separated list of connector types which could be used to restrict the result to Electric Vehicle Station supporting specific connector types. Item order does not matter. When multiple connector types are provided, only results that belong to (at least) one of the provided list will be returned.\n *\n * Available connector types are:\n * * `StandardHouseholdCountrySpecific` - These are the standard household connectors for a certain region. They are all AC single phase and the standard Voltage and standard Amperage. See also: [Plug & socket types - World Standards](https://www.worldstandards.eu/electricity/plugs-and-sockets).\n * * `IEC62196Type1` - Type 1 connector as defined in the IEC 62196-2 standard. Also called Yazaki after the original manufacturer or SAE J1772 after the standard that first published it. Mostly used in combination with 120V single phase or up to 240V single phase infrastructure.\n * * `IEC62196Type1CCS` - Type 1 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 1 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type2CableAttached` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a cable and plug attached to the charging point.\n * * `IEC62196Type2Outlet` - Type 2 connector as defined in the IEC 62196-2 standard. Provided as a socket set into the charging point.\n * * `IEC62196Type2CCS` - Type 2 based combo connector as defined in the IEC 62196-3 standard. The connector is based on the Type 2 connector – as defined in the IEC 62196-2 standard – with two additional direct current (DC) contacts to allow DC fast charging.\n * * `IEC62196Type3` - Type 3 connector as defined in the IEC 62196-2 standard. Also called Scame after the original manufacturer. Mostly used in combination with up to 240V single phase or up to 420V three phase infrastructure.\n * * `Chademo` - CHAdeMO connector named after an association formed by the Tokyo Electric Power Company and industrial partners. Because of this is is also known as the TEPCO's connector. It supports fast DC charging.\n * * `IEC60309AC1PhaseBlue` - Industrial Blue connector is a connector defined in the IEC 60309 standard. It is sometime referred to as by some combination of the standard, the color and the fact that is a single phase connector. The connector usually has the \"P+N+E, 6h\" configuration.\n * * `IEC60309DCWhite` - Industrial White connector is a DC connector defined in the IEC 60309 standard.\n * * `Tesla` - The Tesla connector is the regionally specific Tesla Supercharger connector. I.e. it refers to either Tesla's proprietary connector, sometimes referred to as Tesla Port mostly limited to North America or the modified Type 2 (DC over Type 2) in Europe.\n *\n * Usage examples:\n *\n * connectorSet=IEC62196Type2CableAttached\n * connectorSet=IEC62196Type2Outlet,IEC62196Type2CableAttached\n */\n connectorSet?: Array<\n | \"StandardHouseholdCountrySpecific\"\n | \"IEC62196Type1\"\n | \"IEC62196Type1CCS\"\n | \"IEC62196Type2CableAttached\"\n | \"IEC62196Type2Outlet\"\n | \"IEC62196Type2CCS\"\n | \"IEC62196Type3\"\n | \"Chademo\"\n | \"IEC60309AC1PhaseBlue\"\n | \"IEC60309DCWhite\"\n | \"Tesla\"\n >;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n /**\n * Hours of operation for a POI (Points of Interest). The availability of hours of operation will vary based on the data available. If not passed, then no opening hours information will be returned.\n * Supported value: nextSevenDays\n */\n openingHours?: \"nextSevenDays\";\n}\n\nexport interface SearchSearchAlongRouteQueryParam {\n queryParameters: SearchSearchAlongRouteQueryParamProperties;\n}\n\nexport interface SearchSearchAlongRouteMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchSearchAlongRouteParameters = SearchSearchAlongRouteQueryParam &\n SearchSearchAlongRouteMediaTypesParam &\n SearchSearchAlongRouteBodyParam &\n RequestParameters;\n\nexport interface SearchFuzzySearchBatchSyncBodyParam {\n /** The list of search fuzzy queries/requests to process. The list can contain a max of 10,000 queries and must contain at least 1 query. */\n body: BatchRequest;\n}\n\nexport interface SearchFuzzySearchBatchSyncMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchFuzzySearchBatchSyncParameters = SearchFuzzySearchBatchSyncMediaTypesParam &\n SearchFuzzySearchBatchSyncBodyParam &\n RequestParameters;\n\nexport interface SearchFuzzySearchBatchBodyParam {\n /** The list of search fuzzy queries/requests to process. The list can contain a max of 10,000 queries and must contain at least 1 query. */\n body: BatchRequest;\n}\n\nexport interface SearchFuzzySearchBatchMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchFuzzySearchBatchParameters = SearchFuzzySearchBatchMediaTypesParam &\n SearchFuzzySearchBatchBodyParam &\n RequestParameters;\nexport type SearchGetFuzzySearchBatchParameters = RequestParameters;\n\nexport interface SearchSearchAddressBatchSyncBodyParam {\n /** The list of address geocoding queries/requests to process. The list can contain a max of 10,000 queries and must contain at least 1 query. */\n body: BatchRequest;\n}\n\nexport interface SearchSearchAddressBatchSyncMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchSearchAddressBatchSyncParameters = SearchSearchAddressBatchSyncMediaTypesParam &\n SearchSearchAddressBatchSyncBodyParam &\n RequestParameters;\n\nexport interface SearchSearchAddressBatchBodyParam {\n /** The list of address geocoding queries/requests to process. The list can contain a max of 10,000 queries and must contain at least 1 query. */\n body: BatchRequest;\n}\n\nexport interface SearchSearchAddressBatchMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchSearchAddressBatchParameters = SearchSearchAddressBatchMediaTypesParam &\n SearchSearchAddressBatchBodyParam &\n RequestParameters;\nexport type SearchGetSearchAddressBatchParameters = RequestParameters;\n\nexport interface SearchReverseSearchAddressBatchSyncBodyParam {\n /** The list of reverse geocoding queries/requests to process. The list can contain a max of 10,000 queries and must contain at least 1 query. */\n body: BatchRequest;\n}\n\nexport interface SearchReverseSearchAddressBatchSyncMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchReverseSearchAddressBatchSyncParameters = SearchReverseSearchAddressBatchSyncMediaTypesParam &\n SearchReverseSearchAddressBatchSyncBodyParam &\n RequestParameters;\n\nexport interface SearchReverseSearchAddressBatchBodyParam {\n /** The list of reverse geocoding queries/requests to process. The list can contain a max of 10,000 queries and must contain at least 1 query. */\n body: BatchRequest;\n}\n\nexport interface SearchReverseSearchAddressBatchMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SearchReverseSearchAddressBatchParameters = SearchReverseSearchAddressBatchMediaTypesParam &\n SearchReverseSearchAddressBatchBodyParam &\n RequestParameters;\nexport type SearchGetReverseSearchAddressBatchParameters = RequestParameters;\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;IAEpE,MAAM,MAAM,GAAkC;QAC5C,aAAa,EAAE,eAAe,CAAC,OAAO,CAAC,MAAM;QAC7C,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG;QACxC,kBAAkB,EAAE,KAAK,IAAI,EAAE;YAC7B,sGAAsG;YACtG,2FAA2F;YAC3F,6BAA6B;YAC7B,OAAO,cAAc,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;QACD,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YAC9B,sEAAsE;YACtE,4EAA4E;YAC5E,0JAA0J;YAC1J,+GAA+G;YAC/G,MAAM,QAAQ,GAAG,MAAM,MAAM;iBAC1B,aAAa,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;iBAClD,GAAG,EAAE,CAAC;YACT,MAAM,WAAW,GAAG,cAAc,CAAC,QAAmB,CAAC,CAAC;YACxD,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC;gBAClD,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;YAC9B,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CACrB,QAAiB;IAEjB,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CACjB,uDAAuD,QAAQ,CAAC,MAAM,EAAE,CACzE,CAAC;KACH;IAED,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,WAAW,kCACN,QAAQ,KACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,GACpB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft 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"]}
|