Beispiel #1
0
        /// <inheritdoc/>
        protected override async Task <object> CallGitHubApi(DialogContext dc, Octokit.GitHubClient gitHubClient, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (User != null && Since != null && Options != null)
            {
                var userValue    = User.GetValue(dc.State);
                var sinceValue   = Since.GetValue(dc.State);
                var optionsValue = Options.GetValue(dc.State);
                return(await gitHubClient.Gist.GetAllForUser(userValue, sinceValue, optionsValue).ConfigureAwait(false));
            }
            if (User != null && Options != null)
            {
                var userValue    = User.GetValue(dc.State);
                var optionsValue = Options.GetValue(dc.State);
                return(await gitHubClient.Gist.GetAllForUser(userValue, optionsValue).ConfigureAwait(false));
            }
            if (User != null && Since != null)
            {
                var userValue  = User.GetValue(dc.State);
                var sinceValue = Since.GetValue(dc.State);
                return(await gitHubClient.Gist.GetAllForUser(userValue, sinceValue).ConfigureAwait(false));
            }
            if (User != null)
            {
                var userValue = User.GetValue(dc.State);
                return(await gitHubClient.Gist.GetAllForUser(userValue).ConfigureAwait(false));
            }

            throw new ArgumentNullException("Required [user] arguments missing for GitHubClient.Gist.GetAllForUser");
        }
Beispiel #2
0
 /// <inheritdoc/>
 protected override async Task <object> CallGitHubApi(DialogContext dc, Octokit.GitHubClient gitHubClient, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (Since != null && Options != null)
     {
         var sinceValue   = Since.GetValue(dc.State);
         var optionsValue = Options.GetValue(dc.State);
         return(await gitHubClient.Gist.GetAllStarred(sinceValue, optionsValue).ConfigureAwait(false));
     }
     if (Options != null)
     {
         var optionsValue = Options.GetValue(dc.State);
         return(await gitHubClient.Gist.GetAllStarred(optionsValue).ConfigureAwait(false));
     }
     if (Since != null)
     {
         var sinceValue = Since.GetValue(dc.State);
         return(await gitHubClient.Gist.GetAllStarred(sinceValue).ConfigureAwait(false));
     }
     else
     {
         return(await gitHubClient.Gist.GetAllStarred().ConfigureAwait(false));
     }
 }