Skip to main content

ai_agent/services/oauth/
types.rs

1// Source: /data/home/swei/claudecode/openclaudecode/src/utils/filePersistence/types.ts
2use serde::{Deserialize, Serialize};
3use std::collections::HashMap;
4
5#[derive(Debug, Clone, Serialize, Deserialize, Default)]
6pub struct OAuthTokens {
7    #[serde(default)]
8    pub access_token: Option<String>,
9    #[serde(rename = "refreshToken", default)]
10    pub refresh_token: Option<String>,
11    #[serde(rename = "expiresAt", default)]
12    pub expires_at: Option<i64>,
13    #[serde(flatten)]
14    pub extra: HashMap<String, serde_json::Value>,
15}
16
17impl OAuthTokens {
18    pub fn new() -> Self {
19        Self::default()
20    }
21}
22
23pub type SubscriptionType = String;
24pub type BillingType = String;
25pub type OAuthProfileResponse = HashMap<String, serde_json::Value>;
26pub type ReferralEligibilityResponse = HashMap<String, serde_json::Value>;
27pub type ReferralRedemptionsResponse = HashMap<String, serde_json::Value>;
28pub type ReferrerRewardInfo = HashMap<String, serde_json::Value>;