/// <summary> /// Delete a specific Participant. This is a soft-delete. The participant remains associated with the session and cannot /// be re-added. Participants are only permanently deleted when the /// [Session](https://www.twilio.com/docs/proxy/api/session) is deleted. /// </summary> /// <param name="options"> Delete Participant parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Participant </returns> public static bool Delete(DeleteParticipantOptions 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 specific Participant. /// </summary> /// /// <param name="options"> Delete Participant parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Participant </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteParticipantOptions 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 a specific Participant. This is a soft-delete. The participant remains associated with the session and cannot /// be re-added. Participants are only permanently deleted when the /// [Session](https://www.twilio.com/docs/proxy/api/session) is deleted. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathSessionSid"> Session Sid. </param> /// <param name="pathSid"> A string that uniquely identifies this Participant. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Participant </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteParticipantOptions(pathServiceSid, pathSessionSid, pathSid); return(await DeleteAsync(options, client)); }
/// <summary> /// Delete a specific Participant. This is a soft-delete. The participant remains associated with the session and cannot /// be re-added. Participants are only permanently deleted when the /// [Session](https://www.twilio.com/docs/proxy/api/session) is deleted. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathSessionSid"> Session Sid. </param> /// <param name="pathSid"> A string that uniquely identifies this Participant. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Participant </returns> public static bool Delete(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteParticipantOptions(pathServiceSid, pathSessionSid, pathSid); return(Delete(options, client)); }
private static Request BuildDeleteRequest(DeleteParticipantOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Delete, Rest.Domain.Proxy, "/v1/Services/" + options.PathServiceSid + "/Sessions/" + options.PathSessionSid + "/Participants/" + options.PathSid + "", queryParams: options.GetParams() )); }