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);

        AlphaSenderResource.Delete(
            pathServiceSid: "MG2172dd2db502e20dd981ef0d67850e1a",
            pathSid: "AIc781610ec0b3400c9e0cab8e757da937"
            );
    }
    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);

        AlphaSenderResource.Delete(
            pathServiceSid: "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathSid: "AIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
            );
    }
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid     = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken      = "your_auth_token";
        const string pathServiceSid = "MG2172dd2db502e20dd981ef0d67850e1a";
        const string alphaSenderSid = "AIc781610ec0b3400c9e0cab8e757da937";

        TwilioClient.Init(accountSid, authToken);

        var deleted = AlphaSenderResource.Delete(pathServiceSid, alphaSenderSid);

        Console.WriteLine(deleted);
    }
        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 = AlphaSenderResource.Delete("MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "AIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient);

            Assert.NotNull(response);
        }
Exemple #5
0
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        // To set up environmental variables, see http://twil.io/secure
        const string accountSid     = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        const string authToken      = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");
        const string pathServiceSid = "MG2172dd2db502e20dd981ef0d67850e1a";
        const string alphaSenderSid = "AIc781610ec0b3400c9e0cab8e757da937";

        TwilioClient.Init(accountSid, authToken);

        var deleted = AlphaSenderResource.Delete(pathServiceSid, alphaSenderSid);

        Console.WriteLine(deleted);
    }
        public void TestDeleteRequest()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();
            var request          = new Request(
                HttpMethod.Delete,
                Twilio.Rest.Domain.Messaging,
                "/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AlphaSenders/AIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                ""
                );

            twilioRestClient.Request(request).Throws(new ApiException("Server Error, no content"));

            try
            {
                AlphaSenderResource.Delete("MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "AIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient);
                Assert.Fail("Expected TwilioException to be thrown for 500");
            }
            catch (ApiException) {}
            twilioRestClient.Received().Request(request);
        }