Exemple #1
0
        public async Task <R2Ping> GetCurrentUserPing(string pkgFilename, CancellationToken cancelTkn)
        {
            var list = await _client.List <PingsForCurrentUser1>(cancelTkn);

            if (list.Count == 0)
            {
                throw Fault.NoItems("Pings for current user");
            }

            var named = list.Where(x
                                   => x.PackageFilename == pkgFilename).ToList();

            if (named.Count == 0)
            {
                throw Fault
                      .NoMatch <R2Ping>("PkgFilename", pkgFilename);
            }

            if (named.Count > 1)
            {
                throw Fault
                      .NonSolo($"Pings for {pkgFilename}", named.Count);
            }

            return(named.First());
        }
Exemple #2
0
 public Task <List <R2PackagePart> > ListByPkgHash(string packageFilename, string packageHash, CancellationToken cancelTkn)
 => _client.List <R2PackagePart, PartsByPkgHash1>(cancelTkn, packageFilename, packageHash);
 public Task <List <R2ErrorTicket> > List(ErrorState ticketStatus, CancellationToken cancelTkn)
 => _client.List <R2ErrorTicket, ErrorsByStatus1>(cancelTkn, (int)ticketStatus);
 public Task <List <R2Package> > ListByFilename(string pkgFilename, CancellationToken cancelTkn)
 => _client.List <R2Package, PackagesByFilename1>(cancelTkn, pkgFilename);