updateModel method

Future<Model> updateModel({
  1. required String modelName,
  2. required String restApiId,
  3. List<PatchOperation>? patchOperations,
})

Changes information about a model.

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

Parameter modelName : Required The name of the model to update.

Parameter restApiId : Required The string identifier of the associated RestApi.

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

Implementation

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