easyjson.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package performancetimeline
  3. import (
  4. json "encoding/json"
  5. cdp "github.com/chromedp/cdproto/cdp"
  6. dom "github.com/chromedp/cdproto/dom"
  7. easyjson "github.com/mailru/easyjson"
  8. jlexer "github.com/mailru/easyjson/jlexer"
  9. jwriter "github.com/mailru/easyjson/jwriter"
  10. )
  11. // suppress unused package warning
  12. var (
  13. _ *json.RawMessage
  14. _ *jlexer.Lexer
  15. _ *jwriter.Writer
  16. _ easyjson.Marshaler
  17. )
  18. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline(in *jlexer.Lexer, out *TimelineEvent) {
  19. isTopLevel := in.IsStart()
  20. if in.IsNull() {
  21. if isTopLevel {
  22. in.Consumed()
  23. }
  24. in.Skip()
  25. return
  26. }
  27. in.Delim('{')
  28. for !in.IsDelim('}') {
  29. key := in.UnsafeFieldName(false)
  30. in.WantColon()
  31. if in.IsNull() {
  32. in.Skip()
  33. in.WantComma()
  34. continue
  35. }
  36. switch key {
  37. case "frameId":
  38. (out.FrameID).UnmarshalEasyJSON(in)
  39. case "type":
  40. out.Type = string(in.String())
  41. case "name":
  42. out.Name = string(in.String())
  43. case "time":
  44. if in.IsNull() {
  45. in.Skip()
  46. out.Time = nil
  47. } else {
  48. if out.Time == nil {
  49. out.Time = new(cdp.TimeSinceEpoch)
  50. }
  51. (*out.Time).UnmarshalEasyJSON(in)
  52. }
  53. case "duration":
  54. out.Duration = float64(in.Float64())
  55. case "lcpDetails":
  56. if in.IsNull() {
  57. in.Skip()
  58. out.LcpDetails = nil
  59. } else {
  60. if out.LcpDetails == nil {
  61. out.LcpDetails = new(LargestContentfulPaint)
  62. }
  63. (*out.LcpDetails).UnmarshalEasyJSON(in)
  64. }
  65. case "layoutShiftDetails":
  66. if in.IsNull() {
  67. in.Skip()
  68. out.LayoutShiftDetails = nil
  69. } else {
  70. if out.LayoutShiftDetails == nil {
  71. out.LayoutShiftDetails = new(LayoutShift)
  72. }
  73. (*out.LayoutShiftDetails).UnmarshalEasyJSON(in)
  74. }
  75. default:
  76. in.SkipRecursive()
  77. }
  78. in.WantComma()
  79. }
  80. in.Delim('}')
  81. if isTopLevel {
  82. in.Consumed()
  83. }
  84. }
  85. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline(out *jwriter.Writer, in TimelineEvent) {
  86. out.RawByte('{')
  87. first := true
  88. _ = first
  89. {
  90. const prefix string = ",\"frameId\":"
  91. out.RawString(prefix[1:])
  92. out.String(string(in.FrameID))
  93. }
  94. {
  95. const prefix string = ",\"type\":"
  96. out.RawString(prefix)
  97. out.String(string(in.Type))
  98. }
  99. {
  100. const prefix string = ",\"name\":"
  101. out.RawString(prefix)
  102. out.String(string(in.Name))
  103. }
  104. {
  105. const prefix string = ",\"time\":"
  106. out.RawString(prefix)
  107. if in.Time == nil {
  108. out.RawString("null")
  109. } else {
  110. (*in.Time).MarshalEasyJSON(out)
  111. }
  112. }
  113. if in.Duration != 0 {
  114. const prefix string = ",\"duration\":"
  115. out.RawString(prefix)
  116. out.Float64(float64(in.Duration))
  117. }
  118. if in.LcpDetails != nil {
  119. const prefix string = ",\"lcpDetails\":"
  120. out.RawString(prefix)
  121. (*in.LcpDetails).MarshalEasyJSON(out)
  122. }
  123. if in.LayoutShiftDetails != nil {
  124. const prefix string = ",\"layoutShiftDetails\":"
  125. out.RawString(prefix)
  126. (*in.LayoutShiftDetails).MarshalEasyJSON(out)
  127. }
  128. out.RawByte('}')
  129. }
  130. // MarshalJSON supports json.Marshaler interface
  131. func (v TimelineEvent) MarshalJSON() ([]byte, error) {
  132. w := jwriter.Writer{}
  133. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline(&w, v)
  134. return w.Buffer.BuildBytes(), w.Error
  135. }
  136. // MarshalEasyJSON supports easyjson.Marshaler interface
  137. func (v TimelineEvent) MarshalEasyJSON(w *jwriter.Writer) {
  138. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline(w, v)
  139. }
  140. // UnmarshalJSON supports json.Unmarshaler interface
  141. func (v *TimelineEvent) UnmarshalJSON(data []byte) error {
  142. r := jlexer.Lexer{Data: data}
  143. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline(&r, v)
  144. return r.Error()
  145. }
  146. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  147. func (v *TimelineEvent) UnmarshalEasyJSON(l *jlexer.Lexer) {
  148. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline(l, v)
  149. }
  150. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline1(in *jlexer.Lexer, out *LayoutShiftAttribution) {
  151. isTopLevel := in.IsStart()
  152. if in.IsNull() {
  153. if isTopLevel {
  154. in.Consumed()
  155. }
  156. in.Skip()
  157. return
  158. }
  159. in.Delim('{')
  160. for !in.IsDelim('}') {
  161. key := in.UnsafeFieldName(false)
  162. in.WantColon()
  163. if in.IsNull() {
  164. in.Skip()
  165. in.WantComma()
  166. continue
  167. }
  168. switch key {
  169. case "previousRect":
  170. if in.IsNull() {
  171. in.Skip()
  172. out.PreviousRect = nil
  173. } else {
  174. if out.PreviousRect == nil {
  175. out.PreviousRect = new(dom.Rect)
  176. }
  177. (*out.PreviousRect).UnmarshalEasyJSON(in)
  178. }
  179. case "currentRect":
  180. if in.IsNull() {
  181. in.Skip()
  182. out.CurrentRect = nil
  183. } else {
  184. if out.CurrentRect == nil {
  185. out.CurrentRect = new(dom.Rect)
  186. }
  187. (*out.CurrentRect).UnmarshalEasyJSON(in)
  188. }
  189. case "nodeId":
  190. (out.NodeID).UnmarshalEasyJSON(in)
  191. default:
  192. in.SkipRecursive()
  193. }
  194. in.WantComma()
  195. }
  196. in.Delim('}')
  197. if isTopLevel {
  198. in.Consumed()
  199. }
  200. }
  201. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline1(out *jwriter.Writer, in LayoutShiftAttribution) {
  202. out.RawByte('{')
  203. first := true
  204. _ = first
  205. {
  206. const prefix string = ",\"previousRect\":"
  207. out.RawString(prefix[1:])
  208. if in.PreviousRect == nil {
  209. out.RawString("null")
  210. } else {
  211. (*in.PreviousRect).MarshalEasyJSON(out)
  212. }
  213. }
  214. {
  215. const prefix string = ",\"currentRect\":"
  216. out.RawString(prefix)
  217. if in.CurrentRect == nil {
  218. out.RawString("null")
  219. } else {
  220. (*in.CurrentRect).MarshalEasyJSON(out)
  221. }
  222. }
  223. if in.NodeID != 0 {
  224. const prefix string = ",\"nodeId\":"
  225. out.RawString(prefix)
  226. out.Int64(int64(in.NodeID))
  227. }
  228. out.RawByte('}')
  229. }
  230. // MarshalJSON supports json.Marshaler interface
  231. func (v LayoutShiftAttribution) MarshalJSON() ([]byte, error) {
  232. w := jwriter.Writer{}
  233. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline1(&w, v)
  234. return w.Buffer.BuildBytes(), w.Error
  235. }
  236. // MarshalEasyJSON supports easyjson.Marshaler interface
  237. func (v LayoutShiftAttribution) MarshalEasyJSON(w *jwriter.Writer) {
  238. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline1(w, v)
  239. }
  240. // UnmarshalJSON supports json.Unmarshaler interface
  241. func (v *LayoutShiftAttribution) UnmarshalJSON(data []byte) error {
  242. r := jlexer.Lexer{Data: data}
  243. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline1(&r, v)
  244. return r.Error()
  245. }
  246. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  247. func (v *LayoutShiftAttribution) UnmarshalEasyJSON(l *jlexer.Lexer) {
  248. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline1(l, v)
  249. }
  250. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline2(in *jlexer.Lexer, out *LayoutShift) {
  251. isTopLevel := in.IsStart()
  252. if in.IsNull() {
  253. if isTopLevel {
  254. in.Consumed()
  255. }
  256. in.Skip()
  257. return
  258. }
  259. in.Delim('{')
  260. for !in.IsDelim('}') {
  261. key := in.UnsafeFieldName(false)
  262. in.WantColon()
  263. if in.IsNull() {
  264. in.Skip()
  265. in.WantComma()
  266. continue
  267. }
  268. switch key {
  269. case "value":
  270. out.Value = float64(in.Float64())
  271. case "hadRecentInput":
  272. out.HadRecentInput = bool(in.Bool())
  273. case "lastInputTime":
  274. if in.IsNull() {
  275. in.Skip()
  276. out.LastInputTime = nil
  277. } else {
  278. if out.LastInputTime == nil {
  279. out.LastInputTime = new(cdp.TimeSinceEpoch)
  280. }
  281. (*out.LastInputTime).UnmarshalEasyJSON(in)
  282. }
  283. case "sources":
  284. if in.IsNull() {
  285. in.Skip()
  286. out.Sources = nil
  287. } else {
  288. in.Delim('[')
  289. if out.Sources == nil {
  290. if !in.IsDelim(']') {
  291. out.Sources = make([]*LayoutShiftAttribution, 0, 8)
  292. } else {
  293. out.Sources = []*LayoutShiftAttribution{}
  294. }
  295. } else {
  296. out.Sources = (out.Sources)[:0]
  297. }
  298. for !in.IsDelim(']') {
  299. var v1 *LayoutShiftAttribution
  300. if in.IsNull() {
  301. in.Skip()
  302. v1 = nil
  303. } else {
  304. if v1 == nil {
  305. v1 = new(LayoutShiftAttribution)
  306. }
  307. (*v1).UnmarshalEasyJSON(in)
  308. }
  309. out.Sources = append(out.Sources, v1)
  310. in.WantComma()
  311. }
  312. in.Delim(']')
  313. }
  314. default:
  315. in.SkipRecursive()
  316. }
  317. in.WantComma()
  318. }
  319. in.Delim('}')
  320. if isTopLevel {
  321. in.Consumed()
  322. }
  323. }
  324. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline2(out *jwriter.Writer, in LayoutShift) {
  325. out.RawByte('{')
  326. first := true
  327. _ = first
  328. {
  329. const prefix string = ",\"value\":"
  330. out.RawString(prefix[1:])
  331. out.Float64(float64(in.Value))
  332. }
  333. {
  334. const prefix string = ",\"hadRecentInput\":"
  335. out.RawString(prefix)
  336. out.Bool(bool(in.HadRecentInput))
  337. }
  338. {
  339. const prefix string = ",\"lastInputTime\":"
  340. out.RawString(prefix)
  341. if in.LastInputTime == nil {
  342. out.RawString("null")
  343. } else {
  344. (*in.LastInputTime).MarshalEasyJSON(out)
  345. }
  346. }
  347. {
  348. const prefix string = ",\"sources\":"
  349. out.RawString(prefix)
  350. if in.Sources == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  351. out.RawString("null")
  352. } else {
  353. out.RawByte('[')
  354. for v2, v3 := range in.Sources {
  355. if v2 > 0 {
  356. out.RawByte(',')
  357. }
  358. if v3 == nil {
  359. out.RawString("null")
  360. } else {
  361. (*v3).MarshalEasyJSON(out)
  362. }
  363. }
  364. out.RawByte(']')
  365. }
  366. }
  367. out.RawByte('}')
  368. }
  369. // MarshalJSON supports json.Marshaler interface
  370. func (v LayoutShift) MarshalJSON() ([]byte, error) {
  371. w := jwriter.Writer{}
  372. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline2(&w, v)
  373. return w.Buffer.BuildBytes(), w.Error
  374. }
  375. // MarshalEasyJSON supports easyjson.Marshaler interface
  376. func (v LayoutShift) MarshalEasyJSON(w *jwriter.Writer) {
  377. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline2(w, v)
  378. }
  379. // UnmarshalJSON supports json.Unmarshaler interface
  380. func (v *LayoutShift) UnmarshalJSON(data []byte) error {
  381. r := jlexer.Lexer{Data: data}
  382. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline2(&r, v)
  383. return r.Error()
  384. }
  385. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  386. func (v *LayoutShift) UnmarshalEasyJSON(l *jlexer.Lexer) {
  387. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline2(l, v)
  388. }
  389. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline3(in *jlexer.Lexer, out *LargestContentfulPaint) {
  390. isTopLevel := in.IsStart()
  391. if in.IsNull() {
  392. if isTopLevel {
  393. in.Consumed()
  394. }
  395. in.Skip()
  396. return
  397. }
  398. in.Delim('{')
  399. for !in.IsDelim('}') {
  400. key := in.UnsafeFieldName(false)
  401. in.WantColon()
  402. if in.IsNull() {
  403. in.Skip()
  404. in.WantComma()
  405. continue
  406. }
  407. switch key {
  408. case "renderTime":
  409. if in.IsNull() {
  410. in.Skip()
  411. out.RenderTime = nil
  412. } else {
  413. if out.RenderTime == nil {
  414. out.RenderTime = new(cdp.TimeSinceEpoch)
  415. }
  416. (*out.RenderTime).UnmarshalEasyJSON(in)
  417. }
  418. case "loadTime":
  419. if in.IsNull() {
  420. in.Skip()
  421. out.LoadTime = nil
  422. } else {
  423. if out.LoadTime == nil {
  424. out.LoadTime = new(cdp.TimeSinceEpoch)
  425. }
  426. (*out.LoadTime).UnmarshalEasyJSON(in)
  427. }
  428. case "size":
  429. out.Size = float64(in.Float64())
  430. case "elementId":
  431. out.ElementID = string(in.String())
  432. case "url":
  433. out.URL = string(in.String())
  434. case "nodeId":
  435. (out.NodeID).UnmarshalEasyJSON(in)
  436. default:
  437. in.SkipRecursive()
  438. }
  439. in.WantComma()
  440. }
  441. in.Delim('}')
  442. if isTopLevel {
  443. in.Consumed()
  444. }
  445. }
  446. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline3(out *jwriter.Writer, in LargestContentfulPaint) {
  447. out.RawByte('{')
  448. first := true
  449. _ = first
  450. {
  451. const prefix string = ",\"renderTime\":"
  452. out.RawString(prefix[1:])
  453. if in.RenderTime == nil {
  454. out.RawString("null")
  455. } else {
  456. (*in.RenderTime).MarshalEasyJSON(out)
  457. }
  458. }
  459. {
  460. const prefix string = ",\"loadTime\":"
  461. out.RawString(prefix)
  462. if in.LoadTime == nil {
  463. out.RawString("null")
  464. } else {
  465. (*in.LoadTime).MarshalEasyJSON(out)
  466. }
  467. }
  468. {
  469. const prefix string = ",\"size\":"
  470. out.RawString(prefix)
  471. out.Float64(float64(in.Size))
  472. }
  473. if in.ElementID != "" {
  474. const prefix string = ",\"elementId\":"
  475. out.RawString(prefix)
  476. out.String(string(in.ElementID))
  477. }
  478. if in.URL != "" {
  479. const prefix string = ",\"url\":"
  480. out.RawString(prefix)
  481. out.String(string(in.URL))
  482. }
  483. if in.NodeID != 0 {
  484. const prefix string = ",\"nodeId\":"
  485. out.RawString(prefix)
  486. out.Int64(int64(in.NodeID))
  487. }
  488. out.RawByte('}')
  489. }
  490. // MarshalJSON supports json.Marshaler interface
  491. func (v LargestContentfulPaint) MarshalJSON() ([]byte, error) {
  492. w := jwriter.Writer{}
  493. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline3(&w, v)
  494. return w.Buffer.BuildBytes(), w.Error
  495. }
  496. // MarshalEasyJSON supports easyjson.Marshaler interface
  497. func (v LargestContentfulPaint) MarshalEasyJSON(w *jwriter.Writer) {
  498. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline3(w, v)
  499. }
  500. // UnmarshalJSON supports json.Unmarshaler interface
  501. func (v *LargestContentfulPaint) UnmarshalJSON(data []byte) error {
  502. r := jlexer.Lexer{Data: data}
  503. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline3(&r, v)
  504. return r.Error()
  505. }
  506. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  507. func (v *LargestContentfulPaint) UnmarshalEasyJSON(l *jlexer.Lexer) {
  508. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline3(l, v)
  509. }
  510. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline4(in *jlexer.Lexer, out *EventTimelineEventAdded) {
  511. isTopLevel := in.IsStart()
  512. if in.IsNull() {
  513. if isTopLevel {
  514. in.Consumed()
  515. }
  516. in.Skip()
  517. return
  518. }
  519. in.Delim('{')
  520. for !in.IsDelim('}') {
  521. key := in.UnsafeFieldName(false)
  522. in.WantColon()
  523. if in.IsNull() {
  524. in.Skip()
  525. in.WantComma()
  526. continue
  527. }
  528. switch key {
  529. case "event":
  530. if in.IsNull() {
  531. in.Skip()
  532. out.Event = nil
  533. } else {
  534. if out.Event == nil {
  535. out.Event = new(TimelineEvent)
  536. }
  537. (*out.Event).UnmarshalEasyJSON(in)
  538. }
  539. default:
  540. in.SkipRecursive()
  541. }
  542. in.WantComma()
  543. }
  544. in.Delim('}')
  545. if isTopLevel {
  546. in.Consumed()
  547. }
  548. }
  549. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline4(out *jwriter.Writer, in EventTimelineEventAdded) {
  550. out.RawByte('{')
  551. first := true
  552. _ = first
  553. {
  554. const prefix string = ",\"event\":"
  555. out.RawString(prefix[1:])
  556. if in.Event == nil {
  557. out.RawString("null")
  558. } else {
  559. (*in.Event).MarshalEasyJSON(out)
  560. }
  561. }
  562. out.RawByte('}')
  563. }
  564. // MarshalJSON supports json.Marshaler interface
  565. func (v EventTimelineEventAdded) MarshalJSON() ([]byte, error) {
  566. w := jwriter.Writer{}
  567. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline4(&w, v)
  568. return w.Buffer.BuildBytes(), w.Error
  569. }
  570. // MarshalEasyJSON supports easyjson.Marshaler interface
  571. func (v EventTimelineEventAdded) MarshalEasyJSON(w *jwriter.Writer) {
  572. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline4(w, v)
  573. }
  574. // UnmarshalJSON supports json.Unmarshaler interface
  575. func (v *EventTimelineEventAdded) UnmarshalJSON(data []byte) error {
  576. r := jlexer.Lexer{Data: data}
  577. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline4(&r, v)
  578. return r.Error()
  579. }
  580. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  581. func (v *EventTimelineEventAdded) UnmarshalEasyJSON(l *jlexer.Lexer) {
  582. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline4(l, v)
  583. }
  584. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline5(in *jlexer.Lexer, out *EnableParams) {
  585. isTopLevel := in.IsStart()
  586. if in.IsNull() {
  587. if isTopLevel {
  588. in.Consumed()
  589. }
  590. in.Skip()
  591. return
  592. }
  593. in.Delim('{')
  594. for !in.IsDelim('}') {
  595. key := in.UnsafeFieldName(false)
  596. in.WantColon()
  597. if in.IsNull() {
  598. in.Skip()
  599. in.WantComma()
  600. continue
  601. }
  602. switch key {
  603. case "eventTypes":
  604. if in.IsNull() {
  605. in.Skip()
  606. out.EventTypes = nil
  607. } else {
  608. in.Delim('[')
  609. if out.EventTypes == nil {
  610. if !in.IsDelim(']') {
  611. out.EventTypes = make([]string, 0, 4)
  612. } else {
  613. out.EventTypes = []string{}
  614. }
  615. } else {
  616. out.EventTypes = (out.EventTypes)[:0]
  617. }
  618. for !in.IsDelim(']') {
  619. var v4 string
  620. v4 = string(in.String())
  621. out.EventTypes = append(out.EventTypes, v4)
  622. in.WantComma()
  623. }
  624. in.Delim(']')
  625. }
  626. default:
  627. in.SkipRecursive()
  628. }
  629. in.WantComma()
  630. }
  631. in.Delim('}')
  632. if isTopLevel {
  633. in.Consumed()
  634. }
  635. }
  636. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline5(out *jwriter.Writer, in EnableParams) {
  637. out.RawByte('{')
  638. first := true
  639. _ = first
  640. {
  641. const prefix string = ",\"eventTypes\":"
  642. out.RawString(prefix[1:])
  643. if in.EventTypes == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  644. out.RawString("null")
  645. } else {
  646. out.RawByte('[')
  647. for v5, v6 := range in.EventTypes {
  648. if v5 > 0 {
  649. out.RawByte(',')
  650. }
  651. out.String(string(v6))
  652. }
  653. out.RawByte(']')
  654. }
  655. }
  656. out.RawByte('}')
  657. }
  658. // MarshalJSON supports json.Marshaler interface
  659. func (v EnableParams) MarshalJSON() ([]byte, error) {
  660. w := jwriter.Writer{}
  661. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline5(&w, v)
  662. return w.Buffer.BuildBytes(), w.Error
  663. }
  664. // MarshalEasyJSON supports easyjson.Marshaler interface
  665. func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
  666. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline5(w, v)
  667. }
  668. // UnmarshalJSON supports json.Unmarshaler interface
  669. func (v *EnableParams) UnmarshalJSON(data []byte) error {
  670. r := jlexer.Lexer{Data: data}
  671. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline5(&r, v)
  672. return r.Error()
  673. }
  674. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  675. func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  676. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline5(l, v)
  677. }