예제 #1
0
 internal IEnumerable <PackageHeader> ListAll()
 {
     return(FailFunc.TryExecute(() => {
         var nv = HeaderCollectionDownload.ByEngine("dynamo");
         var pkgResponse = this.client.ExecuteAndDeserializeWithContent <List <PackageHeader> >(nv);
         return pkgResponse.content;
     }, new List <PackageHeader>()));
 }
예제 #2
0
 internal bool Downvote(string packageId)
 {
     return(FailFunc.TryExecute(() =>
     {
         var pkgResponse = this.client.ExecuteAndDeserialize(new Downvote(packageId));
         return pkgResponse.success;
     }, false));
 }
예제 #3
0
 internal PackageManagerResult Undeprecate(string name)
 {
     return(FailFunc.TryExecute(() =>
     {
         var pkgResponse = this.client.ExecuteAndDeserialize(new Undeprecate(name, PackageEngineName));
         return new PackageManagerResult(pkgResponse.message, pkgResponse.success);
     }, new PackageManagerResult("Failed to send.", false)));
 }
예제 #4
0
 private bool ExecuteTermsOfUseCall(bool queryAcceptanceStatus)
 {
     return(FailFunc.TryExecute(() =>
     {
         var request = new TermsOfUse(queryAcceptanceStatus);
         var response = client.ExecuteAndDeserializeWithContent <TermsOfUseStatus>(request);
         return response.content.accepted;
     }, false));
 }
예제 #5
0
 /// <summary>
 /// Make a call to Package Manager to get the known
 /// supported hosts for package publishing and filtering
 /// </summary>
 internal IEnumerable <string> GetKnownHosts()
 {
     return(FailFunc.TryExecute(() =>
     {
         var hosts = new Hosts();
         var hostsResponse = this.client.ExecuteAndDeserializeWithContent <List <String> >(hosts);
         return hostsResponse.content;
     }, new List <string>()));
 }
예제 #6
0
        /// <summary>
        /// Gets maintainers for a specific package
        /// </summary>
        /// <param name="packageInfo"></param>
        /// <returns></returns>
        internal PackageHeader GetPackageMaintainers(IPackageInfo packageInfo)
        {
            var header = FailFunc.TryExecute(() =>
            {
                var nv          = new GetMaintainers("dynamo", packageInfo.Name);
                var pkgResponse = this.client.ExecuteAndDeserializeWithContent <PackageHeader>(nv);
                return(pkgResponse.content);
            }, null);

            return(header);
        }