Exemplo n.º 1
0
        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",
            };
        }
Exemplo n.º 2
0
        public WebRtcCredential Update()
        {
            WebRtcCredential result = new WebRtcCredential();

            try
            {
                var updateOptions = new TelephonyCredentialUpdateOptions()
                {
                    ConnectionId = "987654321",
                    ExpiresAt    = "2018-02-02T22:25:27.521Z",
                    Name         = "My Creds",
                };

                result = service.Update(id, updateOptions);
                Console.WriteLine(JsonConvert.SerializeObject(result));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(result);
        }