updateModel method
Updates a Model.
May throw NotFoundException. May throw TooManyRequestsException. May throw BadRequestException. May throw ConflictException.
Parameter apiId
:
The API identifier.
Parameter modelId
:
The model ID.
Parameter contentType
:
The content-type for the model, for example, "application/json".
Parameter description
:
The description of the model.
Parameter name
:
The name of the model.
Parameter schema
:
The schema for the model. For application/json models, this should be JSON
schema draft 4 model.
Implementation
Future<UpdateModelResponse> updateModel({
required String apiId,
required String modelId,
String? contentType,
String? description,
String? name,
String? schema,
}) async {
ArgumentError.checkNotNull(apiId, 'apiId');
ArgumentError.checkNotNull(modelId, 'modelId');
final $payload = <String, dynamic>{
if (contentType != null) 'contentType': contentType,
if (description != null) 'description': description,
if (name != null) 'name': name,
if (schema != null) 'schema': schema,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/v2/apis/${Uri.encodeComponent(apiId)}/models/${Uri.encodeComponent(modelId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateModelResponse.fromJson(response);
}