Esempio n. 1
0
 /// <summary>
 /// Creates an Instance of the TwitchAPI Class.
 /// </summary>
 /// <param name="logger">Instance Of Logger, otherwise no logging is used,  </param>
 /// <param name="rateLimiter">Instance Of RateLimiter, otherwise no ratelimiter is used. </param>
 public TwitchAPI(ILoggerFactory loggerFactory = null, IRateLimiter rateLimiter = null, IHttpCallHandler http = null)
 {
     _logger         = loggerFactory?.CreateLogger <TwitchAPI>();
     _http           = http ?? new TwitchHttpClient(loggerFactory?.CreateLogger <TwitchHttpClient>());
     _rateLimiter    = rateLimiter ?? BypassLimiter.CreateLimiterBypassInstance();
     Analytics       = new Analytics(this);
     Auth            = new Auth(this);
     Badges          = new Badges(this);
     Bits            = new Bits(this);
     ChannelFeeds    = new ChannelFeeds(this);
     Channels        = new Channels(this);
     Chat            = new Chat(this);
     Clips           = new Clips(this);
     Collections     = new Collections(this);
     Communities     = new Communities(this);
     Entitlements    = new Entitlements(this);
     Games           = new Games(this);
     Ingests         = new Ingests(this);
     Root            = new Root(this);
     Search          = new Search(this);
     Streams         = new Streams(this);
     Teams           = new Teams(this);
     ThirdParty      = new ThirdParty(this);
     Undocumented    = new Undocumented(this);
     Users           = new Users(this);
     Videos          = new Videos(this);
     Webhooks        = new Webhooks(this);
     Debugging       = new Debugging();
     Settings        = new ApiSettings(this);
     _jsonSerializer = new TwitchLibJsonSerializer();
 }
Esempio n. 2
0
 /// <summary>
 /// Creates an Instance of the TwitchAPI Class.
 /// </summary>
 /// <param name="logger">Instance Of Logger, otherwise no logging is used,  </param>
 /// <param name="rateLimiter">Instance Of RateLimiter, otherwise no ratelimiter is used. </param>
 public TwitchAPI(ILogger <TwitchAPI> logger = null, IRateLimiter rateLimiter = null)
 {
     _logger         = logger;
     _http           = new HttpClient(new TwitchLibCustomHttpMessageHandler(new HttpClientHandler(), _logger));
     _rateLimiter    = rateLimiter ?? BypassLimiter.CreateLimiterBypassInstance();
     Auth            = new Auth(this);
     Blocks          = new Blocks(this);
     Badges          = new Badges(this);
     Bits            = new Bits(this);
     ChannelFeeds    = new ChannelFeeds(this);
     Channels        = new Channels(this);
     Chat            = new Chat(this);
     Clips           = new Clips(this);
     Collections     = new Collections(this);
     Communities     = new Communities(this);
     Follows         = new Follows(this);
     Games           = new Games(this);
     Ingests         = new Ingests(this);
     Root            = new Root(this);
     Search          = new Search(this);
     Streams         = new Streams(this);
     Subscriptions   = new Subscriptions(this);
     Teams           = new Teams(this);
     ThirdParty      = new ThirdParty(this);
     Undocumented    = new Undocumented(this);
     Users           = new Users(this);
     Videos          = new Videos(this);
     Webhooks        = new Webhooks(this);
     Debugging       = new Debugging();
     Settings        = new ApiSettings(this);
     _jsonSerializer = new TwitchLibJsonSerializer();
 }
