static void Main(string[] args) { // Find your Account Sid and Token at twilio.com/console const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; const string authToken = "your_auth_token"; TwilioClient.Init(accountSid, authToken); CompositionHookResource.Delete(pathSid: "HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); }
static void Main(string[] args) { // Find your API Key SID and Secret at twilio.com/console const string apiKeySid = "SKXXXX"; const string apiKeySecret = "your_api_key_secret"; TwilioClient.Init(apiKeySid, apiKeySecret); CompositionHookResource.Delete( pathSid: "HKXXXX" ); Console.WriteLine("Composition Hook removed"); }
public void TestDeleteResponse() { var twilioRestClient = Substitute.For <ITwilioRestClient>(); twilioRestClient.AccountSid.Returns("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); twilioRestClient.Request(Arg.Any <Request>()) .Returns(new Response( System.Net.HttpStatusCode.NoContent, "null" )); var response = CompositionHookResource.Delete("HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient); Assert.NotNull(response); }
static void Main(string[] args) { // Find your API Key SID and Secret at twilio.com/console // To set up environmental variables, see http://twil.io/secure const string apiKeySid = Environment.GetEnvironmentVariable("TWILIO_API_KEY_SID"); const string apiKeySecret = Environment.GetEnvironmentVariable("TWILIO_API_KEY_SECRET"); TwilioClient.Init(apiKeySid, apiKeySecret); CompositionHookResource.Delete( pathSid: "HKXXXX" ); Console.WriteLine("Composition Hook removed"); }
public void TestDeleteRequest() { var twilioRestClient = Substitute.For <ITwilioRestClient>(); var request = new Request( HttpMethod.Delete, Twilio.Rest.Domain.Video, "/v1/CompositionHooks/HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "" ); twilioRestClient.Request(request).Throws(new ApiException("Server Error, no content")); try { CompositionHookResource.Delete("HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient); Assert.Fail("Expected TwilioException to be thrown for 500"); } catch (ApiException) {} twilioRestClient.Received().Request(request); }