Beispiel #1
0
        /// <summary>
        /// Get content hash list for strong fingerprint
        /// </summary>
        public Task <GetContentHashListResult> GetContentHashListAsync(OperationContext context, StrongFingerprint strongFingerprint)
        {
            return(PerformOperationAsync(
                       context,
                       async sessionContext =>
            {
                var request = new GetContentHashListRequest()
                {
                    Header = sessionContext.CreateHeader(),
                    Fingerprint = strongFingerprint.ToGrpc(),
                };

                GetContentHashListResponse response = await SendGrpcRequestAndThrowIfFailedAsync(
                    sessionContext,
                    async() => await Client.GetContentHashListAsync(request));

                return response.FromGrpc();
            }));
        }
Beispiel #2
0
        /// <summary>
        /// Add or get content hash list for strong fingerprint
        /// </summary>
        public Task <AddOrGetContentHashListResult> AddOrGetContentHashListAsync(OperationContext context, StrongFingerprint strongFingerprint, ContentHashListWithDeterminism contentHashListWithDeterminism)
        {
            return(PerformOperationAsync(
                       context,
                       async sessionContext =>
            {
                var request = new AddOrGetContentHashListRequest
                {
                    Header = sessionContext.CreateHeader(),
                    Fingerprint = strongFingerprint.ToGrpc(),
                    HashList = contentHashListWithDeterminism.ToGrpc(),
                };

                AddOrGetContentHashListResponse response = await SendGrpcRequestAndThrowIfFailedAsync(
                    sessionContext,
                    async() => await Client.AddOrGetContentHashListAsync(request),
                    throwFailures: false);

                return response.FromGrpc();
            }));
        }