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)); }
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)); }
/// <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); } }
/// <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); } }
/// <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)); }
/// <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())); }
public Task <IReadOnlyList <RepositoryStar> > GetAllForCurrentWithTimestamps(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); return(ApiConnection.GetAll <RepositoryStar>(ApiUrls.Starred(), null, AcceptHeaders.StarCreationTimestamps, options)); }
public Task <IReadOnlyList <Repository> > GetAllForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); return(ApiConnection.GetAll <Repository>(ApiUrls.Starred(), options)); }