diff --git a/sdk/maps/azure-maps-data/CHANGELOG.md b/sdk/maps/azure-maps-data/CHANGELOG.md new file mode 100644 index 000000000000..b83e3c41a9f6 --- /dev/null +++ b/sdk/maps/azure-maps-data/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AzureMapsDataService client library for Java. This package contains Microsoft Azure AzureMapsDataService client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/maps/azure-maps-data/README.md b/sdk/maps/azure-maps-data/README.md new file mode 100644 index 000000000000..67458a991dd9 --- /dev/null +++ b/sdk/maps/azure-maps-data/README.md @@ -0,0 +1,63 @@ +# Azure AzureMapsDataService client library for Java + +Azure AzureMapsDataService client library for Java. + +This package contains Microsoft Azure AzureMapsDataService 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-data;current}) +```xml + + com.azure + azure-maps-data + 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.data.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-data/pom.xml b/sdk/maps/azure-maps-data/pom.xml new file mode 100644 index 000000000000..ca78b1e3ed11 --- /dev/null +++ b/sdk/maps/azure-maps-data/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-data + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureMapsDataService Management + This package contains Microsoft Azure AzureMapsDataService 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.23.1 + + + com.azure + azure-core-http-netty + 1.11.4 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.1 + test + + + com.azure + azure-core-test + 1.7.5 + test + + + com.azure + azure-identity + 1.4.2 + test + + + diff --git a/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceAsyncClient.java b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceAsyncClient.java new file mode 100644 index 000000000000..da1753946cd5 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceAsyncClient.java @@ -0,0 +1,664 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.data; + +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.core.util.polling.PollerFlux; +import com.azure.maps.data.implementation.DatasImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AzureMapsDataServiceClient type. */ +@ServiceClient(builder = AzureMapsDataServiceClientBuilder.class, isAsync = true) +public final class AzureMapsDataServiceAsyncClient { + @Generated private final DatasImpl serviceClient; + + /** + * Initializes an instance of Datas client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsDataServiceAsyncClient(DatasImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Upload API allows the caller to upload data content to the Azure Maps service. You can use this API + * in a scenario like uploading a collection of Geofences in `GeoJSON` format, for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

## Submit Upload Request + * + *

To upload your content you will use a `POST` request. The request body will contain the data to upload. The + * `dataFormat` query parameter will contain the format for the data, the `dataSharingLevel` query parameter can + * contain the sharing level for the data. The `Content-Type` header will be set to the content type of the data. + * + *

