// 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.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.serializer.CollectionFormat;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.maps.elevation.implementation.models.ErrorResponseException;
import com.azure.maps.elevation.implementation.models.JsonFormat;
import com.azure.maps.elevation.implementation.models.LatLongPairAbbreviated;
import com.azure.maps.elevation.models.ElevationResult;
import java.util.List;
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 ElevationClientImpl client;

    /**
     * Initializes an instance of ElevationsImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    ElevationsImpl(ElevationClientImpl client) {
        this.service =
                RestProxy.create(ElevationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for ElevationClientElevations to be used by the proxy service to perform
     * REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "ElevationClientEleva")
    private interface ElevationsService {
        @Get("/elevation/point/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<ElevationResult>> getDataForPoints(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @QueryParam("points") String points,
                @HeaderParam("Accept") String accept,
                Context context);

        @Post("/elevation/point/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<ElevationResult>> postDataForPoints(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @BodyParam("application/json") List<LatLongPairAbbreviated> points,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/elevation/line/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<ElevationResult>> getDataForPolyline(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @QueryParam("lines") String lines,
                @QueryParam("samples") Integer samples,
                @HeaderParam("Accept") String accept,
                Context context);

        @Post("/elevation/line/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<ElevationResult>> postDataForPolyline(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @QueryParam("samples") Integer samples,
                @BodyParam("application/json") List<LatLongPairAbbreviated> polyline,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/elevation/lattice/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<ElevationResult>> getDataForBoundingBox(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @QueryParam("bounds") String bounds,
                @QueryParam("rows") int rows,
                @QueryParam("columns") int columns,
                @HeaderParam("Accept") String accept,
                Context context);
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long
     * coordinate format.
     *
     * <p>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 POST Data For Points.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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. 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> getDataForPointsWithResponseAsync(JsonFormat format, List<String> points) {
        final String accept = "application/json";
        String pointsConverted =
                JacksonAdapter.createDefaultSerializerAdapter().serializeList(points, CollectionFormat.PIPES);
        return FluxUtil.withContext(
                context ->
                        service.getDataForPoints(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                pointsConverted,
                                accept,
                                context));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long
     * coordinate format.
     *
     * <p>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 POST Data For Points.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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. 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> getDataForPointsWithResponseAsync(
            JsonFormat format, List<String> points, Context context) {
        final String accept = "application/json";
        String pointsConverted =
                JacksonAdapter.createDefaultSerializerAdapter().serializeList(points, CollectionFormat.PIPES);
        return service.getDataForPoints(
                this.client.getHost(),
                this.client.getClientId(),
                this.client.getApiVersion(),
                format,
                pointsConverted,
                accept,
                context);
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long
     * coordinate format.
     *
     * <p>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 POST Data For Points.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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. 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> getDataForPointsAsync(JsonFormat format, List<String> points) {
        return getDataForPointsWithResponseAsync(format, points).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long
     * coordinate format.
     *
     * <p>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 POST Data For Points.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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. 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> getDataForPointsAsync(JsonFormat format, List<String> points, Context context) {
        return getDataForPointsWithResponseAsync(format, points, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long
     * coordinate format.
     *
     * <p>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 POST Data For Points.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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. 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ElevationResult getDataForPoints(JsonFormat format, List<String> points) {
        return getDataForPointsAsync(format, points).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long
     * coordinate format.
     *
     * <p>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 POST Data For Points.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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. 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ElevationResult> getDataForPointsWithResponse(
            JsonFormat format, List<String> points, Context context) {
        return getDataForPointsWithResponseAsync(format, points, context).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat
     * coordinate format.
     *
     * <p>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 GET Data For Points API.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> postDataForPointsWithResponseAsync(
            JsonFormat format, List<LatLongPairAbbreviated> points) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.postDataForPoints(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                points,
                                accept,
                                context));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat
     * coordinate format.
     *
     * <p>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 GET Data For Points API.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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 context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> postDataForPointsWithResponseAsync(
            JsonFormat format, List<LatLongPairAbbreviated> points, Context context) {
        final String accept = "application/json";
        return service.postDataForPoints(
                this.client.getHost(),
                this.client.getClientId(),
                this.client.getApiVersion(),
                format,
                points,
                accept,
                context);
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat
     * coordinate format.
     *
     * <p>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 GET Data For Points API.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> postDataForPointsAsync(JsonFormat format, List<LatLongPairAbbreviated> points) {
        return postDataForPointsWithResponseAsync(format, points).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat
     * coordinate format.
     *
     * <p>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 GET Data For Points API.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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 context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> postDataForPointsAsync(
            JsonFormat format, List<LatLongPairAbbreviated> points, Context context) {
        return postDataForPointsWithResponseAsync(format, points, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat
     * coordinate format.
     *
     * <p>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 GET Data For Points API.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ElevationResult postDataForPoints(JsonFormat format, List<LatLongPairAbbreviated> points) {
        return postDataForPointsAsync(format, points).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Points API provides elevation data for multiple points. A point is defined lon/lat
     * coordinate format.
     *
     * <p>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 GET Data For Points API.
     *
     * <p>The result will be in the same sequence of points listed in the request.
     *
     * @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 context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ElevationResult> postDataForPointsWithResponse(
            JsonFormat format, List<LatLongPairAbbreviated> points, Context context) {
        return postDataForPointsWithResponseAsync(format, points, context).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param lines 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]`.
     *     <p>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.
     * @param samples The 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> getDataForPolylineWithResponseAsync(
            JsonFormat format, List<String> lines, Integer samples) {
        final String accept = "application/json";
        String linesConverted =
                JacksonAdapter.createDefaultSerializerAdapter().serializeList(lines, CollectionFormat.PIPES);
        return FluxUtil.withContext(
                context ->
                        service.getDataForPolyline(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                linesConverted,
                                samples,
                                accept,
                                context));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param lines 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]`.
     *     <p>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.
     * @param samples The 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> getDataForPolylineWithResponseAsync(
            JsonFormat format, List<String> lines, Integer samples, Context context) {
        final String accept = "application/json";
        String linesConverted =
                JacksonAdapter.createDefaultSerializerAdapter().serializeList(lines, CollectionFormat.PIPES);
        return service.getDataForPolyline(
                this.client.getHost(),
                this.client.getClientId(),
                this.client.getApiVersion(),
                format,
                linesConverted,
                samples,
                accept,
                context);
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param lines 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]`.
     *     <p>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.
     * @param samples The 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> getDataForPolylineAsync(JsonFormat format, List<String> lines, Integer samples) {
        return getDataForPolylineWithResponseAsync(format, lines, samples)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param lines 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]`.
     *     <p>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.
     * @param samples The 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> getDataForPolylineAsync(
            JsonFormat format, List<String> lines, Integer samples, Context context) {
        return getDataForPolylineWithResponseAsync(format, lines, samples, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param lines 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]`.
     *     <p>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.
     * @param samples The 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ElevationResult getDataForPolyline(JsonFormat format, List<String> lines, Integer samples) {
        return getDataForPolylineAsync(format, lines, samples).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Get Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param lines 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]`.
     *     <p>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.
     * @param samples The 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ElevationResult> getDataForPolylineWithResponse(
            JsonFormat format, List<String> lines, Integer samples, Context context) {
        return getDataForPolylineWithResponseAsync(format, lines, samples, context).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @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 samples The 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> postDataForPolylineWithResponseAsync(
            JsonFormat format, List<LatLongPairAbbreviated> polyline, Integer samples) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.postDataForPolyline(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                samples,
                                polyline,
                                accept,
                                context));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @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 samples The 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> postDataForPolylineWithResponseAsync(
            JsonFormat format, List<LatLongPairAbbreviated> polyline, Integer samples, Context context) {
        final String accept = "application/json";
        return service.postDataForPolyline(
                this.client.getHost(),
                this.client.getClientId(),
                this.client.getApiVersion(),
                format,
                samples,
                polyline,
                accept,
                context);
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @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 samples The 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> postDataForPolylineAsync(
            JsonFormat format, List<LatLongPairAbbreviated> polyline, Integer samples) {
        return postDataForPolylineWithResponseAsync(format, polyline, samples)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @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 samples The 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> postDataForPolylineAsync(
            JsonFormat format, List<LatLongPairAbbreviated> polyline, Integer samples, Context context) {
        return postDataForPolylineWithResponseAsync(format, polyline, samples, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @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 samples The 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ElevationResult postDataForPolyline(
            JsonFormat format, List<LatLongPairAbbreviated> polyline, Integer samples) {
        return postDataForPolylineAsync(format, polyline, samples).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>The Post Data for Polyline API provides elevation data along a polyline.
     *
     * <p>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.
     *
     * <p>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.
     *
     * @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 samples The 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ElevationResult> postDataForPolylineWithResponse(
            JsonFormat format, List<LatLongPairAbbreviated> polyline, Integer samples, Context context) {
        return postDataForPolylineWithResponseAsync(format, polyline, samples, context).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param bounds The 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]`.
     * @param rows Specifies 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.
     * @param columns Specifies 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> getDataForBoundingBoxWithResponseAsync(
            JsonFormat format, List<Double> bounds, int rows, int columns) {
        final String accept = "application/json";
        String boundsConverted =
                JacksonAdapter.createDefaultSerializerAdapter().serializeList(bounds, CollectionFormat.CSV);
        return FluxUtil.withContext(
                context ->
                        service.getDataForBoundingBox(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                boundsConverted,
                                rows,
                                columns,
                                accept,
                                context));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param bounds The 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]`.
     * @param rows Specifies 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.
     * @param columns Specifies 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @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<Response<ElevationResult>> getDataForBoundingBoxWithResponseAsync(
            JsonFormat format, List<Double> bounds, int rows, int columns, Context context) {
        final String accept = "application/json";
        String boundsConverted =
                JacksonAdapter.createDefaultSerializerAdapter().serializeList(bounds, CollectionFormat.CSV);
        return service.getDataForBoundingBox(
                this.client.getHost(),
                this.client.getClientId(),
                this.client.getApiVersion(),
                format,
                boundsConverted,
                rows,
                columns,
                accept,
                context);
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param bounds The 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]`.
     * @param rows Specifies 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.
     * @param columns Specifies 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> getDataForBoundingBoxAsync(
            JsonFormat format, List<Double> bounds, int rows, int columns) {
        return getDataForBoundingBoxWithResponseAsync(format, bounds, rows, columns)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param bounds The 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]`.
     * @param rows Specifies 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.
     * @param columns Specifies 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ElevationResult> getDataForBoundingBoxAsync(
            JsonFormat format, List<Double> bounds, int rows, int columns, Context context) {
        return getDataForBoundingBoxWithResponseAsync(format, bounds, rows, columns, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param bounds The 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]`.
     * @param rows Specifies 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.
     * @param columns Specifies 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.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ElevationResult getDataForBoundingBox(JsonFormat format, List<Double> bounds, int rows, int columns) {
        return getDataForBoundingBoxAsync(format, bounds, rows, columns).block();
    }

    /**
     * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>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.
     *
     * <p>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.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param bounds The 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]`.
     * @param rows Specifies 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.
     * @param columns Specifies 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.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response from a successful Get Data for Bounding Box API along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ElevationResult> getDataForBoundingBoxWithResponse(
            JsonFormat format, List<Double> bounds, int rows, int columns, Context context) {
        return getDataForBoundingBoxWithResponseAsync(format, bounds, rows, columns, context).block();
    }
}
