예제 #1
0
        private static void GetPackageVersionHeaderTest()
        {
            var req        = new HeaderVersionDownload("dynamo", "get package version test", "0.1.1");
            var res        = pmc.ExecuteAndDeserializeWithContent <PackageVersion>(req);
            var serializer = new JsonSerializer();

            Console.WriteLine(serializer.Serialize(res.content));
        }
예제 #2
0
        /// <summary>
        /// Gets the metadata for a specific version of a package.
        /// </summary>
        /// <param name="packageInfo">Name and version of a package</param>
        /// <returns>Package version metadata</returns>
        internal virtual PackageVersion GetPackageVersionHeader(string id, string version)
        {
            var req         = new HeaderVersionDownload(id, version);
            var pkgResponse = this.client.ExecuteAndDeserializeWithContent <PackageVersion>(req);

            if (!pkgResponse.success)
            {
                throw new ApplicationException(pkgResponse.message);
            }
            return(pkgResponse.content);
        }
예제 #3
0
        /// <summary>
        /// Gets the metadata for a specific version of a package.
        /// </summary>
        /// <param name="packageInfo">Name and version of a package</param>
        /// <returns>Package version metadata</returns>
        internal PackageVersion GetPackageVersionHeader(IPackageInfo packageInfo)
        {
            var req         = new HeaderVersionDownload("dynamo", packageInfo.Name, packageInfo.Version.ToString());
            var pkgResponse = this.client.ExecuteAndDeserializeWithContent <PackageVersion>(req);

            if (!pkgResponse.success)
            {
                throw new ApplicationException(pkgResponse.message);
            }
            return(pkgResponse.content);
        }