From b10a482c2ca1236ac2c0c56e5a9a192accb73bf9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 1 Mar 2022 19:41:07 +0000 Subject: [PATCH] CodeGen from PR 18047 in Azure/azure-rest-api-specs Merge e13c2dd2fd4b4c29ac5e9390def735a49bad48f0 into a18974f4b347b995372059a54eeaf4912f53aa03 --- sdk/maps/azure-maps-tileset/CHANGELOG.md | 13 + sdk/maps/azure-maps-tileset/README.md | 63 + sdk/maps/azure-maps-tileset/pom.xml | 73 + .../AzureMapsTilesetServiceAsyncClient.java | 399 +++++ .../AzureMapsTilesetServiceClient.java | 322 ++++ .../AzureMapsTilesetServiceClientBuilder.java | 357 ++++ .../AzureMapsTilesetServiceVersion.java | 33 + .../AzureMapsTilesetServiceClientImpl.java | 166 ++ .../tileset/implementation/TilesetsImpl.java | 1453 +++++++++++++++++ .../com/azure/maps/tileset/package-info.java | 6 + .../src/main/java/module-info.java | 9 + .../resources/azure-maps-tileset.properties | 2 + .../com/azure/maps/tileset/ReadmeSamples.java | 12 + .../CreateTilesetByProvidingADatasetId.java | 25 + .../generated/DeleteACreatedTileset.java | 23 + .../generated/GetAListOfAllTilesets.java | 24 + ...OperationWhichHasFinishedSuccessfully.java | 25 + ...tatusOfAnOperationWhichIsStillRunning.java | 25 + .../GetsTheDetailsForASingleTileset.java | 24 + .../com/azure/maps/tileset/ClientTests.java | 51 + .../azure-maps-tileset/swagger/README_SPEC.md | 25 + 21 files changed, 3130 insertions(+) create mode 100644 sdk/maps/azure-maps-tileset/CHANGELOG.md create mode 100644 sdk/maps/azure-maps-tileset/README.md create mode 100644 sdk/maps/azure-maps-tileset/pom.xml create mode 100644 sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceAsyncClient.java create mode 100644 sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceClient.java create mode 100644 sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceClientBuilder.java create mode 100644 sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceVersion.java create mode 100644 sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/implementation/AzureMapsTilesetServiceClientImpl.java create mode 100644 sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/implementation/TilesetsImpl.java create mode 100644 sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/package-info.java create mode 100644 sdk/maps/azure-maps-tileset/src/main/java/module-info.java create mode 100644 sdk/maps/azure-maps-tileset/src/main/resources/azure-maps-tileset.properties create mode 100644 sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/ReadmeSamples.java create mode 100644 sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/CreateTilesetByProvidingADatasetId.java create mode 100644 sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/DeleteACreatedTileset.java create mode 100644 sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetAListOfAllTilesets.java create mode 100644 sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.java create mode 100644 sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetTheStatusOfAnOperationWhichIsStillRunning.java create mode 100644 sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetsTheDetailsForASingleTileset.java create mode 100644 sdk/maps/azure-maps-tileset/src/test/java/com/azure/maps/tileset/ClientTests.java create mode 100644 sdk/maps/azure-maps-tileset/swagger/README_SPEC.md diff --git a/sdk/maps/azure-maps-tileset/CHANGELOG.md b/sdk/maps/azure-maps-tileset/CHANGELOG.md new file mode 100644 index 000000000000..9f75e412e526 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AzureMapsTilesetService client library for Java. This package contains Microsoft Azure AzureMapsTilesetService client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/maps/azure-maps-tileset/README.md b/sdk/maps/azure-maps-tileset/README.md new file mode 100644 index 000000000000..fb37738d80ae --- /dev/null +++ b/sdk/maps/azure-maps-tileset/README.md @@ -0,0 +1,63 @@ +# Azure AzureMapsTilesetService client library for Java + +Azure AzureMapsTilesetService client library for Java. + +This package contains Microsoft Azure AzureMapsTilesetService 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-tileset;current}) +```xml + + com.azure + azure-maps-tileset + 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.tileset.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-tileset/pom.xml b/sdk/maps/azure-maps-tileset/pom.xml new file mode 100644 index 000000000000..86d57b742cec --- /dev/null +++ b/sdk/maps/azure-maps-tileset/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-maps-tileset + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureMapsTilesetService Management + This package contains Microsoft Azure AzureMapsTilesetService 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 + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-http-netty + 1.11.7 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + com.azure + azure-core-test + 1.7.8 + test + + + com.azure + azure-identity + 1.4.4 + test + + + diff --git a/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceAsyncClient.java b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceAsyncClient.java new file mode 100644 index 000000000000..e8ee842a4dd8 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceAsyncClient.java @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.tileset; + +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.PagedFlux; +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.tileset.implementation.TilesetsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AzureMapsTilesetServiceClient type. */ +@ServiceClient(builder = AzureMapsTilesetServiceClientBuilder.class, isAsync = true) +public final class AzureMapsTilesetServiceAsyncClient { + @Generated private final TilesetsImpl serviceClient; + + /** + * Initializes an instance of Tilesets client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsTilesetServiceAsyncClient(TilesetsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

