getPlanResolveById method

Future<PlanResolution?> getPlanResolveById(
  1. String id
)

Resolves one plan to everything a consumer of the catalog needs at once: its canonical entitlement block, the flat license-feature list a signed license carries, its billing reference, and the catalog it came from.

Resolves one plan to everything a consumer of the catalog needs at once: its canonical entitlement block, the flat license-feature list a signed license carries, its billing reference, and the catalog it came from. The id may be the plan's id or its slug, and it is resolved against the caller's catalog, so a reseller's override wins over the canonical record. An id no catalog holds answers 404.

Parameters:

  • String id (required): ID is the plan's catalog id or slug — "pro", "team", "world-enterprise", "rpc-growth". Both are matched, so a slug resolves the plan it names.

Implementation

Future<PlanResolution?> getPlanResolveById(String id,) async {
  final response = await getPlanResolveByIdWithHttpInfo(id,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PlanResolution',) as PlanResolution;

  }
  return null;
}