Beispiel #1
0
        /// <summary>
        /// Remove an event type from a subscription.
        /// </summary>
        /// <param name="options"> Delete SubscribedEvent parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SubscribedEvent </returns>
        public static bool Delete(DeleteSubscribedEventOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Beispiel #2
0
        /// <summary>
        /// Remove an event type from a subscription.
        /// </summary>
        /// <param name="pathSubscriptionSid"> Subscription SID. </param>
        /// <param name="pathType"> Type of event being subscribed to. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SubscribedEvent </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathSubscriptionSid,
                                                                           string pathType,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteSubscribedEventOptions(pathSubscriptionSid, pathType);

            return(await DeleteAsync(options, client));
        }
Beispiel #3
0
        /// <summary>
        /// Remove an event type from a subscription.
        /// </summary>
        /// <param name="options"> Delete SubscribedEvent parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SubscribedEvent </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteSubscribedEventOptions options,
                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Beispiel #4
0
 private static Request BuildDeleteRequest(DeleteSubscribedEventOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Events,
                "/v1/Subscriptions/" + options.PathSubscriptionSid + "/SubscribedEvents/" + options.PathType + "",
                queryParams: options.GetParams()
                ));
 }
Beispiel #5
0
        /// <summary>
        /// Remove an event type from a subscription.
        /// </summary>
        /// <param name="pathSubscriptionSid"> Subscription SID. </param>
        /// <param name="pathType"> Type of event being subscribed to. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SubscribedEvent </returns>
        public static bool Delete(string pathSubscriptionSid, string pathType, ITwilioRestClient client = null)
        {
            var options = new DeleteSubscribedEventOptions(pathSubscriptionSid, pathType);

            return(Delete(options, client));
        }