diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 9094ba44d3b9..00e5a09ad164 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -146,6 +146,9 @@ com.azure:azure-template-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-media-videoanalyzer-edge;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-verticals-agrifood-farming;1.0.0-beta.2;1.0.0-beta.3 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-maps-stylerecipe;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-maps-styleset;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-maps-tileset;1.0.0-beta.1;1.0.0-beta.1 com.microsoft.azure:spring-cloud-azure-appconfiguration-config-web;1.3.0;1.4.0-beta.1 com.microsoft.azure:spring-cloud-azure-appconfiguration-config;1.3.0;1.4.0-beta.1 com.microsoft.azure:spring-cloud-azure-feature-management-web;1.3.0;1.4.0-beta.1 diff --git a/sdk/maps/azure-maps-styleset/CHANGELOG.md b/sdk/maps/azure-maps-styleset/CHANGELOG.md new file mode 100644 index 000000000000..5ebbd67b7c89 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AzureMapsStyleSetService client library for Java. This package contains Microsoft Azure AzureMapsStyleSetService client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/maps/azure-maps-styleset/README.md b/sdk/maps/azure-maps-styleset/README.md new file mode 100644 index 000000000000..1eeadd89fae7 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/README.md @@ -0,0 +1,63 @@ +# Azure AzureMapsStyleSetService client library for Java + +Azure AzureMapsStyleSetService client library for Java. + +This package contains Microsoft Azure AzureMapsStyleSetService 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-styleset;current}) +```xml + + com.azure + azure-maps-styleset + 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.styleset.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-styleset/pom.xml b/sdk/maps/azure-maps-styleset/pom.xml new file mode 100644 index 000000000000..8fcee253578a --- /dev/null +++ b/sdk/maps/azure-maps-styleset/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-styleset + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureMapsStyleSetService Management + This package contains Microsoft Azure AzureMapsStyleSetService 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.27.0 + + + com.azure + azure-core-http-netty + 1.11.9 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + com.azure + azure-core-test + 1.7.10 + test + + + com.azure + azure-identity + 1.5.0 + test + + + diff --git a/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceAsyncClient.java b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceAsyncClient.java new file mode 100644 index 000000000000..18cb4c8c7f85 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceAsyncClient.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset; + +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.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +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.styleset.implementation.StyleSetsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AzureMapsStyleSetServiceClient type. */ +@ServiceClient(builder = AzureMapsStyleSetServiceClientBuilder.class, isAsync = true) +public final class AzureMapsStyleSetServiceAsyncClient { + @Generated private final StyleSetsImpl serviceClient; + + /** + * Initializes an instance of AzureMapsStyleSetServiceAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsStyleSetServiceAsyncClient(StyleSetsImpl 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. + * + *

The StyleSet Create API allows the caller to create a styleSet from their styleSet configuration file. + * + *

## Submit Create Request + * + *

To create your styleset you will make a `POST` request with a styleSet configuration file. + * + *

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

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
dataFormatStringNoDefines the type of input file for a style set to be created from.
aliasStringNoThe alias of the style set.
descriptionStringNoUser provided description of the styleSet.
+ * + *

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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@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. + * + *

The StyleSet Create API allows the caller to create a styleSet from their styleSet configuration file. + * + *

## Submit Create Request + * + *

