easyjson.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package tethering
  3. import (
  4. json "encoding/json"
  5. easyjson "github.com/mailru/easyjson"
  6. jlexer "github.com/mailru/easyjson/jlexer"
  7. jwriter "github.com/mailru/easyjson/jwriter"
  8. )
  9. // suppress unused package warning
  10. var (
  11. _ *json.RawMessage
  12. _ *jlexer.Lexer
  13. _ *jwriter.Writer
  14. _ easyjson.Marshaler
  15. )
  16. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering(in *jlexer.Lexer, out *UnbindParams) {
  17. isTopLevel := in.IsStart()
  18. if in.IsNull() {
  19. if isTopLevel {
  20. in.Consumed()
  21. }
  22. in.Skip()
  23. return
  24. }
  25. in.Delim('{')
  26. for !in.IsDelim('}') {
  27. key := in.UnsafeFieldName(false)
  28. in.WantColon()
  29. if in.IsNull() {
  30. in.Skip()
  31. in.WantComma()
  32. continue
  33. }
  34. switch key {
  35. case "port":
  36. out.Port = int64(in.Int64())
  37. default:
  38. in.SkipRecursive()
  39. }
  40. in.WantComma()
  41. }
  42. in.Delim('}')
  43. if isTopLevel {
  44. in.Consumed()
  45. }
  46. }
  47. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering(out *jwriter.Writer, in UnbindParams) {
  48. out.RawByte('{')
  49. first := true
  50. _ = first
  51. {
  52. const prefix string = ",\"port\":"
  53. out.RawString(prefix[1:])
  54. out.Int64(int64(in.Port))
  55. }
  56. out.RawByte('}')
  57. }
  58. // MarshalJSON supports json.Marshaler interface
  59. func (v UnbindParams) MarshalJSON() ([]byte, error) {
  60. w := jwriter.Writer{}
  61. easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering(&w, v)
  62. return w.Buffer.BuildBytes(), w.Error
  63. }
  64. // MarshalEasyJSON supports easyjson.Marshaler interface
  65. func (v UnbindParams) MarshalEasyJSON(w *jwriter.Writer) {
  66. easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering(w, v)
  67. }
  68. // UnmarshalJSON supports json.Unmarshaler interface
  69. func (v *UnbindParams) UnmarshalJSON(data []byte) error {
  70. r := jlexer.Lexer{Data: data}
  71. easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering(&r, v)
  72. return r.Error()
  73. }
  74. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  75. func (v *UnbindParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  76. easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering(l, v)
  77. }
  78. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering1(in *jlexer.Lexer, out *EventAccepted) {
  79. isTopLevel := in.IsStart()
  80. if in.IsNull() {
  81. if isTopLevel {
  82. in.Consumed()
  83. }
  84. in.Skip()
  85. return
  86. }
  87. in.Delim('{')
  88. for !in.IsDelim('}') {
  89. key := in.UnsafeFieldName(false)
  90. in.WantColon()
  91. if in.IsNull() {
  92. in.Skip()
  93. in.WantComma()
  94. continue
  95. }
  96. switch key {
  97. case "port":
  98. out.Port = int64(in.Int64())
  99. case "connectionId":
  100. out.ConnectionID = string(in.String())
  101. default:
  102. in.SkipRecursive()
  103. }
  104. in.WantComma()
  105. }
  106. in.Delim('}')
  107. if isTopLevel {
  108. in.Consumed()
  109. }
  110. }
  111. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering1(out *jwriter.Writer, in EventAccepted) {
  112. out.RawByte('{')
  113. first := true
  114. _ = first
  115. {
  116. const prefix string = ",\"port\":"
  117. out.RawString(prefix[1:])
  118. out.Int64(int64(in.Port))
  119. }
  120. {
  121. const prefix string = ",\"connectionId\":"
  122. out.RawString(prefix)
  123. out.String(string(in.ConnectionID))
  124. }
  125. out.RawByte('}')
  126. }
  127. // MarshalJSON supports json.Marshaler interface
  128. func (v EventAccepted) MarshalJSON() ([]byte, error) {
  129. w := jwriter.Writer{}
  130. easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering1(&w, v)
  131. return w.Buffer.BuildBytes(), w.Error
  132. }
  133. // MarshalEasyJSON supports easyjson.Marshaler interface
  134. func (v EventAccepted) MarshalEasyJSON(w *jwriter.Writer) {
  135. easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering1(w, v)
  136. }
  137. // UnmarshalJSON supports json.Unmarshaler interface
  138. func (v *EventAccepted) UnmarshalJSON(data []byte) error {
  139. r := jlexer.Lexer{Data: data}
  140. easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering1(&r, v)
  141. return r.Error()
  142. }
  143. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  144. func (v *EventAccepted) UnmarshalEasyJSON(l *jlexer.Lexer) {
  145. easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering1(l, v)
  146. }
  147. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering2(in *jlexer.Lexer, out *BindParams) {
  148. isTopLevel := in.IsStart()
  149. if in.IsNull() {
  150. if isTopLevel {
  151. in.Consumed()
  152. }
  153. in.Skip()
  154. return
  155. }
  156. in.Delim('{')
  157. for !in.IsDelim('}') {
  158. key := in.UnsafeFieldName(false)
  159. in.WantColon()
  160. if in.IsNull() {
  161. in.Skip()
  162. in.WantComma()
  163. continue
  164. }
  165. switch key {
  166. case "port":
  167. out.Port = int64(in.Int64())
  168. default:
  169. in.SkipRecursive()
  170. }
  171. in.WantComma()
  172. }
  173. in.Delim('}')
  174. if isTopLevel {
  175. in.Consumed()
  176. }
  177. }
  178. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering2(out *jwriter.Writer, in BindParams) {
  179. out.RawByte('{')
  180. first := true
  181. _ = first
  182. {
  183. const prefix string = ",\"port\":"
  184. out.RawString(prefix[1:])
  185. out.Int64(int64(in.Port))
  186. }
  187. out.RawByte('}')
  188. }
  189. // MarshalJSON supports json.Marshaler interface
  190. func (v BindParams) MarshalJSON() ([]byte, error) {
  191. w := jwriter.Writer{}
  192. easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering2(&w, v)
  193. return w.Buffer.BuildBytes(), w.Error
  194. }
  195. // MarshalEasyJSON supports easyjson.Marshaler interface
  196. func (v BindParams) MarshalEasyJSON(w *jwriter.Writer) {
  197. easyjsonC5a4559bEncodeGithubComChromedpCdprotoTethering2(w, v)
  198. }
  199. // UnmarshalJSON supports json.Unmarshaler interface
  200. func (v *BindParams) UnmarshalJSON(data []byte) error {
  201. r := jlexer.Lexer{Data: data}
  202. easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering2(&r, v)
  203. return r.Error()
  204. }
  205. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  206. func (v *BindParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  207. easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering2(l, v)
  208. }