Esempio n. 3
0
        private void lstWebhooks_Click(object sender, int row, int col)
        {
            try
            {
                switch (col)
                {
                case WebhooksList.Test:
                    Webhooks[row].Send(new WebhookMessage("", "Testing webhook."));

                    break;

                case WebhooksList.Delete:
                    Webhooks.RemoveAt(row);
                    RefreshEventTriggerWebhookChoice();
                    RefreshTimedTriggerWebhookChoice();
                    RefreshChatTriggerWebhookChoice();
                    RefreshWebhooksList();

                    SaveSettings();

                    break;

                default:
                    PrintWebhook(Webhooks[row]);

                    break;
                }
                ;
            }
            catch (Exception ex)
            {
                Util.LogError(ex);
            }
        }
        public async Task <string> CountSubscriptions(string userId)
        {
            var credentials = Startup.WebhookConfiguration.ConsumerOnlyCredentials;
            var result      = await Webhooks.CountNumberOfSubscriptionsAsync(credentials);

            return(result?.SubscriptionsCountAll);
        }
        public async Task <bool> UnsubscribeAccountFromWebhooks(string environment, string userId)
        {
            var userCredentials = await CredentialsRetriever.GetUserCredentials(userId);

            var result = await Webhooks.RemoveAllAccountSubscriptionsAsync(environment, userCredentials);

            return(result);
        }
        public async Task <bool> SubscribeAccountToWebhook(string environment, string userId)
        {
            var userCredentials = await CredentialsRetriever.GetUserCredentials(userId);

            var success = await Webhooks.SubscribeToAccountActivityEventsAsync(environment, userCredentials);

            return(success);
        }
        public async Task <bool> DeleteWebhook(string environment, string webhookId, string userId)
        {
            var userCredentials = await CredentialsRetriever.GetUserCredentials(userId);

            var result = await Webhooks.RemoveWebhookAsync(environment, webhookId, userCredentials);

            return(result);
        }
        /// <summary>
        /// Create a Webhook
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public VoiceResponse <Webhook> CreateWebhook(Webhook request)
        {
            ParameterValidator.IsNotNullOrWhiteSpace(request.url, "url");

            var webhookResource = new Webhooks(request);
            var result          = restClient.Create(webhookResource);

            return((VoiceResponse <Webhook>)result.Object);
        }
Esempio n. 9
0
        public static Event Example()
        {
            var data = ReadFileToString(@"../../data.txt");
            var evt  = Webhooks.ParseWebhook(data);

            Console.WriteLine(evt);

            return(evt);
        }
        public void DeleteConversationWebhook(string id)
        {
            ParameterValidator.IsNotNullOrWhiteSpace(id, "id");

            var resource = new Webhooks(new ConversationWebhook {
                Id = id
            });

            restClient.Delete(resource);
        }
        /// <summary>
        /// This request deletes a webhook. The parameter is the unique ID of the webhook.
        /// If successful, this request will return an HTTP header of 204 No Content and an empty response.
        /// </summary>
        /// <param name="webhookId">The unique ID of a call generated upon creation.</param>
        public void DeleteWebhook(string webhookId)
        {
            ParameterValidator.IsNotNullOrWhiteSpace(webhookId, "webhookId");

            var resource = new Webhooks(new Webhook {
                Id = webhookId
            });

            restClient.Delete(resource);
        }
 public Settings AddWebhookNotification(string name, string uri, string payload, string restorePayload = "")
 {
     Webhooks.Add(new WebHookNotification
     {
         Name            = name,
         Uri             = uri,
         Payload         = payload,
         RestoredPayload = restorePayload
     });
     return(this);
 }
        /// <summary>
        /// This request retrieves a Webhook
        /// </summary>
        /// <param name="webhookId"></param>Unique identifier of the webhook
        /// <returns></returns>
        public VoiceResponse <Webhook> ViewWebhook(string webhookId)
        {
            ParameterValidator.IsNotNullOrWhiteSpace(webhookId, "webhookId");

            var resource = new Webhooks(new Webhook {
                Id = webhookId
            });
            var result = restClient.Retrieve(resource);

            return((VoiceResponse <Webhook>)result.Object);
        }
        /// <summary>
        /// This request updates a webhook resource. The single parameter is the unique ID that was returned upon creation.<br/>
        /// If successful, this request will return an object with a data property, which is an array that has a single call flow object. If the request failed, an error object will be returned.
        /// </summary>
        /// <param name="id">The unique ID which was returned upon creation of a webhook.</param>
        /// <param name="webhook"></param>
        /// <returns></returns>
        public VoiceResponse <Webhook> UpdateWebhook(string id, Webhook webhook)
        {
            ParameterValidator.IsNotNullOrWhiteSpace(id, "id");

            var resource = new Webhooks(new Webhook {
                Id = id, url = webhook.url, token = webhook.token
            });
            var result = restClient.Update(resource);

            return((VoiceResponse <Webhook>)result.Object);
        }
