예제 #1
0
        /// <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));
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 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()
                ));
 }
예제 #4
0
        /// <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));
        }