Пример #1
0
 public static Task Create(Client client, string orderName, params string[] numbers)
 {
     var order = new DisconnectTelephoneNumberOrder
     {
         Name = orderName,
         DisconnectTelephoneNumberOrderType = new DisconnectTelephoneNumberOrderType
         {
             TelephoneNumbers = numbers
         }
     };
     return client.MakePostRequest(client.ConcatAccountPath(DisconnectNumbersPath), order, true);
 }
Пример #2
0
        public static Task Create(Client client, string orderName, params string[] numbers)
        {
            var order = new DisconnectTelephoneNumberOrder
            {
                Name = orderName,
                DisconnectTelephoneNumberOrderType = new DisconnectTelephoneNumberOrderType
                {
                    TelephoneNumberList = new TelephoneNumberList
                    {
                        TelephoneNumbers = numbers
                    }
                }
            };

            return(client.MakePostRequest(client.ConcatAccountPath(DisconnectNumbersPath), order, true));
        }
 public void DisconnectNumbersWithDefaultClientTest()
 {
     var data = new DisconnectTelephoneNumberOrder
     {
         Name = "order",
         DisconnectTelephoneNumberOrderType = new DisconnectTelephoneNumberOrderType
         {
             TelephoneNumbers = new[] { "111", "222" }
         }
     };
     using (var server = new HttpServer(new RequestHandler
     {
         EstimatedMethod = "POST",
         EstimatedPathAndQuery = string.Format("/v1.0/accounts/{0}/disconnects", Helper.AccountId),
         EstimatedContent = Helper.ToXmlString(data)
     }))
     {
         Disconnect.Create("order", "111", "222").Wait();
         if (server.Error != null) throw server.Error;
     }
 }