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

package com.azure.resourcemanager.reservations.models;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Resource collection API of ReservationOrders. */
public interface ReservationOrders {
    /**
     * Calculate price for a `ReservationOrder`.
     *
     * <p>Calculate price for placing a `ReservationOrder`.
     *
     * @param body Information needed for calculate or purchase reservation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException 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 of calculate price for reservation along with {@link Response}.
     */
    Response<CalculatePriceResponse> calculateWithResponse(PurchaseRequest body, Context context);

    /**
     * Calculate price for a `ReservationOrder`.
     *
     * <p>Calculate price for placing a `ReservationOrder`.
     *
     * @param body Information needed for calculate or purchase reservation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException 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 of calculate price for reservation.
     */
    CalculatePriceResponse calculate(PurchaseRequest body);

    /**
     * Get all `ReservationOrder`s.
     *
     * <p>List of all the `ReservationOrder`s that the user has access to in the current tenant.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of `ReservationOrder`s as paginated response with {@link PagedIterable}.
     */
    PagedIterable<ReservationOrderResponse> list();

    /**
     * Get all `ReservationOrder`s.
     *
     * <p>List of all the `ReservationOrder`s that the user has access to in the current tenant.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of `ReservationOrder`s as paginated response with {@link PagedIterable}.
     */
    PagedIterable<ReservationOrderResponse> list(Context context);

    /**
     * Purchase `ReservationOrder`
     *
     * <p>Purchase `ReservationOrder` and create resource under the specified URI.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param body Information needed for calculate or purchase reservation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return details of a reservation order being returned.
     */
    ReservationOrderResponse purchase(String reservationOrderId, PurchaseRequest body);

    /**
     * Purchase `ReservationOrder`
     *
     * <p>Purchase `ReservationOrder` and create resource under the specified URI.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param body Information needed for calculate or purchase reservation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return details of a reservation order being returned.
     */
    ReservationOrderResponse purchase(String reservationOrderId, PurchaseRequest body, Context context);

    /**
     * Get a specific `ReservationOrder`.
     *
     * <p>Get the details of the `ReservationOrder`.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param expand May be used to expand the planInformation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the details of the `ReservationOrder` along with {@link Response}.
     */
    Response<ReservationOrderResponse> getWithResponse(String reservationOrderId, String expand, Context context);

    /**
     * Get a specific `ReservationOrder`.
     *
     * <p>Get the details of the `ReservationOrder`.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the details of the `ReservationOrder`.
     */
    ReservationOrderResponse get(String reservationOrderId);

    /**
     * Change directory of `ReservationOrder`.
     *
     * <p>Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param body Information needed to change directory of reservation order.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return change directory response along with {@link Response}.
     */
    Response<ChangeDirectoryResponse> changeDirectoryWithResponse(
        String reservationOrderId, ChangeDirectoryRequest body, Context context);

    /**
     * Change directory of `ReservationOrder`.
     *
     * <p>Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param body Information needed to change directory of reservation order.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return change directory response.
     */
    ChangeDirectoryResponse changeDirectory(String reservationOrderId, ChangeDirectoryRequest body);
}