Esempio n. 15
0
        async Task Run()
        {
            Message message = new Message()
            {
                username   = "******",
                content    = "mdr",
                avatar_url = "https://cdn.iconverticons.com/files/png/9feca6582f22e9a7_256x256.png"
            };

            await Webhooks.SendWebhook <Message>(message);
        }
        public ConversationWebhook CreateConversationWebhook(ConversationWebhook conversationWebhook)
        {
            ParameterValidator.IsNotNullOrWhiteSpace(conversationWebhook.ChannelId, "channelId");
            ParameterValidator.IsNotNullOrWhiteSpace(conversationWebhook.Url, "url");
            ParameterValidator.ContainsAtLeast(conversationWebhook.Events.ToArray(), 1, "events");

            var resource = new Webhooks(conversationWebhook);

            restClient.Create(resource);

            return(resource.Object as ConversationWebhook);
        }
        public ConversationWebhook ViewConversationWebhook(string id)
        {
            ParameterValidator.IsNotNullOrWhiteSpace(id, "id");

            var resource = new Webhooks(new ConversationWebhook {
                Id = id
            });

            restClient.Retrieve(resource);

            return(resource.Object as ConversationWebhook);
        }
Esempio n. 18
0
 public Settings AddWebhookNotification(string name, string uri, string payload, string restorePayload = "", Func <UIHealthReport, bool> shouldNotifyFunc = null, Func <UIHealthReport, string> customMessageFunc = null, Func <UIHealthReport, string> customDescriptionFunc = null)
 {
     Webhooks.Add(new WebHookNotification
     {
         Name                  = name,
         Uri                   = uri,
         Payload               = payload,
         RestoredPayload       = restorePayload,
         ShouldNotifyFunc      = shouldNotifyFunc,
         CustomMessageFunc     = customMessageFunc,
         CustomDescriptionFunc = customDescriptionFunc
     });
     return(this);
 }
Esempio n. 19
0
        public static void GetListOfSubscriptions()
        {
            Tweetinvi.Models.TwitterCredentials tempCredentials = new Tweetinvi.Models.TwitterCredentials(Tweetinvi.Auth.Credentials.ConsumerKey, Tweetinvi.Auth.Credentials.ConsumerSecret);
            Tweetinvi.Auth.InitializeApplicationOnlyCredentials(tempCredentials, true);

            Tweetinvi.Core.Public.Models.Authentication.ConsumerOnlyCredentials credentials = new Tweetinvi.Core.Public.Models.Authentication.ConsumerOnlyCredentials(tempCredentials.ConsumerKey, tempCredentials.ConsumerSecret)
            {
                ApplicationOnlyBearerToken = tempCredentials.ApplicationOnlyBearerToken
            };

            var task = Webhooks.GetListOfSubscriptionsAsync(webHookEnvironmentName, credentials);

            task.Wait();
        }
Esempio n. 20
0
        private static async Task RegisterAccountActivities(IConsumerOnlyCredentials consumerOnlyCredentials)
        {
            var webhookEnvironments = await Webhooks.GetAllWebhookEnvironmentsAsync(consumerOnlyCredentials);

            webhookEnvironments.ForEach(async environment =>
            {
                var webhookEnvironment = new RegistrableWebhookEnvironment(environment)
                {
                    Credentials = consumerOnlyCredentials
                };

                WebhookConfiguration.AddWebhookEnvironment(webhookEnvironment);

                await SubscribeToAllAccountActivities(consumerOnlyCredentials, environment);
            });
        }
        public Settings AddWebhookNotification(string name, string uri, string payload, string restorePayload = "")
        {
            if (!Uri.TryCreate(uri, UriKind.Absolute, out Uri absoluteUri))
            {
                throw new ArgumentException($"Invalid uri: {uri}");
            }

            Webhooks.Add(new WebHookNotification
            {
                Name            = name,
                Uri             = absoluteUri,
                Payload         = payload,
                RestoredPayload = restorePayload
            });
            return(this);
        }
Esempio n. 22
0
        private static async Task SubscribeToAllAccountActivities(
            IConsumerOnlyCredentials consumerOnlyCredentials,
            IWebhookEnvironmentDTO environment)
        {
            // If you wish to subscribe to the different account activity events you can do the following
            var subscriptions = await Webhooks.GetListOfSubscriptionsAsync(environment.Name, consumerOnlyCredentials);

            subscriptions.Subscriptions.ForEach(subscription =>
            {
                var activityStream = Stream.CreateAccountActivityStream(subscription.UserId);

                activityStream.JsonObjectReceived += (sender, args) => { Console.WriteLine("json received : " + args.Json); };

                WebhookConfiguration.AddActivityStream(activityStream);
            });
        }
