twilio.sugar.Model.PhoneAutomation.DeleteProvisionedPhoneNumber C# (CSharp) Méthode

DeleteProvisionedPhoneNumber() public méthode

public DeleteProvisionedPhoneNumber ( twilio.sugar.Model.PhoneNumber model ) : void
model twilio.sugar.Model.PhoneNumber
Résultat void
        public void DeleteProvisionedPhoneNumber(PhoneNumber model)
        {
            if (model == null || String.IsNullOrEmpty(model.sid))
            {
                throw new ArgumentNullException("model");
            }

            _parameters.Clear();
            AddParametersFromPhoneNumberModel(model);

            _account.request(String.Format("Accounts/{0}/IncomingPhoneNumbers/{1}.json", _account.id, model.sid), "DELETE", _parameters);
        }

Usage Example

        public void DeleteProvisionedPhoneNumberWithNullObjectShouldReturnArgumentNullException()
        {
            try
            {
                var account = new TwilioAccountMock();
                var phoneAutomation = new PhoneAutomation(account);

                phoneAutomation.DeleteProvisionedPhoneNumber(null);
            }
            catch (System.Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(System.ArgumentNullException));
            }
        }
All Usage Examples Of twilio.sugar.Model.PhoneAutomation::DeleteProvisionedPhoneNumber