getSegmentVersions method

Future<GetSegmentVersionsResponse> getSegmentVersions({
  1. required String applicationId,
  2. required String segmentId,
  3. String? pageSize,
  4. String? token,
})

Retrieves information about the configuration, dimension, and other settings for all the versions of a specific segment that's associated with an application.

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 segmentId : The unique identifier for the segment.

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.

Parameter token : The NextToken string that specifies which page of results to return in a paginated response.

Implementation

Future<GetSegmentVersionsResponse> getSegmentVersions({
  required String applicationId,
  required String segmentId,
  String? pageSize,
  String? token,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  ArgumentError.checkNotNull(segmentId, 'segmentId');
  final $query = <String, List<String>>{
    if (pageSize != null) 'page-size': [pageSize],
    if (token != null) 'token': [token],
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'GET',
    requestUri:
        '/v1/apps/${Uri.encodeComponent(applicationId)}/segments/${Uri.encodeComponent(segmentId)}/versions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return GetSegmentVersionsResponse(
    segmentsResponse: SegmentsResponse.fromJson($json),
  );
}