cufinder_rust/
types.rs

1use serde::{Deserialize, Serialize};
2
3/// Base response structure for all CUFinder API responses
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct BaseResponse {
6    pub query: Option<serde_json::Value>,
7    #[serde(rename = "credit_count")]
8    pub credit_count: Option<i32>,
9    #[serde(rename = "meta_data")]
10    pub meta_data: Option<serde_json::Value>,
11    #[serde(rename = "confidence_level")]
12    pub confidence_level: Option<i32>,
13}
14
15/// Company social media information
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct CompanySocial {
18    pub facebook: Option<String>,
19    pub linkedin: Option<String>,
20    pub twitter: Option<String>,
21    pub youtube: Option<String>,
22    pub instagram: Option<String>,
23}
24
25/// Company employee information
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct CompanyEmployees {
28    pub range: Option<String>,
29    pub count: Option<i32>,
30}
31
32/// Company main location
33#[derive(Debug, Clone, Serialize, Deserialize)]
34pub struct MainLocation {
35    pub geo: Option<String>,
36    pub country: Option<String>,
37    pub state: Option<String>,
38    pub city: Option<String>,
39    pub address: Option<String>,
40    pub continent: Option<String>,
41    #[serde(rename = "postal_code")]
42    pub postal_code: Option<String>,
43}
44
45/// Company information model
46#[derive(Debug, Clone, Serialize, Deserialize)]
47pub struct Company {
48    pub name: Option<String>,
49    pub domain: Option<String>,
50    #[serde(rename = "linkedin_url")]
51    pub linkedin_url: Option<String>,
52    pub industry: Option<String>,
53    pub overview: Option<String>,
54    pub r#type: Option<String>,
55    pub size: Option<String>,
56    #[serde(rename = "main_location")]
57    pub main_location: Option<MainLocation>,
58    pub location: Option<String>,
59    pub description: Option<String>,
60    pub founded: Option<i32>,
61    pub revenue: Option<String>,
62    pub employees: Option<CompanyEmployees>,
63    pub website: Option<String>,
64    pub phone: Option<String>,
65    pub email: Option<String>,
66    pub social: Option<CompanySocial>,
67    pub technologies: Option<Vec<String>>,
68    pub subsidiaries: Option<Vec<String>>,
69    pub headquarters: Option<String>,
70    pub country: Option<String>,
71    pub state: Option<String>,
72    pub city: Option<String>,
73    #[serde(rename = "zip_code")]
74    pub zip_code: Option<String>,
75    pub address: Option<String>,
76}
77
78/// Current job information
79#[derive(Debug, Clone, Serialize, Deserialize)]
80pub struct CurrentJob {
81    pub title: Option<String>,
82    pub role: Option<String>,
83    pub level: Option<String>,
84}
85
86
87/// Person location information
88#[derive(Debug, Clone, Serialize, Deserialize)]
89pub struct PersonLocation {
90    pub country: Option<String>,
91    pub state: Option<String>,
92    pub city: Option<String>,
93}
94
95/// Person social media information
96#[derive(Debug, Clone, Serialize, Deserialize)]
97pub struct PersonSocial {
98    #[serde(rename = "linkedin_username")]
99    pub linkedin_username: Option<String>,
100    #[serde(rename = "linkedin_connections")]
101    pub linkedin_connections: Option<i32>,
102    pub linkedin: Option<String>,
103    pub twitter: Option<String>,
104    pub facebook: Option<String>,
105    pub github: Option<String>,
106}
107
108/// Person information model
109#[derive(Debug, Clone, Serialize, Deserialize)]
110pub struct Person {
111    #[serde(rename = "first_name")]
112    pub first_name: Option<String>,
113    #[serde(rename = "last_name")]
114    pub last_name: Option<String>,
115    #[serde(rename = "full_name")]
116    pub full_name: Option<String>,
117    pub logo: Option<String>,
118    pub overview: Option<String>,
119    pub experience: Option<serde_json::Value>,
120    pub connections: Option<serde_json::Value>,
121    pub interests: Option<Vec<String>>,
122    pub skills: Option<Vec<String>>,
123    pub educations: Option<Vec<serde_json::Value>>,
124    pub experiences: Option<Vec<serde_json::Value>>,
125    pub certifications: Option<Vec<serde_json::Value>>,
126    pub company: Option<Company>,
127    pub location: Option<PersonLocation>,
128    #[serde(rename = "current_job")]
129    pub current_job: Option<CurrentJob>,
130    pub social: Option<PersonSocial>,
131}
132
133// Response types for each service
134#[derive(Debug, Clone, Serialize, Deserialize)]
135pub struct CufResponse {
136    #[serde(flatten)]
137    pub base: BaseResponse,
138    pub domain: String,
139}
140
141#[derive(Debug, Clone, Serialize, Deserialize)]
142pub struct LcufResponse {
143    #[serde(flatten)]
144    pub base: BaseResponse,
145    #[serde(rename = "linkedin_url")]
146    pub linkedin_url: String,
147}
148
149#[derive(Debug, Clone, Serialize, Deserialize)]
150pub struct DtcResponse {
151    #[serde(flatten)]
152    pub base: BaseResponse,
153    #[serde(rename = "company_name")]
154    pub company_name: String,
155}
156
157#[derive(Debug, Clone, Serialize, Deserialize)]
158pub struct DteResponse {
159    #[serde(flatten)]
160    pub base: BaseResponse,
161    pub emails: Vec<String>,
162}
163
164#[derive(Debug, Clone, Serialize, Deserialize)]
165pub struct NtpResponse {
166    #[serde(flatten)]
167    pub base: BaseResponse,
168    pub phones: Vec<String>,
169}
170
171#[derive(Debug, Clone, Serialize, Deserialize)]
172pub struct RelPerson {
173    #[serde(rename = "full_name")]
174    pub full_name: Option<String>,
175    #[serde(rename = "first_name")]
176    pub first_name: Option<String>,
177    #[serde(rename = "last_name")]
178    pub last_name: Option<String>,
179    #[serde(rename = "linkedin_url")]
180    pub linkedin_url: Option<String>,
181    pub summary: Option<String>,
182    #[serde(rename = "linkedin_followers")]
183    pub linkedin_followers: Option<String>,
184    pub facebook: Option<String>,
185    pub twitter: Option<String>,
186    pub avatar: Option<String>,
187    pub country: Option<String>,
188    pub state: Option<String>,
189    pub city: Option<String>,
190    #[serde(rename = "job_title")]
191    pub job_title: Option<String>,
192    #[serde(rename = "job_title_categories")]
193    pub job_title_categories: Option<Vec<String>>,
194    #[serde(rename = "company_name")]
195    pub company_name: Option<String>,
196    #[serde(rename = "company_linkedin")]
197    pub company_linkedin: Option<String>,
198    #[serde(rename = "company_website")]
199    pub company_website: Option<String>,
200    #[serde(rename = "company_size")]
201    pub company_size: Option<String>,
202    #[serde(rename = "company_industry")]
203    pub company_industry: Option<String>,
204    #[serde(rename = "company_facebook")]
205    pub company_facebook: Option<String>,
206    #[serde(rename = "company_twitter")]
207    pub company_twitter: Option<String>,
208    #[serde(rename = "company_country")]
209    pub company_country: Option<String>,
210    #[serde(rename = "company_state")]
211    pub company_state: Option<String>,
212    #[serde(rename = "company_city")]
213    pub company_city: Option<String>,
214}
215
216#[derive(Debug, Clone, Serialize, Deserialize)]
217pub struct RelResponse {
218    #[serde(flatten)]
219    pub base: BaseResponse,
220    pub person: RelPerson,
221}
222
223#[derive(Debug, Clone, Serialize, Deserialize)]
224pub struct FclCompany {
225    pub name: Option<String>,
226    pub website: Option<String>,
227    #[serde(rename = "employee_count")]
228    pub employee_count: Option<i32>,
229    pub size: Option<String>,
230    pub industry: Option<String>,
231    pub description: Option<String>,
232    #[serde(rename = "linkedin_url")]
233    pub linkedin_url: Option<String>,
234    pub domain: Option<String>,
235    pub country: Option<String>,
236    pub state: Option<String>,
237    pub city: Option<String>,
238    pub address: Option<String>,
239    #[serde(rename = "founded_year")]
240    pub founded_year: Option<String>,
241    #[serde(rename = "logo_url")]
242    pub logo_url: Option<String>,
243    #[serde(rename = "followers_count")]
244    pub followers_count: Option<i32>,
245}
246
247#[derive(Debug, Clone, Serialize, Deserialize)]
248pub struct FclResponse {
249    #[serde(flatten)]
250    pub base: BaseResponse,
251    pub companies: Vec<FclCompany>,
252}
253
254#[derive(Debug, Clone, Serialize, Deserialize)]
255pub struct ElfFundraising {
256    #[serde(rename = "funding_last_round_type")]
257    pub funding_last_round_type: Option<String>,
258    #[serde(rename = "funding_ammount_currency_code")]
259    pub funding_ammount_currency_code: Option<String>,
260    #[serde(rename = "funding_money_raised")]
261    pub funding_money_raised: Option<String>,
262    #[serde(rename = "funding_last_round_investors_url")]
263    pub funding_last_round_investors_url: Option<String>,
264}
265
266#[derive(Debug, Clone, Serialize, Deserialize)]
267pub struct ElfResponse {
268    #[serde(flatten)]
269    pub base: BaseResponse,
270    #[serde(rename = "fundraising_info")]
271    pub fundraising: ElfFundraising,
272}
273
274#[derive(Debug, Clone, Serialize, Deserialize)]
275pub struct CarResponse {
276    #[serde(flatten)]
277    pub base: BaseResponse,
278    #[serde(rename = "annual_revenue")]
279    pub revenue: String,
280}
281
282#[derive(Debug, Clone, Serialize, Deserialize)]
283pub struct FccResponse {
284    #[serde(flatten)]
285    pub base: BaseResponse,
286    pub subsidiaries: Vec<String>,
287}
288
289#[derive(Debug, Clone, Serialize, Deserialize)]
290pub struct FtsResponse {
291    #[serde(flatten)]
292    pub base: BaseResponse,
293    pub technologies: Vec<String>,
294}
295
296#[derive(Debug, Clone, Serialize, Deserialize)]
297pub struct EppPerson {
298    #[serde(rename = "full_name")]
299    pub full_name: Option<String>,
300    #[serde(rename = "first_name")]
301    pub first_name: Option<String>,
302    #[serde(rename = "last_name")]
303    pub last_name: Option<String>,
304    #[serde(rename = "linkedin_url")]
305    pub linkedin_url: Option<String>,
306    pub summary: Option<String>,
307    #[serde(rename = "linkedin_followers")]
308    pub linkedin_followers: Option<i32>,
309    pub facebook: Option<String>,
310    pub twitter: Option<String>,
311    pub avatar: Option<String>,
312    pub country: Option<String>,
313    pub state: Option<String>,
314    pub city: Option<String>,
315    #[serde(rename = "job_title")]
316    pub job_title: Option<String>,
317    #[serde(rename = "job_title_categories")]
318    pub job_title_categories: Option<Vec<String>>,
319    #[serde(rename = "company_name")]
320    pub company_name: Option<String>,
321    #[serde(rename = "company_linkedin")]
322    pub company_linkedin: Option<String>,
323    #[serde(rename = "company_website")]
324    pub company_website: Option<String>,
325    #[serde(rename = "company_size")]
326    pub company_size: Option<String>,
327    #[serde(rename = "company_industry")]
328    pub company_industry: Option<String>,
329    #[serde(rename = "company_facebook")]
330    pub company_facebook: Option<String>,
331    #[serde(rename = "company_twitter")]
332    pub company_twitter: Option<String>,
333    #[serde(rename = "company_country")]
334    pub company_country: Option<String>,
335    #[serde(rename = "company_state")]
336    pub company_state: Option<String>,
337    #[serde(rename = "company_city")]
338    pub company_city: Option<String>,
339}
340
341#[derive(Debug, Clone, Serialize, Deserialize)]
342pub struct EppResponse {
343    #[serde(flatten)]
344    pub base: BaseResponse,
345    pub person: EppPerson,
346}
347
348#[derive(Debug, Clone, Serialize, Deserialize)]
349pub struct FweResponse {
350    #[serde(flatten)]
351    pub base: BaseResponse,
352    #[serde(rename = "work_email")]
353    pub email: String,
354}
355
356#[derive(Debug, Clone, Serialize, Deserialize)]
357pub struct TepPerson {
358    #[serde(rename = "full_name")]
359    pub full_name: Option<String>,
360    #[serde(rename = "first_name")]
361    pub first_name: Option<String>,
362    #[serde(rename = "last_name")]
363    pub last_name: Option<String>,
364    #[serde(rename = "linkedin_url")]
365    pub linkedin_url: Option<String>,
366    pub summary: Option<String>,
367    #[serde(rename = "linkedin_followers")]
368    pub linkedin_followers: Option<i32>,
369    pub facebook: Option<String>,
370    pub twitter: Option<String>,
371    pub avatar: Option<String>,
372    pub country: Option<String>,
373    pub state: Option<String>,
374    pub city: Option<String>,
375    #[serde(rename = "job_title")]
376    pub job_title: Option<String>,
377    #[serde(rename = "job_title_categories")]
378    pub job_title_categories: Option<Vec<String>>,
379    #[serde(rename = "company_name")]
380    pub company_name: Option<String>,
381    #[serde(rename = "company_linkedin")]
382    pub company_linkedin: Option<String>,
383    #[serde(rename = "company_website")]
384    pub company_website: Option<String>,
385    #[serde(rename = "company_size")]
386    pub company_size: Option<String>,
387    #[serde(rename = "company_industry")]
388    pub company_industry: Option<String>,
389    #[serde(rename = "company_facebook")]
390    pub company_facebook: Option<String>,
391    #[serde(rename = "company_twitter")]
392    pub company_twitter: Option<String>,
393    #[serde(rename = "company_country")]
394    pub company_country: Option<String>,
395    #[serde(rename = "company_state")]
396    pub company_state: Option<String>,
397    #[serde(rename = "company_city")]
398    pub company_city: Option<String>,
399    pub email: Option<String>,
400    pub phone: Option<String>,
401}
402
403#[derive(Debug, Clone, Serialize, Deserialize)]
404pub struct TepResponse {
405    #[serde(flatten)]
406    pub base: BaseResponse,
407    pub person: TepPerson,
408}
409
410#[derive(Debug, Clone, Serialize, Deserialize)]
411pub struct EncCompany {
412    pub name: Option<String>,
413    pub website: Option<String>,
414    #[serde(rename = "employee_count")]
415    pub employee_count: Option<i32>,
416    pub industry: Option<String>,
417    pub size: Option<String>,
418    pub description: Option<String>,
419    #[serde(rename = "linkedin_url")]
420    pub linkedin_url: Option<String>,
421    pub r#type: Option<String>,
422    pub domain: Option<String>,
423    pub country: Option<String>,
424    pub state: Option<String>,
425    pub city: Option<String>,
426    pub address: Option<String>,
427    #[serde(rename = "founded_year")]
428    pub founded_year: Option<String>,
429    #[serde(rename = "logo_url")]
430    pub logo_url: Option<String>,
431    #[serde(rename = "followers_count")]
432    pub followers_count: Option<i32>,
433}
434
435#[derive(Debug, Clone, Serialize, Deserialize)]
436pub struct EncResponse {
437    #[serde(flatten)]
438    pub base: BaseResponse,
439    pub company: EncCompany,
440}
441
442#[derive(Debug, Clone, Serialize, Deserialize)]
443pub struct CecResponse {
444    #[serde(flatten)]
445    pub base: BaseResponse,
446    pub countries: serde_json::Value,
447}
448
449#[derive(Debug, Clone, Serialize, Deserialize)]
450pub struct CloLocation {
451    pub country: Option<String>,
452    pub state: Option<String>,
453    pub city: Option<String>,
454    #[serde(rename = "postal_code")]
455    pub postal_code: Option<String>,
456    pub line1: Option<String>,
457    pub line2: Option<String>,
458    pub latitude: Option<String>,
459    pub longitude: Option<String>,
460}
461
462#[derive(Debug, Clone, Serialize, Deserialize)]
463pub struct CloResponse {
464    #[serde(flatten)]
465    pub base: BaseResponse,
466    pub locations: Vec<CloLocation>,
467}
468
469#[derive(Debug, Clone, Serialize, Deserialize)]
470pub struct CseResponse {
471    #[serde(flatten)]
472    pub base: BaseResponse,
473    pub companies: Vec<Company>,
474}
475
476#[derive(Debug, Clone, Serialize, Deserialize)]
477pub struct PseResponse {
478    #[serde(flatten)]
479    pub base: BaseResponse,
480    pub peoples: Vec<Person>,
481}
482
483#[derive(Debug, Clone, Serialize, Deserialize)]
484pub struct LbsResponse {
485    #[serde(flatten)]
486    pub base: BaseResponse,
487    pub companies: Vec<Company>,
488}
489
490// Parameter types for each service
491#[derive(Debug, Clone, Serialize, Deserialize)]
492pub struct CufParams {
493    #[serde(rename = "company_name")]
494    pub company_name: String,
495    #[serde(rename = "country_code")]
496    pub country_code: String,
497}
498
499#[derive(Debug, Clone, Serialize, Deserialize)]
500pub struct LcufParams {
501    #[serde(rename = "company_name")]
502    pub company_name: String,
503}
504
505#[derive(Debug, Clone, Serialize, Deserialize)]
506pub struct DtcParams {
507    #[serde(rename = "company_website")]
508    pub company_website: String,
509}
510
511#[derive(Debug, Clone, Serialize, Deserialize)]
512pub struct DteParams {
513    #[serde(rename = "company_website")]
514    pub company_website: String,
515}
516
517#[derive(Debug, Clone, Serialize, Deserialize)]
518pub struct NtpParams {
519    #[serde(rename = "company_name")]
520    pub company_name: String,
521}
522
523#[derive(Debug, Clone, Serialize, Deserialize)]
524pub struct RelParams {
525    pub email: String,
526}
527
528#[derive(Debug, Clone, Serialize, Deserialize)]
529pub struct FclParams {
530    pub query: String,
531}
532
533#[derive(Debug, Clone, Serialize, Deserialize)]
534pub struct ElfParams {
535    pub query: String,
536}
537
538#[derive(Debug, Clone, Serialize, Deserialize)]
539pub struct CarParams {
540    pub query: String,
541}
542
543#[derive(Debug, Clone, Serialize, Deserialize)]
544pub struct FccParams {
545    pub query: String,
546}
547
548#[derive(Debug, Clone, Serialize, Deserialize)]
549pub struct FtsParams {
550    pub query: String,
551}
552
553#[derive(Debug, Clone, Serialize, Deserialize)]
554pub struct EppParams {
555    #[serde(rename = "linkedin_url")]
556    pub linkedin_url: String,
557}
558
559#[derive(Debug, Clone, Serialize, Deserialize)]
560pub struct FweParams {
561    #[serde(rename = "linkedin_url")]
562    pub linkedin_url: String,
563}
564
565#[derive(Debug, Clone, Serialize, Deserialize)]
566pub struct TepParams {
567    #[serde(rename = "full_name")]
568    pub full_name: String,
569    pub company: String,
570}
571
572#[derive(Debug, Clone, Serialize, Deserialize)]
573pub struct EncParams {
574    pub query: String,
575}
576
577#[derive(Debug, Clone, Serialize, Deserialize)]
578pub struct CecParams {
579    pub query: String,
580}
581
582#[derive(Debug, Clone, Serialize, Deserialize)]
583pub struct CloParams {
584    pub query: String,
585}
586
587#[derive(Debug, Clone, Serialize, Deserialize, Default)]
588pub struct CseParams {
589    pub name: Option<String>,
590    pub country: Option<String>,
591    pub state: Option<String>,
592    pub city: Option<String>,
593    #[serde(rename = "followers_count_min")]
594    pub followers_count_min: Option<i32>,
595    #[serde(rename = "followers_count_max")]
596    pub followers_count_max: Option<i32>,
597    pub industry: Option<String>,
598    #[serde(rename = "employee_size")]
599    pub employee_size: Option<String>,
600    #[serde(rename = "founded_after_year")]
601    pub founded_after_year: Option<i32>,
602    #[serde(rename = "founded_before_year")]
603    pub founded_before_year: Option<i32>,
604    #[serde(rename = "funding_amount_max")]
605    pub funding_amount_max: Option<i32>,
606    #[serde(rename = "funding_amount_min")]
607    pub funding_amount_min: Option<i32>,
608    #[serde(rename = "products_services")]
609    pub products_services: Option<Vec<String>>,
610    #[serde(rename = "is_school")]
611    pub is_school: Option<bool>,
612    #[serde(rename = "annual_revenue_min")]
613    pub annual_revenue_min: Option<i32>,
614    #[serde(rename = "annual_revenue_max")]
615    pub annual_revenue_max: Option<i32>,
616    pub page: Option<i32>,
617}
618
619#[derive(Debug, Clone, Serialize, Deserialize, Default)]
620pub struct PseParams {
621    #[serde(rename = "full_name")]
622    pub full_name: Option<String>,
623    pub country: Option<String>,
624    pub state: Option<String>,
625    pub city: Option<String>,
626    #[serde(rename = "job_title_role")]
627    pub job_title_role: Option<String>,
628    #[serde(rename = "job_title_level")]
629    pub job_title_level: Option<String>,
630    #[serde(rename = "company_country")]
631    pub company_country: Option<String>,
632    #[serde(rename = "company_state")]
633    pub company_state: Option<String>,
634    #[serde(rename = "company_city")]
635    pub company_city: Option<String>,
636    #[serde(rename = "company_name")]
637    pub company_name: Option<String>,
638    #[serde(rename = "company_linkedin_url")]
639    pub company_linkedin_url: Option<String>,
640    #[serde(rename = "company_industry")]
641    pub company_industry: Option<String>,
642    #[serde(rename = "company_employee_size")]
643    pub company_employee_size: Option<String>,
644    #[serde(rename = "company_products_services")]
645    pub company_products_services: Option<Vec<String>>,
646    #[serde(rename = "company_annual_revenue_min")]
647    pub company_annual_revenue_min: Option<i32>,
648    #[serde(rename = "company_annual_revenue_max")]
649    pub company_annual_revenue_max: Option<i32>,
650    pub page: Option<i32>,
651}
652
653#[derive(Debug, Clone, Serialize, Deserialize, Default)]
654pub struct LbsParams {
655    pub name: Option<String>,
656    pub country: Option<String>,
657    pub state: Option<String>,
658    pub city: Option<String>,
659    pub industry: Option<String>,
660    pub page: Option<i32>,
661}