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

Returns the Uri for the specified reference.
public static Reference ( long repositoryId ) : Uri
repositoryId long The Id of the repository
Результат System.Uri
Пример #1
0
        public Task <Reference> Update(long repositoryId, string reference, ReferenceUpdate referenceUpdate)
        {
            Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));
            Ensure.ArgumentNotNull(referenceUpdate, nameof(referenceUpdate));

            if (reference.StartsWith("refs/"))
            {
                reference = reference.Replace("refs/", string.Empty);
            }

            return(ApiConnection.Patch <Reference>(ApiUrls.Reference(repositoryId, reference), referenceUpdate));
        }
Пример #2
0
        public Task <IReadOnlyList <Reference> > GetAllForSubNamespace(long repositoryId, string subNamespace, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(subNamespace, nameof(subNamespace));
            Ensure.ArgumentNotNull(options, nameof(options));

            if (subNamespace.StartsWith("refs/"))
            {
                subNamespace = subNamespace.Replace("refs/", string.Empty);
            }

            return(ApiConnection.GetAll <Reference>(ApiUrls.Reference(repositoryId, subNamespace), options));
        }
Пример #3
0
        public Task <Reference> Get(string owner, string name, string reference)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
            Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));

            if (reference.StartsWith("refs/"))
            {
                reference = reference.Replace("refs/", string.Empty);
            }

            return(ApiConnection.Get <Reference>(ApiUrls.Reference(owner, name, reference)));
        }
Пример #4
0
 /// <summary>
 /// Gets all references for a given repository
 /// </summary>
 /// <remarks>
 /// http://developer.github.com/v3/git/refs/#get-all-references
 /// </remarks>
 /// <param name="repositoryId">The Id of the repository</param>
 /// <returns></returns>
 public Task <IReadOnlyList <Reference> > GetAll(long repositoryId)
 {
     return(ApiConnection.GetAll <Reference>(ApiUrls.Reference(repositoryId)));
 }
Пример #5
0
        /// <summary>
        /// Gets a reference for a given repository by reference name
        /// </summary>
        /// <remarks>
        /// http://developer.github.com/v3/git/refs/#get-a-reference
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="reference">The name of the reference</param>
        /// <returns></returns>
        public Task <Reference> Get(long repositoryId, string reference)
        {
            Ensure.ArgumentNotNullOrEmptyString(reference, "reference");

            return(ApiConnection.Get <Reference>(ApiUrls.Reference(repositoryId, reference)));
        }
Пример #6
0
        /// <summary>
        /// Creates a reference for a given repository
        /// </summary>
        /// <remarks>
        /// http://developer.github.com/v3/git/refs/#create-a-reference
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="reference">The reference to create</param>
        /// <returns></returns>
        public Task <Reference> Create(long repositoryId, NewReference reference)
        {
            Ensure.ArgumentNotNull(reference, "reference");

            return(ApiConnection.Post <Reference>(ApiUrls.Reference(repositoryId), reference));
        }
Пример #7
0
        /// <summary>
        /// Deletes a reference for a given repository by reference name
        /// </summary>
        /// <remarks>
        /// http://developer.github.com/v3/git/refs/#delete-a-reference
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="reference">The canonical name of the reference without the 'refs/' prefix. e.g. "heads/master" or "tags/release-1"</param>
        /// <returns></returns>
        public Task Delete(long repositoryId, string reference)
        {
            Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));

            return(ApiConnection.Delete(ApiUrls.Reference(repositoryId, reference)));
        }
Пример #8
0
        /// <summary>
        /// Gets all references for a given repository
        /// </summary>
        /// <remarks>
        /// http://developer.github.com/v3/git/refs/#get-all-references
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="options">Options for changing the API response</param>
        /// <returns></returns>
        public Task <IReadOnlyList <Reference> > GetAll(long repositoryId, ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, nameof(options));

            return(ApiConnection.GetAll <Reference>(ApiUrls.Reference(repositoryId), options));
        }