diff --git a/sdk/maps/azure-maps-elevation/CHANGELOG.md b/sdk/maps/azure-maps-elevation/CHANGELOG.md new file mode 100644 index 000000000000..33ddda2e39a2 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AzureMapsElevationApi client library for Java. This package contains Microsoft Azure AzureMapsElevationApi client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/maps/azure-maps-elevation/README.md b/sdk/maps/azure-maps-elevation/README.md new file mode 100644 index 000000000000..06fc74e555c0 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/README.md @@ -0,0 +1,63 @@ +# Azure AzureMapsElevationApi client library for Java + +Azure AzureMapsElevationApi client library for Java. + +This package contains Microsoft Azure AzureMapsElevationApi 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-elevation;current}) +```xml + + com.azure + azure-maps-elevation + 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.elevation.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-elevation/pom.xml b/sdk/maps/azure-maps-elevation/pom.xml new file mode 100644 index 000000000000..e05e497d1b7f --- /dev/null +++ b/sdk/maps/azure-maps-elevation/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-elevation + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureMapsElevationApi Management + This package contains Microsoft Azure AzureMapsElevationApi 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-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiAsyncClient.java b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiAsyncClient.java new file mode 100644 index 000000000000..732d2cac17c2 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiAsyncClient.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.maps.elevation.implementation.ElevationsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AzureMapsElevationApiClient type. */ +@ServiceClient(builder = AzureMapsElevationApiClientBuilder.class, isAsync = true) +public final class AzureMapsElevationApiAsyncClient { + @Generated private final ElevationsImpl serviceClient; + + /** + * Initializes an instance of Elevations client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsElevationApiAsyncClient(ElevationsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long + * coordinate format. + * + *

