Skip to main content

data_for_seo/entity/appendix/
mod.rs

1//! Entity models for the Appendix API domain.
2
3use serde::{Deserialize, Serialize};
4use serde_json::Value;
5
6/// Account information returned by the User Data endpoint.
7/// See <https://docs.dataforseo.com/v3/appendix/user_data/>.
8#[derive(Debug, Default, Serialize, Deserialize, Clone)]
9pub struct AppendixApiUserData {
10    /// Account login.
11    pub login: Option<String>,
12    /// Time zone configured for the account.
13    pub timezone: Option<String>,
14    /// API rate limits and usage statistics.
15    pub rates: Option<AppendixApiUserDataRates>,
16    /// Deposited funds, remaining balance, and spending statistics.
17    pub money: Option<AppendixApiUserDataMoney>,
18    /// Pricing per API/function/priority; keys are dynamic, kept as raw JSON.
19    pub price: Option<Value>,
20    /// Expiry of the Backlinks API subscription, UTC; `None` when inactive.
21    pub backlinks_subscription_expiry_date: Option<String>,
22    /// Expiry of the LLM Mentions subscription, UTC; `None` when inactive.
23    pub llm_mentions_subscription_expiry_date: Option<String>,
24}
25
26/// API rate limits and usage statistics.
27#[derive(Debug, Default, Serialize, Deserialize, Clone)]
28pub struct AppendixApiUserDataRates {
29    /// Limits per time grouping (`day`, `minute`); keys are dynamic, kept as raw JSON.
30    pub limits: Option<Value>,
31    /// Usage statistics per time grouping and function; keys are dynamic, kept as raw JSON.
32    pub statistics: Option<Value>,
33}
34
35/// Deposited funds, remaining balance, and spending statistics.
36#[derive(Debug, Default, Serialize, Deserialize, Clone)]
37pub struct AppendixApiUserDataMoney {
38    /// Total funds deposited into the account, USD.
39    pub total: Option<f64>,
40    /// Remaining account balance, USD.
41    pub balance: Option<f64>,
42    /// Cost thresholds per time grouping; keys are dynamic, kept as raw JSON.
43    pub limits: Option<Value>,
44    /// Spending breakdown per function; keys are dynamic, kept as raw JSON.
45    pub statistics: Option<Value>,
46}