easyjson.go 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package io
  3. import (
  4. json "encoding/json"
  5. runtime "github.com/chromedp/cdproto/runtime"
  6. easyjson "github.com/mailru/easyjson"
  7. jlexer "github.com/mailru/easyjson/jlexer"
  8. jwriter "github.com/mailru/easyjson/jwriter"
  9. )
  10. // suppress unused package warning
  11. var (
  12. _ *json.RawMessage
  13. _ *jlexer.Lexer
  14. _ *jwriter.Writer
  15. _ easyjson.Marshaler
  16. )
  17. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo(in *jlexer.Lexer, out *ResolveBlobReturns) {
  18. isTopLevel := in.IsStart()
  19. if in.IsNull() {
  20. if isTopLevel {
  21. in.Consumed()
  22. }
  23. in.Skip()
  24. return
  25. }
  26. in.Delim('{')
  27. for !in.IsDelim('}') {
  28. key := in.UnsafeFieldName(false)
  29. in.WantColon()
  30. if in.IsNull() {
  31. in.Skip()
  32. in.WantComma()
  33. continue
  34. }
  35. switch key {
  36. case "uuid":
  37. out.UUID = string(in.String())
  38. default:
  39. in.SkipRecursive()
  40. }
  41. in.WantComma()
  42. }
  43. in.Delim('}')
  44. if isTopLevel {
  45. in.Consumed()
  46. }
  47. }
  48. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo(out *jwriter.Writer, in ResolveBlobReturns) {
  49. out.RawByte('{')
  50. first := true
  51. _ = first
  52. if in.UUID != "" {
  53. const prefix string = ",\"uuid\":"
  54. first = false
  55. out.RawString(prefix[1:])
  56. out.String(string(in.UUID))
  57. }
  58. out.RawByte('}')
  59. }
  60. // MarshalJSON supports json.Marshaler interface
  61. func (v ResolveBlobReturns) MarshalJSON() ([]byte, error) {
  62. w := jwriter.Writer{}
  63. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo(&w, v)
  64. return w.Buffer.BuildBytes(), w.Error
  65. }
  66. // MarshalEasyJSON supports easyjson.Marshaler interface
  67. func (v ResolveBlobReturns) MarshalEasyJSON(w *jwriter.Writer) {
  68. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo(w, v)
  69. }
  70. // UnmarshalJSON supports json.Unmarshaler interface
  71. func (v *ResolveBlobReturns) UnmarshalJSON(data []byte) error {
  72. r := jlexer.Lexer{Data: data}
  73. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo(&r, v)
  74. return r.Error()
  75. }
  76. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  77. func (v *ResolveBlobReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
  78. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo(l, v)
  79. }
  80. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo1(in *jlexer.Lexer, out *ResolveBlobParams) {
  81. isTopLevel := in.IsStart()
  82. if in.IsNull() {
  83. if isTopLevel {
  84. in.Consumed()
  85. }
  86. in.Skip()
  87. return
  88. }
  89. in.Delim('{')
  90. for !in.IsDelim('}') {
  91. key := in.UnsafeFieldName(false)
  92. in.WantColon()
  93. if in.IsNull() {
  94. in.Skip()
  95. in.WantComma()
  96. continue
  97. }
  98. switch key {
  99. case "objectId":
  100. out.ObjectID = runtime.RemoteObjectID(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 easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo1(out *jwriter.Writer, in ResolveBlobParams) {
  112. out.RawByte('{')
  113. first := true
  114. _ = first
  115. {
  116. const prefix string = ",\"objectId\":"
  117. out.RawString(prefix[1:])
  118. out.String(string(in.ObjectID))
  119. }
  120. out.RawByte('}')
  121. }
  122. // MarshalJSON supports json.Marshaler interface
  123. func (v ResolveBlobParams) MarshalJSON() ([]byte, error) {
  124. w := jwriter.Writer{}
  125. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo1(&w, v)
  126. return w.Buffer.BuildBytes(), w.Error
  127. }
  128. // MarshalEasyJSON supports easyjson.Marshaler interface
  129. func (v ResolveBlobParams) MarshalEasyJSON(w *jwriter.Writer) {
  130. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo1(w, v)
  131. }
  132. // UnmarshalJSON supports json.Unmarshaler interface
  133. func (v *ResolveBlobParams) UnmarshalJSON(data []byte) error {
  134. r := jlexer.Lexer{Data: data}
  135. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo1(&r, v)
  136. return r.Error()
  137. }
  138. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  139. func (v *ResolveBlobParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  140. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo1(l, v)
  141. }
  142. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo2(in *jlexer.Lexer, out *ReadReturns) {
  143. isTopLevel := in.IsStart()
  144. if in.IsNull() {
  145. if isTopLevel {
  146. in.Consumed()
  147. }
  148. in.Skip()
  149. return
  150. }
  151. in.Delim('{')
  152. for !in.IsDelim('}') {
  153. key := in.UnsafeFieldName(false)
  154. in.WantColon()
  155. if in.IsNull() {
  156. in.Skip()
  157. in.WantComma()
  158. continue
  159. }
  160. switch key {
  161. case "base64Encoded":
  162. out.Base64encoded = bool(in.Bool())
  163. case "data":
  164. out.Data = string(in.String())
  165. case "eof":
  166. out.EOF = bool(in.Bool())
  167. default:
  168. in.SkipRecursive()
  169. }
  170. in.WantComma()
  171. }
  172. in.Delim('}')
  173. if isTopLevel {
  174. in.Consumed()
  175. }
  176. }
  177. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo2(out *jwriter.Writer, in ReadReturns) {
  178. out.RawByte('{')
  179. first := true
  180. _ = first
  181. if in.Base64encoded {
  182. const prefix string = ",\"base64Encoded\":"
  183. first = false
  184. out.RawString(prefix[1:])
  185. out.Bool(bool(in.Base64encoded))
  186. }
  187. if in.Data != "" {
  188. const prefix string = ",\"data\":"
  189. if first {
  190. first = false
  191. out.RawString(prefix[1:])
  192. } else {
  193. out.RawString(prefix)
  194. }
  195. out.String(string(in.Data))
  196. }
  197. if in.EOF {
  198. const prefix string = ",\"eof\":"
  199. if first {
  200. first = false
  201. out.RawString(prefix[1:])
  202. } else {
  203. out.RawString(prefix)
  204. }
  205. out.Bool(bool(in.EOF))
  206. }
  207. out.RawByte('}')
  208. }
  209. // MarshalJSON supports json.Marshaler interface
  210. func (v ReadReturns) MarshalJSON() ([]byte, error) {
  211. w := jwriter.Writer{}
  212. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo2(&w, v)
  213. return w.Buffer.BuildBytes(), w.Error
  214. }
  215. // MarshalEasyJSON supports easyjson.Marshaler interface
  216. func (v ReadReturns) MarshalEasyJSON(w *jwriter.Writer) {
  217. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo2(w, v)
  218. }
  219. // UnmarshalJSON supports json.Unmarshaler interface
  220. func (v *ReadReturns) UnmarshalJSON(data []byte) error {
  221. r := jlexer.Lexer{Data: data}
  222. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo2(&r, v)
  223. return r.Error()
  224. }
  225. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  226. func (v *ReadReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
  227. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo2(l, v)
  228. }
  229. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo3(in *jlexer.Lexer, out *ReadParams) {
  230. isTopLevel := in.IsStart()
  231. if in.IsNull() {
  232. if isTopLevel {
  233. in.Consumed()
  234. }
  235. in.Skip()
  236. return
  237. }
  238. in.Delim('{')
  239. for !in.IsDelim('}') {
  240. key := in.UnsafeFieldName(false)
  241. in.WantColon()
  242. if in.IsNull() {
  243. in.Skip()
  244. in.WantComma()
  245. continue
  246. }
  247. switch key {
  248. case "handle":
  249. out.Handle = StreamHandle(in.String())
  250. case "offset":
  251. out.Offset = int64(in.Int64())
  252. case "size":
  253. out.Size = int64(in.Int64())
  254. default:
  255. in.SkipRecursive()
  256. }
  257. in.WantComma()
  258. }
  259. in.Delim('}')
  260. if isTopLevel {
  261. in.Consumed()
  262. }
  263. }
  264. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo3(out *jwriter.Writer, in ReadParams) {
  265. out.RawByte('{')
  266. first := true
  267. _ = first
  268. {
  269. const prefix string = ",\"handle\":"
  270. out.RawString(prefix[1:])
  271. out.String(string(in.Handle))
  272. }
  273. if in.Offset != 0 {
  274. const prefix string = ",\"offset\":"
  275. out.RawString(prefix)
  276. out.Int64(int64(in.Offset))
  277. }
  278. if in.Size != 0 {
  279. const prefix string = ",\"size\":"
  280. out.RawString(prefix)
  281. out.Int64(int64(in.Size))
  282. }
  283. out.RawByte('}')
  284. }
  285. // MarshalJSON supports json.Marshaler interface
  286. func (v ReadParams) MarshalJSON() ([]byte, error) {
  287. w := jwriter.Writer{}
  288. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo3(&w, v)
  289. return w.Buffer.BuildBytes(), w.Error
  290. }
  291. // MarshalEasyJSON supports easyjson.Marshaler interface
  292. func (v ReadParams) MarshalEasyJSON(w *jwriter.Writer) {
  293. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo3(w, v)
  294. }
  295. // UnmarshalJSON supports json.Unmarshaler interface
  296. func (v *ReadParams) UnmarshalJSON(data []byte) error {
  297. r := jlexer.Lexer{Data: data}
  298. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo3(&r, v)
  299. return r.Error()
  300. }
  301. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  302. func (v *ReadParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  303. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo3(l, v)
  304. }
  305. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo4(in *jlexer.Lexer, out *CloseParams) {
  306. isTopLevel := in.IsStart()
  307. if in.IsNull() {
  308. if isTopLevel {
  309. in.Consumed()
  310. }
  311. in.Skip()
  312. return
  313. }
  314. in.Delim('{')
  315. for !in.IsDelim('}') {
  316. key := in.UnsafeFieldName(false)
  317. in.WantColon()
  318. if in.IsNull() {
  319. in.Skip()
  320. in.WantComma()
  321. continue
  322. }
  323. switch key {
  324. case "handle":
  325. out.Handle = StreamHandle(in.String())
  326. default:
  327. in.SkipRecursive()
  328. }
  329. in.WantComma()
  330. }
  331. in.Delim('}')
  332. if isTopLevel {
  333. in.Consumed()
  334. }
  335. }
  336. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo4(out *jwriter.Writer, in CloseParams) {
  337. out.RawByte('{')
  338. first := true
  339. _ = first
  340. {
  341. const prefix string = ",\"handle\":"
  342. out.RawString(prefix[1:])
  343. out.String(string(in.Handle))
  344. }
  345. out.RawByte('}')
  346. }
  347. // MarshalJSON supports json.Marshaler interface
  348. func (v CloseParams) MarshalJSON() ([]byte, error) {
  349. w := jwriter.Writer{}
  350. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo4(&w, v)
  351. return w.Buffer.BuildBytes(), w.Error
  352. }
  353. // MarshalEasyJSON supports easyjson.Marshaler interface
  354. func (v CloseParams) MarshalEasyJSON(w *jwriter.Writer) {
  355. easyjsonC5a4559bEncodeGithubComChromedpCdprotoIo4(w, v)
  356. }
  357. // UnmarshalJSON supports json.Unmarshaler interface
  358. func (v *CloseParams) UnmarshalJSON(data []byte) error {
  359. r := jlexer.Lexer{Data: data}
  360. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo4(&r, v)
  361. return r.Error()
  362. }
  363. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  364. func (v *CloseParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  365. easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo4(l, v)
  366. }