예제 #1
0
 /// <summary>
 /// Construct a new CreateWebhookOptions
 /// </summary>
 /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </param>
 /// <param name="pathConversationSid"> The unique ID of the Conversation for this webhook. </param>
 /// <param name="target"> The target of this webhook. </param>
 public CreateWebhookOptions(string pathChatServiceSid, string pathConversationSid, WebhookResource.TargetEnum target)
 {
     PathChatServiceSid  = pathChatServiceSid;
     PathConversationSid = pathConversationSid;
     Target = target;
     ConfigurationFilters  = new List <string>();
     ConfigurationTriggers = new List <string>();
 }
예제 #2
0
        /// <summary>
        /// Create a new webhook scoped to the conversation in a specific service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </param>
        /// <param name="pathConversationSid"> The unique ID of the Conversation for this webhook. </param>
        /// <param name="target"> The target of this webhook. </param>
        /// <param name="configurationUrl"> The absolute url the webhook request should be sent to. </param>
        /// <param name="configurationMethod"> The HTTP method to be used when sending a webhook request. </param>
        /// <param name="configurationFilters"> The list of events, firing webhook event for this Conversation. </param>
        /// <param name="configurationTriggers"> The list of keywords, firing webhook event for this Conversation. </param>
        /// <param name="configurationFlowSid"> The studio flow SID, where the webhook should be sent to. </param>
        /// <param name="configurationReplayAfter"> The message index for which and it's successors the webhook will be
        ///                                replayed. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Webhook </returns>
        public static WebhookResource Create(string pathChatServiceSid,
                                             string pathConversationSid,
                                             WebhookResource.TargetEnum target,
                                             string configurationUrl = null,
                                             WebhookResource.MethodEnum configurationMethod = null,
                                             List <string> configurationFilters             = null,
                                             List <string> configurationTriggers            = null,
                                             string configurationFlowSid  = null,
                                             int?configurationReplayAfter = null,
                                             ITwilioRestClient client     = null)
        {
            var options = new CreateWebhookOptions(pathChatServiceSid, pathConversationSid, target)
            {
                ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationReplayAfter = configurationReplayAfter
            };

            return(Create(options, client));
        }