Exemplo n.º 1
0
        public void SearchDigitalSpreadsheet()
        {
            // Set request
            var testFile = TestFiles.SpreadsheetStorageSigned.FirstOrDefault();
            var fileInfo = testFile.GetFileInfo();
            var options  = new SearchDigitalOptions();

            PopulateOptions(options);
            var searchSettings = new SearchSettings();

            searchSettings.FileInfo = fileInfo;
            searchSettings.Options  = new List <SearchOptions>()
            {
                options
            };
            var request = new SearchSignaturesRequest(searchSettings);

            // Get and check result
            var response = SignatureApi.SearchSignatures(request);

            CheckResponse(new List <SearchOptions>()
            {
                options
            }, response, testFile);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Searches for signatures applied to the document
        /// </summary>
        /// <param name="request">Request. <see cref="SearchSignaturesRequest" /></param>
        /// <returns><see cref="SearchResult"/></returns>
        public SearchResult SearchSignatures(SearchSignaturesRequest request)
        {
            // verify the required parameter 'searchSettings' is set
            if (request.searchSettings == null)
            {
                throw new ApiException(400, "Missing required parameter 'searchSettings' when calling SearchSignatures");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/signature/search";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            var postBody = SerializationHelper.Serialize(request.searchSettings); // http body (model) parameter
            var response = this.apiInvoker.InvokeApi(
                resourcePath,
                "POST",
                postBody,
                null,
                null);

            if (response != null)
            {
                return((SearchResult)SerializationHelper.Deserialize(response, typeof(SearchResult)));
            }

            return(null);
        }
Exemplo n.º 3
0
        public void SearchCollectionPdf()
        {
            // Set request
            var testFile = TestFiles.PdfStorageSigned.FirstOrDefault();
            var fileInfo = testFile.GetFileInfo();

            var optionsBarcode = new SearchBarcodeOptions();

            TestsSearchBarcode.PopulateOptions(optionsBarcode);

            var optionsQrCode = new SearchQRCodeOptions();

            TestsSearchQrCode.PopulateOptions(optionsQrCode);

            var optionsDigital = new SearchDigitalOptions();

            TestsSearchDigital.PopulateOptions(optionsDigital);

            var searchSettings = new SearchSettings();

            searchSettings.FileInfo = fileInfo;
            searchSettings.Options  = new List <SearchOptions>()
            {
                optionsBarcode, optionsQrCode, optionsDigital
            };
            var request = new SearchSignaturesRequest(searchSettings);

            // Get and check result
            var response = SignatureApi.SearchSignatures(request);

            CheckResponse(new List <SearchOptions>()
            {
                optionsBarcode, optionsQrCode, optionsDigital
            }, response, testFile);
        }