headhunter_bindings/
response.rs

1use serde::{Deserialize, Serialize};
2
3/// Result-like type that can fallback into error if can't parse `T` with serde
4#[derive(Debug, Deserialize)]
5#[serde(untagged)]
6pub enum HeadhunterResponse<T> {
7    Response(T),
8    Error(serde_json::Value),
9}
10
11/// This structure is used to store access tokens and to update them, saved as `response.json`
12#[derive(Debug, Deserialize, Serialize)]
13pub struct UserOpenAuthorizationResponse {
14    pub access_token: String,
15    pub token_type: String,
16    pub expires_in: u32,
17    pub refresh_token: String,
18}
19
20/// User information, useful for checking token
21#[derive(Debug, Deserialize)]
22pub struct MeResponse {
23    pub auth_type: String,
24    pub email: String,
25}
26
27/// List of resumes that were listed on the site
28#[derive(Debug, Deserialize)]
29pub struct MineResumesResponse {
30    pub found: u32,
31    pub items: Vec<super::types::Resume>,
32}