Skip to main content

allwright/
allwright.engine.v1.rs

1// This file is @generated by prost-build.
2#[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    /// String value of the enum field names used in the ProtoBuf definition.
149    ///
150    /// The values are not transformed in any way and thus are considered stable
151    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
152    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    /// Creates an enum from field names used in the ProtoBuf definition.
160    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    /// String value of the enum field names used in the ProtoBuf definition.
179    ///
180    /// The values are not transformed in any way and thus are considered stable
181    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
182    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    /// Creates an enum from field names used in the ProtoBuf definition.
191    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)]
244pub struct RegisterNewPageHook {}
245#[derive(Clone, PartialEq, ::prost::Message)]
246pub struct NewPageHookResult {
247    #[prost(string, tag = "1")]
248    pub context_session_id: ::prost::alloc::string::String,
249    #[prost(string, tag = "2")]
250    pub note: ::prost::alloc::string::String,
251}
252#[derive(Clone, Copy, PartialEq, ::prost::Message)]
253pub struct RegisterFileChooserHook {}
254#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct FileChooserHookResult {
256    #[prost(string, tag = "1")]
257    pub file_chooser_id: ::prost::alloc::string::String,
258    #[prost(bool, tag = "2")]
259    pub is_multiple: bool,
260    #[prost(string, tag = "3")]
261    pub note: ::prost::alloc::string::String,
262}
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct SetFileChooserFilesCommand {
265    #[prost(string, tag = "1")]
266    pub file_chooser_id: ::prost::alloc::string::String,
267    #[prost(string, repeated, tag = "2")]
268    pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
269    #[prost(message, optional, tag = "3")]
270    pub retry_options: ::core::option::Option<CommandRetryOptions>,
271}
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct FileChooserFilesSetEvent {
274    #[prost(string, tag = "1")]
275    pub file_chooser_id: ::prost::alloc::string::String,
276    #[prost(string, repeated, tag = "2")]
277    pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
278    #[prost(string, tag = "3")]
279    pub note: ::prost::alloc::string::String,
280}
281#[derive(Clone, Copy, PartialEq, ::prost::Message)]
282pub struct RegisterDownloadHook {}
283#[derive(Clone, PartialEq, ::prost::Message)]
284pub struct DownloadHookResult {
285    #[prost(string, tag = "1")]
286    pub download_id: ::prost::alloc::string::String,
287    #[prost(string, tag = "2")]
288    pub url: ::prost::alloc::string::String,
289    #[prost(string, tag = "3")]
290    pub suggested_filename: ::prost::alloc::string::String,
291    #[prost(string, tag = "4")]
292    pub note: ::prost::alloc::string::String,
293}
294#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct SaveDownloadCommand {
296    #[prost(string, tag = "1")]
297    pub download_id: ::prost::alloc::string::String,
298    #[prost(message, optional, tag = "2")]
299    pub retry_options: ::core::option::Option<CommandRetryOptions>,
300}
301#[derive(Clone, PartialEq, ::prost::Message)]
302pub struct DownloadSavedEvent {
303    #[prost(string, tag = "1")]
304    pub download_id: ::prost::alloc::string::String,
305    #[prost(string, tag = "2")]
306    pub file_id: ::prost::alloc::string::String,
307    #[prost(string, tag = "3")]
308    pub suggested_filename: ::prost::alloc::string::String,
309    #[prost(uint64, tag = "4")]
310    pub size: u64,
311    #[prost(string, tag = "5")]
312    pub note: ::prost::alloc::string::String,
313}
314#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
315#[repr(i32)]
316pub enum BrowserKind {
317    Unspecified = 0,
318    Chromium = 1,
319    Firefox = 2,
320}
321impl BrowserKind {
322    /// String value of the enum field names used in the ProtoBuf definition.
323    ///
324    /// The values are not transformed in any way and thus are considered stable
325    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
326    pub fn as_str_name(&self) -> &'static str {
327        match self {
328            Self::Unspecified => "BROWSER_KIND_UNSPECIFIED",
329            Self::Chromium => "BROWSER_KIND_CHROMIUM",
330            Self::Firefox => "BROWSER_KIND_FIREFOX",
331        }
332    }
333    /// Creates an enum from field names used in the ProtoBuf definition.
334    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
335        match value {
336            "BROWSER_KIND_UNSPECIFIED" => Some(Self::Unspecified),
337            "BROWSER_KIND_CHROMIUM" => Some(Self::Chromium),
338            "BROWSER_KIND_FIREFOX" => Some(Self::Firefox),
339            _ => None,
340        }
341    }
342}
343#[derive(Clone, PartialEq, ::prost::Message)]
344pub struct SurfaceSessionCommand {
345    #[prost(oneof = "surface_session_command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
346    pub command: ::core::option::Option<surface_session_command::Command>,
347}
348/// Nested message and enum types in `SurfaceSessionCommand`.
349pub mod surface_session_command {
350    #[derive(Clone, PartialEq, ::prost::Oneof)]
351    pub enum Command {
352        #[prost(message, tag = "1")]
353        LaunchChrome(super::LaunchChromeCommand),
354        #[prost(message, tag = "2")]
355        OpenContext(super::OpenContextCommand),
356        #[prost(message, tag = "3")]
357        Ping(super::SessionPingCommand),
358        #[prost(message, tag = "4")]
359        Close(super::CloseSurfaceSessionCommand),
360        #[prost(message, tag = "5")]
361        LaunchBrowser(super::LaunchBrowserCommand),
362        #[prost(message, tag = "6")]
363        ConnectMobile(super::ConnectMobileCommand),
364        #[prost(message, tag = "7")]
365        LaunchApp(super::LaunchAppCommand),
366    }
367}
368#[derive(Clone, Copy, PartialEq, ::prost::Message)]
369pub struct OpenContextCommand {
370    #[prost(message, optional, tag = "1")]
371    pub retry_options: ::core::option::Option<CommandRetryOptions>,
372}
373#[derive(Clone, PartialEq, ::prost::Message)]
374pub struct SessionPingCommand {
375    #[prost(string, tag = "1")]
376    pub message: ::prost::alloc::string::String,
377}
378#[derive(Clone, Copy, PartialEq, ::prost::Message)]
379pub struct CloseSurfaceSessionCommand {}
380#[derive(Clone, PartialEq, ::prost::Message)]
381pub struct SurfaceSessionEvent {
382    #[prost(string, tag = "1")]
383    pub session_id: ::prost::alloc::string::String,
384    #[prost(oneof = "surface_session_event::Event", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
385    pub event: ::core::option::Option<surface_session_event::Event>,
386}
387/// Nested message and enum types in `SurfaceSessionEvent`.
388pub mod surface_session_event {
389    #[derive(Clone, PartialEq, ::prost::Oneof)]
390    pub enum Event {
391        #[prost(message, tag = "2")]
392        ChromeLaunched(super::ChromeLaunchedEvent),
393        #[prost(message, tag = "3")]
394        ContextOpened(super::ContextOpenedEvent),
395        #[prost(message, tag = "4")]
396        Pong(super::SessionPongEvent),
397        #[prost(message, tag = "5")]
398        Closed(super::SurfaceSessionClosedEvent),
399        #[prost(message, tag = "6")]
400        Error(super::SurfaceSessionErrorEvent),
401        #[prost(message, tag = "7")]
402        BrowserLaunched(super::BrowserLaunchedEvent),
403        #[prost(message, tag = "8")]
404        MobileConnected(super::MobileConnectedEvent),
405        #[prost(message, tag = "9")]
406        AppLaunched(super::AppLaunchedEvent),
407    }
408}
409#[derive(Clone, PartialEq, ::prost::Message)]
410pub struct ContextOpenedEvent {
411    #[prost(string, tag = "1")]
412    pub context_session_id: ::prost::alloc::string::String,
413    #[prost(string, tag = "2")]
414    pub note: ::prost::alloc::string::String,
415}
416#[derive(Clone, PartialEq, ::prost::Message)]
417pub struct SessionPongEvent {
418    #[prost(string, tag = "1")]
419    pub message: ::prost::alloc::string::String,
420}
421#[derive(Clone, PartialEq, ::prost::Message)]
422pub struct SurfaceSessionClosedEvent {
423    #[prost(string, tag = "1")]
424    pub reason: ::prost::alloc::string::String,
425}
426#[derive(Clone, PartialEq, ::prost::Message)]
427pub struct SurfaceSessionErrorEvent {
428    #[prost(string, tag = "1")]
429    pub message: ::prost::alloc::string::String,
430}
431#[derive(Clone, PartialEq, ::prost::Message)]
432pub struct ContextSessionCommand {
433    #[prost(string, tag = "1")]
434    pub surface_session_id: ::prost::alloc::string::String,
435    #[prost(string, tag = "2")]
436    pub context_session_id: ::prost::alloc::string::String,
437    #[prost(
438        oneof = "context_session_command::Command",
439        tags = "3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25"
440    )]
441    pub command: ::core::option::Option<context_session_command::Command>,
442}
443/// Nested message and enum types in `ContextSessionCommand`.
444pub mod context_session_command {
445    #[derive(Clone, PartialEq, ::prost::Oneof)]
446    pub enum Command {
447        #[prost(message, tag = "3")]
448        Ping(super::ContextSessionPingCommand),
449        #[prost(message, tag = "4")]
450        Close(super::CloseContextSessionCommand),
451        #[prost(message, tag = "5")]
452        Navigate(super::NavigatePageCommand),
453        #[prost(message, tag = "6")]
454        ClickElement(super::ClickElementCommand),
455        #[prost(message, tag = "7")]
456        CountElements(super::CountElementsCommand),
457        #[prost(message, tag = "8")]
458        HighlightElements(super::HighlightElementsCommand),
459        #[prost(message, tag = "9")]
460        FocusElement(super::FocusElementCommand),
461        #[prost(message, tag = "10")]
462        FillElement(super::FillElementCommand),
463        #[prost(message, tag = "11")]
464        HoverElement(super::HoverElementCommand),
465        #[prost(message, tag = "12")]
466        PressKey(super::PressKeyCommand),
467        #[prost(message, tag = "13")]
468        GetTextContent(super::GetTextContentCommand),
469        #[prost(message, tag = "14")]
470        GetInnerText(super::GetInnerTextCommand),
471        #[prost(message, tag = "15")]
472        WaitForSelector(super::WaitForSelectorCommand),
473        #[prost(message, tag = "16")]
474        Screenshot(super::ScreenshotCommand),
475        #[prost(message, tag = "17")]
476        AccessibilitySnapshot(super::AccessibilitySnapshotCommand),
477        #[prost(message, tag = "18")]
478        RegisterHook(super::RegisterHookCommand),
479        #[prost(message, tag = "19")]
480        WaitForHook(super::WaitForHookCommand),
481        #[prost(message, tag = "20")]
482        SetFileChooserFiles(super::SetFileChooserFilesCommand),
483        #[prost(message, tag = "21")]
484        SaveDownload(super::SaveDownloadCommand),
485        #[prost(message, tag = "22")]
486        UploadFileChunk(super::UploadFileChunkCommand),
487        #[prost(message, tag = "23")]
488        ReadFileChunk(super::ReadFileChunkCommand),
489        #[prost(message, tag = "24")]
490        SetMobileFileChooserFiles(super::SetMobileFileChooserFilesCommand),
491        #[prost(message, tag = "25")]
492        SaveMobileDownload(super::SaveMobileDownloadCommand),
493    }
494}
495#[derive(Clone, PartialEq, ::prost::Message)]
496pub struct ContextSessionPingCommand {
497    #[prost(string, tag = "1")]
498    pub message: ::prost::alloc::string::String,
499}
500#[derive(Clone, Copy, PartialEq, ::prost::Message)]
501pub struct CloseContextSessionCommand {}
502#[derive(Clone, PartialEq, ::prost::Message)]
503pub struct ContextSessionEvent {
504    #[prost(string, tag = "1")]
505    pub context_session_id: ::prost::alloc::string::String,
506    #[prost(
507        oneof = "context_session_event::Event",
508        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"
509    )]
510    pub event: ::core::option::Option<context_session_event::Event>,
511}
512/// Nested message and enum types in `ContextSessionEvent`.
513pub mod context_session_event {
514    #[derive(Clone, PartialEq, ::prost::Oneof)]
515    pub enum Event {
516        #[prost(message, tag = "2")]
517        Attached(super::ContextSessionAttachedEvent),
518        #[prost(message, tag = "3")]
519        Pong(super::ContextSessionPongEvent),
520        #[prost(message, tag = "4")]
521        Closed(super::ContextSessionClosedEvent),
522        #[prost(message, tag = "5")]
523        Error(super::ContextSessionErrorEvent),
524        #[prost(message, tag = "6")]
525        Navigated(super::PageNavigatedEvent),
526        #[prost(message, tag = "7")]
527        ChromiumBidiInjection(super::ChromiumBidiInjectionEvent),
528        #[prost(message, tag = "8")]
529        ElementClicked(super::ElementClickedEvent),
530        #[prost(message, tag = "9")]
531        ElementCounted(super::ElementCountedEvent),
532        #[prost(message, tag = "10")]
533        ElementsHighlighted(super::ElementsHighlightedEvent),
534        #[prost(message, tag = "11")]
535        ElementFocused(super::ElementFocusedEvent),
536        #[prost(message, tag = "12")]
537        ElementFilled(super::ElementFilledEvent),
538        #[prost(message, tag = "13")]
539        ElementHovered(super::ElementHoveredEvent),
540        #[prost(message, tag = "14")]
541        KeyPressed(super::KeyPressedEvent),
542        #[prost(message, tag = "15")]
543        TextContentResolved(super::TextContentResolvedEvent),
544        #[prost(message, tag = "16")]
545        InnerTextResolved(super::InnerTextResolvedEvent),
546        #[prost(message, tag = "17")]
547        SelectorWaitSatisfied(super::SelectorWaitSatisfiedEvent),
548        #[prost(message, tag = "18")]
549        ScreenshotCaptured(super::ScreenshotCapturedEvent),
550        #[prost(message, tag = "19")]
551        AccessibilitySnapshotCaptured(super::AccessibilitySnapshotCapturedEvent),
552        #[prost(message, tag = "20")]
553        HookRegistered(super::HookRegisteredEvent),
554        #[prost(message, tag = "21")]
555        HookCompleted(super::HookCompletedEvent),
556        #[prost(message, tag = "22")]
557        FileChooserFilesSet(super::FileChooserFilesSetEvent),
558        #[prost(message, tag = "23")]
559        DownloadSaved(super::DownloadSavedEvent),
560        #[prost(message, tag = "24")]
561        FileUploaded(super::FileUploadedEvent),
562        #[prost(message, tag = "25")]
563        FileChunk(super::FileChunkEvent),
564        #[prost(message, tag = "26")]
565        MobileFileChooserFilesSet(super::MobileFileChooserFilesSetEvent),
566        #[prost(message, tag = "27")]
567        MobileDownloadSaved(super::MobileDownloadSavedEvent),
568    }
569}
570#[derive(Clone, PartialEq, ::prost::Message)]
571pub struct ContextSessionAttachedEvent {
572    #[prost(string, tag = "1")]
573    pub note: ::prost::alloc::string::String,
574}
575#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct ContextSessionPongEvent {
577    #[prost(string, tag = "1")]
578    pub message: ::prost::alloc::string::String,
579}
580#[derive(Clone, PartialEq, ::prost::Message)]
581pub struct ContextSessionClosedEvent {
582    #[prost(string, tag = "1")]
583    pub reason: ::prost::alloc::string::String,
584}
585#[derive(Clone, PartialEq, ::prost::Message)]
586pub struct ContextSessionErrorEvent {
587    #[prost(string, tag = "1")]
588    pub message: ::prost::alloc::string::String,
589}
590#[derive(Clone, Copy, PartialEq, ::prost::Message)]
591pub struct RegisterHookCommand {
592    #[prost(oneof = "register_hook_command::Hook", tags = "1, 2, 3, 4, 5")]
593    pub hook: ::core::option::Option<register_hook_command::Hook>,
594}
595/// Nested message and enum types in `RegisterHookCommand`.
596pub mod register_hook_command {
597    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
598    pub enum Hook {
599        #[prost(message, tag = "1")]
600        NewPage(super::RegisterNewPageHook),
601        #[prost(message, tag = "2")]
602        FileChooser(super::RegisterFileChooserHook),
603        #[prost(message, tag = "3")]
604        Download(super::RegisterDownloadHook),
605        #[prost(message, tag = "4")]
606        MobileFileChooser(super::RegisterMobileFileChooserHook),
607        #[prost(message, tag = "5")]
608        MobileDownload(super::RegisterMobileDownloadHook),
609    }
610}
611#[derive(Clone, PartialEq, ::prost::Message)]
612pub struct WaitForHookCommand {
613    #[prost(string, tag = "1")]
614    pub hook_id: ::prost::alloc::string::String,
615    #[prost(message, optional, tag = "2")]
616    pub retry_options: ::core::option::Option<CommandRetryOptions>,
617}
618#[derive(Clone, PartialEq, ::prost::Message)]
619pub struct HookRegisteredEvent {
620    #[prost(string, tag = "1")]
621    pub hook_id: ::prost::alloc::string::String,
622}
623#[derive(Clone, PartialEq, ::prost::Message)]
624pub struct HookCompletedEvent {
625    #[prost(string, tag = "1")]
626    pub hook_id: ::prost::alloc::string::String,
627    #[prost(oneof = "hook_completed_event::Result", tags = "2, 3, 4, 5, 6")]
628    pub result: ::core::option::Option<hook_completed_event::Result>,
629}
630/// Nested message and enum types in `HookCompletedEvent`.
631pub mod hook_completed_event {
632    #[derive(Clone, PartialEq, ::prost::Oneof)]
633    pub enum Result {
634        #[prost(message, tag = "2")]
635        NewPage(super::NewPageHookResult),
636        #[prost(message, tag = "3")]
637        FileChooser(super::FileChooserHookResult),
638        #[prost(message, tag = "4")]
639        Download(super::DownloadHookResult),
640        #[prost(message, tag = "5")]
641        MobileFileChooser(super::MobileFileChooserHookResult),
642        #[prost(message, tag = "6")]
643        MobileDownload(super::MobileDownloadHookResult),
644    }
645}
646#[derive(Clone, PartialEq, ::prost::Message)]
647pub struct UploadFileChunkCommand {
648    #[prost(string, tag = "1")]
649    pub transfer_id: ::prost::alloc::string::String,
650    #[prost(string, tag = "2")]
651    pub name: ::prost::alloc::string::String,
652    #[prost(uint64, tag = "3")]
653    pub offset: u64,
654    #[prost(bytes = "vec", tag = "4")]
655    pub data: ::prost::alloc::vec::Vec<u8>,
656    #[prost(bool, tag = "5")]
657    pub last: bool,
658}
659#[derive(Clone, PartialEq, ::prost::Message)]
660pub struct FileUploadedEvent {
661    #[prost(string, tag = "1")]
662    pub transfer_id: ::prost::alloc::string::String,
663    #[prost(string, tag = "2")]
664    pub file_id: ::prost::alloc::string::String,
665    #[prost(string, tag = "3")]
666    pub name: ::prost::alloc::string::String,
667    #[prost(uint64, tag = "4")]
668    pub size: u64,
669}
670#[derive(Clone, PartialEq, ::prost::Message)]
671pub struct ReadFileChunkCommand {
672    #[prost(string, tag = "1")]
673    pub file_id: ::prost::alloc::string::String,
674    #[prost(uint64, tag = "2")]
675    pub offset: u64,
676    #[prost(uint32, tag = "3")]
677    pub max_bytes: u32,
678}
679#[derive(Clone, PartialEq, ::prost::Message)]
680pub struct FileChunkEvent {
681    #[prost(string, tag = "1")]
682    pub file_id: ::prost::alloc::string::String,
683    #[prost(uint64, tag = "2")]
684    pub offset: u64,
685    #[prost(bytes = "vec", tag = "3")]
686    pub data: ::prost::alloc::vec::Vec<u8>,
687    #[prost(bool, tag = "4")]
688    pub last: bool,
689}
690#[derive(Clone, PartialEq, ::prost::Message)]
691pub struct NavigatePageCommand {
692    #[prost(string, tag = "1")]
693    pub url: ::prost::alloc::string::String,
694    #[prost(message, optional, tag = "2")]
695    pub retry_options: ::core::option::Option<CommandRetryOptions>,
696}
697#[derive(Clone, PartialEq, ::prost::Message)]
698pub struct ClickElementCommand {
699    #[prost(string, tag = "1")]
700    pub css_selector: ::prost::alloc::string::String,
701    #[prost(message, optional, tag = "2")]
702    pub retry_options: ::core::option::Option<CommandRetryOptions>,
703}
704#[derive(Clone, PartialEq, ::prost::Message)]
705pub struct CountElementsCommand {
706    #[prost(string, tag = "1")]
707    pub css_selector: ::prost::alloc::string::String,
708    #[prost(message, optional, tag = "2")]
709    pub retry_options: ::core::option::Option<CommandRetryOptions>,
710}
711#[derive(Clone, PartialEq, ::prost::Message)]
712pub struct HighlightElementsCommand {
713    #[prost(string, tag = "1")]
714    pub css_selector: ::prost::alloc::string::String,
715    #[prost(uint32, optional, tag = "2")]
716    pub duration_ms: ::core::option::Option<u32>,
717    #[prost(message, optional, tag = "3")]
718    pub retry_options: ::core::option::Option<CommandRetryOptions>,
719}
720#[derive(Clone, PartialEq, ::prost::Message)]
721pub struct FocusElementCommand {
722    #[prost(string, tag = "1")]
723    pub css_selector: ::prost::alloc::string::String,
724    #[prost(message, optional, tag = "2")]
725    pub retry_options: ::core::option::Option<CommandRetryOptions>,
726}
727#[derive(Clone, PartialEq, ::prost::Message)]
728pub struct FillElementCommand {
729    #[prost(string, tag = "1")]
730    pub css_selector: ::prost::alloc::string::String,
731    #[prost(string, tag = "2")]
732    pub value: ::prost::alloc::string::String,
733    #[prost(message, optional, tag = "3")]
734    pub retry_options: ::core::option::Option<CommandRetryOptions>,
735}
736#[derive(Clone, PartialEq, ::prost::Message)]
737pub struct HoverElementCommand {
738    #[prost(string, tag = "1")]
739    pub css_selector: ::prost::alloc::string::String,
740    #[prost(message, optional, tag = "2")]
741    pub retry_options: ::core::option::Option<CommandRetryOptions>,
742}
743#[derive(Clone, PartialEq, ::prost::Message)]
744pub struct PressKeyCommand {
745    #[prost(string, tag = "1")]
746    pub css_selector: ::prost::alloc::string::String,
747    #[prost(string, tag = "2")]
748    pub key: ::prost::alloc::string::String,
749    #[prost(string, optional, tag = "3")]
750    pub text: ::core::option::Option<::prost::alloc::string::String>,
751    #[prost(message, optional, tag = "4")]
752    pub retry_options: ::core::option::Option<CommandRetryOptions>,
753}
754#[derive(Clone, PartialEq, ::prost::Message)]
755pub struct GetTextContentCommand {
756    #[prost(string, tag = "1")]
757    pub css_selector: ::prost::alloc::string::String,
758    #[prost(message, optional, tag = "2")]
759    pub retry_options: ::core::option::Option<CommandRetryOptions>,
760}
761#[derive(Clone, PartialEq, ::prost::Message)]
762pub struct GetInnerTextCommand {
763    #[prost(string, tag = "1")]
764    pub css_selector: ::prost::alloc::string::String,
765    #[prost(message, optional, tag = "2")]
766    pub retry_options: ::core::option::Option<CommandRetryOptions>,
767}
768#[derive(Clone, PartialEq, ::prost::Message)]
769pub struct WaitForSelectorCommand {
770    #[prost(string, tag = "1")]
771    pub css_selector: ::prost::alloc::string::String,
772    #[prost(bool, optional, tag = "2")]
773    pub visible: ::core::option::Option<bool>,
774    #[prost(message, optional, tag = "3")]
775    pub retry_options: ::core::option::Option<CommandRetryOptions>,
776}
777#[derive(Clone, Copy, PartialEq, ::prost::Message)]
778pub struct ScreenshotCommand {
779    #[prost(message, optional, tag = "1")]
780    pub retry_options: ::core::option::Option<CommandRetryOptions>,
781    #[prost(bool, optional, tag = "2")]
782    pub full_page: ::core::option::Option<bool>,
783}
784#[derive(Clone, PartialEq, ::prost::Message)]
785pub struct PageNavigatedEvent {
786    #[prost(string, tag = "1")]
787    pub url: ::prost::alloc::string::String,
788    #[prost(string, tag = "2")]
789    pub note: ::prost::alloc::string::String,
790}
791#[derive(Clone, PartialEq, ::prost::Message)]
792pub struct ChromiumBidiInjectionEvent {
793    #[prost(string, tag = "1")]
794    pub note: ::prost::alloc::string::String,
795    #[prost(string, tag = "2")]
796    pub bidi_session_id: ::prost::alloc::string::String,
797    #[prost(string, tag = "3")]
798    pub mapper_target_id: ::prost::alloc::string::String,
799    #[prost(string, tag = "4")]
800    pub mapper_session_id: ::prost::alloc::string::String,
801    #[prost(string, tag = "5")]
802    pub package_version: ::prost::alloc::string::String,
803}
804#[derive(Clone, PartialEq, ::prost::Message)]
805pub struct ElementClickedEvent {
806    #[prost(string, tag = "1")]
807    pub css_selector: ::prost::alloc::string::String,
808    #[prost(string, tag = "2")]
809    pub note: ::prost::alloc::string::String,
810    #[prost(string, tag = "3")]
811    pub bidi_session_id: ::prost::alloc::string::String,
812}
813#[derive(Clone, PartialEq, ::prost::Message)]
814pub struct ElementCountedEvent {
815    #[prost(string, tag = "1")]
816    pub css_selector: ::prost::alloc::string::String,
817    #[prost(uint32, tag = "2")]
818    pub count: u32,
819    #[prost(string, tag = "3")]
820    pub note: ::prost::alloc::string::String,
821}
822#[derive(Clone, PartialEq, ::prost::Message)]
823pub struct ElementsHighlightedEvent {
824    #[prost(string, tag = "1")]
825    pub css_selector: ::prost::alloc::string::String,
826    #[prost(uint32, tag = "2")]
827    pub count: u32,
828    #[prost(string, tag = "3")]
829    pub note: ::prost::alloc::string::String,
830}
831#[derive(Clone, PartialEq, ::prost::Message)]
832pub struct ElementFocusedEvent {
833    #[prost(string, tag = "1")]
834    pub css_selector: ::prost::alloc::string::String,
835    #[prost(string, tag = "2")]
836    pub note: ::prost::alloc::string::String,
837}
838#[derive(Clone, PartialEq, ::prost::Message)]
839pub struct ElementFilledEvent {
840    #[prost(string, tag = "1")]
841    pub css_selector: ::prost::alloc::string::String,
842    #[prost(string, tag = "2")]
843    pub value: ::prost::alloc::string::String,
844    #[prost(string, tag = "3")]
845    pub note: ::prost::alloc::string::String,
846}
847#[derive(Clone, PartialEq, ::prost::Message)]
848pub struct ElementHoveredEvent {
849    #[prost(string, tag = "1")]
850    pub css_selector: ::prost::alloc::string::String,
851    #[prost(string, tag = "2")]
852    pub note: ::prost::alloc::string::String,
853}
854#[derive(Clone, PartialEq, ::prost::Message)]
855pub struct KeyPressedEvent {
856    #[prost(string, tag = "1")]
857    pub css_selector: ::prost::alloc::string::String,
858    #[prost(string, tag = "2")]
859    pub key: ::prost::alloc::string::String,
860    #[prost(string, tag = "3")]
861    pub note: ::prost::alloc::string::String,
862}
863#[derive(Clone, PartialEq, ::prost::Message)]
864pub struct TextContentResolvedEvent {
865    #[prost(string, tag = "1")]
866    pub css_selector: ::prost::alloc::string::String,
867    #[prost(string, tag = "2")]
868    pub text: ::prost::alloc::string::String,
869    #[prost(string, tag = "3")]
870    pub note: ::prost::alloc::string::String,
871}
872#[derive(Clone, PartialEq, ::prost::Message)]
873pub struct InnerTextResolvedEvent {
874    #[prost(string, tag = "1")]
875    pub css_selector: ::prost::alloc::string::String,
876    #[prost(string, tag = "2")]
877    pub text: ::prost::alloc::string::String,
878    #[prost(string, tag = "3")]
879    pub note: ::prost::alloc::string::String,
880}
881#[derive(Clone, PartialEq, ::prost::Message)]
882pub struct SelectorWaitSatisfiedEvent {
883    #[prost(string, tag = "1")]
884    pub css_selector: ::prost::alloc::string::String,
885    #[prost(bool, tag = "2")]
886    pub visible: bool,
887    #[prost(string, tag = "3")]
888    pub note: ::prost::alloc::string::String,
889}
890#[derive(Clone, PartialEq, ::prost::Message)]
891pub struct ScreenshotCapturedEvent {
892    #[prost(bytes = "vec", tag = "1")]
893    pub png_data: ::prost::alloc::vec::Vec<u8>,
894    #[prost(string, tag = "2")]
895    pub note: ::prost::alloc::string::String,
896}
897/// Empty format defaults to JSON. Accepted values are "json" and "yaml".
898#[derive(Clone, PartialEq, ::prost::Message)]
899pub struct AccessibilitySnapshotCommand {
900    /// Empty mode defaults to default. AI assigns queryable references; reference storage is surface-owned.
901    /// Supported: default, ai, autoexpect, codegen.
902    #[prost(string, tag = "3")]
903    pub mode: ::prost::alloc::string::String,
904    #[prost(string, tag = "1")]
905    pub format: ::prost::alloc::string::String,
906    #[prost(message, optional, tag = "2")]
907    pub retry_options: ::core::option::Option<CommandRetryOptions>,
908}
909/// Both formats encode the same versioned, structured document.
910#[derive(Clone, PartialEq, ::prost::Message)]
911pub struct AccessibilitySnapshotCapturedEvent {
912    #[prost(string, tag = "1")]
913    pub snapshot: ::prost::alloc::string::String,
914    #[prost(string, tag = "2")]
915    pub format: ::prost::alloc::string::String,
916}
917/// Generated client implementations.
918pub mod engine_service_client {
919    #![allow(
920        unused_variables,
921        dead_code,
922        missing_docs,
923        clippy::wildcard_imports,
924        clippy::let_unit_value,
925    )]
926    use tonic::codegen::*;
927    use tonic::codegen::http::Uri;
928    #[derive(Debug, Clone)]
929    pub struct EngineServiceClient<T> {
930        inner: tonic::client::Grpc<T>,
931    }
932    impl EngineServiceClient<tonic::transport::Channel> {
933        /// Attempt to create a new client by connecting to a given endpoint.
934        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
935        where
936            D: TryInto<tonic::transport::Endpoint>,
937            D::Error: Into<StdError>,
938        {
939            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
940            Ok(Self::new(conn))
941        }
942    }
943    impl<T> EngineServiceClient<T>
944    where
945        T: tonic::client::GrpcService<tonic::body::BoxBody>,
946        T::Error: Into<StdError>,
947        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
948        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
949    {
950        pub fn new(inner: T) -> Self {
951            let inner = tonic::client::Grpc::new(inner);
952            Self { inner }
953        }
954        pub fn with_origin(inner: T, origin: Uri) -> Self {
955            let inner = tonic::client::Grpc::with_origin(inner, origin);
956            Self { inner }
957        }
958        pub fn with_interceptor<F>(
959            inner: T,
960            interceptor: F,
961        ) -> EngineServiceClient<InterceptedService<T, F>>
962        where
963            F: tonic::service::Interceptor,
964            T::ResponseBody: Default,
965            T: tonic::codegen::Service<
966                http::Request<tonic::body::BoxBody>,
967                Response = http::Response<
968                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
969                >,
970            >,
971            <T as tonic::codegen::Service<
972                http::Request<tonic::body::BoxBody>,
973            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
974        {
975            EngineServiceClient::new(InterceptedService::new(inner, interceptor))
976        }
977        /// Compress requests with the given encoding.
978        ///
979        /// This requires the server to support it otherwise it might respond with an
980        /// error.
981        #[must_use]
982        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
983            self.inner = self.inner.send_compressed(encoding);
984            self
985        }
986        /// Enable decompressing responses.
987        #[must_use]
988        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
989            self.inner = self.inner.accept_compressed(encoding);
990            self
991        }
992        /// Limits the maximum size of a decoded message.
993        ///
994        /// Default: `4MB`
995        #[must_use]
996        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
997            self.inner = self.inner.max_decoding_message_size(limit);
998            self
999        }
1000        /// Limits the maximum size of an encoded message.
1001        ///
1002        /// Default: `usize::MAX`
1003        #[must_use]
1004        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1005            self.inner = self.inner.max_encoding_message_size(limit);
1006            self
1007        }
1008        pub async fn ping(
1009            &mut self,
1010            request: impl tonic::IntoRequest<super::PingRequest>,
1011        ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status> {
1012            self.inner
1013                .ready()
1014                .await
1015                .map_err(|e| {
1016                    tonic::Status::unknown(
1017                        format!("Service was not ready: {}", e.into()),
1018                    )
1019                })?;
1020            let codec = tonic::codec::ProstCodec::default();
1021            let path = http::uri::PathAndQuery::from_static(
1022                "/allwright.engine.v1.EngineService/Ping",
1023            );
1024            let mut req = request.into_request();
1025            req.extensions_mut()
1026                .insert(GrpcMethod::new("allwright.engine.v1.EngineService", "Ping"));
1027            self.inner.unary(req, path, codec).await
1028        }
1029        pub async fn surface_session(
1030            &mut self,
1031            request: impl tonic::IntoStreamingRequest<
1032                Message = super::SurfaceSessionCommand,
1033            >,
1034        ) -> std::result::Result<
1035            tonic::Response<tonic::codec::Streaming<super::SurfaceSessionEvent>>,
1036            tonic::Status,
1037        > {
1038            self.inner
1039                .ready()
1040                .await
1041                .map_err(|e| {
1042                    tonic::Status::unknown(
1043                        format!("Service was not ready: {}", e.into()),
1044                    )
1045                })?;
1046            let codec = tonic::codec::ProstCodec::default();
1047            let path = http::uri::PathAndQuery::from_static(
1048                "/allwright.engine.v1.EngineService/SurfaceSession",
1049            );
1050            let mut req = request.into_streaming_request();
1051            req.extensions_mut()
1052                .insert(
1053                    GrpcMethod::new(
1054                        "allwright.engine.v1.EngineService",
1055                        "SurfaceSession",
1056                    ),
1057                );
1058            self.inner.streaming(req, path, codec).await
1059        }
1060        pub async fn context_session(
1061            &mut self,
1062            request: impl tonic::IntoStreamingRequest<
1063                Message = super::ContextSessionCommand,
1064            >,
1065        ) -> std::result::Result<
1066            tonic::Response<tonic::codec::Streaming<super::ContextSessionEvent>>,
1067            tonic::Status,
1068        > {
1069            self.inner
1070                .ready()
1071                .await
1072                .map_err(|e| {
1073                    tonic::Status::unknown(
1074                        format!("Service was not ready: {}", e.into()),
1075                    )
1076                })?;
1077            let codec = tonic::codec::ProstCodec::default();
1078            let path = http::uri::PathAndQuery::from_static(
1079                "/allwright.engine.v1.EngineService/ContextSession",
1080            );
1081            let mut req = request.into_streaming_request();
1082            req.extensions_mut()
1083                .insert(
1084                    GrpcMethod::new(
1085                        "allwright.engine.v1.EngineService",
1086                        "ContextSession",
1087                    ),
1088                );
1089            self.inner.streaming(req, path, codec).await
1090        }
1091    }
1092}
1093/// Generated server implementations.
1094pub mod engine_service_server {
1095    #![allow(
1096        unused_variables,
1097        dead_code,
1098        missing_docs,
1099        clippy::wildcard_imports,
1100        clippy::let_unit_value,
1101    )]
1102    use tonic::codegen::*;
1103    /// Generated trait containing gRPC methods that should be implemented for use with EngineServiceServer.
1104    #[async_trait]
1105    pub trait EngineService: std::marker::Send + std::marker::Sync + 'static {
1106        async fn ping(
1107            &self,
1108            request: tonic::Request<super::PingRequest>,
1109        ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status>;
1110        /// Server streaming response type for the SurfaceSession method.
1111        type SurfaceSessionStream: tonic::codegen::tokio_stream::Stream<
1112                Item = std::result::Result<super::SurfaceSessionEvent, tonic::Status>,
1113            >
1114            + std::marker::Send
1115            + 'static;
1116        async fn surface_session(
1117            &self,
1118            request: tonic::Request<tonic::Streaming<super::SurfaceSessionCommand>>,
1119        ) -> std::result::Result<
1120            tonic::Response<Self::SurfaceSessionStream>,
1121            tonic::Status,
1122        >;
1123        /// Server streaming response type for the ContextSession method.
1124        type ContextSessionStream: tonic::codegen::tokio_stream::Stream<
1125                Item = std::result::Result<super::ContextSessionEvent, tonic::Status>,
1126            >
1127            + std::marker::Send
1128            + 'static;
1129        async fn context_session(
1130            &self,
1131            request: tonic::Request<tonic::Streaming<super::ContextSessionCommand>>,
1132        ) -> std::result::Result<
1133            tonic::Response<Self::ContextSessionStream>,
1134            tonic::Status,
1135        >;
1136    }
1137    #[derive(Debug)]
1138    pub struct EngineServiceServer<T> {
1139        inner: Arc<T>,
1140        accept_compression_encodings: EnabledCompressionEncodings,
1141        send_compression_encodings: EnabledCompressionEncodings,
1142        max_decoding_message_size: Option<usize>,
1143        max_encoding_message_size: Option<usize>,
1144    }
1145    impl<T> EngineServiceServer<T> {
1146        pub fn new(inner: T) -> Self {
1147            Self::from_arc(Arc::new(inner))
1148        }
1149        pub fn from_arc(inner: Arc<T>) -> Self {
1150            Self {
1151                inner,
1152                accept_compression_encodings: Default::default(),
1153                send_compression_encodings: Default::default(),
1154                max_decoding_message_size: None,
1155                max_encoding_message_size: None,
1156            }
1157        }
1158        pub fn with_interceptor<F>(
1159            inner: T,
1160            interceptor: F,
1161        ) -> InterceptedService<Self, F>
1162        where
1163            F: tonic::service::Interceptor,
1164        {
1165            InterceptedService::new(Self::new(inner), interceptor)
1166        }
1167        /// Enable decompressing requests with the given encoding.
1168        #[must_use]
1169        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1170            self.accept_compression_encodings.enable(encoding);
1171            self
1172        }
1173        /// Compress responses with the given encoding, if the client supports it.
1174        #[must_use]
1175        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1176            self.send_compression_encodings.enable(encoding);
1177            self
1178        }
1179        /// Limits the maximum size of a decoded message.
1180        ///
1181        /// Default: `4MB`
1182        #[must_use]
1183        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1184            self.max_decoding_message_size = Some(limit);
1185            self
1186        }
1187        /// Limits the maximum size of an encoded message.
1188        ///
1189        /// Default: `usize::MAX`
1190        #[must_use]
1191        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1192            self.max_encoding_message_size = Some(limit);
1193            self
1194        }
1195    }
1196    impl<T, B> tonic::codegen::Service<http::Request<B>> for EngineServiceServer<T>
1197    where
1198        T: EngineService,
1199        B: Body + std::marker::Send + 'static,
1200        B::Error: Into<StdError> + std::marker::Send + 'static,
1201    {
1202        type Response = http::Response<tonic::body::BoxBody>;
1203        type Error = std::convert::Infallible;
1204        type Future = BoxFuture<Self::Response, Self::Error>;
1205        fn poll_ready(
1206            &mut self,
1207            _cx: &mut Context<'_>,
1208        ) -> Poll<std::result::Result<(), Self::Error>> {
1209            Poll::Ready(Ok(()))
1210        }
1211        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1212            match req.uri().path() {
1213                "/allwright.engine.v1.EngineService/Ping" => {
1214                    #[allow(non_camel_case_types)]
1215                    struct PingSvc<T: EngineService>(pub Arc<T>);
1216                    impl<
1217                        T: EngineService,
1218                    > tonic::server::UnaryService<super::PingRequest> for PingSvc<T> {
1219                        type Response = super::PingResponse;
1220                        type Future = BoxFuture<
1221                            tonic::Response<Self::Response>,
1222                            tonic::Status,
1223                        >;
1224                        fn call(
1225                            &mut self,
1226                            request: tonic::Request<super::PingRequest>,
1227                        ) -> Self::Future {
1228                            let inner = Arc::clone(&self.0);
1229                            let fut = async move {
1230                                <T as EngineService>::ping(&inner, request).await
1231                            };
1232                            Box::pin(fut)
1233                        }
1234                    }
1235                    let accept_compression_encodings = self.accept_compression_encodings;
1236                    let send_compression_encodings = self.send_compression_encodings;
1237                    let max_decoding_message_size = self.max_decoding_message_size;
1238                    let max_encoding_message_size = self.max_encoding_message_size;
1239                    let inner = self.inner.clone();
1240                    let fut = async move {
1241                        let method = PingSvc(inner);
1242                        let codec = tonic::codec::ProstCodec::default();
1243                        let mut grpc = tonic::server::Grpc::new(codec)
1244                            .apply_compression_config(
1245                                accept_compression_encodings,
1246                                send_compression_encodings,
1247                            )
1248                            .apply_max_message_size_config(
1249                                max_decoding_message_size,
1250                                max_encoding_message_size,
1251                            );
1252                        let res = grpc.unary(method, req).await;
1253                        Ok(res)
1254                    };
1255                    Box::pin(fut)
1256                }
1257                "/allwright.engine.v1.EngineService/SurfaceSession" => {
1258                    #[allow(non_camel_case_types)]
1259                    struct SurfaceSessionSvc<T: EngineService>(pub Arc<T>);
1260                    impl<
1261                        T: EngineService,
1262                    > tonic::server::StreamingService<super::SurfaceSessionCommand>
1263                    for SurfaceSessionSvc<T> {
1264                        type Response = super::SurfaceSessionEvent;
1265                        type ResponseStream = T::SurfaceSessionStream;
1266                        type Future = BoxFuture<
1267                            tonic::Response<Self::ResponseStream>,
1268                            tonic::Status,
1269                        >;
1270                        fn call(
1271                            &mut self,
1272                            request: tonic::Request<
1273                                tonic::Streaming<super::SurfaceSessionCommand>,
1274                            >,
1275                        ) -> Self::Future {
1276                            let inner = Arc::clone(&self.0);
1277                            let fut = async move {
1278                                <T as EngineService>::surface_session(&inner, request).await
1279                            };
1280                            Box::pin(fut)
1281                        }
1282                    }
1283                    let accept_compression_encodings = self.accept_compression_encodings;
1284                    let send_compression_encodings = self.send_compression_encodings;
1285                    let max_decoding_message_size = self.max_decoding_message_size;
1286                    let max_encoding_message_size = self.max_encoding_message_size;
1287                    let inner = self.inner.clone();
1288                    let fut = async move {
1289                        let method = SurfaceSessionSvc(inner);
1290                        let codec = tonic::codec::ProstCodec::default();
1291                        let mut grpc = tonic::server::Grpc::new(codec)
1292                            .apply_compression_config(
1293                                accept_compression_encodings,
1294                                send_compression_encodings,
1295                            )
1296                            .apply_max_message_size_config(
1297                                max_decoding_message_size,
1298                                max_encoding_message_size,
1299                            );
1300                        let res = grpc.streaming(method, req).await;
1301                        Ok(res)
1302                    };
1303                    Box::pin(fut)
1304                }
1305                "/allwright.engine.v1.EngineService/ContextSession" => {
1306                    #[allow(non_camel_case_types)]
1307                    struct ContextSessionSvc<T: EngineService>(pub Arc<T>);
1308                    impl<
1309                        T: EngineService,
1310                    > tonic::server::StreamingService<super::ContextSessionCommand>
1311                    for ContextSessionSvc<T> {
1312                        type Response = super::ContextSessionEvent;
1313                        type ResponseStream = T::ContextSessionStream;
1314                        type Future = BoxFuture<
1315                            tonic::Response<Self::ResponseStream>,
1316                            tonic::Status,
1317                        >;
1318                        fn call(
1319                            &mut self,
1320                            request: tonic::Request<
1321                                tonic::Streaming<super::ContextSessionCommand>,
1322                            >,
1323                        ) -> Self::Future {
1324                            let inner = Arc::clone(&self.0);
1325                            let fut = async move {
1326                                <T as EngineService>::context_session(&inner, request).await
1327                            };
1328                            Box::pin(fut)
1329                        }
1330                    }
1331                    let accept_compression_encodings = self.accept_compression_encodings;
1332                    let send_compression_encodings = self.send_compression_encodings;
1333                    let max_decoding_message_size = self.max_decoding_message_size;
1334                    let max_encoding_message_size = self.max_encoding_message_size;
1335                    let inner = self.inner.clone();
1336                    let fut = async move {
1337                        let method = ContextSessionSvc(inner);
1338                        let codec = tonic::codec::ProstCodec::default();
1339                        let mut grpc = tonic::server::Grpc::new(codec)
1340                            .apply_compression_config(
1341                                accept_compression_encodings,
1342                                send_compression_encodings,
1343                            )
1344                            .apply_max_message_size_config(
1345                                max_decoding_message_size,
1346                                max_encoding_message_size,
1347                            );
1348                        let res = grpc.streaming(method, req).await;
1349                        Ok(res)
1350                    };
1351                    Box::pin(fut)
1352                }
1353                _ => {
1354                    Box::pin(async move {
1355                        let mut response = http::Response::new(empty_body());
1356                        let headers = response.headers_mut();
1357                        headers
1358                            .insert(
1359                                tonic::Status::GRPC_STATUS,
1360                                (tonic::Code::Unimplemented as i32).into(),
1361                            );
1362                        headers
1363                            .insert(
1364                                http::header::CONTENT_TYPE,
1365                                tonic::metadata::GRPC_CONTENT_TYPE,
1366                            );
1367                        Ok(response)
1368                    })
1369                }
1370            }
1371        }
1372    }
1373    impl<T> Clone for EngineServiceServer<T> {
1374        fn clone(&self) -> Self {
1375            let inner = self.inner.clone();
1376            Self {
1377                inner,
1378                accept_compression_encodings: self.accept_compression_encodings,
1379                send_compression_encodings: self.send_compression_encodings,
1380                max_decoding_message_size: self.max_decoding_message_size,
1381                max_encoding_message_size: self.max_encoding_message_size,
1382            }
1383        }
1384    }
1385    /// Generated gRPC service name
1386    pub const SERVICE_NAME: &str = "allwright.engine.v1.EngineService";
1387    impl<T> tonic::server::NamedService for EngineServiceServer<T> {
1388        const NAME: &'static str = SERVICE_NAME;
1389    }
1390}