updateSchema method
Updates the schema definition
May throw BadRequestException. May throw InternalServerErrorException. May throw ForbiddenException. May throw NotFoundException. May throw ServiceUnavailableException.
Parameter registryName
:
The name of the registry.
Parameter schemaName
:
The name of the schema.
Parameter clientTokenId
:
The ID of the client token.
Parameter content
:
The source of the schema definition.
Parameter description
:
The description of the schema.
Parameter type
:
The schema type for the events schema.
Implementation
Future<UpdateSchemaResponse> updateSchema({
required String registryName,
required String schemaName,
String? clientTokenId,
String? content,
String? description,
Type? type,
}) async {
ArgumentError.checkNotNull(registryName, 'registryName');
ArgumentError.checkNotNull(schemaName, 'schemaName');
_s.validateStringLength(
'clientTokenId',
clientTokenId,
0,
36,
);
_s.validateStringLength(
'content',
content,
1,
100000,
);
_s.validateStringLength(
'description',
description,
0,
256,
);
final $payload = <String, dynamic>{
'ClientTokenId': clientTokenId ?? _s.generateIdempotencyToken(),
if (content != null) 'Content': content,
if (description != null) 'Description': description,
if (type != null) 'Type': type.toValue(),
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/v1/registries/name/${Uri.encodeComponent(registryName)}/schemas/name/${Uri.encodeComponent(schemaName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateSchemaResponse.fromJson(response);
}