easyjson.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package deviceaccess
  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 easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess(in *jlexer.Lexer, out *SelectPromptParams) {
  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 "id":
  36. out.ID = RequestID(in.String())
  37. case "deviceId":
  38. out.DeviceID = DeviceID(in.String())
  39. default:
  40. in.SkipRecursive()
  41. }
  42. in.WantComma()
  43. }
  44. in.Delim('}')
  45. if isTopLevel {
  46. in.Consumed()
  47. }
  48. }
  49. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess(out *jwriter.Writer, in SelectPromptParams) {
  50. out.RawByte('{')
  51. first := true
  52. _ = first
  53. {
  54. const prefix string = ",\"id\":"
  55. out.RawString(prefix[1:])
  56. out.String(string(in.ID))
  57. }
  58. {
  59. const prefix string = ",\"deviceId\":"
  60. out.RawString(prefix)
  61. out.String(string(in.DeviceID))
  62. }
  63. out.RawByte('}')
  64. }
  65. // MarshalJSON supports json.Marshaler interface
  66. func (v SelectPromptParams) MarshalJSON() ([]byte, error) {
  67. w := jwriter.Writer{}
  68. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess(&w, v)
  69. return w.Buffer.BuildBytes(), w.Error
  70. }
  71. // MarshalEasyJSON supports easyjson.Marshaler interface
  72. func (v SelectPromptParams) MarshalEasyJSON(w *jwriter.Writer) {
  73. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess(w, v)
  74. }
  75. // UnmarshalJSON supports json.Unmarshaler interface
  76. func (v *SelectPromptParams) UnmarshalJSON(data []byte) error {
  77. r := jlexer.Lexer{Data: data}
  78. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess(&r, v)
  79. return r.Error()
  80. }
  81. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  82. func (v *SelectPromptParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  83. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess(l, v)
  84. }
  85. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess1(in *jlexer.Lexer, out *PromptDevice) {
  86. isTopLevel := in.IsStart()
  87. if in.IsNull() {
  88. if isTopLevel {
  89. in.Consumed()
  90. }
  91. in.Skip()
  92. return
  93. }
  94. in.Delim('{')
  95. for !in.IsDelim('}') {
  96. key := in.UnsafeFieldName(false)
  97. in.WantColon()
  98. if in.IsNull() {
  99. in.Skip()
  100. in.WantComma()
  101. continue
  102. }
  103. switch key {
  104. case "id":
  105. out.ID = DeviceID(in.String())
  106. case "name":
  107. out.Name = string(in.String())
  108. default:
  109. in.SkipRecursive()
  110. }
  111. in.WantComma()
  112. }
  113. in.Delim('}')
  114. if isTopLevel {
  115. in.Consumed()
  116. }
  117. }
  118. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess1(out *jwriter.Writer, in PromptDevice) {
  119. out.RawByte('{')
  120. first := true
  121. _ = first
  122. {
  123. const prefix string = ",\"id\":"
  124. out.RawString(prefix[1:])
  125. out.String(string(in.ID))
  126. }
  127. {
  128. const prefix string = ",\"name\":"
  129. out.RawString(prefix)
  130. out.String(string(in.Name))
  131. }
  132. out.RawByte('}')
  133. }
  134. // MarshalJSON supports json.Marshaler interface
  135. func (v PromptDevice) MarshalJSON() ([]byte, error) {
  136. w := jwriter.Writer{}
  137. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess1(&w, v)
  138. return w.Buffer.BuildBytes(), w.Error
  139. }
  140. // MarshalEasyJSON supports easyjson.Marshaler interface
  141. func (v PromptDevice) MarshalEasyJSON(w *jwriter.Writer) {
  142. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess1(w, v)
  143. }
  144. // UnmarshalJSON supports json.Unmarshaler interface
  145. func (v *PromptDevice) UnmarshalJSON(data []byte) error {
  146. r := jlexer.Lexer{Data: data}
  147. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess1(&r, v)
  148. return r.Error()
  149. }
  150. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  151. func (v *PromptDevice) UnmarshalEasyJSON(l *jlexer.Lexer) {
  152. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess1(l, v)
  153. }
  154. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess2(in *jlexer.Lexer, out *EventDeviceRequestPrompted) {
  155. isTopLevel := in.IsStart()
  156. if in.IsNull() {
  157. if isTopLevel {
  158. in.Consumed()
  159. }
  160. in.Skip()
  161. return
  162. }
  163. in.Delim('{')
  164. for !in.IsDelim('}') {
  165. key := in.UnsafeFieldName(false)
  166. in.WantColon()
  167. if in.IsNull() {
  168. in.Skip()
  169. in.WantComma()
  170. continue
  171. }
  172. switch key {
  173. case "id":
  174. out.ID = RequestID(in.String())
  175. case "devices":
  176. if in.IsNull() {
  177. in.Skip()
  178. out.Devices = nil
  179. } else {
  180. in.Delim('[')
  181. if out.Devices == nil {
  182. if !in.IsDelim(']') {
  183. out.Devices = make([]*PromptDevice, 0, 8)
  184. } else {
  185. out.Devices = []*PromptDevice{}
  186. }
  187. } else {
  188. out.Devices = (out.Devices)[:0]
  189. }
  190. for !in.IsDelim(']') {
  191. var v1 *PromptDevice
  192. if in.IsNull() {
  193. in.Skip()
  194. v1 = nil
  195. } else {
  196. if v1 == nil {
  197. v1 = new(PromptDevice)
  198. }
  199. (*v1).UnmarshalEasyJSON(in)
  200. }
  201. out.Devices = append(out.Devices, v1)
  202. in.WantComma()
  203. }
  204. in.Delim(']')
  205. }
  206. default:
  207. in.SkipRecursive()
  208. }
  209. in.WantComma()
  210. }
  211. in.Delim('}')
  212. if isTopLevel {
  213. in.Consumed()
  214. }
  215. }
  216. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess2(out *jwriter.Writer, in EventDeviceRequestPrompted) {
  217. out.RawByte('{')
  218. first := true
  219. _ = first
  220. {
  221. const prefix string = ",\"id\":"
  222. out.RawString(prefix[1:])
  223. out.String(string(in.ID))
  224. }
  225. {
  226. const prefix string = ",\"devices\":"
  227. out.RawString(prefix)
  228. if in.Devices == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  229. out.RawString("null")
  230. } else {
  231. out.RawByte('[')
  232. for v2, v3 := range in.Devices {
  233. if v2 > 0 {
  234. out.RawByte(',')
  235. }
  236. if v3 == nil {
  237. out.RawString("null")
  238. } else {
  239. (*v3).MarshalEasyJSON(out)
  240. }
  241. }
  242. out.RawByte(']')
  243. }
  244. }
  245. out.RawByte('}')
  246. }
  247. // MarshalJSON supports json.Marshaler interface
  248. func (v EventDeviceRequestPrompted) MarshalJSON() ([]byte, error) {
  249. w := jwriter.Writer{}
  250. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess2(&w, v)
  251. return w.Buffer.BuildBytes(), w.Error
  252. }
  253. // MarshalEasyJSON supports easyjson.Marshaler interface
  254. func (v EventDeviceRequestPrompted) MarshalEasyJSON(w *jwriter.Writer) {
  255. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess2(w, v)
  256. }
  257. // UnmarshalJSON supports json.Unmarshaler interface
  258. func (v *EventDeviceRequestPrompted) UnmarshalJSON(data []byte) error {
  259. r := jlexer.Lexer{Data: data}
  260. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess2(&r, v)
  261. return r.Error()
  262. }
  263. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  264. func (v *EventDeviceRequestPrompted) UnmarshalEasyJSON(l *jlexer.Lexer) {
  265. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess2(l, v)
  266. }
  267. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess3(in *jlexer.Lexer, out *EnableParams) {
  268. isTopLevel := in.IsStart()
  269. if in.IsNull() {
  270. if isTopLevel {
  271. in.Consumed()
  272. }
  273. in.Skip()
  274. return
  275. }
  276. in.Delim('{')
  277. for !in.IsDelim('}') {
  278. key := in.UnsafeFieldName(false)
  279. in.WantColon()
  280. if in.IsNull() {
  281. in.Skip()
  282. in.WantComma()
  283. continue
  284. }
  285. switch key {
  286. default:
  287. in.SkipRecursive()
  288. }
  289. in.WantComma()
  290. }
  291. in.Delim('}')
  292. if isTopLevel {
  293. in.Consumed()
  294. }
  295. }
  296. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess3(out *jwriter.Writer, in EnableParams) {
  297. out.RawByte('{')
  298. first := true
  299. _ = first
  300. out.RawByte('}')
  301. }
  302. // MarshalJSON supports json.Marshaler interface
  303. func (v EnableParams) MarshalJSON() ([]byte, error) {
  304. w := jwriter.Writer{}
  305. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess3(&w, v)
  306. return w.Buffer.BuildBytes(), w.Error
  307. }
  308. // MarshalEasyJSON supports easyjson.Marshaler interface
  309. func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
  310. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess3(w, v)
  311. }
  312. // UnmarshalJSON supports json.Unmarshaler interface
  313. func (v *EnableParams) UnmarshalJSON(data []byte) error {
  314. r := jlexer.Lexer{Data: data}
  315. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess3(&r, v)
  316. return r.Error()
  317. }
  318. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  319. func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  320. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess3(l, v)
  321. }
  322. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess4(in *jlexer.Lexer, out *DisableParams) {
  323. isTopLevel := in.IsStart()
  324. if in.IsNull() {
  325. if isTopLevel {
  326. in.Consumed()
  327. }
  328. in.Skip()
  329. return
  330. }
  331. in.Delim('{')
  332. for !in.IsDelim('}') {
  333. key := in.UnsafeFieldName(false)
  334. in.WantColon()
  335. if in.IsNull() {
  336. in.Skip()
  337. in.WantComma()
  338. continue
  339. }
  340. switch key {
  341. default:
  342. in.SkipRecursive()
  343. }
  344. in.WantComma()
  345. }
  346. in.Delim('}')
  347. if isTopLevel {
  348. in.Consumed()
  349. }
  350. }
  351. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess4(out *jwriter.Writer, in DisableParams) {
  352. out.RawByte('{')
  353. first := true
  354. _ = first
  355. out.RawByte('}')
  356. }
  357. // MarshalJSON supports json.Marshaler interface
  358. func (v DisableParams) MarshalJSON() ([]byte, error) {
  359. w := jwriter.Writer{}
  360. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess4(&w, v)
  361. return w.Buffer.BuildBytes(), w.Error
  362. }
  363. // MarshalEasyJSON supports easyjson.Marshaler interface
  364. func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
  365. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess4(w, v)
  366. }
  367. // UnmarshalJSON supports json.Unmarshaler interface
  368. func (v *DisableParams) UnmarshalJSON(data []byte) error {
  369. r := jlexer.Lexer{Data: data}
  370. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess4(&r, v)
  371. return r.Error()
  372. }
  373. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  374. func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  375. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess4(l, v)
  376. }
  377. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess5(in *jlexer.Lexer, out *CancelPromptParams) {
  378. isTopLevel := in.IsStart()
  379. if in.IsNull() {
  380. if isTopLevel {
  381. in.Consumed()
  382. }
  383. in.Skip()
  384. return
  385. }
  386. in.Delim('{')
  387. for !in.IsDelim('}') {
  388. key := in.UnsafeFieldName(false)
  389. in.WantColon()
  390. if in.IsNull() {
  391. in.Skip()
  392. in.WantComma()
  393. continue
  394. }
  395. switch key {
  396. case "id":
  397. out.ID = RequestID(in.String())
  398. default:
  399. in.SkipRecursive()
  400. }
  401. in.WantComma()
  402. }
  403. in.Delim('}')
  404. if isTopLevel {
  405. in.Consumed()
  406. }
  407. }
  408. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess5(out *jwriter.Writer, in CancelPromptParams) {
  409. out.RawByte('{')
  410. first := true
  411. _ = first
  412. {
  413. const prefix string = ",\"id\":"
  414. out.RawString(prefix[1:])
  415. out.String(string(in.ID))
  416. }
  417. out.RawByte('}')
  418. }
  419. // MarshalJSON supports json.Marshaler interface
  420. func (v CancelPromptParams) MarshalJSON() ([]byte, error) {
  421. w := jwriter.Writer{}
  422. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess5(&w, v)
  423. return w.Buffer.BuildBytes(), w.Error
  424. }
  425. // MarshalEasyJSON supports easyjson.Marshaler interface
  426. func (v CancelPromptParams) MarshalEasyJSON(w *jwriter.Writer) {
  427. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceaccess5(w, v)
  428. }
  429. // UnmarshalJSON supports json.Unmarshaler interface
  430. func (v *CancelPromptParams) UnmarshalJSON(data []byte) error {
  431. r := jlexer.Lexer{Data: data}
  432. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess5(&r, v)
  433. return r.Error()
  434. }
  435. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  436. func (v *CancelPromptParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  437. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceaccess5(l, v)
  438. }