google_search_console_api/search_analytics/
query.rs

1use serde::{Deserialize, Serialize};
2use crate::types::{DIMENSION, DimensionFilterGroup};
3
4#[derive(Default, Debug, Serialize, Deserialize, Clone)]
5pub struct SearchAnalyticsQueryRequest {
6    #[serde(rename = "startDate")]
7    pub start_date: String,
8    #[serde(rename = "endDate")]
9    pub end_date: String,
10    pub dimensions: Option<Vec<DIMENSION>>,
11    #[serde(rename = "search_type")]
12    pub search_type: Option<String>,
13    #[serde(rename = "type")]
14    pub query_type: Option<String>,
15    #[serde(rename = "dimensionFilterGroups")]
16    pub dimension_filter_groups: Option<Vec<DimensionFilterGroup>>,
17    #[serde(rename = "aggregationType")]
18    pub aggregation_type: Option<String>,
19    #[serde(rename = "rowLimit")]
20    pub row_limit: Option<usize>,
21    #[serde(rename = "startRow")]
22    pub start_row: Option<usize>,
23    #[serde(rename = "dataState")]
24    pub data_state: Option<String>,
25}
26#[derive(Default, Debug, Serialize, Deserialize, Clone)]
27pub struct SearchAnalyticsQueryResponse {
28    pub rows: Option<Vec<SearchAnalyticsQueryResponseRow>>,
29    #[serde(rename = "responseAggregationType")]
30    pub response_aggregation_type: Option<String>,
31}
32#[derive(Default, Debug, Serialize, Deserialize, Clone)]
33pub struct SearchAnalyticsQueryResponseRow {
34    pub keys: Option<Vec<String>>,
35    pub clicks: Option<f32>,
36    pub impressions: Option<f32>,
37    pub ctr: Option<f32>,
38    pub position: Option<f32>,
39}