示例#1
0
        /// <summary>
        /// Saves updates to the phone number.
        /// </summary>
        /// <param name="client">REST client.</param>
        /// <returns></returns>
        public void Save(IVcRestClient client = null)
        {
            Number number = null;

            UpdateNumber updateNumber = new UpdateNumber(this.Id)
            {
                Name                       = this.Name,
                StatusTextUrl              = this.StatusTextUrl,
                IncomingTextUrl            = this.IncomingTextUrl,
                IncomingTextMethod         = this.IncomingTextMethod,
                IncomingTextFallbackUrl    = this.IncomingTextFallbackUrl,
                IncomingTextFallbackMethod = this.IncomingTextFallbackMethod,
                VoiceForwardingNumber      = this.VoiceForwardingNumber
            };

            if (this.PhoneNumberType == PhoneNumberTypeEnum.Local)
            {
                number = UpdateLocal(this.AccountId, updateNumber, client);
            }
            else
            {
                number = Update(this.AccountId, updateNumber, client);
            }

            Mapper.Map(number, this);
        }
示例#2
0
 /// <summary>
 /// Updates local phone number.
 /// </summary>
 /// <param name="accountId">Account ID.</param>
 /// <param name="updateNumber">UpdateNumber.</param>
 /// <param name="client">REST client.</param>
 /// <returns></returns>
 private static Number UpdateLocal(int accountId, UpdateNumber updateNumber, IVcRestClient client = null)
 {
     return(Update <Number>(BuildUpdateLocalUrl(accountId, updateNumber.Id), updateNumber, client: client));
 }