public TelephonyCredentialServiceTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.service = new TelephonyCredentialService(); this.listOptions = new ListOptions { PageNumber = 1, PageSize = 20, }; this.baseOptions = new BaseOptions(); this.requestOptions = new RequestOptions(); this.createOptions = new TelephonyCredentialCreateOptions() { ConnectionId = "1234567890", ExpiresAt = "2018-02-02T22:25:27.521Z", Name = "admin", }; this.updateOptions = new TelephonyCredentialUpdateOptions() { ConnectionId = "987654321", ExpiresAt = "2018-02-02T22:25:27.521Z", Name = "My Creds", }; }
public WebRtcCredential Create() { WebRtcCredential result = new WebRtcCredential(); try { var createOptions = new TelephonyCredentialCreateOptions() { ConnectionId = "1234567890", ExpiresAt = "2018-02-02T22:25:27.521Z", }; result = service.Create(createOptions); Console.WriteLine(JsonConvert.SerializeObject(result)); } catch (TelnyxException ex) { Console.WriteLine("exception"); Console.WriteLine(JsonConvert.SerializeObject(ex)); } return(result); }