Exemplo n.º 1
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        ///
        /// <param name="options"> Update Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        ///
        /// <param name="pathSid"> Service Sid. </param>
        /// <param name="name"> Friendly name of the service </param>
        /// <param name="codeLength"> Length of verification code. Valid values are 4-10 </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(string pathSid, string name = null, int?codeLength = null, ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                Name = name, CodeLength = codeLength
            };

            return(await UpdateAsync(options, client));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        ///
        /// <param name="pathSid"> Service Sid. </param>
        /// <param name="name"> Friendly name of the service </param>
        /// <param name="codeLength"> Length of verification code. Valid values are 4-10 </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(string pathSid, string name = null, int?codeLength = null, ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                Name = name, CodeLength = codeLength
            };

            return(Update(options, client));
        }
Exemplo n.º 4
0
 private static Request BuildUpdateRequest(UpdateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/Verification/Services/" + options.PathSid + "",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Update a specific Phone Verification Service.
        /// </summary>
        ///
        /// <param name="options"> Update Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }