From 7be2540fb395e996a414e8e85584ebdcc9aa4401 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 10 Jan 2022 21:52:16 +0000 Subject: [PATCH] CodeGen from PR 17297 in Azure/azure-rest-api-specs Merge fdfe4e54855152fca09d8b4ff984b41611d5adfd into 9a19506631005d0ff1e3f394c86a9ce10cf51910 --- sdk/maps/azure-maps-spatial/CHANGELOG.md | 13 + sdk/maps/azure-maps-spatial/README.md | 63 + sdk/maps/azure-maps-spatial/pom.xml | 76 + .../AzureMapsSpatialServiceAsyncClient.java | 739 ++++++ .../AzureMapsSpatialServiceClient.java | 737 +++++ .../AzureMapsSpatialServiceClientBuilder.java | 335 +++ .../AzureMapsSpatialServiceVersion.java | 33 + .../AzureMapsSpatialServiceClientImpl.java | 166 ++ .../spatial/implementation/SpatialsImpl.java | 2359 +++++++++++++++++ .../com/azure/maps/spatial/package-info.java | 6 + .../src/main/java/module-info.java | 9 + .../resources/azure-maps-spatial.properties | 2 + .../com/azure/maps/spatial/ReadmeSamples.java | 12 + .../maps/spatial/generated/GetBuffer.java | 26 + .../spatial/generated/GetClosestPoint.java | 25 + .../maps/spatial/generated/GetGeofence.java | 30 + .../generated/GetGreatCircleDistance.java | 25 + .../spatial/generated/GetPointInPolygon.java | 25 + .../maps/spatial/generated/PostBuffer.java | 27 + .../spatial/generated/PostClosestPoint.java | 28 + .../maps/spatial/generated/PostGeofence.java | 33 + .../spatial/generated/PostPointInPolygon.java | 28 + .../com/azure/maps/spatial/ClientTests.java | 47 + .../azure-maps-spatial/swagger/README_SPEC.md | 26 + 24 files changed, 4870 insertions(+) create mode 100644 sdk/maps/azure-maps-spatial/CHANGELOG.md create mode 100644 sdk/maps/azure-maps-spatial/README.md create mode 100644 sdk/maps/azure-maps-spatial/pom.xml create mode 100644 sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceAsyncClient.java create mode 100644 sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceClient.java create mode 100644 sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceClientBuilder.java create mode 100644 sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceVersion.java create mode 100644 sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/implementation/AzureMapsSpatialServiceClientImpl.java create mode 100644 sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/implementation/SpatialsImpl.java create mode 100644 sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/package-info.java create mode 100644 sdk/maps/azure-maps-spatial/src/main/java/module-info.java create mode 100644 sdk/maps/azure-maps-spatial/src/main/resources/azure-maps-spatial.properties create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/ReadmeSamples.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetBuffer.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetClosestPoint.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetGeofence.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetGreatCircleDistance.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetPointInPolygon.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostBuffer.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostClosestPoint.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostGeofence.java create mode 100644 sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostPointInPolygon.java create mode 100644 sdk/maps/azure-maps-spatial/src/test/java/com/azure/maps/spatial/ClientTests.java create mode 100644 sdk/maps/azure-maps-spatial/swagger/README_SPEC.md diff --git a/sdk/maps/azure-maps-spatial/CHANGELOG.md b/sdk/maps/azure-maps-spatial/CHANGELOG.md new file mode 100644 index 000000000000..d8e812f9a9de --- /dev/null +++ b/sdk/maps/azure-maps-spatial/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AzureMapsSpatialService client library for Java. This package contains Microsoft Azure AzureMapsSpatialService client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/maps/azure-maps-spatial/README.md b/sdk/maps/azure-maps-spatial/README.md new file mode 100644 index 000000000000..a8ba878b0d8d --- /dev/null +++ b/sdk/maps/azure-maps-spatial/README.md @@ -0,0 +1,63 @@ +# Azure AzureMapsSpatialService client library for Java + +Azure AzureMapsSpatialService client library for Java. + +This package contains Microsoft Azure AzureMapsSpatialService client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-maps-spatial;current}) +```xml + + com.azure + azure-maps-spatial + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.maps.spatial.readme +``` + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/maps/azure-maps-spatial/pom.xml b/sdk/maps/azure-maps-spatial/pom.xml new file mode 100644 index 000000000000..99ced4db3c6d --- /dev/null +++ b/sdk/maps/azure-maps-spatial/pom.xml @@ -0,0 +1,76 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-maps-spatial + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureMapsSpatialService Management + This package contains Microsoft Azure AzureMapsSpatialService client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + false + + + + + + com.azure + azure-core + 1.24.0 + + + com.azure + azure-core-http-netty + 1.11.5 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.1 + test + + + com.azure + azure-core-test + 1.7.6 + test + + + com.azure + azure-identity + 1.4.2 + test + + + diff --git a/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceAsyncClient.java b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceAsyncClient.java new file mode 100644 index 000000000000..a6b04a69a4e8 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceAsyncClient.java @@ -0,0 +1,739 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.maps.spatial.implementation.SpatialsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AzureMapsSpatialServiceClient type. */ +@ServiceClient(builder = AzureMapsSpatialServiceClientBuilder.class, isAsync = true) +public final class AzureMapsSpatialServiceAsyncClient { + @Generated private final SpatialsImpl serviceClient; + + /** + * Initializes an instance of Spatials client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsSpatialServiceAsyncClient(SpatialsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Search Geofence Get API** + * + *

**Applies to:** S1 Pricing tier. + * + *

The Geofence Get API allows you to retrieve the proximity of a coordinate to a geofence that has been uploaded + * to the Data service. You can use the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) to upload a geofence or set of fences. + * See [Geofencing GeoJSON data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more + * details on the geofence data format. To query the proximity of a coordinate, you supply the location of the + * object you are tracking as well as the ID for the fence or set of fences, and the response will contain + * information about the distance from the outer edge of the geofence. A negative value signifies that the + * coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). To test this API, you can upload the sample + * data from Post Geofence API examples(Request Body) via Data Upload API and replace the [udid] from the sample + * request below with the udid returned by Data Upload API. + * + *

### Geofencing InnerError code + * + *

In geofencing response error contract, `innererror` is an object containing service specific information about + * the error. `code` is a property in `innererror` which can map to a specific geofencing error type. The table + * belows shows the code mapping between all the known client error type to the corresponding geofencing error + * `message`. + * + *

innererror.code | error.message ---------------------------- | -------------------------------------- + * NullDeviceId | Device Id should not be null. NullUdid | Udid should not be null. UdidWrongFormat| Udid should be + * acquired from user data ingestion API. InvalidUserTime| Usertime is invalid. InvalidSearchBuffer| Searchbuffer is + * invalid. InvalidSearchRange| The value range of searchbuffer should be from 0 to 500 meters. InvalidLatLon| Lat + * and/or lon parameters are invalid. InvalidIsAsyncValue| The IsAsync parameter is invalid. InvalidModeValue| The + * mode parameter invalid. InvalidJson| Geofencing data is not a valid json file. NotSupportedGeoJson| Geofencing + * data can't be read as a Feature or FeatureCollections. InvalidGeoJson| Geofencing data is invalid. + * NoUserDataWithAccountOrSubscription| Can't find user geofencing data with provided account-id and/or + * subscription-id. NoUserDataWithUdid| Can't find user geofencing data with provided udid. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion is used. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.Now.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGeofenceWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getGeofenceWithResponseAsync(format, requestOptions); + } + + /** + * **Search Geofence Post API** **Applies to:** S1 Pricing tier. The Geofence Post API allows you to retrieve the + * proximity of a coordinate to a provided geofence or set of fences. With POST call, you do not have to upload the + * fence data in advance, instead you supply the location of the object you are tracking in query parameters as well + * as the fence or set of fences data in post request body. See [Geofencing GeoJSON + * data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more details on the geofence data + * format. The response will contain information about the distance from the outer edge of the geofence. A negative + * value signifies that the coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion geofencing is applied. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.UtcNow.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param searchGeofenceRequestBody The geofencing GeoJSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postGeofenceWithResponse( + String format, BinaryData searchGeofenceRequestBody, RequestOptions requestOptions) { + return this.serviceClient.postGeofenceWithResponseAsync(format, searchGeofenceRequestBody, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input may + * contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and MultiLineString. + * GeometryCollection will be ignored if provided. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     geometries: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     *     distances: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param bufferRequestBody The FeatureCollection and the list of distances (one per feature or one for all + * features). + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postBufferWithResponse( + String format, BinaryData bufferRequestBody, RequestOptions requestOptions) { + return this.serviceClient.postBufferWithResponseAsync(format, bufferRequestBody, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input features + * are provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and + * MultiLineString. GeometryCollection will be ignored if provided. + * + *

