Skip to main content

cdp_protocol/
target.rs

1// Auto-generated from Chrome at version 146.0.7680.165 domain: Target
2#![allow(dead_code)]
3use super::browser;
4use super::page;
5#[allow(unused_imports)]
6use super::types::*;
7#[allow(unused_imports)]
8use derive_builder::Builder;
9#[allow(unused_imports)]
10use serde::{Deserialize, Serialize};
11#[allow(unused_imports)]
12use serde_json::Value as Json;
13pub type TargetId = String;
14pub type SessionId = String;
15pub type TargetFilter = Vec<FilterEntry>;
16#[allow(deprecated)]
17#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
18pub enum WindowState {
19    #[serde(rename = "normal")]
20    Normal,
21    #[serde(rename = "minimized")]
22    Minimized,
23    #[serde(rename = "maximized")]
24    Maximized,
25    #[serde(rename = "fullscreen")]
26    Fullscreen,
27}
28#[allow(deprecated)]
29#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
30#[builder(setter(into, strip_option))]
31#[serde(rename_all = "camelCase")]
32pub struct TargetInfo {
33    pub target_id: TargetId,
34    #[serde(default)]
35    #[doc = "List of types: <https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_agent_host_impl.cc?ss=chromium&q=f:devtools%20-f:out%20%22::kTypeTab%5B%5D%22>"]
36    pub r#type: String,
37    #[serde(default)]
38    pub title: String,
39    #[serde(default)]
40    pub url: String,
41    #[serde(default)]
42    #[doc = "Whether the target has an attached client."]
43    pub attached: bool,
44    #[builder(default)]
45    #[serde(skip_serializing_if = "Option::is_none")]
46    #[doc = "Opener target Id"]
47    pub opener_id: Option<TargetId>,
48    #[serde(default)]
49    #[doc = "Whether the target has access to the originating window."]
50    pub can_access_opener: bool,
51    #[builder(default)]
52    #[serde(skip_serializing_if = "Option::is_none")]
53    #[doc = "Frame id of originating window (is only set if target has an opener)."]
54    pub opener_frame_id: Option<page::FrameId>,
55    #[builder(default)]
56    #[serde(skip_serializing_if = "Option::is_none")]
57    #[doc = "Id of the parent frame, only present for the \"iframe\" targets."]
58    pub parent_frame_id: Option<page::FrameId>,
59    #[builder(default)]
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub browser_context_id: Option<browser::BrowserContextId>,
62    #[builder(default)]
63    #[serde(skip_serializing_if = "Option::is_none")]
64    #[serde(default)]
65    #[doc = "Provides additional details for specific target types. For example, for\n the type of \"page\", this may be set to \"prerender\"."]
66    pub subtype: Option<String>,
67}
68#[allow(deprecated)]
69#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
70#[builder(setter(into, strip_option))]
71#[serde(rename_all = "camelCase")]
72#[doc = "A filter used by target query/discovery/auto-attach operations."]
73pub struct FilterEntry {
74    #[builder(default)]
75    #[serde(skip_serializing_if = "Option::is_none")]
76    #[serde(default)]
77    #[doc = "If set, causes exclusion of matching targets from the list."]
78    pub exclude: Option<bool>,
79    #[builder(default)]
80    #[serde(skip_serializing_if = "Option::is_none")]
81    #[serde(default)]
82    #[doc = "If not present, matches any type."]
83    pub r#type: Option<String>,
84}
85#[allow(deprecated)]
86#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
87#[builder(setter(into, strip_option))]
88#[serde(rename_all = "camelCase")]
89pub struct RemoteLocation {
90    #[serde(default)]
91    pub host: String,
92    #[serde(default)]
93    pub port: JsUInt,
94}
95#[allow(deprecated)]
96#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
97#[builder(setter(into, strip_option))]
98#[serde(rename_all = "camelCase")]
99#[doc = "Activates (focuses) the target."]
100pub struct ActivateTarget {
101    pub target_id: TargetId,
102}
103#[allow(deprecated)]
104#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
105#[builder(setter(into, strip_option))]
106#[serde(rename_all = "camelCase")]
107#[doc = "Attaches to the target with given id."]
108pub struct AttachToTarget {
109    pub target_id: TargetId,
110    #[builder(default)]
111    #[serde(skip_serializing_if = "Option::is_none")]
112    #[serde(default)]
113    #[doc = "Enables \"flat\" access to the session via specifying sessionId attribute in the commands.\n We plan to make this the default, deprecate non-flattened mode,\n and eventually retire it. See crbug.com/991325."]
114    pub flatten: Option<bool>,
115}
116#[allow(deprecated)]
117#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
118pub struct AttachToBrowserTarget(pub Option<Json>);
119#[allow(deprecated)]
120#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
121#[builder(setter(into, strip_option))]
122#[serde(rename_all = "camelCase")]
123#[doc = "Closes the target. If the target is a page that gets closed too."]
124pub struct CloseTarget {
125    pub target_id: TargetId,
126}
127#[allow(deprecated)]
128#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
129#[builder(setter(into, strip_option))]
130#[serde(rename_all = "camelCase")]
131#[doc = "Inject object to the target's main frame that provides a communication\n channel with browser target.\n \n Injected object will be available as `window\\[bindingName\\]`.\n \n The object has the following API:\n - `binding.send(json)` - a method to send messages over the remote debugging protocol\n - `binding.onmessage = json =\\> handleMessage(json)` - a callback that will be called for the protocol notifications and command responses."]
132pub struct ExposeDevToolsProtocol {
133    pub target_id: TargetId,
134    #[builder(default)]
135    #[serde(skip_serializing_if = "Option::is_none")]
136    #[serde(default)]
137    #[doc = "Binding name, 'cdp' if not specified."]
138    pub binding_name: Option<String>,
139    #[builder(default)]
140    #[serde(skip_serializing_if = "Option::is_none")]
141    #[serde(default)]
142    #[doc = "If true, inherits the current root session's permissions (default: false)."]
143    pub inherit_permissions: Option<bool>,
144}
145#[allow(deprecated)]
146#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
147#[builder(setter(into, strip_option))]
148#[serde(rename_all = "camelCase")]
149#[doc = "Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than\n one."]
150pub struct CreateBrowserContext {
151    #[builder(default)]
152    #[serde(skip_serializing_if = "Option::is_none")]
153    #[serde(default)]
154    #[doc = "If specified, disposes this context when debugging session disconnects."]
155    pub dispose_on_detach: Option<bool>,
156    #[builder(default)]
157    #[serde(skip_serializing_if = "Option::is_none")]
158    #[serde(default)]
159    #[doc = "Proxy server, similar to the one passed to --proxy-server"]
160    pub proxy_server: Option<String>,
161    #[builder(default)]
162    #[serde(skip_serializing_if = "Option::is_none")]
163    #[serde(default)]
164    #[doc = "Proxy bypass list, similar to the one passed to --proxy-bypass-list"]
165    pub proxy_bypass_list: Option<String>,
166    #[builder(default)]
167    #[serde(skip_serializing_if = "Option::is_none")]
168    #[serde(default)]
169    #[doc = "An optional list of origins to grant unlimited cross-origin access to.\n Parts of the URL other than those constituting origin are ignored."]
170    pub origins_with_universal_network_access: Option<Vec<String>>,
171}
172#[allow(deprecated)]
173#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
174pub struct GetBrowserContexts(pub Option<Json>);
175#[allow(deprecated)]
176#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
177#[builder(setter(into, strip_option))]
178#[serde(rename_all = "camelCase")]
179#[doc = "Creates a new page."]
180pub struct CreateTarget {
181    #[serde(default)]
182    #[doc = "The initial URL the page will be navigated to. An empty string indicates about:blank."]
183    pub url: String,
184    #[builder(default)]
185    #[serde(skip_serializing_if = "Option::is_none")]
186    #[serde(default)]
187    #[doc = "Frame left origin in DIP (requires newWindow to be true or headless shell)."]
188    pub left: Option<JsUInt>,
189    #[builder(default)]
190    #[serde(skip_serializing_if = "Option::is_none")]
191    #[serde(default)]
192    #[doc = "Frame top origin in DIP (requires newWindow to be true or headless shell)."]
193    pub top: Option<JsUInt>,
194    #[builder(default)]
195    #[serde(skip_serializing_if = "Option::is_none")]
196    #[serde(default)]
197    #[doc = "Frame width in DIP (requires newWindow to be true or headless shell)."]
198    pub width: Option<JsUInt>,
199    #[builder(default)]
200    #[serde(skip_serializing_if = "Option::is_none")]
201    #[serde(default)]
202    #[doc = "Frame height in DIP (requires newWindow to be true or headless shell)."]
203    pub height: Option<JsUInt>,
204    #[builder(default)]
205    #[serde(skip_serializing_if = "Option::is_none")]
206    #[doc = "Frame window state (requires newWindow to be true or headless shell).\n Default is normal."]
207    pub window_state: Option<WindowState>,
208    #[builder(default)]
209    #[serde(skip_serializing_if = "Option::is_none")]
210    #[doc = "The browser context to create the page in."]
211    pub browser_context_id: Option<browser::BrowserContextId>,
212    #[builder(default)]
213    #[serde(skip_serializing_if = "Option::is_none")]
214    #[serde(default)]
215    #[doc = "Whether BeginFrames for this target will be controlled via DevTools (headless shell only,\n not supported on MacOS yet, false by default)."]
216    pub enable_begin_frame_control: Option<bool>,
217    #[builder(default)]
218    #[serde(skip_serializing_if = "Option::is_none")]
219    #[serde(default)]
220    #[doc = "Whether to create a new Window or Tab (false by default, not supported by headless shell)."]
221    pub new_window: Option<bool>,
222    #[builder(default)]
223    #[serde(skip_serializing_if = "Option::is_none")]
224    #[serde(default)]
225    #[doc = "Whether to create the target in background or foreground (false by default, not supported\n by headless shell)."]
226    pub background: Option<bool>,
227    #[builder(default)]
228    #[serde(skip_serializing_if = "Option::is_none")]
229    #[serde(default)]
230    #[doc = "Whether to create the target of type \"tab\"."]
231    pub for_tab: Option<bool>,
232    #[builder(default)]
233    #[serde(skip_serializing_if = "Option::is_none")]
234    #[serde(default)]
235    #[doc = "Whether to create a hidden target. The hidden target is observable via protocol, but not\n present in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or\n `background: false`. The life-time of the tab is limited to the life-time of the session."]
236    pub hidden: Option<bool>,
237    #[builder(default)]
238    #[serde(skip_serializing_if = "Option::is_none")]
239    #[serde(default)]
240    #[doc = "If specified, the option is used to determine if the new target should\n be focused or not. By default, the focus behavior depends on the\n value of the background field. For example, background=false and focus=false\n will result in the target tab being opened but the browser window remain\n unchanged (if it was in the background, it will remain in the background)\n and background=false with focus=undefined will result in the window being focused.\n Using background: true and focus: true is not supported and will result in an error."]
241    pub focus: Option<bool>,
242}
243#[allow(deprecated)]
244#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
245#[builder(setter(into, strip_option))]
246#[serde(rename_all = "camelCase")]
247#[doc = "Detaches session with given id."]
248pub struct DetachFromTarget {
249    #[builder(default)]
250    #[serde(skip_serializing_if = "Option::is_none")]
251    #[doc = "Session to detach."]
252    pub session_id: Option<SessionId>,
253    #[builder(default)]
254    #[serde(skip_serializing_if = "Option::is_none")]
255    #[doc = "Deprecated."]
256    #[deprecated]
257    pub target_id: Option<TargetId>,
258}
259#[allow(deprecated)]
260#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
261#[builder(setter(into, strip_option))]
262#[serde(rename_all = "camelCase")]
263#[doc = "Deletes a BrowserContext. All the belonging pages will be closed without calling their\n beforeunload hooks."]
264pub struct DisposeBrowserContext {
265    pub browser_context_id: browser::BrowserContextId,
266}
267#[allow(deprecated)]
268#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
269#[builder(setter(into, strip_option))]
270#[serde(rename_all = "camelCase")]
271#[doc = "Returns information about a target."]
272pub struct GetTargetInfo {
273    #[builder(default)]
274    #[serde(skip_serializing_if = "Option::is_none")]
275    pub target_id: Option<TargetId>,
276}
277#[allow(deprecated)]
278#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
279#[builder(setter(into, strip_option))]
280#[serde(rename_all = "camelCase")]
281#[doc = "Retrieves a list of available targets."]
282pub struct GetTargets {
283    #[builder(default)]
284    #[serde(skip_serializing_if = "Option::is_none")]
285    #[doc = "Only targets matching filter will be reported. If filter is not specified\n and target discovery is currently enabled, a filter used for target discovery\n is used for consistency."]
286    pub filter: Option<TargetFilter>,
287}
288#[allow(deprecated)]
289#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
290#[builder(setter(into, strip_option))]
291#[serde(rename_all = "camelCase")]
292#[doc = "Sends protocol message over session with given id.\n Consider using flat mode instead; see commands attachToTarget, setAutoAttach,\n and crbug.com/991325."]
293#[deprecated]
294pub struct SendMessageToTarget {
295    #[serde(default)]
296    pub message: String,
297    #[builder(default)]
298    #[serde(skip_serializing_if = "Option::is_none")]
299    #[doc = "Identifier of the session."]
300    pub session_id: Option<SessionId>,
301    #[builder(default)]
302    #[serde(skip_serializing_if = "Option::is_none")]
303    #[doc = "Deprecated."]
304    #[deprecated]
305    pub target_id: Option<TargetId>,
306}
307#[allow(deprecated)]
308#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
309#[builder(setter(into, strip_option))]
310#[serde(rename_all = "camelCase")]
311#[doc = "Controls whether to automatically attach to new targets which are considered\n to be directly related to this one (for example, iframes or workers).\n When turned on, attaches to all existing related targets as well. When turned off,\n automatically detaches from all currently attached targets.\n This also clears all targets added by `autoAttachRelated` from the list of targets to watch\n for creation of related targets.\n You might want to call this recursively for auto-attached targets to attach\n to all available targets."]
312pub struct SetAutoAttach {
313    #[serde(default)]
314    #[doc = "Whether to auto-attach to related targets."]
315    pub auto_attach: bool,
316    #[serde(default)]
317    #[doc = "Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`\n to run paused targets."]
318    pub wait_for_debugger_on_start: bool,
319    #[builder(default)]
320    #[serde(skip_serializing_if = "Option::is_none")]
321    #[serde(default)]
322    #[doc = "Enables \"flat\" access to the session via specifying sessionId attribute in the commands.\n We plan to make this the default, deprecate non-flattened mode,\n and eventually retire it. See crbug.com/991325."]
323    pub flatten: Option<bool>,
324    #[builder(default)]
325    #[serde(skip_serializing_if = "Option::is_none")]
326    #[doc = "Only targets matching filter will be attached."]
327    pub filter: Option<TargetFilter>,
328}
329#[allow(deprecated)]
330#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
331#[builder(setter(into, strip_option))]
332#[serde(rename_all = "camelCase")]
333#[doc = "Adds the specified target to the list of targets that will be monitored for any related target\n creation (such as child frames, child workers and new versions of service worker) and reported\n through `attachedToTarget`. The specified target is also auto-attached.\n This cancels the effect of any previous `setAutoAttach` and is also cancelled by subsequent\n `setAutoAttach`. Only available at the Browser target."]
334pub struct AutoAttachRelated {
335    pub target_id: TargetId,
336    #[serde(default)]
337    #[doc = "Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`\n to run paused targets."]
338    pub wait_for_debugger_on_start: bool,
339    #[builder(default)]
340    #[serde(skip_serializing_if = "Option::is_none")]
341    #[doc = "Only targets matching filter will be attached."]
342    pub filter: Option<TargetFilter>,
343}
344#[allow(deprecated)]
345#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
346#[builder(setter(into, strip_option))]
347#[serde(rename_all = "camelCase")]
348#[doc = "Controls whether to discover available targets and notify via\n `targetCreated/targetInfoChanged/targetDestroyed` events."]
349pub struct SetDiscoverTargets {
350    #[serde(default)]
351    #[doc = "Whether to discover available targets."]
352    pub discover: bool,
353    #[builder(default)]
354    #[serde(skip_serializing_if = "Option::is_none")]
355    #[doc = "Only targets matching filter will be attached. If `discover` is false,\n `filter` must be omitted or empty."]
356    pub filter: Option<TargetFilter>,
357}
358#[allow(deprecated)]
359#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
360#[builder(setter(into, strip_option))]
361#[serde(rename_all = "camelCase")]
362#[doc = "Enables target discovery for the specified locations, when `setDiscoverTargets` was set to\n `true`."]
363pub struct SetRemoteLocations {
364    #[doc = "List of remote locations."]
365    pub locations: Vec<RemoteLocation>,
366}
367#[allow(deprecated)]
368#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
369#[builder(setter(into, strip_option))]
370#[serde(rename_all = "camelCase")]
371#[doc = "Gets the targetId of the DevTools page target opened for the given target\n (if any)."]
372pub struct GetDevToolsTarget {
373    #[doc = "Page or tab target ID."]
374    pub target_id: TargetId,
375}
376#[allow(deprecated)]
377#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
378#[builder(setter(into, strip_option))]
379#[serde(rename_all = "camelCase")]
380#[doc = "Opens a DevTools window for the target."]
381pub struct OpenDevTools {
382    #[doc = "This can be the page or tab target ID."]
383    pub target_id: TargetId,
384    #[builder(default)]
385    #[serde(skip_serializing_if = "Option::is_none")]
386    #[serde(default)]
387    #[doc = "The id of the panel we want DevTools to open initially. Currently\n supported panels are elements, console, network, sources, resources\n and performance."]
388    pub panel_id: Option<String>,
389}
390#[allow(deprecated)]
391#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
392#[doc = "Activates (focuses) the target."]
393pub struct ActivateTargetReturnObject(pub Option<Json>);
394#[allow(deprecated)]
395#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
396#[serde(rename_all = "camelCase")]
397#[doc = "Attaches to the target with given id."]
398pub struct AttachToTargetReturnObject {
399    #[doc = "Id assigned to the session."]
400    pub session_id: SessionId,
401}
402#[allow(deprecated)]
403#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
404#[serde(rename_all = "camelCase")]
405#[doc = "Attaches to the browser target, only uses flat sessionId mode."]
406pub struct AttachToBrowserTargetReturnObject {
407    #[doc = "Id assigned to the session."]
408    pub session_id: SessionId,
409}
410#[allow(deprecated)]
411#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
412#[serde(rename_all = "camelCase")]
413#[doc = "Closes the target. If the target is a page that gets closed too."]
414pub struct CloseTargetReturnObject {
415    #[serde(default)]
416    #[doc = "Always set to true. If an error occurs, the response indicates protocol error."]
417    #[deprecated]
418    pub success: bool,
419}
420#[allow(deprecated)]
421#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
422#[doc = "Inject object to the target's main frame that provides a communication\n channel with browser target.\n \n Injected object will be available as `window\\[bindingName\\]`.\n \n The object has the following API:\n - `binding.send(json)` - a method to send messages over the remote debugging protocol\n - `binding.onmessage = json =\\> handleMessage(json)` - a callback that will be called for the protocol notifications and command responses."]
423pub struct ExposeDevToolsProtocolReturnObject(pub Option<Json>);
424#[allow(deprecated)]
425#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
426#[serde(rename_all = "camelCase")]
427#[doc = "Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than\n one."]
428pub struct CreateBrowserContextReturnObject {
429    #[doc = "The id of the context created."]
430    pub browser_context_id: browser::BrowserContextId,
431}
432#[allow(deprecated)]
433#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
434#[serde(rename_all = "camelCase")]
435#[doc = "Returns all browser contexts created with `Target.createBrowserContext` method."]
436pub struct GetBrowserContextsReturnObject {
437    #[doc = "An array of browser context ids."]
438    pub browser_context_ids: browser::BrowserContextId,
439    #[builder(default)]
440    #[serde(skip_serializing_if = "Option::is_none")]
441    #[doc = "The id of the default browser context if available."]
442    pub default_browser_context_id: Option<browser::BrowserContextId>,
443}
444#[allow(deprecated)]
445#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
446#[serde(rename_all = "camelCase")]
447#[doc = "Creates a new page."]
448pub struct CreateTargetReturnObject {
449    #[doc = "The id of the page opened."]
450    pub target_id: TargetId,
451}
452#[allow(deprecated)]
453#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
454#[doc = "Detaches session with given id."]
455pub struct DetachFromTargetReturnObject(pub Option<Json>);
456#[allow(deprecated)]
457#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
458#[doc = "Deletes a BrowserContext. All the belonging pages will be closed without calling their\n beforeunload hooks."]
459pub struct DisposeBrowserContextReturnObject(pub Option<Json>);
460#[allow(deprecated)]
461#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
462#[serde(rename_all = "camelCase")]
463#[doc = "Returns information about a target."]
464pub struct GetTargetInfoReturnObject {
465    pub target_info: TargetInfo,
466}
467#[allow(deprecated)]
468#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
469#[serde(rename_all = "camelCase")]
470#[doc = "Retrieves a list of available targets."]
471pub struct GetTargetsReturnObject {
472    #[doc = "The list of targets."]
473    pub target_infos: Vec<TargetInfo>,
474}
475#[allow(deprecated)]
476#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
477#[doc = "Sends protocol message over session with given id.\n Consider using flat mode instead; see commands attachToTarget, setAutoAttach,\n and crbug.com/991325."]
478#[deprecated]
479pub struct SendMessageToTargetReturnObject(pub Option<Json>);
480#[allow(deprecated)]
481#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
482#[doc = "Controls whether to automatically attach to new targets which are considered\n to be directly related to this one (for example, iframes or workers).\n When turned on, attaches to all existing related targets as well. When turned off,\n automatically detaches from all currently attached targets.\n This also clears all targets added by `autoAttachRelated` from the list of targets to watch\n for creation of related targets.\n You might want to call this recursively for auto-attached targets to attach\n to all available targets."]
483pub struct SetAutoAttachReturnObject(pub Option<Json>);
484#[allow(deprecated)]
485#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
486#[doc = "Adds the specified target to the list of targets that will be monitored for any related target\n creation (such as child frames, child workers and new versions of service worker) and reported\n through `attachedToTarget`. The specified target is also auto-attached.\n This cancels the effect of any previous `setAutoAttach` and is also cancelled by subsequent\n `setAutoAttach`. Only available at the Browser target."]
487pub struct AutoAttachRelatedReturnObject(pub Option<Json>);
488#[allow(deprecated)]
489#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
490#[doc = "Controls whether to discover available targets and notify via\n `targetCreated/targetInfoChanged/targetDestroyed` events."]
491pub struct SetDiscoverTargetsReturnObject(pub Option<Json>);
492#[allow(deprecated)]
493#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
494#[doc = "Enables target discovery for the specified locations, when `setDiscoverTargets` was set to\n `true`."]
495pub struct SetRemoteLocationsReturnObject(pub Option<Json>);
496#[allow(deprecated)]
497#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
498#[serde(rename_all = "camelCase")]
499#[doc = "Gets the targetId of the DevTools page target opened for the given target\n (if any)."]
500pub struct GetDevToolsTargetReturnObject {
501    #[builder(default)]
502    #[serde(skip_serializing_if = "Option::is_none")]
503    #[doc = "The targetId of DevTools page target if exists."]
504    pub target_id: Option<TargetId>,
505}
506#[allow(deprecated)]
507#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
508#[serde(rename_all = "camelCase")]
509#[doc = "Opens a DevTools window for the target."]
510pub struct OpenDevToolsReturnObject {
511    #[doc = "The targetId of DevTools page target."]
512    pub target_id: TargetId,
513}
514#[allow(deprecated)]
515impl Method for ActivateTarget {
516    const NAME: &'static str = "Target.activateTarget";
517    type ReturnObject = ActivateTargetReturnObject;
518}
519#[allow(deprecated)]
520impl Method for AttachToTarget {
521    const NAME: &'static str = "Target.attachToTarget";
522    type ReturnObject = AttachToTargetReturnObject;
523}
524#[allow(deprecated)]
525impl Method for AttachToBrowserTarget {
526    const NAME: &'static str = "Target.attachToBrowserTarget";
527    type ReturnObject = AttachToBrowserTargetReturnObject;
528}
529#[allow(deprecated)]
530impl Method for CloseTarget {
531    const NAME: &'static str = "Target.closeTarget";
532    type ReturnObject = CloseTargetReturnObject;
533}
534#[allow(deprecated)]
535impl Method for ExposeDevToolsProtocol {
536    const NAME: &'static str = "Target.exposeDevToolsProtocol";
537    type ReturnObject = ExposeDevToolsProtocolReturnObject;
538}
539#[allow(deprecated)]
540impl Method for CreateBrowserContext {
541    const NAME: &'static str = "Target.createBrowserContext";
542    type ReturnObject = CreateBrowserContextReturnObject;
543}
544#[allow(deprecated)]
545impl Method for GetBrowserContexts {
546    const NAME: &'static str = "Target.getBrowserContexts";
547    type ReturnObject = GetBrowserContextsReturnObject;
548}
549#[allow(deprecated)]
550impl Method for CreateTarget {
551    const NAME: &'static str = "Target.createTarget";
552    type ReturnObject = CreateTargetReturnObject;
553}
554#[allow(deprecated)]
555impl Method for DetachFromTarget {
556    const NAME: &'static str = "Target.detachFromTarget";
557    type ReturnObject = DetachFromTargetReturnObject;
558}
559#[allow(deprecated)]
560impl Method for DisposeBrowserContext {
561    const NAME: &'static str = "Target.disposeBrowserContext";
562    type ReturnObject = DisposeBrowserContextReturnObject;
563}
564#[allow(deprecated)]
565impl Method for GetTargetInfo {
566    const NAME: &'static str = "Target.getTargetInfo";
567    type ReturnObject = GetTargetInfoReturnObject;
568}
569#[allow(deprecated)]
570impl Method for GetTargets {
571    const NAME: &'static str = "Target.getTargets";
572    type ReturnObject = GetTargetsReturnObject;
573}
574#[allow(deprecated)]
575impl Method for SendMessageToTarget {
576    const NAME: &'static str = "Target.sendMessageToTarget";
577    type ReturnObject = SendMessageToTargetReturnObject;
578}
579#[allow(deprecated)]
580impl Method for SetAutoAttach {
581    const NAME: &'static str = "Target.setAutoAttach";
582    type ReturnObject = SetAutoAttachReturnObject;
583}
584#[allow(deprecated)]
585impl Method for AutoAttachRelated {
586    const NAME: &'static str = "Target.autoAttachRelated";
587    type ReturnObject = AutoAttachRelatedReturnObject;
588}
589#[allow(deprecated)]
590impl Method for SetDiscoverTargets {
591    const NAME: &'static str = "Target.setDiscoverTargets";
592    type ReturnObject = SetDiscoverTargetsReturnObject;
593}
594#[allow(deprecated)]
595impl Method for SetRemoteLocations {
596    const NAME: &'static str = "Target.setRemoteLocations";
597    type ReturnObject = SetRemoteLocationsReturnObject;
598}
599#[allow(deprecated)]
600impl Method for GetDevToolsTarget {
601    const NAME: &'static str = "Target.getDevToolsTarget";
602    type ReturnObject = GetDevToolsTargetReturnObject;
603}
604#[allow(deprecated)]
605impl Method for OpenDevTools {
606    const NAME: &'static str = "Target.openDevTools";
607    type ReturnObject = OpenDevToolsReturnObject;
608}
609#[allow(dead_code)]
610pub mod events {
611    #[allow(unused_imports)]
612    use super::super::types::*;
613    #[allow(unused_imports)]
614    use derive_builder::Builder;
615    #[allow(unused_imports)]
616    use serde::{Deserialize, Serialize};
617    #[allow(unused_imports)]
618    use serde_json::Value as Json;
619    #[allow(deprecated)]
620    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
621    pub struct AttachedToTargetEvent {
622        pub params: AttachedToTargetEventParams,
623    }
624    #[allow(deprecated)]
625    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
626    #[serde(rename_all = "camelCase")]
627    pub struct AttachedToTargetEventParams {
628        #[doc = "Identifier assigned to the session used to send/receive messages."]
629        pub session_id: super::SessionId,
630        pub target_info: super::TargetInfo,
631        #[serde(default)]
632        pub waiting_for_debugger: bool,
633    }
634    #[allow(deprecated)]
635    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
636    pub struct DetachedFromTargetEvent {
637        pub params: DetachedFromTargetEventParams,
638    }
639    #[allow(deprecated)]
640    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
641    #[serde(rename_all = "camelCase")]
642    pub struct DetachedFromTargetEventParams {
643        #[doc = "Detached session identifier."]
644        pub session_id: super::SessionId,
645        #[builder(default)]
646        #[serde(skip_serializing_if = "Option::is_none")]
647        #[doc = "Deprecated."]
648        #[deprecated]
649        pub target_id: Option<super::TargetId>,
650    }
651    #[allow(deprecated)]
652    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
653    pub struct ReceivedMessageFromTargetEvent {
654        pub params: ReceivedMessageFromTargetEventParams,
655    }
656    #[allow(deprecated)]
657    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
658    #[serde(rename_all = "camelCase")]
659    pub struct ReceivedMessageFromTargetEventParams {
660        #[doc = "Identifier of a session which sends a message."]
661        pub session_id: super::SessionId,
662        #[serde(default)]
663        pub message: String,
664        #[builder(default)]
665        #[serde(skip_serializing_if = "Option::is_none")]
666        #[doc = "Deprecated."]
667        #[deprecated]
668        pub target_id: Option<super::TargetId>,
669    }
670    #[allow(deprecated)]
671    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
672    pub struct TargetCreatedEvent {
673        pub params: TargetCreatedEventParams,
674    }
675    #[allow(deprecated)]
676    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
677    #[serde(rename_all = "camelCase")]
678    pub struct TargetCreatedEventParams {
679        pub target_info: super::TargetInfo,
680    }
681    #[allow(deprecated)]
682    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
683    pub struct TargetDestroyedEvent {
684        pub params: TargetDestroyedEventParams,
685    }
686    #[allow(deprecated)]
687    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
688    #[serde(rename_all = "camelCase")]
689    pub struct TargetDestroyedEventParams {
690        pub target_id: super::TargetId,
691    }
692    #[allow(deprecated)]
693    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
694    pub struct TargetCrashedEvent {
695        pub params: TargetCrashedEventParams,
696    }
697    #[allow(deprecated)]
698    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
699    #[serde(rename_all = "camelCase")]
700    pub struct TargetCrashedEventParams {
701        pub target_id: super::TargetId,
702        #[serde(default)]
703        #[doc = "Termination status type."]
704        pub status: String,
705        #[serde(default)]
706        #[doc = "Termination error code."]
707        pub error_code: JsUInt,
708    }
709    #[allow(deprecated)]
710    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
711    pub struct TargetInfoChangedEvent {
712        pub params: TargetInfoChangedEventParams,
713    }
714    #[allow(deprecated)]
715    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
716    #[serde(rename_all = "camelCase")]
717    pub struct TargetInfoChangedEventParams {
718        pub target_info: super::TargetInfo,
719    }
720}