using Bit.Core.Entities;
using Bit.Core.Exceptions;
using Stripe;
namespace Bit.Core.Billing.Queries;
public interface ISubscriberQueries
{
///
/// Retrieves a Stripe using the 's property.
///
/// The organization, provider or user to retrieve the customer for.
/// Optional parameters that can be passed to Stripe to expand or modify the .
/// A Stripe .
/// Thrown when the is .
/// This method opts for returning rather than throwing exceptions, making it ideal for surfacing data from API endpoints.
Task GetCustomer(
ISubscriber subscriber,
CustomerGetOptions customerGetOptions = null);
///
/// Retrieves a Stripe using the 's property.
///
/// The organization, provider or user to retrieve the subscription for.
/// Optional parameters that can be passed to Stripe to expand or modify the .
/// A Stripe .
/// Thrown when the is .
/// This method opts for returning rather than throwing exceptions, making it ideal for surfacing data from API endpoints.
Task GetSubscription(
ISubscriber subscriber,
SubscriptionGetOptions subscriptionGetOptions = null);
///
/// Retrieves a Stripe using the 's property.
///
/// The organization or user to retrieve the subscription for.
/// Optional parameters that can be passed to Stripe to expand or modify the .
/// A Stripe .
/// Thrown when the is .
/// Thrown when the subscriber's is or empty.
/// Thrown when the returned from Stripe's API is null.
Task GetCustomerOrThrow(
ISubscriber subscriber,
CustomerGetOptions customerGetOptions = null);
///
/// Retrieves a Stripe using the 's property.
///
/// The organization or user to retrieve the subscription for.
/// Optional parameters that can be passed to Stripe to expand or modify the .
/// A Stripe .
/// Thrown when the is .
/// Thrown when the subscriber's is or empty.
/// Thrown when the returned from Stripe's API is null.
Task GetSubscriptionOrThrow(
ISubscriber subscriber,
SubscriptionGetOptions subscriptionGetOptions = null);
}