updateBot method
Updates the properties of an existing bot in a Wickr network. This operation allows you to modify the bot's display name, security group, password, or suspension status.
May throw BadRequestError.
May throw ForbiddenError.
May throw InternalServerError.
May throw RateLimitError.
May throw ResourceNotFoundError.
May throw UnauthorizedError.
May throw ValidationError.
Parameter botId :
The unique identifier of the bot to update.
Parameter networkId :
The ID of the Wickr network containing the bot to update.
Parameter challenge :
The new password for the bot account.
Parameter displayName :
The new display name for the bot.
Parameter groupId :
The ID of the new security group to assign the bot to.
Parameter suspend :
Set to true to suspend the bot or false to unsuspend it. Omit this field
for standard updates that don't affect suspension status.
Implementation
Future<UpdateBotResponse> updateBot({
required String botId,
required String networkId,
String? challenge,
String? displayName,
String? groupId,
bool? suspend,
}) async {
final $payload = <String, dynamic>{
if (challenge != null) 'challenge': challenge,
if (displayName != null) 'displayName': displayName,
if (groupId != null) 'groupId': groupId,
if (suspend != null) 'suspend': suspend,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/networks/${Uri.encodeComponent(networkId)}/bots/${Uri.encodeComponent(botId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateBotResponse.fromJson(response);
}