コード例 #1
0
ファイル: ApiExtensions.cs プロジェクト: artfuldev/Tookan.NET
        /// <summary>
        /// Gets all API resources in the list at the specified URI.
        /// </summary>
        /// <typeparam name="T">Type of the API resource in the list.</typeparam>
        /// <param name="connection">The connection to use</param>
        /// <param name="uri">URI of the API resource to get</param>
        /// <returns><see cref="IReadOnlyList{T}"/> of the The API resources in the list.</returns>
        /// <exception cref="ApiException">Thrown when an API error occurs.</exception>
        public static Task <IReadOnlyList <T> > GetAll <T>(this IApiConnection connection, Uri uri)
        {
            Ensure.ArgumentIsNotNull(connection, "connection");
            Ensure.ArgumentIsNotNull(uri, "uri");

            return(connection.GetAll <T>(uri, null));
        }
コード例 #2
0
        /// <summary>
        /// Gets all API resources in the list at the specified URI.
        /// </summary>
        /// <typeparam name="T">Type of the API resource in the list.</typeparam>
        /// <param name="connection">The connection to use</param>
        /// <param name="uri">URI of the API resource to get</param>
        /// <returns><see cref="IReadOnlyList{T}"/> of the API resources in the list.</returns>
        /// <exception cref="ApiException">Thrown when an API error occurs.</exception>
        public static Task <IReadOnlyList <T> > GetAll <T>(this IApiConnection connection, Uri uri)
        {
            Ensure.ArgumentNotNull(connection, nameof(connection));
            Ensure.ArgumentNotNull(uri, nameof(uri));

            return(connection.GetAll <T>(uri, ApiOptions.None));
        }
コード例 #3
0
        /// <summary>
        /// Gets all commits for a given repository
        /// </summary>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="request">Used to filter list of commits returned</param>
        /// <param name="options">Options for changing the API response</param>
        /// <returns></returns>
        public Task <IReadOnlyList <GitHubCommit> > GetAll(string owner, string name, CommitRequest request, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(request, "request");

            return(_apiConnection.GetAll <GitHubCommit>(ApiUrls.RepositoryCommits(owner, name), request.ToParametersDictionary(), options));
        }