/// <summary> /// delete /// </summary> /// <param name="options"> Delete Activity parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Activity </returns> public static bool Delete(DeleteActivityOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildDeleteRequest(options, client)); return(response.StatusCode == System.Net.HttpStatusCode.NoContent); }
/// <summary> /// delete /// </summary> /// /// <param name="options"> Delete Activity parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Activity </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteActivityOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); return(response.StatusCode == System.Net.HttpStatusCode.NoContent); }
/// <summary> /// delete /// </summary> /// <param name="pathWorkspaceSid"> The SID of the Workspace with the Activity resources to delete </param> /// <param name="pathSid"> The SID of the Activity resource to delete </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Activity </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteActivityOptions(pathWorkspaceSid, pathSid); return(await DeleteAsync(options, client)); }
private static Request BuildDeleteRequest(DeleteActivityOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Delete, Rest.Domain.Taskrouter, "/v1/Workspaces/" + options.PathWorkspaceSid + "/Activities/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// delete /// </summary> /// <param name="pathWorkspaceSid"> The SID of the Workspace with the Activity resources to delete </param> /// <param name="pathSid"> The SID of the Activity resource to delete </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Activity </returns> public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteActivityOptions(pathWorkspaceSid, pathSid); return(Delete(options, client)); }