Exemple #1
0
        /// <summary>
        /// Delete a specific Factor.
        /// </summary>
        /// <param name="options"> Delete Factor parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Factor </returns>
        public static bool Delete(DeleteFactorOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemple #2
0
        /// <summary>
        /// Delete a specific Factor.
        /// </summary>
        /// <param name="options"> Delete Factor parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Factor </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteFactorOptions options,
                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemple #3
0
        /// <summary>
        /// Delete a specific Factor.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique external identifier of the Entity </param>
        /// <param name="pathSid"> A string that uniquely identifies this Factor. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Factor </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid,
                                                                           string pathIdentity,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteFactorOptions(pathServiceSid, pathIdentity, pathSid);

            return(await DeleteAsync(options, client));
        }
Exemple #4
0
        /// <summary>
        /// Delete a specific Factor.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique external identifier of the Entity </param>
        /// <param name="pathSid"> A string that uniquely identifies this Factor. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Factor </returns>
        public static bool Delete(string pathServiceSid,
                                  string pathIdentity,
                                  string pathSid,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteFactorOptions(pathServiceSid, pathIdentity, pathSid);

            return(Delete(options, client));
        }
Exemple #5
0
 private static Request BuildDeleteRequest(DeleteFactorOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Verify,
                "/v2/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "/Factors/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }