deleteSession method

Future<DeleteSessionResponse> deleteSession({
  1. required String botAlias,
  2. required String botName,
  3. required String userId,
})

Removes session information for a specified bot, alias, and user ID.

May throw NotFoundException. May throw BadRequestException. May throw LimitExceededException. May throw InternalFailureException. May throw ConflictException.

Parameter botAlias : The alias in use for the bot that contains the session data.

Parameter botName : The name of the bot that contains the session data.

Parameter userId : The identifier of the user associated with the session data.

Implementation

Future<DeleteSessionResponse> deleteSession({
  required String botAlias,
  required String botName,
  required String userId,
}) async {
  ArgumentError.checkNotNull(botAlias, 'botAlias');
  ArgumentError.checkNotNull(botName, 'botName');
  ArgumentError.checkNotNull(userId, 'userId');
  _s.validateStringLength(
    'userId',
    userId,
    2,
    100,
    isRequired: true,
  );
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/bot/${Uri.encodeComponent(botName)}/alias/${Uri.encodeComponent(botAlias)}/user/${Uri.encodeComponent(userId)}/session',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteSessionResponse.fromJson(response);
}