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

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.
@@ -4,15 +4,15 @@
4
4
 
5
5
  ```ts
6
6
 
7
- import { AzureKeyCredential } from '@azure/core-auth';
8
- import { AzureSASCredential } from '@azure/core-auth';
7
+ import type { AzureKeyCredential } from '@azure/core-auth';
8
+ import type { AzureSASCredential } from '@azure/core-auth';
9
9
  import { Client } from '@azure-rest/core-client';
10
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';
14
14
  import { StreamableMethod } from '@azure-rest/core-client';
15
- import { TokenCredential } from '@azure/core-auth';
15
+ import type { TokenCredential } from '@azure/core-auth';
16
16
 
17
17
  // @public (undocumented)
18
18
  export interface AddressAdminDistrictsItemOutput {
@@ -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,12 +1,12 @@
1
- import { AzureKeyCredential } from '@azure/core-auth';
2
- import { AzureSASCredential } from '@azure/core-auth';
1
+ import type { AzureKeyCredential } from '@azure/core-auth';
2
+ import type { AzureSASCredential } from '@azure/core-auth';
3
3
  import { Client } from '@azure-rest/core-client';
4
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';
8
8
  import { StreamableMethod } from '@azure-rest/core-client';
9
- import { TokenCredential } from '@azure/core-auth';
9
+ import type { TokenCredential } from '@azure/core-auth';
10
10
 
11
11
  export declare interface AddressAdminDistrictsItemOutput {
12
12
  /**
@@ -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,74 +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 ?? 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
- const pathParts = path.split("/");
22
- // Traverse list to match the longest candidate
23
- // matchedLen: the length of candidate path
24
- // matchedValue: the matched status code array
25
- let matchedLen = -1, matchedValue = [];
26
- // Iterate the responseMap to find a match
27
- for (const [key, value] of Object.entries(responseMap)) {
28
- // Extracting the path from the map key which is in format
29
- // GET /path/foo
30
- if (!key.startsWith(method)) {
31
- continue;
32
- }
33
- const candidatePath = getPathFromMapKey(key);
34
- // Get each part of the url path
35
- const candidateParts = candidatePath.split("/");
36
- // track if we have found a match to return the values found.
37
- let found = true;
38
- for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
39
- if (candidateParts[i]?.startsWith("{") &&
40
- candidateParts[i]?.indexOf("}") !== -1) {
41
- const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
42
- // If the current part of the candidate is a "template" part
43
- // Try to use the suffix of pattern to match the path
44
- // {guid} ==> $
45
- // {guid}:export ==> :export$
46
- const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
47
- if (!isMatched) {
48
- found = false;
49
- break;
50
- }
51
- continue;
52
- }
53
- // If the candidate part is not a template and
54
- // the parts don't match mark the candidate as not found
55
- // to move on with the next candidate path.
56
- if (candidateParts[i] !== pathParts[j]) {
57
- found = false;
58
- break;
59
- }
60
- }
61
- // We finished evaluating the current candidate parts
62
- // Update the matched value if and only if we found the longer pattern
63
- if (found && candidatePath.length > matchedLen) {
64
- matchedLen = candidatePath.length;
65
- matchedValue = value;
66
- }
67
- }
68
- return matchedValue;
69
- }
70
- function getPathFromMapKey(mapKey) {
71
- const pathStart = mapKey.indexOf("/");
72
- return mapKey.slice(pathStart);
73
- }
74
- //# 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,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE;QAChB,WAAW,GAAG,0BAA0B,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;KAChE;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,0BAA0B,CAAC,MAAc,EAAE,IAAY;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,+CAA+C;IAC/C,2CAA2C;IAC3C,8CAA8C;IAC9C,IAAI,UAAU,GAAG,CAAC,CAAC,EACjB,YAAY,GAAa,EAAE,CAAC;IAE9B,0CAA0C;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACtD,0DAA0D;QAC1D,gBAAgB;QAChB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YAC3B,SAAS;SACV;QACD,MAAM,aAAa,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC7C,gCAAgC;QAChC,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhD,6DAA6D;QAC7D,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,KACE,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3D,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAChB,CAAC,EAAE,EAAE,CAAC,EAAE,EACR;YACA,IACE,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC;gBAClC,cAAc,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACtC;gBACA,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAC1B,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAC1C,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;gBAE3B,IAAI,CAAC,SAAS,EAAE;oBACd,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;gBACD,SAAS;aACV;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;gBACtC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;aACP;SACF;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;YAC9C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;SACtB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n SearchGetGeocoding200Response,\n SearchGetGeocodingDefaultResponse,\n SearchGetGeocodingBatch200Response,\n SearchGetGeocodingBatchDefaultResponse,\n SearchGetPolygon200Response,\n SearchGetPolygonDefaultResponse,\n SearchGetReverseGeocoding200Response,\n SearchGetReverseGeocodingDefaultResponse,\n SearchGetReverseGeocodingBatch200Response,\n SearchGetReverseGeocodingBatchDefaultResponse\n} from \"./responses\";\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,32 +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
- const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;
12
- options.apiVersion = options.apiVersion ?? "2023-06-01";
13
- const userAgentInfo = `azsdk-js-maps-search-rest/2.0.0-beta.1`;
14
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
15
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
16
- : `${userAgentInfo}`;
17
- options = {
18
- ...options,
19
- userAgentOptions: {
20
- userAgentPrefix
21
- },
22
- loggingOptions: {
23
- logger: options.loggingOptions?.logger ?? logger.info
24
- },
25
- credentials: {
26
- apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? "subscription-key"
27
- }
28
- };
29
- const client = getClient(baseUrl, credentials, options);
30
- return client;
31
- }
32
- //# 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,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACjE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,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,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI;SACtD;QACD,WAAW,EAAE;YACX,gBAAgB,EACd,OAAO,CAAC,WAAW,EAAE,gBAAgB,IAAI,kBAAkB;SAC9D;KACF,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