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

Returns the Uri that returns all the assets for the specified release for the specified repository.
public static ReleaseAssets ( long repositoryId, int id ) : Uri
repositoryId long The Id of the repository
id int The id of the release
Результат System.Uri
Пример #1
0
        /// <summary>
        /// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="id">The id of the <see cref="Release"/>.</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        public Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(long repositoryId, int id, ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            var endpoint = ApiUrls.ReleaseAssets(repositoryId, id);
            return ApiConnection.GetAll<ReleaseAsset>(endpoint, null, AcceptHeaders.StableVersion, options);
        }
Пример #2
0
        /// <summary>
        /// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release-asset">API documentation</a> for more information.
        /// </remarks>
        /// <param name="owner">The repository's owner</param>
        /// <param name="name">The repository's name</param>
        /// <param name="releaseId">The id of the <see cref="Release"/></param>
        /// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
        /// <returns>The <see cref="ReleaseAsset"/> specified by the asset id.</returns>
        public Task <ReleaseAsset> GetAsset(string owner, string name, int releaseId, int assetId)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            var endpoint = ApiUrls.ReleaseAssets(owner, name, releaseId, assetId);

            return(ApiConnection.Get <ReleaseAsset>(endpoint));
        }
Пример #3
0
        /// <summary>
        /// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
        /// </remarks>
        /// <param name="owner">The repository's owner</param>
        /// <param name="name">The repository's name</param>
        /// <param name="id">The id of the <see cref="Release"/>.</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
        public Task <IReadOnlyList <ReleaseAsset> > GetAssets(string owner, string name, int id)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            var endpoint = ApiUrls.ReleaseAssets(owner, name, id);

            return(ApiConnection.GetAll <ReleaseAsset>(endpoint, null, "application/vnd.github.v3"));
        }
Пример #4
0
        /// <summary>
        /// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
        /// </remarks>
        /// <param name="owner">The repository's owner</param>
        /// <param name="name">The repository's name</param>
        /// <param name="id">The id of the <see cref="Release"/>.</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
        public Task <IReadOnlyList <ReleaseAsset> > GetAllAssets(string owner, string name, int id)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            var endpoint = ApiUrls.ReleaseAssets(owner, name, id);

            return(ApiConnection.GetAll <ReleaseAsset>(endpoint, null, AcceptHeaders.StableVersion));
        }
Пример #5
0
        /// <summary>
        /// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release-asset">API documentation</a> for more information.
        /// </remarks>
        /// <param name="owner">The repository's owner</param>
        /// <param name="name">The repository's name</param>
        /// <param name="releaseId">The id of the <see cref="Release"/></param>
        /// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
        /// <param name="data">Description of the asset with its amended data</param>
        /// <returns>The edited <see cref="ReleaseAsset"/>.</returns>
        public Task <ReleaseAsset> EditAsset(string owner, string name, int releaseId, int assetId, ReleaseAssetUpdate data)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(data, "data");

            var endpoint = ApiUrls.ReleaseAssets(owner, name, releaseId, assetId);

            return(ApiConnection.Patch <ReleaseAsset>(endpoint, data));
        }