Repository() публичный статический Метод

Returns the Uri for a repository.
public static Repository ( long repositoryId ) : Uri
repositoryId long The Id of the repository
Результат Uri
Пример #1
0
        public Task Delete(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

            return(ApiConnection.Delete(ApiUrls.Repository(owner, name)));
        }
Пример #2
0
        /// <summary>
        /// Gets the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#get">API documentation</a> for more information.
        /// </remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="Repository"/></returns>
        public Task <Repository> Get(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            return(ApiConnection.Get <Repository>(ApiUrls.Repository(owner, name)));
        }
Пример #3
0
        /// <summary>
        /// Gets the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#get">API documentation</a> for more information.
        /// </remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="Repository"/></returns>
        public Task <Repository> Get(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            return(ApiConnection.Get <Repository>(ApiUrls.Repository(owner, name), null, AcceptHeaders.Concat(AcceptHeaders.SquashCommitPreview, AcceptHeaders.LicensesApiPreview)));
        }
Пример #4
0
        public Task <Repository> Get(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

            return(ApiConnection.Get <Repository>(ApiUrls.Repository(owner, name), null, AcceptHeaders.VisibilityPreview));
        }
Пример #5
0
        /// <summary>
        /// Updates the specified repository with the values given in <paramref name="update"/>
        /// </summary>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="update">New values to update the repository with</param>
        /// <returns>The updated <see cref="T:Octokit.Repository"/></returns>
        public Task <Repository> Edit(string owner, string name, RepositoryUpdate update)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(update, "update");

            return(ApiConnection.Patch <Repository>(ApiUrls.Repository(owner, name), update));
        }
Пример #6
0
        /// <summary>
        /// Updates the specified repository with the values given in <paramref name="update"/>
        /// </summary>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="update">New values to update the repository with</param>
        /// <returns>The updated <see cref="T:Octokit.Repository"/></returns>
        public Task <Repository> Edit(string owner, string name, RepositoryUpdate update)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(update, "update");
            Ensure.ArgumentNotNull(update.Name, "update.Name");

            return(ApiConnection.Patch <Repository>(ApiUrls.Repository(owner, name), update, AcceptHeaders.Concat(AcceptHeaders.SquashCommitPreview, AcceptHeaders.LicensesApiPreview)));
        }
Пример #7
0
        public Task <Repository> Edit(string owner, string name, RepositoryUpdate update)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
            Ensure.ArgumentNotNull(update, nameof(update));
            Ensure.ArgumentNotNull(update.Name, nameof(update.Name));

            return(ApiConnection.Patch <Repository>(ApiUrls.Repository(owner, name), update, AcceptHeaders.VisibilityPreview));
        }
Пример #8
0
 /// <summary>
 /// Gets the specified repository.
 /// </summary>
 /// <remarks>
 /// See the <a href="http://developer.github.com/v3/repos/#get">API documentation</a> for more information.
 /// </remarks>
 /// <param name="repositoryId">The Id of the repository</param>
 /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
 /// <returns>A <see cref="Repository"/></returns>
 public Task <Repository> Get(long repositoryId)
 {
     return(ApiConnection.Get <Repository>(ApiUrls.Repository(repositoryId), null, AcceptHeaders.Concat(AcceptHeaders.SquashCommitPreview, AcceptHeaders.LicensesApiPreview)));
 }
Пример #9
0
        /// <summary>
        /// Updates the specified repository with the values given in <paramref name="update"/>
        /// </summary>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="update">New values to update the repository with</param>
        /// <returns>The updated <see cref="T:Octokit.Repository"/></returns>
        public Task <Repository> Edit(long repositoryId, RepositoryUpdate update)
        {
            Ensure.ArgumentNotNull(update, "update");

            return(ApiConnection.Patch <Repository>(ApiUrls.Repository(repositoryId), update, AcceptHeaders.Concat(AcceptHeaders.SquashCommitPreview, AcceptHeaders.LicensesApiPreview)));
        }
Пример #10
0
 /// <summary>
 /// Deletes the specified repository.
 /// </summary>
 /// <remarks>
 /// See the <a href="http://developer.github.com/v3/repos/#delete-a-repository">API documentation</a> for more information.
 /// Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.
 /// </remarks>
 /// <param name="repositoryId">The Id of the repository</param>
 /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
 public Task Delete(long repositoryId)
 {
     return(ApiConnection.Delete(ApiUrls.Repository(repositoryId)));
 }
Пример #11
0
 /// <summary>
 /// Gets the specified repository.
 /// </summary>
 /// <remarks>
 /// See the <a href="http://developer.github.com/v3/repos/#get">API documentation</a> for more information.
 /// </remarks>
 /// <param name="repositoryId">The Id of the repository</param>
 /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
 /// <returns>A <see cref="Repository"/></returns>
 public Task <Repository> Get(long repositoryId)
 {
     return(ApiConnection.Get <Repository>(ApiUrls.Repository(repositoryId)));
 }
Пример #12
0
        /// <summary>
        /// Updates the specified repository with the values given in <paramref name="update"/>
        /// </summary>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="update">New values to update the repository with</param>
        /// <returns>The updated <see cref="T:Octokit.Repository"/></returns>
        public Task <Repository> Edit(long repositoryId, RepositoryUpdate update)
        {
            Ensure.ArgumentNotNull(update, "update");

            return(ApiConnection.Patch <Repository>(ApiUrls.Repository(repositoryId), update));
        }