1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct PingRequest {}
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct PingResponse {
6 #[prost(string, tag = "1")]
7 pub message: ::prost::alloc::string::String,
8 #[prost(string, tag = "2")]
9 pub version: ::prost::alloc::string::String,
10}
11#[derive(Clone, Copy, PartialEq, ::prost::Message)]
12pub struct CommandRetryOptions {
13 #[prost(uint32, optional, tag = "1")]
14 pub timeout_ms: ::core::option::Option<u32>,
15 #[prost(uint32, optional, tag = "2")]
16 pub retry_interval_ms: ::core::option::Option<u32>,
17}
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct ConnectMobileCommand {
20 #[prost(enumeration = "MobilePlatform", tag = "1")]
21 pub platform: i32,
22 #[prost(string, optional, tag = "2")]
23 pub device: ::core::option::Option<::prost::alloc::string::String>,
24 #[prost(string, optional, tag = "3")]
25 pub adb_endpoint: ::core::option::Option<::prost::alloc::string::String>,
26 #[prost(bool, tag = "4")]
27 pub preserve_app_state: bool,
28 #[prost(message, optional, tag = "5")]
29 pub retry_options: ::core::option::Option<CommandRetryOptions>,
30}
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct MobileConnectedEvent {
33 #[prost(enumeration = "MobilePlatform", tag = "1")]
34 pub platform: i32,
35 #[prost(string, tag = "2")]
36 pub device_name: ::prost::alloc::string::String,
37 #[prost(string, tag = "3")]
38 pub note: ::prost::alloc::string::String,
39 #[prost(string, tag = "4")]
40 pub device_id: ::prost::alloc::string::String,
41 #[prost(enumeration = "DeviceConnectionKind", tag = "5")]
42 pub connection_kind: i32,
43 #[prost(string, tag = "6")]
44 pub backend: ::prost::alloc::string::String,
45 #[prost(string, tag = "7")]
46 pub device_session_id: ::prost::alloc::string::String,
47 #[prost(string, tag = "8")]
48 pub initial_app_session_id: ::prost::alloc::string::String,
49 #[prost(string, optional, tag = "9")]
50 pub package_name: ::core::option::Option<::prost::alloc::string::String>,
51 #[prost(string, optional, tag = "10")]
52 pub activity_name: ::core::option::Option<::prost::alloc::string::String>,
53}
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct LaunchAppCommand {
56 #[prost(string, optional, tag = "1")]
57 pub apk_path: ::core::option::Option<::prost::alloc::string::String>,
58 #[prost(string, optional, tag = "2")]
59 pub app_id: ::core::option::Option<::prost::alloc::string::String>,
60 #[prost(string, optional, tag = "3")]
61 pub launch_activity: ::core::option::Option<::prost::alloc::string::String>,
62 #[prost(bool, tag = "4")]
63 pub stop_before_launch: bool,
64 #[prost(message, optional, tag = "5")]
65 pub retry_options: ::core::option::Option<CommandRetryOptions>,
66}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct AppLaunchedEvent {
69 #[prost(string, tag = "1")]
70 pub app_session_id: ::prost::alloc::string::String,
71 #[prost(string, tag = "2")]
72 pub note: ::prost::alloc::string::String,
73 #[prost(string, optional, tag = "3")]
74 pub package_name: ::core::option::Option<::prost::alloc::string::String>,
75 #[prost(string, optional, tag = "4")]
76 pub activity_name: ::core::option::Option<::prost::alloc::string::String>,
77 #[prost(string, optional, tag = "5")]
78 pub webview_context: ::core::option::Option<::prost::alloc::string::String>,
79}
80#[derive(Clone, Copy, PartialEq, ::prost::Message)]
81pub struct RegisterMobileFileChooserHook {}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct MobileFileChooserHookResult {
84 #[prost(string, tag = "1")]
85 pub file_chooser_id: ::prost::alloc::string::String,
86 #[prost(bool, tag = "2")]
87 pub is_multiple: bool,
88 #[prost(string, tag = "3")]
89 pub note: ::prost::alloc::string::String,
90}
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct SetMobileFileChooserFilesCommand {
93 #[prost(string, tag = "1")]
94 pub file_chooser_id: ::prost::alloc::string::String,
95 #[prost(string, repeated, tag = "2")]
96 pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
97 #[prost(message, optional, tag = "3")]
98 pub retry_options: ::core::option::Option<CommandRetryOptions>,
99}
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct MobileFileChooserFilesSetEvent {
102 #[prost(string, tag = "1")]
103 pub file_chooser_id: ::prost::alloc::string::String,
104 #[prost(string, repeated, tag = "2")]
105 pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
106 #[prost(string, tag = "3")]
107 pub note: ::prost::alloc::string::String,
108}
109#[derive(Clone, Copy, PartialEq, ::prost::Message)]
110pub struct RegisterMobileDownloadHook {}
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct MobileDownloadHookResult {
113 #[prost(string, tag = "1")]
114 pub download_id: ::prost::alloc::string::String,
115 #[prost(string, tag = "2")]
116 pub suggested_filename: ::prost::alloc::string::String,
117 #[prost(string, tag = "3")]
118 pub note: ::prost::alloc::string::String,
119}
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct SaveMobileDownloadCommand {
122 #[prost(string, tag = "1")]
123 pub download_id: ::prost::alloc::string::String,
124 #[prost(message, optional, tag = "2")]
125 pub retry_options: ::core::option::Option<CommandRetryOptions>,
126}
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct MobileDownloadSavedEvent {
129 #[prost(string, tag = "1")]
130 pub download_id: ::prost::alloc::string::String,
131 #[prost(string, tag = "2")]
132 pub file_id: ::prost::alloc::string::String,
133 #[prost(string, tag = "3")]
134 pub suggested_filename: ::prost::alloc::string::String,
135 #[prost(uint64, tag = "4")]
136 pub size: u64,
137 #[prost(string, tag = "5")]
138 pub note: ::prost::alloc::string::String,
139}
140#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
141#[repr(i32)]
142pub enum MobilePlatform {
143 Unspecified = 0,
144 Android = 1,
145 Ios = 2,
146}
147impl MobilePlatform {
148 pub fn as_str_name(&self) -> &'static str {
153 match self {
154 Self::Unspecified => "MOBILE_PLATFORM_UNSPECIFIED",
155 Self::Android => "MOBILE_PLATFORM_ANDROID",
156 Self::Ios => "MOBILE_PLATFORM_IOS",
157 }
158 }
159 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
161 match value {
162 "MOBILE_PLATFORM_UNSPECIFIED" => Some(Self::Unspecified),
163 "MOBILE_PLATFORM_ANDROID" => Some(Self::Android),
164 "MOBILE_PLATFORM_IOS" => Some(Self::Ios),
165 _ => None,
166 }
167 }
168}
169#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
170#[repr(i32)]
171pub enum DeviceConnectionKind {
172 Unspecified = 0,
173 Usb = 1,
174 Emulator = 2,
175 RemoteAdb = 3,
176}
177impl DeviceConnectionKind {
178 pub fn as_str_name(&self) -> &'static str {
183 match self {
184 Self::Unspecified => "DEVICE_CONNECTION_KIND_UNSPECIFIED",
185 Self::Usb => "DEVICE_CONNECTION_KIND_USB",
186 Self::Emulator => "DEVICE_CONNECTION_KIND_EMULATOR",
187 Self::RemoteAdb => "DEVICE_CONNECTION_KIND_REMOTE_ADB",
188 }
189 }
190 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
192 match value {
193 "DEVICE_CONNECTION_KIND_UNSPECIFIED" => Some(Self::Unspecified),
194 "DEVICE_CONNECTION_KIND_USB" => Some(Self::Usb),
195 "DEVICE_CONNECTION_KIND_EMULATOR" => Some(Self::Emulator),
196 "DEVICE_CONNECTION_KIND_REMOTE_ADB" => Some(Self::RemoteAdb),
197 _ => None,
198 }
199 }
200}
201#[derive(Clone, PartialEq, ::prost::Message)]
202pub struct LaunchBrowserCommand {
203 #[prost(enumeration = "BrowserKind", tag = "1")]
204 pub browser_kind: i32,
205 #[prost(string, optional, tag = "2")]
206 pub browser_binary: ::core::option::Option<::prost::alloc::string::String>,
207 #[prost(message, optional, tag = "3")]
208 pub retry_options: ::core::option::Option<CommandRetryOptions>,
209}
210#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct BrowserLaunchedEvent {
212 #[prost(enumeration = "BrowserKind", tag = "1")]
213 pub browser_kind: i32,
214 #[prost(string, tag = "2")]
215 pub browser: ::prost::alloc::string::String,
216 #[prost(string, tag = "3")]
217 pub note: ::prost::alloc::string::String,
218 #[prost(string, tag = "4")]
219 pub user_data_dir: ::prost::alloc::string::String,
220 #[prost(string, tag = "5")]
221 pub initial_page_session_id: ::prost::alloc::string::String,
222}
223#[derive(Clone, PartialEq, ::prost::Message)]
224pub struct LaunchChromeCommand {
225 #[prost(string, optional, tag = "1")]
226 pub chrome_binary: ::core::option::Option<::prost::alloc::string::String>,
227 #[prost(message, optional, tag = "2")]
228 pub retry_options: ::core::option::Option<CommandRetryOptions>,
229}
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct ChromeLaunchedEvent {
232 #[prost(string, tag = "1")]
233 pub browser: ::prost::alloc::string::String,
234 #[prost(string, tag = "2")]
235 pub note: ::prost::alloc::string::String,
236 #[prost(string, tag = "3")]
237 pub cdp_websocket_url: ::prost::alloc::string::String,
238 #[prost(string, tag = "4")]
239 pub user_data_dir: ::prost::alloc::string::String,
240 #[prost(string, tag = "5")]
241 pub initial_page_session_id: ::prost::alloc::string::String,
242}
243#[derive(Clone, Copy, PartialEq, ::prost::Message)]
245pub struct RegisterDialogHook {}
246#[derive(Clone, PartialEq, ::prost::Message)]
247pub struct DialogHookResult {
248 #[prost(string, tag = "1")]
249 pub dialog_id: ::prost::alloc::string::String,
250 #[prost(string, tag = "2")]
251 pub r#type: ::prost::alloc::string::String,
252 #[prost(string, tag = "3")]
253 pub message: ::prost::alloc::string::String,
254 #[prost(string, tag = "4")]
255 pub default_value: ::prost::alloc::string::String,
256}
257#[derive(Clone, PartialEq, ::prost::Message)]
258pub struct HandleDialogCommand {
259 #[prost(string, tag = "1")]
260 pub dialog_id: ::prost::alloc::string::String,
261 #[prost(bool, tag = "2")]
262 pub accept: bool,
263 #[prost(string, optional, tag = "3")]
264 pub prompt_text: ::core::option::Option<::prost::alloc::string::String>,
265 #[prost(message, optional, tag = "4")]
267 pub retry_options: ::core::option::Option<CommandRetryOptions>,
268}
269#[derive(Clone, PartialEq, ::prost::Message)]
270pub struct DialogHandledEvent {
271 #[prost(string, tag = "1")]
272 pub dialog_id: ::prost::alloc::string::String,
273}
274#[derive(Clone, Copy, PartialEq, ::prost::Message)]
275pub struct RegisterNewPageHook {}
276#[derive(Clone, PartialEq, ::prost::Message)]
277pub struct NewPageHookResult {
278 #[prost(string, tag = "1")]
279 pub context_session_id: ::prost::alloc::string::String,
280 #[prost(string, tag = "2")]
281 pub note: ::prost::alloc::string::String,
282}
283#[derive(Clone, Copy, PartialEq, ::prost::Message)]
284pub struct RegisterFileChooserHook {}
285#[derive(Clone, PartialEq, ::prost::Message)]
286pub struct FileChooserHookResult {
287 #[prost(string, tag = "1")]
288 pub file_chooser_id: ::prost::alloc::string::String,
289 #[prost(bool, tag = "2")]
290 pub is_multiple: bool,
291 #[prost(string, tag = "3")]
292 pub note: ::prost::alloc::string::String,
293}
294#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct SetFileChooserFilesCommand {
296 #[prost(string, tag = "1")]
297 pub file_chooser_id: ::prost::alloc::string::String,
298 #[prost(string, repeated, tag = "2")]
299 pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
300 #[prost(message, optional, tag = "3")]
301 pub retry_options: ::core::option::Option<CommandRetryOptions>,
302}
303#[derive(Clone, PartialEq, ::prost::Message)]
304pub struct FileChooserFilesSetEvent {
305 #[prost(string, tag = "1")]
306 pub file_chooser_id: ::prost::alloc::string::String,
307 #[prost(string, repeated, tag = "2")]
308 pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
309 #[prost(string, tag = "3")]
310 pub note: ::prost::alloc::string::String,
311}
312#[derive(Clone, Copy, PartialEq, ::prost::Message)]
313pub struct RegisterDownloadHook {}
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct DownloadHookResult {
316 #[prost(string, tag = "1")]
317 pub download_id: ::prost::alloc::string::String,
318 #[prost(string, tag = "2")]
319 pub url: ::prost::alloc::string::String,
320 #[prost(string, tag = "3")]
321 pub suggested_filename: ::prost::alloc::string::String,
322 #[prost(string, tag = "4")]
323 pub note: ::prost::alloc::string::String,
324}
325#[derive(Clone, PartialEq, ::prost::Message)]
326pub struct SaveDownloadCommand {
327 #[prost(string, tag = "1")]
328 pub download_id: ::prost::alloc::string::String,
329 #[prost(message, optional, tag = "2")]
330 pub retry_options: ::core::option::Option<CommandRetryOptions>,
331}
332#[derive(Clone, PartialEq, ::prost::Message)]
333pub struct DownloadSavedEvent {
334 #[prost(string, tag = "1")]
335 pub download_id: ::prost::alloc::string::String,
336 #[prost(string, tag = "2")]
337 pub file_id: ::prost::alloc::string::String,
338 #[prost(string, tag = "3")]
339 pub suggested_filename: ::prost::alloc::string::String,
340 #[prost(uint64, tag = "4")]
341 pub size: u64,
342 #[prost(string, tag = "5")]
343 pub note: ::prost::alloc::string::String,
344}
345#[derive(Clone, PartialEq, ::prost::Message)]
347pub struct ResolveFrameCommand {
348 #[prost(string, tag = "1")]
349 pub css_selector: ::prost::alloc::string::String,
350 #[prost(message, optional, tag = "2")]
351 pub retry_options: ::core::option::Option<CommandRetryOptions>,
352}
353#[derive(Clone, PartialEq, ::prost::Message)]
354pub struct FrameResolvedEvent {
355 #[prost(string, tag = "1")]
356 pub context_session_id: ::prost::alloc::string::String,
357}
358#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
359#[repr(i32)]
360pub enum BrowserKind {
361 Unspecified = 0,
362 Chromium = 1,
363 Firefox = 2,
364}
365impl BrowserKind {
366 pub fn as_str_name(&self) -> &'static str {
371 match self {
372 Self::Unspecified => "BROWSER_KIND_UNSPECIFIED",
373 Self::Chromium => "BROWSER_KIND_CHROMIUM",
374 Self::Firefox => "BROWSER_KIND_FIREFOX",
375 }
376 }
377 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
379 match value {
380 "BROWSER_KIND_UNSPECIFIED" => Some(Self::Unspecified),
381 "BROWSER_KIND_CHROMIUM" => Some(Self::Chromium),
382 "BROWSER_KIND_FIREFOX" => Some(Self::Firefox),
383 _ => None,
384 }
385 }
386}
387#[derive(Clone, PartialEq, ::prost::Message)]
388pub struct SurfaceSessionCommand {
389 #[prost(oneof = "surface_session_command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
390 pub command: ::core::option::Option<surface_session_command::Command>,
391}
392pub mod surface_session_command {
394 #[derive(Clone, PartialEq, ::prost::Oneof)]
395 pub enum Command {
396 #[prost(message, tag = "1")]
397 LaunchChrome(super::LaunchChromeCommand),
398 #[prost(message, tag = "2")]
399 OpenContext(super::OpenContextCommand),
400 #[prost(message, tag = "3")]
401 Ping(super::SessionPingCommand),
402 #[prost(message, tag = "4")]
403 Close(super::CloseSurfaceSessionCommand),
404 #[prost(message, tag = "5")]
405 LaunchBrowser(super::LaunchBrowserCommand),
406 #[prost(message, tag = "6")]
407 ConnectMobile(super::ConnectMobileCommand),
408 #[prost(message, tag = "7")]
409 LaunchApp(super::LaunchAppCommand),
410 }
411}
412#[derive(Clone, Copy, PartialEq, ::prost::Message)]
413pub struct OpenContextCommand {
414 #[prost(message, optional, tag = "1")]
415 pub retry_options: ::core::option::Option<CommandRetryOptions>,
416}
417#[derive(Clone, PartialEq, ::prost::Message)]
418pub struct SessionPingCommand {
419 #[prost(string, tag = "1")]
420 pub message: ::prost::alloc::string::String,
421}
422#[derive(Clone, Copy, PartialEq, ::prost::Message)]
423pub struct CloseSurfaceSessionCommand {}
424#[derive(Clone, PartialEq, ::prost::Message)]
425pub struct SurfaceSessionEvent {
426 #[prost(string, tag = "1")]
427 pub session_id: ::prost::alloc::string::String,
428 #[prost(oneof = "surface_session_event::Event", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
429 pub event: ::core::option::Option<surface_session_event::Event>,
430}
431pub mod surface_session_event {
433 #[derive(Clone, PartialEq, ::prost::Oneof)]
434 pub enum Event {
435 #[prost(message, tag = "2")]
436 ChromeLaunched(super::ChromeLaunchedEvent),
437 #[prost(message, tag = "3")]
438 ContextOpened(super::ContextOpenedEvent),
439 #[prost(message, tag = "4")]
440 Pong(super::SessionPongEvent),
441 #[prost(message, tag = "5")]
442 Closed(super::SurfaceSessionClosedEvent),
443 #[prost(message, tag = "6")]
444 Error(super::SurfaceSessionErrorEvent),
445 #[prost(message, tag = "7")]
446 BrowserLaunched(super::BrowserLaunchedEvent),
447 #[prost(message, tag = "8")]
448 MobileConnected(super::MobileConnectedEvent),
449 #[prost(message, tag = "9")]
450 AppLaunched(super::AppLaunchedEvent),
451 }
452}
453#[derive(Clone, PartialEq, ::prost::Message)]
454pub struct ContextOpenedEvent {
455 #[prost(string, tag = "1")]
456 pub context_session_id: ::prost::alloc::string::String,
457 #[prost(string, tag = "2")]
458 pub note: ::prost::alloc::string::String,
459}
460#[derive(Clone, PartialEq, ::prost::Message)]
461pub struct SessionPongEvent {
462 #[prost(string, tag = "1")]
463 pub message: ::prost::alloc::string::String,
464}
465#[derive(Clone, PartialEq, ::prost::Message)]
466pub struct SurfaceSessionClosedEvent {
467 #[prost(string, tag = "1")]
468 pub reason: ::prost::alloc::string::String,
469}
470#[derive(Clone, PartialEq, ::prost::Message)]
471pub struct SurfaceSessionErrorEvent {
472 #[prost(string, tag = "1")]
473 pub message: ::prost::alloc::string::String,
474}
475#[derive(Clone, PartialEq, ::prost::Message)]
476pub struct ContextSessionCommand {
477 #[prost(string, tag = "1")]
478 pub surface_session_id: ::prost::alloc::string::String,
479 #[prost(string, tag = "2")]
480 pub context_session_id: ::prost::alloc::string::String,
481 #[prost(
482 oneof = "context_session_command::Command",
483 tags = "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"
484 )]
485 pub command: ::core::option::Option<context_session_command::Command>,
486}
487pub mod context_session_command {
489 #[derive(Clone, PartialEq, ::prost::Oneof)]
490 pub enum Command {
491 #[prost(message, tag = "3")]
492 Ping(super::ContextSessionPingCommand),
493 #[prost(message, tag = "4")]
494 Close(super::CloseContextSessionCommand),
495 #[prost(message, tag = "5")]
496 Navigate(super::NavigatePageCommand),
497 #[prost(message, tag = "6")]
498 ClickElement(super::ClickElementCommand),
499 #[prost(message, tag = "7")]
500 CountElements(super::CountElementsCommand),
501 #[prost(message, tag = "8")]
502 HighlightElements(super::HighlightElementsCommand),
503 #[prost(message, tag = "9")]
504 FocusElement(super::FocusElementCommand),
505 #[prost(message, tag = "10")]
506 FillElement(super::FillElementCommand),
507 #[prost(message, tag = "11")]
508 HoverElement(super::HoverElementCommand),
509 #[prost(message, tag = "12")]
510 PressKey(super::PressKeyCommand),
511 #[prost(message, tag = "13")]
512 GetTextContent(super::GetTextContentCommand),
513 #[prost(message, tag = "14")]
514 GetInnerText(super::GetInnerTextCommand),
515 #[prost(message, tag = "15")]
516 WaitForSelector(super::WaitForSelectorCommand),
517 #[prost(message, tag = "16")]
518 Screenshot(super::ScreenshotCommand),
519 #[prost(message, tag = "17")]
520 AccessibilitySnapshot(super::AccessibilitySnapshotCommand),
521 #[prost(message, tag = "18")]
522 RegisterHook(super::RegisterHookCommand),
523 #[prost(message, tag = "19")]
524 WaitForHook(super::WaitForHookCommand),
525 #[prost(message, tag = "20")]
526 SetFileChooserFiles(super::SetFileChooserFilesCommand),
527 #[prost(message, tag = "21")]
528 SaveDownload(super::SaveDownloadCommand),
529 #[prost(message, tag = "22")]
530 UploadFileChunk(super::UploadFileChunkCommand),
531 #[prost(message, tag = "23")]
532 ReadFileChunk(super::ReadFileChunkCommand),
533 #[prost(message, tag = "24")]
534 SetMobileFileChooserFiles(super::SetMobileFileChooserFilesCommand),
535 #[prost(message, tag = "25")]
536 SaveMobileDownload(super::SaveMobileDownloadCommand),
537 #[prost(message, tag = "26")]
538 ResolveFrame(super::ResolveFrameCommand),
539 #[prost(message, tag = "27")]
540 Capture(super::CaptureCommand),
541 #[prost(message, tag = "28")]
542 HandleDialog(super::HandleDialogCommand),
543 }
544}
545#[derive(Clone, PartialEq, ::prost::Message)]
546pub struct ContextSessionPingCommand {
547 #[prost(string, tag = "1")]
548 pub message: ::prost::alloc::string::String,
549}
550#[derive(Clone, Copy, PartialEq, ::prost::Message)]
551pub struct CloseContextSessionCommand {}
552#[derive(Clone, PartialEq, ::prost::Message)]
553pub struct ContextSessionEvent {
554 #[prost(string, tag = "1")]
555 pub context_session_id: ::prost::alloc::string::String,
556 #[prost(
557 oneof = "context_session_event::Event",
558 tags = "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"
559 )]
560 pub event: ::core::option::Option<context_session_event::Event>,
561}
562pub mod context_session_event {
564 #[derive(Clone, PartialEq, ::prost::Oneof)]
565 pub enum Event {
566 #[prost(message, tag = "2")]
567 Attached(super::ContextSessionAttachedEvent),
568 #[prost(message, tag = "3")]
569 Pong(super::ContextSessionPongEvent),
570 #[prost(message, tag = "4")]
571 Closed(super::ContextSessionClosedEvent),
572 #[prost(message, tag = "5")]
573 Error(super::ContextSessionErrorEvent),
574 #[prost(message, tag = "6")]
575 Navigated(super::PageNavigatedEvent),
576 #[prost(message, tag = "7")]
577 ChromiumBidiInjection(super::ChromiumBidiInjectionEvent),
578 #[prost(message, tag = "8")]
579 ElementClicked(super::ElementClickedEvent),
580 #[prost(message, tag = "9")]
581 ElementCounted(super::ElementCountedEvent),
582 #[prost(message, tag = "10")]
583 ElementsHighlighted(super::ElementsHighlightedEvent),
584 #[prost(message, tag = "11")]
585 ElementFocused(super::ElementFocusedEvent),
586 #[prost(message, tag = "12")]
587 ElementFilled(super::ElementFilledEvent),
588 #[prost(message, tag = "13")]
589 ElementHovered(super::ElementHoveredEvent),
590 #[prost(message, tag = "14")]
591 KeyPressed(super::KeyPressedEvent),
592 #[prost(message, tag = "15")]
593 TextContentResolved(super::TextContentResolvedEvent),
594 #[prost(message, tag = "16")]
595 InnerTextResolved(super::InnerTextResolvedEvent),
596 #[prost(message, tag = "17")]
597 SelectorWaitSatisfied(super::SelectorWaitSatisfiedEvent),
598 #[prost(message, tag = "18")]
599 ScreenshotCaptured(super::ScreenshotCapturedEvent),
600 #[prost(message, tag = "19")]
601 AccessibilitySnapshotCaptured(super::AccessibilitySnapshotCapturedEvent),
602 #[prost(message, tag = "20")]
603 HookRegistered(super::HookRegisteredEvent),
604 #[prost(message, tag = "21")]
605 HookCompleted(super::HookCompletedEvent),
606 #[prost(message, tag = "22")]
607 FileChooserFilesSet(super::FileChooserFilesSetEvent),
608 #[prost(message, tag = "23")]
609 DownloadSaved(super::DownloadSavedEvent),
610 #[prost(message, tag = "24")]
611 FileUploaded(super::FileUploadedEvent),
612 #[prost(message, tag = "25")]
613 FileChunk(super::FileChunkEvent),
614 #[prost(message, tag = "26")]
615 MobileFileChooserFilesSet(super::MobileFileChooserFilesSetEvent),
616 #[prost(message, tag = "27")]
617 MobileDownloadSaved(super::MobileDownloadSavedEvent),
618 #[prost(message, tag = "28")]
619 FrameResolved(super::FrameResolvedEvent),
620 #[prost(message, tag = "29")]
621 CaptureResolved(super::CaptureResolvedEvent),
622 #[prost(message, tag = "30")]
623 DialogHandled(super::DialogHandledEvent),
624 }
625}
626#[derive(Clone, PartialEq, ::prost::Message)]
627pub struct ContextSessionAttachedEvent {
628 #[prost(string, tag = "1")]
629 pub note: ::prost::alloc::string::String,
630}
631#[derive(Clone, PartialEq, ::prost::Message)]
632pub struct ContextSessionPongEvent {
633 #[prost(string, tag = "1")]
634 pub message: ::prost::alloc::string::String,
635}
636#[derive(Clone, PartialEq, ::prost::Message)]
637pub struct ContextSessionClosedEvent {
638 #[prost(string, tag = "1")]
639 pub reason: ::prost::alloc::string::String,
640}
641#[derive(Clone, PartialEq, ::prost::Message)]
642pub struct ContextSessionErrorEvent {
643 #[prost(string, tag = "1")]
644 pub message: ::prost::alloc::string::String,
645}
646#[derive(Clone, Copy, PartialEq, ::prost::Message)]
647pub struct RegisterHookCommand {
648 #[prost(oneof = "register_hook_command::Hook", tags = "1, 2, 3, 4, 5, 6")]
649 pub hook: ::core::option::Option<register_hook_command::Hook>,
650}
651pub mod register_hook_command {
653 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
654 pub enum Hook {
655 #[prost(message, tag = "1")]
656 NewPage(super::RegisterNewPageHook),
657 #[prost(message, tag = "2")]
658 FileChooser(super::RegisterFileChooserHook),
659 #[prost(message, tag = "3")]
660 Download(super::RegisterDownloadHook),
661 #[prost(message, tag = "4")]
662 MobileFileChooser(super::RegisterMobileFileChooserHook),
663 #[prost(message, tag = "5")]
664 MobileDownload(super::RegisterMobileDownloadHook),
665 #[prost(message, tag = "6")]
666 Dialog(super::RegisterDialogHook),
667 }
668}
669#[derive(Clone, PartialEq, ::prost::Message)]
670pub struct WaitForHookCommand {
671 #[prost(string, tag = "1")]
672 pub hook_id: ::prost::alloc::string::String,
673 #[prost(message, optional, tag = "2")]
674 pub retry_options: ::core::option::Option<CommandRetryOptions>,
675}
676#[derive(Clone, PartialEq, ::prost::Message)]
677pub struct HookRegisteredEvent {
678 #[prost(string, tag = "1")]
679 pub hook_id: ::prost::alloc::string::String,
680}
681#[derive(Clone, PartialEq, ::prost::Message)]
682pub struct HookCompletedEvent {
683 #[prost(string, tag = "1")]
684 pub hook_id: ::prost::alloc::string::String,
685 #[prost(oneof = "hook_completed_event::Result", tags = "2, 3, 4, 5, 6, 7")]
686 pub result: ::core::option::Option<hook_completed_event::Result>,
687}
688pub mod hook_completed_event {
690 #[derive(Clone, PartialEq, ::prost::Oneof)]
691 pub enum Result {
692 #[prost(message, tag = "2")]
693 NewPage(super::NewPageHookResult),
694 #[prost(message, tag = "3")]
695 FileChooser(super::FileChooserHookResult),
696 #[prost(message, tag = "4")]
697 Download(super::DownloadHookResult),
698 #[prost(message, tag = "5")]
699 MobileFileChooser(super::MobileFileChooserHookResult),
700 #[prost(message, tag = "6")]
701 MobileDownload(super::MobileDownloadHookResult),
702 #[prost(message, tag = "7")]
703 Dialog(super::DialogHookResult),
704 }
705}
706#[derive(Clone, PartialEq, ::prost::Message)]
707pub struct UploadFileChunkCommand {
708 #[prost(string, tag = "1")]
709 pub transfer_id: ::prost::alloc::string::String,
710 #[prost(string, tag = "2")]
711 pub name: ::prost::alloc::string::String,
712 #[prost(uint64, tag = "3")]
713 pub offset: u64,
714 #[prost(bytes = "vec", tag = "4")]
715 pub data: ::prost::alloc::vec::Vec<u8>,
716 #[prost(bool, tag = "5")]
717 pub last: bool,
718}
719#[derive(Clone, PartialEq, ::prost::Message)]
720pub struct FileUploadedEvent {
721 #[prost(string, tag = "1")]
722 pub transfer_id: ::prost::alloc::string::String,
723 #[prost(string, tag = "2")]
724 pub file_id: ::prost::alloc::string::String,
725 #[prost(string, tag = "3")]
726 pub name: ::prost::alloc::string::String,
727 #[prost(uint64, tag = "4")]
728 pub size: u64,
729}
730#[derive(Clone, PartialEq, ::prost::Message)]
731pub struct ReadFileChunkCommand {
732 #[prost(string, tag = "1")]
733 pub file_id: ::prost::alloc::string::String,
734 #[prost(uint64, tag = "2")]
735 pub offset: u64,
736 #[prost(uint32, tag = "3")]
737 pub max_bytes: u32,
738}
739#[derive(Clone, PartialEq, ::prost::Message)]
740pub struct FileChunkEvent {
741 #[prost(string, tag = "1")]
742 pub file_id: ::prost::alloc::string::String,
743 #[prost(uint64, tag = "2")]
744 pub offset: u64,
745 #[prost(bytes = "vec", tag = "3")]
746 pub data: ::prost::alloc::vec::Vec<u8>,
747 #[prost(bool, tag = "4")]
748 pub last: bool,
749}
750#[derive(Clone, PartialEq, ::prost::Message)]
751pub struct NavigatePageCommand {
752 #[prost(string, tag = "1")]
753 pub url: ::prost::alloc::string::String,
754 #[prost(message, optional, tag = "2")]
755 pub retry_options: ::core::option::Option<CommandRetryOptions>,
756}
757#[derive(Clone, PartialEq, ::prost::Message)]
758pub struct ClickElementCommand {
759 #[prost(string, tag = "1")]
760 pub css_selector: ::prost::alloc::string::String,
761 #[prost(message, optional, tag = "2")]
762 pub retry_options: ::core::option::Option<CommandRetryOptions>,
763}
764#[derive(Clone, PartialEq, ::prost::Message)]
765pub struct CountElementsCommand {
766 #[prost(string, tag = "1")]
767 pub css_selector: ::prost::alloc::string::String,
768 #[prost(message, optional, tag = "2")]
769 pub retry_options: ::core::option::Option<CommandRetryOptions>,
770}
771#[derive(Clone, PartialEq, ::prost::Message)]
772pub struct HighlightElementsCommand {
773 #[prost(string, tag = "1")]
774 pub css_selector: ::prost::alloc::string::String,
775 #[prost(uint32, optional, tag = "2")]
776 pub duration_ms: ::core::option::Option<u32>,
777 #[prost(message, optional, tag = "3")]
778 pub retry_options: ::core::option::Option<CommandRetryOptions>,
779}
780#[derive(Clone, PartialEq, ::prost::Message)]
781pub struct FocusElementCommand {
782 #[prost(string, tag = "1")]
783 pub css_selector: ::prost::alloc::string::String,
784 #[prost(message, optional, tag = "2")]
785 pub retry_options: ::core::option::Option<CommandRetryOptions>,
786}
787#[derive(Clone, PartialEq, ::prost::Message)]
788pub struct FillElementCommand {
789 #[prost(string, tag = "1")]
790 pub css_selector: ::prost::alloc::string::String,
791 #[prost(string, tag = "2")]
792 pub value: ::prost::alloc::string::String,
793 #[prost(message, optional, tag = "3")]
794 pub retry_options: ::core::option::Option<CommandRetryOptions>,
795}
796#[derive(Clone, PartialEq, ::prost::Message)]
797pub struct HoverElementCommand {
798 #[prost(string, tag = "1")]
799 pub css_selector: ::prost::alloc::string::String,
800 #[prost(message, optional, tag = "2")]
801 pub retry_options: ::core::option::Option<CommandRetryOptions>,
802}
803#[derive(Clone, PartialEq, ::prost::Message)]
804pub struct PressKeyCommand {
805 #[prost(string, tag = "1")]
806 pub css_selector: ::prost::alloc::string::String,
807 #[prost(string, tag = "2")]
808 pub key: ::prost::alloc::string::String,
809 #[prost(string, optional, tag = "3")]
810 pub text: ::core::option::Option<::prost::alloc::string::String>,
811 #[prost(message, optional, tag = "4")]
812 pub retry_options: ::core::option::Option<CommandRetryOptions>,
813}
814#[derive(Clone, PartialEq, ::prost::Message)]
815pub struct GetTextContentCommand {
816 #[prost(string, tag = "1")]
817 pub css_selector: ::prost::alloc::string::String,
818 #[prost(message, optional, tag = "2")]
819 pub retry_options: ::core::option::Option<CommandRetryOptions>,
820}
821#[derive(Clone, PartialEq, ::prost::Message)]
822pub struct GetInnerTextCommand {
823 #[prost(string, tag = "1")]
824 pub css_selector: ::prost::alloc::string::String,
825 #[prost(message, optional, tag = "2")]
826 pub retry_options: ::core::option::Option<CommandRetryOptions>,
827}
828#[derive(Clone, PartialEq, ::prost::Message)]
829pub struct WaitForSelectorCommand {
830 #[prost(string, tag = "1")]
831 pub css_selector: ::prost::alloc::string::String,
832 #[prost(bool, optional, tag = "2")]
833 pub visible: ::core::option::Option<bool>,
834 #[prost(message, optional, tag = "3")]
835 pub retry_options: ::core::option::Option<CommandRetryOptions>,
836}
837#[derive(Clone, Copy, PartialEq, ::prost::Message)]
838pub struct ScreenshotCommand {
839 #[prost(message, optional, tag = "1")]
840 pub retry_options: ::core::option::Option<CommandRetryOptions>,
841 #[prost(bool, optional, tag = "2")]
842 pub full_page: ::core::option::Option<bool>,
843}
844#[derive(Clone, PartialEq, ::prost::Message)]
845pub struct PageNavigatedEvent {
846 #[prost(string, tag = "1")]
847 pub url: ::prost::alloc::string::String,
848 #[prost(string, tag = "2")]
849 pub note: ::prost::alloc::string::String,
850}
851#[derive(Clone, PartialEq, ::prost::Message)]
852pub struct ChromiumBidiInjectionEvent {
853 #[prost(string, tag = "1")]
854 pub note: ::prost::alloc::string::String,
855 #[prost(string, tag = "2")]
856 pub bidi_session_id: ::prost::alloc::string::String,
857 #[prost(string, tag = "3")]
858 pub mapper_target_id: ::prost::alloc::string::String,
859 #[prost(string, tag = "4")]
860 pub mapper_session_id: ::prost::alloc::string::String,
861 #[prost(string, tag = "5")]
862 pub package_version: ::prost::alloc::string::String,
863}
864#[derive(Clone, PartialEq, ::prost::Message)]
865pub struct ElementClickedEvent {
866 #[prost(string, tag = "1")]
867 pub css_selector: ::prost::alloc::string::String,
868 #[prost(string, tag = "2")]
869 pub note: ::prost::alloc::string::String,
870 #[prost(string, tag = "3")]
871 pub bidi_session_id: ::prost::alloc::string::String,
872}
873#[derive(Clone, PartialEq, ::prost::Message)]
874pub struct ElementCountedEvent {
875 #[prost(string, tag = "1")]
876 pub css_selector: ::prost::alloc::string::String,
877 #[prost(uint32, tag = "2")]
878 pub count: u32,
879 #[prost(string, tag = "3")]
880 pub note: ::prost::alloc::string::String,
881}
882#[derive(Clone, PartialEq, ::prost::Message)]
883pub struct ElementsHighlightedEvent {
884 #[prost(string, tag = "1")]
885 pub css_selector: ::prost::alloc::string::String,
886 #[prost(uint32, tag = "2")]
887 pub count: u32,
888 #[prost(string, tag = "3")]
889 pub note: ::prost::alloc::string::String,
890}
891#[derive(Clone, PartialEq, ::prost::Message)]
892pub struct ElementFocusedEvent {
893 #[prost(string, tag = "1")]
894 pub css_selector: ::prost::alloc::string::String,
895 #[prost(string, tag = "2")]
896 pub note: ::prost::alloc::string::String,
897}
898#[derive(Clone, PartialEq, ::prost::Message)]
899pub struct ElementFilledEvent {
900 #[prost(string, tag = "1")]
901 pub css_selector: ::prost::alloc::string::String,
902 #[prost(string, tag = "2")]
903 pub value: ::prost::alloc::string::String,
904 #[prost(string, tag = "3")]
905 pub note: ::prost::alloc::string::String,
906}
907#[derive(Clone, PartialEq, ::prost::Message)]
908pub struct ElementHoveredEvent {
909 #[prost(string, tag = "1")]
910 pub css_selector: ::prost::alloc::string::String,
911 #[prost(string, tag = "2")]
912 pub note: ::prost::alloc::string::String,
913}
914#[derive(Clone, PartialEq, ::prost::Message)]
915pub struct KeyPressedEvent {
916 #[prost(string, tag = "1")]
917 pub css_selector: ::prost::alloc::string::String,
918 #[prost(string, tag = "2")]
919 pub key: ::prost::alloc::string::String,
920 #[prost(string, tag = "3")]
921 pub note: ::prost::alloc::string::String,
922}
923#[derive(Clone, PartialEq, ::prost::Message)]
924pub struct TextContentResolvedEvent {
925 #[prost(string, tag = "1")]
926 pub css_selector: ::prost::alloc::string::String,
927 #[prost(string, tag = "2")]
928 pub text: ::prost::alloc::string::String,
929 #[prost(string, tag = "3")]
930 pub note: ::prost::alloc::string::String,
931}
932#[derive(Clone, PartialEq, ::prost::Message)]
933pub struct InnerTextResolvedEvent {
934 #[prost(string, tag = "1")]
935 pub css_selector: ::prost::alloc::string::String,
936 #[prost(string, tag = "2")]
937 pub text: ::prost::alloc::string::String,
938 #[prost(string, tag = "3")]
939 pub note: ::prost::alloc::string::String,
940}
941#[derive(Clone, PartialEq, ::prost::Message)]
942pub struct SelectorWaitSatisfiedEvent {
943 #[prost(string, tag = "1")]
944 pub css_selector: ::prost::alloc::string::String,
945 #[prost(bool, tag = "2")]
946 pub visible: bool,
947 #[prost(string, tag = "3")]
948 pub note: ::prost::alloc::string::String,
949}
950#[derive(Clone, PartialEq, ::prost::Message)]
951pub struct ScreenshotCapturedEvent {
952 #[prost(bytes = "vec", tag = "1")]
953 pub png_data: ::prost::alloc::vec::Vec<u8>,
954 #[prost(string, tag = "2")]
955 pub note: ::prost::alloc::string::String,
956}
957#[derive(Clone, PartialEq, ::prost::Message)]
959pub struct AccessibilitySnapshotCommand {
960 #[prost(string, tag = "3")]
963 pub mode: ::prost::alloc::string::String,
964 #[prost(string, tag = "1")]
965 pub format: ::prost::alloc::string::String,
966 #[prost(message, optional, tag = "2")]
967 pub retry_options: ::core::option::Option<CommandRetryOptions>,
968}
969#[derive(Clone, PartialEq, ::prost::Message)]
971pub struct AccessibilitySnapshotCapturedEvent {
972 #[prost(string, tag = "1")]
973 pub snapshot: ::prost::alloc::string::String,
974 #[prost(string, tag = "2")]
975 pub format: ::prost::alloc::string::String,
976}
977#[derive(Clone, PartialEq, ::prost::Message)]
978pub struct CaptureCommand {
979 #[prost(enumeration = "CaptureKind", tag = "1")]
980 pub kind: i32,
981 #[prost(string, tag = "2")]
982 pub css_selector: ::prost::alloc::string::String,
983 #[prost(string, tag = "3")]
984 pub attribute_name: ::prost::alloc::string::String,
985 #[prost(message, optional, tag = "4")]
986 pub retry_options: ::core::option::Option<CommandRetryOptions>,
987}
988#[derive(Clone, PartialEq, ::prost::Message)]
989pub struct CapturedOption {
990 #[prost(string, tag = "1")]
991 pub value: ::prost::alloc::string::String,
992 #[prost(string, tag = "2")]
993 pub label: ::prost::alloc::string::String,
994 #[prost(uint32, tag = "3")]
995 pub index: u32,
996}
997#[derive(Clone, Copy, PartialEq, ::prost::Message)]
998pub struct BoundingBox {
999 #[prost(double, tag = "1")]
1000 pub x: f64,
1001 #[prost(double, tag = "2")]
1002 pub y: f64,
1003 #[prost(double, tag = "3")]
1004 pub width: f64,
1005 #[prost(double, tag = "4")]
1006 pub height: f64,
1007}
1008#[derive(Clone, PartialEq, ::prost::Message)]
1009pub struct CaptureResolvedEvent {
1010 #[prost(string, optional, tag = "1")]
1012 pub value: ::core::option::Option<::prost::alloc::string::String>,
1013 #[prost(bool, optional, tag = "2")]
1014 pub checked: ::core::option::Option<bool>,
1015 #[prost(message, repeated, tag = "3")]
1016 pub selected_options: ::prost::alloc::vec::Vec<CapturedOption>,
1017 #[prost(message, optional, tag = "4")]
1019 pub bounding_box: ::core::option::Option<BoundingBox>,
1020}
1021#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1023#[repr(i32)]
1024pub enum CaptureKind {
1025 Unspecified = 0,
1026 Url = 1,
1027 InputValue = 2,
1028 SelectedOptions = 3,
1029 SelectedText = 4,
1030 Checked = 5,
1031 Attribute = 6,
1032 BoundingBox = 7,
1033}
1034impl CaptureKind {
1035 pub fn as_str_name(&self) -> &'static str {
1040 match self {
1041 Self::Unspecified => "CAPTURE_KIND_UNSPECIFIED",
1042 Self::Url => "CAPTURE_KIND_URL",
1043 Self::InputValue => "CAPTURE_KIND_INPUT_VALUE",
1044 Self::SelectedOptions => "CAPTURE_KIND_SELECTED_OPTIONS",
1045 Self::SelectedText => "CAPTURE_KIND_SELECTED_TEXT",
1046 Self::Checked => "CAPTURE_KIND_CHECKED",
1047 Self::Attribute => "CAPTURE_KIND_ATTRIBUTE",
1048 Self::BoundingBox => "CAPTURE_KIND_BOUNDING_BOX",
1049 }
1050 }
1051 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1053 match value {
1054 "CAPTURE_KIND_UNSPECIFIED" => Some(Self::Unspecified),
1055 "CAPTURE_KIND_URL" => Some(Self::Url),
1056 "CAPTURE_KIND_INPUT_VALUE" => Some(Self::InputValue),
1057 "CAPTURE_KIND_SELECTED_OPTIONS" => Some(Self::SelectedOptions),
1058 "CAPTURE_KIND_SELECTED_TEXT" => Some(Self::SelectedText),
1059 "CAPTURE_KIND_CHECKED" => Some(Self::Checked),
1060 "CAPTURE_KIND_ATTRIBUTE" => Some(Self::Attribute),
1061 "CAPTURE_KIND_BOUNDING_BOX" => Some(Self::BoundingBox),
1062 _ => None,
1063 }
1064 }
1065}
1066pub mod engine_service_client {
1068 #![allow(
1069 unused_variables,
1070 dead_code,
1071 missing_docs,
1072 clippy::wildcard_imports,
1073 clippy::let_unit_value,
1074 )]
1075 use tonic::codegen::*;
1076 use tonic::codegen::http::Uri;
1077 #[derive(Debug, Clone)]
1078 pub struct EngineServiceClient<T> {
1079 inner: tonic::client::Grpc<T>,
1080 }
1081 impl EngineServiceClient<tonic::transport::Channel> {
1082 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1084 where
1085 D: TryInto<tonic::transport::Endpoint>,
1086 D::Error: Into<StdError>,
1087 {
1088 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1089 Ok(Self::new(conn))
1090 }
1091 }
1092 impl<T> EngineServiceClient<T>
1093 where
1094 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1095 T::Error: Into<StdError>,
1096 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1097 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1098 {
1099 pub fn new(inner: T) -> Self {
1100 let inner = tonic::client::Grpc::new(inner);
1101 Self { inner }
1102 }
1103 pub fn with_origin(inner: T, origin: Uri) -> Self {
1104 let inner = tonic::client::Grpc::with_origin(inner, origin);
1105 Self { inner }
1106 }
1107 pub fn with_interceptor<F>(
1108 inner: T,
1109 interceptor: F,
1110 ) -> EngineServiceClient<InterceptedService<T, F>>
1111 where
1112 F: tonic::service::Interceptor,
1113 T::ResponseBody: Default,
1114 T: tonic::codegen::Service<
1115 http::Request<tonic::body::BoxBody>,
1116 Response = http::Response<
1117 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1118 >,
1119 >,
1120 <T as tonic::codegen::Service<
1121 http::Request<tonic::body::BoxBody>,
1122 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1123 {
1124 EngineServiceClient::new(InterceptedService::new(inner, interceptor))
1125 }
1126 #[must_use]
1131 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1132 self.inner = self.inner.send_compressed(encoding);
1133 self
1134 }
1135 #[must_use]
1137 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1138 self.inner = self.inner.accept_compressed(encoding);
1139 self
1140 }
1141 #[must_use]
1145 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1146 self.inner = self.inner.max_decoding_message_size(limit);
1147 self
1148 }
1149 #[must_use]
1153 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1154 self.inner = self.inner.max_encoding_message_size(limit);
1155 self
1156 }
1157 pub async fn ping(
1158 &mut self,
1159 request: impl tonic::IntoRequest<super::PingRequest>,
1160 ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status> {
1161 self.inner
1162 .ready()
1163 .await
1164 .map_err(|e| {
1165 tonic::Status::unknown(
1166 format!("Service was not ready: {}", e.into()),
1167 )
1168 })?;
1169 let codec = tonic::codec::ProstCodec::default();
1170 let path = http::uri::PathAndQuery::from_static(
1171 "/allwright.engine.v1.EngineService/Ping",
1172 );
1173 let mut req = request.into_request();
1174 req.extensions_mut()
1175 .insert(GrpcMethod::new("allwright.engine.v1.EngineService", "Ping"));
1176 self.inner.unary(req, path, codec).await
1177 }
1178 pub async fn surface_session(
1179 &mut self,
1180 request: impl tonic::IntoStreamingRequest<
1181 Message = super::SurfaceSessionCommand,
1182 >,
1183 ) -> std::result::Result<
1184 tonic::Response<tonic::codec::Streaming<super::SurfaceSessionEvent>>,
1185 tonic::Status,
1186 > {
1187 self.inner
1188 .ready()
1189 .await
1190 .map_err(|e| {
1191 tonic::Status::unknown(
1192 format!("Service was not ready: {}", e.into()),
1193 )
1194 })?;
1195 let codec = tonic::codec::ProstCodec::default();
1196 let path = http::uri::PathAndQuery::from_static(
1197 "/allwright.engine.v1.EngineService/SurfaceSession",
1198 );
1199 let mut req = request.into_streaming_request();
1200 req.extensions_mut()
1201 .insert(
1202 GrpcMethod::new(
1203 "allwright.engine.v1.EngineService",
1204 "SurfaceSession",
1205 ),
1206 );
1207 self.inner.streaming(req, path, codec).await
1208 }
1209 pub async fn context_session(
1210 &mut self,
1211 request: impl tonic::IntoStreamingRequest<
1212 Message = super::ContextSessionCommand,
1213 >,
1214 ) -> std::result::Result<
1215 tonic::Response<tonic::codec::Streaming<super::ContextSessionEvent>>,
1216 tonic::Status,
1217 > {
1218 self.inner
1219 .ready()
1220 .await
1221 .map_err(|e| {
1222 tonic::Status::unknown(
1223 format!("Service was not ready: {}", e.into()),
1224 )
1225 })?;
1226 let codec = tonic::codec::ProstCodec::default();
1227 let path = http::uri::PathAndQuery::from_static(
1228 "/allwright.engine.v1.EngineService/ContextSession",
1229 );
1230 let mut req = request.into_streaming_request();
1231 req.extensions_mut()
1232 .insert(
1233 GrpcMethod::new(
1234 "allwright.engine.v1.EngineService",
1235 "ContextSession",
1236 ),
1237 );
1238 self.inner.streaming(req, path, codec).await
1239 }
1240 }
1241}
1242pub mod engine_service_server {
1244 #![allow(
1245 unused_variables,
1246 dead_code,
1247 missing_docs,
1248 clippy::wildcard_imports,
1249 clippy::let_unit_value,
1250 )]
1251 use tonic::codegen::*;
1252 #[async_trait]
1254 pub trait EngineService: std::marker::Send + std::marker::Sync + 'static {
1255 async fn ping(
1256 &self,
1257 request: tonic::Request<super::PingRequest>,
1258 ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status>;
1259 type SurfaceSessionStream: tonic::codegen::tokio_stream::Stream<
1261 Item = std::result::Result<super::SurfaceSessionEvent, tonic::Status>,
1262 >
1263 + std::marker::Send
1264 + 'static;
1265 async fn surface_session(
1266 &self,
1267 request: tonic::Request<tonic::Streaming<super::SurfaceSessionCommand>>,
1268 ) -> std::result::Result<
1269 tonic::Response<Self::SurfaceSessionStream>,
1270 tonic::Status,
1271 >;
1272 type ContextSessionStream: tonic::codegen::tokio_stream::Stream<
1274 Item = std::result::Result<super::ContextSessionEvent, tonic::Status>,
1275 >
1276 + std::marker::Send
1277 + 'static;
1278 async fn context_session(
1279 &self,
1280 request: tonic::Request<tonic::Streaming<super::ContextSessionCommand>>,
1281 ) -> std::result::Result<
1282 tonic::Response<Self::ContextSessionStream>,
1283 tonic::Status,
1284 >;
1285 }
1286 #[derive(Debug)]
1287 pub struct EngineServiceServer<T> {
1288 inner: Arc<T>,
1289 accept_compression_encodings: EnabledCompressionEncodings,
1290 send_compression_encodings: EnabledCompressionEncodings,
1291 max_decoding_message_size: Option<usize>,
1292 max_encoding_message_size: Option<usize>,
1293 }
1294 impl<T> EngineServiceServer<T> {
1295 pub fn new(inner: T) -> Self {
1296 Self::from_arc(Arc::new(inner))
1297 }
1298 pub fn from_arc(inner: Arc<T>) -> Self {
1299 Self {
1300 inner,
1301 accept_compression_encodings: Default::default(),
1302 send_compression_encodings: Default::default(),
1303 max_decoding_message_size: None,
1304 max_encoding_message_size: None,
1305 }
1306 }
1307 pub fn with_interceptor<F>(
1308 inner: T,
1309 interceptor: F,
1310 ) -> InterceptedService<Self, F>
1311 where
1312 F: tonic::service::Interceptor,
1313 {
1314 InterceptedService::new(Self::new(inner), interceptor)
1315 }
1316 #[must_use]
1318 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1319 self.accept_compression_encodings.enable(encoding);
1320 self
1321 }
1322 #[must_use]
1324 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1325 self.send_compression_encodings.enable(encoding);
1326 self
1327 }
1328 #[must_use]
1332 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1333 self.max_decoding_message_size = Some(limit);
1334 self
1335 }
1336 #[must_use]
1340 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1341 self.max_encoding_message_size = Some(limit);
1342 self
1343 }
1344 }
1345 impl<T, B> tonic::codegen::Service<http::Request<B>> for EngineServiceServer<T>
1346 where
1347 T: EngineService,
1348 B: Body + std::marker::Send + 'static,
1349 B::Error: Into<StdError> + std::marker::Send + 'static,
1350 {
1351 type Response = http::Response<tonic::body::BoxBody>;
1352 type Error = std::convert::Infallible;
1353 type Future = BoxFuture<Self::Response, Self::Error>;
1354 fn poll_ready(
1355 &mut self,
1356 _cx: &mut Context<'_>,
1357 ) -> Poll<std::result::Result<(), Self::Error>> {
1358 Poll::Ready(Ok(()))
1359 }
1360 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1361 match req.uri().path() {
1362 "/allwright.engine.v1.EngineService/Ping" => {
1363 #[allow(non_camel_case_types)]
1364 struct PingSvc<T: EngineService>(pub Arc<T>);
1365 impl<
1366 T: EngineService,
1367 > tonic::server::UnaryService<super::PingRequest> for PingSvc<T> {
1368 type Response = super::PingResponse;
1369 type Future = BoxFuture<
1370 tonic::Response<Self::Response>,
1371 tonic::Status,
1372 >;
1373 fn call(
1374 &mut self,
1375 request: tonic::Request<super::PingRequest>,
1376 ) -> Self::Future {
1377 let inner = Arc::clone(&self.0);
1378 let fut = async move {
1379 <T as EngineService>::ping(&inner, request).await
1380 };
1381 Box::pin(fut)
1382 }
1383 }
1384 let accept_compression_encodings = self.accept_compression_encodings;
1385 let send_compression_encodings = self.send_compression_encodings;
1386 let max_decoding_message_size = self.max_decoding_message_size;
1387 let max_encoding_message_size = self.max_encoding_message_size;
1388 let inner = self.inner.clone();
1389 let fut = async move {
1390 let method = PingSvc(inner);
1391 let codec = tonic::codec::ProstCodec::default();
1392 let mut grpc = tonic::server::Grpc::new(codec)
1393 .apply_compression_config(
1394 accept_compression_encodings,
1395 send_compression_encodings,
1396 )
1397 .apply_max_message_size_config(
1398 max_decoding_message_size,
1399 max_encoding_message_size,
1400 );
1401 let res = grpc.unary(method, req).await;
1402 Ok(res)
1403 };
1404 Box::pin(fut)
1405 }
1406 "/allwright.engine.v1.EngineService/SurfaceSession" => {
1407 #[allow(non_camel_case_types)]
1408 struct SurfaceSessionSvc<T: EngineService>(pub Arc<T>);
1409 impl<
1410 T: EngineService,
1411 > tonic::server::StreamingService<super::SurfaceSessionCommand>
1412 for SurfaceSessionSvc<T> {
1413 type Response = super::SurfaceSessionEvent;
1414 type ResponseStream = T::SurfaceSessionStream;
1415 type Future = BoxFuture<
1416 tonic::Response<Self::ResponseStream>,
1417 tonic::Status,
1418 >;
1419 fn call(
1420 &mut self,
1421 request: tonic::Request<
1422 tonic::Streaming<super::SurfaceSessionCommand>,
1423 >,
1424 ) -> Self::Future {
1425 let inner = Arc::clone(&self.0);
1426 let fut = async move {
1427 <T as EngineService>::surface_session(&inner, request).await
1428 };
1429 Box::pin(fut)
1430 }
1431 }
1432 let accept_compression_encodings = self.accept_compression_encodings;
1433 let send_compression_encodings = self.send_compression_encodings;
1434 let max_decoding_message_size = self.max_decoding_message_size;
1435 let max_encoding_message_size = self.max_encoding_message_size;
1436 let inner = self.inner.clone();
1437 let fut = async move {
1438 let method = SurfaceSessionSvc(inner);
1439 let codec = tonic::codec::ProstCodec::default();
1440 let mut grpc = tonic::server::Grpc::new(codec)
1441 .apply_compression_config(
1442 accept_compression_encodings,
1443 send_compression_encodings,
1444 )
1445 .apply_max_message_size_config(
1446 max_decoding_message_size,
1447 max_encoding_message_size,
1448 );
1449 let res = grpc.streaming(method, req).await;
1450 Ok(res)
1451 };
1452 Box::pin(fut)
1453 }
1454 "/allwright.engine.v1.EngineService/ContextSession" => {
1455 #[allow(non_camel_case_types)]
1456 struct ContextSessionSvc<T: EngineService>(pub Arc<T>);
1457 impl<
1458 T: EngineService,
1459 > tonic::server::StreamingService<super::ContextSessionCommand>
1460 for ContextSessionSvc<T> {
1461 type Response = super::ContextSessionEvent;
1462 type ResponseStream = T::ContextSessionStream;
1463 type Future = BoxFuture<
1464 tonic::Response<Self::ResponseStream>,
1465 tonic::Status,
1466 >;
1467 fn call(
1468 &mut self,
1469 request: tonic::Request<
1470 tonic::Streaming<super::ContextSessionCommand>,
1471 >,
1472 ) -> Self::Future {
1473 let inner = Arc::clone(&self.0);
1474 let fut = async move {
1475 <T as EngineService>::context_session(&inner, request).await
1476 };
1477 Box::pin(fut)
1478 }
1479 }
1480 let accept_compression_encodings = self.accept_compression_encodings;
1481 let send_compression_encodings = self.send_compression_encodings;
1482 let max_decoding_message_size = self.max_decoding_message_size;
1483 let max_encoding_message_size = self.max_encoding_message_size;
1484 let inner = self.inner.clone();
1485 let fut = async move {
1486 let method = ContextSessionSvc(inner);
1487 let codec = tonic::codec::ProstCodec::default();
1488 let mut grpc = tonic::server::Grpc::new(codec)
1489 .apply_compression_config(
1490 accept_compression_encodings,
1491 send_compression_encodings,
1492 )
1493 .apply_max_message_size_config(
1494 max_decoding_message_size,
1495 max_encoding_message_size,
1496 );
1497 let res = grpc.streaming(method, req).await;
1498 Ok(res)
1499 };
1500 Box::pin(fut)
1501 }
1502 _ => {
1503 Box::pin(async move {
1504 let mut response = http::Response::new(empty_body());
1505 let headers = response.headers_mut();
1506 headers
1507 .insert(
1508 tonic::Status::GRPC_STATUS,
1509 (tonic::Code::Unimplemented as i32).into(),
1510 );
1511 headers
1512 .insert(
1513 http::header::CONTENT_TYPE,
1514 tonic::metadata::GRPC_CONTENT_TYPE,
1515 );
1516 Ok(response)
1517 })
1518 }
1519 }
1520 }
1521 }
1522 impl<T> Clone for EngineServiceServer<T> {
1523 fn clone(&self) -> Self {
1524 let inner = self.inner.clone();
1525 Self {
1526 inner,
1527 accept_compression_encodings: self.accept_compression_encodings,
1528 send_compression_encodings: self.send_compression_encodings,
1529 max_decoding_message_size: self.max_decoding_message_size,
1530 max_encoding_message_size: self.max_encoding_message_size,
1531 }
1532 }
1533 }
1534 pub const SERVICE_NAME: &str = "allwright.engine.v1.EngineService";
1536 impl<T> tonic::server::NamedService for EngineServiceServer<T> {
1537 const NAME: &'static str = SERVICE_NAME;
1538 }
1539}