updateUsagePlan method

Future<UsagePlan> updateUsagePlan({
  1. required String usagePlanId,
  2. List<PatchOperation>? patchOperations,
})

Updates a usage plan of a given plan Id.

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

Parameter usagePlanId : Required The Id of the to-be-updated usage plan.

Parameter patchOperations : A list of update operations to be applied to the specified resource and in the order specified in this list.

Implementation

Future<UsagePlan> updateUsagePlan({
  required String usagePlanId,
  List<PatchOperation>? patchOperations,
}) async {
  ArgumentError.checkNotNull(usagePlanId, 'usagePlanId');
  final $payload = <String, dynamic>{
    if (patchOperations != null) 'patchOperations': patchOperations,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/usageplans/${Uri.encodeComponent(usagePlanId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UsagePlan.fromJson(response);
}