Skip to main content

data_for_seo/entity/app_data/
mod.rs

1//! Entity models for the app_data API domain.
2//!
3//! Covers Google Play and Apple App Store app search, listing, info and review
4//! data. See <https://docs.dataforseo.com/v3/app_data/>.
5
6mod app_info;
7mod app_list;
8mod app_reviews;
9mod app_searches;
10
11pub use app_info::*;
12pub use app_list::*;
13pub use app_reviews::*;
14pub use app_searches::*;
15
16use serde::{Deserialize, Serialize};
17
18/// Rating block shared by app search, listing, info and review items.
19/// See <https://docs.dataforseo.com/v3/app_data/google/app_info/task_get/advanced/>.
20#[derive(Debug, Default, Serialize, Deserialize, Clone)]
21pub struct AppDataApiRating {
22    /// Rating scale identifier (e.g. `Max5`).
23    pub rating_type: Option<String>,
24    /// Rating value on the scale.
25    pub value: Option<f64>,
26    /// Number of votes the rating is based on.
27    pub votes_count: Option<i64>,
28    /// Maximum value of the rating scale.
29    pub rating_max: Option<i64>,
30}
31
32/// Price block shared by app search, listing and info items.
33/// See <https://docs.dataforseo.com/v3/app_data/google/app_info/task_get/advanced/>.
34#[derive(Debug, Default, Serialize, Deserialize, Clone)]
35pub struct AppDataApiPrice {
36    /// Current price of the application.
37    pub current: Option<f64>,
38    /// Regular (non-discounted) price of the application.
39    pub regular: Option<f64>,
40    /// Upper bound of the price when it is a range.
41    pub max_value: Option<f64>,
42    /// ISO currency code of the price.
43    pub currency: Option<String>,
44    /// `true` when the price is a range rather than a single value.
45    pub is_price_range: Option<bool>,
46    /// Price as displayed in the store.
47    pub displayed_price: Option<String>,
48}
49
50/// A location supported by the App Data endpoints.
51/// See <https://docs.dataforseo.com/v3/app_data/google/locations/>.
52#[derive(Debug, Default, Serialize, Deserialize, Clone)]
53pub struct AppDataApiLocation {
54    /// Unique location identifier used in requests.
55    pub location_code: Option<i32>,
56    /// Full location name.
57    pub location_name: Option<String>,
58    /// Location code of the parent location, if any.
59    pub location_code_parent: Option<i32>,
60    /// ISO country code of the location.
61    pub country_iso_code: Option<String>,
62    /// Type of the location (e.g. `Country`).
63    pub location_type: Option<String>,
64}
65
66/// A language supported by the App Data endpoints.
67/// See <https://docs.dataforseo.com/v3/app_data/google/languages/>.
68#[derive(Debug, Default, Serialize, Deserialize, Clone)]
69pub struct AppDataApiLanguage {
70    /// Full language name.
71    pub language_name: Option<String>,
72    /// Language code used in requests.
73    pub language_code: Option<String>,
74}
75
76/// A category supported by the App Data endpoints.
77/// See <https://docs.dataforseo.com/v3/app_data/google/categories/>.
78#[derive(Debug, Default, Serialize, Deserialize, Clone)]
79pub struct AppDataApiCategory {
80    /// Unique category identifier used in requests.
81    pub category_code: Option<String>,
82    /// Full category name.
83    pub category_name: Option<String>,
84    /// Category code of the parent category, if any.
85    pub category_code_parent: Option<String>,
86}
87
88/// A ready task returned by the `tasks_ready` endpoints.
89/// See <https://docs.dataforseo.com/v3/app_data/google/app_searches/tasks_ready/>.
90#[derive(Debug, Default, Serialize, Deserialize, Clone)]
91pub struct AppDataApiTaskReadyResult {
92    /// Identifier of the completed task.
93    pub id: Option<String>,
94    /// Search engine the task was set for.
95    pub se: Option<String>,
96    /// Type of the task (endpoint the task was set for).
97    pub se_type: Option<String>,
98    /// UTC timestamp when the task was set.
99    pub date_posted: Option<String>,
100    /// User-defined task identifier supplied on `task_post`.
101    pub tag: Option<String>,
102    /// Relative path used to fetch the advanced result.
103    pub endpoint_advanced: Option<String>,
104    /// Relative path used to fetch the raw HTML result.
105    pub endpoint_html: Option<String>,
106}
107
108/// An error record returned by the App Data `errors` endpoint.
109/// See <https://docs.dataforseo.com/v3/app_data/errors/>.
110#[derive(Debug, Default, Serialize, Deserialize, Clone)]
111pub struct AppDataApiError {
112    /// Identifier of the task that errored.
113    pub id: Option<String>,
114    /// UTC timestamp when the error occurred.
115    pub datetime: Option<String>,
116    /// API function that produced the error.
117    pub function: Option<String>,
118    /// DataForSEO error code.
119    pub error_code: Option<i32>,
120    /// Human-readable error message.
121    pub error_message: Option<String>,
122    /// URL that caused the error.
123    pub http_url: Option<String>,
124    /// HTTP method used for the failed request.
125    pub http_method: Option<String>,
126    /// HTTP status code returned.
127    pub http_code: Option<i32>,
128    /// Response time of the failed request, in seconds.
129    pub http_time: Option<f64>,
130    /// Raw response body of the failed request.
131    pub http_response: Option<String>,
132}
133
134/// A task record returned by the App Data `id_list` endpoint.
135/// See <https://docs.dataforseo.com/v3/app_data/id_list/>.
136#[derive(Debug, Default, Serialize, Deserialize, Clone)]
137pub struct AppDataApiIdList {
138    /// Task identifier.
139    pub id: Option<String>,
140    /// URL of the API call that set the task.
141    pub url: Option<String>,
142    /// UTC timestamp when the task was set.
143    pub datetime_posted: Option<String>,
144    /// UTC timestamp when the task completed.
145    pub datetime_done: Option<String>,
146    /// Task status code.
147    pub status: Option<String>,
148    /// Cost of the task, in USD.
149    pub cost: Option<f64>,
150}