// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.maps.route.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.models.ResponseError;
import com.azure.maps.route.implementation.models.RouteDirectionsBatchItemResponse;
import com.fasterxml.jackson.annotation.JsonProperty;

/** An item returned from Route Directions Batch service call. */
@Immutable
public final class RouteDirectionsBatchItem extends BatchResultItem {
    /*
     * The result of the query. RouteDirections if the query completed
     * successfully, ErrorResponse otherwise.
     */
    @JsonProperty(value = "response", access = JsonProperty.Access.WRITE_ONLY)
    private RouteDirectionsBatchItemResponse response;

    /**
     * Returns the {@link ResponseError} in case of an error response.
     *
     * @return the error detail as a {@code ResponseError}
     */
    public ResponseError getError() {
        return this.response.getError();
    }

    /**
     * Returns the {@link RouteDirections} associated with the response.
     *
     * @return the route directions as a {@code RouteDirections}
     */
    public RouteDirections getRouteDirections() {
        return (RouteDirections) this.response;
    }
}
