chromedp/cdp/schema/easyjson.go
2017-01-24 22:09:23 +07:00

267 lines
6.0 KiB
Go

// AUTOGENERATED FILE: easyjson marshaler/unmarshalers.
package schema
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 easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema(in *jlexer.Lexer, out *GetDomainsReturns) {
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 "domains":
if in.IsNull() {
in.Skip()
out.Domains = nil
} else {
in.Delim('[')
if !in.IsDelim(']') {
out.Domains = make([]*Domain, 0, 8)
} else {
out.Domains = []*Domain{}
}
for !in.IsDelim(']') {
var v1 *Domain
if in.IsNull() {
in.Skip()
v1 = nil
} else {
if v1 == nil {
v1 = new(Domain)
}
(*v1).UnmarshalEasyJSON(in)
}
out.Domains = append(out.Domains, v1)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema(out *jwriter.Writer, in GetDomainsReturns) {
out.RawByte('{')
first := true
_ = first
if len(in.Domains) != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"domains\":")
if in.Domains == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v2, v3 := range in.Domains {
if v2 > 0 {
out.RawByte(',')
}
if v3 == nil {
out.RawString("null")
} else {
(*v3).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetDomainsReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetDomainsReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetDomainsReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetDomainsReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema1(in *jlexer.Lexer, out *GetDomainsParams) {
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 {
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema1(out *jwriter.Writer, in GetDomainsParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetDomainsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetDomainsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetDomainsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetDomainsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema1(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema2(in *jlexer.Lexer, out *Domain) {
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 "name":
out.Name = string(in.String())
case "version":
out.Version = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema2(out *jwriter.Writer, in Domain) {
out.RawByte('{')
first := true
_ = first
if in.Name != "" {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"name\":")
out.String(string(in.Name))
}
if in.Version != "" {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"version\":")
out.String(string(in.Version))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v Domain) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Domain) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Domain) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Domain) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema2(l, v)
}