/// <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 SID of the Sync Service with the Sync List Item resource to delete </param>
        /// <param name="pathListSid"> The SID of the Sync List with the Sync List Item resource to delete </param>
        /// <param name="pathIndex"> The index of the Sync List Item resource to delete </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));
        }
 private static Request BuildDeleteRequest(DeleteSyncListItemOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Lists/" + options.PathListSid + "/Items/" + options.PathIndex + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Sync List Item resource to delete </param>
        /// <param name="pathListSid"> The SID of the Sync List with the Sync List Item resource to delete </param>
        /// <param name="pathIndex"> The index of the Sync List Item resource to delete </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));
        }