// Code generated by "gen"; DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package billing

import (
	"context"

	"github.com/clerk/clerk-sdk-go/v2"
)

// ListPlans returns a list of billing plans.
func ListPlans(ctx context.Context, params *ListPlansParams) (*clerk.PlanList, error) {
	return getClient().ListPlans(ctx, params)
}

// ListSubscriptionItems returns a list of subscription items.
func ListSubscriptionItems(ctx context.Context, params *ListSubscriptionItemsParams) (*clerk.SubscriptionItemList, error) {
	return getClient().ListSubscriptionItems(ctx, params)
}

// CancelSubscriptionItem cancels a subscription item.
func CancelSubscriptionItem(ctx context.Context, subscriptionItemID string, params *CancelSubscriptionItemParams) (*clerk.SubscriptionItem, error) {
	return getClient().CancelSubscriptionItem(ctx, subscriptionItemID, params)
}

// ExtendFreeTrial extends the free trial period of a subscription item.
func ExtendFreeTrial(ctx context.Context, subscriptionItemID string, params *ExtendFreeTrialParams) (*clerk.SubscriptionItem, error) {
	return getClient().ExtendFreeTrial(ctx, subscriptionItemID, params)
}

func getClient() *Client {
	return &Client{
		Backend: clerk.GetBackend(),
	}
}
