예제 #1
0
 public Dictionary <string, StatusResult> ClearFlags(params string[] ids)
 {
     return(_innerClient
            .ClearFlags(GrpcExtensions.IdSetFromIds(ids))
            .Entry
            .ToDictionary());
 }
예제 #2
0
 public IEnumerable <string> Existing(params string[] ids)
 {
     return(_innerClient
            .Existing(GrpcExtensions.IdSetFromIds(ids))
            .Id
            .AsEnumerable());
 }
예제 #3
0
        private static Dictionary <string, StatusResult> ChangeFlagsInner(
            Func <ChangeFlagsRequest, StatusMap> changeAction,
            IEnumerable <Flag.Types.Reserved> reservedFlags,
            IEnumerable <string> customFlags,
            string[] ids)
        {
            var flags = reservedFlags
                        .Select(x => new Flag {
                Reserved = x
            })
                        .Concat(customFlags.Select(x => new Flag {
                Custom = x
            }));

            return(changeAction(
                       new ChangeFlagsRequest
            {
                Ids = GrpcExtensions.IdSetFromIds(ids),
                Flag = new FlagSet
                {
                    Flag = { flags }
                }
            }
                       )
                   .Entry
                   .ToDictionary());
        }
예제 #4
0
 public Dictionary <string, ImportResult> ImportResult(params string[] ids)
 {
     return(_innerClient
            .ImportResult(GrpcExtensions.IdSetFromIds(ids))
            .Entry
            .ToDictionary());
 }
예제 #5
0
        public byte[] Download(IArchiveType archiveType, params string[] ids)
        {
            var r = _innerClient.Download(new DownloadRequest
            {
                Format = new Archiver {
                    Format = archiveType.Format, Type = archiveType.Type
                },
                Ids = GrpcExtensions.IdSetFromIds(ids)
            });
            var list = r.ResponseStream.ToListAsync().Result;

            return(list.SelectMany(x => x.Data.ToByteArray()).ToArray());
        }
예제 #6
0
        public async Task <IEnumerable <string> > WithFlagAsync(params string[] ids)
        {
            var withFlag = await _innerClient.WithFlagAsync(GrpcExtensions.IdSetFromIds(ids));

            return(withFlag.Id.AsEnumerable());
        }
예제 #7
0
        public async Task <Dictionary <string, StatusResult> > ImportAsync(params string[] ids)
        {
            var statusMap = await _innerClient.ImportAsync(GrpcExtensions.IdSetFromIds(ids));

            return(statusMap.Entry.ToDictionary());
        }
예제 #8
0
        public async Task <Dictionary <string, ImportResult> > ImportResultAsync(params string[] ids)
        {
            var importResult = await _innerClient.ImportResultAsync(GrpcExtensions.IdSetFromIds(ids));

            return(importResult.Entry.ToDictionary());
        }
예제 #9
0
        public async Task <IEnumerable <string> > ExistingAsync(params string[] ids)
        {
            var idSet = await _innerClient.ExistingAsync(GrpcExtensions.IdSetFromIds(ids));

            return(idSet.Id.AsEnumerable());
        }