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

package com.azure.resourcemanager.billingbenefits.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 SavingsPlans. */
public interface SavingsPlans {
    /**
     * List savings plans in an order.
     *
     * @param savingsPlanOrderId Order ID of the savings plan.
     * @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 paginated response with {@link PagedIterable}.
     */
    PagedIterable<SavingsPlanModel> list(String savingsPlanOrderId);

    /**
     * List savings plans in an order.
     *
     * @param savingsPlanOrderId Order ID of the savings plan.
     * @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 paginated response with {@link PagedIterable}.
     */
    PagedIterable<SavingsPlanModel> list(String savingsPlanOrderId, Context context);

    /**
     * List savings plans.
     *
     * @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 paginated response with {@link PagedIterable}.
     */
    PagedIterable<SavingsPlanModel> listAll();

    /**
     * List savings plans.
     *
     * @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,
     *     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 savings plans group by
     *     provisioning states.
     * @param skiptoken The number of savings plans to skip from the list before returning results.
     * @param selectedState The selected provisioning state.
     * @param take To number of savings plans 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 paginated response with {@link PagedIterable}.
     */
    PagedIterable<SavingsPlanModel> listAll(
        String filter,
        String orderby,
        String refreshSummary,
        Float skiptoken,
        String selectedState,
        Float take,
        Context context);

    /**
     * Get savings plan.
     *
     * @param savingsPlanOrderId Order ID of the savings plan.
     * @param savingsPlanId ID of the savings plan.
     * @param expand May be used to expand the detail information of some properties.
     * @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 savings plan along with {@link Response}.
     */
    Response<SavingsPlanModel> getWithResponse(
        String savingsPlanOrderId, String savingsPlanId, String expand, Context context);

    /**
     * Get savings plan.
     *
     * @param savingsPlanOrderId Order ID of the savings plan.
     * @param savingsPlanId ID of the savings plan.
     * @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 savings plan.
     */
    SavingsPlanModel get(String savingsPlanOrderId, String savingsPlanId);

    /**
     * Update savings plan.
     *
     * @param savingsPlanOrderId Order ID of the savings plan.
     * @param savingsPlanId ID of the savings plan.
     * @param body Request body for patching a savings plan order alias.
     * @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 savings plan.
     */
    Response<SavingsPlanModel> updateWithResponse(
        String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body, Context context);

    /**
     * Update savings plan.
     *
     * @param savingsPlanOrderId Order ID of the savings plan.
     * @param savingsPlanId ID of the savings plan.
     * @param body Request body for patching a savings plan order alias.
     * @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 savings plan.
     */
    SavingsPlanModel update(String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateRequest body);

    /**
     * Validate savings plan patch.
     *
     * @param savingsPlanOrderId Order ID of the savings plan.
     * @param savingsPlanId ID of the savings plan.
     * @param body Request body for validating a savings plan patch request.
     * @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 body along with {@link Response}.
     */
    Response<SavingsPlanValidateResponse> validateUpdateWithResponse(
        String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateValidateRequest body, Context context);

    /**
     * Validate savings plan patch.
     *
     * @param savingsPlanOrderId Order ID of the savings plan.
     * @param savingsPlanId ID of the savings plan.
     * @param body Request body for validating a savings plan patch request.
     * @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.
     */
    SavingsPlanValidateResponse validateUpdate(
        String savingsPlanOrderId, String savingsPlanId, SavingsPlanUpdateValidateRequest body);
}
