123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
- package afreeca
- 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 easyjsonAc9440cbDecodeGitBeejayKimWatchDogWardPlatformAfreeca(in *jlexer.Lexer, out *BridgeMessage) {
- 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 "SVC":
- out.Command = BridgeCommand(in.String())
- case "RESULT":
- out.Result = int(in.Int())
- case "DATA":
- if in.IsNull() {
- in.Skip()
- } else {
- in.Delim('{')
- out.Data = make(map[string]interface{})
- for !in.IsDelim('}') {
- key := string(in.String())
- in.WantColon()
- var v1 interface{}
- if m, ok := v1.(easyjson.Unmarshaler); ok {
- m.UnmarshalEasyJSON(in)
- } else if m, ok := v1.(json.Unmarshaler); ok {
- _ = m.UnmarshalJSON(in.Raw())
- } else {
- v1 = in.Interface()
- }
- (out.Data)[key] = v1
- in.WantComma()
- }
- in.Delim('}')
- }
- default:
- in.SkipRecursive()
- }
- in.WantComma()
- }
- in.Delim('}')
- if isTopLevel {
- in.Consumed()
- }
- }
- func easyjsonAc9440cbEncodeGitBeejayKimWatchDogWardPlatformAfreeca(out *jwriter.Writer, in BridgeMessage) {
- out.RawByte('{')
- first := true
- _ = first
- {
- const prefix string = ",\"SVC\":"
- out.RawString(prefix[1:])
- out.String(string(in.Command))
- }
- {
- const prefix string = ",\"RESULT\":"
- out.RawString(prefix)
- out.Int(int(in.Result))
- }
- {
- const prefix string = ",\"DATA\":"
- out.RawString(prefix)
- if in.Data == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
- out.RawString(`null`)
- } else {
- out.RawByte('{')
- v2First := true
- for v2Name, v2Value := range in.Data {
- if v2First {
- v2First = false
- } else {
- out.RawByte(',')
- }
- out.String(string(v2Name))
- out.RawByte(':')
- if m, ok := v2Value.(easyjson.Marshaler); ok {
- m.MarshalEasyJSON(out)
- } else if m, ok := v2Value.(json.Marshaler); ok {
- out.Raw(m.MarshalJSON())
- } else {
- out.Raw(json.Marshal(v2Value))
- }
- }
- out.RawByte('}')
- }
- }
- out.RawByte('}')
- }
- // MarshalJSON supports json.Marshaler interface
- func (v BridgeMessage) MarshalJSON() ([]byte, error) {
- w := jwriter.Writer{}
- easyjsonAc9440cbEncodeGitBeejayKimWatchDogWardPlatformAfreeca(&w, v)
- return w.Buffer.BuildBytes(), w.Error
- }
- // MarshalEasyJSON supports easyjson.Marshaler interface
- func (v BridgeMessage) MarshalEasyJSON(w *jwriter.Writer) {
- easyjsonAc9440cbEncodeGitBeejayKimWatchDogWardPlatformAfreeca(w, v)
- }
- // UnmarshalJSON supports json.Unmarshaler interface
- func (v *BridgeMessage) UnmarshalJSON(data []byte) error {
- r := jlexer.Lexer{Data: data}
- easyjsonAc9440cbDecodeGitBeejayKimWatchDogWardPlatformAfreeca(&r, v)
- return r.Error()
- }
- // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
- func (v *BridgeMessage) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjsonAc9440cbDecodeGitBeejayKimWatchDogWardPlatformAfreeca(l, v)
- }
|