// 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;
import java.util.List;

/** Resource collection API of Reservations. */
public interface Reservations {
    /**
     * Get Available Scopes for `Reservation`.
     *
     * <p>Check whether the scopes from request is valid for `Reservation`.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @param body Scopes to be checked for eligibility.
     * @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 available scope api containing scopes and their eligibilities.
     */
    AvailableScopeProperties availableScopes(
        String reservationOrderId, String reservationId, AvailableScopeRequest body);

    /**
     * Get Available Scopes for `Reservation`.
     *
     * <p>Check whether the scopes from request is valid for `Reservation`.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @param body Scopes to be checked for eligibility.
     * @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 available scope api containing scopes and their eligibilities.
     */
    AvailableScopeProperties availableScopes(
        String reservationOrderId, String reservationId, AvailableScopeRequest body, Context context);

    /**
     * Split the `Reservation`.
     *
     * <p>Split a `Reservation` into two `Reservation`s with specified quantity distribution.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param body Information needed to Split a reservation item.
     * @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 array of ReservationResponse.
     */
    List<ReservationResponse> split(String reservationOrderId, SplitRequest body);

    /**
     * Split the `Reservation`.
     *
     * <p>Split a `Reservation` into two `Reservation`s with specified quantity distribution.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param body Information needed to Split a reservation item.
     * @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 array of ReservationResponse.
     */
    List<ReservationResponse> split(String reservationOrderId, SplitRequest body, Context context);

    /**
     * Merges two `Reservation`s.
     *
     * <p>Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have
     * same properties.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param body Information needed for commercial request for a 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 array of ReservationResponse.
     */
    List<ReservationResponse> merge(String reservationOrderId, MergeRequest body);

    /**
     * Merges two `Reservation`s.
     *
     * <p>Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have
     * same properties.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param body Information needed for commercial request for a 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 array of ReservationResponse.
     */
    List<ReservationResponse> merge(String reservationOrderId, MergeRequest body, Context context);

    /**
     * Get `Reservation`s in a given reservation Order
     *
     * <p>List `Reservation`s within a single `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 list of `Reservation`s as paginated response with {@link PagedIterable}.
     */
    PagedIterable<ReservationResponse> list(String reservationOrderId);

    /**
     * Get `Reservation`s in a given reservation Order
     *
     * <p>List `Reservation`s within a single `ReservationOrder`.
     *
     * @param reservationOrderId Order Id of the 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 list of `Reservation`s as paginated response with {@link PagedIterable}.
     */
    PagedIterable<ReservationResponse> list(String reservationOrderId, Context context);

    /**
     * Get `Reservation` details.
     *
     * <p>Get specific `Reservation` details.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @param expand Supported value of this query is renewProperties.
     * @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 specific `Reservation` details along with {@link Response}.
     */
    Response<ReservationResponse> getWithResponse(
        String reservationOrderId, String reservationId, String expand, Context context);

    /**
     * Get `Reservation` details.
     *
     * <p>Get specific `Reservation` details.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @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 specific `Reservation` details.
     */
    ReservationResponse get(String reservationOrderId, String reservationId);

    /**
     * Updates a `Reservation`.
     *
     * <p>Updates the applied scopes of the `Reservation`.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @param parameters Information needed to patch a reservation item.
     * @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 definition of the reservation.
     */
    ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters);

    /**
     * Updates a `Reservation`.
     *
     * <p>Updates the applied scopes of the `Reservation`.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @param parameters Information needed to patch a reservation item.
     * @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 definition of the reservation.
     */
    ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters, Context context);

    /**
     * Archive a `Reservation`.
     *
     * <p>Archiving a `Reservation` moves it to `Archived` state.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @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 {@link Response}.
     */
    Response<Void> archiveWithResponse(String reservationOrderId, String reservationId, Context context);

    /**
     * Archive a `Reservation`.
     *
     * <p>Archiving a `Reservation` moves it to `Archived` state.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @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.
     */
    void archive(String reservationOrderId, String reservationId);

    /**
     * Unarchive a `Reservation`.
     *
     * <p>Restores a `Reservation` to the state it was before archiving.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @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 {@link Response}.
     */
    Response<Void> unarchiveWithResponse(String reservationOrderId, String reservationId, Context context);

    /**
     * Unarchive a `Reservation`.
     *
     * <p>Restores a `Reservation` to the state it was before archiving.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @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.
     */
    void unarchive(String reservationOrderId, String reservationId);

    /**
     * Get `Reservation` revisions.
     *
     * <p>List of all the revisions for the `Reservation`.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @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 `Reservation`s as paginated response with {@link PagedIterable}.
     */
    PagedIterable<ReservationResponse> listRevisions(String reservationOrderId, String reservationId);

    /**
     * Get `Reservation` revisions.
     *
     * <p>List of all the revisions for the `Reservation`.
     *
     * @param reservationOrderId Order Id of the reservation.
     * @param reservationId Id of the reservation item.
     * @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 `Reservation`s as paginated response with {@link PagedIterable}.
     */
    PagedIterable<ReservationResponse> listRevisions(String reservationOrderId, String reservationId, Context context);

    /**
     * List the reservations and the roll up counts of reservations group by provisioning states 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 the list of reservations and summary of roll out count of reservations in each state as paginated
     *     response with {@link PagedIterable}.
     */
    PagedIterable<ReservationResponse> listAll();

    /**
     * List the reservations and the roll up counts of reservations group by provisioning states that the user has
     * access to in the current tenant.
     *
     * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does
     *     not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name,
     *     properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate,
     *     expiryDateTime, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType,
     *     userFriendlyRenewState}.
     * @param orderby May be used to sort order by reservation properties.
     * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning
     *     states.
     * @param skiptoken The number of reservations to skip from the list before returning results.
     * @param selectedState The selected provisioning state.
     * @param take To number of reservations to return.
     * @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 list of reservations and summary of roll out count of reservations in each state as paginated
     *     response with {@link PagedIterable}.
     */
    PagedIterable<ReservationResponse> listAll(
        String filter,
        String orderby,
        String refreshSummary,
        Float skiptoken,
        String selectedState,
        Float take,
        Context context);
}
