getFeatureStates method

Future<List<Environment>> getFeatureStates(
  1. List<String> sdkUrl, {
  2. Options? options,
})

Requests all features for this sdkurl and disconnects

Implementation

Future<List<Environment>> getFeatureStates(List<String> sdkUrl,
    {Options? options}) async {
  final response = await apiDelegate.getFeatureStates(
    sdkUrl,
    options: options,
  );

  if (![200, 400].contains(response.statusCode)) {
    throw ApiException(500,
        'Invalid response code ${response.statusCode} returned from API');
  }

  final __body = response.body;
  if (response.statusCode >= 400) {
    throw ApiException(response.statusCode,
        __body == null ? null : await decodeBodyBytes(__body));
  }

  if (__body == null) {
    throw ApiException(500, 'Received an empty body (not in a 204)');
  }

  return await apiDelegate.getFeatureStates_decode(__body);
}