getUsagePlanKeys method

Future<UsagePlanKeys> getUsagePlanKeys({
  1. required String usagePlanId,
  2. int? limit,
  3. String? nameQuery,
  4. String? position,
})

Gets all the usage plan keys representing the API keys added to a specified usage plan.

May throw BadRequestException. May throw UnauthorizedException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter usagePlanId : Required The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.

Parameter limit : The maximum number of returned results per page. The default value is 25 and the maximum value is 500.

Parameter nameQuery : A query parameter specifying the name of the to-be-returned usage plan keys.

Parameter position : The current pagination position in the paged result set.

Implementation

Future<UsagePlanKeys> getUsagePlanKeys({
  required String usagePlanId,
  int? limit,
  String? nameQuery,
  String? position,
}) async {
  ArgumentError.checkNotNull(usagePlanId, 'usagePlanId');
  final $query = <String, List<String>>{
    if (limit != null) 'limit': [limit.toString()],
    if (nameQuery != null) 'name': [nameQuery],
    if (position != null) 'position': [position],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/usageplans/${Uri.encodeComponent(usagePlanId)}/keys',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return UsagePlanKeys.fromJson(response);
}