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

package com.azure.resourcemanager.billing.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 BillingPeriods. */
public interface BillingPeriods {
    /**
     * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for
     * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web
     * portal are not supported through this preview API.
     *
     * @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 result of listing billing periods as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingPeriod> list();

    /**
     * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for
     * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web
     * portal are not supported through this preview API.
     *
     * @param filter May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt',
     *     'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.
     * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response
     *     contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that
     *     specifies a starting point to use for subsequent calls.
     * @param top May be used to limit the number of results to the most recent N billing periods.
     * @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 result of listing billing periods as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingPeriod> list(String filter, String skiptoken, Integer top, Context context);

    /**
     * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types
     * which were not purchased directly through the Azure web portal are not supported through this preview API.
     *
     * @param billingPeriodName The name of a BillingPeriod resource.
     * @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 a named billing period along with {@link Response}.
     */
    Response<BillingPeriod> getWithResponse(String billingPeriodName, Context context);

    /**
     * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types
     * which were not purchased directly through the Azure web portal are not supported through this preview API.
     *
     * @param billingPeriodName The name of a BillingPeriod resource.
     * @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 a named billing period.
     */
    BillingPeriod get(String billingPeriodName);
}
