getGuideProfile method

Future<ProfileResponse?> getGuideProfile()

Profile returns the caller org's OBSERVED growth profile — the signal set, the classified growth stage, and the org's own key metrics.

Profile returns the caller org's OBSERVED growth profile — the signal set, the classified growth stage, and the org's own key metrics. It is a pure READ, recomputed from the org's CURRENT state each request (real-time by pull): it reuses the reconcile path (snapshotFor runs the detectors) for launch progress and runs the growth probes (observe) for the signals — it never caches, never runs a billable effect, never targets another org. Org-scoped on the validated principal; fail-closed without one. It PRODUCES the profile and classifies the stage; it decides NO recommendation (that is a later surface).

Implementation

Future<ProfileResponse?> getGuideProfile() async {
  final response = await getGuideProfileWithHttpInfo();
  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), 'ProfileResponse',) as ProfileResponse;

  }
  return null;
}