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

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
        /// <summary>
        /// Delete a Function resource.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to delete the Function resource from </param>
        /// <param name="pathSid"> The SID of the Function resource to delete </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Function </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteFunctionOptions(pathServiceSid, pathSid);

            return(await DeleteAsync(options, client));
        }
        /// <summary>
        /// Delete a Function resource.
        /// </summary>
        /// <param name="options"> Delete Function parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Function </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteFunctionOptions options,
                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Example #4
0
 private static Request BuildDeleteRequest(DeleteFunctionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Functions/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Delete a Function resource.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to delete the Function resource from </param>
        /// <param name="pathSid"> The SID of the Function resource to delete </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Function </returns>
        public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new DeleteFunctionOptions(pathServiceSid, pathSid);

            return(Delete(options, client));
        }