/// <summary> /// Delete an Asset. /// </summary> /// <param name="options"> Delete Asset parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Asset </returns> public static bool Delete(DeleteAssetOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildDeleteRequest(options, client)); return(response.StatusCode == System.Net.HttpStatusCode.NoContent); }
/// <summary> /// Delete an Asset. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathSid"> Asset Sid. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Asset </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteAssetOptions(pathServiceSid, pathSid); return(await DeleteAsync(options, client)); }
/// <summary> /// Delete an Asset. /// </summary> /// <param name="options"> Delete Asset parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Asset </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteAssetOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); return(response.StatusCode == System.Net.HttpStatusCode.NoContent); }
private static Request BuildDeleteRequest(DeleteAssetOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Delete, Rest.Domain.Serverless, "/v1/Services/" + options.PathServiceSid + "/Assets/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// Delete an Asset. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathSid"> Asset Sid. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Asset </returns> public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteAssetOptions(pathServiceSid, pathSid); return(Delete(options, client)); }