1 #ifndef PUBSEQ_GATEWAY_CONVERT_UTILS__HPP
2 #define PUBSEQ_GATEWAY_CONVERT_UTILS__HPP
3 
4 /*  $Id: pubseq_gateway_convert_utils.hpp 619307 2020-11-03 13:09:26Z satskyse $
5  * ===========================================================================
6  *
7  *                            PUBLIC DOMAIN NOTICE
8  *               National Center for Biotechnology Information
9  *
10  *  This software/database is a "United States Government Work" under the
11  *  terms of the United States Copyright Act.  It was written as part of
12  *  the author's official duties as a United States Government employee and
13  *  thus cannot be copyrighted.  This software/database is freely available
14  *  to the public for use. The National Library of Medicine and the U.S.
15  *  Government have not placed any restriction on its use or reproduction.
16  *
17  *  Although all reasonable efforts have been taken to ensure the accuracy
18  *  and reliability of the software and data, the NLM and the U.S.
19  *  Government do not and cannot warrant the performance or results that
20  *  may be obtained by using this software or data. The NLM and the U.S.
21  *  Government disclaim all warranties, express or implied, including
22  *  warranties of performance, merchantability or fitness for any particular
23  *  purpose.
24  *
25  *  Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Sergey Satskiy
30  *
31  * File Description: Various format conversion utilities
32  *
33  *
34  */
35 
36 #include <connect/services/json_over_uttp.hpp>
37 #include <objtools/pubseq_gateway/impl/cassandra/blob_record.hpp>
38 #include <objtools/pubseq_gateway/impl/cassandra/bioseq_info/record.hpp>
39 #include <objtools/pubseq_gateway/impl/cassandra/nannot/record.hpp>
40 #include <objtools/pubseq_gateway/impl/cassandra/si2csi/record.hpp>
41 #include <objtools/pubseq_gateway/impl/cassandra/request.hpp>
42 #include <objtools/pubseq_gateway/impl/cassandra/nannot_task/fetch.hpp>
43 #include <objtools/pubseq_gateway/impl/cassandra/blob_task/load_blob.hpp>
44 #include <objtools/pubseq_gateway/impl/cassandra/blob_task/fetch_split_history.hpp>
45 #include <objtools/pubseq_gateway/impl/cassandra/status_history/get_public_comment.hpp>
46 
47 #include "pubseq_gateway_types.hpp"
48 #include "pubseq_gateway_utils.hpp"
49 
50 
51 USING_NCBI_SCOPE;
52 USING_IDBLOB_SCOPE;
53 
54 #include <string>
55 using namespace std;
56 
57 
58 string ToBioseqProtobuf(const CBioseqInfoRecord &  bioseq_info);
59 CJsonNode ToJson(const CBioseqInfoRecord &  bioseq_info,
60                  SPSGS_ResolveRequest::TPSGS_BioseqIncludeData  include_data_flags,
61                  const string &  custom_blob_id = "");
62 CJsonNode ToJson(const CBlobRecord &  blob);
63 CJsonNode ToJson(const CNAnnotRecord &  annot_record, int32_t  sat,
64                  const string &  custom_blob_id = "");
65 
66 CJsonNode ToJson(const CBioseqInfoFetchRequest &  request);
67 CJsonNode ToJson(const CSi2CsiFetchRequest &  request);
68 CJsonNode ToJson(const CBlobFetchRequest &  request);
69 
70 CJsonNode ToJson(const CSI2CSIRecord &  record);
71 
72 CJsonNode ToJson(const CCassBlobTaskLoadBlob &  request);
73 CJsonNode ToJson(const CCassBlobTaskFetchSplitHistory &  request);
74 CJsonNode ToJson(const CCassNAnnotTaskFetch &  request);
75 CJsonNode ToJson(const CCassStatusHistoryTaskGetPublicComment &  request);
76 
77 #endif
78