/// <summary> /// delete /// </summary> /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathIdentity"> The identity </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of User </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteUserOptions(pathServiceSid, pathIdentity); return(await DeleteAsync(options, client)); }
/// <summary> /// delete /// </summary> /// <param name="options"> Delete User parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of User </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteUserOptions 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(DeleteUserOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Delete, Rest.Domain.Notify, "/v1/Services/" + options.PathServiceSid + "/Users/" + options.PathIdentity + "", client.Region, queryParams: options.GetParams() )); }
/// <summary> /// delete /// </summary> /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathIdentity"> The identity </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of User </returns> public static bool Delete(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteUserOptions(pathServiceSid, pathIdentity); return(Delete(options, client)); }