RepositoryHookTest() public static method

Returns the Uri that can tests a specified repository hook
public static RepositoryHookTest ( long repositoryId, int hookId ) : Uri
repositoryId long The Id of the repository
hookId int The identifier of the repository hook
return Uri
Example #1
0
        /// <summary>
        /// Tests a hook for a repository
        /// </summary>
        /// <param name="owner">The repository's owner</param>
        /// <param name="name">The repository's name</param>
        /// <param name="hookId">The repository's hook id</param>
        /// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#test-a-hook">API documentation</a> for more information.
        /// This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook
        /// is not subscribed to push events, the server will respond with 204 but no test POST will be generated.</remarks>
        public Task Test(string owner, string name, int hookId)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            return(ApiConnection.Post(ApiUrls.RepositoryHookTest(owner, name, hookId)));
        }
        /// <summary>
        /// Tests a hook for a repository
        /// </summary>
        /// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#test-a-hook">API documentation</a> for more information.
        /// This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook
        /// is not subscribed to push events, the server will respond with 204 but no test POST will be generated.</remarks>
        /// <returns></returns>
        public Task Test(string owner, string repositoryName, int hookId)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");

            return(ApiConnection.Post <TestRepositoryHook>(ApiUrls.RepositoryHookTest(owner, repositoryName, hookId), new TestRepositoryHook()));
        }
Example #3
0
 /// <summary>
 /// Tests a hook for a repository
 /// </summary>
 /// <param name="repositoryId">The Id of the repository</param>
 /// <param name="hookId">The repository's hook id</param>
 /// <remarks>See <a href="http://developer.github.com/v3/repos/hooks/#test-a-hook">API documentation</a> for more information.
 /// This will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook
 /// is not subscribed to push events, the server will respond with 204 but no test POST will be generated.</remarks>
 public Task Test(long repositoryId, int hookId)
 {
     return(ApiConnection.Post(ApiUrls.RepositoryHookTest(repositoryId, hookId)));
 }