Exemplo n.º 1
0
        /// <inheritdoc/>
        protected override async Task <object> CallGitHubApi(DialogContext dc, Octokit.GitHubClient gitHubClient, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (Org != null && HookId != null && Hook != null)
            {
                var orgValue    = Org.GetValue(dc.State);
                var hookIdValue = HookId.GetValue(dc.State);
                var hookValue   = Hook.GetValue(dc.State);
                return(await gitHubClient.Organization.Hook.Edit(orgValue, (Int32)hookIdValue, hookValue).ConfigureAwait(false));
            }

            throw new ArgumentNullException("Required [org,hookId,hook] arguments missing for GitHubClient.Organization.Hook.Edit");
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        protected override async Task <object> CallGitHubApi(DialogContext dc, Octokit.GitHubClient gitHubClient, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (Owner != null && Name != null && HookId != null)
            {
                var ownerValue  = Owner.GetValue(dc.State);
                var nameValue   = Name.GetValue(dc.State);
                var hookIdValue = HookId.GetValue(dc.State);
                return(gitHubClient.Repository.Hooks.Test(ownerValue, nameValue, (Int32)hookIdValue));
            }
            if (RepositoryId != null && HookId != null)
            {
                var repositoryIdValue = RepositoryId.GetValue(dc.State);
                var hookIdValue       = HookId.GetValue(dc.State);
                return(gitHubClient.Repository.Hooks.Test((Int64)repositoryIdValue, (Int32)hookIdValue));
            }

            throw new ArgumentNullException("Required [hookId] arguments missing for GitHubClient.Repository.Hooks.Test");
        }