123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
- package headlessexperimental
- import (
- json "encoding/json"
- 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 easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental(in *jlexer.Lexer, out *ScreenshotParams) {
- isTopLevel := in.IsStart()
- if in.IsNull() {
- if isTopLevel {
- in.Consumed()
- }
- in.Skip()
- return
- }
- in.Delim('{')
- for !in.IsDelim('}') {
- key := in.UnsafeFieldName(false)
- in.WantColon()
- if in.IsNull() {
- in.Skip()
- in.WantComma()
- continue
- }
- switch key {
- case "format":
- (out.Format).UnmarshalEasyJSON(in)
- case "quality":
- out.Quality = int64(in.Int64())
- case "optimizeForSpeed":
- out.OptimizeForSpeed = bool(in.Bool())
- default:
- in.SkipRecursive()
- }
- in.WantComma()
- }
- in.Delim('}')
- if isTopLevel {
- in.Consumed()
- }
- }
- func easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental(out *jwriter.Writer, in ScreenshotParams) {
- out.RawByte('{')
- first := true
- _ = first
- if in.Format != "" {
- const prefix string = ",\"format\":"
- first = false
- out.RawString(prefix[1:])
- (in.Format).MarshalEasyJSON(out)
- }
- if in.Quality != 0 {
- const prefix string = ",\"quality\":"
- if first {
- first = false
- out.RawString(prefix[1:])
- } else {
- out.RawString(prefix)
- }
- out.Int64(int64(in.Quality))
- }
- if in.OptimizeForSpeed {
- const prefix string = ",\"optimizeForSpeed\":"
- if first {
- first = false
- out.RawString(prefix[1:])
- } else {
- out.RawString(prefix)
- }
- out.Bool(bool(in.OptimizeForSpeed))
- }
- out.RawByte('}')
- }
- // MarshalJSON supports json.Marshaler interface
- func (v ScreenshotParams) MarshalJSON() ([]byte, error) {
- w := jwriter.Writer{}
- easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental(&w, v)
- return w.Buffer.BuildBytes(), w.Error
- }
- // MarshalEasyJSON supports easyjson.Marshaler interface
- func (v ScreenshotParams) MarshalEasyJSON(w *jwriter.Writer) {
- easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental(w, v)
- }
- // UnmarshalJSON supports json.Unmarshaler interface
- func (v *ScreenshotParams) UnmarshalJSON(data []byte) error {
- r := jlexer.Lexer{Data: data}
- easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental(&r, v)
- return r.Error()
- }
- // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
- func (v *ScreenshotParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental(l, v)
- }
- func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental1(in *jlexer.Lexer, out *BeginFrameReturns) {
- isTopLevel := in.IsStart()
- if in.IsNull() {
- if isTopLevel {
- in.Consumed()
- }
- in.Skip()
- return
- }
- in.Delim('{')
- for !in.IsDelim('}') {
- key := in.UnsafeFieldName(false)
- in.WantColon()
- if in.IsNull() {
- in.Skip()
- in.WantComma()
- continue
- }
- switch key {
- case "hasDamage":
- out.HasDamage = bool(in.Bool())
- case "screenshotData":
- out.ScreenshotData = string(in.String())
- default:
- in.SkipRecursive()
- }
- in.WantComma()
- }
- in.Delim('}')
- if isTopLevel {
- in.Consumed()
- }
- }
- func easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental1(out *jwriter.Writer, in BeginFrameReturns) {
- out.RawByte('{')
- first := true
- _ = first
- if in.HasDamage {
- const prefix string = ",\"hasDamage\":"
- first = false
- out.RawString(prefix[1:])
- out.Bool(bool(in.HasDamage))
- }
- if in.ScreenshotData != "" {
- const prefix string = ",\"screenshotData\":"
- if first {
- first = false
- out.RawString(prefix[1:])
- } else {
- out.RawString(prefix)
- }
- out.String(string(in.ScreenshotData))
- }
- out.RawByte('}')
- }
- // MarshalJSON supports json.Marshaler interface
- func (v BeginFrameReturns) MarshalJSON() ([]byte, error) {
- w := jwriter.Writer{}
- easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental1(&w, v)
- return w.Buffer.BuildBytes(), w.Error
- }
- // MarshalEasyJSON supports easyjson.Marshaler interface
- func (v BeginFrameReturns) MarshalEasyJSON(w *jwriter.Writer) {
- easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental1(w, v)
- }
- // UnmarshalJSON supports json.Unmarshaler interface
- func (v *BeginFrameReturns) UnmarshalJSON(data []byte) error {
- r := jlexer.Lexer{Data: data}
- easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental1(&r, v)
- return r.Error()
- }
- // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
- func (v *BeginFrameReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental1(l, v)
- }
- func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental2(in *jlexer.Lexer, out *BeginFrameParams) {
- isTopLevel := in.IsStart()
- if in.IsNull() {
- if isTopLevel {
- in.Consumed()
- }
- in.Skip()
- return
- }
- in.Delim('{')
- for !in.IsDelim('}') {
- key := in.UnsafeFieldName(false)
- in.WantColon()
- if in.IsNull() {
- in.Skip()
- in.WantComma()
- continue
- }
- switch key {
- case "frameTimeTicks":
- out.FrameTimeTicks = float64(in.Float64())
- case "interval":
- out.Interval = float64(in.Float64())
- case "noDisplayUpdates":
- out.NoDisplayUpdates = bool(in.Bool())
- case "screenshot":
- if in.IsNull() {
- in.Skip()
- out.Screenshot = nil
- } else {
- if out.Screenshot == nil {
- out.Screenshot = new(ScreenshotParams)
- }
- (*out.Screenshot).UnmarshalEasyJSON(in)
- }
- default:
- in.SkipRecursive()
- }
- in.WantComma()
- }
- in.Delim('}')
- if isTopLevel {
- in.Consumed()
- }
- }
- func easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental2(out *jwriter.Writer, in BeginFrameParams) {
- out.RawByte('{')
- first := true
- _ = first
- if in.FrameTimeTicks != 0 {
- const prefix string = ",\"frameTimeTicks\":"
- first = false
- out.RawString(prefix[1:])
- out.Float64(float64(in.FrameTimeTicks))
- }
- if in.Interval != 0 {
- const prefix string = ",\"interval\":"
- if first {
- first = false
- out.RawString(prefix[1:])
- } else {
- out.RawString(prefix)
- }
- out.Float64(float64(in.Interval))
- }
- if in.NoDisplayUpdates {
- const prefix string = ",\"noDisplayUpdates\":"
- if first {
- first = false
- out.RawString(prefix[1:])
- } else {
- out.RawString(prefix)
- }
- out.Bool(bool(in.NoDisplayUpdates))
- }
- if in.Screenshot != nil {
- const prefix string = ",\"screenshot\":"
- if first {
- first = false
- out.RawString(prefix[1:])
- } else {
- out.RawString(prefix)
- }
- (*in.Screenshot).MarshalEasyJSON(out)
- }
- out.RawByte('}')
- }
- // MarshalJSON supports json.Marshaler interface
- func (v BeginFrameParams) MarshalJSON() ([]byte, error) {
- w := jwriter.Writer{}
- easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental2(&w, v)
- return w.Buffer.BuildBytes(), w.Error
- }
- // MarshalEasyJSON supports easyjson.Marshaler interface
- func (v BeginFrameParams) MarshalEasyJSON(w *jwriter.Writer) {
- easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental2(w, v)
- }
- // UnmarshalJSON supports json.Unmarshaler interface
- func (v *BeginFrameParams) UnmarshalJSON(data []byte) error {
- r := jlexer.Lexer{Data: data}
- easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental2(&r, v)
- return r.Error()
- }
- // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
- func (v *BeginFrameParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental2(l, v)
- }
|