Esempio n. 23
0
        public Trello(string key)
        {
            _restClient = new TrelloRestClient(key);

            Members       = new Members(_restClient);
            Boards        = new Boards(_restClient);
            Lists         = new Lists(_restClient);
            Cards         = new Cards(_restClient);
            Checklists    = new Checklists(_restClient);
            Organizations = new Organizations(_restClient);
            Notifications = new Notifications(_restClient);
            Tokens        = new Tokens(_restClient);
            Async         = new AsyncTrello(_restClient);
            Actions       = new Actions(_restClient);
            Advanced      = new Advanced(_restClient);
            Webhooks      = new Webhooks(_restClient);
        }
Esempio n. 24
0
        static void Main(string[] args)
        {
            Sync.ExecuteTaskAsync(() =>
            {
                var consumerOnlyCredentials = new ConsumerOnlyCredentials("CONSUMER_TOKEN", "CONSUMER_SECRET")
                {
                    ApplicationOnlyBearerToken = "BEARER_TOKEN"
                };

                IWebhookEnvironmentDTO[] webhookEnvironments = Webhooks.GetAllWebhookEnvironmentsAsync(consumerOnlyCredentials).Result;

                webhookEnvironments.ForEach(env =>
                {
                    Console.WriteLine(env.Name);
                });
            }).Wait();
        }
Esempio n. 25
0
 public Api(ApiKeys apiKeys, HttpClient httpClient = null)
 {
     Security            = new Security(apiKeys, httpClient: httpClient);
     findService         = new FindService(apiKeys.AddressLookupKey, httpClient: httpClient);
     autocompleteService = new AutocompleteService(apiKeys.AddressLookupKey, httpClient: httpClient);
     getService          = new GetService(apiKeys.AddressLookupKey, httpClient: httpClient);
     typeaheadService    = new TypeaheadService(apiKeys.AddressLookupKey, httpClient: httpClient);
     EmailNotifications  = new EmailNotifications(apiKeys.AdministrationKey, httpClient: httpClient);
     usageService        = new UsageService(apiKeys.AdministrationKey, httpClient: httpClient);
     distanceService     = new DistanceService(apiKeys.AddressLookupKey, httpClient: httpClient);
     Subscription        = new SubscriptionService(apiKeys.AdministrationKey, httpClient: httpClient);
     Plans          = new PlansService(apiKeys.AdministrationKey, httpClient: httpClient);
     Webhooks       = new Webhooks(apiKeys.AdministrationKey, httpClient: httpClient);
     Account        = new Account(apiKeys.AdministrationKey, httpClient: httpClient);
     Invoice        = new InvoiceService(apiKeys.AdministrationKey, httpClient: httpClient);
     PrivateAddress = new PrivateAddressService(apiKeys.AdministrationKey, httpClient: httpClient);
     DirectDebt     = new DirectDebtService(apiKeys.AdministrationKey, httpClient: httpClient);
 }
Esempio n. 26
0
        void btnWebhookAdd_Click(object sender, MVControlEventArgs e)
        {
            try
            {
                // Webhooks need names
                if (edtName.Text.Length <= 0)
                {
                    throw new Exception("Webhooks need to have names.");
                }

                // Either the URL or the PayloadFormatString should have an @ symbol, but just warn
                if (!(edtName.Text.Contains("@") || edtPayload.Text.Contains("@")))
                {
                    Util.WriteToChat("Warning: Neither your URL or JSON had an @ symbol in them which means your webhooks will trigger without a message.");
                }

                // Stop if the name isn't unique
                if (Webhooks != null && Webhooks.Count > 0)
                {
                    List <Webhook> found = Webhooks.FindAll(w => w.Name == edtName.Text);

                    if (found.Count > 0)
                    {
                        throw new Exception("A webhook with this name already exists");
                    }
                }

                Webhook webhook = new Webhook(edtName.Text, edtURL.Text, (string)chcMethod.Data[chcMethod.Selected], edtPayload.Text);
                Webhooks.Add(webhook);

                RefreshWebhooksList();
                RefreshEventTriggerWebhookChoice();
                RefreshTimedTriggerWebhookChoice();
                RefreshChatTriggerWebhookChoice();
                SaveSettings();
            }
            catch (Exception ex)
            {
                Util.WriteToChat("Error adding new Webhook: " + ex.Message);
                Util.LogError(ex);
            }
        }
