/// <summary> Deletes a message. </summary> /// <param name="messageId"> The message id. </param> /// <param name="cancellationToken"> The cancellation token to use. </param> /// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception> public virtual Response DeleteMessage(string messageId, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ChatThreadClient)}.{nameof(DeleteMessage)}"); scope.Start(); try { return(_chatThreadRestClient.DeleteChatMessage(Id, messageId, cancellationToken)); } catch (Exception ex) { scope.Failed(ex); throw; } }