diff --git a/sdk/maps/azure-maps-featurestate/CHANGELOG.md b/sdk/maps/azure-maps-featurestate/CHANGELOG.md new file mode 100644 index 000000000000..50160c022133 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AzureMapsFeatureStateService client library for Java. This package contains Microsoft Azure AzureMapsFeatureStateService client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/maps/azure-maps-featurestate/README.md b/sdk/maps/azure-maps-featurestate/README.md new file mode 100644 index 000000000000..041505afae3a --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/README.md @@ -0,0 +1,63 @@ +# Azure AzureMapsFeatureStateService client library for Java + +Azure AzureMapsFeatureStateService client library for Java. + +This package contains Microsoft Azure AzureMapsFeatureStateService 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-featurestate;current}) +```xml + + com.azure + azure-maps-featurestate + 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.featurestate.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-featurestate/pom.xml b/sdk/maps/azure-maps-featurestate/pom.xml new file mode 100644 index 000000000000..90dee6876c73 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-maps-featurestate + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureMapsFeatureStateService Management + This package contains Microsoft Azure AzureMapsFeatureStateService client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-http-netty + 1.11.7 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + com.azure + azure-core-test + 1.7.8 + test + + + com.azure + azure-identity + 1.4.4 + test + + + diff --git a/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceAsyncClient.java b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceAsyncClient.java new file mode 100644 index 000000000000..7332b1e5039d --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceAsyncClient.java @@ -0,0 +1,471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.featurestate; + +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.featurestate.implementation.FeatureStatesImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AzureMapsFeatureStateServiceClient type. */ +@ServiceClient(builder = AzureMapsFeatureStateServiceClientBuilder.class, isAsync = true) +public final class AzureMapsFeatureStateServiceAsyncClient { + @Generated private final FeatureStatesImpl serviceClient; + + /** + * Initializes an instance of FeatureStates client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsFeatureStateServiceAsyncClient(FeatureStatesImpl 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 POST API allows the user to create a new Stateset and define stateset style using request body. + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. The Feature State API is part of Creator. + * + *

The Feature State service allows the user to update the states of a feature and query them to be used in other + * services. The dynamic properties of a feature that don't belong to the dataset are referred to as *states* here. + * + *

This Feature State service pivot on the Stateset. Like Tileset, Stateset encapsulates the storage mechanism + * for feature states for a dataset. + * + *

Once the stateset is created, users can use that statesetId to post feature state updates and retrieve the + * current feature states. A feature can have only one state at a given point in time. + * + *

Feature state is defined by the key name, value and the timestamp. When a feature state update is posted to + * Azure Maps, the state value gets updated only if the provided state’s timestamp is later than the stored + * timestamp. + * + *

