/// <summary> /// Prepare request service address /// </summary> /// <param name="documentId">Document id</param> /// <param name="type">Type of document</param> /// <returns>Address</returns> protected Uri PrepareAddress(string documentId, DocumentTypeRequest type) { var queryParams = new Dictionary <string, string>() { { "dotaz", documentId }, { "doklad", ((int)type).ToString() } }; return(_serviceAddress.AttachQueryParameters(queryParams)); }
/// <summary> /// Check document validity /// </summary> /// <param name="documentId">Document id</param> /// <param name="type">Type of document</param> /// <returns>Document information</returns> public async Task <InvalidDocument> ValideAsync(string documentId, DocumentTypeRequest type) { _log.Debug($"Start validation of document id {documentId} as {type.ToString()}"); try { var document = await GetRequestAsync <InvalidDocument>(PrepareAddress(documentId, type)).ConfigureAwait(false); _log.Debug($"End validation of document id {documentId} as {type.ToString()}"); return(document); } catch (Exception ex) { _log.Error(ex, $"Validation of document id {documentId} as {type.ToString()}"); throw; } }