using System; using System.Threading.Tasks; using Chtn.CSharp.SDK.Core; using Chtn.CSharp.SDK.Models.Call; namespace Chtn.CSharp.SDK.Services { public interface ICallService { Task InviteToCall(); Task GetRTCAccess(); } public class CallService: ICallService { private readonly ApiClient _apiClient; private readonly string _userId; private readonly string _token; public CallService(ApiClient apiClient, string userId, string token) { _apiClient = apiClient ?? throw new ArgumentNullException(nameof(apiClient)); _userId = userId; _token = token; } public async Task InviteToCall() { var body = new { userid = _userId }; await _apiClient.PostAsync("v2/chat/rtcInvite", body); } public async Task GetRTCAccess() { var body = new { userid = _userId }; return await _apiClient.PostAsync("v2/chat/getRTCAccess", body); } } }