/// <summary>
        /// Updates a specific HostedNumberOrder.
        /// </summary>
        ///
        /// <param name="options"> Update HostedNumberOrder parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of HostedNumberOrder </returns>
        public static HostedNumberOrderResource Update(UpdateHostedNumberOrderOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Updates a specific HostedNumberOrder.
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> A human readable description of this resource. </param>
        /// <param name="uniqueName"> A unique, developer assigned name of this HostedNumberOrder. </param>
        /// <param name="email"> Email. </param>
        /// <param name="ccEmails"> A list of emails. </param>
        /// <param name="status"> The Status of this HostedNumberOrder. </param>
        /// <param name="verificationCode"> A verification code. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of HostedNumberOrder </returns>
        public static async System.Threading.Tasks.Task <HostedNumberOrderResource> UpdateAsync(string pathSid, string friendlyName = null, string uniqueName = null, string email = null, List <string> ccEmails = null, HostedNumberOrderResource.StatusEnum status = null, string verificationCode = null, ITwilioRestClient client = null)
        {
            var options = new UpdateHostedNumberOrderOptions(pathSid)
            {
                FriendlyName = friendlyName, UniqueName = uniqueName, Email = email, CcEmails = ccEmails, Status = status, VerificationCode = verificationCode
            };

            return(await UpdateAsync(options, client));
        }
 private static Request BuildUpdateRequest(UpdateHostedNumberOrderOptions options, ITwilioRestClient client)
 {
     return new Request(
         HttpMethod.Post,
         Rest.Domain.Preview,
         "/HostedNumbers/HostedNumberOrders/" + options.PathSid + "",
         postParams: options.GetParams()
     );
 }
 /// <summary>
 /// Updates a specific HostedNumberOrder.
 /// </summary>
 /// <param name="pathSid"> The sid </param>
 /// <param name="friendlyName"> A human readable description of this resource. </param>
 /// <param name="uniqueName"> A unique, developer assigned name of this HostedNumberOrder. </param>
 /// <param name="email"> Email. </param>
 /// <param name="ccEmails"> A list of emails. </param>
 /// <param name="status"> The Status of this HostedNumberOrder. </param>
 /// <param name="verificationCode"> A verification code. </param>
 /// <param name="verificationType"> Verification Type. </param>
 /// <param name="verificationDocumentSid"> Verification Document Sid </param>
 /// <param name="extension"> Digits to dial after connecting the verification call. </param>
 /// <param name="callDelay"> The number of seconds, between 0 and 60, to delay before initiating the verification call.
 ///                 </param>
 /// <param name="client"> Client to make requests to Twilio </param>
 /// <returns> Task that resolves to A single instance of HostedNumberOrder </returns>
 public static async System.Threading.Tasks.Task<HostedNumberOrderResource> UpdateAsync(string pathSid,
                                                                                        string friendlyName = null,
                                                                                        string uniqueName = null,
                                                                                        string email = null,
                                                                                        List<string> ccEmails = null,
                                                                                        HostedNumberOrderResource.StatusEnum status = null,
                                                                                        string verificationCode = null,
                                                                                        HostedNumberOrderResource.VerificationTypeEnum verificationType = null,
                                                                                        string verificationDocumentSid = null,
                                                                                        string extension = null,
                                                                                        int? callDelay = null,
                                                                                        ITwilioRestClient client = null)
 {
     var options = new UpdateHostedNumberOrderOptions(pathSid){FriendlyName = friendlyName, UniqueName = uniqueName, Email = email, CcEmails = ccEmails, Status = status, VerificationCode = verificationCode, VerificationType = verificationType, VerificationDocumentSid = verificationDocumentSid, Extension = extension, CallDelay = callDelay};
     return await UpdateAsync(options, client);
 }
        /// <summary>
        /// Updates a specific HostedNumberOrder.
        /// </summary>
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> A human readable description of this resource. </param>
        /// <param name="uniqueName"> A unique, developer assigned name of this HostedNumberOrder. </param>
        /// <param name="email"> Email. </param>
        /// <param name="ccEmails"> A list of emails. </param>
        /// <param name="status"> The Status of this HostedNumberOrder. </param>
        /// <param name="verificationCode"> A verification code. </param>
        /// <param name="verificationType"> Verification Type. </param>
        /// <param name="verificationDocumentSid"> Verification Document Sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of HostedNumberOrder </returns>
        public static HostedNumberOrderResource Update(string pathSid,
                                                       string friendlyName    = null,
                                                       string uniqueName      = null,
                                                       string email           = null,
                                                       List <string> ccEmails = null,
                                                       HostedNumberOrderResource.StatusEnum status = null,
                                                       string verificationCode = null,
                                                       HostedNumberOrderResource.VerificationTypeEnum verificationType = null,
                                                       string verificationDocumentSid = null,
                                                       ITwilioRestClient client       = null)
        {
            var options = new UpdateHostedNumberOrderOptions(pathSid)
            {
                FriendlyName = friendlyName, UniqueName = uniqueName, Email = email, CcEmails = ccEmails, Status = status, VerificationCode = verificationCode, VerificationType = verificationType, VerificationDocumentSid = verificationDocumentSid
            };

            return(Update(options, client));
        }
        /// <summary>
        /// Updates a specific HostedNumberOrder.
        /// </summary>
        ///
        /// <param name="options"> Update HostedNumberOrder parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of HostedNumberOrder </returns>
        public static async System.Threading.Tasks.Task <HostedNumberOrderResource> UpdateAsync(UpdateHostedNumberOrderOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }