public async Task HandleAsync(HearingParticipantsUpdatedIntegrationEvent eventMessage) { var conferenceResponse = await _videoApiService.GetConferenceByHearingRefId(eventMessage.HearingId, true); var updateConferenceParticipantsRequest = new UpdateConferenceParticipantsRequest { ExistingParticipants = eventMessage.ExistingParticipants.Select(x => ParticipantToUpdateParticipantMapper.MapToParticipantRequest(x)).ToList(), NewParticipants = eventMessage.NewParticipants.Select(x => ParticipantToParticipantRequestMapper.MapToParticipantRequest(x)).ToList(), RemovedParticipants = eventMessage.RemovedParticipants, LinkedParticipants = eventMessage.LinkedParticipants.Select(x => LinkedParticipantToRequestMapper.MapToLinkedParticipantRequest(x)).ToList(), }; await _videoApiService.UpdateConferenceParticipantsAsync(conferenceResponse.Id, updateConferenceParticipantsRequest); await _videoWebService.PushParticipantsUpdatedMessage(conferenceResponse.Id, updateConferenceParticipantsRequest); }
public async Task HandleAsync(ParticipantsAddedIntegrationEvent eventMessage) { var conference = await _videoApiService.GetConferenceByHearingRefId(eventMessage.HearingId); var request = new AddParticipantsToConferenceRequest { Participants = eventMessage.Participants .Select(ParticipantToParticipantRequestMapper.MapToParticipantRequest).ToList() }; await _videoApiService.AddParticipantsToConference(conference.Id, request); var updateConferenceParticipantsRequest = new UpdateConferenceParticipantsRequest { NewParticipants = eventMessage.Participants.Select(x => ParticipantToParticipantRequestMapper.MapToParticipantRequest(x)).ToList(), }; await _videoWebService.PushParticipantsUpdatedMessage(conference.Id, updateConferenceParticipantsRequest); }
public async Task PushParticipantsUpdatedMessage(Guid conferenceId, UpdateConferenceParticipantsRequest request) { var path = $"internalevent/ParticipantsUpdated?conferenceId={conferenceId}"; logger.LogDebug("PushParticipantsUpdatedMessage ConferenceId: {ConferenceId}", conferenceId); DefaultContractResolver contractResolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() }; string json = JsonConvert.SerializeObject(request, new JsonSerializerSettings { ContractResolver = contractResolver, Formatting = Formatting.Indented }); var httpContent = new StringContent(json, Encoding.UTF8, "application/json"); var result = httpClient.PostAsync(path, httpContent).Result; logger.LogDebug("PushParticipantsUpdatedMessage result: {Result}", result); }
public Task UpdateConferenceParticipantsAsync(Guid conferenceId, UpdateConferenceParticipantsRequest request) { _logger.LogInformation("Updating participants in conference {ConferenceId} with request: {request}", conferenceId, request); return(_apiClient.UpdateConferenceParticipantsAsync(conferenceId, request)); }
public Task PushParticipantsUpdatedMessage(Guid conferenceId, UpdateConferenceParticipantsRequest request) { PushParticipantsUpdatedMessageCount++; return(Task.FromResult(HttpStatusCode.OK)); }
public Task UpdateConferenceParticipantsAsync(Guid conferenceId, UpdateConferenceParticipantsRequest request) { UpdateConferenceParticipantsAsyncCount++; return(Task.FromResult(HttpStatusCode.OK)); }