getPlatformEnvironments method

Future<EnvironmentBoard?> getPlatformEnvironments()

Returns your deploy targets, and what is running on each.

Returns your deploy targets, and what is running on each. It returns the org's environments — the distinct deploy targets its applications name, production for anything that names none — each aggregating the apps that target it, a rolled-up status and when it last changed. An environment is DERIVED, not stored: there is nothing to create or delete here, and an environment exists exactly as long as an app points at it. Requires a validated principal; 403 without one.

Implementation

Future<EnvironmentBoard?> getPlatformEnvironments() async {
  final response = await getPlatformEnvironmentsWithHttpInfo();
  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), 'EnvironmentBoard',) as EnvironmentBoard;

  }
  return null;
}