readSubscription static method

Future<SubscriptionInfo?> readSubscription(
  1. Client cloudApiClient, {
  2. required String projectId,
})

Reads the subscription the project is billed under, or null if the project has no subscription.

Implementation

static Future<SubscriptionInfo?> readSubscription(
  Client cloudApiClient, {
  required String projectId,
}) async {
  try {
    return await cloudApiClient.plans.getSubscriptionInfoOfProject(
      cloudProjectId: projectId,
    );
  } on NotFoundException {
    return null;
  } on Exception catch (e, s) {
    throw FailureException.nested(
      e,
      s,
      "Request to fetch the project's plan failed",
    );
  }
}