updateType method
Updates a Type object.
May throw BadRequestException.
May throw ConcurrentModificationException.
May throw InternalFailureException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter apiId :
The API ID.
Parameter format :
The new type format: SDL or JSON.
Parameter typeName :
The new type name.
Parameter definition :
The new definition.
Implementation
Future<UpdateTypeResponse> updateType({
required String apiId,
required TypeDefinitionFormat format,
required String typeName,
String? definition,
}) async {
final $payload = <String, dynamic>{
'format': format.value,
if (definition != null) 'definition': definition,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/v1/apis/${Uri.encodeComponent(apiId)}/types/${Uri.encodeComponent(typeName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateTypeResponse.fromJson(response);
}