From 47c3f51b51604563fe7745b97fe20f27fc840980 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 6 Jan 2022 06:30:19 +0000 Subject: [PATCH] CodeGen from PR 17217 in Azure/azure-rest-api-specs Merge 2a23a50036bf476b3c684fd58c8865ebb1eb7ba0 into 0ca8399b0e4fb4ae4608ffd0a6c056213664dacd --- sdk/maps/azure-maps-alias/CHANGELOG.md | 13 + sdk/maps/azure-maps-alias/README.md | 63 + sdk/maps/azure-maps-alias/pom.xml | 76 + .../AzureMapsAliasServiceAsyncClient.java | 340 +++++ .../alias/AzureMapsAliasServiceClient.java | 339 +++++ .../AzureMapsAliasServiceClientBuilder.java | 335 ++++ .../alias/AzureMapsAliasServiceVersion.java | 33 + .../implementation/AliasOperationsImpl.java | 1354 +++++++++++++++++ .../AzureMapsAliasServiceClientImpl.java | 166 ++ .../com/azure/maps/alias/package-info.java | 6 + .../src/main/java/module-info.java | 9 + .../resources/azure-maps-alias.properties | 2 + .../com/azure/maps/alias/ReadmeSamples.java | 12 + .../generated/AssignAnAliasToAResource.java | 25 + ...nAliasThatDoesNotReferenceAnyResource.java | 24 + .../DeletePreviouslyCreatedAlias.java | 23 + .../generated/GetAPreviouslyCreatedAlias.java | 24 + .../ListAllThePreviouslyCreatedAliases.java | 24 + .../com/azure/maps/alias/ClientTests.java | 47 + .../azure-maps-alias/swagger/README_SPEC.md | 26 + 20 files changed, 2941 insertions(+) create mode 100644 sdk/maps/azure-maps-alias/CHANGELOG.md create mode 100644 sdk/maps/azure-maps-alias/README.md create mode 100644 sdk/maps/azure-maps-alias/pom.xml create mode 100644 sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceAsyncClient.java create mode 100644 sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceClient.java create mode 100644 sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceClientBuilder.java create mode 100644 sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceVersion.java create mode 100644 sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/implementation/AliasOperationsImpl.java create mode 100644 sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/implementation/AzureMapsAliasServiceClientImpl.java create mode 100644 sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/package-info.java create mode 100644 sdk/maps/azure-maps-alias/src/main/java/module-info.java create mode 100644 sdk/maps/azure-maps-alias/src/main/resources/azure-maps-alias.properties create mode 100644 sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/ReadmeSamples.java create mode 100644 sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/AssignAnAliasToAResource.java create mode 100644 sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/CreateAnAliasThatDoesNotReferenceAnyResource.java create mode 100644 sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/DeletePreviouslyCreatedAlias.java create mode 100644 sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/GetAPreviouslyCreatedAlias.java create mode 100644 sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/ListAllThePreviouslyCreatedAliases.java create mode 100644 sdk/maps/azure-maps-alias/src/test/java/com/azure/maps/alias/ClientTests.java create mode 100644 sdk/maps/azure-maps-alias/swagger/README_SPEC.md diff --git a/sdk/maps/azure-maps-alias/CHANGELOG.md b/sdk/maps/azure-maps-alias/CHANGELOG.md new file mode 100644 index 000000000000..d9b86266931d --- /dev/null +++ b/sdk/maps/azure-maps-alias/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AzureMapsAliasService client library for Java. This package contains Microsoft Azure AzureMapsAliasService client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/maps/azure-maps-alias/README.md b/sdk/maps/azure-maps-alias/README.md new file mode 100644 index 000000000000..d967e24943a2 --- /dev/null +++ b/sdk/maps/azure-maps-alias/README.md @@ -0,0 +1,63 @@ +# Azure AzureMapsAliasService client library for Java + +Azure AzureMapsAliasService client library for Java. + +This package contains Microsoft Azure AzureMapsAliasService 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-alias;current}) +```xml + + com.azure + azure-maps-alias + 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.alias.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-alias/pom.xml b/sdk/maps/azure-maps-alias/pom.xml new file mode 100644 index 000000000000..080bcd7395c0 --- /dev/null +++ b/sdk/maps/azure-maps-alias/pom.xml @@ -0,0 +1,76 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-maps-alias + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureMapsAliasService Management + This package contains Microsoft Azure AzureMapsAliasService client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + false + + + + + + com.azure + azure-core + 1.23.1 + + + com.azure + azure-core-http-netty + 1.11.4 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.1 + test + + + com.azure + azure-core-test + 1.7.5 + test + + + com.azure + azure-identity + 1.4.2 + test + + + diff --git a/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceAsyncClient.java b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceAsyncClient.java new file mode 100644 index 000000000000..41a647db89ce --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceAsyncClient.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.maps.alias.implementation.AliasOperationsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AzureMapsAliasServiceClient type. */ +@ServiceClient(builder = AzureMapsAliasServiceClientBuilder.class, isAsync = true) +public final class AzureMapsAliasServiceAsyncClient { + @Generated private final AliasOperationsImpl serviceClient; + + /** + * Initializes an instance of AliasOperations client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsAliasServiceAsyncClient(AliasOperationsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to create an alias. You can also assign the alias during the create request. An + * alias can reference an ID generated by a creator service, but cannot reference another alias ID. + * + *