To test this API, you can upload the sample data from [Post Buffer + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postbuffer#examples) examples(Request Body without + * distances array) via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and + * replace the [udid] from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getbuffer#examples) with the udid returned by Data + * Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
distancesStringYesThe list of distances (one per feature or one for all features), delimited by semicolons. For example, 12.34;-56.78. Positive distance will generate a buffer outside of the feature, whereas negative distance will generate a buffer inside of the feature. If the negative distance larger than the geometry itself, an empty polygon will be returned.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBufferWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getBufferWithResponseAsync(format, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of target points. The set of target + * points is provided by user data in post request body. The user data may only contain a collection of Point + * geometry. MultiPoint or other geometries will be ignored if provided. The algorithm does not take into account + * routing or traffic. The maximum number of points accepted is 100,000. Information returned includes closest point + * latitude, longitude, and distance in meters from the closest point. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param closestPointRequestBody The FeatureCollection of Point geometries from which closest point to source point + * should be determined. All the feature's properties should contain `geometryId`, which is used for identifying + * the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postClosestPointWithResponse( + String format, BinaryData closestPointRequestBody, RequestOptions requestOptions) { + return this.serviceClient.postClosestPointWithResponseAsync(format, closestPointRequestBody, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of points in the user uploaded data + * set identified by udid. The set of target points is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may only contain a collection of Point geometry. MultiPoint or other geometries will be ignored if + * provided. The maximum number of points accepted is 100,000. The algorithm does not take into account routing or + * traffic. Information returned includes closest point latitude, longitude, and distance in meters from the closest + * point. + * + *

To test this API, you can upload the sample data from [Post Closest Point + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postclosestpoint#examples) examples(Request Body) via + * [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] from + * the [sample request below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getclosestpoint#examples) with + * the udid returned by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getClosestPointWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getClosestPointWithResponseAsync(format, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The user data may + * contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If the point is inside + * or on the boundary of one of these polygons, the value returned is true. In all other cases, the value returned + * is false. When the point is inside multiple polygons, the result will give intersecting geometries section to + * show all valid geometries (referenced by geometryId) in user data. The maximum number of vertices accepted to + * form a Polygon is 10,000. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param pointInPolygonRequestBody A FeatureCollection with a set of Polygon/MultiPolygon geometries. The maximum + * number of vertices accepted to form a Polygon is 10,000. All the feature's properties should contain + * `geometryId`, which is used for identifying the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postPointInPolygonWithResponse( + String format, BinaryData pointInPolygonRequestBody, RequestOptions requestOptions) { + return this.serviceClient.postPointInPolygonWithResponseAsync( + format, pointInPolygonRequestBody, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The set of polygons + * is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If + * the point is inside or on the boundary of one of these polygons, the value returned is true. In all other cases, + * the value returned is false. When the point is inside multiple polygons, the result will give intersecting + * geometries section to show all valid geometries(referenced by geometryId) in user data. The maximum number of + * vertices accepted to form a Polygon is 10,000. + * + *

To test this API, you can upload the sample data from [Post Point In Polygon + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postpointinpolygon#examples) examples(Request Body) + * via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] + * from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getpointinpolygon#examples) with the udid returned + * by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPointInPolygonWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getPointInPolygonWithResponseAsync(format, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API will return the great-circle or shortest distance between two points on the surface of a sphere, + * measured along the surface of the sphere. This differs from calculating a straight line through the sphere's + * interior. This method is helpful for estimating travel distances for airplanes by calculating the shortest + * distance between airports. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
queryStringYesThe Coordinates through which the distance is calculated, delimited by a colon. Two coordinates are required. The first one is the source point coordinate and the last is the target point coordinate. For example, 47.622942,122.316456:57.673988,127.121513
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         targetPoint: (recursive schema, see targetPoint above)
+     *     }
+     *     result: {
+     *         distanceInMeters: Float
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Great Circle Distance call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGreatCircleDistanceWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getGreatCircleDistanceWithResponseAsync(format, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceClient.java b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceClient.java new file mode 100644 index 000000000000..5e9bdd1e6bbc --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceClient.java @@ -0,0 +1,737 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.maps.spatial.implementation.SpatialsImpl; + +/** Initializes a new instance of the synchronous AzureMapsSpatialServiceClient type. */ +@ServiceClient(builder = AzureMapsSpatialServiceClientBuilder.class) +public final class AzureMapsSpatialServiceClient { + @Generated private final SpatialsImpl serviceClient; + + /** + * Initializes an instance of Spatials client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsSpatialServiceClient(SpatialsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Search Geofence Get API** + * + *

**Applies to:** S1 Pricing tier. + * + *

The Geofence Get API allows you to retrieve the proximity of a coordinate to a geofence that has been uploaded + * to the Data service. You can use the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) to upload a geofence or set of fences. + * See [Geofencing GeoJSON data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more + * details on the geofence data format. To query the proximity of a coordinate, you supply the location of the + * object you are tracking as well as the ID for the fence or set of fences, and the response will contain + * information about the distance from the outer edge of the geofence. A negative value signifies that the + * coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). To test this API, you can upload the sample + * data from Post Geofence API examples(Request Body) via Data Upload API and replace the [udid] from the sample + * request below with the udid returned by Data Upload API. + * + *

### Geofencing InnerError code + * + *

In geofencing response error contract, `innererror` is an object containing service specific information about + * the error. `code` is a property in `innererror` which can map to a specific geofencing error type. The table + * belows shows the code mapping between all the known client error type to the corresponding geofencing error + * `message`. + * + *

innererror.code | error.message ---------------------------- | -------------------------------------- + * NullDeviceId | Device Id should not be null. NullUdid | Udid should not be null. UdidWrongFormat| Udid should be + * acquired from user data ingestion API. InvalidUserTime| Usertime is invalid. InvalidSearchBuffer| Searchbuffer is + * invalid. InvalidSearchRange| The value range of searchbuffer should be from 0 to 500 meters. InvalidLatLon| Lat + * and/or lon parameters are invalid. InvalidIsAsyncValue| The IsAsync parameter is invalid. InvalidModeValue| The + * mode parameter invalid. InvalidJson| Geofencing data is not a valid json file. NotSupportedGeoJson| Geofencing + * data can't be read as a Feature or FeatureCollections. InvalidGeoJson| Geofencing data is invalid. + * NoUserDataWithAccountOrSubscription| Can't find user geofencing data with provided account-id and/or + * subscription-id. NoUserDataWithUdid| Can't find user geofencing data with provided udid. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion is used. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.Now.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGeofenceWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getGeofenceWithResponse(format, requestOptions); + } + + /** + * **Search Geofence Post API** **Applies to:** S1 Pricing tier. The Geofence Post API allows you to retrieve the + * proximity of a coordinate to a provided geofence or set of fences. With POST call, you do not have to upload the + * fence data in advance, instead you supply the location of the object you are tracking in query parameters as well + * as the fence or set of fences data in post request body. See [Geofencing GeoJSON + * data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more details on the geofence data + * format. The response will contain information about the distance from the outer edge of the geofence. A negative + * value signifies that the coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion geofencing is applied. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.UtcNow.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param searchGeofenceRequestBody The geofencing GeoJSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postGeofenceWithResponse( + String format, BinaryData searchGeofenceRequestBody, RequestOptions requestOptions) { + return this.serviceClient.postGeofenceWithResponse(format, searchGeofenceRequestBody, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input may + * contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and MultiLineString. + * GeometryCollection will be ignored if provided. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     geometries: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     *     distances: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param bufferRequestBody The FeatureCollection and the list of distances (one per feature or one for all + * features). + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postBufferWithResponse( + String format, BinaryData bufferRequestBody, RequestOptions requestOptions) { + return this.serviceClient.postBufferWithResponse(format, bufferRequestBody, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input features + * are provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and + * MultiLineString. GeometryCollection will be ignored if provided. + * + *

To test this API, you can upload the sample data from [Post Buffer + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postbuffer#examples) examples(Request Body without + * distances array) via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and + * replace the [udid] from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getbuffer#examples) with the udid returned by Data + * Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
distancesStringYesThe list of distances (one per feature or one for all features), delimited by semicolons. For example, 12.34;-56.78. Positive distance will generate a buffer outside of the feature, whereas negative distance will generate a buffer inside of the feature. If the negative distance larger than the geometry itself, an empty polygon will be returned.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBufferWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getBufferWithResponse(format, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of target points. The set of target + * points is provided by user data in post request body. The user data may only contain a collection of Point + * geometry. MultiPoint or other geometries will be ignored if provided. The algorithm does not take into account + * routing or traffic. The maximum number of points accepted is 100,000. Information returned includes closest point + * latitude, longitude, and distance in meters from the closest point. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param closestPointRequestBody The FeatureCollection of Point geometries from which closest point to source point + * should be determined. All the feature's properties should contain `geometryId`, which is used for identifying + * the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postClosestPointWithResponse( + String format, BinaryData closestPointRequestBody, RequestOptions requestOptions) { + return this.serviceClient.postClosestPointWithResponse(format, closestPointRequestBody, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of points in the user uploaded data + * set identified by udid. The set of target points is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may only contain a collection of Point geometry. MultiPoint or other geometries will be ignored if + * provided. The maximum number of points accepted is 100,000. The algorithm does not take into account routing or + * traffic. Information returned includes closest point latitude, longitude, and distance in meters from the closest + * point. + * + *

To test this API, you can upload the sample data from [Post Closest Point + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postclosestpoint#examples) examples(Request Body) via + * [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] from + * the [sample request below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getclosestpoint#examples) with + * the udid returned by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getClosestPointWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getClosestPointWithResponse(format, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The user data may + * contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If the point is inside + * or on the boundary of one of these polygons, the value returned is true. In all other cases, the value returned + * is false. When the point is inside multiple polygons, the result will give intersecting geometries section to + * show all valid geometries (referenced by geometryId) in user data. The maximum number of vertices accepted to + * form a Polygon is 10,000. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param pointInPolygonRequestBody A FeatureCollection with a set of Polygon/MultiPolygon geometries. The maximum + * number of vertices accepted to form a Polygon is 10,000. All the feature's properties should contain + * `geometryId`, which is used for identifying the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postPointInPolygonWithResponse( + String format, BinaryData pointInPolygonRequestBody, RequestOptions requestOptions) { + return this.serviceClient.postPointInPolygonWithResponse(format, pointInPolygonRequestBody, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The set of polygons + * is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If + * the point is inside or on the boundary of one of these polygons, the value returned is true. In all other cases, + * the value returned is false. When the point is inside multiple polygons, the result will give intersecting + * geometries section to show all valid geometries(referenced by geometryId) in user data. The maximum number of + * vertices accepted to form a Polygon is 10,000. + * + *

To test this API, you can upload the sample data from [Post Point In Polygon + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postpointinpolygon#examples) examples(Request Body) + * via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] + * from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getpointinpolygon#examples) with the udid returned + * by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPointInPolygonWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getPointInPolygonWithResponse(format, requestOptions); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API will return the great-circle or shortest distance between two points on the surface of a sphere, + * measured along the surface of the sphere. This differs from calculating a straight line through the sphere's + * interior. This method is helpful for estimating travel distances for airplanes by calculating the shortest + * distance between airports. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
queryStringYesThe Coordinates through which the distance is calculated, delimited by a colon. Two coordinates are required. The first one is the source point coordinate and the last is the target point coordinate. For example, 47.622942,122.316456:57.673988,127.121513
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         targetPoint: (recursive schema, see targetPoint above)
+     *     }
+     *     result: {
+     *         distanceInMeters: Float
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Great Circle Distance call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGreatCircleDistanceWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getGreatCircleDistanceWithResponse(format, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceClientBuilder.java b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceClientBuilder.java new file mode 100644 index 000000000000..9ce6b2870c57 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceClientBuilder.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.maps.spatial.implementation.AzureMapsSpatialServiceClientImpl; +import com.azure.maps.spatial.models.Geography; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the AzureMapsSpatialServiceClient type. */ +@ServiceClientBuilder(serviceClients = {AzureMapsSpatialServiceClient.class, AzureMapsSpatialServiceAsyncClient.class}) +public final class AzureMapsSpatialServiceClientBuilder { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated static final String[] DEFAULT_SCOPES = new String[] {"https://maps.azure.com/.default"}; + + @Generated private final Map properties = CoreUtils.getProperties("azure-maps-spatial.properties"); + + /** Create an instance of the AzureMapsSpatialServiceClientBuilder. */ + @Generated + public AzureMapsSpatialServiceClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * Specifies which account is intended for usage in conjunction with the + * Azure AD security model. It represents a unique ID for the Azure Maps + * account and can be retrieved from the Azure Maps management plane + * Account API. To use Azure AD security in Azure Maps see the following + * [articles](https://aka.ms/amauthdetails) for guidance. + */ + @Generated private String clientId; + + /** + * Sets Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents + * a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To + * use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance. + * + * @param clientId the clientId value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /* + * This parameter specifies where the Azure Maps Creator resource is + * located. Valid values are us and eu. + */ + @Generated private Geography geography; + + /** + * Sets This parameter specifies where the Azure Maps Creator resource is located. Valid values are us and eu. + * + * @param geography the geography value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder geography(Geography geography) { + this.geography = geography; + return this; + } + + /* + * Service version + */ + @Generated private AzureMapsSpatialServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder serviceVersion(AzureMapsSpatialServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + @Generated private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** + * Sets The HTTP client used to send the request. + * + * @param httpClient the httpClient value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The configuration store that is used during construction of the service + * client. + */ + @Generated private Configuration configuration; + + /** + * Sets The configuration store that is used during construction of the service client. + * + * @param configuration the configuration value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** + * Sets The TokenCredential used for authentication. + * + * @param tokenCredential the tokenCredential value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** + * Sets The logging configuration for HTTP requests and responses. + * + * @param httpLogOptions the httpLogOptions value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if + * applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /* + * The list of Http pipeline policies to add. + */ + @Generated private final List pipelinePolicies; + + /* + * The client options such as application ID and custom headers to set on a + * request. + */ + @Generated private ClientOptions clientOptions; + + /** + * Sets The client options such as application ID and custom headers to set on a request. + * + * @param clientOptions the clientOptions value. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /** + * Adds a custom Http pipeline policy. + * + * @param customPolicy The custom Http pipeline policy to add. + * @return the AzureMapsSpatialServiceClientBuilder. + */ + @Generated + public AzureMapsSpatialServiceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AzureMapsSpatialServiceClientImpl with the provided parameters. + * + * @return an instance of AzureMapsSpatialServiceClientImpl. + */ + @Generated + private AzureMapsSpatialServiceClientImpl buildInnerClient() { + if (geography == null) { + this.geography = Geography.US; + } + if (serviceVersion == null) { + this.serviceVersion = AzureMapsSpatialServiceVersion.getLatest(); + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AzureMapsSpatialServiceClientImpl client = + new AzureMapsSpatialServiceClientImpl( + pipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of AzureMapsSpatialServiceAsyncClient async client. + * + * @return an instance of AzureMapsSpatialServiceAsyncClient. + */ + @Generated + public AzureMapsSpatialServiceAsyncClient buildAsyncClient() { + return new AzureMapsSpatialServiceAsyncClient(buildInnerClient().getSpatials()); + } + + /** + * Builds an instance of AzureMapsSpatialServiceClient sync client. + * + * @return an instance of AzureMapsSpatialServiceClient. + */ + @Generated + public AzureMapsSpatialServiceClient buildClient() { + return new AzureMapsSpatialServiceClient(buildInnerClient().getSpatials()); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceVersion.java b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceVersion.java new file mode 100644 index 000000000000..4d0883d9a796 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/AzureMapsSpatialServiceVersion.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AzureMapsSpatialServiceClient. */ +public enum AzureMapsSpatialServiceVersion implements ServiceVersion { + /** Enum value 1.0. */ + V1_0("1.0"); + + private final String version; + + AzureMapsSpatialServiceVersion(String version) { + this.version = version; + } + + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link AzureMapsSpatialServiceVersion}. + */ + public static AzureMapsSpatialServiceVersion getLatest() { + return V1_0; + } +} diff --git a/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/implementation/AzureMapsSpatialServiceClientImpl.java b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/implementation/AzureMapsSpatialServiceClientImpl.java new file mode 100644 index 000000000000..8527526e0d8d --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/implementation/AzureMapsSpatialServiceClientImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.implementation; + +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.maps.spatial.AzureMapsSpatialServiceVersion; +import com.azure.maps.spatial.models.Geography; + +/** Initializes a new instance of the AzureMapsSpatialServiceClient type. */ +public final class AzureMapsSpatialServiceClientImpl { + /** + * Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents a + * unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To + * use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance. + */ + private final String clientId; + + /** + * Gets Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents + * a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To + * use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance. + * + * @return the clientId value. + */ + public String getClientId() { + return this.clientId; + } + + /** This parameter specifies where the Azure Maps Creator resource is located. Valid values are us and eu. */ + private final Geography geography; + + /** + * Gets This parameter specifies where the Azure Maps Creator resource is located. Valid values are us and eu. + * + * @return the geography value. + */ + public Geography getGeography() { + return this.geography; + } + + /** Service version. */ + private final AzureMapsSpatialServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AzureMapsSpatialServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The SpatialsImpl object to access its operations. */ + private final SpatialsImpl spatials; + + /** + * Gets the SpatialsImpl object to access its operations. + * + * @return the SpatialsImpl object. + */ + public SpatialsImpl getSpatials() { + return this.spatials; + } + + /** + * Initializes an instance of AzureMapsSpatialServiceClient client. + * + * @param clientId Specifies which account is intended for usage in conjunction with the Azure AD security model. It + * represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane + * Account API. To use Azure AD security in Azure Maps see the following + * [articles](https://aka.ms/amauthdetails) for guidance. + * @param geography This parameter specifies where the Azure Maps Creator resource is located. Valid values are us + * and eu. + * @param serviceVersion Service version. + */ + public AzureMapsSpatialServiceClientImpl( + String clientId, Geography geography, AzureMapsSpatialServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + clientId, + geography, + serviceVersion); + } + + /** + * Initializes an instance of AzureMapsSpatialServiceClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param clientId Specifies which account is intended for usage in conjunction with the Azure AD security model. It + * represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane + * Account API. To use Azure AD security in Azure Maps see the following + * [articles](https://aka.ms/amauthdetails) for guidance. + * @param geography This parameter specifies where the Azure Maps Creator resource is located. Valid values are us + * and eu. + * @param serviceVersion Service version. + */ + public AzureMapsSpatialServiceClientImpl( + HttpPipeline httpPipeline, + String clientId, + Geography geography, + AzureMapsSpatialServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + } + + /** + * Initializes an instance of AzureMapsSpatialServiceClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param clientId Specifies which account is intended for usage in conjunction with the Azure AD security model. It + * represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane + * Account API. To use Azure AD security in Azure Maps see the following + * [articles](https://aka.ms/amauthdetails) for guidance. + * @param geography This parameter specifies where the Azure Maps Creator resource is located. Valid values are us + * and eu. + * @param serviceVersion Service version. + */ + public AzureMapsSpatialServiceClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String clientId, + Geography geography, + AzureMapsSpatialServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.clientId = clientId; + this.geography = geography; + this.serviceVersion = serviceVersion; + this.spatials = new SpatialsImpl(this); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/implementation/SpatialsImpl.java b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/implementation/SpatialsImpl.java new file mode 100644 index 000000000000..ae883c2fce50 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/implementation/SpatialsImpl.java @@ -0,0 +1,2359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Spatials. */ +public final class SpatialsImpl { + /** The proxy service used to perform REST calls. */ + private final SpatialsService service; + + /** The service client containing this operation class. */ + private final AzureMapsSpatialServiceClientImpl client; + + /** + * Initializes an instance of SpatialsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SpatialsImpl(AzureMapsSpatialServiceClientImpl client) { + this.service = RestProxy.create(SpatialsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMapsSpatialServiceSpatials to be used by the proxy service to + * perform REST calls. + */ + @Host("https://{geography}.atlas.microsoft.com") + @ServiceInterface(name = "AzureMapsSpatialServ") + private interface SpatialsService { + @Get("/spatial/geofence/{format}") + @ExpectedResponses({200}) + Mono> getGeofence( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Post("/spatial/geofence/{format}") + @ExpectedResponses({200}) + Mono> postGeofence( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + @BodyParam("application/json") BinaryData searchGeofenceRequestBody, + RequestOptions requestOptions, + Context context); + + @Post("/spatial/buffer/{format}") + @ExpectedResponses({200}) + Mono> postBuffer( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + @BodyParam("application/json") BinaryData bufferRequestBody, + RequestOptions requestOptions, + Context context); + + @Get("/spatial/buffer/{format}") + @ExpectedResponses({200}) + Mono> getBuffer( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Post("/spatial/closestPoint/{format}") + @ExpectedResponses({200}) + Mono> postClosestPoint( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + @BodyParam("application/json") BinaryData closestPointRequestBody, + RequestOptions requestOptions, + Context context); + + @Get("/spatial/closestPoint/{format}") + @ExpectedResponses({200}) + Mono> getClosestPoint( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Post("/spatial/pointInPolygon/{format}") + @ExpectedResponses({200}) + Mono> postPointInPolygon( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + @BodyParam("application/json") BinaryData pointInPolygonRequestBody, + RequestOptions requestOptions, + Context context); + + @Get("/spatial/pointInPolygon/{format}") + @ExpectedResponses({200}) + Mono> getPointInPolygon( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Get("/spatial/greatCircleDistance/{format}") + @ExpectedResponses({200}) + Mono> getGreatCircleDistance( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + } + + /** + * **Search Geofence Get API** + * + *

**Applies to:** S1 Pricing tier. + * + *

The Geofence Get API allows you to retrieve the proximity of a coordinate to a geofence that has been uploaded + * to the Data service. You can use the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) to upload a geofence or set of fences. + * See [Geofencing GeoJSON data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more + * details on the geofence data format. To query the proximity of a coordinate, you supply the location of the + * object you are tracking as well as the ID for the fence or set of fences, and the response will contain + * information about the distance from the outer edge of the geofence. A negative value signifies that the + * coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). To test this API, you can upload the sample + * data from Post Geofence API examples(Request Body) via Data Upload API and replace the [udid] from the sample + * request below with the udid returned by Data Upload API. + * + *

### Geofencing InnerError code + * + *

In geofencing response error contract, `innererror` is an object containing service specific information about + * the error. `code` is a property in `innererror` which can map to a specific geofencing error type. The table + * belows shows the code mapping between all the known client error type to the corresponding geofencing error + * `message`. + * + *

innererror.code | error.message ---------------------------- | -------------------------------------- + * NullDeviceId | Device Id should not be null. NullUdid | Udid should not be null. UdidWrongFormat| Udid should be + * acquired from user data ingestion API. InvalidUserTime| Usertime is invalid. InvalidSearchBuffer| Searchbuffer is + * invalid. InvalidSearchRange| The value range of searchbuffer should be from 0 to 500 meters. InvalidLatLon| Lat + * and/or lon parameters are invalid. InvalidIsAsyncValue| The IsAsync parameter is invalid. InvalidModeValue| The + * mode parameter invalid. InvalidJson| Geofencing data is not a valid json file. NotSupportedGeoJson| Geofencing + * data can't be read as a Feature or FeatureCollections. InvalidGeoJson| Geofencing data is invalid. + * NoUserDataWithAccountOrSubscription| Can't find user geofencing data with provided account-id and/or + * subscription-id. NoUserDataWithUdid| Can't find user geofencing data with provided udid. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion is used. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.Now.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGeofenceWithResponseAsync(String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getGeofence( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * **Search Geofence Get API** + * + *

**Applies to:** S1 Pricing tier. + * + *

The Geofence Get API allows you to retrieve the proximity of a coordinate to a geofence that has been uploaded + * to the Data service. You can use the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) to upload a geofence or set of fences. + * See [Geofencing GeoJSON data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more + * details on the geofence data format. To query the proximity of a coordinate, you supply the location of the + * object you are tracking as well as the ID for the fence or set of fences, and the response will contain + * information about the distance from the outer edge of the geofence. A negative value signifies that the + * coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). To test this API, you can upload the sample + * data from Post Geofence API examples(Request Body) via Data Upload API and replace the [udid] from the sample + * request below with the udid returned by Data Upload API. + * + *

### Geofencing InnerError code + * + *

In geofencing response error contract, `innererror` is an object containing service specific information about + * the error. `code` is a property in `innererror` which can map to a specific geofencing error type. The table + * belows shows the code mapping between all the known client error type to the corresponding geofencing error + * `message`. + * + *

innererror.code | error.message ---------------------------- | -------------------------------------- + * NullDeviceId | Device Id should not be null. NullUdid | Udid should not be null. UdidWrongFormat| Udid should be + * acquired from user data ingestion API. InvalidUserTime| Usertime is invalid. InvalidSearchBuffer| Searchbuffer is + * invalid. InvalidSearchRange| The value range of searchbuffer should be from 0 to 500 meters. InvalidLatLon| Lat + * and/or lon parameters are invalid. InvalidIsAsyncValue| The IsAsync parameter is invalid. InvalidModeValue| The + * mode parameter invalid. InvalidJson| Geofencing data is not a valid json file. NotSupportedGeoJson| Geofencing + * data can't be read as a Feature or FeatureCollections. InvalidGeoJson| Geofencing data is invalid. + * NoUserDataWithAccountOrSubscription| Can't find user geofencing data with provided account-id and/or + * subscription-id. NoUserDataWithUdid| Can't find user geofencing data with provided udid. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion is used. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.Now.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGeofenceWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getGeofence( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context); + } + + /** + * **Search Geofence Get API** + * + *

**Applies to:** S1 Pricing tier. + * + *

The Geofence Get API allows you to retrieve the proximity of a coordinate to a geofence that has been uploaded + * to the Data service. You can use the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) to upload a geofence or set of fences. + * See [Geofencing GeoJSON data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more + * details on the geofence data format. To query the proximity of a coordinate, you supply the location of the + * object you are tracking as well as the ID for the fence or set of fences, and the response will contain + * information about the distance from the outer edge of the geofence. A negative value signifies that the + * coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). To test this API, you can upload the sample + * data from Post Geofence API examples(Request Body) via Data Upload API and replace the [udid] from the sample + * request below with the udid returned by Data Upload API. + * + *

### Geofencing InnerError code + * + *

In geofencing response error contract, `innererror` is an object containing service specific information about + * the error. `code` is a property in `innererror` which can map to a specific geofencing error type. The table + * belows shows the code mapping between all the known client error type to the corresponding geofencing error + * `message`. + * + *

innererror.code | error.message ---------------------------- | -------------------------------------- + * NullDeviceId | Device Id should not be null. NullUdid | Udid should not be null. UdidWrongFormat| Udid should be + * acquired from user data ingestion API. InvalidUserTime| Usertime is invalid. InvalidSearchBuffer| Searchbuffer is + * invalid. InvalidSearchRange| The value range of searchbuffer should be from 0 to 500 meters. InvalidLatLon| Lat + * and/or lon parameters are invalid. InvalidIsAsyncValue| The IsAsync parameter is invalid. InvalidModeValue| The + * mode parameter invalid. InvalidJson| Geofencing data is not a valid json file. NotSupportedGeoJson| Geofencing + * data can't be read as a Feature or FeatureCollections. InvalidGeoJson| Geofencing data is invalid. + * NoUserDataWithAccountOrSubscription| Can't find user geofencing data with provided account-id and/or + * subscription-id. NoUserDataWithUdid| Can't find user geofencing data with provided udid. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion is used. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.Now.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGeofenceWithResponse(String format, RequestOptions requestOptions) { + return getGeofenceWithResponseAsync(format, requestOptions).block(); + } + + /** + * **Search Geofence Post API** **Applies to:** S1 Pricing tier. The Geofence Post API allows you to retrieve the + * proximity of a coordinate to a provided geofence or set of fences. With POST call, you do not have to upload the + * fence data in advance, instead you supply the location of the object you are tracking in query parameters as well + * as the fence or set of fences data in post request body. See [Geofencing GeoJSON + * data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more details on the geofence data + * format. The response will contain information about the distance from the outer edge of the geofence. A negative + * value signifies that the coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion geofencing is applied. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.UtcNow.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param searchGeofenceRequestBody The geofencing GeoJSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postGeofenceWithResponseAsync( + String format, BinaryData searchGeofenceRequestBody, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.postGeofence( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + searchGeofenceRequestBody, + requestOptions, + context)); + } + + /** + * **Search Geofence Post API** **Applies to:** S1 Pricing tier. The Geofence Post API allows you to retrieve the + * proximity of a coordinate to a provided geofence or set of fences. With POST call, you do not have to upload the + * fence data in advance, instead you supply the location of the object you are tracking in query parameters as well + * as the fence or set of fences data in post request body. See [Geofencing GeoJSON + * data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more details on the geofence data + * format. The response will contain information about the distance from the outer edge of the geofence. A negative + * value signifies that the coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion geofencing is applied. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.UtcNow.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param searchGeofenceRequestBody The geofencing GeoJSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postGeofenceWithResponseAsync( + String format, BinaryData searchGeofenceRequestBody, RequestOptions requestOptions, Context context) { + return service.postGeofence( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + searchGeofenceRequestBody, + requestOptions, + context); + } + + /** + * **Search Geofence Post API** **Applies to:** S1 Pricing tier. The Geofence Post API allows you to retrieve the + * proximity of a coordinate to a provided geofence or set of fences. With POST call, you do not have to upload the + * fence data in advance, instead you supply the location of the object you are tracking in query parameters as well + * as the fence or set of fences data in post request body. See [Geofencing GeoJSON + * data](https://docs.microsoft.com/en-us/azure/azure-maps/geofence-geojson) for more details on the geofence data + * format. The response will contain information about the distance from the outer edge of the geofence. A negative + * value signifies that the coordinate is inside of the fence while a positive value means that it is outside of the + * fence.<br><br>This API can be used for a variety of scenarios that include things like asset + * tracking, fleet management, or setting up alerts for moving objects. + * + *

The API supports [integration with Event + * Grid](https://docs.microsoft.com/azure/azure-maps/azure-maps-event-grid-integration). The isAsync parameter is + * used to enable integration with Event Grid (disabled by default). + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
deviceIdStringYesID of the device
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
zStringNoThe sea level in meter of the location being passed. If this parameter is presented, 2D extrusion geofencing is applied. Example: 200.
userTimeStringNoThe user request time. If not presented in the request, the default value is DateTime.UtcNow.
searchBufferStringNoThe radius of the buffer around the geofence in meters that defines how far to search inside and outside the border of the fence against the coordinate that was provided when calculating the result. The minimum value is 0, and the maximum is 500. The default value is 50.
isAsyncStringNoIf true, the request will use async event mechanism; if false, the request will be synchronized and do not trigger any event. The default value is false.
modeStringNoMode of the geofencing async event mechanism.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     geometries: [
+     *         {
+     *             deviceId: String
+     *             udId: String
+     *             geometryId: String
+     *             distance: Float
+     *             nearestLat: Float
+     *             nearestLon: Float
+     *             nearestZ: Float
+     *         }
+     *     ]
+     *     expiredGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     invalidPeriodGeofenceGeometryId: [
+     *         String
+     *     ]
+     *     isEventPublished: Boolean
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param searchGeofenceRequestBody The geofencing GeoJSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a geofence proximity call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postGeofenceWithResponse( + String format, BinaryData searchGeofenceRequestBody, RequestOptions requestOptions) { + return postGeofenceWithResponseAsync(format, searchGeofenceRequestBody, requestOptions).block(); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input may + * contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and MultiLineString. + * GeometryCollection will be ignored if provided. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     geometries: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     *     distances: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param bufferRequestBody The FeatureCollection and the list of distances (one per feature or one for all + * features). + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postBufferWithResponseAsync( + String format, BinaryData bufferRequestBody, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.postBuffer( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + bufferRequestBody, + requestOptions, + context)); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input may + * contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and MultiLineString. + * GeometryCollection will be ignored if provided. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     geometries: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     *     distances: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param bufferRequestBody The FeatureCollection and the list of distances (one per feature or one for all + * features). + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postBufferWithResponseAsync( + String format, BinaryData bufferRequestBody, RequestOptions requestOptions, Context context) { + return service.postBuffer( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + bufferRequestBody, + requestOptions, + context); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input may + * contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and MultiLineString. + * GeometryCollection will be ignored if provided. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     geometries: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     *     distances: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param bufferRequestBody The FeatureCollection and the list of distances (one per feature or one for all + * features). + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postBufferWithResponse( + String format, BinaryData bufferRequestBody, RequestOptions requestOptions) { + return postBufferWithResponseAsync(format, bufferRequestBody, requestOptions).block(); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input features + * are provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and + * MultiLineString. GeometryCollection will be ignored if provided. + * + *

To test this API, you can upload the sample data from [Post Buffer + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postbuffer#examples) examples(Request Body without + * distances array) via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and + * replace the [udid] from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getbuffer#examples) with the udid returned by Data + * Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
distancesStringYesThe list of distances (one per feature or one for all features), delimited by semicolons. For example, 12.34;-56.78. Positive distance will generate a buffer outside of the feature, whereas negative distance will generate a buffer inside of the feature. If the negative distance larger than the geometry itself, an empty polygon will be returned.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBufferWithResponseAsync(String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getBuffer( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input features + * are provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and + * MultiLineString. GeometryCollection will be ignored if provided. + * + *

To test this API, you can upload the sample data from [Post Buffer + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postbuffer#examples) examples(Request Body without + * distances array) via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and + * replace the [udid] from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getbuffer#examples) with the udid returned by Data + * Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
distancesStringYesThe list of distances (one per feature or one for all features), delimited by semicolons. For example, 12.34;-56.78. Positive distance will generate a buffer outside of the feature, whereas negative distance will generate a buffer inside of the feature. If the negative distance larger than the geometry itself, an empty polygon will be returned.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBufferWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getBuffer( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a FeatureCollection where each Feature is a buffer around the corresponding indexed Feature + * of the input. The buffer could be either on the outside or the inside of the provided Feature, depending on the + * distance provided in the input. There must be either one distance provided per Feature in the FeatureCollection + * input, or if only one distance is provided, then that distance is applied to every Feature in the collection. The + * positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with + * a circle of radius equal to the absolute value of the buffer distance. The buffer API always returns a polygonal + * result. The negative or zero-distance buffer of lines and points is always an empty polygon. The input features + * are provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain a collection of Point, MultiPoint, Polygon, MultiPolygon, LineString and + * MultiLineString. GeometryCollection will be ignored if provided. + * + *

To test this API, you can upload the sample data from [Post Buffer + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postbuffer#examples) examples(Request Body without + * distances array) via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and + * replace the [udid] from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getbuffer#examples) with the udid returned by Data + * Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
distancesStringYesThe list of distances (one per feature or one for all features), delimited by semicolons. For example, 12.34;-56.78. Positive distance will generate a buffer outside of the feature, whereas negative distance will generate a buffer inside of the feature. If the negative distance larger than the geometry itself, an empty polygon will be returned.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         features: [
+     *             {
+     *                 geometry: {
+     *                 }
+     *                 properties: Object
+     *                 id: String
+     *                 featureType: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Buffer call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBufferWithResponse(String format, RequestOptions requestOptions) { + return getBufferWithResponseAsync(format, requestOptions).block(); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of target points. The set of target + * points is provided by user data in post request body. The user data may only contain a collection of Point + * geometry. MultiPoint or other geometries will be ignored if provided. The algorithm does not take into account + * routing or traffic. The maximum number of points accepted is 100,000. Information returned includes closest point + * latitude, longitude, and distance in meters from the closest point. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param closestPointRequestBody The FeatureCollection of Point geometries from which closest point to source point + * should be determined. All the feature's properties should contain `geometryId`, which is used for identifying + * the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postClosestPointWithResponseAsync( + String format, BinaryData closestPointRequestBody, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.postClosestPoint( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + closestPointRequestBody, + requestOptions, + context)); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of target points. The set of target + * points is provided by user data in post request body. The user data may only contain a collection of Point + * geometry. MultiPoint or other geometries will be ignored if provided. The algorithm does not take into account + * routing or traffic. The maximum number of points accepted is 100,000. Information returned includes closest point + * latitude, longitude, and distance in meters from the closest point. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param closestPointRequestBody The FeatureCollection of Point geometries from which closest point to source point + * should be determined. All the feature's properties should contain `geometryId`, which is used for identifying + * the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postClosestPointWithResponseAsync( + String format, BinaryData closestPointRequestBody, RequestOptions requestOptions, Context context) { + return service.postClosestPoint( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + closestPointRequestBody, + requestOptions, + context); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of target points. The set of target + * points is provided by user data in post request body. The user data may only contain a collection of Point + * geometry. MultiPoint or other geometries will be ignored if provided. The algorithm does not take into account + * routing or traffic. The maximum number of points accepted is 100,000. Information returned includes closest point + * latitude, longitude, and distance in meters from the closest point. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param closestPointRequestBody The FeatureCollection of Point geometries from which closest point to source point + * should be determined. All the feature's properties should contain `geometryId`, which is used for identifying + * the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postClosestPointWithResponse( + String format, BinaryData closestPointRequestBody, RequestOptions requestOptions) { + return postClosestPointWithResponseAsync(format, closestPointRequestBody, requestOptions).block(); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of points in the user uploaded data + * set identified by udid. The set of target points is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may only contain a collection of Point geometry. MultiPoint or other geometries will be ignored if + * provided. The maximum number of points accepted is 100,000. The algorithm does not take into account routing or + * traffic. Information returned includes closest point latitude, longitude, and distance in meters from the closest + * point. + * + *

To test this API, you can upload the sample data from [Post Closest Point + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postclosestpoint#examples) examples(Request Body) via + * [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] from + * the [sample request below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getclosestpoint#examples) with + * the udid returned by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getClosestPointWithResponseAsync(String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getClosestPoint( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of points in the user uploaded data + * set identified by udid. The set of target points is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may only contain a collection of Point geometry. MultiPoint or other geometries will be ignored if + * provided. The maximum number of points accepted is 100,000. The algorithm does not take into account routing or + * traffic. Information returned includes closest point latitude, longitude, and distance in meters from the closest + * point. + * + *

To test this API, you can upload the sample data from [Post Closest Point + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postclosestpoint#examples) examples(Request Body) via + * [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] from + * the [sample request below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getclosestpoint#examples) with + * the udid returned by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getClosestPointWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getClosestPoint( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns the closest point between a base point and a given set of points in the user uploaded data + * set identified by udid. The set of target points is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may only contain a collection of Point geometry. MultiPoint or other geometries will be ignored if + * provided. The maximum number of points accepted is 100,000. The algorithm does not take into account routing or + * traffic. Information returned includes closest point latitude, longitude, and distance in meters from the closest + * point. + * + *

To test this API, you can upload the sample data from [Post Closest Point + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postclosestpoint#examples) examples(Request Body) via + * [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] from + * the [sample request below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getclosestpoint#examples) with + * the udid returned by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
numberOfClosestPointsStringNoThe number of closest points expected from response. Default: 1, minimum: 1 and maximum: 50
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: [
+     *         {
+     *             distanceInMeters: Float
+     *             position: (recursive schema, see position above)
+     *             geometryId: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Spatial Closest Point call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getClosestPointWithResponse(String format, RequestOptions requestOptions) { + return getClosestPointWithResponseAsync(format, requestOptions).block(); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The user data may + * contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If the point is inside + * or on the boundary of one of these polygons, the value returned is true. In all other cases, the value returned + * is false. When the point is inside multiple polygons, the result will give intersecting geometries section to + * show all valid geometries (referenced by geometryId) in user data. The maximum number of vertices accepted to + * form a Polygon is 10,000. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param pointInPolygonRequestBody A FeatureCollection with a set of Polygon/MultiPolygon geometries. The maximum + * number of vertices accepted to form a Polygon is 10,000. All the feature's properties should contain + * `geometryId`, which is used for identifying the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postPointInPolygonWithResponseAsync( + String format, BinaryData pointInPolygonRequestBody, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.postPointInPolygon( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + pointInPolygonRequestBody, + requestOptions, + context)); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The user data may + * contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If the point is inside + * or on the boundary of one of these polygons, the value returned is true. In all other cases, the value returned + * is false. When the point is inside multiple polygons, the result will give intersecting geometries section to + * show all valid geometries (referenced by geometryId) in user data. The maximum number of vertices accepted to + * form a Polygon is 10,000. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param pointInPolygonRequestBody A FeatureCollection with a set of Polygon/MultiPolygon geometries. The maximum + * number of vertices accepted to form a Polygon is 10,000. All the feature's properties should contain + * `geometryId`, which is used for identifying the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postPointInPolygonWithResponseAsync( + String format, BinaryData pointInPolygonRequestBody, RequestOptions requestOptions, Context context) { + return service.postPointInPolygon( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + pointInPolygonRequestBody, + requestOptions, + context); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The user data may + * contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If the point is inside + * or on the boundary of one of these polygons, the value returned is true. In all other cases, the value returned + * is false. When the point is inside multiple polygons, the result will give intersecting geometries section to + * show all valid geometries (referenced by geometryId) in user data. The maximum number of vertices accepted to + * form a Polygon is 10,000. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Request Body Schema + * + *

{@code
+     * {
+     *     features: [
+     *         {
+     *             geometry: {
+     *             }
+     *             properties: Object
+     *             id: String
+     *             featureType: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param pointInPolygonRequestBody A FeatureCollection with a set of Polygon/MultiPolygon geometries. The maximum + * number of vertices accepted to form a Polygon is 10,000. All the feature's properties should contain + * `geometryId`, which is used for identifying the geometry and is case-sensitive. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postPointInPolygonWithResponse( + String format, BinaryData pointInPolygonRequestBody, RequestOptions requestOptions) { + return postPointInPolygonWithResponseAsync(format, pointInPolygonRequestBody, requestOptions).block(); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The set of polygons + * is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If + * the point is inside or on the boundary of one of these polygons, the value returned is true. In all other cases, + * the value returned is false. When the point is inside multiple polygons, the result will give intersecting + * geometries section to show all valid geometries(referenced by geometryId) in user data. The maximum number of + * vertices accepted to form a Polygon is 10,000. + * + *

To test this API, you can upload the sample data from [Post Point In Polygon + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postpointinpolygon#examples) examples(Request Body) + * via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] + * from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getpointinpolygon#examples) with the udid returned + * by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPointInPolygonWithResponseAsync(String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getPointInPolygon( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The set of polygons + * is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If + * the point is inside or on the boundary of one of these polygons, the value returned is true. In all other cases, + * the value returned is false. When the point is inside multiple polygons, the result will give intersecting + * geometries section to show all valid geometries(referenced by geometryId) in user data. The maximum number of + * vertices accepted to form a Polygon is 10,000. + * + *

To test this API, you can upload the sample data from [Post Point In Polygon + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postpointinpolygon#examples) examples(Request Body) + * via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] + * from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getpointinpolygon#examples) with the udid returned + * by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPointInPolygonWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getPointInPolygon( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API returns a boolean value indicating whether a point is inside a set of polygons. The set of polygons + * is provided by a GeoJSON file which is uploaded via [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and referenced by a unique udid. The + * GeoJSON file may contain Polygon and MultiPolygon geometries, other geometries will be ignored if provided. If + * the point is inside or on the boundary of one of these polygons, the value returned is true. In all other cases, + * the value returned is false. When the point is inside multiple polygons, the result will give intersecting + * geometries section to show all valid geometries(referenced by geometryId) in user data. The maximum number of + * vertices accepted to form a Polygon is 10,000. + * + *

To test this API, you can upload the sample data from [Post Point In Polygon + * API](https://docs.microsoft.com/en-us/rest/api/maps/spatial/postpointinpolygon#examples) examples(Request Body) + * via [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) and replace the [udid] + * from the [sample request + * below](https://docs.microsoft.com/en-us/rest/api/maps/spatial/getpointinpolygon#examples) with the udid returned + * by Data Upload API. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
udidStringYesThe unique id returned from [Data Upload API](https://docs.microsoft.com/en-us/rest/api/maps/data/uploadPreview) after uploading a valid GeoJSON FeatureCollection object. Please refer to [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.3) for details. All the feature's properties should contain `geometryId`, which is used for identifying the geometry and is case-sensitive.
latitudefloatYesThe latitude of the location being passed. Example: 48.36.
longitudefloatYesThe longitude of the location being passed. Example: -124.63.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         udid: String
+     *         information: String
+     *     }
+     *     result: {
+     *         pointInPolygons: Boolean
+     *         intersectingGeometries: [
+     *             String
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return returns true if point is within the polygon, false otherwise. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPointInPolygonWithResponse(String format, RequestOptions requestOptions) { + return getPointInPolygonWithResponseAsync(format, requestOptions).block(); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API will return the great-circle or shortest distance between two points on the surface of a sphere, + * measured along the surface of the sphere. This differs from calculating a straight line through the sphere's + * interior. This method is helpful for estimating travel distances for airplanes by calculating the shortest + * distance between airports. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
queryStringYesThe Coordinates through which the distance is calculated, delimited by a colon. Two coordinates are required. The first one is the source point coordinate and the last is the target point coordinate. For example, 47.622942,122.316456:57.673988,127.121513
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         targetPoint: (recursive schema, see targetPoint above)
+     *     }
+     *     result: {
+     *         distanceInMeters: Float
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Great Circle Distance call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGreatCircleDistanceWithResponseAsync( + String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getGreatCircleDistance( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API will return the great-circle or shortest distance between two points on the surface of a sphere, + * measured along the surface of the sphere. This differs from calculating a straight line through the sphere's + * interior. This method is helpful for estimating travel distances for airplanes by calculating the shortest + * distance between airports. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
queryStringYesThe Coordinates through which the distance is calculated, delimited by a colon. Two coordinates are required. The first one is the source point coordinate and the last is the target point coordinate. For example, 47.622942,122.316456:57.673988,127.121513
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         targetPoint: (recursive schema, see targetPoint above)
+     *     }
+     *     result: {
+     *         distanceInMeters: Float
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Great Circle Distance call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGreatCircleDistanceWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getGreatCircleDistance( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context); + } + + /** + * **Applies to**: S1 pricing tier. + * + *

This API will return the great-circle or shortest distance between two points on the surface of a sphere, + * measured along the surface of the sphere. This differs from calculating a straight line through the sphere's + * interior. This method is helpful for estimating travel distances for airplanes by calculating the shortest + * distance between airports. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
queryStringYesThe Coordinates through which the distance is calculated, delimited by a colon. Two coordinates are required. The first one is the source point coordinate and the last is the target point coordinate. For example, 47.622942,122.316456:57.673988,127.121513
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     summary: {
+     *         sourcePoint: {
+     *             lat: Double
+     *             lon: Double
+     *         }
+     *         targetPoint: (recursive schema, see targetPoint above)
+     *     }
+     *     result: {
+     *         distanceInMeters: Float
+     *     }
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Great Circle Distance call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGreatCircleDistanceWithResponse(String format, RequestOptions requestOptions) { + return getGreatCircleDistanceWithResponseAsync(format, requestOptions).block(); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/package-info.java b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/package-info.java new file mode 100644 index 000000000000..08a48030000b --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/java/com/azure/maps/spatial/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for AzureMapsSpatialService. Azure Maps Spatial REST APIs. */ +package com.azure.maps.spatial; diff --git a/sdk/maps/azure-maps-spatial/src/main/java/module-info.java b/sdk/maps/azure-maps-spatial/src/main/java/module-info.java new file mode 100644 index 000000000000..3a6c4f5e5d1a --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/java/module-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.maps.spatial { + requires transitive com.azure.core; + + exports com.azure.maps.spatial; +} diff --git a/sdk/maps/azure-maps-spatial/src/main/resources/azure-maps-spatial.properties b/sdk/maps/azure-maps-spatial/src/main/resources/azure-maps-spatial.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/main/resources/azure-maps-spatial.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/ReadmeSamples.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/ReadmeSamples.java new file mode 100644 index 000000000000..5b203b7281ba --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.maps.spatial.readme + // END: com.azure.maps.spatial.readme + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetBuffer.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetBuffer.java new file mode 100644 index 000000000000..0853feafe69d --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetBuffer.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class GetBuffer { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("distances", "176.3"); + requestOptions.addQueryParam("udid", "[udid]"); + Response response = client.getBufferWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetClosestPoint.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetClosestPoint.java new file mode 100644 index 000000000000..59214635bd58 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetClosestPoint.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class GetClosestPoint { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("udid", "[udid]"); + Response response = client.getClosestPointWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetGeofence.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetGeofence.java new file mode 100644 index 000000000000..e60bef240802 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetGeofence.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class GetGeofence { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("mode", "EnterAndExit"); + requestOptions.addQueryParam("userTime", "2017-07-21T17:32:28Z"); + requestOptions.addQueryParam("isAsync", "true"); + requestOptions.addQueryParam("searchBuffer", "50"); + requestOptions.addQueryParam("udid", "[udId]"); + requestOptions.addQueryParam("deviceId", "unique_device_name_under_account"); + Response response = client.getGeofenceWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetGreatCircleDistance.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetGreatCircleDistance.java new file mode 100644 index 000000000000..b40dbbf3b3c5 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetGreatCircleDistance.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class GetGreatCircleDistance { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("query", "47.622942,-122.316456:47.610378,-122.200676"); + Response response = client.getGreatCircleDistanceWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetPointInPolygon.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetPointInPolygon.java new file mode 100644 index 000000000000..ad2c5f3f187c --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/GetPointInPolygon.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class GetPointInPolygon { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("udid", "[udid]"); + Response response = client.getPointInPolygonWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostBuffer.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostBuffer.java new file mode 100644 index 000000000000..26b483c73666 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostBuffer.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class PostBuffer { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + BinaryData bufferRequestBody = + BinaryData.fromString( + "{\"distances\":[176.3],\"geometries\":{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-111.9267386,33.5362475]},\"properties\":{\"geometryId\":\"ExampleId\"}}]}}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.postBufferWithResponse("json", bufferRequestBody, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostClosestPoint.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostClosestPoint.java new file mode 100644 index 000000000000..8f761b34fe85 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostClosestPoint.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class PostClosestPoint { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + BinaryData closestPointRequestBody = + BinaryData.fromString( + "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-105.02860293715861,40.51615340677395]},\"properties\":{\"geometryId\":1001}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-105.02860381672178,40.51599099003731]},\"properties\":{\"geometryId\":1002}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-105.02812292879467,40.51605867808856]},\"properties\":{\"geometryId\":1003}}]}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.postClosestPointWithResponse("json", closestPointRequestBody, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostGeofence.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostGeofence.java new file mode 100644 index 000000000000..afa0926a69bf --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostGeofence.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class PostGeofence { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + BinaryData searchGeofenceRequestBody = + BinaryData.fromString( + "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-122.13241226662022,47.61701140091722],[-122.12810106940353,47.6169969269402],[-122.12824948956276,47.61907683751349],[-122.12833297981392,47.621929787055336],[-122.12971398040168,47.62184100705295],[-122.1318413862121,47.62195364373008],[-122.13231034769727,47.61716332618121],[-122.13241226662022,47.61701140091722]]]},\"properties\":{\"name\":\"Crossroad Mall\",\"geometryId\":\"2\"}},{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-122.1534220563239,47.60981818546625],[-122.153451623509,47.60628733146004],[-122.14971782206638,47.606250040787046],[-122.14817354810637,47.606391046012305],[-122.1482735128807,47.60983316796356],[-122.15225500989803,47.60982613678752],[-122.1534220563239,47.60981818546625]]]},\"properties\":{\"name\":\"Sammamish High school\",\"geometryId\":\"1\"}}]}"); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("mode", "EnterAndExit"); + requestOptions.addQueryParam("usertime", "2017-07-21T17:32:28Z"); + requestOptions.addQueryParam("isAsync", "true"); + requestOptions.addQueryParam("searchBuffer", "50"); + requestOptions.addQueryParam("deviceId", "unique_device_name_under_account"); + Response response = + client.postGeofenceWithResponse("json", searchGeofenceRequestBody, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostPointInPolygon.java b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostPointInPolygon.java new file mode 100644 index 000000000000..73b6a691a432 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/samples/java/com/azure/maps/spatial/generated/PostPointInPolygon.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.spatial.AzureMapsSpatialServiceClient; +import com.azure.maps.spatial.AzureMapsSpatialServiceClientBuilder; + +public class PostPointInPolygon { + public static void main(String[] args) { + AzureMapsSpatialServiceClient client = + new AzureMapsSpatialServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + BinaryData pointInPolygonRequestBody = + BinaryData.fromString( + "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-111.9267386,33.5362475],[-111.9627875,33.5104882],[-111.9027061,33.5004686],[-111.9267386,33.5362475]]]},\"properties\":{\"geometryId\":1001}}]}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.postPointInPolygonWithResponse("json", pointInPolygonRequestBody, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-spatial/src/test/java/com/azure/maps/spatial/ClientTests.java b/sdk/maps/azure-maps-spatial/src/test/java/com/azure/maps/spatial/ClientTests.java new file mode 100644 index 000000000000..0b693fc7a8e3 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/src/test/java/com/azure/maps/spatial/ClientTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.spatial; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClientTests extends TestBase { + private AzureMapsSpatialServiceClientBuilder builder; + + @BeforeEach + public void setup() { + builder = + new AzureMapsSpatialServiceClientBuilder() + .geography(Configuration.getGlobalConfiguration().get("GEOGRAPHY", Geography.US)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)); + if (getTestMode() == TestMode.PLAYBACK) { + builder.httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + builder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + builder.credential(new DefaultAzureCredentialBuilder().build()); + } + } + + @Test + @DoNotRecord(skipInPlayback = true) + public void testClient() { + // use the builder to create client + } +} diff --git a/sdk/maps/azure-maps-spatial/swagger/README_SPEC.md b/sdk/maps/azure-maps-spatial/swagger/README_SPEC.md new file mode 100644 index 000000000000..c48b14ea9227 --- /dev/null +++ b/sdk/maps/azure-maps-spatial/swagger/README_SPEC.md @@ -0,0 +1,26 @@ +## Generate autorest code + +```yaml +input-file: + - /home/vsts/work/1/s/azure-rest-api-specs/specification/maps/data-plane/Creator/preview/1.0/spatial.json +java: true +output-folder: ../ +partial-update: true +regenerate-pom: false +generate-sync-async-clients: true +generate-client-as-impl: true +generate-client-interfaces: false +add-context-parameter: true +artifact-id: azure-maps-spatial +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.maps.spatial +context-client-method-parameter: true +azure-arm: false +credential-types: tokencredential +credential-scopes: https://maps.azure.com/.default +service-versions: + - '1.0' +```