deleteBotAlias method
Deletes an alias for the specified bot.
You can't delete an alias that is used in the association between a bot
and a messaging channel. If an alias is used in a channel association, the
DeleteBot
operation returns a
ResourceInUseException
exception that includes a reference to
the channel association that refers to the bot. You can remove the
reference to the alias by deleting the channel association. If you get the
same exception again, delete the referring association until the
DeleteBotAlias
operation is successful.
May throw NotFoundException. May throw ConflictException. May throw LimitExceededException. May throw InternalFailureException. May throw BadRequestException. May throw ResourceInUseException.
Parameter botName
:
The name of the bot that the alias points to.
Parameter name
:
The name of the alias to delete. The name is case sensitive.
Implementation
Future<void> deleteBotAlias({
required String botName,
required String name,
}) async {
ArgumentError.checkNotNull(botName, 'botName');
_s.validateStringLength(
'botName',
botName,
2,
50,
isRequired: true,
);
ArgumentError.checkNotNull(name, 'name');
_s.validateStringLength(
'name',
name,
1,
100,
isRequired: true,
);
await _protocol.send(
payload: null,
method: 'DELETE',
requestUri:
'/bots/${Uri.encodeComponent(botName)}/aliases/${Uri.encodeComponent(name)}',
exceptionFnMap: _exceptionFns,
);
}