/// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete SyncListItem parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncListItem </returns>
        public static bool Delete(DeleteSyncListItemOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
예제 #2
0
        /// <summary>
        /// delete
        /// </summary>
        ///
        /// <param name="options"> Delete SyncListItem parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncListItem </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteSyncListItemOptions 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="pathServiceSid"> The service_sid </param>
        /// <param name="pathListSid"> The list_sid </param>
        /// <param name="pathIndex"> The index </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncListItem </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid,
                                                                           string pathListSid,
                                                                           int?pathIndex,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteSyncListItemOptions(pathServiceSid, pathListSid, pathIndex);

            return(await DeleteAsync(options, client));
        }
예제 #4
0
 private static Request BuildDeleteRequest(DeleteSyncListItemOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Lists/" + options.PathListSid + "/Items/" + options.PathIndex + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathListSid"> The list_sid </param>
        /// <param name="pathIndex"> The index </param>
        /// <param name="ifMatch"> The If-Match HTTP request header </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncListItem </returns>
        public static bool Delete(string pathServiceSid,
                                  string pathListSid,
                                  int?pathIndex,
                                  string ifMatch           = null,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteSyncListItemOptions(pathServiceSid, pathListSid, pathIndex)
            {
                IfMatch = ifMatch
            };

            return(Delete(options, client));
        }