// 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;
import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner;

/** Resource collection API of BillingSubscriptions. */
public interface BillingSubscriptions {
    /**
     * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type
     * Microsoft Partner Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param customerName The ID that uniquely identifies a customer.
     * @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 billing subscriptions as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingSubscription> listByCustomer(String billingAccountName, String customerName);

    /**
     * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type
     * Microsoft Partner Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param customerName The ID that uniquely identifies a customer.
     * @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 billing subscriptions as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingSubscription> listByCustomer(String billingAccountName, String customerName, Context context);

    /**
     * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement
     * type Microsoft Customer Agreement or Microsoft Partner Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @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 billing subscriptions as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingSubscription> listByBillingAccount(String billingAccountName);

    /**
     * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement
     * type Microsoft Customer Agreement or Microsoft Partner Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @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 billing subscriptions as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingSubscription> listByBillingAccount(String billingAccountName, Context context);

    /**
     * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts
     * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param billingProfileName The ID that uniquely identifies a billing profile.
     * @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 billing subscriptions as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingSubscription> listByBillingProfile(String billingAccountName, String billingProfileName);

    /**
     * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts
     * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param billingProfileName The ID that uniquely identifies a billing profile.
     * @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 billing subscriptions as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingSubscription> listByBillingProfile(
        String billingAccountName, String billingProfileName, Context context);

    /**
     * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing
     * accounts with agreement type Microsoft Customer Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param billingProfileName The ID that uniquely identifies a billing profile.
     * @param invoiceSectionName The ID that uniquely identifies an invoice section.
     * @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 billing subscriptions as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingSubscription> listByInvoiceSection(
        String billingAccountName, String billingProfileName, String invoiceSectionName);

    /**
     * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing
     * accounts with agreement type Microsoft Customer Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param billingProfileName The ID that uniquely identifies a billing profile.
     * @param invoiceSectionName The ID that uniquely identifies an invoice section.
     * @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 billing subscriptions as paginated response with {@link PagedIterable}.
     */
    PagedIterable<BillingSubscription> listByInvoiceSection(
        String billingAccountName, String billingProfileName, String invoiceSectionName, Context context);

    /**
     * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft
     * Customer Agreement and Microsoft Partner Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @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 subscription by its ID along with {@link Response}.
     */
    Response<BillingSubscription> getWithResponse(String billingAccountName, Context context);

    /**
     * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft
     * Customer Agreement and Microsoft Partner Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @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 subscription by its ID.
     */
    BillingSubscription get(String billingAccountName);

    /**
     * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is
     * supported only for billing accounts with agreement type Microsoft Customer Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param parameters Request parameters that are provided to the update billing subscription operation.
     * @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 billing subscription along with {@link Response}.
     */
    Response<BillingSubscription> updateWithResponse(
        String billingAccountName, BillingSubscriptionInner parameters, Context context);

    /**
     * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is
     * supported only for billing accounts with agreement type Microsoft Customer Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param parameters Request parameters that are provided to the update billing subscription 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 billing subscription.
     */
    BillingSubscription update(String billingAccountName, BillingSubscriptionInner parameters);

    /**
     * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing
     * profile as the existing invoice section. This operation is supported for billing accounts with agreement type
     * Microsoft Customer Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param parameters Request parameters that are provided to the move subscription 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 billing subscription.
     */
    BillingSubscription move(String billingAccountName, TransferBillingSubscriptionRequestProperties parameters);

    /**
     * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing
     * profile as the existing invoice section. This operation is supported for billing accounts with agreement type
     * Microsoft Customer Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param parameters Request parameters that are provided to the move subscription operation.
     * @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 billing subscription.
     */
    BillingSubscription move(
        String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context);

    /**
     * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for
     * billing accounts with agreement type Microsoft Customer Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param parameters Request parameters that are provided to the validate move eligibility operation.
     * @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 the transfer eligibility validation along with {@link Response}.
     */
    Response<ValidateSubscriptionTransferEligibilityResult> validateMoveWithResponse(
        String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context);

    /**
     * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for
     * billing accounts with agreement type Microsoft Customer Agreement.
     *
     * @param billingAccountName The ID that uniquely identifies a billing account.
     * @param parameters Request parameters that are provided to the validate move eligibility 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 the transfer eligibility validation.
     */
    ValidateSubscriptionTransferEligibilityResult validateMove(
        String billingAccountName, TransferBillingSubscriptionRequestProperties parameters);
}