Esempio n. 27
0
        /// <summary>
        /// Creates an Instance of the TwitchAPI Class.
        /// </summary>
        /// <param name="clientId">Twitch Client Id.</param>
        /// <param name="accessToken">Twitch Access Token.</param>
        /// <param name="rateLimit">Should RateLimit Requests?</param>
        /// <param name="rateLimiter">Instance Of RateLimiter. Useful if using multiple API instances on one connection and you wish to share the requests ratelimiter.</param>
        /// <param name="callsPerPeriod">Number of Requests per Period to rate limit to</param>
        /// <param name="ratePeriod">Period for Rate Limit (In Seconds)</param>
        public TwitchAPI(string clientId = null, string accessToken = null, bool rateLimit = true, IRateLimiter rateLimiter = null, int callsPerPeriod = 1, int ratePeriod = 1)
        {
            _rateLimiter = rateLimit ?
                           (rateLimiter ?? TimeLimiter.GetFromMaxCountByInterval(callsPerPeriod, TimeSpan.FromSeconds(ratePeriod)))
                : BypassLimiter.CreateLimiterBypassInstance();

            Auth            = new Auth(this);
            Blocks          = new Blocks(this);
            Badges          = new Badges(this);
            Bits            = new Bits(this);
            ChannelFeeds    = new ChannelFeeds(this);
            Channels        = new Channels(this);
            Chat            = new Chat(this);
            Clips           = new Clips(this);
            Collections     = new Collections(this);
            Communities     = new Communities(this);
            Follows         = new Follows(this);
            Games           = new Games(this);
            Ingests         = new Ingests(this);
            Root            = new Root(this);
            Search          = new Search(this);
            Streams         = new Streams(this);
            Subscriptions   = new Subscriptions(this);
            Teams           = new Teams(this);
            ThirdParty      = new ThirdParty(this);
            Undocumented    = new Undocumented(this);
            Users           = new Users(this);
            Videos          = new Videos(this);
            Webhooks        = new Webhooks(this);
            Debugging       = new Debugging();
            Settings        = new ApiSettings(this);
            _jsonSerializer = new TwitchLibJsonSerializer();

            if (!string.IsNullOrWhiteSpace(clientId))
            {
                Settings.ClientId = clientId;
            }
            if (!string.IsNullOrWhiteSpace(accessToken))
            {
                Settings.AccessToken = accessToken;
            }
        }
        public async Task <bool> RegisterWebhook(string environment, string url, string userId)
        {
            url = "https://36716537.ngrok.io/account_activity";
            var userCredentials = await CredentialsRetriever.GetUserCredentials(userId);

            var result = await Webhooks.RegisterWebhookAsync(environment, url, userCredentials);

            if (result == null)
            {
                return(false);
            }

            // Register webhook in server
            var webhookEnvironment = Startup.WebhookConfiguration.RegisteredWebhookEnvironments.FirstOrDefault(x =>
                                                                                                               x.Name == environment);

            webhookEnvironment?.AddWebhook(result);

            return(true);
        }