### Submit Create Request + * + *

To create your alias, you will use a `POST` request. If you would like to assign the alias during the + * creation, you will pass the `resourceId` query parameter. + * + *

### Create Alias Response + * + *

The Create API returns a HTTP `201 Created` response with the alias resource in the body. + * + *

A sample response from creating an alias: + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringNoThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponse(RequestOptions requestOptions) { + return this.serviceClient.createWithResponseAsync(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to fetch a list of all previously successfully created aliases. + * + *

### Submit List Request + * + *

To list all your aliases, you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The List API returns the complete list of all aliases in `json` format. The response contains the following + * details for each alias resource: > createdTimestamp - The timestamp that the alias was created. Format + * yyyy-MM-ddTHH:mm:ss.sssZ > aliasId - The id for the alias. > creatorDataItemId - The id for the creator + * data item that this alias references (could be null if the alias has not been assigned). > + * lastUpdatedTimestamp - The last time the alias was assigned to a resource. Format yyyy-MM-ddTHH:mm:ss.sssZ + * + *

A sample response returning 2 alias resources: + * + *

```json { "aliases": [ { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" }, { "createdTimestamp": "2020-02-18T19:53:33.123Z", + * "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6", "creatorDataItemId": null, "lastUpdatedTimestamp": + * "2020-02-18T19:53:33.123Z" } ] } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @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 assign an alias to reference a resource. + * + *

### Submit Assign Request + * + *

To assign your alias to a resource, you will use a `PUT` request with the `aliasId` in the path and the + * `creatorDataItemId` passed as a query parameter. + * + *

### Assign Alias Response + * + *

The Assign API returns a HTTP `200 OK` response with the updated alias resource in the body, if the alias was + * assigned successfully. A sample of the assign response is + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringYesThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> assignWithResponse(String aliasId, RequestOptions requestOptions) { + return this.serviceClient.assignWithResponseAsync(aliasId, 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 previously created alias. You can also use this API to delete + * old/unused aliases to create space for new content.This API does not delete the references resource, only the + * alias referencing the resource. + * + *

### Submit Delete Request + * + *

To delete your alias you will issue a `DELETE` request where the path will contain the `aliasId` of the alias + * to delete. + * + *

### Delete Alias Response + * + *

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

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponse(String aliasId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(aliasId, 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 the details of a previously created alias. + * + *

### Submit Get Details Request + * + *

To get the details of your alias, you will issue a `GET` request with the `aliasId` in the path. + * + *

### Get Details Response + * + *

The Get Details API returns the previously created alias in `json` format. The response contains the following + * details for the alias resource: > createdTimestamp - The timestamp that the alias was created. > aliasId - + * The id for the alias. > creatorDataItemId - The id for the creator data item that this alias references (could + * be null if the alias has not been assigned). > lastUpdatedTimestamp - The last time the alias was assigned to + * a resource. + * + *

Here's a sample response: ```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(String aliasId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(aliasId, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceClient.java b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceClient.java new file mode 100644 index 000000000000..90594006b7a1 --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceClient.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.maps.alias.implementation.AliasOperationsImpl; + +/** Initializes a new instance of the synchronous AzureMapsAliasServiceClient type. */ +@ServiceClient(builder = AzureMapsAliasServiceClientBuilder.class) +public final class AzureMapsAliasServiceClient { + @Generated private final AliasOperationsImpl serviceClient; + + /** + * Initializes an instance of AliasOperations client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsAliasServiceClient(AliasOperationsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to create an alias. You can also assign the alias during the create request. An + * alias can reference an ID generated by a creator service, but cannot reference another alias ID. + * + *

### Submit Create Request + * + *

To create your alias, you will use a `POST` request. If you would like to assign the alias during the + * creation, you will pass the `resourceId` query parameter. + * + *

### Create Alias Response + * + *

The Create API returns a HTTP `201 Created` response with the alias resource in the body. + * + *

A sample response from creating an alias: + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringNoThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(RequestOptions requestOptions) { + return this.serviceClient.createWithResponse(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 previously successfully created aliases. + * + *

### Submit List Request + * + *

To list all your aliases, you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The List API returns the complete list of all aliases in `json` format. The response contains the following + * details for each alias resource: > createdTimestamp - The timestamp that the alias was created. Format + * yyyy-MM-ddTHH:mm:ss.sssZ > aliasId - The id for the alias. > creatorDataItemId - The id for the creator + * data item that this alias references (could be null if the alias has not been assigned). > + * lastUpdatedTimestamp - The last time the alias was assigned to a resource. Format yyyy-MM-ddTHH:mm:ss.sssZ + * + *

A sample response returning 2 alias resources: + * + *

```json { "aliases": [ { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" }, { "createdTimestamp": "2020-02-18T19:53:33.123Z", + * "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6", "creatorDataItemId": null, "lastUpdatedTimestamp": + * "2020-02-18T19:53:33.123Z" } ] } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(RequestOptions requestOptions) { + return this.serviceClient.list(requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to assign an alias to reference a resource. + * + *

### Submit Assign Request + * + *

To assign your alias to a resource, you will use a `PUT` request with the `aliasId` in the path and the + * `creatorDataItemId` passed as a query parameter. + * + *

### Assign Alias Response + * + *

The Assign API returns a HTTP `200 OK` response with the updated alias resource in the body, if the alias was + * assigned successfully. A sample of the assign response is + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringYesThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response assignWithResponse(String aliasId, RequestOptions requestOptions) { + return this.serviceClient.assignWithResponse(aliasId, 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 previously created alias. You can also use this API to delete + * old/unused aliases to create space for new content.This API does not delete the references resource, only the + * alias referencing the resource. + * + *

### Submit Delete Request + * + *

To delete your alias you will issue a `DELETE` request where the path will contain the `aliasId` of the alias + * to delete. + * + *

### Delete Alias Response + * + *

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

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String aliasId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponse(aliasId, 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 the details of a previously created alias. + * + *

### Submit Get Details Request + * + *

To get the details of your alias, you will issue a `GET` request with the `aliasId` in the path. + * + *

### Get Details Response + * + *

The Get Details API returns the previously created alias in `json` format. The response contains the following + * details for the alias resource: > createdTimestamp - The timestamp that the alias was created. > aliasId - + * The id for the alias. > creatorDataItemId - The id for the creator data item that this alias references (could + * be null if the alias has not been assigned). > lastUpdatedTimestamp - The last time the alias was assigned to + * a resource. + * + *

Here's a sample response: ```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String aliasId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(aliasId, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceClientBuilder.java b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceClientBuilder.java new file mode 100644 index 000000000000..7e93b9df7b60 --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceClientBuilder.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias; + +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.alias.implementation.AzureMapsAliasServiceClientImpl; +import com.azure.maps.alias.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 AzureMapsAliasServiceClient type. */ +@ServiceClientBuilder(serviceClients = {AzureMapsAliasServiceClient.class, AzureMapsAliasServiceAsyncClient.class}) +public final class AzureMapsAliasServiceClientBuilder { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated static final String[] DEFAULT_SCOPES = new String[] {"https://maps.azure.com/.default"}; + + @Generated private final Map properties = CoreUtils.getProperties("azure-maps-alias.properties"); + + /** Create an instance of the AzureMapsAliasServiceClientBuilder. */ + @Generated + public AzureMapsAliasServiceClientBuilder() { + 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder geography(Geography geography) { + this.geography = geography; + return this; + } + + /* + * Service version + */ + @Generated private AzureMapsAliasServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder serviceVersion(AzureMapsAliasServiceVersion 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder 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 AzureMapsAliasServiceClientBuilder. + */ + @Generated + public AzureMapsAliasServiceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AzureMapsAliasServiceClientImpl with the provided parameters. + * + * @return an instance of AzureMapsAliasServiceClientImpl. + */ + @Generated + private AzureMapsAliasServiceClientImpl buildInnerClient() { + if (geography == null) { + this.geography = Geography.US; + } + if (serviceVersion == null) { + this.serviceVersion = AzureMapsAliasServiceVersion.getLatest(); + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AzureMapsAliasServiceClientImpl client = + new AzureMapsAliasServiceClientImpl( + 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 AzureMapsAliasServiceAsyncClient async client. + * + * @return an instance of AzureMapsAliasServiceAsyncClient. + */ + @Generated + public AzureMapsAliasServiceAsyncClient buildAsyncClient() { + return new AzureMapsAliasServiceAsyncClient(buildInnerClient().getAliasOperations()); + } + + /** + * Builds an instance of AzureMapsAliasServiceClient sync client. + * + * @return an instance of AzureMapsAliasServiceClient. + */ + @Generated + public AzureMapsAliasServiceClient buildClient() { + return new AzureMapsAliasServiceClient(buildInnerClient().getAliasOperations()); + } +} diff --git a/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceVersion.java b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceVersion.java new file mode 100644 index 000000000000..946e04ac0561 --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/AzureMapsAliasServiceVersion.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.alias; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AzureMapsAliasServiceClient. */ +public enum AzureMapsAliasServiceVersion implements ServiceVersion { + /** Enum value 2022-01-01-preview. */ + V2022_01_01_PREVIEW("2022-01-01-preview"); + + private final String version; + + AzureMapsAliasServiceVersion(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 AzureMapsAliasServiceVersion}. + */ + public static AzureMapsAliasServiceVersion getLatest() { + return V2022_01_01_PREVIEW; + } +} diff --git a/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/implementation/AliasOperationsImpl.java b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/implementation/AliasOperationsImpl.java new file mode 100644 index 000000000000..c49466ffafac --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/implementation/AliasOperationsImpl.java @@ -0,0 +1,1354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias.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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.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 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 AliasOperations. */ +public final class AliasOperationsImpl { + /** The proxy service used to perform REST calls. */ + private final AliasService service; + + /** The service client containing this operation class. */ + private final AzureMapsAliasServiceClientImpl client; + + /** + * Initializes an instance of AliasOperationsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AliasOperationsImpl(AzureMapsAliasServiceClientImpl client) { + this.service = RestProxy.create(AliasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMapsAliasServiceAliasOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("https://{geography}.atlas.microsoft.com") + @ServiceInterface(name = "AzureMapsAliasServic") + private interface AliasService { + @Post("/aliases") + @ExpectedResponses({201}) + Mono> create( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Get("/aliases") + @ExpectedResponses({200}) + Mono> list( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Put("/aliases/{aliasId}") + @ExpectedResponses({200}) + Mono> assign( + @HostParam("geography") String geography, + @PathParam("aliasId") String aliasId, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Delete("/aliases/{aliasId}") + @ExpectedResponses({204}) + Mono> delete( + @HostParam("geography") String geography, + @PathParam("aliasId") String aliasId, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Get("/aliases/{aliasId}") + @ExpectedResponses({200}) + Mono> get( + @HostParam("geography") String geography, + @PathParam("aliasId") String aliasId, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("geography") String geography, + RequestOptions requestOptions, + Context context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to create an alias. You can also assign the alias during the create request. An + * alias can reference an ID generated by a creator service, but cannot reference another alias ID. + * + *

### Submit Create Request + * + *

To create your alias, you will use a `POST` request. If you would like to assign the alias during the + * creation, you will pass the `resourceId` query parameter. + * + *

### Create Alias Response + * + *

The Create API returns a HTTP `201 Created` response with the alias resource in the body. + * + *

A sample response from creating an alias: + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringNoThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.create( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to create an alias. You can also assign the alias during the create request. An + * alias can reference an ID generated by a creator service, but cannot reference another alias ID. + * + *

### Submit Create Request + * + *

To create your alias, you will use a `POST` request. If you would like to assign the alias during the + * creation, you will pass the `resourceId` query parameter. + * + *

### Create Alias Response + * + *

The Create API returns a HTTP `201 Created` response with the alias resource in the body. + * + *

A sample response from creating an alias: + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringNoThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(RequestOptions requestOptions, Context context) { + return service.create( + this.client.getGeography(), this.client.getServiceVersion().getVersion(), requestOptions, context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to create an alias. You can also assign the alias during the create request. An + * alias can reference an ID generated by a creator service, but cannot reference another alias ID. + * + *

### Submit Create Request + * + *

To create your alias, you will use a `POST` request. If you would like to assign the alias during the + * creation, you will pass the `resourceId` query parameter. + * + *

### Create Alias Response + * + *

The Create API returns a HTTP `201 Created` response with the alias resource in the body. + * + *

A sample response from creating an alias: + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringNoThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(RequestOptions requestOptions) { + return createWithResponseAsync(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 fetch a list of all previously successfully created aliases. + * + *

### Submit List Request + * + *

To list all your aliases, you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The List API returns the complete list of all aliases in `json` format. The response contains the following + * details for each alias resource: > createdTimestamp - The timestamp that the alias was created. Format + * yyyy-MM-ddTHH:mm:ss.sssZ > aliasId - The id for the alias. > creatorDataItemId - The id for the creator + * data item that this alias references (could be null if the alias has not been assigned). > + * lastUpdatedTimestamp - The last time the alias was assigned to a resource. Format yyyy-MM-ddTHH:mm:ss.sssZ + * + *

A sample response returning 2 alias resources: + * + *

```json { "aliases": [ { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" }, { "createdTimestamp": "2020-02-18T19:53:33.123Z", + * "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6", "creatorDataItemId": null, "lastUpdatedTimestamp": + * "2020-02-18T19:53:33.123Z" } ] } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @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(), "aliases"), + 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 previously successfully created aliases. + * + *

### Submit List Request + * + *

To list all your aliases, you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The List API returns the complete list of all aliases in `json` format. The response contains the following + * details for each alias resource: > createdTimestamp - The timestamp that the alias was created. Format + * yyyy-MM-ddTHH:mm:ss.sssZ > aliasId - The id for the alias. > creatorDataItemId - The id for the creator + * data item that this alias references (could be null if the alias has not been assigned). > + * lastUpdatedTimestamp - The last time the alias was assigned to a resource. Format yyyy-MM-ddTHH:mm:ss.sssZ + * + *

A sample response returning 2 alias resources: + * + *

```json { "aliases": [ { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" }, { "createdTimestamp": "2020-02-18T19:53:33.123Z", + * "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6", "creatorDataItemId": null, "lastUpdatedTimestamp": + * "2020-02-18T19:53:33.123Z" } ] } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @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(), "aliases"), + 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 previously successfully created aliases. + * + *

### Submit List Request + * + *

To list all your aliases, you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The List API returns the complete list of all aliases in `json` format. The response contains the following + * details for each alias resource: > createdTimestamp - The timestamp that the alias was created. Format + * yyyy-MM-ddTHH:mm:ss.sssZ > aliasId - The id for the alias. > creatorDataItemId - The id for the creator + * data item that this alias references (could be null if the alias has not been assigned). > + * lastUpdatedTimestamp - The last time the alias was assigned to a resource. Format yyyy-MM-ddTHH:mm:ss.sssZ + * + *

A sample response returning 2 alias resources: + * + *

```json { "aliases": [ { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" }, { "createdTimestamp": "2020-02-18T19:53:33.123Z", + * "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6", "creatorDataItemId": null, "lastUpdatedTimestamp": + * "2020-02-18T19:53:33.123Z" } ] } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @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 previously successfully created aliases. + * + *

### Submit List Request + * + *

To list all your aliases, you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The List API returns the complete list of all aliases in `json` format. The response contains the following + * details for each alias resource: > createdTimestamp - The timestamp that the alias was created. Format + * yyyy-MM-ddTHH:mm:ss.sssZ > aliasId - The id for the alias. > creatorDataItemId - The id for the creator + * data item that this alias references (could be null if the alias has not been assigned). > + * lastUpdatedTimestamp - The last time the alias was assigned to a resource. Format yyyy-MM-ddTHH:mm:ss.sssZ + * + *

A sample response returning 2 alias resources: + * + *

```json { "aliases": [ { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" }, { "createdTimestamp": "2020-02-18T19:53:33.123Z", + * "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6", "creatorDataItemId": null, "lastUpdatedTimestamp": + * "2020-02-18T19:53:33.123Z" } ] } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @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 previously successfully created aliases. + * + *

### Submit List Request + * + *

To list all your aliases, you will issue a `GET` request with no additional parameters. + * + *

### List Data Response + * + *

The List API returns the complete list of all aliases in `json` format. The response contains the following + * details for each alias resource: > createdTimestamp - The timestamp that the alias was created. Format + * yyyy-MM-ddTHH:mm:ss.sssZ > aliasId - The id for the alias. > creatorDataItemId - The id for the creator + * data item that this alias references (could be null if the alias has not been assigned). > + * lastUpdatedTimestamp - The last time the alias was assigned to a resource. Format yyyy-MM-ddTHH:mm:ss.sssZ + * + *

A sample response returning 2 alias resources: + * + *

```json { "aliases": [ { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" }, { "createdTimestamp": "2020-02-18T19:53:33.123Z", + * "aliasId": "1856dbfc-7a66-ee5a-bf8d-51dbfe1906f6", "creatorDataItemId": null, "lastUpdatedTimestamp": + * "2020-02-18T19:53:33.123Z" } ] } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @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 assign an alias to reference a resource. + * + *

### Submit Assign Request + * + *

To assign your alias to a resource, you will use a `PUT` request with the `aliasId` in the path and the + * `creatorDataItemId` passed as a query parameter. + * + *

### Assign Alias Response + * + *

The Assign API returns a HTTP `200 OK` response with the updated alias resource in the body, if the alias was + * assigned successfully. A sample of the assign response is + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringYesThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> assignWithResponseAsync(String aliasId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.assign( + this.client.getGeography(), + aliasId, + this.client.getServiceVersion().getVersion(), + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to assign an alias to reference a resource. + * + *

### Submit Assign Request + * + *

To assign your alias to a resource, you will use a `PUT` request with the `aliasId` in the path and the + * `creatorDataItemId` passed as a query parameter. + * + *

### Assign Alias Response + * + *

The Assign API returns a HTTP `200 OK` response with the updated alias resource in the body, if the alias was + * assigned successfully. A sample of the assign response is + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringYesThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> assignWithResponseAsync( + String aliasId, RequestOptions requestOptions, Context context) { + return service.assign( + this.client.getGeography(), + aliasId, + this.client.getServiceVersion().getVersion(), + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to assign an alias to reference a resource. + * + *

### Submit Assign Request + * + *

To assign your alias to a resource, you will use a `PUT` request with the `aliasId` in the path and the + * `creatorDataItemId` passed as a query parameter. + * + *

### Assign Alias Response + * + *

The Assign API returns a HTTP `200 OK` response with the updated alias resource in the body, if the alias was + * assigned successfully. A sample of the assign response is + * + *

```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": "a8a4b8bb-ecf4-fb27-a618-f41721552766", + * "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } + * ```. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
apiVersionStringYesApi Version
creatorDataItemIdStringYesThe unique id that references a creator data item to be aliased.
+ * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response assignWithResponse(String aliasId, RequestOptions requestOptions) { + return assignWithResponseAsync(aliasId, 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 previously created alias. You can also use this API to delete + * old/unused aliases to create space for new content.This API does not delete the references resource, only the + * alias referencing the resource. + * + *

### Submit Delete Request + * + *

To delete your alias you will issue a `DELETE` request where the path will contain the `aliasId` of the alias + * to delete. + * + *

### Delete Alias Response + * + *

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

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String aliasId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.delete( + this.client.getGeography(), + aliasId, + this.client.getServiceVersion().getVersion(), + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to delete a previously created alias. You can also use this API to delete + * old/unused aliases to create space for new content.This API does not delete the references resource, only the + * alias referencing the resource. + * + *

### Submit Delete Request + * + *

To delete your alias you will issue a `DELETE` request where the path will contain the `aliasId` of the alias + * to delete. + * + *

### Delete Alias Response + * + *

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

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String aliasId, RequestOptions requestOptions, Context context) { + return service.delete( + this.client.getGeography(), + aliasId, + this.client.getServiceVersion().getVersion(), + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to delete a previously created alias. You can also use this API to delete + * old/unused aliases to create space for new content.This API does not delete the references resource, only the + * alias referencing the resource. + * + *

### Submit Delete Request + * + *

To delete your alias you will issue a `DELETE` request where the path will contain the `aliasId` of the alias + * to delete. + * + *

### Delete Alias Response + * + *

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

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
clientIdStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String aliasId, RequestOptions requestOptions) { + return deleteWithResponseAsync(aliasId, 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 fetch the details of a previously created alias. + * + *

### Submit Get Details Request + * + *

To get the details of your alias, you will issue a `GET` request with the `aliasId` in the path. + * + *

### Get Details Response + * + *

The Get Details API returns the previously created alias in `json` format. The response contains the following + * details for the alias resource: > createdTimestamp - The timestamp that the alias was created. > aliasId - + * The id for the alias. > creatorDataItemId - The id for the creator data item that this alias references (could + * be null if the alias has not been assigned). > lastUpdatedTimestamp - The last time the alias was assigned to + * a resource. + * + *

Here's a sample response: ```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String aliasId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.get( + this.client.getGeography(), + aliasId, + this.client.getServiceVersion().getVersion(), + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to fetch the details of a previously created alias. + * + *

### Submit Get Details Request + * + *

To get the details of your alias, you will issue a `GET` request with the `aliasId` in the path. + * + *

### Get Details Response + * + *

The Get Details API returns the previously created alias in `json` format. The response contains the following + * details for the alias resource: > createdTimestamp - The timestamp that the alias was created. > aliasId - + * The id for the alias. > creatorDataItemId - The id for the creator data item that this alias references (could + * be null if the alias has not been assigned). > lastUpdatedTimestamp - The last time the alias was assigned to + * a resource. + * + *

Here's a sample response: ```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String aliasId, RequestOptions requestOptions, Context context) { + return service.get( + this.client.getGeography(), + aliasId, + this.client.getServiceVersion().getVersion(), + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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

This API allows the caller to fetch the details of a previously created alias. + * + *

### Submit Get Details Request + * + *

To get the details of your alias, you will issue a `GET` request with the `aliasId` in the path. + * + *

### Get Details Response + * + *

The Get Details API returns the previously created alias in `json` format. The response contains the following + * details for the alias resource: > createdTimestamp - The timestamp that the alias was created. > aliasId - + * The id for the alias. > creatorDataItemId - The id for the creator data item that this alias references (could + * be null if the alias has not been assigned). > lastUpdatedTimestamp - The last time the alias was assigned to + * a resource. + * + *

Here's a sample response: ```json { "createdTimestamp": "2020-02-13T21:19:11.123Z", "aliasId": + * "a8a4b8bb-ecf4-fb27-a618-f41721552766", "creatorDataItemId": "e89aebb9-70a3-8fe1-32bb-1fbd0c725f14", + * "lastUpdatedTimestamp": "2020-02-13T21:19:22.123Z" } ```. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     createdTimestamp: String
+     *     aliasId: String
+     *     creatorDataItemId: String
+     *     lastUpdatedTimestamp: String
+     * }
+     * }
+ * + * @param aliasId The unique id that references an existing alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return detailed information for the alias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String aliasId, RequestOptions requestOptions) { + return getWithResponseAsync(aliasId, requestOptions).block(); + } + + /** + * Get the next page of items. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @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(), "aliases"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     aliases: [
+     *         {
+     *             createdTimestamp: String
+     *             aliasId: String
+     *             creatorDataItemId: String
+     *             lastUpdatedTimestamp: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the List API. + */ + @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(), "aliases"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + 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-alias/src/main/java/com/azure/maps/alias/implementation/AzureMapsAliasServiceClientImpl.java b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/implementation/AzureMapsAliasServiceClientImpl.java new file mode 100644 index 000000000000..34dede8eb10d --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/implementation/AzureMapsAliasServiceClientImpl.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.alias.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.alias.AzureMapsAliasServiceVersion; +import com.azure.maps.alias.models.Geography; + +/** Initializes a new instance of the AzureMapsAliasServiceClient type. */ +public final class AzureMapsAliasServiceClientImpl { + /** + * 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 AzureMapsAliasServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AzureMapsAliasServiceVersion 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 AliasOperationsImpl object to access its operations. */ + private final AliasOperationsImpl aliasOperations; + + /** + * Gets the AliasOperationsImpl object to access its operations. + * + * @return the AliasOperationsImpl object. + */ + public AliasOperationsImpl getAliasOperations() { + return this.aliasOperations; + } + + /** + * Initializes an instance of AzureMapsAliasServiceClient 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 AzureMapsAliasServiceClientImpl( + String clientId, Geography geography, AzureMapsAliasServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + clientId, + geography, + serviceVersion); + } + + /** + * Initializes an instance of AzureMapsAliasServiceClient 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 AzureMapsAliasServiceClientImpl( + HttpPipeline httpPipeline, + String clientId, + Geography geography, + AzureMapsAliasServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + } + + /** + * Initializes an instance of AzureMapsAliasServiceClient 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 AzureMapsAliasServiceClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String clientId, + Geography geography, + AzureMapsAliasServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.clientId = clientId; + this.geography = geography; + this.serviceVersion = serviceVersion; + this.aliasOperations = new AliasOperationsImpl(this); + } +} diff --git a/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/package-info.java b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/package-info.java new file mode 100644 index 000000000000..0397e06e8143 --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/main/java/com/azure/maps/alias/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for AzureMapsAliasService. APIs for managing aliases in Azure Maps. */ +package com.azure.maps.alias; diff --git a/sdk/maps/azure-maps-alias/src/main/java/module-info.java b/sdk/maps/azure-maps-alias/src/main/java/module-info.java new file mode 100644 index 000000000000..22abb7864aa6 --- /dev/null +++ b/sdk/maps/azure-maps-alias/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.alias { + requires transitive com.azure.core; + + exports com.azure.maps.alias; +} diff --git a/sdk/maps/azure-maps-alias/src/main/resources/azure-maps-alias.properties b/sdk/maps/azure-maps-alias/src/main/resources/azure-maps-alias.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/main/resources/azure-maps-alias.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/ReadmeSamples.java b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/ReadmeSamples.java new file mode 100644 index 000000000000..3dfeefb9b5af --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/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.alias; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.maps.alias.readme + // END: com.azure.maps.alias.readme + } +} diff --git a/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/AssignAnAliasToAResource.java b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/AssignAnAliasToAResource.java new file mode 100644 index 000000000000..fa9476e67b38 --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/AssignAnAliasToAResource.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias.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.alias.AzureMapsAliasServiceClient; +import com.azure.maps.alias.AzureMapsAliasServiceClientBuilder; + +public class AssignAnAliasToAResource { + public static void main(String[] args) { + AzureMapsAliasServiceClient client = + new AzureMapsAliasServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("creatorDataItemId", "[creatorDataItemId]"); + Response response = client.assignWithResponse("[aliasId]", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/CreateAnAliasThatDoesNotReferenceAnyResource.java b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/CreateAnAliasThatDoesNotReferenceAnyResource.java new file mode 100644 index 000000000000..e98e0f42e088 --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/CreateAnAliasThatDoesNotReferenceAnyResource.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias.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.alias.AzureMapsAliasServiceClient; +import com.azure.maps.alias.AzureMapsAliasServiceClientBuilder; + +public class CreateAnAliasThatDoesNotReferenceAnyResource { + public static void main(String[] args) { + AzureMapsAliasServiceClient client = + new AzureMapsAliasServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.createWithResponse(requestOptions); + } +} diff --git a/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/DeletePreviouslyCreatedAlias.java b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/DeletePreviouslyCreatedAlias.java new file mode 100644 index 000000000000..f0445d8e0ead --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/DeletePreviouslyCreatedAlias.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.alias.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.alias.AzureMapsAliasServiceClient; +import com.azure.maps.alias.AzureMapsAliasServiceClientBuilder; + +public class DeletePreviouslyCreatedAlias { + public static void main(String[] args) { + AzureMapsAliasServiceClient client = + new AzureMapsAliasServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.deleteWithResponse("[aliasId]", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/GetAPreviouslyCreatedAlias.java b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/GetAPreviouslyCreatedAlias.java new file mode 100644 index 000000000000..b586278bc79d --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/GetAPreviouslyCreatedAlias.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias.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.alias.AzureMapsAliasServiceClient; +import com.azure.maps.alias.AzureMapsAliasServiceClientBuilder; + +public class GetAPreviouslyCreatedAlias { + public static void main(String[] args) { + AzureMapsAliasServiceClient client = + new AzureMapsAliasServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.getWithResponse("[aliasId]", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/ListAllThePreviouslyCreatedAliases.java b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/ListAllThePreviouslyCreatedAliases.java new file mode 100644 index 000000000000..b711c4f38b59 --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/samples/java/com/azure/maps/alias/generated/ListAllThePreviouslyCreatedAliases.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias.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.alias.AzureMapsAliasServiceClient; +import com.azure.maps.alias.AzureMapsAliasServiceClientBuilder; + +public class ListAllThePreviouslyCreatedAliases { + public static void main(String[] args) { + AzureMapsAliasServiceClient client = + new AzureMapsAliasServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = client.list(requestOptions); + } +} diff --git a/sdk/maps/azure-maps-alias/src/test/java/com/azure/maps/alias/ClientTests.java b/sdk/maps/azure-maps-alias/src/test/java/com/azure/maps/alias/ClientTests.java new file mode 100644 index 000000000000..ddb061e5552b --- /dev/null +++ b/sdk/maps/azure-maps-alias/src/test/java/com/azure/maps/alias/ClientTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.alias; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClientTests extends TestBase { + private AzureMapsAliasServiceClientBuilder builder; + + @BeforeEach + public void setup() { + builder = + new AzureMapsAliasServiceClientBuilder() + .geography(Configuration.getGlobalConfiguration().get("GEOGRAPHY", Geography.US)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)); + if (getTestMode() == TestMode.PLAYBACK) { + builder.httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + builder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + builder.credential(new DefaultAzureCredentialBuilder().build()); + } + } + + @Test + @DoNotRecord(skipInPlayback = true) + public void testClient() { + // use the builder to create client + } +} diff --git a/sdk/maps/azure-maps-alias/swagger/README_SPEC.md b/sdk/maps/azure-maps-alias/swagger/README_SPEC.md new file mode 100644 index 000000000000..afdbcccb5a69 --- /dev/null +++ b/sdk/maps/azure-maps-alias/swagger/README_SPEC.md @@ -0,0 +1,26 @@ +## Generate autorest code + +```yaml +input-file: + - /home/vsts/work/1/s/azure-rest-api-specs/specification/maps/data-plane/Creator/preview/2022-01-01-preview/alias.json +java: true +output-folder: ../ +partial-update: true +regenerate-pom: false +generate-sync-async-clients: true +generate-client-as-impl: true +generate-client-interfaces: false +add-context-parameter: true +artifact-id: azure-maps-alias +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.maps.alias +context-client-method-parameter: true +azure-arm: false +credential-types: tokencredential +credential-scopes: https://maps.azure.com/.default +service-versions: + - '2022-01-01-preview' +```