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>())); }
internal bool Downvote(string packageId) { return(FailFunc.TryExecute(() => { var pkgResponse = this.client.ExecuteAndDeserialize(new Downvote(packageId)); return pkgResponse.success; }, false)); }
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))); }
private bool ExecuteTermsOfUseCall(bool queryAcceptanceStatus) { return(FailFunc.TryExecute(() => { var request = new TermsOfUse(queryAcceptanceStatus); var response = client.ExecuteAndDeserializeWithContent <TermsOfUseStatus>(request); return response.content.accepted; }, false)); }
/// <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>())); }
/// <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); }