/// <summary> /// Delete a specific variable. /// </summary> /// <param name="options"> Delete Variable parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Variable </returns> public static bool Delete(DeleteVariableOptions 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 variable. /// </summary> /// <param name="options"> Delete Variable parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Variable </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteVariableOptions 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 variable. /// </summary> /// <param name="pathServiceSid"> The SID of the Service to delete the Variable resource from </param> /// <param name="pathEnvironmentSid"> The SID of the environment with the Variables to delete </param> /// <param name="pathSid"> The SID of the Variable resource to delete </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Variable </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid); return(await DeleteAsync(options, client)); }
/// <summary> /// Delete a specific variable. /// </summary> /// <param name="pathServiceSid"> The SID of the Service to delete the Variable resource from </param> /// <param name="pathEnvironmentSid"> The SID of the environment with the Variables to delete </param> /// <param name="pathSid"> The SID of the Variable resource to delete </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Variable </returns> public static bool Delete(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid); return(Delete(options, client)); }
private static Request BuildDeleteRequest(DeleteVariableOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Delete, Rest.Domain.Serverless, "/v1/Services/" + options.PathServiceSid + "/Environments/" + options.PathEnvironmentSid + "/Variables/" + options.PathSid + "", queryParams: options.GetParams() )); }