getJourneyExecutionActivityMetrics method

Future<GetJourneyExecutionActivityMetricsResponse> getJourneyExecutionActivityMetrics({
  1. required String applicationId,
  2. required String journeyActivityId,
  3. required String journeyId,
  4. String? nextToken,
  5. String? pageSize,
})

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

May throw BadRequestException. May throw InternalServerErrorException. May throw PayloadTooLargeException. May throw ForbiddenException. May throw NotFoundException. May throw MethodNotAllowedException. 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 journeyActivityId : The unique identifier for the journey activity.

Parameter journeyId : The unique identifier for the journey.

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<GetJourneyExecutionActivityMetricsResponse>
    getJourneyExecutionActivityMetrics({
  required String applicationId,
  required String journeyActivityId,
  required String journeyId,
  String? nextToken,
  String? pageSize,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  ArgumentError.checkNotNull(journeyActivityId, 'journeyActivityId');
  ArgumentError.checkNotNull(journeyId, 'journeyId');
  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)}/activities/${Uri.encodeComponent(journeyActivityId)}/execution-metrics',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return GetJourneyExecutionActivityMetricsResponse(
    journeyExecutionActivityMetricsResponse:
        JourneyExecutionActivityMetricsResponse.fromJson($json),
  );
}