1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
use serde_derive::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct RequestUrlInspection {
#[serde(rename = "inspectionUrl")]
pub inspection_url: String,
#[serde(rename = "siteUrl")]
pub site_url: String,
#[serde(rename = "languageCode")]
pub language_code: String,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ResponseInspectionResult {
#[serde(rename = "inspectionResult")]
pub inspection_result: InspectionResult,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct InspectionResult {
#[serde(rename = "inspectionResultLink")]
pub inspection_result_link: Option<String>,
#[serde(rename = "indexStatusResult")]
pub index_status_result: Option<IndexStatusResult>,
#[serde(rename = "ampResult")]
pub amp_result: Option<AmpInspectionResult>,
#[serde(rename = "mobileUsabilityResult")]
pub mobile_usability_result: Option<MobileUsabilityInspectionResult>,
#[serde(rename = "richResultsResult")]
pub rich_results_result: Option<RichResultsInspectionResult>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct IndexStatusResult {
pub sitemap: Option<Vec<String>>,
#[serde(rename = "referringUrls")]
pub referring_urls: Option<Vec<String>>,
pub verdict: Option<Verdict>,
#[serde(rename = "coverageState")]
pub coverage_state: Option<String>,
#[serde(rename = "robotsTxtState")]
pub robots_txt_state: Option<RobotsTxtState>,
#[serde(rename = "indexingState")]
pub indexing_state: Option<IndexingState>,
#[serde(rename = "lastCrawlTime")]
pub last_crawl_time: Option<String>,
#[serde(rename = "pageFetchState")]
pub page_fetch_state: Option<PageFetchState>,
#[serde(rename = "googleCanonical")]
pub google_canonical: Option<String>,
#[serde(rename = "userCanonical")]
pub user_canonical: Option<String>,
#[serde(rename = "crawledAs")]
pub crawled_as: Option<CrawlUserAgent>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum Verdict {
#[serde(rename = "VERDICT_UNSPECIFIED")]
VerdictUnspecified,
PASS,
PARTIAL,
FAIL,
NEUTRAL,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum RobotsTxtState {
#[serde(rename = "ROBOTS_TXT_STATE_UNSPECIFIED")]
RobotsTxtStateUnspecified,
ALLOWED,
DISALLOWED,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum IndexingState {
#[serde(rename = "INDEXING_STATE_UNSPECIFIED")]
IndexingStateUnspecified,
#[serde(rename = "INDEXING_ALLOWED")]
IndexingAllowed,
#[serde(rename = "BLOCKED_BY_META_TAG")]
BlockedByMetaTag,
#[serde(rename = "BLOCKED_BY_HTTP_HEADER")]
BlockedByHttpHeader,
#[serde(rename = "BLOCKED_BY_ROBOTS_TXT")]
BlockedByRobotsTxt,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum PageFetchState {
#[serde(rename = "PAGE_FETCH_STATE_UNSPECIFIED")]
PageFetchStateUnspecified,
SUCCESSFUL,
#[serde(rename = "SOFT_404")]
Soft404,
#[serde(rename = "BLOCKED_ROBOTS_TXT")]
BlockedRobotsTxt,
#[serde(rename = "NOT_FOUND")]
NotFound,
#[serde(rename = "ACCESS_DENIED")]
AccessDenied,
#[serde(rename = "SERVER_ERROR")]
ServerError,
#[serde(rename = "REDIRECT_ERROR")]
RedirectError,
#[serde(rename = "ACCESS_FORBIDDEN")]
AccessForbidden,
#[serde(rename = "BLOCKED_4XX")]
Blocked4xx,
#[serde(rename = "INTERNAL_CRAWL_ERROR")]
InternalCrawlError,
#[serde(rename = "INVALID_URL")]
InvalidUrl,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum CrawlUserAgent {
#[serde(rename = "CRAWLING_USER_AGENT_UNSPECIFIED")]
CrawlingUserAgentUnspecified,
DESKTOP,
MOBILE,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AmpInspectionResult {
issues: Option<Vec<AmpIssue>>,
verdict: Option<Verdict>,
#[serde(rename = "ampUrl")]
amp_url: Option<String>,
#[serde(rename = "robotsTxtState")]
robots_txt_state: Option<RobotsTxtState>,
#[serde(rename = "indexingState")]
indexing_state: Option<AmpIndexingState>,
#[serde(rename = "ampIndexStatusVerdict")]
amp_index_status_verdict: Option<Verdict>,
#[serde(rename = "lastCrawlTime")]
last_crawl_time: Option<String>,
#[serde(rename = "pageFetchState")]
page_fetch_state: Option<PageFetchState>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum AmpIndexingState {
#[serde(rename = "AMP_INDEXING_STATE_UNSPECIFIED")]
AmpIndexingStateUnspecified,
#[serde(rename = "AMP_INDEXING_ALLOWED")]
AmpIndexingAllowed,
#[serde(rename = "BLOCKED_DUE_TO_NOINDEX")]
BlockedDueToNoindex,
#[serde(rename = "BLOCKED_DUE_TO_EXPIRED_UNAVAILABLE_AFTER")]
BlockedDueToExpiredUnavailableAfter,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AmpIssue {
#[serde(rename = "issueMessage")]
pub issue_message: Option<String>,
pub severity: Option<Severity>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum Severity {
#[serde(rename = "SEVERITY_UNSPECIFIED")]
SeverityUnspecified,
WARNING,
ERROR,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct MobileUsabilityInspectionResult {
pub issues: Option<Vec<MobileUsabilityIssue>>,
pub verdict: Option<Verdict>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct MobileUsabilityIssue {
#[serde(rename = "issueType")]
pub issue_type: Option<MobileUsabilityIssueType>,
pub severity: Option<Severity>,
pub message: Option<String>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum MobileUsabilityIssueType {
#[serde(rename = "MOBILE_USABILITY_ISSUE_TYPE_UNSPECIFIED")]
MobileUsabilityIssueTypeUnspecified,
#[serde(rename = "USES_INCOMPATIBLE_PLUGINS")]
UsesIncompatiblePlugins,
#[serde(rename = "CONFIGURE_VIEWPORT")]
ConfigureViewport,
#[serde(rename = "FixedWidthViewport")]
FixedWidthViewport,
#[serde(rename = "SizeContentToViewport")]
SizeContentToViewport,
#[serde(rename = "UseLegibleFontSizes")]
UseLegibleFontSizes,
#[serde(rename = "TapTargetsTooClose")]
TapTargetsTooClose,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct RichResultsInspectionResult {
#[serde(rename = "detectedItems")]
pub detected_items: Option<Vec<DetectedItems>>,
pub verdict: Option<Verdict>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct DetectedItems {
pub items: Option<Vec<DetectedItemsItem>>,
#[serde(rename = "richResultType")]
pub rich_result_type: Option<String>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct DetectedItemsItem {
pub issues: Option<Vec<RichResultsIssue>>,
pub name: Option<String>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct RichResultsIssue {
#[serde(rename = "issueMessage")]
pub issue_message: Option<String>,
pub severity: Option<Severity>,
}