コード例 #1
0
        /// <inheritdoc/>
        protected override async Task <object> CallGitHubApi(DialogContext dc, Octokit.GitHubClient gitHubClient, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (Owner != null && Name != null && Sha != null && Options != null)
            {
                var ownerValue   = Owner.GetValue(dc.State);
                var nameValue    = Name.GetValue(dc.State);
                var shaValue     = Sha.GetValue(dc.State);
                var optionsValue = Options.GetValue(dc.State);
                return(await gitHubClient.Repository.Comment.GetAllForCommit(ownerValue, nameValue, shaValue, optionsValue).ConfigureAwait(false));
            }
            if (Owner != null && Name != null && Sha != null)
            {
                var ownerValue = Owner.GetValue(dc.State);
                var nameValue  = Name.GetValue(dc.State);
                var shaValue   = Sha.GetValue(dc.State);
                return(await gitHubClient.Repository.Comment.GetAllForCommit(ownerValue, nameValue, shaValue).ConfigureAwait(false));
            }
            if (RepositoryId != null && Sha != null && Options != null)
            {
                var repositoryIdValue = RepositoryId.GetValue(dc.State);
                var shaValue          = Sha.GetValue(dc.State);
                var optionsValue      = Options.GetValue(dc.State);
                return(await gitHubClient.Repository.Comment.GetAllForCommit((Int64)repositoryIdValue, shaValue, optionsValue).ConfigureAwait(false));
            }
            if (RepositoryId != null && Sha != null)
            {
                var repositoryIdValue = RepositoryId.GetValue(dc.State);
                var shaValue          = Sha.GetValue(dc.State);
                return(await gitHubClient.Repository.Comment.GetAllForCommit((Int64)repositoryIdValue, shaValue).ConfigureAwait(false));
            }

            throw new ArgumentNullException("Required [sha] arguments missing for GitHubClient.Repository.Comment.GetAllForCommit");
        }