コード例 #1
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete Participant parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Participant </returns>
        public static bool Delete(DeleteParticipantOptions 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="pathConversationSid"> The unique id of the Conversation for this participant. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Participant </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathConversationSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteParticipantOptions(pathConversationSid, pathSid);

            return(await DeleteAsync(options, client));
        }
コード例 #3
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete Participant parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Participant </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteParticipantOptions options,
                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
コード例 #4
0
 private static Request BuildDeleteRequest(DeleteParticipantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Conversations,
                "/v1/Conversations/" + options.PathConversationSid + "/Participants/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
コード例 #5
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathConversationSid"> The unique id of the Conversation for this participant. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="xTwilioWebhookEnabled"> The X-Twilio-Webhook-Enabled HTTP request header </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Participant </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathConversationSid,
                                                                           string pathSid,
                                                                           ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteParticipantOptions(pathConversationSid, pathSid)
            {
                XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(await DeleteAsync(options, client));
        }
コード例 #6
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathConversationSid"> The unique id of the Conversation for this participant. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="xTwilioWebhookEnabled"> The X-Twilio-Webhook-Enabled HTTP request header </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Participant </returns>
        public static bool Delete(string pathConversationSid,
                                  string pathSid,
                                  ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteParticipantOptions(pathConversationSid, pathSid)
            {
                XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(Delete(options, client));
        }
コード例 #7
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathConversationSid"> The unique id of the Conversation for this participant. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Participant </returns>
        public static bool Delete(string pathConversationSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new DeleteParticipantOptions(pathConversationSid, pathSid);

            return(Delete(options, client));
        }