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

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemplo n.º 2
0
        /// <summary>
        /// delete
        /// </summary>
        ///
        /// <param name="options"> Delete SyncMapItem parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncMapItem </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteSyncMapItemOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemplo n.º 3
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathMapSid"> The map_sid </param>
        /// <param name="pathKey"> The key </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncMapItem </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid,
                                                                           string pathMapSid,
                                                                           string pathKey,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey);

            return(await DeleteAsync(options, client));
        }
Exemplo n.º 4
0
 private static Request BuildDeleteRequest(DeleteSyncMapItemOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Maps/" + options.PathMapSid + "/Items/" + options.PathKey + "",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Sync Map Item resource to delete </param>
        /// <param name="pathMapSid"> The SID of the Sync Map with the Sync Map Item resource to delete </param>
        /// <param name="pathKey"> The key value of the Sync Map 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 SyncMapItem </returns>
        public static bool Delete(string pathServiceSid,
                                  string pathMapSid,
                                  string pathKey,
                                  string ifMatch           = null,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey)
            {
                IfMatch = ifMatch
            };

            return(Delete(options, client));
        }