getJourneyRunExecutionMetrics method

Future<GetJourneyRunExecutionMetricsResponse> getJourneyRunExecutionMetrics({
  1. required String applicationId,
  2. required String journeyId,
  3. required String runId,
  4. String? nextToken,
  5. String? pageSize,
})

Retrieves (queries) pre-aggregated data for a standard run execution metric that applies to a journey.

May throw BadRequestException. May throw ForbiddenException. May throw InternalServerErrorException. May throw MethodNotAllowedException. May throw NotFoundException. May throw PayloadTooLargeException. May throw TooManyRequestsException.

Parameter applicationId : The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.

Parameter journeyId : The unique identifier for the journey.

Parameter runId : The unique identifier for the journey run.

Parameter nextToken : The string that specifies which page of results to return in a paginated response. This parameter is not supported for application, campaign, and journey metrics.

Parameter pageSize : The maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics.

Implementation

Future<GetJourneyRunExecutionMetricsResponse> getJourneyRunExecutionMetrics({
  required String applicationId,
  required String journeyId,
  required String runId,
  String? nextToken,
  String? pageSize,
}) async {
  final $query = <String, List<String>>{
    if (nextToken != null) 'next-token': [nextToken],
    if (pageSize != null) 'page-size': [pageSize],
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'GET',
    requestUri:
        '/v1/apps/${Uri.encodeComponent(applicationId)}/journeys/${Uri.encodeComponent(journeyId)}/runs/${Uri.encodeComponent(runId)}/execution-metrics',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return GetJourneyRunExecutionMetricsResponse(
    journeyRunExecutionMetricsResponse:
        JourneyRunExecutionMetricsResponse.fromJson($json),
  );
}