[This](https://docs.microsoft.com/en-us/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

The Tileset Create API allows the caller to create a tileset from a dataset. A tileset contains a set of tiles + * that can be consumed from the [Get Map Tile](/rest/api/maps/render/getmaptile) to retrieve custom tiles. To make + * a dataset, use the [DataSet Create API](/rest/api/maps/dataset/createpreview). + * + *

## Submit Create Request + * + *

To create your tileset you will make a `POST` request with an empty body. The `datasetId` query parameter will + * be used as the source of the tileset data. + * + *

The Create Tileset API is a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe unique `datasetId` that the tileset create API uses to retrieve features to generate tiles. The `datasetId` must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoUser provided description of the tileset.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     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 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponse(RequestOptions requestOptions) { + return this.serviceClient.createWithResponseAsync(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

[This](https://docs.microsoft.com/en-us/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

The Tileset Create API allows the caller to create a tileset from a dataset. A tileset contains a set of tiles + * that can be consumed from the [Get Map Tile](/rest/api/maps/render/getmaptile) to retrieve custom tiles. To make + * a dataset, use the [DataSet Create API](/rest/api/maps/dataset/createpreview). + * + *

## Submit Create Request + * + *

To create your tileset you will make a `POST` request with an empty body. The `datasetId` query parameter will + * be used as the source of the tileset data. + * + *

The Create Tileset API is a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe unique `datasetId` that the tileset create API uses to retrieve features to generate tiles. The `datasetId` must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoUser provided description of the tileset.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     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 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 {@link PollerFlux} for polling of the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreate(RequestOptions requestOptions) { + return this.serviceClient.beginCreateAsync(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a list of all tilesets created. <br>. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 Tileset List API as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux list(RequestOptions requestOptions) { + return this.serviceClient.listAsync(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a tileset. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesetId: String
+     *     ontology: String
+     *     datasetId: String
+     *     description: String
+     *     minZoom: Integer
+     *     maxZoom: Integer
+     *     bbox: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + * @param tilesetId The Tileset Id. + * @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 detail information for the data along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(String tilesetId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(tilesetId, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to delete a created tileset.<br> You can use this API if a tileset is no + * longer needed. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `tilesetId` of the + * tileset to delete.<br> + * + *

#### Delete request "Successful" + * + *

The Tileset Delete API returns a HTTP `204 No Content` response with an empty body, if the tileset was deleted + * successfully.<br> + * + *

#### Delete request "Failed" + * + *

A HTTP `400 Bad Request` error response will be returned if the tileset with the passed-in `tilesetId` is not + * found. + * + *

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - Tileset Id: + * d85b5b27-5fc4-4599-8b50-47160e90f8ce does not exist." } } ```. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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 tilesetId The Tileset Id. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponse(String tilesetId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(tilesetId, requestOptions); + } + + /** + * This path will be obtained from a call to /tilesets/create. While in progress, an http200 will be returned with + * no extra headers - followed by an http200 with Resource-Location header once successfully completed. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi 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 tileset create/import 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceClient.java b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceClient.java new file mode 100644 index 000000000000..a7ab07e3850f --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceClient.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.tileset; + +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.PagedIterable; +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.tileset.implementation.TilesetsImpl; + +/** Initializes a new instance of the synchronous AzureMapsTilesetServiceClient type. */ +@ServiceClient(builder = AzureMapsTilesetServiceClientBuilder.class) +public final class AzureMapsTilesetServiceClient { + @Generated private final TilesetsImpl serviceClient; + + /** + * Initializes an instance of Tilesets client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsTilesetServiceClient(TilesetsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

[This](https://docs.microsoft.com/en-us/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

The Tileset Create API allows the caller to create a tileset from a dataset. A tileset contains a set of tiles + * that can be consumed from the [Get Map Tile](/rest/api/maps/render/getmaptile) to retrieve custom tiles. To make + * a dataset, use the [DataSet Create API](/rest/api/maps/dataset/createpreview). + * + *

## Submit Create Request + * + *

To create your tileset you will make a `POST` request with an empty body. The `datasetId` query parameter will + * be used as the source of the tileset data. + * + *

The Create Tileset API is a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe unique `datasetId` that the tileset create API uses to retrieve features to generate tiles. The `datasetId` must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoUser provided description of the tileset.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     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 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 {@link SyncPoller} for polling of the response model for a Long-Running Operations API. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(RequestOptions requestOptions) { + return this.serviceClient.beginCreate(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a list of all tilesets created. <br>. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 Tileset List API as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(RequestOptions requestOptions) { + return this.serviceClient.list(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a tileset. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesetId: String
+     *     ontology: String
+     *     datasetId: String
+     *     description: String
+     *     minZoom: Integer
+     *     maxZoom: Integer
+     *     bbox: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + * @param tilesetId The Tileset Id. + * @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 detail information for the data along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String tilesetId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(tilesetId, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to delete a created tileset.<br> You can use this API if a tileset is no + * longer needed. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `tilesetId` of the + * tileset to delete.<br> + * + *

#### Delete request "Successful" + * + *

The Tileset Delete API returns a HTTP `204 No Content` response with an empty body, if the tileset was deleted + * successfully.<br> + * + *

#### Delete request "Failed" + * + *

A HTTP `400 Bad Request` error response will be returned if the tileset with the passed-in `tilesetId` is not + * found. + * + *

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - Tileset Id: + * d85b5b27-5fc4-4599-8b50-47160e90f8ce does not exist." } } ```. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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 tilesetId The Tileset Id. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String tilesetId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponse(tilesetId, requestOptions); + } + + /** + * This path will be obtained from a call to /tilesets/create. While in progress, an http200 will be returned with + * no extra headers - followed by an http200 with Resource-Location header once successfully completed. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi 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 tileset create/import 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 along with {@link Response}. + */ + @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-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceClientBuilder.java b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceClientBuilder.java new file mode 100644 index 000000000000..0e4f284dec54 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceClientBuilder.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.tileset; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.AzureKeyCredential; +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.AzureKeyCredentialPolicy; +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.tileset.implementation.AzureMapsTilesetServiceClientImpl; +import com.azure.maps.tileset.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 AzureMapsTilesetServiceClient type. */ +@ServiceClientBuilder(serviceClients = {AzureMapsTilesetServiceClient.class, AzureMapsTilesetServiceAsyncClient.class}) +public final class AzureMapsTilesetServiceClientBuilder { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://atlas.microsoft.com/.default"}; + + @Generated private final Map properties = CoreUtils.getProperties("azure-maps-tileset.properties"); + + /** Create an instance of the AzureMapsTilesetServiceClientBuilder. */ + @Generated + public AzureMapsTilesetServiceClientBuilder() { + 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder geography(Geography geography) { + this.geography = geography; + return this; + } + + /* + * Service version + */ + @Generated private AzureMapsTilesetServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder serviceVersion(AzureMapsTilesetServiceVersion 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The Azure Key Credential used for authentication. + */ + @Generated private AzureKeyCredential azureKeyCredential; + + /** + * Sets The Azure Key Credential used for authentication. + * + * @param azureKeyCredential the azureKeyCredential value. + * @return the AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder credential(AzureKeyCredential azureKeyCredential) { + this.azureKeyCredential = azureKeyCredential; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** + * Sets The TokenCredential used for authentication. + * + * @param tokenCredential the tokenCredential value. + * @return the AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder 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 AzureMapsTilesetServiceClientBuilder. + */ + @Generated + public AzureMapsTilesetServiceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AzureMapsTilesetServiceClientImpl with the provided parameters. + * + * @return an instance of AzureMapsTilesetServiceClientImpl. + */ + @Generated + private AzureMapsTilesetServiceClientImpl buildInnerClient() { + if (geography == null) { + this.geography = Geography.US; + } + if (serviceVersion == null) { + this.serviceVersion = AzureMapsTilesetServiceVersion.getLatest(); + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AzureMapsTilesetServiceClientImpl client = + new AzureMapsTilesetServiceClientImpl( + 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 (azureKeyCredential != null) { + policies.add(new AzureKeyCredentialPolicy("subscription-key", azureKeyCredential)); + } + 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 AzureMapsTilesetServiceAsyncClient async client. + * + * @return an instance of AzureMapsTilesetServiceAsyncClient. + */ + @Generated + public AzureMapsTilesetServiceAsyncClient buildAsyncClient() { + return new AzureMapsTilesetServiceAsyncClient(buildInnerClient().getTilesets()); + } + + /** + * Builds an instance of AzureMapsTilesetServiceClient sync client. + * + * @return an instance of AzureMapsTilesetServiceClient. + */ + @Generated + public AzureMapsTilesetServiceClient buildClient() { + return new AzureMapsTilesetServiceClient(buildInnerClient().getTilesets()); + } +} diff --git a/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceVersion.java b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceVersion.java new file mode 100644 index 000000000000..8acfc986e4f5 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/AzureMapsTilesetServiceVersion.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.tileset; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AzureMapsTilesetServiceClient. */ +public enum AzureMapsTilesetServiceVersion implements ServiceVersion { + /** Enum value 2.0. */ + V2_0("2.0"); + + private final String version; + + AzureMapsTilesetServiceVersion(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 AzureMapsTilesetServiceVersion}. + */ + public static AzureMapsTilesetServiceVersion getLatest() { + return V2_0; + } +} diff --git a/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/implementation/AzureMapsTilesetServiceClientImpl.java b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/implementation/AzureMapsTilesetServiceClientImpl.java new file mode 100644 index 000000000000..c1a319315e00 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/implementation/AzureMapsTilesetServiceClientImpl.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.tileset.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.tileset.AzureMapsTilesetServiceVersion; +import com.azure.maps.tileset.models.Geography; + +/** Initializes a new instance of the AzureMapsTilesetServiceClient type. */ +public final class AzureMapsTilesetServiceClientImpl { + /** + * 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 AzureMapsTilesetServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AzureMapsTilesetServiceVersion 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 TilesetsImpl object to access its operations. */ + private final TilesetsImpl tilesets; + + /** + * Gets the TilesetsImpl object to access its operations. + * + * @return the TilesetsImpl object. + */ + public TilesetsImpl getTilesets() { + return this.tilesets; + } + + /** + * Initializes an instance of AzureMapsTilesetServiceClient 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 AzureMapsTilesetServiceClientImpl( + String clientId, Geography geography, AzureMapsTilesetServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + clientId, + geography, + serviceVersion); + } + + /** + * Initializes an instance of AzureMapsTilesetServiceClient 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 AzureMapsTilesetServiceClientImpl( + HttpPipeline httpPipeline, + String clientId, + Geography geography, + AzureMapsTilesetServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + } + + /** + * Initializes an instance of AzureMapsTilesetServiceClient 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 AzureMapsTilesetServiceClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String clientId, + Geography geography, + AzureMapsTilesetServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.clientId = clientId; + this.geography = geography; + this.serviceVersion = serviceVersion; + this.tilesets = new TilesetsImpl(this); + } +} diff --git a/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/implementation/TilesetsImpl.java b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/implementation/TilesetsImpl.java new file mode 100644 index 000000000000..548c5283eb17 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/implementation/TilesetsImpl.java @@ -0,0 +1,1453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.tileset.implementation; + +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.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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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 java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Tilesets. */ +public final class TilesetsImpl { + /** The proxy service used to perform REST calls. */ + private final TilesetsService service; + + /** The service client containing this operation class. */ + private final AzureMapsTilesetServiceClientImpl client; + + /** + * Initializes an instance of TilesetsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TilesetsImpl(AzureMapsTilesetServiceClientImpl client) { + this.service = RestProxy.create(TilesetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMapsTilesetServiceTilesets to be used by the proxy service to + * perform REST calls. + */ + @Host("https://{geography}.atlas.microsoft.com") + @ServiceInterface(name = "AzureMapsTilesetServ") + private interface TilesetsService { + @Post("/tilesets") + @ExpectedResponses({200, 202}) + Mono> create( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Get("/tilesets") + @ExpectedResponses({200}) + Mono> list( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Get("/tilesets/{tilesetId}") + @ExpectedResponses({200}) + Mono> get( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("tilesetId") String tilesetId, + RequestOptions requestOptions, + Context context); + + @Delete("/tilesets/{tilesetId}") + @ExpectedResponses({204}) + Mono> delete( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("tilesetId") String tilesetId, + RequestOptions requestOptions, + Context context); + + @Get("/tilesets/operations/{operationId}") + @ExpectedResponses({200}) + Mono> getOperation( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("geography") String geography, + RequestOptions requestOptions, + Context context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

[This](https://docs.microsoft.com/en-us/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

The Tileset Create API allows the caller to create a tileset from a dataset. A tileset contains a set of tiles + * that can be consumed from the [Get Map Tile](/rest/api/maps/render/getmaptile) to retrieve custom tiles. To make + * a dataset, use the [DataSet Create API](/rest/api/maps/dataset/createpreview). + * + *

## Submit Create Request + * + *

To create your tileset you will make a `POST` request with an empty body. The `datasetId` query parameter will + * be used as the source of the tileset data. + * + *

The Create Tileset API is a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe unique `datasetId` that the tileset create API uses to retrieve features to generate tiles. The `datasetId` must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoUser provided description of the tileset.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     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 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.create( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

[This](https://docs.microsoft.com/en-us/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

The Tileset Create API allows the caller to create a tileset from a dataset. A tileset contains a set of tiles + * that can be consumed from the [Get Map Tile](/rest/api/maps/render/getmaptile) to retrieve custom tiles. To make + * a dataset, use the [DataSet Create API](/rest/api/maps/dataset/createpreview). + * + *

## Submit Create Request + * + *

To create your tileset you will make a `POST` request with an empty body. The `datasetId` query parameter will + * be used as the source of the tileset data. + * + *

The Create Tileset API is a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe unique `datasetId` that the tileset create API uses to retrieve features to generate tiles. The `datasetId` must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoUser provided description of the tileset.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     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 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(RequestOptions requestOptions, Context context) { + return service.create( + this.client.getGeography(), this.client.getServiceVersion().getVersion(), requestOptions, context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

[This](https://docs.microsoft.com/en-us/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

The Tileset Create API allows the caller to create a tileset from a dataset. A tileset contains a set of tiles + * that can be consumed from the [Get Map Tile](/rest/api/maps/render/getmaptile) to retrieve custom tiles. To make + * a dataset, use the [DataSet Create API](/rest/api/maps/dataset/createpreview). + * + *

## Submit Create Request + * + *

To create your tileset you will make a `POST` request with an empty body. The `datasetId` query parameter will + * be used as the source of the tileset data. + * + *

The Create Tileset API is a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe unique `datasetId` that the tileset create API uses to retrieve features to generate tiles. The `datasetId` must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoUser provided description of the tileset.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     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 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 {@link PollerFlux} for polling of the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateAsync(RequestOptions requestOptions) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.createWithResponseAsync(requestOptions), + new DefaultPollingStrategy<>(this.client.getHttpPipeline()), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

[This](https://docs.microsoft.com/en-us/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

The Tileset Create API allows the caller to create a tileset from a dataset. A tileset contains a set of tiles + * that can be consumed from the [Get Map Tile](/rest/api/maps/render/getmaptile) to retrieve custom tiles. To make + * a dataset, use the [DataSet Create API](/rest/api/maps/dataset/createpreview). + * + *

## Submit Create Request + * + *

To create your tileset you will make a `POST` request with an empty body. The `datasetId` query parameter will + * be used as the source of the tileset data. + * + *

The Create Tileset API is a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe unique `datasetId` that the tileset create API uses to retrieve features to generate tiles. The `datasetId` must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoUser provided description of the tileset.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     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 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 {@link PollerFlux} for polling of the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateAsync(RequestOptions requestOptions, Context context) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.createWithResponseAsync(requestOptions, context), + new DefaultPollingStrategy<>(this.client.getHttpPipeline()), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

[This](https://docs.microsoft.com/en-us/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

The Tileset Create API allows the caller to create a tileset from a dataset. A tileset contains a set of tiles + * that can be consumed from the [Get Map Tile](/rest/api/maps/render/getmaptile) to retrieve custom tiles. To make + * a dataset, use the [DataSet Create API](/rest/api/maps/dataset/createpreview). + * + *

## Submit Create Request + * + *

To create your tileset you will make a `POST` request with an empty body. The `datasetId` query parameter will + * be used as the source of the tileset data. + * + *

The Create Tileset API is a [long-running request](https://aka.ms/am-creator-lrt-v2). + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe unique `datasetId` that the tileset create API uses to retrieve features to generate tiles. The `datasetId` must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoUser provided description of the tileset.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     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 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 {@link SyncPoller} for polling of the response model for a Long-Running Operations API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(RequestOptions requestOptions) { + return this.beginCreateAsync(requestOptions).getSyncPoller(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a list of all tilesets created. <br>. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 Tileset List API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.list( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "tilesets"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a list of all tilesets created. <br>. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 Tileset List API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(RequestOptions requestOptions, Context context) { + return service.list( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "tilesets"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a list of all tilesets created. <br>. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 Tileset List API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(RequestOptions requestOptions) { + return new PagedFlux<>( + () -> listSinglePageAsync(requestOptions), nextLink -> listNextSinglePageAsync(nextLink, null)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a list of all tilesets created. <br>. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 Tileset List API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(RequestOptions requestOptions, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(requestOptions, context), + nextLink -> listNextSinglePageAsync(nextLink, null, context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a list of all tilesets created. <br>. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 Tileset List API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(RequestOptions requestOptions) { + return new PagedIterable<>(listAsync(requestOptions)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a tileset. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesetId: String
+     *     ontology: String
+     *     datasetId: String
+     *     description: String
+     *     minZoom: Integer
+     *     maxZoom: Integer
+     *     bbox: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + * @param tilesetId The Tileset Id. + * @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 detail information for the data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String tilesetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.get( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + tilesetId, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a tileset. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesetId: String
+     *     ontology: String
+     *     datasetId: String
+     *     description: String
+     *     minZoom: Integer
+     *     maxZoom: Integer
+     *     bbox: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + * @param tilesetId The Tileset Id. + * @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 detail information for the data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String tilesetId, RequestOptions requestOptions, Context context) { + return service.get( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + tilesetId, + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to fetch a tileset. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesetId: String
+     *     ontology: String
+     *     datasetId: String
+     *     description: String
+     *     minZoom: Integer
+     *     maxZoom: Integer
+     *     bbox: [
+     *         float
+     *     ]
+     * }
+     * }
+ * + * @param tilesetId The Tileset Id. + * @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 detail information for the data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String tilesetId, RequestOptions requestOptions) { + return getWithResponseAsync(tilesetId, requestOptions).block(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to delete a created tileset.<br> You can use this API if a tileset is no + * longer needed. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `tilesetId` of the + * tileset to delete.<br> + * + *

#### Delete request "Successful" + * + *

The Tileset Delete API returns a HTTP `204 No Content` response with an empty body, if the tileset was deleted + * successfully.<br> + * + *

#### Delete request "Failed" + * + *

A HTTP `400 Bad Request` error response will be returned if the tileset with the passed-in `tilesetId` is not + * found. + * + *

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - Tileset Id: + * d85b5b27-5fc4-4599-8b50-47160e90f8ce does not exist." } } ```. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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 tilesetId The Tileset Id. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String tilesetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.delete( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + tilesetId, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to delete a created tileset.<br> You can use this API if a tileset is no + * longer needed. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `tilesetId` of the + * tileset to delete.<br> + * + *

#### Delete request "Successful" + * + *

The Tileset Delete API returns a HTTP `204 No Content` response with an empty body, if the tileset was deleted + * successfully.<br> + * + *

#### Delete request "Failed" + * + *

A HTTP `400 Bad Request` error response will be returned if the tileset with the passed-in `tilesetId` is not + * found. + * + *

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - Tileset Id: + * d85b5b27-5fc4-4599-8b50-47160e90f8ce does not exist." } } ```. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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 tilesetId The Tileset Id. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String tilesetId, RequestOptions requestOptions, Context context) { + return service.delete( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + tilesetId, + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. [This](https://docs.microsoft.com/azure/azure-maps/creator-indoor-maps) article introduces concepts and + * tools that apply to Azure Maps Creator. + * + *

This API allows the caller to delete a created tileset.<br> You can use this API if a tileset is no + * longer needed. + * + *

### Submit Delete Request + * + *

To delete your content you will issue a `DELETE` request where the path will contain the `tilesetId` of the + * tileset to delete.<br> + * + *

#### Delete request "Successful" + * + *

The Tileset Delete API returns a HTTP `204 No Content` response with an empty body, if the tileset was deleted + * successfully.<br> + * + *

#### Delete request "Failed" + * + *

A HTTP `400 Bad Request` error response will be returned if the tileset with the passed-in `tilesetId` is not + * found. + * + *

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - Tileset Id: + * d85b5b27-5fc4-4599-8b50-47160e90f8ce does not exist." } } ```. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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 tilesetId The Tileset Id. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String tilesetId, RequestOptions requestOptions) { + return deleteWithResponseAsync(tilesetId, requestOptions).block(); + } + + /** + * This path will be obtained from a call to /tilesets/create. While in progress, an http200 will be returned with + * no extra headers - followed by an http200 with Resource-Location header once successfully completed. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi 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 tileset create/import 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 /tilesets/create. While in progress, an http200 will be returned with + * no extra headers - followed by an http200 with Resource-Location header once successfully completed. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi 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 tileset create/import 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 /tilesets/create. While in progress, an http200 will be returned with + * no extra headers - followed by an http200 with Resource-Location header once successfully completed. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi 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 tileset create/import 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return getOperationWithResponseAsync(operationId, requestOptions).block(); + } + + /** + * Get the next page of items. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @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 Tileset List API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.listNext(nextLink, this.client.getGeography(), requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "tilesets"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies 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
+     * {
+     *     tilesets: [
+     *         {
+     *             tilesetId: String
+     *             ontology: String
+     *             datasetId: String
+     *             description: String
+     *             minZoom: Integer
+     *             maxZoom: Integer
+     *             bbox: [
+     *                 float
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @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 Tileset List API along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + return service.listNext(nextLink, this.client.getGeography(), requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "tilesets"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + private static final class TypeReferenceBinaryData extends TypeReference { + // empty + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/package-info.java b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/package-info.java new file mode 100644 index 000000000000..a93cd20fa900 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/main/java/com/azure/maps/tileset/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 AzureMapsTilesetService. APIs for managing Tilesets. */ +package com.azure.maps.tileset; diff --git a/sdk/maps/azure-maps-tileset/src/main/java/module-info.java b/sdk/maps/azure-maps-tileset/src/main/java/module-info.java new file mode 100644 index 000000000000..2d011f7b49eb --- /dev/null +++ b/sdk/maps/azure-maps-tileset/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.tileset { + requires transitive com.azure.core; + + exports com.azure.maps.tileset; +} diff --git a/sdk/maps/azure-maps-tileset/src/main/resources/azure-maps-tileset.properties b/sdk/maps/azure-maps-tileset/src/main/resources/azure-maps-tileset.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/main/resources/azure-maps-tileset.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/ReadmeSamples.java b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/ReadmeSamples.java new file mode 100644 index 000000000000..315ce6901fc5 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/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.tileset; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.maps.tileset.readme + // END: com.azure.maps.tileset.readme + } +} diff --git a/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/CreateTilesetByProvidingADatasetId.java b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/CreateTilesetByProvidingADatasetId.java new file mode 100644 index 000000000000..23eee302d331 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/CreateTilesetByProvidingADatasetId.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.tileset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.tileset.AzureMapsTilesetServiceClient; +import com.azure.maps.tileset.AzureMapsTilesetServiceClientBuilder; + +public class CreateTilesetByProvidingADatasetId { + public static void main(String[] args) { + AzureMapsTilesetServiceClient client = + new AzureMapsTilesetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("datasetId", "[dataset-Id]"); + SyncPoller response = client.beginCreate(requestOptions); + } +} diff --git a/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/DeleteACreatedTileset.java b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/DeleteACreatedTileset.java new file mode 100644 index 000000000000..49c3f1e6d94c --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/DeleteACreatedTileset.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.tileset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.tileset.AzureMapsTilesetServiceClient; +import com.azure.maps.tileset.AzureMapsTilesetServiceClientBuilder; + +public class DeleteACreatedTileset { + public static void main(String[] args) { + AzureMapsTilesetServiceClient client = + new AzureMapsTilesetServiceClientBuilder() + .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-tileset/src/samples/java/com/azure/maps/tileset/generated/GetAListOfAllTilesets.java b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetAListOfAllTilesets.java new file mode 100644 index 000000000000..f6951e63366a --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetAListOfAllTilesets.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.tileset.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.tileset.AzureMapsTilesetServiceClient; +import com.azure.maps.tileset.AzureMapsTilesetServiceClientBuilder; + +public class GetAListOfAllTilesets { + public static void main(String[] args) { + AzureMapsTilesetServiceClient client = + new AzureMapsTilesetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = client.list(requestOptions); + } +} diff --git a/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.java b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.java new file mode 100644 index 000000000000..01e87d1e536f --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/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.tileset.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.tileset.AzureMapsTilesetServiceClient; +import com.azure.maps.tileset.AzureMapsTilesetServiceClientBuilder; + +public class GetTheStatusOfAnOperationWhichHasFinishedSuccessfully { + public static void main(String[] args) { + AzureMapsTilesetServiceClient client = + new AzureMapsTilesetServiceClientBuilder() + .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-tileset/src/samples/java/com/azure/maps/tileset/generated/GetTheStatusOfAnOperationWhichIsStillRunning.java b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetTheStatusOfAnOperationWhichIsStillRunning.java new file mode 100644 index 000000000000..a62c092c595c --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/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.tileset.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.tileset.AzureMapsTilesetServiceClient; +import com.azure.maps.tileset.AzureMapsTilesetServiceClientBuilder; + +public class GetTheStatusOfAnOperationWhichIsStillRunning { + public static void main(String[] args) { + AzureMapsTilesetServiceClient client = + new AzureMapsTilesetServiceClientBuilder() + .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-tileset/src/samples/java/com/azure/maps/tileset/generated/GetsTheDetailsForASingleTileset.java b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetsTheDetailsForASingleTileset.java new file mode 100644 index 000000000000..f2608032e885 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/samples/java/com/azure/maps/tileset/generated/GetsTheDetailsForASingleTileset.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.tileset.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.tileset.AzureMapsTilesetServiceClient; +import com.azure.maps.tileset.AzureMapsTilesetServiceClientBuilder; + +public class GetsTheDetailsForASingleTileset { + public static void main(String[] args) { + AzureMapsTilesetServiceClient client = + new AzureMapsTilesetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.getWithResponse("d8fa86de-bb0f-4a02-a6ff-62ae7545dd84", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-tileset/src/test/java/com/azure/maps/tileset/ClientTests.java b/sdk/maps/azure-maps-tileset/src/test/java/com/azure/maps/tileset/ClientTests.java new file mode 100644 index 000000000000..5990442a0ccf --- /dev/null +++ b/sdk/maps/azure-maps-tileset/src/test/java/com/azure/maps/tileset/ClientTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.tileset; + +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 com.azure.maps.tileset.models.Geography; +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 AzureMapsTilesetServiceClient azureMapsTilesetServiceClient; + + @BeforeEach + public void setup() { + AzureMapsTilesetServiceClientBuilder azureMapsTilesetServiceClientbuilder = + new AzureMapsTilesetServiceClientBuilder() + .geography(Configuration.getGlobalConfiguration().get("GEOGRAPHY", Geography.US)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + azureMapsTilesetServiceClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + azureMapsTilesetServiceClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + azureMapsTilesetServiceClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + azureMapsTilesetServiceClient = azureMapsTilesetServiceClientbuilder.buildClient(); + } + + @Test + @DoNotRecord(skipInPlayback = true) + public void testClient() { + // use the builder to create client + } +} diff --git a/sdk/maps/azure-maps-tileset/swagger/README_SPEC.md b/sdk/maps/azure-maps-tileset/swagger/README_SPEC.md new file mode 100644 index 000000000000..58837f715395 --- /dev/null +++ b/sdk/maps/azure-maps-tileset/swagger/README_SPEC.md @@ -0,0 +1,25 @@ +## Generate autorest code + +```yaml +input-files: +- /home/vsts/work/1/s/azure-rest-api-specs/specification/maps/data-plane/Creator/preview/2.0/tileset.json +output-folder: ../ +java: true +regenerate-pom: false +partial-update: true +generate-sync-async-clients: true +generate-client-as-impl: true +generate-client-interfaces: false +generate-builder-per-client: true +add-context-parameter: true +artifact-id: azure-maps-tileset +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.maps.tileset +context-client-method-parameter: true +azure-arm: false +service-versions: +- '2.0' +```