Due to the URL character length limit of 2048, it's not possible to pass more than 100 coordinates as a + * pipeline delimited string in a URL GET request. If you intend to pass more than 100 coordinates as a pipeline + * delimited string, use the [POST Data For + * Points](https://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
pointsStringYesThe string representation of a list of points. A point is defined in lon/lat WGS84 coordinate reference system format. If multiple points are requested, each of the points in a list should be separated by the pipe ('|') character. The maximum number of points that can be requested in a single request is 2,000. The resolution of the elevation data will be the highest for a single point and will decrease if multiple points are spread further apart.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForPointsWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getDataForPointsWithResponseAsync(format, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat + * coordinate format. + * + *

Use the POST endpoint only if you intend to pass multiple points in the request. If you intend to pass a + * single coordinate into the API, use the [GET Data For Points + * API](https://docs.microsoft.com/rest/api/maps/elevation/getdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param points The string representation of a list of points. A point is defined in lon/lat WGS84 coordinate + * reference system format. Each points in a list should be separated by the pipe ('|') character. The number of + * points that can be requested in a POST request ranges from 2 to 2,000. The resolution of the elevation data + * will be the highest for a single point and will decrease if multiple points are spread further apart. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postDataForPointsWithResponse( + String format, BinaryData points, RequestOptions requestOptions) { + return this.serviceClient.postDataForPointsWithResponseAsync(format, points, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and endpoints, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
linesStringYesThe string representation of a polyline path. A polyline is defined by endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]`. + * + * The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. The resolution of the data used to compute the elevation depends on the distance between the endpoints.
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForPolylineWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getDataForPolylineWithResponseAsync(format, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and end points, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param polyline The string representation of a polyline path. A polyline is defined by endpoint coordinates, with + * each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: + * `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, + * latitude_pointN]`. The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate + * reference system. The resolution of the data used to compute the elevation will depend on the distance + * between the endpoints. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postDataForPolylineWithResponse( + String format, BinaryData polyline, RequestOptions requestOptions) { + return this.serviceClient.postDataForPolylineWithResponseAsync(format, polyline, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Bounding Box API provides elevation data at equally spaced locations within a bounding box. A + * bounding box is defined by the coordinates for two corners (southwest, northeast) and then subsequently divided + * into rows and columns. + * + *

Elevations are returned for the vertices of the grid created by the rows and columns. Up to 2,000 elevations + * can be returned in a single request. The returned elevation values are ordered, starting at the southwest corner, + * and then proceeding west to east along the row. At the end of the row, it moves north to the next row, and + * repeats the process until it reaches the far northeast corner. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
boundsStringYesThe string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`.
rowsintYesSpecifies the number of rows to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
columnsintYesSpecifies the number of columns to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForBoundingBoxWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getDataForBoundingBoxWithResponseAsync(format, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiClient.java b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiClient.java new file mode 100644 index 000000000000..4fbbb37eb78e --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiClient.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.maps.elevation.implementation.ElevationsImpl; + +/** Initializes a new instance of the synchronous AzureMapsElevationApiClient type. */ +@ServiceClient(builder = AzureMapsElevationApiClientBuilder.class) +public final class AzureMapsElevationApiClient { + @Generated private final ElevationsImpl serviceClient; + + /** + * Initializes an instance of Elevations client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsElevationApiClient(ElevationsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long + * coordinate format. + * + *

Due to the URL character length limit of 2048, it's not possible to pass more than 100 coordinates as a + * pipeline delimited string in a URL GET request. If you intend to pass more than 100 coordinates as a pipeline + * delimited string, use the [POST Data For + * Points](https://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
pointsStringYesThe string representation of a list of points. A point is defined in lon/lat WGS84 coordinate reference system format. If multiple points are requested, each of the points in a list should be separated by the pipe ('|') character. The maximum number of points that can be requested in a single request is 2,000. The resolution of the elevation data will be the highest for a single point and will decrease if multiple points are spread further apart.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDataForPointsWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getDataForPointsWithResponse(format, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat + * coordinate format. + * + *

Use the POST endpoint only if you intend to pass multiple points in the request. If you intend to pass a + * single coordinate into the API, use the [GET Data For Points + * API](https://docs.microsoft.com/rest/api/maps/elevation/getdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param points The string representation of a list of points. A point is defined in lon/lat WGS84 coordinate + * reference system format. Each points in a list should be separated by the pipe ('|') character. The number of + * points that can be requested in a POST request ranges from 2 to 2,000. The resolution of the elevation data + * will be the highest for a single point and will decrease if multiple points are spread further apart. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postDataForPointsWithResponse( + String format, BinaryData points, RequestOptions requestOptions) { + return this.serviceClient.postDataForPointsWithResponse(format, points, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and endpoints, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
linesStringYesThe string representation of a polyline path. A polyline is defined by endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]`. + * + * The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. The resolution of the data used to compute the elevation depends on the distance between the endpoints.
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDataForPolylineWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getDataForPolylineWithResponse(format, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and end points, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param polyline The string representation of a polyline path. A polyline is defined by endpoint coordinates, with + * each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: + * `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, + * latitude_pointN]`. The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate + * reference system. The resolution of the data used to compute the elevation will depend on the distance + * between the endpoints. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postDataForPolylineWithResponse( + String format, BinaryData polyline, RequestOptions requestOptions) { + return this.serviceClient.postDataForPolylineWithResponse(format, polyline, requestOptions); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Bounding Box API provides elevation data at equally spaced locations within a bounding box. A + * bounding box is defined by the coordinates for two corners (southwest, northeast) and then subsequently divided + * into rows and columns. + * + *

Elevations are returned for the vertices of the grid created by the rows and columns. Up to 2,000 elevations + * can be returned in a single request. The returned elevation values are ordered, starting at the southwest corner, + * and then proceeding west to east along the row. At the end of the row, it moves north to the next row, and + * repeats the process until it reaches the far northeast corner. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
boundsStringYesThe string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`.
rowsintYesSpecifies the number of rows to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
columnsintYesSpecifies the number of columns to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDataForBoundingBoxWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getDataForBoundingBoxWithResponse(format, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiClientBuilder.java b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiClientBuilder.java new file mode 100644 index 000000000000..92baa77b0c00 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiClientBuilder.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.maps.elevation.implementation.AzureMapsElevationApiClientImpl; +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 AzureMapsElevationApiClient type. */ +@ServiceClientBuilder(serviceClients = {AzureMapsElevationApiClient.class, AzureMapsElevationApiAsyncClient.class}) +public final class AzureMapsElevationApiClientBuilder { + @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-elevation.properties"); + + /** Create an instance of the AzureMapsElevationApiClientBuilder. */ + @Generated + public AzureMapsElevationApiClientBuilder() { + 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 AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /* + * server parameter + */ + @Generated private String host; + + /** + * Sets server parameter. + * + * @param host the host value. + * @return the AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder host(String host) { + this.host = host; + return this; + } + + /* + * Service version + */ + @Generated private AzureMapsElevationApiServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder serviceVersion(AzureMapsElevationApiServiceVersion 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 AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder 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 AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder 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 AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** + * Sets The TokenCredential used for authentication. + * + * @param tokenCredential the tokenCredential value. + * @return the AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder 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 AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder 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 AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder 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 AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder 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 AzureMapsElevationApiClientBuilder. + */ + @Generated + public AzureMapsElevationApiClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AzureMapsElevationApiClientImpl with the provided parameters. + * + * @return an instance of AzureMapsElevationApiClientImpl. + */ + @Generated + private AzureMapsElevationApiClientImpl buildInnerClient() { + if (host == null) { + this.host = "https://atlas.microsoft.com"; + } + if (serviceVersion == null) { + this.serviceVersion = AzureMapsElevationApiServiceVersion.getLatest(); + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AzureMapsElevationApiClientImpl client = + new AzureMapsElevationApiClientImpl( + pipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, host, serviceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of AzureMapsElevationApiAsyncClient async client. + * + * @return an instance of AzureMapsElevationApiAsyncClient. + */ + @Generated + public AzureMapsElevationApiAsyncClient buildAsyncClient() { + return new AzureMapsElevationApiAsyncClient(buildInnerClient().getElevations()); + } + + /** + * Builds an instance of AzureMapsElevationApiClient sync client. + * + * @return an instance of AzureMapsElevationApiClient. + */ + @Generated + public AzureMapsElevationApiClient buildClient() { + return new AzureMapsElevationApiClient(buildInnerClient().getElevations()); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiServiceVersion.java b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiServiceVersion.java new file mode 100644 index 000000000000..9767072fe212 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/AzureMapsElevationApiServiceVersion.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.elevation; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AzureMapsElevationApiClient. */ +public enum AzureMapsElevationApiServiceVersion implements ServiceVersion { + /** Enum value 1.0. */ + V1_0("1.0"); + + private final String version; + + AzureMapsElevationApiServiceVersion(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 AzureMapsElevationApiServiceVersion}. + */ + public static AzureMapsElevationApiServiceVersion getLatest() { + return V1_0; + } +} diff --git a/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/implementation/AzureMapsElevationApiClientImpl.java b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/implementation/AzureMapsElevationApiClientImpl.java new file mode 100644 index 000000000000..9cb6dc91cb9c --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/implementation/AzureMapsElevationApiClientImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation.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.elevation.AzureMapsElevationApiServiceVersion; + +/** Initializes a new instance of the AzureMapsElevationApiClient type. */ +public final class AzureMapsElevationApiClientImpl { + /** + * 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; + } + + /** server parameter. */ + private final String host; + + /** + * Gets server parameter. + * + * @return the host value. + */ + public String getHost() { + return this.host; + } + + /** Service version. */ + private final AzureMapsElevationApiServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AzureMapsElevationApiServiceVersion 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 ElevationsImpl object to access its operations. */ + private final ElevationsImpl elevations; + + /** + * Gets the ElevationsImpl object to access its operations. + * + * @return the ElevationsImpl object. + */ + public ElevationsImpl getElevations() { + return this.elevations; + } + + /** + * Initializes an instance of AzureMapsElevationApiClient 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 host server parameter. + * @param serviceVersion Service version. + */ + public AzureMapsElevationApiClientImpl( + String clientId, String host, AzureMapsElevationApiServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + clientId, + host, + serviceVersion); + } + + /** + * Initializes an instance of AzureMapsElevationApiClient 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 host server parameter. + * @param serviceVersion Service version. + */ + public AzureMapsElevationApiClientImpl( + HttpPipeline httpPipeline, + String clientId, + String host, + AzureMapsElevationApiServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, host, serviceVersion); + } + + /** + * Initializes an instance of AzureMapsElevationApiClient 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 host server parameter. + * @param serviceVersion Service version. + */ + public AzureMapsElevationApiClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String clientId, + String host, + AzureMapsElevationApiServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.clientId = clientId; + this.host = host; + this.serviceVersion = serviceVersion; + this.elevations = new ElevationsImpl(this); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/implementation/ElevationsImpl.java b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/implementation/ElevationsImpl.java new file mode 100644 index 000000000000..dcb79611d71d --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/implementation/ElevationsImpl.java @@ -0,0 +1,1132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.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 reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Elevations. */ +public final class ElevationsImpl { + /** The proxy service used to perform REST calls. */ + private final ElevationsService service; + + /** The service client containing this operation class. */ + private final AzureMapsElevationApiClientImpl client; + + /** + * Initializes an instance of ElevationsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElevationsImpl(AzureMapsElevationApiClientImpl client) { + this.service = + RestProxy.create(ElevationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMapsElevationApiElevations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMapsElevationAp") + private interface ElevationsService { + @Get("/elevation/point/{format}") + @ExpectedResponses({200}) + Mono> getDataForPoints( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Post("/elevation/point/{format}") + @ExpectedResponses({200}) + Mono> postDataForPoints( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + @BodyParam("application/json") BinaryData points, + RequestOptions requestOptions, + Context context); + + @Get("/elevation/line/{format}") + @ExpectedResponses({200}) + Mono> getDataForPolyline( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Post("/elevation/line/{format}") + @ExpectedResponses({200}) + Mono> postDataForPolyline( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + @BodyParam("application/json") BinaryData polyline, + RequestOptions requestOptions, + Context context); + + @Get("/elevation/lattice/{format}") + @ExpectedResponses({200}) + Mono> getDataForBoundingBox( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long + * coordinate format. + * + *

Due to the URL character length limit of 2048, it's not possible to pass more than 100 coordinates as a + * pipeline delimited string in a URL GET request. If you intend to pass more than 100 coordinates as a pipeline + * delimited string, use the [POST Data For + * Points](https://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
pointsStringYesThe string representation of a list of points. A point is defined in lon/lat WGS84 coordinate reference system format. If multiple points are requested, each of the points in a list should be separated by the pipe ('|') character. The maximum number of points that can be requested in a single request is 2,000. The resolution of the elevation data will be the highest for a single point and will decrease if multiple points are spread further apart.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForPointsWithResponseAsync(String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getDataForPoints( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long + * coordinate format. + * + *

Due to the URL character length limit of 2048, it's not possible to pass more than 100 coordinates as a + * pipeline delimited string in a URL GET request. If you intend to pass more than 100 coordinates as a pipeline + * delimited string, use the [POST Data For + * Points](https://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
pointsStringYesThe string representation of a list of points. A point is defined in lon/lat WGS84 coordinate reference system format. If multiple points are requested, each of the points in a list should be separated by the pipe ('|') character. The maximum number of points that can be requested in a single request is 2,000. The resolution of the elevation data will be the highest for a single point and will decrease if multiple points are spread further apart.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForPointsWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getDataForPoints( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long + * coordinate format. + * + *

Due to the URL character length limit of 2048, it's not possible to pass more than 100 coordinates as a + * pipeline delimited string in a URL GET request. If you intend to pass more than 100 coordinates as a pipeline + * delimited string, use the [POST Data For + * Points](https://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
pointsStringYesThe string representation of a list of points. A point is defined in lon/lat WGS84 coordinate reference system format. If multiple points are requested, each of the points in a list should be separated by the pipe ('|') character. The maximum number of points that can be requested in a single request is 2,000. The resolution of the elevation data will be the highest for a single point and will decrease if multiple points are spread further apart.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDataForPointsWithResponse(String format, RequestOptions requestOptions) { + return getDataForPointsWithResponseAsync(format, requestOptions).block(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat + * coordinate format. + * + *

Use the POST endpoint only if you intend to pass multiple points in the request. If you intend to pass a + * single coordinate into the API, use the [GET Data For Points + * API](https://docs.microsoft.com/rest/api/maps/elevation/getdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param points The string representation of a list of points. A point is defined in lon/lat WGS84 coordinate + * reference system format. Each points in a list should be separated by the pipe ('|') character. The number of + * points that can be requested in a POST request ranges from 2 to 2,000. The resolution of the elevation data + * will be the highest for a single point and will decrease if multiple points are spread further apart. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postDataForPointsWithResponseAsync( + String format, BinaryData points, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.postDataForPoints( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + points, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat + * coordinate format. + * + *

Use the POST endpoint only if you intend to pass multiple points in the request. If you intend to pass a + * single coordinate into the API, use the [GET Data For Points + * API](https://docs.microsoft.com/rest/api/maps/elevation/getdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param points The string representation of a list of points. A point is defined in lon/lat WGS84 coordinate + * reference system format. Each points in a list should be separated by the pipe ('|') character. The number of + * points that can be requested in a POST request ranges from 2 to 2,000. The resolution of the elevation data + * will be the highest for a single point and will decrease if multiple points are spread further apart. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postDataForPointsWithResponseAsync( + String format, BinaryData points, RequestOptions requestOptions, Context context) { + return service.postDataForPoints( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + points, + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat + * coordinate format. + * + *

Use the POST endpoint only if you intend to pass multiple points in the request. If you intend to pass a + * single coordinate into the API, use the [GET Data For Points + * API](https://docs.microsoft.com/rest/api/maps/elevation/getdataforpoints). + * + *

The result will be in the same sequence of points listed in the request. + * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param points The string representation of a list of points. A point is defined in lon/lat WGS84 coordinate + * reference system format. Each points in a list should be separated by the pipe ('|') character. The number of + * points that can be requested in a POST request ranges from 2 to 2,000. The resolution of the elevation data + * will be the highest for a single point and will decrease if multiple points are spread further apart. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postDataForPointsWithResponse( + String format, BinaryData points, RequestOptions requestOptions) { + return postDataForPointsWithResponseAsync(format, points, requestOptions).block(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and endpoints, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
linesStringYesThe string representation of a polyline path. A polyline is defined by endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]`. + * + * The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. The resolution of the data used to compute the elevation depends on the distance between the endpoints.
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForPolylineWithResponseAsync( + String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getDataForPolyline( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and endpoints, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
linesStringYesThe string representation of a polyline path. A polyline is defined by endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]`. + * + * The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. The resolution of the data used to compute the elevation depends on the distance between the endpoints.
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForPolylineWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getDataForPolyline( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and endpoints, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
linesStringYesThe string representation of a polyline path. A polyline is defined by endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]`. + * + * The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. The resolution of the data used to compute the elevation depends on the distance between the endpoints.
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDataForPolylineWithResponse(String format, RequestOptions requestOptions) { + return getDataForPolylineWithResponseAsync(format, requestOptions).block(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and end points, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param polyline The string representation of a polyline path. A polyline is defined by endpoint coordinates, with + * each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: + * `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, + * latitude_pointN]`. The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate + * reference system. The resolution of the data used to compute the elevation will depend on the distance + * between the endpoints. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postDataForPolylineWithResponseAsync( + String format, BinaryData polyline, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.postDataForPolyline( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + polyline, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and end points, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param polyline The string representation of a polyline path. A polyline is defined by endpoint coordinates, with + * each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: + * `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, + * latitude_pointN]`. The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate + * reference system. The resolution of the data used to compute the elevation will depend on the distance + * between the endpoints. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postDataForPolylineWithResponseAsync( + String format, BinaryData polyline, RequestOptions requestOptions, Context context) { + return service.postDataForPolyline( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + polyline, + requestOptions, + context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Post Data for Polyline API provides elevation data along a polyline. + * + *

A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. + * In addition to passing in endpoints, customers can specify the number of sample points that will be used to + * divide polyline into equally spaced segments. + * + *

Elevation data at both start and end points, as well as equally spaced points along the polyline will be + * returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line + * between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate + * reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the + * geodesic path along the curved surface of the reference ellipsoid. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
samplesStringNoThe samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
+ * + *

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
+     * [
+     *     {
+     *         lat: Double
+     *         lon: Double
+     *     }
+     * ]
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param polyline The string representation of a polyline path. A polyline is defined by endpoint coordinates, with + * each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: + * `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, + * latitude_pointN]`. The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate + * reference system. The resolution of the data used to compute the elevation will depend on the distance + * between the endpoints. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postDataForPolylineWithResponse( + String format, BinaryData polyline, RequestOptions requestOptions) { + return postDataForPolylineWithResponseAsync(format, polyline, requestOptions).block(); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Bounding Box API provides elevation data at equally spaced locations within a bounding box. A + * bounding box is defined by the coordinates for two corners (southwest, northeast) and then subsequently divided + * into rows and columns. + * + *

Elevations are returned for the vertices of the grid created by the rows and columns. Up to 2,000 elevations + * can be returned in a single request. The returned elevation values are ordered, starting at the southwest corner, + * and then proceeding west to east along the row. At the end of the row, it moves north to the next row, and + * repeats the process until it reaches the far northeast corner. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
boundsStringYesThe string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`.
rowsintYesSpecifies the number of rows to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
columnsintYesSpecifies the number of columns to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForBoundingBoxWithResponseAsync( + String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getDataForBoundingBox( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Bounding Box API provides elevation data at equally spaced locations within a bounding box. A + * bounding box is defined by the coordinates for two corners (southwest, northeast) and then subsequently divided + * into rows and columns. + * + *

Elevations are returned for the vertices of the grid created by the rows and columns. Up to 2,000 elevations + * can be returned in a single request. The returned elevation values are ordered, starting at the southwest corner, + * and then proceeding west to east along the row. At the end of the row, it moves north to the next row, and + * repeats the process until it reaches the far northeast corner. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
boundsStringYesThe string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`.
rowsintYesSpecifies the number of rows to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
columnsintYesSpecifies the number of columns to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDataForBoundingBoxWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getDataForBoundingBox( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

The Get Data for Bounding Box API provides elevation data at equally spaced locations within a bounding box. A + * bounding box is defined by the coordinates for two corners (southwest, northeast) and then subsequently divided + * into rows and columns. + * + *

Elevations are returned for the vertices of the grid created by the rows and columns. Up to 2,000 elevations + * can be returned in a single request. The returned elevation values are ordered, starting at the southwest corner, + * and then proceeding west to east along the row. At the end of the row, it moves north to the next row, and + * repeats the process until it reaches the far northeast corner. + * + *

Query Parameters + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
boundsStringYesThe string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`.
rowsintYesSpecifies the number of rows to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
columnsintYesSpecifies the number of columns to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
+ * + *

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
+     * {
+     *     elevations: [
+     *         {
+     *             coordinate: {
+     *                 latitude: Double
+     *                 longitude: Double
+     *             }
+     *             elevationInMeter: Float
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @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 from a successful Get Data for Bounding Box API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDataForBoundingBoxWithResponse(String format, RequestOptions requestOptions) { + return getDataForBoundingBoxWithResponseAsync(format, requestOptions).block(); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/package-info.java b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/package-info.java new file mode 100644 index 000000000000..112aa9b8b04c --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/main/java/com/azure/maps/elevation/package-info.java @@ -0,0 +1,14 @@ +// 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 AzureMapsElevationApi. The Azure Maps Elevation API provides an HTTP interface to + * query elevation data on the surface of the Earth. Elevation data can be retrieved at specific locations by sending + * lat/lon coordinates, by defining an ordered set of vertices that form a Polyline and a number of sample points along + * the length of a Polyline, or by defining a bounding box that consists of equally spaced vertices as rows and columns. + * The vertical datum is EPSG:3855. This datum uses the EGM2008 geoid model applied to the WGS84 ellipsoid as its zero + * height reference surface. The vertical unit is measured in meters, the spatial resolution of the elevation data is + * 0.8 arc-second for global coverage (~24 meters). + */ +package com.azure.maps.elevation; diff --git a/sdk/maps/azure-maps-elevation/src/main/java/module-info.java b/sdk/maps/azure-maps-elevation/src/main/java/module-info.java new file mode 100644 index 000000000000..31cc523b2a4c --- /dev/null +++ b/sdk/maps/azure-maps-elevation/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.elevation { + requires transitive com.azure.core; + + exports com.azure.maps.elevation; +} diff --git a/sdk/maps/azure-maps-elevation/src/main/resources/azure-maps-elevation.properties b/sdk/maps/azure-maps-elevation/src/main/resources/azure-maps-elevation.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/main/resources/azure-maps-elevation.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/ReadmeSamples.java b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/ReadmeSamples.java new file mode 100644 index 000000000000..cc1141a9de08 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/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.elevation; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.maps.elevation.readme + // END: com.azure.maps.elevation.readme + } +} diff --git a/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataAlongAPolylineUsingGet.java b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataAlongAPolylineUsingGet.java new file mode 100644 index 000000000000..617621be4d93 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataAlongAPolylineUsingGet.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation.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.elevation.AzureMapsElevationApiClient; +import com.azure.maps.elevation.AzureMapsElevationApiClientBuilder; + +public class SuccessfullyRetrieveElevationDataAlongAPolylineUsingGet { + public static void main(String[] args) { + AzureMapsElevationApiClient client = + new AzureMapsElevationApiClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam( + "lines", "-121.66853362143818, 46.84646479863713|-121.67853362143818, 46.85646479863713"); + requestOptions.addQueryParam("samples", "5"); + Response response = client.getDataForPolylineWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataAlongAPolylineUsingPost.java b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataAlongAPolylineUsingPost.java new file mode 100644 index 000000000000..0e53cb7c7e45 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataAlongAPolylineUsingPost.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation.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.elevation.AzureMapsElevationApiClient; +import com.azure.maps.elevation.AzureMapsElevationApiClientBuilder; + +public class SuccessfullyRetrieveElevationDataAlongAPolylineUsingPost { + public static void main(String[] args) { + AzureMapsElevationApiClient client = + new AzureMapsElevationApiClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + BinaryData polyline = + BinaryData.fromString( + "[{\"lat\":46.84646479863713,\"lon\":-121.66853362143819},{\"lat\":46.85646479863713,\"lon\":-121.67853362143818}]"); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("samples", "5"); + Response response = client.postDataForPolylineWithResponse("json", polyline, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataForMultiplePointsUsingPost.java b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataForMultiplePointsUsingPost.java new file mode 100644 index 000000000000..9a264334b5b3 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataForMultiplePointsUsingPost.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation.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.elevation.AzureMapsElevationApiClient; +import com.azure.maps.elevation.AzureMapsElevationApiClientBuilder; + +public class SuccessfullyRetrieveElevationDataForMultiplePointsUsingPost { + public static void main(String[] args) { + AzureMapsElevationApiClient client = + new AzureMapsElevationApiClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + BinaryData points = + BinaryData.fromString( + "[{\"lat\":46.84646479863713,\"lon\":-121.66853362143819},{\"lat\":46.85646479863713,\"lon\":-121.68853362143818}]"); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.postDataForPointsWithResponse("json", points, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataForOneOrMorePointsUsingGet.java b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataForOneOrMorePointsUsingGet.java new file mode 100644 index 000000000000..5a3335465475 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataForOneOrMorePointsUsingGet.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation.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.elevation.AzureMapsElevationApiClient; +import com.azure.maps.elevation.AzureMapsElevationApiClientBuilder; + +public class SuccessfullyRetrieveElevationDataForOneOrMorePointsUsingGet { + public static void main(String[] args) { + AzureMapsElevationApiClient client = + new AzureMapsElevationApiClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam( + "points", "-121.66853362143818, 46.84646479863713|-121.68853362143818, 46.856464798637127"); + Response response = client.getDataForPointsWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataWithinABoundingBox.java b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataWithinABoundingBox.java new file mode 100644 index 000000000000..e729eac2751a --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/samples/java/com/azure/maps/elevation/generated/SuccessfullyRetrieveElevationDataWithinABoundingBox.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation.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.elevation.AzureMapsElevationApiClient; +import com.azure.maps.elevation.AzureMapsElevationApiClientBuilder; + +public class SuccessfullyRetrieveElevationDataWithinABoundingBox { + public static void main(String[] args) { + AzureMapsElevationApiClient client = + new AzureMapsElevationApiClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam( + "bounds", "-121.66853362143819,46.84646479863713,-121.65853362143818,46.85646479863713"); + requestOptions.addQueryParam("rows", 2); + requestOptions.addQueryParam("columns", 3); + Response response = client.getDataForBoundingBoxWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-elevation/src/test/java/com/azure/maps/elevation/ClientTests.java b/sdk/maps/azure-maps-elevation/src/test/java/com/azure/maps/elevation/ClientTests.java new file mode 100644 index 000000000000..4ee35b8f31a1 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/src/test/java/com/azure/maps/elevation/ClientTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.maps.elevation; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClientTests extends TestBase { + private AzureMapsElevationApiClient azureMapsElevationApiClient; + + @BeforeEach + public void setup() { + AzureMapsElevationApiClientBuilder azureMapsElevationApiClientbuilder = + new AzureMapsElevationApiClientBuilder() + .host(Configuration.getGlobalConfiguration().get("HOST", "https://atlas.microsoft.com")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + azureMapsElevationApiClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + azureMapsElevationApiClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + azureMapsElevationApiClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + azureMapsElevationApiClient = azureMapsElevationApiClientbuilder.buildClient(); + } + + @Test + @DoNotRecord(skipInPlayback = true) + public void testClient() { + // use the builder to create client + } +} diff --git a/sdk/maps/azure-maps-elevation/swagger/README_SPEC.md b/sdk/maps/azure-maps-elevation/swagger/README_SPEC.md new file mode 100644 index 000000000000..582b96a76175 --- /dev/null +++ b/sdk/maps/azure-maps-elevation/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/DEM/preview/1.0/elevation.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-elevation +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.maps.elevation +context-client-method-parameter: true +azure-arm: false +service-versions: +- '1.0' +```