Esempio n. 29
0
        public bool DrawConfigUI()
        {
            var drawConfig = true;

            var scale = ImGui.GetIO().FontGlobalScale;

            var modified = false;

            ImGui.SetNextWindowSize(new Vector2(360 * scale, 350), ImGuiCond.FirstUseEver);
            ImGui.SetNextWindowSizeConstraints(new Vector2(360 * scale, 350), new Vector2(560 * scale, 650));
            ImGui.Begin($"{plugin.Name} Config", ref drawConfig, ImGuiWindowFlags.NoCollapse);

#if DEBUG
            var alwaysShowAlert = AlwaysShowAlert;
            if (ImGui.Checkbox("Debug: Always Alert", ref alwaysShowAlert))
            {
                AlwaysShowAlert = alwaysShowAlert;
                Save();
            }

            if (ImGui.Button("Debug: Print All Alerts"))
            {
                foreach (var r in plugin.RouletteList)
                {
                    if (r.ContentRouletteRoleBonus.Row > 0)
                    {
                        try {
                            plugin.ShowAlert(r, Roulettes[r.RowId], PreferredRole.Tank);
                            plugin.ShowAlert(r, Roulettes[r.RowId], PreferredRole.Healer);
                            plugin.ShowAlert(r, Roulettes[r.RowId], PreferredRole.DPS);
                        } catch (Exception ex) {
                            PluginLog.LogError(ex.ToString());
                        }
                    }
                }
            }
#endif

            var inGameAlerts = InGameAlert;
            if (ImGui.Checkbox("Send alerts in game chat.", ref inGameAlerts))
            {
                InGameAlert = inGameAlerts;
                Save();
            }

            ImGui.SameLine();
            ImGui.SetNextItemWidth(150);

            var selectedDetails = ChatType.GetDetails();

            if (ImGui.BeginCombo("###chatType", ChatType == XivChatType.None ? "Any" : (selectedDetails == null ? ChatType.ToString() : selectedDetails.FancyName)))
            {
                foreach (var chatType in ((XivChatType[])Enum.GetValues(typeof(XivChatType))))
                {
                    var details = chatType.GetDetails();

                    if (ImGui.Selectable(chatType == XivChatType.None ? "Any" : (details == null ? chatType.ToString() : details.FancyName), chatType == ChatType))
                    {
                        ChatType = chatType;
                        Save();
                    }

                    if (chatType == ChatType)
                    {
                        ImGui.SetItemDefaultFocus();
                    }
                }

                ImGui.EndCombo();
            }

            var webhookAlerts = WebhookAlert;
            if (ImGui.Checkbox("Send alerts to webhook.", ref webhookAlerts))
            {
                WebhookAlert = webhookAlerts;
                Save();
            }

            ImGui.SameLine();
            if (ImGui.SmallButton("Setup Webhooks"))
            {
                showWebhookWindow = true;
            }

            ImGui.Separator();
            ImGui.Columns(6, "###cols", false);
            ImGui.SetColumnWidth(0, 40f * scale);
            ImGui.SetColumnWidth(1, ImGui.GetWindowWidth() - 240f * scale);
            ImGui.SetColumnWidth(2, 40f * scale);
            ImGui.SetColumnWidth(3, 40f * scale);
            ImGui.SetColumnWidth(4, 40f * scale);
            ImGui.SetColumnWidth(5, 80f * scale);

            ImGui.NextColumn();
            ImGui.Text("Roulette");
            ImGui.NextColumn();
            ImGui.Text("T");
            ImGui.NextColumn();
            ImGui.Text("H");
            ImGui.NextColumn();
            ImGui.Text("D");
            ImGui.NextColumn();
            ImGui.Text("Current");
            ImGui.NextColumn();

            ImGui.Separator();

            if (plugin.RouletteList != null)
            {
                foreach (var r in plugin.RouletteList.Where(r => r != null && r.ContentRouletteRoleBonus != null && r.ContentRouletteRoleBonus.Row > 0))
                {
                    var rCfg = Roulettes.ContainsKey(r.RowId) ? Roulettes[r.RowId] : new RouletteConfig();
                    modified = ImGui.Checkbox($"###rouletteEnabled{r.RowId}", ref rCfg.Enabled) || modified;
                    ImGui.NextColumn();

                    ImGui.Text(r.Name);
                    ImGui.NextColumn();
                    modified = ImGui.Checkbox($"###rouletteTankEnabled{r.RowId}", ref rCfg.Tank) || modified;
                    ImGui.NextColumn();
                    modified = ImGui.Checkbox($"###rouletteHealerEnabled{r.RowId}", ref rCfg.Healer) || modified;
                    ImGui.NextColumn();
                    modified = ImGui.Checkbox($"###rouletteDPSEnabled{r.RowId}", ref rCfg.DPS) || modified;
                    ImGui.NextColumn();

                    if (plugin.LastPreferredRoleList != null)
                    {
                        var currentRole = plugin.LastPreferredRoleList.Get(r.ContentRouletteRoleBonus.Row);
                        ImGui.Text(currentRole.ToString());
                    }

                    ImGui.NextColumn();

                    Roulettes[r.RowId] = rCfg;
                }
            }

            ImGui.Columns(1);

            ImGui.End();

            if (modified)
            {
                Save();
            }


            if (showWebhookWindow)
            {
                ImGui.Begin($"{plugin.Name}: Webhooks", ref showWebhookWindow);

                ImGui.TextWrapped($"Add webhook urls here to have {plugin.Name} send alerts somewhere else, like discord.");

                ImGui.TextColored(new Vector4(0.5f, 0.5f, 1f, 1f), "Discord Webhook Guide");
                if (ImGui.IsItemHovered())
                {
                    ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
                }

                if (ImGui.IsItemClicked(0))
                {
                    Process.Start("https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks");
                }

                for (var i = 0; i < Webhooks.Count; i++)
                {
                    var url = Webhooks[i];
                    ImGui.SetNextItemWidth(-1);
                    if (ImGui.InputText($"###webhook{i}", ref url, 1024))
                    {
                        Webhooks[i] = url;
                        Save();
                    }
                }

                if (ImGui.SmallButton("Add Webhook"))
                {
                    Webhooks.Add("");
                }

                ImGui.End();
            }


            return(drawConfig);
        }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Account           = new Account(this);
     Token             = new Token(this);
     DirectoryService  = new DirectoryService(this);
     FoldersNavigation = new FoldersNavigation(this);
     Licensing         = new Licensing(this);
     Logs                   = new Logs(this);
     Maintenance            = new Maintenance(this);
     RobotsService          = new RobotsService(this);
     Stats                  = new Stats(this);
     Status                 = new Status(this);
     TestAutomation         = new TestAutomation(this);
     TestDataQueueActions   = new TestDataQueueActions(this);
     Translations           = new Translations(this);
     TaskForms              = new TaskForms(this);
     Alerts                 = new Alerts(this);
     Assets                 = new Assets(this);
     AuditLogs              = new AuditLogs(this);
     Buckets                = new Buckets(this);
     Calendars              = new Calendars(this);
     CredentialStores       = new CredentialStores(this);
     Environments           = new Environments(this);
     ExecutionMedia         = new ExecutionMedia(this);
     Folders                = new Folders(this);
     HostLicenses           = new HostLicenses(this);
     Jobs                   = new Jobs(this);
     JobTriggers            = new JobTriggers(this);
     Libraries              = new Libraries(this);
     LicensesNamedUser      = new LicensesNamedUser(this);
     LicensesRuntime        = new LicensesRuntime(this);
     Machines               = new Machines(this);
     MessageTemplates       = new MessageTemplates(this);
     OrganizationUnits      = new OrganizationUnits(this);
     Permissions            = new Permissions(this);
     Processes              = new Processes(this);
     ProcessSchedules       = new ProcessSchedules(this);
     QueueDefinitions       = new QueueDefinitions(this);
     QueueItemComments      = new QueueItemComments(this);
     QueueItemEvents        = new QueueItemEvents(this);
     QueueItems             = new QueueItems(this);
     QueueProcessingRecords = new QueueProcessingRecords(this);
     Queues                 = new Queues(this);
     Releases               = new Releases(this);
     RobotLogs              = new RobotLogs(this);
     Robots                 = new Robots(this);
     Roles                  = new Roles(this);
     Sessions               = new Sessions(this);
     Settings               = new Settings(this);
     TaskActivities         = new TaskActivities(this);
     TaskCatalogs           = new TaskCatalogs(this);
     TaskNotes              = new TaskNotes(this);
     Tasks                  = new Tasks(this);
     Tenants                = new Tenants(this);
     TestCaseDefinitions    = new TestCaseDefinitions(this);
     TestCaseExecutions     = new TestCaseExecutions(this);
     TestDataQueueItems     = new TestDataQueueItems(this);
     TestDataQueues         = new TestDataQueues(this);
     TestSetExecutions      = new TestSetExecutions(this);
     TestSets               = new TestSets(this);
     TestSetSchedules       = new TestSetSchedules(this);
     UserLoginAttempts      = new UserLoginAttempts(this);
     Users                  = new Users(this);
     Webhooks               = new Webhooks(this);
     GenericTasks           = new GenericTasks(this);
     BaseUri                = new System.Uri("https://cloud.uipath.com");
     SerializationSettings  = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new  List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
 }