To create your styleset you will make a `POST` request with a styleSet configuration file. + * + *

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

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
dataFormatStringNoDefines the type of input file for a style set to be created from.
aliasStringNoThe alias of the style set.
descriptionStringNoUser provided description of the styleSet.
+ * + *

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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @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 styleSets 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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet 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 styleSet. + * + *

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
+     * {
+     *     id: String
+     *     defaultStyle: String
+     *     version: Float
+     *     description: String
+     *     created: String
+     *     styles: [
+     *         {
+     *             name: String
+     *             displayName: String
+     *             theme: String
+     *             thumbnail: Object
+     *             url: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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 styleSetId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(styleSetId, 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 styleSet.<br> You can use this API if a style is no + * longer needed. + * + *

### Submit Delete Request + * + *

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

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

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

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

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

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - StyleSet 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 styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponse(String styleSetId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(styleSetId, 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 export a composed style defined in the styleSet. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
styleFormatStringNo Defines the type of JSON object that is exported.
+ * + *

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
+     * {
+     *     name: String
+     *     version: Float
+     *     sources: Object
+     *     sprite: String
+     *     glyphs: String
+     *     layers: [
+     *         {
+     *             id: String
+     *             type: String
+     *             sourceLayer: String
+     *             source: String
+     *             layout: Object
+     *             paint: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet Id. + * @param styleName The StyleSet style name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a style configuration in a styleSet along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStyleWithResponse( + String styleSetId, String styleName, RequestOptions requestOptions) { + return this.serviceClient.getStyleWithResponseAsync(styleSetId, styleName, requestOptions); + } + + /** + * This path will be obtained from a call to create a styleSet. 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 styleSet create 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceClient.java b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceClient.java new file mode 100644 index 000000000000..ea7094e481c9 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceClient.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset; + +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.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +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; + +/** Initializes a new instance of the synchronous AzureMapsStyleSetServiceClient type. */ +@ServiceClient(builder = AzureMapsStyleSetServiceClientBuilder.class) +public final class AzureMapsStyleSetServiceClient { + @Generated private final AzureMapsStyleSetServiceAsyncClient asyncClient; + + /** + * Initializes an instance of AzureMapsStyleSetServiceClient class. + * + * @param asyncClient the async client. + */ + @Generated + AzureMapsStyleSetServiceClient(AzureMapsStyleSetServiceAsyncClient asyncClient) { + this.asyncClient = asyncClient; + } + + /** + * **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. + * + *

The StyleSet Create API allows the caller to create a styleSet from their styleSet configuration file. + * + *

## Submit Create Request + * + *

To create your styleset you will make a `POST` request with a styleSet configuration file. + * + *

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

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
dataFormatStringNoDefines the type of input file for a style set to be created from.
aliasStringNoThe alias of the style set.
descriptionStringNoUser provided description of the styleSet.
+ * + *

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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(RequestOptions requestOptions) { + return this.asyncClient.beginCreate(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 styleSets 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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet List API as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(RequestOptions requestOptions) { + return new PagedIterable<>(this.asyncClient.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 styleSet. + * + *

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
+     * {
+     *     id: String
+     *     defaultStyle: String
+     *     version: Float
+     *     description: String
+     *     created: String
+     *     styles: [
+     *         {
+     *             name: String
+     *             displayName: String
+     *             theme: String
+     *             thumbnail: Object
+     *             url: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detail information for the data along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String styleSetId, RequestOptions requestOptions) { + return this.asyncClient.getWithResponse(styleSetId, 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 styleSet.<br> You can use this API if a style is no + * longer needed. + * + *

### Submit Delete Request + * + *

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

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

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

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

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

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - StyleSet 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 styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String styleSetId, RequestOptions requestOptions) { + return this.asyncClient.deleteWithResponse(styleSetId, 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 export a composed style defined in the styleSet. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
styleFormatStringNo Defines the type of JSON object that is exported.
+ * + *

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
+     * {
+     *     name: String
+     *     version: Float
+     *     sources: Object
+     *     sprite: String
+     *     glyphs: String
+     *     layers: [
+     *         {
+     *             id: String
+     *             type: String
+     *             sourceLayer: String
+     *             source: String
+     *             layout: Object
+     *             paint: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet Id. + * @param styleName The StyleSet style name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a style configuration in a styleSet along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStyleWithResponse( + String styleSetId, String styleName, RequestOptions requestOptions) { + return this.asyncClient.getStyleWithResponse(styleSetId, styleName, requestOptions).block(); + } + + /** + * This path will be obtained from a call to create a styleSet. 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 styleSet create 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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.asyncClient.getOperationWithResponse(operationId, requestOptions).block(); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceClientBuilder.java b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceClientBuilder.java new file mode 100644 index 000000000000..360acc5ce053 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceClientBuilder.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.maps.styleset.implementation.AzureMapsStyleSetServiceClientImpl; +import com.azure.maps.styleset.implementation.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 AzureMapsStyleSetServiceClient type. */ +@ServiceClientBuilder( + serviceClients = {AzureMapsStyleSetServiceClient.class, AzureMapsStyleSetServiceAsyncClient.class}) +public final class AzureMapsStyleSetServiceClientBuilder { + @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-styleset.properties"); + + /** Create an instance of the AzureMapsStyleSetServiceClientBuilder. */ + @Generated + public AzureMapsStyleSetServiceClientBuilder() { + 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder geography(Geography geography) { + this.geography = geography; + return this; + } + + /* + * Service version + */ + @Generated private AzureMapsStyleSetServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder serviceVersion(AzureMapsStyleSetServiceVersion 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** + * Sets The TokenCredential used for authentication. + * + * @param tokenCredential the tokenCredential value. + * @return the AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder 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 AzureMapsStyleSetServiceClientBuilder. + */ + @Generated + public AzureMapsStyleSetServiceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AzureMapsStyleSetServiceClientImpl with the provided parameters. + * + * @return an instance of AzureMapsStyleSetServiceClientImpl. + */ + @Generated + private AzureMapsStyleSetServiceClientImpl buildInnerClient() { + if (geography == null) { + this.geography = Geography.US; + } + if (serviceVersion == null) { + this.serviceVersion = AzureMapsStyleSetServiceVersion.getLatest(); + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AzureMapsStyleSetServiceClientImpl client = + new AzureMapsStyleSetServiceClientImpl( + pipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of AzureMapsStyleSetServiceAsyncClient class. + * + * @return an instance of AzureMapsStyleSetServiceAsyncClient. + */ + @Generated + public AzureMapsStyleSetServiceAsyncClient buildAsyncClient() { + return new AzureMapsStyleSetServiceAsyncClient(buildInnerClient().getStyleSets()); + } + + /** + * Builds an instance of AzureMapsStyleSetServiceClient class. + * + * @return an instance of AzureMapsStyleSetServiceClient. + */ + @Generated + public AzureMapsStyleSetServiceClient buildClient() { + return new AzureMapsStyleSetServiceClient( + new AzureMapsStyleSetServiceAsyncClient(buildInnerClient().getStyleSets())); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceVersion.java b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceVersion.java new file mode 100644 index 000000000000..92d1c07aac2b --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/AzureMapsStyleSetServiceVersion.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.styleset; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AzureMapsStyleSetServiceClient. */ +public enum AzureMapsStyleSetServiceVersion implements ServiceVersion { + /** Enum value 2022-01-01-preview. */ + V2022_01_01_PREVIEW("2022-01-01-preview"); + + private final String version; + + AzureMapsStyleSetServiceVersion(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 AzureMapsStyleSetServiceVersion}. + */ + public static AzureMapsStyleSetServiceVersion getLatest() { + return V2022_01_01_PREVIEW; + } +} diff --git a/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/implementation/AzureMapsStyleSetServiceClientImpl.java b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/implementation/AzureMapsStyleSetServiceClientImpl.java new file mode 100644 index 000000000000..159e21b303b1 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/implementation/AzureMapsStyleSetServiceClientImpl.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.styleset.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.styleset.AzureMapsStyleSetServiceVersion; +import com.azure.maps.styleset.implementation.models.Geography; + +/** Initializes a new instance of the AzureMapsStyleSetServiceClient type. */ +public final class AzureMapsStyleSetServiceClientImpl { + /** + * 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 AzureMapsStyleSetServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AzureMapsStyleSetServiceVersion 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 StyleSetsImpl object to access its operations. */ + private final StyleSetsImpl styleSets; + + /** + * Gets the StyleSetsImpl object to access its operations. + * + * @return the StyleSetsImpl object. + */ + public StyleSetsImpl getStyleSets() { + return this.styleSets; + } + + /** + * Initializes an instance of AzureMapsStyleSetServiceClient 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 AzureMapsStyleSetServiceClientImpl( + String clientId, Geography geography, AzureMapsStyleSetServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + clientId, + geography, + serviceVersion); + } + + /** + * Initializes an instance of AzureMapsStyleSetServiceClient 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 AzureMapsStyleSetServiceClientImpl( + HttpPipeline httpPipeline, + String clientId, + Geography geography, + AzureMapsStyleSetServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + } + + /** + * Initializes an instance of AzureMapsStyleSetServiceClient 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 AzureMapsStyleSetServiceClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String clientId, + Geography geography, + AzureMapsStyleSetServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.clientId = clientId; + this.geography = geography; + this.serviceVersion = serviceVersion; + this.styleSets = new StyleSetsImpl(this); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/implementation/StyleSetsImpl.java b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/implementation/StyleSetsImpl.java new file mode 100644 index 000000000000..058e011124e6 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/implementation/StyleSetsImpl.java @@ -0,0 +1,1703 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.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.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +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 StyleSets. */ +public final class StyleSetsImpl { + /** The proxy service used to perform REST calls. */ + private final StyleSetsService service; + + /** The service client containing this operation class. */ + private final AzureMapsStyleSetServiceClientImpl client; + + /** + * Initializes an instance of StyleSetsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StyleSetsImpl(AzureMapsStyleSetServiceClientImpl client) { + this.service = + RestProxy.create(StyleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMapsStyleSetServiceStyleSets to be used by the proxy service to + * perform REST calls. + */ + @Host("https://{geography}.atlas.microsoft.com") + @ServiceInterface(name = "AzureMapsStyleSetSer") + private interface StyleSetsService { + @Post("/styles/stylesets") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> create( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Get("/styles/stylesets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> list( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Get("/styles/stylesets/{styleSetId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("styleSetId") String styleSetId, + RequestOptions requestOptions, + Context context); + + @Delete("/styles/stylesets/{styleSetId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("styleSetId") String styleSetId, + RequestOptions requestOptions, + Context context); + + @Get("/styles/stylesets/{styleSetId}/{styleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getStyle( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("styleSetId") String styleSetId, + @PathParam("styleName") String styleName, + RequestOptions requestOptions, + Context context); + + @Get("/styles/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOperation( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + 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. + * + *

The StyleSet Create API allows the caller to create a styleSet from their styleSet configuration file. + * + *

## Submit Create Request + * + *

To create your styleset you will make a `POST` request with a styleSet configuration file. + * + *

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

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
dataFormatStringNoDefines the type of input file for a style set to be created from.
aliasStringNoThe alias of the style set.
descriptionStringNoUser provided description of the styleSet.
+ * + *

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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@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. + * + *

The StyleSet Create API allows the caller to create a styleSet from their styleSet configuration file. + * + *

## Submit Create Request + * + *

To create your styleset you will make a `POST` request with a styleSet configuration file. + * + *

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

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
dataFormatStringNoDefines the type of input file for a style set to be created from.
aliasStringNoThe alias of the style set.
descriptionStringNoUser provided description of the styleSet.
+ * + *

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 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@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. + * + *

The StyleSet Create API allows the caller to create a styleSet from their styleSet configuration file. + * + *

## Submit Create Request + * + *

To create your styleset you will make a `POST` request with a styleSet configuration file. + * + *

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

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
dataFormatStringNoDefines the type of input file for a style set to be created from.
aliasStringNoThe alias of the style set.
descriptionStringNoUser provided description of the styleSet.
+ * + *

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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @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. + * + *

The StyleSet Create API allows the caller to create a styleSet from their styleSet configuration file. + * + *

## Submit Create Request + * + *

To create your styleset you will make a `POST` request with a styleSet configuration file. + * + *

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

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
dataFormatStringNoDefines the type of input file for a style set to be created from.
aliasStringNoThe alias of the style set.
descriptionStringNoUser provided description of the styleSet.
+ * + *

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 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @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. + * + *

The StyleSet Create API allows the caller to create a styleSet from their styleSet configuration file. + * + *

## Submit Create Request + * + *

To create your styleset you will make a `POST` request with a styleSet configuration file. + * + *

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

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
dataFormatStringNoDefines the type of input file for a style set to be created from.
aliasStringNoThe alias of the style set.
descriptionStringNoUser provided description of the styleSet.
+ * + *

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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @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 styleSets 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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet 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(), "styleSets"), + 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 styleSets 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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet 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(), "styleSets"), + 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 styleSets 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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet 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 styleSets 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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet 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 styleSets 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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet 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 styleSet. + * + *

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
+     * {
+     *     id: String
+     *     defaultStyle: String
+     *     version: Float
+     *     description: String
+     *     created: String
+     *     styles: [
+     *         {
+     *             name: String
+     *             displayName: String
+     *             theme: String
+     *             thumbnail: Object
+     *             url: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detail information for the data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String styleSetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.get( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + styleSetId, + 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 styleSet. + * + *

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
+     * {
+     *     id: String
+     *     defaultStyle: String
+     *     version: Float
+     *     description: String
+     *     created: String
+     *     styles: [
+     *         {
+     *             name: String
+     *             displayName: String
+     *             theme: String
+     *             thumbnail: Object
+     *             url: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detail information for the data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String styleSetId, RequestOptions requestOptions, Context context) { + return service.get( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + styleSetId, + 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 styleSet. + * + *

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
+     * {
+     *     id: String
+     *     defaultStyle: String
+     *     version: Float
+     *     description: String
+     *     created: String
+     *     styles: [
+     *         {
+     *             name: String
+     *             displayName: String
+     *             theme: String
+     *             thumbnail: Object
+     *             url: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return detail information for the data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String styleSetId, RequestOptions requestOptions) { + return getWithResponseAsync(styleSetId, 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 styleSet.<br> You can use this API if a style is no + * longer needed. + * + *

### Submit Delete Request + * + *

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

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

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

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

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

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - StyleSet 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 styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String styleSetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.delete( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + styleSetId, + 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 styleSet.<br> You can use this API if a style is no + * longer needed. + * + *

### Submit Delete Request + * + *

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

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

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

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

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

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - StyleSet 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 styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String styleSetId, RequestOptions requestOptions, Context context) { + return service.delete( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + styleSetId, + 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 styleSet.<br> You can use this API if a style is no + * longer needed. + * + *

### Submit Delete Request + * + *

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

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

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

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

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

Here is a sample error response: + * + *

<br> + * + *

```json { "error": { "code": "400 BadRequest", "message": "Bad request - StyleSet 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 styleSetId The StyleSet 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String styleSetId, RequestOptions requestOptions) { + return deleteWithResponseAsync(styleSetId, 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 export a composed style defined in the styleSet. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
styleFormatStringNo Defines the type of JSON object that is exported.
+ * + *

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
+     * {
+     *     name: String
+     *     version: Float
+     *     sources: Object
+     *     sprite: String
+     *     glyphs: String
+     *     layers: [
+     *         {
+     *             id: String
+     *             type: String
+     *             sourceLayer: String
+     *             source: String
+     *             layout: Object
+     *             paint: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet Id. + * @param styleName The StyleSet style name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a style configuration in a styleSet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStyleWithResponseAsync( + String styleSetId, String styleName, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getStyle( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + styleSetId, + styleName, + 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 export a composed style defined in the styleSet. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
styleFormatStringNo Defines the type of JSON object that is exported.
+ * + *

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
+     * {
+     *     name: String
+     *     version: Float
+     *     sources: Object
+     *     sprite: String
+     *     glyphs: String
+     *     layers: [
+     *         {
+     *             id: String
+     *             type: String
+     *             sourceLayer: String
+     *             source: String
+     *             layout: Object
+     *             paint: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet Id. + * @param styleName The StyleSet style name. + * @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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a style configuration in a styleSet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStyleWithResponseAsync( + String styleSetId, String styleName, RequestOptions requestOptions, Context context) { + return service.getStyle( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + styleSetId, + styleName, + 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 export a composed style defined in the styleSet. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
styleFormatStringNo Defines the type of JSON object that is exported.
+ * + *

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
+     * {
+     *     name: String
+     *     version: Float
+     *     sources: Object
+     *     sprite: String
+     *     glyphs: String
+     *     layers: [
+     *         {
+     *             id: String
+     *             type: String
+     *             sourceLayer: String
+     *             source: String
+     *             layout: Object
+     *             paint: Object
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param styleSetId The StyleSet Id. + * @param styleName The StyleSet style name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a style configuration in a styleSet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStyleWithResponse( + String styleSetId, String styleName, RequestOptions requestOptions) { + return getStyleWithResponseAsync(styleSetId, styleName, requestOptions).block(); + } + + /** + * This path will be obtained from a call to create a styleSet. 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 styleSet create 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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 create a styleSet. 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 styleSet create 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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 create a styleSet. 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 styleSet create 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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet 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(), "styleSets"), + 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
+     * {
+     *     styleSets: [
+     *         {
+     *             id: String
+     *             defaultStyle: String
+     *             version: Float
+     *             description: String
+     *             created: String
+     *             styles: [
+     *                 {
+     *                     name: String
+     *                     displayName: String
+     *                     theme: String
+     *                     thumbnail: Object
+     *                     url: Object
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response model for the StyleSet 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(), "styleSets"), + 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-styleset/src/main/java/com/azure/maps/styleset/implementation/package-info.java b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/implementation/package-info.java new file mode 100644 index 000000000000..1934f7fb67f2 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/implementation/package-info.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 containing the implementations for AzureMapsStyleSetService. This is an extension of the Azure Maps Tileset + * API to serve custom styles. It will allow a client to create a list of map styling information which can be combined + * with tilesetIds to compose a Mapbox style that can be consumed directly by front-end services (map control web & + * mobile SDKs, styling tools like [Maputnik](https://maputnik.github.io/editor/)). StyleSet can be viewed as the + * backend representation for a style picker at frontend. + */ +package com.azure.maps.styleset.implementation; diff --git a/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/package-info.java b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/package-info.java new file mode 100644 index 000000000000..38436ef54f8e --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/java/com/azure/maps/styleset/package-info.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 containing the classes for AzureMapsStyleSetService. This is an extension of the Azure Maps Tileset API to + * serve custom styles. It will allow a client to create a list of map styling information which can be combined with + * tilesetIds to compose a Mapbox style that can be consumed directly by front-end services (map control web & + * mobile SDKs, styling tools like [Maputnik](https://maputnik.github.io/editor/)). StyleSet can be viewed as the + * backend representation for a style picker at frontend. + */ +package com.azure.maps.styleset; diff --git a/sdk/maps/azure-maps-styleset/src/main/java/module-info.java b/sdk/maps/azure-maps-styleset/src/main/java/module-info.java new file mode 100644 index 000000000000..2603089420e8 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/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.styleset { + requires transitive com.azure.core; + + exports com.azure.maps.styleset; +} diff --git a/sdk/maps/azure-maps-styleset/src/main/resources/azure-maps-styleset.properties b/sdk/maps/azure-maps-styleset/src/main/resources/azure-maps-styleset.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/main/resources/azure-maps-styleset.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/ReadmeSamples.java b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/ReadmeSamples.java new file mode 100644 index 000000000000..23c2f2083dc1 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/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.styleset; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.maps.styleset.readme + // END: com.azure.maps.styleset.readme + } +} diff --git a/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/DeleteAImportedStyle.java b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/DeleteAImportedStyle.java new file mode 100644 index 000000000000..ba630cbbf9b6 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/DeleteAImportedStyle.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClient; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClientBuilder; + +public class DeleteAImportedStyle { + public static void main(String[] args) { + // BEGIN: com.azure.maps.styleset.generated.stylesetdelete.deleteaimportedstyle + AzureMapsStyleSetServiceClient azureMapsStyleSetServiceClient = + new AzureMapsStyleSetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = + azureMapsStyleSetServiceClient.deleteWithResponse( + "25084fb7-307a-4720-8f91-7952a0b91012", requestOptions); + // END: com.azure.maps.styleset.generated.stylesetdelete.deleteaimportedstyle + } +} diff --git a/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetAListOfAllStyleSets.java b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetAListOfAllStyleSets.java new file mode 100644 index 000000000000..c0a2fcc814fb --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetAListOfAllStyleSets.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.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.styleset.AzureMapsStyleSetServiceClient; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClientBuilder; + +public class GetAListOfAllStyleSets { + public static void main(String[] args) { + // BEGIN: com.azure.maps.styleset.generated.stylesetlist.getalistofallstylesets + AzureMapsStyleSetServiceClient azureMapsStyleSetServiceClient = + new AzureMapsStyleSetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = azureMapsStyleSetServiceClient.list(requestOptions); + // END: com.azure.maps.styleset.generated.stylesetlist.getalistofallstylesets + } +} diff --git a/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.java b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.java new file mode 100644 index 000000000000..8d1aa8eb253e --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfully.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.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.styleset.AzureMapsStyleSetServiceClient; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClientBuilder; + +public class GetTheStatusOfAnOperationWhichHasFinishedSuccessfully { + public static void main(String[] args) { + // BEGIN: + // com.azure.maps.styleset.generated.stylesetgetoperation.getthestatusofanoperationwhichhasfinishedsuccessfully + AzureMapsStyleSetServiceClient azureMapsStyleSetServiceClient = + new AzureMapsStyleSetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = + azureMapsStyleSetServiceClient.getOperationWithResponse( + "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", requestOptions); + // END: + // com.azure.maps.styleset.generated.stylesetgetoperation.getthestatusofanoperationwhichhasfinishedsuccessfully + } +} diff --git a/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichIsStillRunning.java b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichIsStillRunning.java new file mode 100644 index 000000000000..bffa92fd549b --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichIsStillRunning.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.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.styleset.AzureMapsStyleSetServiceClient; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClientBuilder; + +public class GetTheStatusOfAnOperationWhichIsStillRunning { + public static void main(String[] args) { + // BEGIN: com.azure.maps.styleset.generated.stylesetgetoperation.getthestatusofanoperationwhichisstillrunning + AzureMapsStyleSetServiceClient azureMapsStyleSetServiceClient = + new AzureMapsStyleSetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = + azureMapsStyleSetServiceClient.getOperationWithResponse( + "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", requestOptions); + // END: com.azure.maps.styleset.generated.stylesetgetoperation.getthestatusofanoperationwhichisstillrunning + } +} diff --git a/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleInAStyleSet.java b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleInAStyleSet.java new file mode 100644 index 000000000000..2f9a05e2a65c --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleInAStyleSet.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.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.styleset.AzureMapsStyleSetServiceClient; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClientBuilder; + +public class GetsTheDetailsForASingleStyleInAStyleSet { + public static void main(String[] args) { + // BEGIN: com.azure.maps.styleset.generated.stylesetgetstyle.getsthedetailsforasinglestyleinastyleset + AzureMapsStyleSetServiceClient azureMapsStyleSetServiceClient = + new AzureMapsStyleSetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("styleFormat", "azureMapsStyleRecipe"); + Response response = + azureMapsStyleSetServiceClient.getStyleWithResponse("[styleSetId]", "composedStyle", requestOptions); + // END: com.azure.maps.styleset.generated.stylesetgetstyle.getsthedetailsforasinglestyleinastyleset + } +} diff --git a/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleSet.java b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleSet.java new file mode 100644 index 000000000000..5c556cabb673 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleSet.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.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.styleset.AzureMapsStyleSetServiceClient; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClientBuilder; + +public class GetsTheDetailsForASingleStyleSet { + public static void main(String[] args) { + // BEGIN: com.azure.maps.styleset.generated.stylesetget.getsthedetailsforasinglestyleset + AzureMapsStyleSetServiceClient azureMapsStyleSetServiceClient = + new AzureMapsStyleSetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = azureMapsStyleSetServiceClient.getWithResponse("[styleSetId]", requestOptions); + // END: com.azure.maps.styleset.generated.stylesetget.getsthedetailsforasinglestyleset + } +} diff --git a/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/ImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFile.java b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/ImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFile.java new file mode 100644 index 000000000000..776b979769b9 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/samples/java/com/azure/maps/styleset/generated/ImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFile.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.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.styleset.AzureMapsStyleSetServiceClient; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClientBuilder; + +public class ImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFile { + public static void main(String[] args) { + // BEGIN: com.azure.maps.styleset.generated.stylesetcreate.importstylebyprovidingaazuremapsormapboxstylejsonfile + AzureMapsStyleSetServiceClient azureMapsStyleSetServiceClient = + new AzureMapsStyleSetServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("description", "This is my first styleset."); + requestOptions.addQueryParam("alias", "styleset-alias"); + requestOptions.addQueryParam("dataFormat", "ZIP"); + SyncPoller response = azureMapsStyleSetServiceClient.beginCreate(requestOptions); + // END: com.azure.maps.styleset.generated.stylesetcreate.importstylebyprovidingaazuremapsormapboxstylejsonfile + } +} diff --git a/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/AzureMapsStyleSetServiceClientTestBase.java b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/AzureMapsStyleSetServiceClientTestBase.java new file mode 100644 index 000000000000..c40fda2b7832 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/AzureMapsStyleSetServiceClientTestBase.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.generated; + +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.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClient; +import com.azure.maps.styleset.AzureMapsStyleSetServiceClientBuilder; +import com.azure.maps.styleset.implementation.models.Geography; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +class AzureMapsStyleSetServiceClientTestBase extends TestBase { + protected AzureMapsStyleSetServiceClient azureMapsStyleSetServiceClient; + + @Override + protected void beforeTest() { + AzureMapsStyleSetServiceClientBuilder azureMapsStyleSetServiceClientbuilder = + new AzureMapsStyleSetServiceClientBuilder() + .geography(Configuration.getGlobalConfiguration().get("GEOGRAPHY", Geography.US)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + azureMapsStyleSetServiceClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + azureMapsStyleSetServiceClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + azureMapsStyleSetServiceClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + azureMapsStyleSetServiceClient = azureMapsStyleSetServiceClientbuilder.buildClient(); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/DeleteAImportedStyleTests.java b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/DeleteAImportedStyleTests.java new file mode 100644 index 000000000000..eb028e64fdaa --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/DeleteAImportedStyleTests.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.styleset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteAImportedStyleTests extends AzureMapsStyleSetServiceClientTestBase { + @Test + @Disabled + public void testDeleteAImportedStyleTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + azureMapsStyleSetServiceClient.deleteWithResponse( + "25084fb7-307a-4720-8f91-7952a0b91012", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetAListOfAllStyleSetsTests.java b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetAListOfAllStyleSetsTests.java new file mode 100644 index 000000000000..b6b441ddc660 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetAListOfAllStyleSetsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetAListOfAllStyleSetsTests extends AzureMapsStyleSetServiceClientTestBase { + @Test + @Disabled + public void testGetAListOfAllStyleSetsTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = azureMapsStyleSetServiceClient.list(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"My greatest style set\",\"created\":\"2021-05-21T03:04:05.678Z\",\"defaultStyle\":\"indoor-light\",\"id\":\"9c451b0a-6527-49a7-9154-1b3d9486487f\",\"styles\":[{\"name\":\"indoor-light\",\"displayName\":\"My cool map styling\",\"theme\":\"light\",\"thumbnail\":\"https://us.atlas.microsoft.com/styles/thumbnail/019db5fd-1792-4a84-9e39-7a82ceaea311/indoor-light.png\",\"url\":\"https://us.atlas.microsoft.com/styles/styleSet/9c451b0a-6527-49a7-9154-1b3d9486487f/indoor-light\"},{\"name\":\"indoor-dark\",\"displayName\":\"Awesome map styling\",\"theme\":\"dark\",\"thumbnail\":\"https://us.atlas.microsoft.com/styles/thumbnail/019db5fd-1792-4a84-9e39-7a82ceaea311/indoor-dark.png\",\"url\":\"https://us.atlas.microsoft.com/styles/styleSet/9c451b0a-6527-49a7-9154-1b3d9486487f/indoor-dark\"}],\"version\":1}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfullyTests.java b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfullyTests.java new file mode 100644 index 000000000000..543b2fda71c4 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichHasFinishedSuccessfullyTests.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.styleset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetTheStatusOfAnOperationWhichHasFinishedSuccessfullyTests + extends AzureMapsStyleSetServiceClientTestBase { + @Test + @Disabled + public void testGetTheStatusOfAnOperationWhichHasFinishedSuccessfullyTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + azureMapsStyleSetServiceClient.getOperationWithResponse( + "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + "https://us.atlas.microsoft.com/styles/styleSets/3e36b996-f6d1-b068-0fcb-dd6b014c3447?api-version=2022-01-01-preview", + response.getHeaders().get("Resource-Location").getValue()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"8b1288fa-1958-4a2b-b68e-13a7i5af7d7c\",\"created\":\"2021-04-20T22:43:14.9401559+00:00\",\"status\":\"Succeeded\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichIsStillRunningTests.java b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichIsStillRunningTests.java new file mode 100644 index 000000000000..53cdc600b16d --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetTheStatusOfAnOperationWhichIsStillRunningTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetTheStatusOfAnOperationWhichIsStillRunningTests extends AzureMapsStyleSetServiceClientTestBase { + @Test + @Disabled + public void testGetTheStatusOfAnOperationWhichIsStillRunningTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + azureMapsStyleSetServiceClient.getOperationWithResponse( + "8b1288fa-1958-4a2b-b68e-13a7i5af7d7c", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"8b1288fa-1958-4a2b-b68e-13a7i5af7d7c\",\"created\":\"2021-04-23T19:14:03.2452596+00:00\",\"status\":\"Running\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleInAStyleSetTests.java b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleInAStyleSetTests.java new file mode 100644 index 000000000000..4f341c4d66a1 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleInAStyleSetTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetsTheDetailsForASingleStyleInAStyleSetTests extends AzureMapsStyleSetServiceClientTestBase { + @Test + @Disabled + public void testGetsTheDetailsForASingleStyleInAStyleSetTests() { + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("styleFormat", "azureMapsStyleRecipe"); + Response response = + azureMapsStyleSetServiceClient.getStyleWithResponse("[styleSetId]", "composedStyle", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"My cool map styling\",\"glyphs\":\"https://us.atlas.microsoft.com/styles/glyphs/{fontstack}/{range}.pbf\",\"layers\":[{\"type\":\"background\",\"id\":\"microsoft.maps.base.base.background:grayscale_light:microsoft.base\",\"layout\":{},\"paint\":{\"background-color\":\"hsl(55, 11%, 96%)\"},\"source\":\"microsoft.base\"},{\"type\":\"background\",\"id\":\"indoorLayer:9c451b0a-6527-49a7-9154-1b3d9486487f:64d79640-1db8-42e9-8e4a-714be32543c6\",\"layout\":{},\"paint\":{\"background-color\":\"hsl(55, 11%, 96%)\"},\"source\":\"microsoft.base\"}],\"sources\":{\"64d79640-1db8-42e9-8e4a-714be32543c6\":{\"type\":\"vector\",\"url\":\"https://us.atlas.microsoft.com/tileset/64d79640-1db8-42e9-8e4a-714be32543c6\"},\"microsoft.base\":{\"type\":\"vector\",\"url\":\"https://us.atlas.microsoft.com/map/tileset?api-version=2.1&tilesetId=microsoft.base\"}},\"sprite\":\"https://us.atlas.microsoft.com/styles/sprites/019db5fd-1792-4a84-9e39-7a82ceaea311\",\"version\":8}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleSetTests.java b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleSetTests.java new file mode 100644 index 000000000000..48a5f5310f66 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/GetsTheDetailsForASingleStyleSetTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetsTheDetailsForASingleStyleSetTests extends AzureMapsStyleSetServiceClientTestBase { + @Test + @Disabled + public void testGetsTheDetailsForASingleStyleSetTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = azureMapsStyleSetServiceClient.getWithResponse("[styleSetId]", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"My first style set\",\"created\":\"2021-05-21T03:04:05.678Z\",\"defaultStyle\":\"indoor-light\",\"id\":\"9c451b0a-6527-49a7-9154-1b3d9486487f\",\"styles\":[{\"name\":\"indoor-light\",\"displayName\":\"My cool map styling\",\"theme\":\"light\",\"thumbnail\":\"https://us.atlas.microsoft.com/styles/thumbnail/019db5fd-1792-4a84-9e39-7a82ceaea311/indoor-light.png\",\"url\":\"https://us.atlas.microsoft.com/styles/styleSet/9c451b0a-6527-49a7-9154-1b3d9486487f/indoor-light\"},{\"name\":\"indoor-dark\",\"displayName\":\"Awesome map styling\",\"theme\":\"dark\",\"thumbnail\":\"https://us.atlas.microsoft.com/styles/thumbnail/019db5fd-1792-4a84-9e39-7a82ceaea311/indoor-dark.png\",\"url\":\"https://us.atlas.microsoft.com/styles/styleSet/9c451b0a-6527-49a7-9154-1b3d9486487f/indoor-dark\"}],\"version\":1}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/ImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFileTests.java b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/ImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFileTests.java new file mode 100644 index 000000000000..9ed9a6c7ad27 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/src/test/java/com/azure/maps/styleset/generated/ImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFileTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.styleset.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class ImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFileTests + extends AzureMapsStyleSetServiceClientTestBase { + @Test + @Disabled + public void testImportStyleByProvidingAAzureMapsOrMapboxStyleJsonFileTests() { + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("description", "This is my first styleset."); + requestOptions.addQueryParam("alias", "styleset-alias"); + requestOptions.addQueryParam("dataFormat", "ZIP"); + SyncPoller response = azureMapsStyleSetServiceClient.beginCreate(requestOptions); + Assertions.assertEquals( + LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/maps/azure-maps-styleset/swagger/README_SPEC.md b/sdk/maps/azure-maps-styleset/swagger/README_SPEC.md new file mode 100644 index 000000000000..d05be1f297b6 --- /dev/null +++ b/sdk/maps/azure-maps-styleset/swagger/README_SPEC.md @@ -0,0 +1,30 @@ +## Generate autorest code + +```yaml +input-file: +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/maps/data-plane/Creator/preview/2022-01-01-preview/styleset.json +output-folder: ../ +java: true +regenerate-pom: false +partial-update: true +model-override-setter-from-superclass: true +use-default-http-status-code-to-exception-type-mapping: true +generate-sync-async-clients: true +generate-client-as-impl: true +models-subpackage: implementation.models +generate-client-interfaces: false +generate-builder-per-client: true +add-context-parameter: true +generate-tests: true +artifact-id: azure-maps-styleset +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +client-logger: true +namespace: com.azure.maps.styleset +context-client-method-parameter: true +azure-arm: false +service-versions: +- 2022-01-01-preview +``` diff --git a/sdk/maps/ci.yml b/sdk/maps/ci.yml index 874e551fbe28..8e74678bfb8f 100644 --- a/sdk/maps/ci.yml +++ b/sdk/maps/ci.yml @@ -35,3 +35,12 @@ extends: - name: azure-resourcemanager-maps groupId: com.azure.resourcemanager safeName: azureresourcemanagermaps + - name: azure-maps-stylerecipe + groupId: com.azure + safeName: azuremapsstylerecipe + - name: azure-maps-styleset + groupId: com.azure + safeName: azuremapsstyleset + - name: azure-maps-tileset + groupId: com.azure + safeName: azuremapstileset diff --git a/sdk/maps/pom.xml b/sdk/maps/pom.xml index d41c02faf8a0..2723b4590475 100644 --- a/sdk/maps/pom.xml +++ b/sdk/maps/pom.xml @@ -37,6 +37,9 @@ true + azure-maps-stylerecipe + azure-maps-styleset + azure-maps-tileset azure-resourcemanager-maps