chromedp/cdp/browser/easyjson.go

523 lines
12 KiB
Go

// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package browser
import (
json "encoding/json"
target "github.com/knq/chromedp/cdp/target"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jlexer.Lexer
_ *jwriter.Writer
_ easyjson.Marshaler
)
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser(in *jlexer.Lexer, out *SetWindowBoundsParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "windowId":
out.WindowID = WindowID(in.Int64())
case "bounds":
if in.IsNull() {
in.Skip()
out.Bounds = nil
} else {
if out.Bounds == nil {
out.Bounds = new(Bounds)
}
(*out.Bounds).UnmarshalEasyJSON(in)
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser(out *jwriter.Writer, in SetWindowBoundsParams) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"windowId\":")
out.Int64(int64(in.WindowID))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"bounds\":")
if in.Bounds == nil {
out.RawString("null")
} else {
(*in.Bounds).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v SetWindowBoundsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetWindowBoundsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetWindowBoundsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetWindowBoundsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser1(in *jlexer.Lexer, out *GetWindowForTargetReturns) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "windowId":
out.WindowID = WindowID(in.Int64())
case "bounds":
if in.IsNull() {
in.Skip()
out.Bounds = nil
} else {
if out.Bounds == nil {
out.Bounds = new(Bounds)
}
(*out.Bounds).UnmarshalEasyJSON(in)
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser1(out *jwriter.Writer, in GetWindowForTargetReturns) {
out.RawByte('{')
first := true
_ = first
if in.WindowID != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"windowId\":")
out.Int64(int64(in.WindowID))
}
if in.Bounds != nil {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"bounds\":")
if in.Bounds == nil {
out.RawString("null")
} else {
(*in.Bounds).MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetWindowForTargetReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetWindowForTargetReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetWindowForTargetReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetWindowForTargetReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser1(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser2(in *jlexer.Lexer, out *GetWindowForTargetParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "targetId":
out.TargetID = target.ID(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser2(out *jwriter.Writer, in GetWindowForTargetParams) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"targetId\":")
out.String(string(in.TargetID))
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetWindowForTargetParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetWindowForTargetParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetWindowForTargetParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetWindowForTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser2(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser3(in *jlexer.Lexer, out *GetWindowBoundsReturns) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "bounds":
if in.IsNull() {
in.Skip()
out.Bounds = nil
} else {
if out.Bounds == nil {
out.Bounds = new(Bounds)
}
(*out.Bounds).UnmarshalEasyJSON(in)
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser3(out *jwriter.Writer, in GetWindowBoundsReturns) {
out.RawByte('{')
first := true
_ = first
if in.Bounds != nil {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"bounds\":")
if in.Bounds == nil {
out.RawString("null")
} else {
(*in.Bounds).MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetWindowBoundsReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetWindowBoundsReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetWindowBoundsReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetWindowBoundsReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser3(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser4(in *jlexer.Lexer, out *GetWindowBoundsParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "windowId":
out.WindowID = WindowID(in.Int64())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser4(out *jwriter.Writer, in GetWindowBoundsParams) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"windowId\":")
out.Int64(int64(in.WindowID))
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetWindowBoundsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetWindowBoundsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetWindowBoundsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetWindowBoundsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser4(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser5(in *jlexer.Lexer, out *Bounds) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "left":
out.Left = int64(in.Int64())
case "top":
out.Top = int64(in.Int64())
case "width":
out.Width = int64(in.Int64())
case "height":
out.Height = int64(in.Int64())
case "windowState":
(out.WindowState).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser5(out *jwriter.Writer, in Bounds) {
out.RawByte('{')
first := true
_ = first
if in.Left != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"left\":")
out.Int64(int64(in.Left))
}
if in.Top != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"top\":")
out.Int64(int64(in.Top))
}
if in.Width != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"width\":")
out.Int64(int64(in.Width))
}
if in.Height != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"height\":")
out.Int64(int64(in.Height))
}
if in.WindowState != "" {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"windowState\":")
(in.WindowState).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v Bounds) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Bounds) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpBrowser5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Bounds) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Bounds) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpBrowser5(l, v)
}