getUsagePlans method

Future<UsagePlans> getUsagePlans({
  1. String? keyId,
  2. int? limit,
  3. String? position,
})

Gets all the usage plans of the caller's account.

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

Parameter keyId : The identifier of the API key associated with the usage plans.

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

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

Implementation

Future<UsagePlans> getUsagePlans({
  String? keyId,
  int? limit,
  String? position,
}) async {
  final $query = <String, List<String>>{
    if (keyId != null) 'keyId': [keyId],
    if (limit != null) 'limit': [limit.toString()],
    if (position != null) 'position': [position],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/usageplans',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return UsagePlans.fromJson(response);
}