For example, to upload a collection of geofences in `GeoJSON` format, set the request body to the geofence + * content. Set the `dataFormat` query parameter to _geojson_, and set the `Content-Type` header to either one of + * the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for uploading a simple Geofence represented as a circle geometry using a center + * point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The Data Upload API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Upload Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
dataFormatStringYesData format of the content being uploaded.
+ * + *

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.
contentLengthlongYesThe contentLength parameter
+ * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param uploadContent The content to upload. + * @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 the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadWithResponse(BinaryData uploadContent, RequestOptions requestOptions) { + return this.serviceClient.uploadWithResponseAsync(uploadContent, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Upload API allows the caller to upload data content to the Azure Maps service. You can use this API + * in a scenario like uploading a collection of Geofences in `GeoJSON` format, for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

## Submit Upload Request + * + *

To upload your content you will use a `POST` request. The request body will contain the data to upload. The + * `dataFormat` query parameter will contain the format for the data, the `dataSharingLevel` query parameter can + * contain the sharing level for the data. The `Content-Type` header will be set to the content type of the data. + * + *

For example, to upload a collection of geofences in `GeoJSON` format, set the request body to the geofence + * content. Set the `dataFormat` query parameter to _geojson_, and set the `Content-Type` header to either one of + * the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for uploading a simple Geofence represented as a circle geometry using a center + * point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The Data Upload API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Upload Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
dataFormatStringYesData format of the content being uploaded.
+ * + *

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.
contentLengthlongYesThe contentLength parameter
+ * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param uploadContent The content to upload. + * @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 the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpload(BinaryData uploadContent, RequestOptions requestOptions) { + return this.serviceClient.beginUploadAsync(uploadContent, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to fetch a list of all content uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview). + * + *

### Submit List Request + * + *

To list all your map data content you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The Data List API returns the complete list of all data in `json` format. The response contains the following + * details for each data resource: + * + *

> udid - The unique data id for the data resource. + * + *

> location - The location of the data resource. Execute a HTTP `GET` on this location to download the data. + * + *

Here's a sample response returning the `udid` and `location` of 3 data resources: + * + *

<br> + * + *

```json { "mapDataList": [ { "udid": "9a1288fa-1858-4a3b-b68d-13a8j5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/9a1288fa-1858-4a3b-b68d-13a8j5af7d7c?api-version=1.0", "sizeInBytes": + * 29920, "uploadStatus": "Completed" }, { "udid": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/8b1288fa-1958-4a2b-b68e-13a7i5af7d7c?api-version=1.0", "sizeInBytes": + * 1339, "uploadStatus": "Completed" }, { "udid": "7c1288fa-2058-4a1b-b68f-13a6h5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/7c1288fa-2058-4a1b-b68f-13a6h5af7d7c?api-version=1.0", "sizeInBytes": + * 1650, "uploadStatus": "Pending" }] } ``` + * + *

<br>. + * + *

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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     mapDataList: [
+     *         {
+     *             udid: String
+     *             locationUrl: String
+     *             sizeInBytes: Long
+     *             uploadStatus: String(Pending/Completed/Failed)
+     *             dataFormat: String(geojson/zip/dwgzippackage)
+     *             description: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 the response model for the Data List API. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listWithResponseAsync(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Update API allows the caller to update a previously uploaded data content. + * + *

You can use this API in a scenario like adding or removing geofences to or from an existing collection of + * geofences. Geofences are uploaded using the [Data Upload + * API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for use in the [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

Please note that the Update API will *replace* and *override* the existing data content. + * + *

## Submit Update Request + * + *

To update your content you will use a `PUT` request. The request body will contain the new data that will + * replace the existing data. The `Content-Type` header will be set to the content type of the data, and the path + * will contain the `udid` of the data to be update. + * + *

For example, to update a collection of geofences that were previously uploaded using the Upload API, place the + * new geofence content in the request body. Set the `udid` parameter in the path to the `udid` of the data received + * previously in the upload API response. And set the `Content-Type` header to one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for updating a simple Geofence. It's represented as a circle geometry using a + * center point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The previously uploaded geofence had a radius of 100m. The above request will update it to 500m. + * + *

The Data Update API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Update Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
+ * + *

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
+     * Object
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @param updateContent The new content that will update/replace the previously uploaded content. + * @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 the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponse( + String udid, BinaryData updateContent, RequestOptions requestOptions) { + return this.serviceClient.updateWithResponseAsync(udid, updateContent, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Update API allows the caller to update a previously uploaded data content. + * + *

You can use this API in a scenario like adding or removing geofences to or from an existing collection of + * geofences. Geofences are uploaded using the [Data Upload + * API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for use in the [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

Please note that the Update API will *replace* and *override* the existing data content. + * + *

## Submit Update Request + * + *

To update your content you will use a `PUT` request. The request body will contain the new data that will + * replace the existing data. The `Content-Type` header will be set to the content type of the data, and the path + * will contain the `udid` of the data to be update. + * + *

For example, to update a collection of geofences that were previously uploaded using the Upload API, place the + * new geofence content in the request body. Set the `udid` parameter in the path to the `udid` of the data received + * previously in the upload API response. And set the `Content-Type` header to one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for updating a simple Geofence. It's represented as a circle geometry using a + * center point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The previously uploaded geofence had a radius of 100m. The above request will update it to 500m. + * + *

The Data Update API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Update Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
+ * + *

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
+     * Object
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @param updateContent The new content that will update/replace the previously uploaded content. + * @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 the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdate( + String udid, BinaryData updateContent, RequestOptions requestOptions) { + return this.serviceClient.beginUpdateAsync(udid, updateContent, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to download a previously uploaded data content.<br> You can use this API in a + * scenario like downloading an existing collection of geofences uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). + * + *

### Submit Download Request + * + *

To download your content you will use a `GET` request where the path will contain the `udid` of the data to + * download. Optionally, you can also pass in an `Accept` header to specify a preference for the `Content-Type` of + * the data response. <br> For example, to download a collection of geofences previously uploaded using the + * Upload API, set the `udid` parameter in the path to the `udid` of the data received previously in the upload API + * response and set the `Accept` header to either one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

### Download Data Response + * + *

The Download API will return a HTTP `200 OK` response if the data resource with the passed-in `udid` is found, + * where the response body will contain the content of the data resource.<br> A HTTP `400 Bad Request` error + * response will be returned if the data resource with the passed-in `udid` is not found.<br> + * + *

Here's a sample response body for a simple geofence represented in `GeoJSON` uploaded previously using the + * Upload API: <br> + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ```. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> downloadWithResponse(String udid, RequestOptions requestOptions) { + return this.serviceClient.downloadWithResponseAsync(udid, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to delete a previously uploaded data content.<br> You can use this API in a + * scenario like removing geofences previously uploaded using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). You can also use this API to delete old/unused + * uploaded content and create space for new content. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `udid` of the data to + * delete.<br> For example, to delete a collection of geofences previously uploaded using the Upload API, set + * the `udid` parameter in the path to the `udid` of the data received previously in the upload API response. + * + *

### Delete Data Response + * + *

The Data Delete API returns a HTTP `204 No Content` response with an empty body, if the data resource was + * deleted successfully.<br> A HTTP `400 Bad Request` error response will be returned if the data resource + * with the passed-in `udid` is not found. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponse(String udid, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(udid, requestOptions); + } + + /** + * This path will be obtained from a call to POST /mapData. While in progress, an http200 will be returned with no + * extra headers - followed by an http200 with Resource-Location header once completed. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param operationId The ID to query the status for the data upload request. + * @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 the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return this.serviceClient.getOperationWithResponseAsync(operationId, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceClient.java b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceClient.java new file mode 100644 index 000000000000..d5cd42d028e9 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceClient.java @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.data; + +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.core.util.polling.SyncPoller; +import com.azure.maps.data.implementation.DatasImpl; + +/** Initializes a new instance of the synchronous AzureMapsDataServiceClient type. */ +@ServiceClient(builder = AzureMapsDataServiceClientBuilder.class) +public final class AzureMapsDataServiceClient { + @Generated private final DatasImpl serviceClient; + + /** + * Initializes an instance of Datas client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsDataServiceClient(DatasImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Upload API allows the caller to upload data content to the Azure Maps service. You can use this API + * in a scenario like uploading a collection of Geofences in `GeoJSON` format, for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

## Submit Upload Request + * + *

To upload your content you will use a `POST` request. The request body will contain the data to upload. The + * `dataFormat` query parameter will contain the format for the data, the `dataSharingLevel` query parameter can + * contain the sharing level for the data. The `Content-Type` header will be set to the content type of the data. + * + *

For example, to upload a collection of geofences in `GeoJSON` format, set the request body to the geofence + * content. Set the `dataFormat` query parameter to _geojson_, and set the `Content-Type` header to either one of + * the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for uploading a simple Geofence represented as a circle geometry using a center + * point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The Data Upload API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Upload Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
dataFormatStringYesData format of the content being uploaded.
+ * + *

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.
contentLengthlongYesThe contentLength parameter
+ * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param uploadContent The content to upload. + * @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 the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpload(BinaryData uploadContent, RequestOptions requestOptions) { + return this.serviceClient.beginUpload(uploadContent, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to fetch a list of all content uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview). + * + *

### Submit List Request + * + *

To list all your map data content you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The Data List API returns the complete list of all data in `json` format. The response contains the following + * details for each data resource: + * + *

> udid - The unique data id for the data resource. + * + *

> location - The location of the data resource. Execute a HTTP `GET` on this location to download the data. + * + *

Here's a sample response returning the `udid` and `location` of 3 data resources: + * + *

<br> + * + *

```json { "mapDataList": [ { "udid": "9a1288fa-1858-4a3b-b68d-13a8j5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/9a1288fa-1858-4a3b-b68d-13a8j5af7d7c?api-version=1.0", "sizeInBytes": + * 29920, "uploadStatus": "Completed" }, { "udid": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/8b1288fa-1958-4a2b-b68e-13a7i5af7d7c?api-version=1.0", "sizeInBytes": + * 1339, "uploadStatus": "Completed" }, { "udid": "7c1288fa-2058-4a1b-b68f-13a6h5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/7c1288fa-2058-4a1b-b68f-13a6h5af7d7c?api-version=1.0", "sizeInBytes": + * 1650, "uploadStatus": "Pending" }] } ``` + * + *

<br>. + * + *

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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     mapDataList: [
+     *         {
+     *             udid: String
+     *             locationUrl: String
+     *             sizeInBytes: Long
+     *             uploadStatus: String(Pending/Completed/Failed)
+     *             dataFormat: String(geojson/zip/dwgzippackage)
+     *             description: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 the response model for the Data List API. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listWithResponse(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Update API allows the caller to update a previously uploaded data content. + * + *

You can use this API in a scenario like adding or removing geofences to or from an existing collection of + * geofences. Geofences are uploaded using the [Data Upload + * API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for use in the [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

Please note that the Update API will *replace* and *override* the existing data content. + * + *

## Submit Update Request + * + *

To update your content you will use a `PUT` request. The request body will contain the new data that will + * replace the existing data. The `Content-Type` header will be set to the content type of the data, and the path + * will contain the `udid` of the data to be update. + * + *

For example, to update a collection of geofences that were previously uploaded using the Upload API, place the + * new geofence content in the request body. Set the `udid` parameter in the path to the `udid` of the data received + * previously in the upload API response. And set the `Content-Type` header to one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for updating a simple Geofence. It's represented as a circle geometry using a + * center point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The previously uploaded geofence had a radius of 100m. The above request will update it to 500m. + * + *

The Data Update API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Update Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
+ * + *

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
+     * Object
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @param updateContent The new content that will update/replace the previously uploaded content. + * @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 the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdate( + String udid, BinaryData updateContent, RequestOptions requestOptions) { + return this.serviceClient.beginUpdate(udid, updateContent, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to download a previously uploaded data content.<br> You can use this API in a + * scenario like downloading an existing collection of geofences uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). + * + *

### Submit Download Request + * + *

To download your content you will use a `GET` request where the path will contain the `udid` of the data to + * download. Optionally, you can also pass in an `Accept` header to specify a preference for the `Content-Type` of + * the data response. <br> For example, to download a collection of geofences previously uploaded using the + * Upload API, set the `udid` parameter in the path to the `udid` of the data received previously in the upload API + * response and set the `Accept` header to either one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

### Download Data Response + * + *

The Download API will return a HTTP `200 OK` response if the data resource with the passed-in `udid` is found, + * where the response body will contain the content of the data resource.<br> A HTTP `400 Bad Request` error + * response will be returned if the data resource with the passed-in `udid` is not found.<br> + * + *

Here's a sample response body for a simple geofence represented in `GeoJSON` uploaded previously using the + * Upload API: <br> + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ```. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response downloadWithResponse(String udid, RequestOptions requestOptions) { + return this.serviceClient.downloadWithResponse(udid, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to delete a previously uploaded data content.<br> You can use this API in a + * scenario like removing geofences previously uploaded using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). You can also use this API to delete old/unused + * uploaded content and create space for new content. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `udid` of the data to + * delete.<br> For example, to delete a collection of geofences previously uploaded using the Upload API, set + * the `udid` parameter in the path to the `udid` of the data received previously in the upload API response. + * + *

### Delete Data Response + * + *

The Data Delete API returns a HTTP `204 No Content` response with an empty body, if the data resource was + * deleted successfully.<br> A HTTP `400 Bad Request` error response will be returned if the data resource + * with the passed-in `udid` is not found. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String udid, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponse(udid, requestOptions); + } + + /** + * This path will be obtained from a call to POST /mapData. While in progress, an http200 will be returned with no + * extra headers - followed by an http200 with Resource-Location header once completed. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param operationId The ID to query the status for the data upload request. + * @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 the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return this.serviceClient.getOperationWithResponse(operationId, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceClientBuilder.java b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceClientBuilder.java new file mode 100644 index 000000000000..a203f3acbfe3 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceClientBuilder.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.data; + +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.data.implementation.AzureMapsDataServiceClientImpl; +import com.azure.maps.data.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 AzureMapsDataServiceClient type. */ +@ServiceClientBuilder(serviceClients = {AzureMapsDataServiceClient.class, AzureMapsDataServiceAsyncClient.class}) +public final class AzureMapsDataServiceClientBuilder { + @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-data.properties"); + + /** Create an instance of the AzureMapsDataServiceClientBuilder. */ + @Generated + public AzureMapsDataServiceClientBuilder() { + 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder geography(Geography geography) { + this.geography = geography; + return this; + } + + /* + * Service version + */ + @Generated private AzureMapsDataServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder serviceVersion(AzureMapsDataServiceVersion 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder 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 AzureMapsDataServiceClientBuilder. + */ + @Generated + public AzureMapsDataServiceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AzureMapsDataServiceClientImpl with the provided parameters. + * + * @return an instance of AzureMapsDataServiceClientImpl. + */ + @Generated + private AzureMapsDataServiceClientImpl buildInnerClient() { + if (geography == null) { + this.geography = Geography.US; + } + if (serviceVersion == null) { + this.serviceVersion = AzureMapsDataServiceVersion.getLatest(); + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AzureMapsDataServiceClientImpl client = + new AzureMapsDataServiceClientImpl( + 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 AzureMapsDataServiceAsyncClient async client. + * + * @return an instance of AzureMapsDataServiceAsyncClient. + */ + @Generated + public AzureMapsDataServiceAsyncClient buildAsyncClient() { + return new AzureMapsDataServiceAsyncClient(buildInnerClient().getDatas()); + } + + /** + * Builds an instance of AzureMapsDataServiceClient sync client. + * + * @return an instance of AzureMapsDataServiceClient. + */ + @Generated + public AzureMapsDataServiceClient buildClient() { + return new AzureMapsDataServiceClient(buildInnerClient().getDatas()); + } +} diff --git a/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceVersion.java b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceVersion.java new file mode 100644 index 000000000000..b1dc9abf93b8 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/AzureMapsDataServiceVersion.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.data; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AzureMapsDataServiceClient. */ +public enum AzureMapsDataServiceVersion implements ServiceVersion { + /** Enum value 2022-01-01-preview. */ + V2022_01_01_PREVIEW("2022-01-01-preview"); + + private final String version; + + AzureMapsDataServiceVersion(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 AzureMapsDataServiceVersion}. + */ + public static AzureMapsDataServiceVersion getLatest() { + return V2022_01_01_PREVIEW; + } +} diff --git a/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/implementation/AzureMapsDataServiceClientImpl.java b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/implementation/AzureMapsDataServiceClientImpl.java new file mode 100644 index 000000000000..c8696aefeb69 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/implementation/AzureMapsDataServiceClientImpl.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.data.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.data.AzureMapsDataServiceVersion; +import com.azure.maps.data.models.Geography; + +/** Initializes a new instance of the AzureMapsDataServiceClient type. */ +public final class AzureMapsDataServiceClientImpl { + /** + * 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 AzureMapsDataServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AzureMapsDataServiceVersion 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 DatasImpl object to access its operations. */ + private final DatasImpl datas; + + /** + * Gets the DatasImpl object to access its operations. + * + * @return the DatasImpl object. + */ + public DatasImpl getDatas() { + return this.datas; + } + + /** + * Initializes an instance of AzureMapsDataServiceClient 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 AzureMapsDataServiceClientImpl( + String clientId, Geography geography, AzureMapsDataServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + clientId, + geography, + serviceVersion); + } + + /** + * Initializes an instance of AzureMapsDataServiceClient 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 AzureMapsDataServiceClientImpl( + HttpPipeline httpPipeline, + String clientId, + Geography geography, + AzureMapsDataServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + } + + /** + * Initializes an instance of AzureMapsDataServiceClient 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 AzureMapsDataServiceClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String clientId, + Geography geography, + AzureMapsDataServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.clientId = clientId; + this.geography = geography; + this.serviceVersion = serviceVersion; + this.datas = new DatasImpl(this); + } +} diff --git a/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/implementation/DatasImpl.java b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/implementation/DatasImpl.java new file mode 100644 index 000000000000..a1744b1bf1bb --- /dev/null +++ b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/implementation/DatasImpl.java @@ -0,0 +1,1889 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.data.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +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.Put; +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 com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Datas. */ +public final class DatasImpl { + /** The proxy service used to perform REST calls. */ + private final DatasService service; + + /** The service client containing this operation class. */ + private final AzureMapsDataServiceClientImpl client; + + /** + * Initializes an instance of DatasImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatasImpl(AzureMapsDataServiceClientImpl client) { + this.service = RestProxy.create(DatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMapsDataServiceDatas to be used by the proxy service to perform + * REST calls. + */ + @Host("https://{geography}.atlas.microsoft.com") + @ServiceInterface(name = "AzureMapsDataService") + private interface DatasService { + @Post("/mapData") + @ExpectedResponses({200, 202}) + Mono> upload( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/octet-stream") BinaryData uploadContent, + RequestOptions requestOptions, + Context context); + + @Get("/mapData") + @ExpectedResponses({200}) + Mono> list( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Put("/mapData/{udid}") + @ExpectedResponses({200, 202}) + Mono> update( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("udid") String udid, + @BodyParam("application/json") BinaryData updateContent, + RequestOptions requestOptions, + Context context); + + @Get("/mapData/{udid}") + @ExpectedResponses({200}) + Mono> download( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("udid") String udid, + RequestOptions requestOptions, + Context context); + + @Delete("/mapData/{udid}") + @ExpectedResponses({204}) + Mono> delete( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("udid") String udid, + RequestOptions requestOptions, + Context context); + + @Get("/mapData/operations/{operationId}") + @ExpectedResponses({200}) + Mono> getOperation( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, + RequestOptions requestOptions, + Context context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Upload API allows the caller to upload data content to the Azure Maps service. You can use this API + * in a scenario like uploading a collection of Geofences in `GeoJSON` format, for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

## Submit Upload Request + * + *

To upload your content you will use a `POST` request. The request body will contain the data to upload. The + * `dataFormat` query parameter will contain the format for the data, the `dataSharingLevel` query parameter can + * contain the sharing level for the data. The `Content-Type` header will be set to the content type of the data. + * + *

For example, to upload a collection of geofences in `GeoJSON` format, set the request body to the geofence + * content. Set the `dataFormat` query parameter to _geojson_, and set the `Content-Type` header to either one of + * the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for uploading a simple Geofence represented as a circle geometry using a center + * point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The Data Upload API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Upload Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
dataFormatStringYesData format of the content being uploaded.
+ * + *

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.
contentLengthlongYesThe contentLength parameter
+ * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param uploadContent The content to upload. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadWithResponseAsync(BinaryData uploadContent, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.upload( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + uploadContent, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Upload API allows the caller to upload data content to the Azure Maps service. You can use this API + * in a scenario like uploading a collection of Geofences in `GeoJSON` format, for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

## Submit Upload Request + * + *

To upload your content you will use a `POST` request. The request body will contain the data to upload. The + * `dataFormat` query parameter will contain the format for the data, the `dataSharingLevel` query parameter can + * contain the sharing level for the data. The `Content-Type` header will be set to the content type of the data. + * + *

For example, to upload a collection of geofences in `GeoJSON` format, set the request body to the geofence + * content. Set the `dataFormat` query parameter to _geojson_, and set the `Content-Type` header to either one of + * the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for uploading a simple Geofence represented as a circle geometry using a center + * point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The Data Upload API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Upload Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
dataFormatStringYesData format of the content being uploaded.
+ * + *

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.
contentLengthlongYesThe contentLength parameter
+ * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param uploadContent The content to upload. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadWithResponseAsync( + BinaryData uploadContent, RequestOptions requestOptions, Context context) { + return service.upload( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + uploadContent, + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Upload API allows the caller to upload data content to the Azure Maps service. You can use this API + * in a scenario like uploading a collection of Geofences in `GeoJSON` format, for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

## Submit Upload Request + * + *

To upload your content you will use a `POST` request. The request body will contain the data to upload. The + * `dataFormat` query parameter will contain the format for the data, the `dataSharingLevel` query parameter can + * contain the sharing level for the data. The `Content-Type` header will be set to the content type of the data. + * + *

For example, to upload a collection of geofences in `GeoJSON` format, set the request body to the geofence + * content. Set the `dataFormat` query parameter to _geojson_, and set the `Content-Type` header to either one of + * the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for uploading a simple Geofence represented as a circle geometry using a center + * point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The Data Upload API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Upload Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
dataFormatStringYesData format of the content being uploaded.
+ * + *

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.
contentLengthlongYesThe contentLength parameter
+ * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param uploadContent The content to upload. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUploadAsync( + BinaryData uploadContent, RequestOptions requestOptions) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.uploadWithResponseAsync(uploadContent, requestOptions), + new DefaultPollingStrategy<>(this.client.getHttpPipeline()), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Upload API allows the caller to upload data content to the Azure Maps service. You can use this API + * in a scenario like uploading a collection of Geofences in `GeoJSON` format, for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

## Submit Upload Request + * + *

To upload your content you will use a `POST` request. The request body will contain the data to upload. The + * `dataFormat` query parameter will contain the format for the data, the `dataSharingLevel` query parameter can + * contain the sharing level for the data. The `Content-Type` header will be set to the content type of the data. + * + *

For example, to upload a collection of geofences in `GeoJSON` format, set the request body to the geofence + * content. Set the `dataFormat` query parameter to _geojson_, and set the `Content-Type` header to either one of + * the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for uploading a simple Geofence represented as a circle geometry using a center + * point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The Data Upload API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Upload Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
dataFormatStringYesData format of the content being uploaded.
+ * + *

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.
contentLengthlongYesThe contentLength parameter
+ * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param uploadContent The content to upload. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUploadAsync( + BinaryData uploadContent, RequestOptions requestOptions, Context context) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.uploadWithResponseAsync(uploadContent, requestOptions, context), + new DefaultPollingStrategy<>(this.client.getHttpPipeline()), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Upload API allows the caller to upload data content to the Azure Maps service. You can use this API + * in a scenario like uploading a collection of Geofences in `GeoJSON` format, for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

## Submit Upload Request + * + *

To upload your content you will use a `POST` request. The request body will contain the data to upload. The + * `dataFormat` query parameter will contain the format for the data, the `dataSharingLevel` query parameter can + * contain the sharing level for the data. The `Content-Type` header will be set to the content type of the data. + * + *

For example, to upload a collection of geofences in `GeoJSON` format, set the request body to the geofence + * content. Set the `dataFormat` query parameter to _geojson_, and set the `Content-Type` header to either one of + * the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for uploading a simple Geofence represented as a circle geometry using a center + * point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The Data Upload API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Upload Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
dataFormatStringYesData format of the content being uploaded.
+ * + *

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.
contentLengthlongYesThe contentLength parameter
+ * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param uploadContent The content to upload. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpload(BinaryData uploadContent, RequestOptions requestOptions) { + return this.beginUploadAsync(uploadContent, requestOptions).getSyncPoller(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to fetch a list of all content uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview). + * + *

### Submit List Request + * + *

To list all your map data content you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The Data List API returns the complete list of all data in `json` format. The response contains the following + * details for each data resource: + * + *

> udid - The unique data id for the data resource. + * + *

> location - The location of the data resource. Execute a HTTP `GET` on this location to download the data. + * + *

Here's a sample response returning the `udid` and `location` of 3 data resources: + * + *

<br> + * + *

```json { "mapDataList": [ { "udid": "9a1288fa-1858-4a3b-b68d-13a8j5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/9a1288fa-1858-4a3b-b68d-13a8j5af7d7c?api-version=1.0", "sizeInBytes": + * 29920, "uploadStatus": "Completed" }, { "udid": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/8b1288fa-1958-4a2b-b68e-13a7i5af7d7c?api-version=1.0", "sizeInBytes": + * 1339, "uploadStatus": "Completed" }, { "udid": "7c1288fa-2058-4a1b-b68f-13a6h5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/7c1288fa-2058-4a1b-b68f-13a6h5af7d7c?api-version=1.0", "sizeInBytes": + * 1650, "uploadStatus": "Pending" }] } ``` + * + *

<br>. + * + *

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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     mapDataList: [
+     *         {
+     *             udid: String
+     *             locationUrl: String
+     *             sizeInBytes: Long
+     *             uploadStatus: String(Pending/Completed/Failed)
+     *             dataFormat: String(geojson/zip/dwgzippackage)
+     *             description: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 the response model for the Data List API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.list( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to fetch a list of all content uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview). + * + *

### Submit List Request + * + *

To list all your map data content you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The Data List API returns the complete list of all data in `json` format. The response contains the following + * details for each data resource: + * + *

> udid - The unique data id for the data resource. + * + *

> location - The location of the data resource. Execute a HTTP `GET` on this location to download the data. + * + *

Here's a sample response returning the `udid` and `location` of 3 data resources: + * + *

<br> + * + *

```json { "mapDataList": [ { "udid": "9a1288fa-1858-4a3b-b68d-13a8j5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/9a1288fa-1858-4a3b-b68d-13a8j5af7d7c?api-version=1.0", "sizeInBytes": + * 29920, "uploadStatus": "Completed" }, { "udid": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/8b1288fa-1958-4a2b-b68e-13a7i5af7d7c?api-version=1.0", "sizeInBytes": + * 1339, "uploadStatus": "Completed" }, { "udid": "7c1288fa-2058-4a1b-b68f-13a6h5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/7c1288fa-2058-4a1b-b68f-13a6h5af7d7c?api-version=1.0", "sizeInBytes": + * 1650, "uploadStatus": "Pending" }] } ``` + * + *

<br>. + * + *

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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     mapDataList: [
+     *         {
+     *             udid: String
+     *             locationUrl: String
+     *             sizeInBytes: Long
+     *             uploadStatus: String(Pending/Completed/Failed)
+     *             dataFormat: String(geojson/zip/dwgzippackage)
+     *             description: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 the response model for the Data List API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listWithResponseAsync(RequestOptions requestOptions, Context context) { + return service.list( + this.client.getGeography(), this.client.getServiceVersion().getVersion(), requestOptions, context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to fetch a list of all content uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview). + * + *

### Submit List Request + * + *

To list all your map data content you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The Data List API returns the complete list of all data in `json` format. The response contains the following + * details for each data resource: + * + *

> udid - The unique data id for the data resource. + * + *

> location - The location of the data resource. Execute a HTTP `GET` on this location to download the data. + * + *

Here's a sample response returning the `udid` and `location` of 3 data resources: + * + *

<br> + * + *

```json { "mapDataList": [ { "udid": "9a1288fa-1858-4a3b-b68d-13a8j5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/9a1288fa-1858-4a3b-b68d-13a8j5af7d7c?api-version=1.0", "sizeInBytes": + * 29920, "uploadStatus": "Completed" }, { "udid": "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/8b1288fa-1958-4a2b-b68e-13a7i5af7d7c?api-version=1.0", "sizeInBytes": + * 1339, "uploadStatus": "Completed" }, { "udid": "7c1288fa-2058-4a1b-b68f-13a6h5af7d7c", "location": + * "https://us.atlas.microsoft.com/mapData/7c1288fa-2058-4a1b-b68f-13a6h5af7d7c?api-version=1.0", "sizeInBytes": + * 1650, "uploadStatus": "Pending" }] } ``` + * + *

<br>. + * + *

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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     mapDataList: [
+     *         {
+     *             udid: String
+     *             locationUrl: String
+     *             sizeInBytes: Long
+     *             uploadStatus: String(Pending/Completed/Failed)
+     *             dataFormat: String(geojson/zip/dwgzippackage)
+     *             description: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 the response model for the Data List API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(RequestOptions requestOptions) { + return listWithResponseAsync(requestOptions).block(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Update API allows the caller to update a previously uploaded data content. + * + *

You can use this API in a scenario like adding or removing geofences to or from an existing collection of + * geofences. Geofences are uploaded using the [Data Upload + * API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for use in the [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

Please note that the Update API will *replace* and *override* the existing data content. + * + *

## Submit Update Request + * + *

To update your content you will use a `PUT` request. The request body will contain the new data that will + * replace the existing data. The `Content-Type` header will be set to the content type of the data, and the path + * will contain the `udid` of the data to be update. + * + *

For example, to update a collection of geofences that were previously uploaded using the Upload API, place the + * new geofence content in the request body. Set the `udid` parameter in the path to the `udid` of the data received + * previously in the upload API response. And set the `Content-Type` header to one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for updating a simple Geofence. It's represented as a circle geometry using a + * center point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The previously uploaded geofence had a radius of 100m. The above request will update it to 500m. + * + *

The Data Update API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Update Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
+ * + *

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
+     * Object
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @param updateContent The new content that will update/replace the previously uploaded content. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String udid, BinaryData updateContent, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.update( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + udid, + updateContent, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Update API allows the caller to update a previously uploaded data content. + * + *

You can use this API in a scenario like adding or removing geofences to or from an existing collection of + * geofences. Geofences are uploaded using the [Data Upload + * API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for use in the [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

Please note that the Update API will *replace* and *override* the existing data content. + * + *

## Submit Update Request + * + *

To update your content you will use a `PUT` request. The request body will contain the new data that will + * replace the existing data. The `Content-Type` header will be set to the content type of the data, and the path + * will contain the `udid` of the data to be update. + * + *

For example, to update a collection of geofences that were previously uploaded using the Upload API, place the + * new geofence content in the request body. Set the `udid` parameter in the path to the `udid` of the data received + * previously in the upload API response. And set the `Content-Type` header to one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for updating a simple Geofence. It's represented as a circle geometry using a + * center point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The previously uploaded geofence had a radius of 100m. The above request will update it to 500m. + * + *

The Data Update API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Update Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
+ * + *

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
+     * Object
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @param updateContent The new content that will update/replace the previously uploaded content. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String udid, BinaryData updateContent, RequestOptions requestOptions, Context context) { + return service.update( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + udid, + updateContent, + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Update API allows the caller to update a previously uploaded data content. + * + *

You can use this API in a scenario like adding or removing geofences to or from an existing collection of + * geofences. Geofences are uploaded using the [Data Upload + * API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for use in the [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

Please note that the Update API will *replace* and *override* the existing data content. + * + *

## Submit Update Request + * + *

To update your content you will use a `PUT` request. The request body will contain the new data that will + * replace the existing data. The `Content-Type` header will be set to the content type of the data, and the path + * will contain the `udid` of the data to be update. + * + *

For example, to update a collection of geofences that were previously uploaded using the Upload API, place the + * new geofence content in the request body. Set the `udid` parameter in the path to the `udid` of the data received + * previously in the upload API response. And set the `Content-Type` header to one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for updating a simple Geofence. It's represented as a circle geometry using a + * center point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The previously uploaded geofence had a radius of 100m. The above request will update it to 500m. + * + *

The Data Update API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Update Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
+ * + *

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
+     * Object
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @param updateContent The new content that will update/replace the previously uploaded content. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateAsync( + String udid, BinaryData updateContent, RequestOptions requestOptions) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.updateWithResponseAsync(udid, updateContent, requestOptions), + new DefaultPollingStrategy<>(this.client.getHttpPipeline()), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Update API allows the caller to update a previously uploaded data content. + * + *

You can use this API in a scenario like adding or removing geofences to or from an existing collection of + * geofences. Geofences are uploaded using the [Data Upload + * API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for use in the [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

Please note that the Update API will *replace* and *override* the existing data content. + * + *

## Submit Update Request + * + *

To update your content you will use a `PUT` request. The request body will contain the new data that will + * replace the existing data. The `Content-Type` header will be set to the content type of the data, and the path + * will contain the `udid` of the data to be update. + * + *

For example, to update a collection of geofences that were previously uploaded using the Upload API, place the + * new geofence content in the request body. Set the `udid` parameter in the path to the `udid` of the data received + * previously in the upload API response. And set the `Content-Type` header to one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for updating a simple Geofence. It's represented as a circle geometry using a + * center point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The previously uploaded geofence had a radius of 100m. The above request will update it to 500m. + * + *

The Data Update API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Update Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
+ * + *

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
+     * Object
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @param updateContent The new content that will update/replace the previously uploaded content. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateAsync( + String udid, BinaryData updateContent, RequestOptions requestOptions, Context context) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.updateWithResponseAsync(udid, updateContent, requestOptions, context), + new DefaultPollingStrategy<>(this.client.getHttpPipeline()), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Data Update API allows the caller to update a previously uploaded data content. + * + *

You can use this API in a scenario like adding or removing geofences to or from an existing collection of + * geofences. Geofences are uploaded using the [Data Upload + * API](https://docs.microsoft.com/rest/api/maps/data-v2/upload-preview), for use in the [Azure Maps Geofencing + * Service](https://docs.microsoft.com/rest/api/maps/spatial). + * + *

Please note that the Update API will *replace* and *override* the existing data content. + * + *

## Submit Update Request + * + *

To update your content you will use a `PUT` request. The request body will contain the new data that will + * replace the existing data. The `Content-Type` header will be set to the content type of the data, and the path + * will contain the `udid` of the data to be update. + * + *

For example, to update a collection of geofences that were previously uploaded using the Upload API, place the + * new geofence content in the request body. Set the `udid` parameter in the path to the `udid` of the data received + * previously in the upload API response. And set the `Content-Type` header to one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

Here's a sample request body for updating a simple Geofence. It's represented as a circle geometry using a + * center point and a radius. The sample below is in `GeoJSON`: + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ``` + * + *

The previously uploaded geofence had a radius of 100m. The above request will update it to 500m. + * + *

The Data Update API performs a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

## Data Update Limits + * + *

Please, be aware that currently every Azure Maps account has a [data storage + * limit](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-maps-limits). + * Once the storage limit is reached, all the new upload API calls will return a `409 Conflict` http error response. + * You can always use the [Data Delete API](https://docs.microsoft.com/rest/api/maps/data-v2/delete-preview) to + * delete old/unused content and create space for new uploads. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
descriptionStringNoThe description to be given to the upload.
+ * + *

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
+     * Object
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @param updateContent The new content that will update/replace the previously uploaded content. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdate( + String udid, BinaryData updateContent, RequestOptions requestOptions) { + return this.beginUpdateAsync(udid, updateContent, requestOptions).getSyncPoller(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to download a previously uploaded data content.<br> You can use this API in a + * scenario like downloading an existing collection of geofences uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). + * + *

### Submit Download Request + * + *

To download your content you will use a `GET` request where the path will contain the `udid` of the data to + * download. Optionally, you can also pass in an `Accept` header to specify a preference for the `Content-Type` of + * the data response. <br> For example, to download a collection of geofences previously uploaded using the + * Upload API, set the `udid` parameter in the path to the `udid` of the data received previously in the upload API + * response and set the `Accept` header to either one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

### Download Data Response + * + *

The Download API will return a HTTP `200 OK` response if the data resource with the passed-in `udid` is found, + * where the response body will contain the content of the data resource.<br> A HTTP `400 Bad Request` error + * response will be returned if the data resource with the passed-in `udid` is not found.<br> + * + *

Here's a sample response body for a simple geofence represented in `GeoJSON` uploaded previously using the + * Upload API: <br> + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ```. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> downloadWithResponseAsync(String udid, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.download( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + udid, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to download a previously uploaded data content.<br> You can use this API in a + * scenario like downloading an existing collection of geofences uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). + * + *

### Submit Download Request + * + *

To download your content you will use a `GET` request where the path will contain the `udid` of the data to + * download. Optionally, you can also pass in an `Accept` header to specify a preference for the `Content-Type` of + * the data response. <br> For example, to download a collection of geofences previously uploaded using the + * Upload API, set the `udid` parameter in the path to the `udid` of the data received previously in the upload API + * response and set the `Accept` header to either one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

### Download Data Response + * + *

The Download API will return a HTTP `200 OK` response if the data resource with the passed-in `udid` is found, + * where the response body will contain the content of the data resource.<br> A HTTP `400 Bad Request` error + * response will be returned if the data resource with the passed-in `udid` is not found.<br> + * + *

Here's a sample response body for a simple geofence represented in `GeoJSON` uploaded previously using the + * Upload API: <br> + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ```. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> downloadWithResponseAsync(String udid, RequestOptions requestOptions, Context context) { + return service.download( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + udid, + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to download a previously uploaded data content.<br> You can use this API in a + * scenario like downloading an existing collection of geofences uploaded previously using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). + * + *

### Submit Download Request + * + *

To download your content you will use a `GET` request where the path will contain the `udid` of the data to + * download. Optionally, you can also pass in an `Accept` header to specify a preference for the `Content-Type` of + * the data response. <br> For example, to download a collection of geofences previously uploaded using the + * Upload API, set the `udid` parameter in the path to the `udid` of the data received previously in the upload API + * response and set the `Accept` header to either one of the following media types: + * + *

- `application/json` - `application/vnd.geo+json` - `application/octet-stream` + * + *

### Download Data Response + * + *

The Download API will return a HTTP `200 OK` response if the data resource with the passed-in `udid` is found, + * where the response body will contain the content of the data resource.<br> A HTTP `400 Bad Request` error + * response will be returned if the data resource with the passed-in `udid` is not found.<br> + * + *

Here's a sample response body for a simple geofence represented in `GeoJSON` uploaded previously using the + * Upload API: <br> + * + *

```json { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", + * "coordinates": [-122.126986, 47.639754] }, "properties": { "geometryId": "001", "radius": 500 } }] } ```. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response downloadWithResponse(String udid, RequestOptions requestOptions) { + return downloadWithResponseAsync(udid, requestOptions).block(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to delete a previously uploaded data content.<br> You can use this API in a + * scenario like removing geofences previously uploaded using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). You can also use this API to delete old/unused + * uploaded content and create space for new content. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `udid` of the data to + * delete.<br> For example, to delete a collection of geofences previously uploaded using the Upload API, set + * the `udid` parameter in the path to the `udid` of the data received previously in the upload API response. + * + *

### Delete Data Response + * + *

The Data Delete API returns a HTTP `204 No Content` response with an empty body, if the data resource was + * deleted successfully.<br> A HTTP `400 Bad Request` error response will be returned if the data resource + * with the passed-in `udid` is not found. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String udid, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.delete( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + udid, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to delete a previously uploaded data content.<br> You can use this API in a + * scenario like removing geofences previously uploaded using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). You can also use this API to delete old/unused + * uploaded content and create space for new content. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `udid` of the data to + * delete.<br> For example, to delete a collection of geofences previously uploaded using the Upload API, set + * the `udid` parameter in the path to the `udid` of the data received previously in the upload API response. + * + *

### Delete Data Response + * + *

The Data Delete API returns a HTTP `204 No Content` response with an empty body, if the data resource was + * deleted successfully.<br> A HTTP `400 Bad Request` error response will be returned if the data resource + * with the passed-in `udid` is not found. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String udid, RequestOptions requestOptions, Context context) { + return service.delete( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + udid, + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API allows the caller to delete a previously uploaded data content.<br> You can use this API in a + * scenario like removing geofences previously uploaded using the [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) for use in our [Azure Maps Geofencing + * Service](https://docs.microsoft.com/en-us/rest/api/maps/spatial). You can also use this API to delete old/unused + * uploaded content and create space for new content. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `udid` of the data to + * delete.<br> For example, to delete a collection of geofences previously uploaded using the Upload API, set + * the `udid` parameter in the path to the `udid` of the data received previously in the upload API response. + * + *

### Delete Data Response + * + *

The Data Delete API returns a HTTP `204 No Content` response with an empty body, if the data resource was + * deleted successfully.<br> A HTTP `400 Bad Request` error response will be returned if the data resource + * with the passed-in `udid` is not found. + * + *

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.
+ * + * @param udid The unique data id for the content. The `udid` must have been obtained from a successful [Data Upload + * API](https://docs.microsoft.com/en-us/rest/api/maps/data-v2/upload-preview) call. + * @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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String udid, RequestOptions requestOptions) { + return deleteWithResponseAsync(udid, requestOptions).block(); + } + + /** + * This path will be obtained from a call to POST /mapData. While in progress, an http200 will be returned with no + * extra headers - followed by an http200 with Resource-Location header once completed. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param operationId The ID to query the status for the data upload request. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationWithResponseAsync(String operationId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getOperation( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + operationId, + requestOptions, + context)); + } + + /** + * This path will be obtained from a call to POST /mapData. While in progress, an http200 will be returned with no + * extra headers - followed by an http200 with Resource-Location header once completed. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param operationId The ID to query the status for the data upload request. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationWithResponseAsync( + String operationId, RequestOptions requestOptions, Context context) { + return service.getOperation( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + operationId, + requestOptions, + context); + } + + /** + * This path will be obtained from a call to POST /mapData. While in progress, an http200 will be returned with no + * extra headers - followed by an http200 with Resource-Location header once completed. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Failed/Succeeded)
+     *     created: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         additionalInfo: [
+     *             {
+     *                 type: String
+     *                 info: Object
+     *             }
+     *         ]
+     *     }
+     *     warning: (recursive schema, see warning above)
+     * }
+     * }
+ * + * @param operationId The ID to query the status for the data upload request. + * @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 the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return getOperationWithResponseAsync(operationId, requestOptions).block(); + } + + private static final class TypeReferenceBinaryData extends TypeReference { + // empty + } +} diff --git a/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/package-info.java b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/package-info.java new file mode 100644 index 000000000000..f283c04393f9 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/main/java/com/azure/maps/data/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 AzureMapsDataService. APIs for uploading map data to Azure Maps. */ +package com.azure.maps.data; diff --git a/sdk/maps/azure-maps-data/src/main/java/module-info.java b/sdk/maps/azure-maps-data/src/main/java/module-info.java new file mode 100644 index 000000000000..e5280f1d2b06 --- /dev/null +++ b/sdk/maps/azure-maps-data/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.data { + requires transitive com.azure.core; + + exports com.azure.maps.data; +} diff --git a/sdk/maps/azure-maps-data/src/main/resources/azure-maps-data.properties b/sdk/maps/azure-maps-data/src/main/resources/azure-maps-data.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/main/resources/azure-maps-data.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/ReadmeSamples.java b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/ReadmeSamples.java new file mode 100644 index 000000000000..847fc800002e --- /dev/null +++ b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/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.data; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.maps.data.readme + // END: com.azure.maps.data.readme + } +} diff --git a/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/DeletePreviouslyUploadedGeoJSONDataContainingGeometriesThatRepresentACollectionOfGeofences.java b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/DeletePreviouslyUploadedGeoJSONDataContainingGeometriesThatRepresentACollectionOfGeofences.java new file mode 100644 index 000000000000..7300fd4def49 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/DeletePreviouslyUploadedGeoJSONDataContainingGeometriesThatRepresentACollectionOfGeofences.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.data.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.data.AzureMapsDataServiceClient; +import com.azure.maps.data.AzureMapsDataServiceClientBuilder; + +public class DeletePreviouslyUploadedGeoJSONDataContainingGeometriesThatRepresentACollectionOfGeofences { + public static void main(String[] args) { + AzureMapsDataServiceClient client = + new AzureMapsDataServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.deleteWithResponse("25084fb7-307a-4720-8f91-7952a0b91012", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/DownloadPreviouslyUploadedGeoJSONDataContainingGeometriesThatRepresentACollectionOfGeofences.java b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/DownloadPreviouslyUploadedGeoJSONDataContainingGeometriesThatRepresentACollectionOfGeofences.java new file mode 100644 index 000000000000..a154c2920279 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/DownloadPreviouslyUploadedGeoJSONDataContainingGeometriesThatRepresentACollectionOfGeofences.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.data.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.data.AzureMapsDataServiceClient; +import com.azure.maps.data.AzureMapsDataServiceClientBuilder; + +public class DownloadPreviouslyUploadedGeoJSONDataContainingGeometriesThatRepresentACollectionOfGeofences { + public static void main(String[] args) { + AzureMapsDataServiceClient client = + new AzureMapsDataServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.downloadWithResponse("25084fb7-307a-4720-8f91-7952a0b91012", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.java b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.java new file mode 100644 index 000000000000..54acc678d669 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.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.data.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.data.AzureMapsDataServiceClient; +import com.azure.maps.data.AzureMapsDataServiceClientBuilder; + +public class GetTheStatusOfAnOperationWhichHasFinishedSuccessfully { + public static void main(String[] args) { + AzureMapsDataServiceClient client = + new AzureMapsDataServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.getOperationWithResponse("8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/GetTheStatusOfAnOperationWhichIsStillRunning.java b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/GetTheStatusOfAnOperationWhichIsStillRunning.java new file mode 100644 index 000000000000..5dd7f62ce903 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/GetTheStatusOfAnOperationWhichIsStillRunning.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.data.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.data.AzureMapsDataServiceClient; +import com.azure.maps.data.AzureMapsDataServiceClientBuilder; + +public class GetTheStatusOfAnOperationWhichIsStillRunning { + public static void main(String[] args) { + AzureMapsDataServiceClient client = + new AzureMapsDataServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.getOperationWithResponse("8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/ListAllThePreviouslyUploadedData.java b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/ListAllThePreviouslyUploadedData.java new file mode 100644 index 000000000000..c890feac1675 --- /dev/null +++ b/sdk/maps/azure-maps-data/src/samples/java/com/azure/maps/data/generated/ListAllThePreviouslyUploadedData.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.data.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.data.AzureMapsDataServiceClient; +import com.azure.maps.data.AzureMapsDataServiceClientBuilder; + +public class ListAllThePreviouslyUploadedData { + public static void main(String[] args) { + AzureMapsDataServiceClient client = + new AzureMapsDataServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.listWithResponse(requestOptions); + } +} diff --git a/sdk/maps/azure-maps-data/src/test/java/com/azure/maps/data/ClientTests.java b/sdk/maps/azure-maps-data/src/test/java/com/azure/maps/data/ClientTests.java new file mode 100644 index 000000000000..b44a9bd9b19c --- /dev/null +++ b/sdk/maps/azure-maps-data/src/test/java/com/azure/maps/data/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.data; + +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 AzureMapsDataServiceClientBuilder builder; + + @BeforeEach + public void setup() { + builder = + new AzureMapsDataServiceClientBuilder() + .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-data/swagger/README_SPEC.md b/sdk/maps/azure-maps-data/swagger/README_SPEC.md new file mode 100644 index 000000000000..2f5d2503778f --- /dev/null +++ b/sdk/maps/azure-maps-data/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/2022-01-01-preview/data.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-data +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.maps.data +context-client-method-parameter: true +azure-arm: false +credential-types: tokencredential +credential-scopes: https://maps.azure.com/.default +service-versions: + - '2022-01-01-preview' +```