Starred() public static method

Returns the Uri that lists the starred repositories for the authenticated user.
public static Starred ( ) : Uri
return Uri
コード例 #1
0
        public Task <IReadOnlyList <RepositoryStar> > GetAllForCurrentWithTimestamps(StarredRequest request, ApiOptions options)
        {
            Ensure.ArgumentNotNull(request, nameof(request));
            Ensure.ArgumentNotNull(options, nameof(options));

            return(ApiConnection.GetAll <RepositoryStar>(ApiUrls.Starred(), request.ToParametersDictionary(), AcceptHeaders.StarCreationTimestamps, options));
        }
コード例 #2
0
        public Task <IReadOnlyList <Repository> > GetAllForCurrent(StarredRequest request, ApiOptions options)
        {
            Ensure.ArgumentNotNull(request, nameof(request));
            Ensure.ArgumentNotNull(options, nameof(options));

            return(ApiConnection.GetAll <Repository>(ApiUrls.Starred(), request.ToParametersDictionary(), options));
        }
コード例 #3
0
        /// <summary>
        /// Unstars a repository for the authenticated user.
        /// </summary>
        /// <param name="owner">The owner of the repository to unstar</param>
        /// <param name="name">The name of the repository to unstar</param>
        /// <returns>A <c>bool</c> representing the success of the operation</returns>
        public async Task <bool> RemoveStarFromRepo(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            try
            {
                var statusCode = await Connection.Delete(ApiUrls.Starred(owner, name)).ConfigureAwait(false);

                return(statusCode == HttpStatusCode.NoContent);
            }
            catch (NotFoundException)
            {
                return(false);
            }
        }
コード例 #4
0
        /// <summary>
        /// Stars a repository for the authenticated user.
        /// </summary>
        /// <param name="owner">The owner of the repository to star</param>
        /// <param name="name">The name of the repository to star</param>
        /// <returns>A <c>bool</c> representing the success of starring</returns>
        public async Task <bool> StarRepo(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            try
            {
                var response = await Connection.Put <object>(ApiUrls.Starred(owner, name), null, null).ConfigureAwait(false);

                return(response.HttpResponse.StatusCode == HttpStatusCode.NoContent);
            }
            catch (NotFoundException)
            {
                return(false);
            }
        }
コード例 #5
0
 /// <summary>
 /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user with star creation timestamps.
 /// </summary>
 /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
 /// <returns>
 /// A <see cref="IReadOnlyPagedCollection{RepoStar}"/> of <see cref="Repository"/>(ies) starred by the current authenticated user with star creation timestamps.
 /// </returns>
 public Task <IReadOnlyList <RepositoryStar> > GetAllForCurrentWithTimestamps()
 {
     return(ApiConnection.GetAll <RepositoryStar>(ApiUrls.Starred(), null, AcceptHeaders.StarCreationTimestamps));
 }
コード例 #6
0
 /// <summary>
 /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user.
 /// </summary>
 /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
 /// <returns>
 /// A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>(ies) starred by the current authenticated user.
 /// </returns>
 public Task <IReadOnlyList <Repository> > GetAllForCurrent()
 {
     return(ApiConnection.GetAll <Repository>(ApiUrls.Starred()));
 }
コード例 #7
0
        public Task <IReadOnlyList <RepositoryStar> > GetAllForCurrentWithTimestamps(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, nameof(options));

            return(ApiConnection.GetAll <RepositoryStar>(ApiUrls.Starred(), null, AcceptHeaders.StarCreationTimestamps, options));
        }
コード例 #8
0
        public Task <IReadOnlyList <Repository> > GetAllForCurrent(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, nameof(options));

            return(ApiConnection.GetAll <Repository>(ApiUrls.Starred(), options));
        }