Azure Maps MapControl provides a way to use these feature states to style the features. Please refer to the + * [State Tile documentation](https://docs.microsoft.com/en-us/rest/api/maps/render/get-map-state-tile-preview) for + * more information. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe datasetId must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoDescription for the stateset. Max length allowed is 1000.
+ * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     statesetId: String
+     * }
+     * }
+ * + * @param statesetCreateRequestBody The stateset style JSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the successful Stateset Create API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createStatesetWithResponse( + BinaryData statesetCreateRequestBody, RequestOptions requestOptions) { + return this.serviceClient.createStatesetWithResponseAsync(statesetCreateRequestBody, 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 statesets. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listStateset(RequestOptions requestOptions) { + return this.serviceClient.listStatesetAsync(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 PUT API allows the user to update the stateset style rules. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param statesetStyleUpdateRequestBody The stateset style JSON data. Only style rules are allowed to be updated, + * update on keyname and type is not allowed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putStatesetWithResponse( + String statesetId, BinaryData statesetStyleUpdateRequestBody, RequestOptions requestOptions) { + return this.serviceClient.putStatesetWithResponseAsync( + statesetId, statesetStyleUpdateRequestBody, 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 DELETE API allows the user to delete the stateset and the associated data. + * + *

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteStatesetWithResponse(String statesetId, RequestOptions requestOptions) { + return this.serviceClient.deleteStatesetWithResponseAsync(statesetId, 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 GET API allows the user to get the stateset Information. + * + *

The stateset Information includes the datasetId associated to the stateset, and the styles of that stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     description: String
+     *     datasetIds: [
+     *         String
+     *     ]
+     *     statesetStyle: {
+     *         styles: [
+     *             {
+     *                 keyName: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @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 successful Stateset Get API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatesetWithResponse(String statesetId, RequestOptions requestOptions) { + return this.serviceClient.getStatesetWithResponseAsync(statesetId, 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 PUT API allows the user to update the state of the given feature in the given stateset. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given dataset. If the featureId is not present in the dataset, Bad + * Request response will be returned. + * @param featureStateUpdateRequestBody The feature state JSON data. A feature can have only one state at a given + * point in time. The specified state keyname must have been defined during the stateset creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateStatesWithResponse( + String statesetId, + String featureId, + BinaryData featureStateUpdateRequestBody, + RequestOptions requestOptions) { + return this.serviceClient.updateStatesWithResponseAsync( + statesetId, featureId, featureStateUpdateRequestBody, 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 deletes the state information identified by the StateKeyName parameter for the feature identified by + * the FeatureId parameter in the the stateset. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
stateKeyNameStringYesThe Name of the state to be deleted.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteStateWithResponse( + String statesetId, String featureId, RequestOptions requestOptions) { + return this.serviceClient.deleteStateWithResponseAsync(statesetId, featureId, 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 returns the current state information associated with the given feature in the given stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @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 feature states model for a feature along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatesWithResponse( + String statesetId, String featureId, RequestOptions requestOptions) { + return this.serviceClient.getStatesWithResponseAsync(statesetId, featureId, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceClient.java b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceClient.java new file mode 100644 index 000000000000..91c7d56964fd --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceClient.java @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.featurestate; + +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.featurestate.implementation.FeatureStatesImpl; + +/** Initializes a new instance of the synchronous AzureMapsFeatureStateServiceClient type. */ +@ServiceClient(builder = AzureMapsFeatureStateServiceClientBuilder.class) +public final class AzureMapsFeatureStateServiceClient { + @Generated private final FeatureStatesImpl serviceClient; + + /** + * Initializes an instance of FeatureStates client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsFeatureStateServiceClient(FeatureStatesImpl 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 POST API allows the user to create a new Stateset and define stateset style using request body. + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. The Feature State API is part of Creator. + * + *

The Feature State service allows the user to update the states of a feature and query them to be used in other + * services. The dynamic properties of a feature that don't belong to the dataset are referred to as *states* here. + * + *

This Feature State service pivot on the Stateset. Like Tileset, Stateset encapsulates the storage mechanism + * for feature states for a dataset. + * + *

Once the stateset is created, users can use that statesetId to post feature state updates and retrieve the + * current feature states. A feature can have only one state at a given point in time. + * + *

Feature state is defined by the key name, value and the timestamp. When a feature state update is posted to + * Azure Maps, the state value gets updated only if the provided state’s timestamp is later than the stored + * timestamp. + * + *

Azure Maps MapControl provides a way to use these feature states to style the features. Please refer to the + * [State Tile documentation](https://docs.microsoft.com/en-us/rest/api/maps/render/get-map-state-tile-preview) for + * more information. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe datasetId must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoDescription for the stateset. Max length allowed is 1000.
+ * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     statesetId: String
+     * }
+     * }
+ * + * @param statesetCreateRequestBody The stateset style JSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the successful Stateset Create API along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createStatesetWithResponse( + BinaryData statesetCreateRequestBody, RequestOptions requestOptions) { + return this.serviceClient.createStatesetWithResponse(statesetCreateRequestBody, 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 statesets. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listStateset(RequestOptions requestOptions) { + return this.serviceClient.listStateset(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 PUT API allows the user to update the stateset style rules. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param statesetStyleUpdateRequestBody The stateset style JSON data. Only style rules are allowed to be updated, + * update on keyname and type is not allowed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putStatesetWithResponse( + String statesetId, BinaryData statesetStyleUpdateRequestBody, RequestOptions requestOptions) { + return this.serviceClient.putStatesetWithResponse(statesetId, statesetStyleUpdateRequestBody, 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 DELETE API allows the user to delete the stateset and the associated data. + * + *

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

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

The stateset Information includes the datasetId associated to the stateset, and the styles of that stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     description: String
+     *     datasetIds: [
+     *         String
+     *     ]
+     *     statesetStyle: {
+     *         styles: [
+     *             {
+     *                 keyName: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @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 successful Stateset Get API along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStatesetWithResponse(String statesetId, RequestOptions requestOptions) { + return this.serviceClient.getStatesetWithResponse(statesetId, 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 PUT API allows the user to update the state of the given feature in the given stateset. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given dataset. If the featureId is not present in the dataset, Bad + * Request response will be returned. + * @param featureStateUpdateRequestBody The feature state JSON data. A feature can have only one state at a given + * point in time. The specified state keyname must have been defined during the stateset creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateStatesWithResponse( + String statesetId, + String featureId, + BinaryData featureStateUpdateRequestBody, + RequestOptions requestOptions) { + return this.serviceClient.updateStatesWithResponse( + statesetId, featureId, featureStateUpdateRequestBody, 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 deletes the state information identified by the StateKeyName parameter for the feature identified by + * the FeatureId parameter in the the stateset. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
stateKeyNameStringYesThe Name of the state to be deleted.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteStateWithResponse(String statesetId, String featureId, RequestOptions requestOptions) { + return this.serviceClient.deleteStateWithResponse(statesetId, featureId, 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 returns the current state information associated with the given feature in the given stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @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 feature states model for a feature along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStatesWithResponse( + String statesetId, String featureId, RequestOptions requestOptions) { + return this.serviceClient.getStatesWithResponse(statesetId, featureId, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceClientBuilder.java b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceClientBuilder.java new file mode 100644 index 000000000000..fe79f6e4fa9e --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceClientBuilder.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.featurestate; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.AzureKeyCredentialPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.maps.featurestate.implementation.AzureMapsFeatureStateServiceClientImpl; +import com.azure.maps.featurestate.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 AzureMapsFeatureStateServiceClient type. */ +@ServiceClientBuilder( + serviceClients = {AzureMapsFeatureStateServiceClient.class, AzureMapsFeatureStateServiceAsyncClient.class}) +public final class AzureMapsFeatureStateServiceClientBuilder { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://atlas.microsoft.com/.default"}; + + @Generated + private final Map properties = CoreUtils.getProperties("azure-maps-featurestate.properties"); + + /** Create an instance of the AzureMapsFeatureStateServiceClientBuilder. */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder() { + 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder geography(Geography geography) { + this.geography = geography; + return this; + } + + /* + * Service version + */ + @Generated private AzureMapsFeatureStateServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder serviceVersion( + AzureMapsFeatureStateServiceVersion 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The Azure Key Credential used for authentication. + */ + @Generated private AzureKeyCredential azureKeyCredential; + + /** + * Sets The Azure Key Credential used for authentication. + * + * @param azureKeyCredential the azureKeyCredential value. + * @return the AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder credential(AzureKeyCredential azureKeyCredential) { + this.azureKeyCredential = azureKeyCredential; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** + * Sets The TokenCredential used for authentication. + * + * @param tokenCredential the tokenCredential value. + * @return the AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder 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 AzureMapsFeatureStateServiceClientBuilder. + */ + @Generated + public AzureMapsFeatureStateServiceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AzureMapsFeatureStateServiceClientImpl with the provided parameters. + * + * @return an instance of AzureMapsFeatureStateServiceClientImpl. + */ + @Generated + private AzureMapsFeatureStateServiceClientImpl buildInnerClient() { + if (geography == null) { + this.geography = Geography.US; + } + if (serviceVersion == null) { + this.serviceVersion = AzureMapsFeatureStateServiceVersion.getLatest(); + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AzureMapsFeatureStateServiceClientImpl client = + new AzureMapsFeatureStateServiceClientImpl( + pipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); + policies.add(new CookiePolicy()); + if (azureKeyCredential != null) { + policies.add(new AzureKeyCredentialPolicy("subscription-key", azureKeyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of AzureMapsFeatureStateServiceAsyncClient async client. + * + * @return an instance of AzureMapsFeatureStateServiceAsyncClient. + */ + @Generated + public AzureMapsFeatureStateServiceAsyncClient buildAsyncClient() { + return new AzureMapsFeatureStateServiceAsyncClient(buildInnerClient().getFeatureStates()); + } + + /** + * Builds an instance of AzureMapsFeatureStateServiceClient sync client. + * + * @return an instance of AzureMapsFeatureStateServiceClient. + */ + @Generated + public AzureMapsFeatureStateServiceClient buildClient() { + return new AzureMapsFeatureStateServiceClient(buildInnerClient().getFeatureStates()); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceVersion.java b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceVersion.java new file mode 100644 index 000000000000..b50821fc1052 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/AzureMapsFeatureStateServiceVersion.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.featurestate; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AzureMapsFeatureStateServiceClient. */ +public enum AzureMapsFeatureStateServiceVersion implements ServiceVersion { + /** Enum value 2.0. */ + V2_0("2.0"); + + private final String version; + + AzureMapsFeatureStateServiceVersion(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 AzureMapsFeatureStateServiceVersion}. + */ + public static AzureMapsFeatureStateServiceVersion getLatest() { + return V2_0; + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/implementation/AzureMapsFeatureStateServiceClientImpl.java b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/implementation/AzureMapsFeatureStateServiceClientImpl.java new file mode 100644 index 000000000000..4ddba8bd418e --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/implementation/AzureMapsFeatureStateServiceClientImpl.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.featurestate.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.featurestate.AzureMapsFeatureStateServiceVersion; +import com.azure.maps.featurestate.models.Geography; + +/** Initializes a new instance of the AzureMapsFeatureStateServiceClient type. */ +public final class AzureMapsFeatureStateServiceClientImpl { + /** + * 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 AzureMapsFeatureStateServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AzureMapsFeatureStateServiceVersion 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 FeatureStatesImpl object to access its operations. */ + private final FeatureStatesImpl featureStates; + + /** + * Gets the FeatureStatesImpl object to access its operations. + * + * @return the FeatureStatesImpl object. + */ + public FeatureStatesImpl getFeatureStates() { + return this.featureStates; + } + + /** + * Initializes an instance of AzureMapsFeatureStateServiceClient 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 AzureMapsFeatureStateServiceClientImpl( + String clientId, Geography geography, AzureMapsFeatureStateServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + clientId, + geography, + serviceVersion); + } + + /** + * Initializes an instance of AzureMapsFeatureStateServiceClient 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 AzureMapsFeatureStateServiceClientImpl( + HttpPipeline httpPipeline, + String clientId, + Geography geography, + AzureMapsFeatureStateServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, geography, serviceVersion); + } + + /** + * Initializes an instance of AzureMapsFeatureStateServiceClient 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 AzureMapsFeatureStateServiceClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String clientId, + Geography geography, + AzureMapsFeatureStateServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.clientId = clientId; + this.geography = geography; + this.serviceVersion = serviceVersion; + this.featureStates = new FeatureStatesImpl(this); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/implementation/FeatureStatesImpl.java b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/implementation/FeatureStatesImpl.java new file mode 100644 index 000000000000..c3684ffc2cde --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/implementation/FeatureStatesImpl.java @@ -0,0 +1,1820 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.featurestate.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.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 FeatureStates. */ +public final class FeatureStatesImpl { + /** The proxy service used to perform REST calls. */ + private final FeatureStatesService service; + + /** The service client containing this operation class. */ + private final AzureMapsFeatureStateServiceClientImpl client; + + /** + * Initializes an instance of FeatureStatesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeatureStatesImpl(AzureMapsFeatureStateServiceClientImpl client) { + this.service = + RestProxy.create(FeatureStatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMapsFeatureStateServiceFeatureStates to be used by the proxy + * service to perform REST calls. + */ + @Host("https://{geography}.atlas.microsoft.com") + @ServiceInterface(name = "AzureMapsFeatureStat") + private interface FeatureStatesService { + @Post("/featureStateSets") + @ExpectedResponses({200}) + Mono> createStateset( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData statesetCreateRequestBody, + RequestOptions requestOptions, + Context context); + + @Get("/featureStateSets") + @ExpectedResponses({200}) + Mono> listStateset( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, + Context context); + + @Put("/featureStateSets/{statesetId}") + @ExpectedResponses({200}) + Mono> putStateset( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("statesetId") String statesetId, + @BodyParam("application/json") BinaryData statesetStyleUpdateRequestBody, + RequestOptions requestOptions, + Context context); + + @Delete("/featureStateSets/{statesetId}") + @ExpectedResponses({204}) + Mono> deleteStateset( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("statesetId") String statesetId, + RequestOptions requestOptions, + Context context); + + @Get("/featureStateSets/{statesetId}") + @ExpectedResponses({200}) + Mono> getStateset( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("statesetId") String statesetId, + RequestOptions requestOptions, + Context context); + + @Put("/featureStateSets/{statesetId}/featureStates/{featureId}") + @ExpectedResponses({200}) + Mono> updateStates( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("statesetId") String statesetId, + @PathParam("featureId") String featureId, + @BodyParam("application/json") BinaryData featureStateUpdateRequestBody, + RequestOptions requestOptions, + Context context); + + @Delete("/featureStateSets/{statesetId}/featureStates/{featureId}") + @ExpectedResponses({204}) + Mono> deleteState( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("statesetId") String statesetId, + @PathParam("featureId") String featureId, + RequestOptions requestOptions, + Context context); + + @Get("/featureStateSets/{statesetId}/featureStates/{featureId}") + @ExpectedResponses({200}) + Mono> getStates( + @HostParam("geography") String geography, + @QueryParam("api-version") String apiVersion, + @PathParam("statesetId") String statesetId, + @PathParam("featureId") String featureId, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + Mono> listStatesetNext( + @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 POST API allows the user to create a new Stateset and define stateset style using request body. + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. The Feature State API is part of Creator. + * + *

The Feature State service allows the user to update the states of a feature and query them to be used in other + * services. The dynamic properties of a feature that don't belong to the dataset are referred to as *states* here. + * + *

This Feature State service pivot on the Stateset. Like Tileset, Stateset encapsulates the storage mechanism + * for feature states for a dataset. + * + *

Once the stateset is created, users can use that statesetId to post feature state updates and retrieve the + * current feature states. A feature can have only one state at a given point in time. + * + *

Feature state is defined by the key name, value and the timestamp. When a feature state update is posted to + * Azure Maps, the state value gets updated only if the provided state’s timestamp is later than the stored + * timestamp. + * + *

Azure Maps MapControl provides a way to use these feature states to style the features. Please refer to the + * [State Tile documentation](https://docs.microsoft.com/en-us/rest/api/maps/render/get-map-state-tile-preview) for + * more information. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe datasetId must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoDescription for the stateset. Max length allowed is 1000.
+ * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     statesetId: String
+     * }
+     * }
+ * + * @param statesetCreateRequestBody The stateset style JSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the successful Stateset Create API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createStatesetWithResponseAsync( + BinaryData statesetCreateRequestBody, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.createStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetCreateRequestBody, + 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 POST API allows the user to create a new Stateset and define stateset style using request body. + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. The Feature State API is part of Creator. + * + *

The Feature State service allows the user to update the states of a feature and query them to be used in other + * services. The dynamic properties of a feature that don't belong to the dataset are referred to as *states* here. + * + *

This Feature State service pivot on the Stateset. Like Tileset, Stateset encapsulates the storage mechanism + * for feature states for a dataset. + * + *

Once the stateset is created, users can use that statesetId to post feature state updates and retrieve the + * current feature states. A feature can have only one state at a given point in time. + * + *

Feature state is defined by the key name, value and the timestamp. When a feature state update is posted to + * Azure Maps, the state value gets updated only if the provided state’s timestamp is later than the stored + * timestamp. + * + *

Azure Maps MapControl provides a way to use these feature states to style the features. Please refer to the + * [State Tile documentation](https://docs.microsoft.com/en-us/rest/api/maps/render/get-map-state-tile-preview) for + * more information. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe datasetId must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoDescription for the stateset. Max length allowed is 1000.
+ * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     statesetId: String
+     * }
+     * }
+ * + * @param statesetCreateRequestBody The stateset style JSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the successful Stateset Create API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createStatesetWithResponseAsync( + BinaryData statesetCreateRequestBody, RequestOptions requestOptions, Context context) { + return service.createStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetCreateRequestBody, + 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 POST API allows the user to create a new Stateset and define stateset style using request body. + * + *

Creator makes it possible to develop applications based on your private indoor map data using Azure Maps API + * and SDK. The Feature State API is part of Creator. + * + *

The Feature State service allows the user to update the states of a feature and query them to be used in other + * services. The dynamic properties of a feature that don't belong to the dataset are referred to as *states* here. + * + *

This Feature State service pivot on the Stateset. Like Tileset, Stateset encapsulates the storage mechanism + * for feature states for a dataset. + * + *

Once the stateset is created, users can use that statesetId to post feature state updates and retrieve the + * current feature states. A feature can have only one state at a given point in time. + * + *

Feature state is defined by the key name, value and the timestamp. When a feature state update is posted to + * Azure Maps, the state value gets updated only if the provided state’s timestamp is later than the stored + * timestamp. + * + *

Azure Maps MapControl provides a way to use these feature states to style the features. Please refer to the + * [State Tile documentation](https://docs.microsoft.com/en-us/rest/api/maps/render/get-map-state-tile-preview) for + * more information. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
datasetIdStringYesThe datasetId must have been obtained from a successful [Dataset Create API](https://docs.microsoft.com/en-us/rest/api/maps/v2/dataset/create) call.
descriptionStringNoDescription for the stateset. Max length allowed is 1000.
+ * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     statesetId: String
+     * }
+     * }
+ * + * @param statesetCreateRequestBody The stateset style JSON data. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response model for the successful Stateset Create API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createStatesetWithResponse( + BinaryData statesetCreateRequestBody, RequestOptions requestOptions) { + return createStatesetWithResponseAsync(statesetCreateRequestBody, 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 statesets. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listStatesetSinglePageAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.listStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "statesets"), + 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 statesets. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listStatesetSinglePageAsync(RequestOptions requestOptions, Context context) { + return service.listStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "statesets"), + 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 statesets. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listStatesetAsync(RequestOptions requestOptions) { + return new PagedFlux<>( + () -> listStatesetSinglePageAsync(requestOptions), + nextLink -> listStatesetNextSinglePageAsync(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 statesets. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listStatesetAsync(RequestOptions requestOptions, Context context) { + return new PagedFlux<>( + () -> listStatesetSinglePageAsync(requestOptions, context), + nextLink -> listStatesetNextSinglePageAsync(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 statesets. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listStateset(RequestOptions requestOptions) { + return new PagedIterable<>(listStatesetAsync(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 PUT API allows the user to update the stateset style rules. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param statesetStyleUpdateRequestBody The stateset style JSON data. Only style rules are allowed to be updated, + * update on keyname and type is not allowed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putStatesetWithResponseAsync( + String statesetId, BinaryData statesetStyleUpdateRequestBody, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.putStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + statesetStyleUpdateRequestBody, + 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 PUT API allows the user to update the stateset style rules. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param statesetStyleUpdateRequestBody The stateset style JSON data. Only style rules are allowed to be updated, + * update on keyname and type is not allowed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putStatesetWithResponseAsync( + String statesetId, + BinaryData statesetStyleUpdateRequestBody, + RequestOptions requestOptions, + Context context) { + return service.putStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + statesetStyleUpdateRequestBody, + 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 PUT API allows the user to update the stateset style rules. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     styles: [
+     *         {
+     *             keyName: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param statesetStyleUpdateRequestBody The stateset style JSON data. Only style rules are allowed to be updated, + * update on keyname and type is not allowed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putStatesetWithResponse( + String statesetId, BinaryData statesetStyleUpdateRequestBody, RequestOptions requestOptions) { + return putStatesetWithResponseAsync(statesetId, statesetStyleUpdateRequestBody, 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 DELETE API allows the user to delete the stateset and the associated data. + * + *

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteStatesetWithResponseAsync(String statesetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.deleteStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + 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 DELETE API allows the user to delete the stateset and the associated data. + * + *

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteStatesetWithResponseAsync( + String statesetId, RequestOptions requestOptions, Context context) { + return service.deleteStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + 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 DELETE API allows the user to delete the stateset and the associated data. + * + *

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

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteStatesetWithResponse(String statesetId, RequestOptions requestOptions) { + return deleteStatesetWithResponseAsync(statesetId, 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 GET API allows the user to get the stateset Information. + * + *

The stateset Information includes the datasetId associated to the stateset, and the styles of that stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     description: String
+     *     datasetIds: [
+     *         String
+     *     ]
+     *     statesetStyle: {
+     *         styles: [
+     *             {
+     *                 keyName: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @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 successful Stateset Get API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatesetWithResponseAsync(String statesetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + 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 GET API allows the user to get the stateset Information. + * + *

The stateset Information includes the datasetId associated to the stateset, and the styles of that stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     description: String
+     *     datasetIds: [
+     *         String
+     *     ]
+     *     statesetStyle: {
+     *         styles: [
+     *             {
+     *                 keyName: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @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 successful Stateset Get API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatesetWithResponseAsync( + String statesetId, RequestOptions requestOptions, Context context) { + return service.getStateset( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + 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 GET API allows the user to get the stateset Information. + * + *

The stateset Information includes the datasetId associated to the stateset, and the styles of that stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     description: String
+     *     datasetIds: [
+     *         String
+     *     ]
+     *     statesetStyle: {
+     *         styles: [
+     *             {
+     *                 keyName: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @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 successful Stateset Get API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStatesetWithResponse(String statesetId, RequestOptions requestOptions) { + return getStatesetWithResponseAsync(statesetId, 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 PUT API allows the user to update the state of the given feature in the given stateset. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given dataset. If the featureId is not present in the dataset, Bad + * Request response will be returned. + * @param featureStateUpdateRequestBody The feature state JSON data. A feature can have only one state at a given + * point in time. The specified state keyname must have been defined during the stateset creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateStatesWithResponseAsync( + String statesetId, + String featureId, + BinaryData featureStateUpdateRequestBody, + RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.updateStates( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + featureId, + featureStateUpdateRequestBody, + 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 PUT API allows the user to update the state of the given feature in the given stateset. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given dataset. If the featureId is not present in the dataset, Bad + * Request response will be returned. + * @param featureStateUpdateRequestBody The feature state JSON data. A feature can have only one state at a given + * point in time. The specified state keyname must have been defined during the stateset creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateStatesWithResponseAsync( + String statesetId, + String featureId, + BinaryData featureStateUpdateRequestBody, + RequestOptions requestOptions, + Context context) { + return service.updateStates( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + featureId, + featureStateUpdateRequestBody, + 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 PUT API allows the user to update the state of the given feature in the given stateset. + * + *

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

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

Request Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given dataset. If the featureId is not present in the dataset, Bad + * Request response will be returned. + * @param featureStateUpdateRequestBody The feature state JSON data. A feature can have only one state at a given + * point in time. The specified state keyname must have been defined during the stateset creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateStatesWithResponse( + String statesetId, + String featureId, + BinaryData featureStateUpdateRequestBody, + RequestOptions requestOptions) { + return updateStatesWithResponseAsync(statesetId, featureId, featureStateUpdateRequestBody, 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 deletes the state information identified by the StateKeyName parameter for the feature identified by + * the FeatureId parameter in the the stateset. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
stateKeyNameStringYesThe Name of the state to be deleted.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteStateWithResponseAsync( + String statesetId, String featureId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.deleteState( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + featureId, + 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 deletes the state information identified by the StateKeyName parameter for the feature identified by + * the FeatureId parameter in the the stateset. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
stateKeyNameStringYesThe Name of the state to be deleted.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteStateWithResponseAsync( + String statesetId, String featureId, RequestOptions requestOptions, Context context) { + return service.deleteState( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + featureId, + 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 deletes the state information identified by the StateKeyName parameter for the feature identified by + * the FeatureId parameter in the the stateset. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
stateKeyNameStringYesThe Name of the state to be deleted.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteStateWithResponse(String statesetId, String featureId, RequestOptions requestOptions) { + return deleteStateWithResponseAsync(statesetId, featureId, 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 returns the current state information associated with the given feature in the given stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @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 feature states model for a feature along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatesWithResponseAsync( + String statesetId, String featureId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getStates( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + featureId, + 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 returns the current state information associated with the given feature in the given stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @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 feature states model for a feature along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatesWithResponseAsync( + String statesetId, String featureId, RequestOptions requestOptions, Context context) { + return service.getStates( + this.client.getGeography(), + this.client.getServiceVersion().getVersion(), + statesetId, + featureId, + 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 returns the current state information associated with the given feature in the given stateset. + * + *

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

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

Response Body Schema + * + *

{@code
+     * {
+     *     states: [
+     *         {
+     *             keyName: String
+     *             value: String
+     *             eventTimestamp: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param statesetId The stateset id that was created. + * @param featureId The id of a feature in the given stateset. If no state was set for the featureId in the stateset + * earlier, Bad Request response will be returned. + * @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 feature states model for a feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStatesWithResponse( + String statesetId, String featureId, RequestOptions requestOptions) { + return getStatesWithResponseAsync(statesetId, featureId, requestOptions).block(); + } + + /** + * Get the next page of items. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listStatesetNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.listStatesetNext(nextLink, this.client.getGeography(), requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "statesets"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     statesets: [
+     *         {
+     *             statesetId: String
+     *             description: String
+     *             datasetIds: [
+     *                 String
+     *             ]
+     *             statesetStyle: {
+     *                 styles: [
+     *                     {
+     *                         keyName: 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 successful Stateset List API along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listStatesetNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + return service.listStatesetNext(nextLink, this.client.getGeography(), requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "statesets"), + 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-featurestate/src/main/java/com/azure/maps/featurestate/package-info.java b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/package-info.java new file mode 100644 index 000000000000..7497e4baf420 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/main/java/com/azure/maps/featurestate/package-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. + +/** + * Package containing the classes for AzureMapsFeatureStateService. APIs for managing the dynamic feature states in + * Azure Maps. + */ +package com.azure.maps.featurestate; diff --git a/sdk/maps/azure-maps-featurestate/src/main/java/module-info.java b/sdk/maps/azure-maps-featurestate/src/main/java/module-info.java new file mode 100644 index 000000000000..bb7463a2c861 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/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.featurestate { + requires transitive com.azure.core; + + exports com.azure.maps.featurestate; +} diff --git a/sdk/maps/azure-maps-featurestate/src/main/resources/azure-maps-featurestate.properties b/sdk/maps/azure-maps-featurestate/src/main/resources/azure-maps-featurestate.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/main/resources/azure-maps-featurestate.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/ReadmeSamples.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/ReadmeSamples.java new file mode 100644 index 000000000000..2aab8e6f3954 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/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.featurestate; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.maps.featurestate.readme + // END: com.azure.maps.featurestate.readme + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/CreateANewStatesetWithADatasetId.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/CreateANewStatesetWithADatasetId.java new file mode 100644 index 000000000000..056baa573e18 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/CreateANewStatesetWithADatasetId.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.featurestate.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.featurestate.AzureMapsFeatureStateServiceClient; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClientBuilder; + +public class CreateANewStatesetWithADatasetId { + public static void main(String[] args) { + AzureMapsFeatureStateServiceClient client = + new AzureMapsFeatureStateServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + BinaryData statesetCreateRequestBody = + BinaryData.fromString( + "{\"styles\":[{\"type\":\"boolean\",\"keyName\":\"s1\",\"rules\":[{\"false\":\"#00FF00\",\"true\":\"#FF0000\"}]},{\"type\":\"number\",\"keyName\":\"s2\",\"rules\":[{\"color\":\"#343deb\",\"range\":{\"exclusiveMaximum\":\"50\"}},{\"color\":\"#34ebb1\",\"range\":{\"exclusiveMaximum\":\"70\",\"minimum\":\"50\"}},{\"color\":\"#eba834\",\"range\":{\"exclusiveMaximum\":\"90\",\"minimum\":\"70\"}},{\"color\":\"#eb3434\",\"range\":{\"minimum\":\"90\"}}]},{\"type\":\"string\",\"keyName\":\"s3\",\"rules\":[{\"stateValue1\":\"#FF0000\",\"stateValue2\":\"#FF00AA\",\"stateValueN\":\"#00FF00\"}]}]}"); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("description", "Stateset for Azure Maps POC."); + requestOptions.addQueryParam("datasetId", "5d34fbe8-87b7-f7c0-3144-c50e003a3c75"); + Response response = client.createStatesetWithResponse(statesetCreateRequestBody, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/DeleteAnExistingStateset.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/DeleteAnExistingStateset.java new file mode 100644 index 000000000000..7502e0ee6d65 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/DeleteAnExistingStateset.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.featurestate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClient; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClientBuilder; + +public class DeleteAnExistingStateset { + public static void main(String[] args) { + AzureMapsFeatureStateServiceClient client = + new AzureMapsFeatureStateServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.deleteStatesetWithResponse("b24bdb73-1305-3212-1909-a428d937b64f", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/DeleteTheGivenFeatureState.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/DeleteTheGivenFeatureState.java new file mode 100644 index 000000000000..6feb7f125bc5 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/DeleteTheGivenFeatureState.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.featurestate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClient; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClientBuilder; + +public class DeleteTheGivenFeatureState { + public static void main(String[] args) { + AzureMapsFeatureStateServiceClient client = + new AzureMapsFeatureStateServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("stateKeyName", "keyName1"); + Response response = + client.deleteStateWithResponse("b24bdb73-1305-3212-1909-a428d937b64", "SPC4709", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/GetStatesetInformationWithAStatesetId.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/GetStatesetInformationWithAStatesetId.java new file mode 100644 index 000000000000..c3f1cc41a144 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/GetStatesetInformationWithAStatesetId.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.featurestate.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.featurestate.AzureMapsFeatureStateServiceClient; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClientBuilder; + +public class GetStatesetInformationWithAStatesetId { + public static void main(String[] args) { + AzureMapsFeatureStateServiceClient client = + new AzureMapsFeatureStateServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.getStatesetWithResponse("b24bdb73-1305-3212-1909-a428d937b64", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/GetTheCurrentStatesOfAFeature.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/GetTheCurrentStatesOfAFeature.java new file mode 100644 index 000000000000..8a4865042638 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/GetTheCurrentStatesOfAFeature.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.featurestate.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.featurestate.AzureMapsFeatureStateServiceClient; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClientBuilder; + +public class GetTheCurrentStatesOfAFeature { + public static void main(String[] args) { + AzureMapsFeatureStateServiceClient client = + new AzureMapsFeatureStateServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.getStatesWithResponse("b24bdb73-1305-3212-1909-a428d937b64", "SPC4709", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/ListAllThePreviouslyCreatedStatesets.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/ListAllThePreviouslyCreatedStatesets.java new file mode 100644 index 000000000000..513513a6df35 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/ListAllThePreviouslyCreatedStatesets.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.featurestate.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.featurestate.AzureMapsFeatureStateServiceClient; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClientBuilder; + +public class ListAllThePreviouslyCreatedStatesets { + public static void main(String[] args) { + AzureMapsFeatureStateServiceClient client = + new AzureMapsFeatureStateServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = client.listStateset(requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/UpdateStatesetStyleRulesWithAStatesetId.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/UpdateStatesetStyleRulesWithAStatesetId.java new file mode 100644 index 000000000000..23176cfb9738 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/UpdateStatesetStyleRulesWithAStatesetId.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.featurestate.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.featurestate.AzureMapsFeatureStateServiceClient; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClientBuilder; + +public class UpdateStatesetStyleRulesWithAStatesetId { + public static void main(String[] args) { + AzureMapsFeatureStateServiceClient client = + new AzureMapsFeatureStateServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + BinaryData statesetStyleUpdateRequestBody = + BinaryData.fromString( + "{\"styles\":[{\"type\":\"boolean\",\"keyName\":\"s1\",\"rules\":[{\"false\":\"#FFFFFF\",\"true\":\"#FFFF00\"}]},{\"type\":\"number\",\"keyName\":\"s2\",\"rules\":[{\"color\":\"#343deb\",\"range\":{\"exclusiveMaximum\":\"50\"}},{\"color\":\"#34ebb1\",\"range\":{\"exclusiveMaximum\":\"69\",\"minimum\":\"50\"}},{\"color\":\"#eba834\",\"range\":{\"exclusiveMaximum\":\"90\",\"minimum\":\"69\"}},{\"color\":\"#eb3434\",\"range\":{\"minimum\":\"90\"}}]}]}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.putStatesetWithResponse( + "b24bdb73-1305-3212-1909-a428d937b64", statesetStyleUpdateRequestBody, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/UpdateTheStatesOfAFeature.java b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/UpdateTheStatesOfAFeature.java new file mode 100644 index 000000000000..79efbc74fc1d --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/samples/java/com/azure/maps/featurestate/generated/UpdateTheStatesOfAFeature.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.featurestate.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.featurestate.AzureMapsFeatureStateServiceClient; +import com.azure.maps.featurestate.AzureMapsFeatureStateServiceClientBuilder; + +public class UpdateTheStatesOfAFeature { + public static void main(String[] args) { + AzureMapsFeatureStateServiceClient client = + new AzureMapsFeatureStateServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .geography("us") + .buildClient(); + BinaryData featureStateUpdateRequestBody = + BinaryData.fromString( + "{\"states\":[{\"eventTimestamp\":\"2019-08-16 13:01\",\"keyName\":\"s1\",\"value\":\"true\"}]}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + client.updateStatesWithResponse( + "b24bdb73-1305-3212-1909-a428d937b64", + "SPC4709", + featureStateUpdateRequestBody, + requestOptions); + } +} diff --git a/sdk/maps/azure-maps-featurestate/src/test/java/com/azure/maps/featurestate/ClientTests.java b/sdk/maps/azure-maps-featurestate/src/test/java/com/azure/maps/featurestate/ClientTests.java new file mode 100644 index 000000000000..687f961acd11 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/src/test/java/com/azure/maps/featurestate/ClientTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.featurestate; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.featurestate.models.Geography; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClientTests extends TestBase { + private AzureMapsFeatureStateServiceClient azureMapsFeatureStateServiceClient; + + @BeforeEach + public void setup() { + AzureMapsFeatureStateServiceClientBuilder azureMapsFeatureStateServiceClientbuilder = + new AzureMapsFeatureStateServiceClientBuilder() + .geography(Configuration.getGlobalConfiguration().get("GEOGRAPHY", Geography.US)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + azureMapsFeatureStateServiceClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + azureMapsFeatureStateServiceClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + azureMapsFeatureStateServiceClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + azureMapsFeatureStateServiceClient = azureMapsFeatureStateServiceClientbuilder.buildClient(); + } + + @Test + @DoNotRecord(skipInPlayback = true) + public void testClient() { + // use the builder to create client + } +} diff --git a/sdk/maps/azure-maps-featurestate/swagger/README_SPEC.md b/sdk/maps/azure-maps-featurestate/swagger/README_SPEC.md new file mode 100644 index 000000000000..49f4f836b704 --- /dev/null +++ b/sdk/maps/azure-maps-featurestate/swagger/README_SPEC.md @@ -0,0 +1,25 @@ +## Generate autorest code + +```yaml +input-files: +- /home/vsts/work/1/s/azure-rest-api-specs/specification/maps/data-plane/Creator/preview/2.0/featurestate.json +output-folder: ../ +java: true +regenerate-pom: false +partial-update: true +generate-sync-async-clients: true +generate-client-as-impl: true +generate-client-interfaces: false +generate-builder-per-client: true +add-context-parameter: true +artifact-id: azure-maps-featurestate +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.maps.featurestate +context-client-method-parameter: true +azure-arm: false +service-versions: +- '2.0' +```