public void Write(TfsTeamRoom room, string message)
        {
            var request = new RestRequest("/_apis/chat/rooms/{RoomId}/messages", Method.POST);

            request.AddUrlSegment("RoomId", room.Id.ToString());
            request.RequestFormat = DataFormat.Json;
            request.AddBody(new { content = message });
            Execute(request);
        }
        public void Leave(TfsTeamRoom room)
        {
            var userProfileClient = new TfsUserProfileRestClient(Config);
            var identity          = userProfileClient.GetIdentity();

            var request = new RestRequest("/_apis/chat/rooms/{RoomId}/users/{Identity}", Method.DELETE);

            request.AddUrlSegment("RoomId", room.Id.ToString());
            request.AddUrlSegment("Identity", identity.TeamFoundationId);
            request.RequestFormat = DataFormat.Json;
            Execute(request);
        }
        public IEnumerable <TfsTeamRoomMessage> Messages(TfsTeamRoom room, string filter = null)
        {
            var request = new RestRequest("/_apis/chat/rooms/{RoomId}/messages", Method.GET);

            request.AddUrlSegment("RoomId", room.Id.ToString());

            if (filter != null)
            {
                request.AddParameter("$filter", filter);
            }

            TfsTeamMessageList messages = Execute <TfsTeamMessageList>(request);

            return((messages != null) ? messages.Value : null);
        }