public Task <IReadOnlyList <Repository> > GetAllForCurrent(RepositoryRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, "request"); Ensure.ArgumentNotNull(options, "options"); return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories(), request.ToParametersDictionary(), options)); }
/// <summary> /// Gets all repositories owned by the specified user. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/repos/#list-user-repositories">API documentation</a> for more information. /// </remarks> /// <param name="login">The account name to search for</param> /// <param name="options">Options for changing the API response</param> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns> public Task <IReadOnlyList <Repository> > GetAllForUser(string login, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(login, "login"); Ensure.ArgumentNotNull(options, "options"); return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories(login), options)); }
public Task <IReadOnlyList <Repository> > GetAllForUser(string login, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); Ensure.ArgumentNotNull(options, nameof(options)); return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories(login), null, AcceptHeaders.LicensesApiPreview, options)); }
public Task <IReadOnlyList <Repository> > GetAllForCurrent(RepositoryRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories(), request.ToParametersDictionary(), AcceptHeaders.LicensesApiPreview, options)); }
/// <summary> /// Creates a new repository for the current user. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/repos/#create">API documentation</a> for more information. /// </remarks> /// <param name="newRepository">A <see cref="NewRepository"/> instance describing the new repository to create</param> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>A <see cref="Repository"/> instance for the created repository.</returns> public Task <Repository> Create(NewRepository newRepository) { Ensure.ArgumentNotNull(newRepository, "newRepository"); if (string.IsNullOrEmpty(newRepository.Name)) { throw new ArgumentException("The new repository's name must not be null."); } return(Create(ApiUrls.Repositories(), null, newRepository)); }
/// <summary> /// Creates a new repository for the current user. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/repos/#create">API documentation</a> for more information. /// </remarks> /// <param name="newRepository">A <see cref="NewRepository"/> instance describing the new repository to create</param> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>A <see cref="Repository"/> instance for the created repository.</returns> public Task <Repository> Create(NewRepository newRepository) { Ensure.ArgumentNotNull(newRepository, "newRepository"); return(Create(ApiUrls.Repositories(), null, newRepository)); }
/// <summary> /// Gets all repositories owned by the current user. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/repos/#list-your-repositories">API documentation</a> for more information. /// The default page size on GitHub.com is 30. /// </remarks> /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns> public Task <IReadOnlyList <Repository> > GetAllForCurrent() { return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories())); }
/// <summary> /// Gets all repositories owned by the current user. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/repos/#list-your-repositories">API documentation</a> for more information. /// </remarks> /// <param name="options">Options for changing the API response</param> /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns> public Task <IReadOnlyList <Repository> > GetAllForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories(), options)); }
/// <summary> /// Gets all repositories owned by the current user. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/repos/#list-your-repositories">API documentation</a> for more information. /// </remarks> /// <param name="options">Options for changing the API response</param> /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns> public Task <IReadOnlyList <Repository> > GetAllForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories(), null, AcceptHeaders.LicensesApiPreview, options)); }