updateChannelNamespace method
Updates a ChannelNamespace associated with an
Api.
May throw AccessDeniedException.
May throw BadRequestException.
May throw ConcurrentModificationException.
May throw InternalFailureException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter apiId :
The Api ID.
Parameter name :
The name of the ChannelNamespace.
Parameter codeHandlers :
The event handler functions that run custom business logic to process
published events and subscribe requests.
Parameter handlerConfigs :
The configuration for the OnPublish and
OnSubscribe handlers.
Parameter publishAuthModes :
The authorization mode to use for publishing messages on the channel
namespace. This configuration overrides the default Api
authorization configuration.
Parameter subscribeAuthModes :
The authorization mode to use for subscribing to messages on the channel
namespace. This configuration overrides the default Api
authorization configuration.
Implementation
Future<UpdateChannelNamespaceResponse> updateChannelNamespace({
required String apiId,
required String name,
String? codeHandlers,
HandlerConfigs? handlerConfigs,
List<AuthMode>? publishAuthModes,
List<AuthMode>? subscribeAuthModes,
}) async {
final $payload = <String, dynamic>{
if (codeHandlers != null) 'codeHandlers': codeHandlers,
if (handlerConfigs != null) 'handlerConfigs': handlerConfigs,
if (publishAuthModes != null) 'publishAuthModes': publishAuthModes,
if (subscribeAuthModes != null) 'subscribeAuthModes': subscribeAuthModes,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/v2/apis/${Uri.encodeComponent(apiId)}/channelNamespaces/${Uri.encodeComponent(name)}',
exceptionFnMap: _exceptionFns,
);
return UpdateChannelNamespaceResponse.fromJson(response);
}