1package page
2
3// Code generated by cdproto-gen. DO NOT EDIT.
4
5import (
6	"errors"
7
8	"github.com/chromedp/cdproto/cdp"
9	"github.com/chromedp/cdproto/network"
10	"github.com/mailru/easyjson"
11	"github.com/mailru/easyjson/jlexer"
12	"github.com/mailru/easyjson/jwriter"
13)
14
15// FrameResource information about the Resource on the page.
16//
17// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FrameResource
18type FrameResource struct {
19	URL          string               `json:"url"`                    // Resource URL.
20	Type         network.ResourceType `json:"type"`                   // Type of this resource.
21	MimeType     string               `json:"mimeType"`               // Resource mimeType as determined by the browser.
22	LastModified *cdp.TimeSinceEpoch  `json:"lastModified,omitempty"` // last-modified timestamp as reported by server.
23	ContentSize  float64              `json:"contentSize,omitempty"`  // Resource content size.
24	Failed       bool                 `json:"failed,omitempty"`       // True if the resource failed to load.
25	Canceled     bool                 `json:"canceled,omitempty"`     // True if the resource was canceled during loading.
26}
27
28// FrameResourceTree information about the Frame hierarchy along with their
29// cached resources.
30//
31// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FrameResourceTree
32type FrameResourceTree struct {
33	Frame       *cdp.Frame           `json:"frame"`                 // Frame information for this tree item.
34	ChildFrames []*FrameResourceTree `json:"childFrames,omitempty"` // Child frames.
35	Resources   []*FrameResource     `json:"resources"`             // Information about frame resources.
36}
37
38// FrameTree information about the Frame hierarchy.
39//
40// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FrameTree
41type FrameTree struct {
42	Frame       *cdp.Frame   `json:"frame"`                 // Frame information for this tree item.
43	ChildFrames []*FrameTree `json:"childFrames,omitempty"` // Child frames.
44}
45
46// ScriptIdentifier unique script identifier.
47//
48// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-ScriptIdentifier
49type ScriptIdentifier string
50
51// String returns the ScriptIdentifier as string value.
52func (t ScriptIdentifier) String() string {
53	return string(t)
54}
55
56// TransitionType transition type.
57//
58// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-TransitionType
59type TransitionType string
60
61// String returns the TransitionType as string value.
62func (t TransitionType) String() string {
63	return string(t)
64}
65
66// TransitionType values.
67const (
68	TransitionTypeLink             TransitionType = "link"
69	TransitionTypeTyped            TransitionType = "typed"
70	TransitionTypeAddressBar       TransitionType = "address_bar"
71	TransitionTypeAutoBookmark     TransitionType = "auto_bookmark"
72	TransitionTypeAutoSubframe     TransitionType = "auto_subframe"
73	TransitionTypeManualSubframe   TransitionType = "manual_subframe"
74	TransitionTypeGenerated        TransitionType = "generated"
75	TransitionTypeAutoToplevel     TransitionType = "auto_toplevel"
76	TransitionTypeFormSubmit       TransitionType = "form_submit"
77	TransitionTypeReload           TransitionType = "reload"
78	TransitionTypeKeyword          TransitionType = "keyword"
79	TransitionTypeKeywordGenerated TransitionType = "keyword_generated"
80	TransitionTypeOther            TransitionType = "other"
81)
82
83// MarshalEasyJSON satisfies easyjson.Marshaler.
84func (t TransitionType) MarshalEasyJSON(out *jwriter.Writer) {
85	out.String(string(t))
86}
87
88// MarshalJSON satisfies json.Marshaler.
89func (t TransitionType) MarshalJSON() ([]byte, error) {
90	return easyjson.Marshal(t)
91}
92
93// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
94func (t *TransitionType) UnmarshalEasyJSON(in *jlexer.Lexer) {
95	switch TransitionType(in.String()) {
96	case TransitionTypeLink:
97		*t = TransitionTypeLink
98	case TransitionTypeTyped:
99		*t = TransitionTypeTyped
100	case TransitionTypeAddressBar:
101		*t = TransitionTypeAddressBar
102	case TransitionTypeAutoBookmark:
103		*t = TransitionTypeAutoBookmark
104	case TransitionTypeAutoSubframe:
105		*t = TransitionTypeAutoSubframe
106	case TransitionTypeManualSubframe:
107		*t = TransitionTypeManualSubframe
108	case TransitionTypeGenerated:
109		*t = TransitionTypeGenerated
110	case TransitionTypeAutoToplevel:
111		*t = TransitionTypeAutoToplevel
112	case TransitionTypeFormSubmit:
113		*t = TransitionTypeFormSubmit
114	case TransitionTypeReload:
115		*t = TransitionTypeReload
116	case TransitionTypeKeyword:
117		*t = TransitionTypeKeyword
118	case TransitionTypeKeywordGenerated:
119		*t = TransitionTypeKeywordGenerated
120	case TransitionTypeOther:
121		*t = TransitionTypeOther
122
123	default:
124		in.AddError(errors.New("unknown TransitionType value"))
125	}
126}
127
128// UnmarshalJSON satisfies json.Unmarshaler.
129func (t *TransitionType) UnmarshalJSON(buf []byte) error {
130	return easyjson.Unmarshal(buf, t)
131}
132
133// NavigationEntry navigation history entry.
134//
135// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-NavigationEntry
136type NavigationEntry struct {
137	ID             int64          `json:"id"`             // Unique id of the navigation history entry.
138	URL            string         `json:"url"`            // URL of the navigation history entry.
139	UserTypedURL   string         `json:"userTypedURL"`   // URL that the user typed in the url bar.
140	Title          string         `json:"title"`          // Title of the navigation history entry.
141	TransitionType TransitionType `json:"transitionType"` // Transition type.
142}
143
144// ScreencastFrameMetadata screencast frame metadata.
145//
146// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-ScreencastFrameMetadata
147type ScreencastFrameMetadata struct {
148	OffsetTop       float64             `json:"offsetTop"`           // Top offset in DIP.
149	PageScaleFactor float64             `json:"pageScaleFactor"`     // Page scale factor.
150	DeviceWidth     float64             `json:"deviceWidth"`         // Device screen width in DIP.
151	DeviceHeight    float64             `json:"deviceHeight"`        // Device screen height in DIP.
152	ScrollOffsetX   float64             `json:"scrollOffsetX"`       // Position of horizontal scroll in CSS pixels.
153	ScrollOffsetY   float64             `json:"scrollOffsetY"`       // Position of vertical scroll in CSS pixels.
154	Timestamp       *cdp.TimeSinceEpoch `json:"timestamp,omitempty"` // Frame swap timestamp.
155}
156
157// DialogType javascript dialog type.
158//
159// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-DialogType
160type DialogType string
161
162// String returns the DialogType as string value.
163func (t DialogType) String() string {
164	return string(t)
165}
166
167// DialogType values.
168const (
169	DialogTypeAlert        DialogType = "alert"
170	DialogTypeConfirm      DialogType = "confirm"
171	DialogTypePrompt       DialogType = "prompt"
172	DialogTypeBeforeunload DialogType = "beforeunload"
173)
174
175// MarshalEasyJSON satisfies easyjson.Marshaler.
176func (t DialogType) MarshalEasyJSON(out *jwriter.Writer) {
177	out.String(string(t))
178}
179
180// MarshalJSON satisfies json.Marshaler.
181func (t DialogType) MarshalJSON() ([]byte, error) {
182	return easyjson.Marshal(t)
183}
184
185// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
186func (t *DialogType) UnmarshalEasyJSON(in *jlexer.Lexer) {
187	switch DialogType(in.String()) {
188	case DialogTypeAlert:
189		*t = DialogTypeAlert
190	case DialogTypeConfirm:
191		*t = DialogTypeConfirm
192	case DialogTypePrompt:
193		*t = DialogTypePrompt
194	case DialogTypeBeforeunload:
195		*t = DialogTypeBeforeunload
196
197	default:
198		in.AddError(errors.New("unknown DialogType value"))
199	}
200}
201
202// UnmarshalJSON satisfies json.Unmarshaler.
203func (t *DialogType) UnmarshalJSON(buf []byte) error {
204	return easyjson.Unmarshal(buf, t)
205}
206
207// AppManifestError error while paring app manifest.
208//
209// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-AppManifestError
210type AppManifestError struct {
211	Message  string `json:"message"`  // Error message.
212	Critical int64  `json:"critical"` // If criticial, this is a non-recoverable parse error.
213	Line     int64  `json:"line"`     // Error line.
214	Column   int64  `json:"column"`   // Error column.
215}
216
217// AppManifestParsedProperties parsed app manifest properties.
218//
219// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-AppManifestParsedProperties
220type AppManifestParsedProperties struct {
221	Scope string `json:"scope"` // Computed scope value
222}
223
224// LayoutViewport layout viewport position and dimensions.
225//
226// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-LayoutViewport
227type LayoutViewport struct {
228	PageX        int64 `json:"pageX"`        // Horizontal offset relative to the document (CSS pixels).
229	PageY        int64 `json:"pageY"`        // Vertical offset relative to the document (CSS pixels).
230	ClientWidth  int64 `json:"clientWidth"`  // Width (CSS pixels), excludes scrollbar if present.
231	ClientHeight int64 `json:"clientHeight"` // Height (CSS pixels), excludes scrollbar if present.
232}
233
234// VisualViewport visual viewport position, dimensions, and scale.
235//
236// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-VisualViewport
237type VisualViewport struct {
238	OffsetX      float64 `json:"offsetX"`        // Horizontal offset relative to the layout viewport (CSS pixels).
239	OffsetY      float64 `json:"offsetY"`        // Vertical offset relative to the layout viewport (CSS pixels).
240	PageX        float64 `json:"pageX"`          // Horizontal offset relative to the document (CSS pixels).
241	PageY        float64 `json:"pageY"`          // Vertical offset relative to the document (CSS pixels).
242	ClientWidth  float64 `json:"clientWidth"`    // Width (CSS pixels), excludes scrollbar if present.
243	ClientHeight float64 `json:"clientHeight"`   // Height (CSS pixels), excludes scrollbar if present.
244	Scale        float64 `json:"scale"`          // Scale relative to the ideal viewport (size at width=device-width).
245	Zoom         float64 `json:"zoom,omitempty"` // Page zoom factor (CSS to device independent pixels ratio).
246}
247
248// Viewport viewport for capturing screenshot.
249//
250// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-Viewport
251type Viewport struct {
252	X      float64 `json:"x"`      // X offset in device independent pixels (dip).
253	Y      float64 `json:"y"`      // Y offset in device independent pixels (dip).
254	Width  float64 `json:"width"`  // Rectangle width in device independent pixels (dip).
255	Height float64 `json:"height"` // Rectangle height in device independent pixels (dip).
256	Scale  float64 `json:"scale"`  // Page scale factor.
257}
258
259// FontFamilies generic font families collection.
260//
261// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FontFamilies
262type FontFamilies struct {
263	Standard   string `json:"standard,omitempty"`   // The standard font-family.
264	Fixed      string `json:"fixed,omitempty"`      // The fixed font-family.
265	Serif      string `json:"serif,omitempty"`      // The serif font-family.
266	SansSerif  string `json:"sansSerif,omitempty"`  // The sansSerif font-family.
267	Cursive    string `json:"cursive,omitempty"`    // The cursive font-family.
268	Fantasy    string `json:"fantasy,omitempty"`    // The fantasy font-family.
269	Pictograph string `json:"pictograph,omitempty"` // The pictograph font-family.
270}
271
272// FontSizes default font sizes.
273//
274// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FontSizes
275type FontSizes struct {
276	Standard int64 `json:"standard,omitempty"` // Default standard font size.
277	Fixed    int64 `json:"fixed,omitempty"`    // Default fixed font size.
278}
279
280// ClientNavigationReason [no description].
281//
282// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-ClientNavigationReason
283type ClientNavigationReason string
284
285// String returns the ClientNavigationReason as string value.
286func (t ClientNavigationReason) String() string {
287	return string(t)
288}
289
290// ClientNavigationReason values.
291const (
292	ClientNavigationReasonFormSubmissionGet     ClientNavigationReason = "formSubmissionGet"
293	ClientNavigationReasonFormSubmissionPost    ClientNavigationReason = "formSubmissionPost"
294	ClientNavigationReasonHTTPHeaderRefresh     ClientNavigationReason = "httpHeaderRefresh"
295	ClientNavigationReasonScriptInitiated       ClientNavigationReason = "scriptInitiated"
296	ClientNavigationReasonMetaTagRefresh        ClientNavigationReason = "metaTagRefresh"
297	ClientNavigationReasonPageBlockInterstitial ClientNavigationReason = "pageBlockInterstitial"
298	ClientNavigationReasonReload                ClientNavigationReason = "reload"
299)
300
301// MarshalEasyJSON satisfies easyjson.Marshaler.
302func (t ClientNavigationReason) MarshalEasyJSON(out *jwriter.Writer) {
303	out.String(string(t))
304}
305
306// MarshalJSON satisfies json.Marshaler.
307func (t ClientNavigationReason) MarshalJSON() ([]byte, error) {
308	return easyjson.Marshal(t)
309}
310
311// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
312func (t *ClientNavigationReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
313	switch ClientNavigationReason(in.String()) {
314	case ClientNavigationReasonFormSubmissionGet:
315		*t = ClientNavigationReasonFormSubmissionGet
316	case ClientNavigationReasonFormSubmissionPost:
317		*t = ClientNavigationReasonFormSubmissionPost
318	case ClientNavigationReasonHTTPHeaderRefresh:
319		*t = ClientNavigationReasonHTTPHeaderRefresh
320	case ClientNavigationReasonScriptInitiated:
321		*t = ClientNavigationReasonScriptInitiated
322	case ClientNavigationReasonMetaTagRefresh:
323		*t = ClientNavigationReasonMetaTagRefresh
324	case ClientNavigationReasonPageBlockInterstitial:
325		*t = ClientNavigationReasonPageBlockInterstitial
326	case ClientNavigationReasonReload:
327		*t = ClientNavigationReasonReload
328
329	default:
330		in.AddError(errors.New("unknown ClientNavigationReason value"))
331	}
332}
333
334// UnmarshalJSON satisfies json.Unmarshaler.
335func (t *ClientNavigationReason) UnmarshalJSON(buf []byte) error {
336	return easyjson.Unmarshal(buf, t)
337}
338
339// FileChooserOpenedMode input mode.
340//
341// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-fileChooserOpened
342type FileChooserOpenedMode string
343
344// String returns the FileChooserOpenedMode as string value.
345func (t FileChooserOpenedMode) String() string {
346	return string(t)
347}
348
349// FileChooserOpenedMode values.
350const (
351	FileChooserOpenedModeSelectSingle   FileChooserOpenedMode = "selectSingle"
352	FileChooserOpenedModeSelectMultiple FileChooserOpenedMode = "selectMultiple"
353)
354
355// MarshalEasyJSON satisfies easyjson.Marshaler.
356func (t FileChooserOpenedMode) MarshalEasyJSON(out *jwriter.Writer) {
357	out.String(string(t))
358}
359
360// MarshalJSON satisfies json.Marshaler.
361func (t FileChooserOpenedMode) MarshalJSON() ([]byte, error) {
362	return easyjson.Marshal(t)
363}
364
365// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
366func (t *FileChooserOpenedMode) UnmarshalEasyJSON(in *jlexer.Lexer) {
367	switch FileChooserOpenedMode(in.String()) {
368	case FileChooserOpenedModeSelectSingle:
369		*t = FileChooserOpenedModeSelectSingle
370	case FileChooserOpenedModeSelectMultiple:
371		*t = FileChooserOpenedModeSelectMultiple
372
373	default:
374		in.AddError(errors.New("unknown FileChooserOpenedMode value"))
375	}
376}
377
378// UnmarshalJSON satisfies json.Unmarshaler.
379func (t *FileChooserOpenedMode) UnmarshalJSON(buf []byte) error {
380	return easyjson.Unmarshal(buf, t)
381}
382
383// CaptureScreenshotFormat image compression format (defaults to png).
384//
385// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-captureScreenshot
386type CaptureScreenshotFormat string
387
388// String returns the CaptureScreenshotFormat as string value.
389func (t CaptureScreenshotFormat) String() string {
390	return string(t)
391}
392
393// CaptureScreenshotFormat values.
394const (
395	CaptureScreenshotFormatJpeg CaptureScreenshotFormat = "jpeg"
396	CaptureScreenshotFormatPng  CaptureScreenshotFormat = "png"
397)
398
399// MarshalEasyJSON satisfies easyjson.Marshaler.
400func (t CaptureScreenshotFormat) MarshalEasyJSON(out *jwriter.Writer) {
401	out.String(string(t))
402}
403
404// MarshalJSON satisfies json.Marshaler.
405func (t CaptureScreenshotFormat) MarshalJSON() ([]byte, error) {
406	return easyjson.Marshal(t)
407}
408
409// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
410func (t *CaptureScreenshotFormat) UnmarshalEasyJSON(in *jlexer.Lexer) {
411	switch CaptureScreenshotFormat(in.String()) {
412	case CaptureScreenshotFormatJpeg:
413		*t = CaptureScreenshotFormatJpeg
414	case CaptureScreenshotFormatPng:
415		*t = CaptureScreenshotFormatPng
416
417	default:
418		in.AddError(errors.New("unknown CaptureScreenshotFormat value"))
419	}
420}
421
422// UnmarshalJSON satisfies json.Unmarshaler.
423func (t *CaptureScreenshotFormat) UnmarshalJSON(buf []byte) error {
424	return easyjson.Unmarshal(buf, t)
425}
426
427// CaptureSnapshotFormat format (defaults to mhtml).
428//
429// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-captureSnapshot
430type CaptureSnapshotFormat string
431
432// String returns the CaptureSnapshotFormat as string value.
433func (t CaptureSnapshotFormat) String() string {
434	return string(t)
435}
436
437// CaptureSnapshotFormat values.
438const (
439	CaptureSnapshotFormatMhtml CaptureSnapshotFormat = "mhtml"
440)
441
442// MarshalEasyJSON satisfies easyjson.Marshaler.
443func (t CaptureSnapshotFormat) MarshalEasyJSON(out *jwriter.Writer) {
444	out.String(string(t))
445}
446
447// MarshalJSON satisfies json.Marshaler.
448func (t CaptureSnapshotFormat) MarshalJSON() ([]byte, error) {
449	return easyjson.Marshal(t)
450}
451
452// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
453func (t *CaptureSnapshotFormat) UnmarshalEasyJSON(in *jlexer.Lexer) {
454	switch CaptureSnapshotFormat(in.String()) {
455	case CaptureSnapshotFormatMhtml:
456		*t = CaptureSnapshotFormatMhtml
457
458	default:
459		in.AddError(errors.New("unknown CaptureSnapshotFormat value"))
460	}
461}
462
463// UnmarshalJSON satisfies json.Unmarshaler.
464func (t *CaptureSnapshotFormat) UnmarshalJSON(buf []byte) error {
465	return easyjson.Unmarshal(buf, t)
466}
467
468// PrintToPDFTransferMode return as stream.
469//
470// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-printToPDF
471type PrintToPDFTransferMode string
472
473// String returns the PrintToPDFTransferMode as string value.
474func (t PrintToPDFTransferMode) String() string {
475	return string(t)
476}
477
478// PrintToPDFTransferMode values.
479const (
480	PrintToPDFTransferModeReturnAsBase64 PrintToPDFTransferMode = "ReturnAsBase64"
481	PrintToPDFTransferModeReturnAsStream PrintToPDFTransferMode = "ReturnAsStream"
482)
483
484// MarshalEasyJSON satisfies easyjson.Marshaler.
485func (t PrintToPDFTransferMode) MarshalEasyJSON(out *jwriter.Writer) {
486	out.String(string(t))
487}
488
489// MarshalJSON satisfies json.Marshaler.
490func (t PrintToPDFTransferMode) MarshalJSON() ([]byte, error) {
491	return easyjson.Marshal(t)
492}
493
494// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
495func (t *PrintToPDFTransferMode) UnmarshalEasyJSON(in *jlexer.Lexer) {
496	switch PrintToPDFTransferMode(in.String()) {
497	case PrintToPDFTransferModeReturnAsBase64:
498		*t = PrintToPDFTransferModeReturnAsBase64
499	case PrintToPDFTransferModeReturnAsStream:
500		*t = PrintToPDFTransferModeReturnAsStream
501
502	default:
503		in.AddError(errors.New("unknown PrintToPDFTransferMode value"))
504	}
505}
506
507// UnmarshalJSON satisfies json.Unmarshaler.
508func (t *PrintToPDFTransferMode) UnmarshalJSON(buf []byte) error {
509	return easyjson.Unmarshal(buf, t)
510}
511
512// SetDownloadBehaviorBehavior whether to allow all or deny all download
513// requests, or use default Chrome behavior if available (otherwise deny).
514//
515// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setDownloadBehavior
516type SetDownloadBehaviorBehavior string
517
518// String returns the SetDownloadBehaviorBehavior as string value.
519func (t SetDownloadBehaviorBehavior) String() string {
520	return string(t)
521}
522
523// SetDownloadBehaviorBehavior values.
524const (
525	SetDownloadBehaviorBehaviorDeny    SetDownloadBehaviorBehavior = "deny"
526	SetDownloadBehaviorBehaviorAllow   SetDownloadBehaviorBehavior = "allow"
527	SetDownloadBehaviorBehaviorDefault SetDownloadBehaviorBehavior = "default"
528)
529
530// MarshalEasyJSON satisfies easyjson.Marshaler.
531func (t SetDownloadBehaviorBehavior) MarshalEasyJSON(out *jwriter.Writer) {
532	out.String(string(t))
533}
534
535// MarshalJSON satisfies json.Marshaler.
536func (t SetDownloadBehaviorBehavior) MarshalJSON() ([]byte, error) {
537	return easyjson.Marshal(t)
538}
539
540// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
541func (t *SetDownloadBehaviorBehavior) UnmarshalEasyJSON(in *jlexer.Lexer) {
542	switch SetDownloadBehaviorBehavior(in.String()) {
543	case SetDownloadBehaviorBehaviorDeny:
544		*t = SetDownloadBehaviorBehaviorDeny
545	case SetDownloadBehaviorBehaviorAllow:
546		*t = SetDownloadBehaviorBehaviorAllow
547	case SetDownloadBehaviorBehaviorDefault:
548		*t = SetDownloadBehaviorBehaviorDefault
549
550	default:
551		in.AddError(errors.New("unknown SetDownloadBehaviorBehavior value"))
552	}
553}
554
555// UnmarshalJSON satisfies json.Unmarshaler.
556func (t *SetDownloadBehaviorBehavior) UnmarshalJSON(buf []byte) error {
557	return easyjson.Unmarshal(buf, t)
558}
559
560// ScreencastFormat image compression format.
561//
562// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-startScreencast
563type ScreencastFormat string
564
565// String returns the ScreencastFormat as string value.
566func (t ScreencastFormat) String() string {
567	return string(t)
568}
569
570// ScreencastFormat values.
571const (
572	ScreencastFormatJpeg ScreencastFormat = "jpeg"
573	ScreencastFormatPng  ScreencastFormat = "png"
574)
575
576// MarshalEasyJSON satisfies easyjson.Marshaler.
577func (t ScreencastFormat) MarshalEasyJSON(out *jwriter.Writer) {
578	out.String(string(t))
579}
580
581// MarshalJSON satisfies json.Marshaler.
582func (t ScreencastFormat) MarshalJSON() ([]byte, error) {
583	return easyjson.Marshal(t)
584}
585
586// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
587func (t *ScreencastFormat) UnmarshalEasyJSON(in *jlexer.Lexer) {
588	switch ScreencastFormat(in.String()) {
589	case ScreencastFormatJpeg:
590		*t = ScreencastFormatJpeg
591	case ScreencastFormatPng:
592		*t = ScreencastFormatPng
593
594	default:
595		in.AddError(errors.New("unknown ScreencastFormat value"))
596	}
597}
598
599// UnmarshalJSON satisfies json.Unmarshaler.
600func (t *ScreencastFormat) UnmarshalJSON(buf []byte) error {
601	return easyjson.Unmarshal(buf, t)
602}
603
604// SetWebLifecycleStateState target lifecycle state.
605//
606// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setWebLifecycleState
607type SetWebLifecycleStateState string
608
609// String returns the SetWebLifecycleStateState as string value.
610func (t SetWebLifecycleStateState) String() string {
611	return string(t)
612}
613
614// SetWebLifecycleStateState values.
615const (
616	SetWebLifecycleStateStateFrozen SetWebLifecycleStateState = "frozen"
617	SetWebLifecycleStateStateActive SetWebLifecycleStateState = "active"
618)
619
620// MarshalEasyJSON satisfies easyjson.Marshaler.
621func (t SetWebLifecycleStateState) MarshalEasyJSON(out *jwriter.Writer) {
622	out.String(string(t))
623}
624
625// MarshalJSON satisfies json.Marshaler.
626func (t SetWebLifecycleStateState) MarshalJSON() ([]byte, error) {
627	return easyjson.Marshal(t)
628}
629
630// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
631func (t *SetWebLifecycleStateState) UnmarshalEasyJSON(in *jlexer.Lexer) {
632	switch SetWebLifecycleStateState(in.String()) {
633	case SetWebLifecycleStateStateFrozen:
634		*t = SetWebLifecycleStateStateFrozen
635	case SetWebLifecycleStateStateActive:
636		*t = SetWebLifecycleStateStateActive
637
638	default:
639		in.AddError(errors.New("unknown SetWebLifecycleStateState value"))
640	}
641}
642
643// UnmarshalJSON satisfies json.Unmarshaler.
644func (t *SetWebLifecycleStateState) UnmarshalJSON(buf []byte) error {
645	return easyjson.Unmarshal(buf, t)
646}
647