1use serde::Deserialize;
2
3
4pub enum CCNewsStatus {
9 ACTIVE,
10 INACTIVE,
11}
12
13impl CCNewsStatus {
14 pub fn to_string(&self) -> String {
16 match self {
17 CCNewsStatus::ACTIVE => String::from("ACTIVE"),
18 CCNewsStatus::INACTIVE => String::from("INACTIVE")
19 }
20 }
21}
22
23
24pub enum CCNewsLang {
26 EN,
27 ES,
28 TR,
29 FR,
30 JP,
31 PT,
32}
33
34impl CCNewsLang {
35 pub fn to_string(&self) -> String {
37 match self {
38 CCNewsLang::EN => String::from("EN"),
39 CCNewsLang::ES => String::from("ES"),
40 CCNewsLang::TR => String::from("TR"),
41 CCNewsLang::FR => String::from("FR"),
42 CCNewsLang::JP => String::from("JP"),
43 CCNewsLang::PT => String::from("PT"),
44 }
45 }
46}
47
48
49pub enum CCNewsSourceID {
55 CoinDesk,
56 CoinTelegraph,
57 BitcoinMagazine,
58 CryptoGlobe,
59 CoinGape,
60 Blockworks,
61 TheDailyHodl,
62 CryptoSlate,
63 CryptoPotato,
64 Decrypt,
65 CryptoBriefing,
66 TheBlock,
67 BitcoinDotCom,
68 NewsBTC,
69 UToday,
70 Bitcoinist,
71 Coinpedia,
72 Cryptonomist,
73 CryptoNewsReview,
74 CCData,
75 Cryptoknowmics,
76 CCN,
77 FinanceMagnates,
78 ETHNewsDotCom,
79 CryptoVest,
80 CryptoInsider,
81 HuobiBlog,
82 CoinSpeaker,
83 CoinJoker,
84 NintyNineBitcoins,
85 Cointelligence,
86 OKXInsights,
87 CryptoCoreMedia,
88 Bitcoinerx,
89 AMBCrypto,
90 Coinpaprika,
91 LiveBitcoinNews,
92 CryptoCompare,
93 BitDegree,
94 TheCoinRepublic,
95 Chaindd,
96 Chaintimes,
97 TheCoinRise,
98 CryptoNewsZ,
99 YahooFinanceBitcoin,
100 VauldInsights,
101 ZyCrypto,
102 KrakenBlog,
103 Coincu,
104 DailyCoin,
105 TrustNodes,
106 Coinnounce,
107 CoinEdition,
108 BitcoinSistemi,
109 TheNewsCrypto,
110 ForbesDigitalAssets,
111 Cryptonews,
112 TimesNext,
113 EthereumWorldNews,
114 CryptoCoinDotNews,
115 BTCPulse,
116 BloombergCrypto,
117 CoinOtag,
118 CryptoDotNews,
119 Chainwire,
120 CryptoIntelligence,
121 Coinpaper,
122 BitfinexBlog,
123 TheCryptoBasic,
124 NFTDotNews,
125 Blokt,
126 BitcoinWorld,
127 CryptoDaily,
128 TimesTabloid,
129 CoinTurkNews,
130 Invezz,
131 SeekingAlpha,
132 Finbold,
133 FinancialTimesCrypto,
134 Cryptopolitan,
135 NullTx,
136 TipRanks,
137 TheDefiant,
138}
139
140impl CCNewsSourceID {
141 pub fn to_string(&self) -> String {
143 match self {
144 CCNewsSourceID::CoinDesk => String::from("coindesk"),
145 CCNewsSourceID::CoinTelegraph => String::from("cointelegraph"),
146 CCNewsSourceID::BitcoinMagazine => String::from("bitcoinmagazine"),
147 CCNewsSourceID::CryptoGlobe => String::from("cryptoglobe"),
148 CCNewsSourceID::CoinGape => String::from("coingape"),
149 CCNewsSourceID::Blockworks => String::from("blockworks"),
150 CCNewsSourceID::TheDailyHodl => String::from("dailyhodl"),
151 CCNewsSourceID::CryptoSlate => String::from("cryptoslate"),
152 CCNewsSourceID::CryptoPotato => String::from("cryptopotato"),
153 CCNewsSourceID::Decrypt => String::from("decrypt"),
154 CCNewsSourceID::CryptoBriefing => String::from("cryptobriefing"),
155 CCNewsSourceID::TheBlock => String::from("theblock"),
156 CCNewsSourceID::BitcoinDotCom => String::from("bitcoin.com"),
157 CCNewsSourceID::NewsBTC => String::from("newsbtc"),
158 CCNewsSourceID::UToday => String::from("utoday"),
159 CCNewsSourceID::Bitcoinist => String::from("bitcoinist"),
160 CCNewsSourceID::Coinpedia => String::from("coinpedia"),
161 CCNewsSourceID::Cryptonomist => String::from("cryptonomist"),
162 CCNewsSourceID::CryptoNewsReview => String::from("cryptonewsreview"),
163 CCNewsSourceID::CCData => String::from("ccdata"),
164 CCNewsSourceID::Cryptoknowmics => String::from("cryptokowmics"),
165 CCNewsSourceID::CCN => String::from("ccn"),
166 CCNewsSourceID::FinanceMagnates => String::from("financemagnates"),
167 CCNewsSourceID::ETHNewsDotCom => String::from("ethnews.com"),
168 CCNewsSourceID::CryptoVest => String::from("cryptovest"),
169 CCNewsSourceID::CryptoInsider => String::from("cryptoinsider"),
170 CCNewsSourceID::HuobiBlog => String::from("huobi"),
171 CCNewsSourceID::CoinSpeaker => String::from("coinspeaker"),
172 CCNewsSourceID::CoinJoker => String::from("coinjoker"),
173 CCNewsSourceID::NintyNineBitcoins => String::from("99bitcoins"),
174 CCNewsSourceID::Cointelligence => String::from("cointelligence"),
175 CCNewsSourceID::OKXInsights => String::from("okexinsights"),
176 CCNewsSourceID::CryptoCoreMedia => String::from("cryptocoremedia"),
177 CCNewsSourceID::Bitcoinerx => String::from("bitcoinerx"),
178 CCNewsSourceID::AMBCrypto => String::from("ambcrypto"),
179 CCNewsSourceID::Coinpaprika => String::from("coinpaprika"),
180 CCNewsSourceID::LiveBitcoinNews => String::from("livebitcoinnews"),
181 CCNewsSourceID::CryptoCompare => String::from("cryptocompare"),
182 CCNewsSourceID::BitDegree => String::from("bitdegree"),
183 CCNewsSourceID::TheCoinRepublic => String::from("coinrepublic"),
184 CCNewsSourceID::Chaindd => String::from("chaindd"),
185 CCNewsSourceID::Chaintimes => String::from("chaintimes"),
186 CCNewsSourceID::TheCoinRise => String::from("thecoinrise"),
187 CCNewsSourceID::CryptoNewsZ => String::from("cryptonewsz"),
188 CCNewsSourceID::YahooFinanceBitcoin => String::from("yahoofinance"),
189 CCNewsSourceID::VauldInsights => String::from("vauld_insights"),
190 CCNewsSourceID::ZyCrypto => String::from("zycrypto"),
191 CCNewsSourceID::KrakenBlog => String::from("krakenblog"),
192 CCNewsSourceID::Coincu => String::from("coincu"),
193 CCNewsSourceID::DailyCoin => String::from("dailycoin"),
194 CCNewsSourceID::TrustNodes => String::from("trustnodes"),
195 CCNewsSourceID::Coinnounce => String::from("coinnounce"),
196 CCNewsSourceID::CoinEdition => String::from("coinquora"),
197 CCNewsSourceID::BitcoinSistemi => String::from("bitcoinsistemi"),
198 CCNewsSourceID::TheNewsCrypto => String::from("thenewscrypto"),
199 CCNewsSourceID::ForbesDigitalAssets => String::from("forbes"),
200 CCNewsSourceID::Cryptonews => String::from("cryptonews"),
201 CCNewsSourceID::TimesNext => String::from("timesnext"),
202 CCNewsSourceID::EthereumWorldNews => String::from("ethereumworldnews"),
203 CCNewsSourceID::CryptoCoinDotNews => String::from("cryptocoinnews"),
204 CCNewsSourceID::BTCPulse => String::from("btcpulse"),
205 CCNewsSourceID::BloombergCrypto => String::from("bloomberg_crypto_"),
206 CCNewsSourceID::CoinOtag => String::from("coinotag"),
207 CCNewsSourceID::CryptoDotNews => String::from("crypto_news"),
208 CCNewsSourceID::Chainwire => String::from("chainwire"),
209 CCNewsSourceID::CryptoIntelligence => String::from("cryptointelligence"),
210 CCNewsSourceID::Coinpaper => String::from("coinpaper"),
211 CCNewsSourceID::BitfinexBlog => String::from("bitfinexblog"),
212 CCNewsSourceID::TheCryptoBasic => String::from("thecryptobasic"),
213 CCNewsSourceID::NFTDotNews => String::from("nft_news"),
214 CCNewsSourceID::Blokt => String::from("blokt"),
215 CCNewsSourceID::BitcoinWorld => String::from("bitcoinworld"),
216 CCNewsSourceID::CryptoDaily => String::from("cryptodaily"),
217 CCNewsSourceID::TimesTabloid => String::from("timestabloid"),
218 CCNewsSourceID::CoinTurkNews => String::from("cointurken"),
219 CCNewsSourceID::Invezz => String::from("invezz"),
220 CCNewsSourceID::SeekingAlpha => String::from("seekingalpha"),
221 CCNewsSourceID::Finbold => String::from("finbold"),
222 CCNewsSourceID::FinancialTimesCrypto => String::from("financial_times_"),
223 CCNewsSourceID::Cryptopolitan => String::from("cryptopolitan"),
224 CCNewsSourceID::NullTx => String::from("themerkle"),
225 CCNewsSourceID::TipRanks => String::from("tipranks"),
226 CCNewsSourceID::TheDefiant => String::from("thedefiant"),
227 }
228 }
229}
230
231#[derive(Deserialize, Debug)]
232pub struct CCCategoryData {
233 #[serde(rename = "TYPE")]
234 pub type_: String,
236 #[serde(rename = "ID")]
237 pub id: i32,
239 #[serde(rename = "NAME")]
240 pub name: String,
242 #[serde(rename = "CATEGORY")]
243 pub category: String,
244}
245
246#[derive(Deserialize, Debug)]
248pub struct CCNewsLatestArticle {
249 #[serde(rename = "TYPE")]
250 pub type_: String,
252 #[serde(rename = "ID")]
253 pub id: i32,
255 #[serde(rename = "GUID")]
256 pub guid: String,
259 #[serde(rename = "PUBLISHED_ON")]
260 pub published_on: i64,
263 #[serde(rename = "IMAGE_URL")]
264 pub image_url: String,
267 #[serde(rename = "TITLE")]
268 pub title: String,
270 #[serde(rename = "URL")]
271 pub url: String,
274 #[serde(rename = "SOURCE_ID")]
275 pub source_id: i32,
278 #[serde(rename = "BODY")]
279 pub body: String,
282 #[serde(rename = "KEYWORDS")]
283 pub keywords: String,
286 #[serde(rename = "LANG")]
287 pub lang: String,
289 #[serde(rename = "UPVOTES")]
290 pub upvotes: i32,
292 #[serde(rename = "DOWNVOTES")]
293 pub downvotes: i32,
295 #[serde(rename = "SCORE")]
296 pub score: i32,
298 #[serde(rename = "SENTIMENT")]
299 pub sentiment: String,
301 #[serde(rename = "STATUS")]
302 pub status: String,
304 #[serde(rename = "CREATED_ON")]
305 pub created_on: i64,
307 #[serde(rename = "UPDATED_ON")]
308 pub updated_on: Option<i64>,
310 #[serde(rename = "SOURCE_DATA")]
311 pub source_data: CCNewsSource,
313 #[serde(rename = "CATEGORY_DATA")]
314 pub category_date: Vec<CCCategoryData>,
316}
317
318
319
320pub enum CCNewsSourceType {
328 RSS,
329 API,
330 TWITTER,
331}
332
333impl CCNewsSourceType {
334 pub fn to_string(&self) -> String {
336 match self {
337 CCNewsSourceType::RSS => String::from("RSS"),
338 CCNewsSourceType::API => String::from("API"),
339 CCNewsSourceType::TWITTER => String::from("TWITTER"),
340 }
341 }
342}
343
344
345#[derive(Deserialize, Debug)]
347pub struct CCNewsSource {
348 #[serde(rename = "TYPE")]
349 pub type_: String,
351 #[serde(rename = "ID")]
352 pub id: i32,
354 #[serde(rename = "SOURCE_KEY")]
355 pub source_key: String,
357 #[serde(rename = "NAME")]
358 pub name: String,
360 #[serde(rename = "IMAGE_URL")]
361 pub image_url: String,
363 #[serde(rename = "URL")]
364 pub url: String,
366 #[serde(rename = "LANG")]
367 pub lang: String,
369 #[serde(rename = "SOURCE_TYPE")]
370 pub source_type: String,
372 #[serde(rename = "LAUNCH_DATE")]
373 pub launch_date: Option<i64>,
375 #[serde(rename = "SORT_ORDER")]
376 pub sort_order: i32,
378 #[serde(rename = "BENCHMARK_SCORE")]
379 pub benchmark_score: i32,
380 #[serde(rename = "STATUS")]
381 pub status: String,
383 #[serde(rename = "LAST_UPDATED_TS")]
384 pub last_updated_ts: i64,
386 #[serde(rename = "CREATED_ON")]
387 pub created_on: i64,
389 #[serde(rename = "UPDATED_ON")]
390 pub updated_on: i64,
392}
393
394
395#[derive(Deserialize, Debug)]
400pub struct CCCategoryFilter {
401 #[serde(rename = "INCLUDED_WORDS")]
402 pub included_words: Option<Vec<String>>,
404 #[serde(rename = "INCLUDED_PHRASES")]
405 pub included_phrases: Option<Vec<String>>,
407 #[serde(rename = "EXCLUDED_PHRASES")]
408 pub excluded_phrases: Option<Vec<String>>,
410}
411
412
413#[derive(Deserialize, Debug)]
415pub struct CCNewsCategory {
416 #[serde(rename = "TYPE")]
417 pub type_: String,
419 #[serde(rename = "ID")]
420 pub id: i32,
422 #[serde(rename = "NAME")]
423 pub name: String,
425 #[serde(rename = "FILTER")]
426 pub filter: Option<CCCategoryFilter>,
428 #[serde(rename = "STATUS")]
429 pub status: String,
431 #[serde(rename = "CREATED_ON")]
432 pub created_on: i64,
434 #[serde(rename = "UPDATED_ON")]
435 pub updated_on: Option<i64>,
437}