// 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.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.models.GeoPosition;
import com.azure.maps.elevation.implementation.models.Elevation;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;

/** The response from a successful Get Data for Bounding Box API. */
@Immutable
public final class ElevationResult {
    /*
     * The response for point/points elevation API. The result will be in same
     * sequence of points listed in request.
     */
    @JsonProperty(value = "data", access = JsonProperty.Access.WRITE_ONLY)
    private List<Elevation> elevations;

    /** Set default ElevationResult constructor to private */
    private ElevationResult() {}

    /**
     * Get the elevations property: The response for point/points elevation API. The result will be in same sequence of
     * points listed in request.
     *
     * @return the elevations value
     */
    public List<GeoPosition> getElevations() {
        List<GeoPosition> toreturn = new ArrayList<>();
        for (Elevation e : this.elevations) {
            toreturn.add(
                    new GeoPosition(
                            e.getCoordinate().getLatitude(),
                            e.getCoordinate().getLongitude(),
                            (double) e.getElevationInMeters()));
        }
        return toreturn;
    }
}
