easyjson.go 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package cachestorage
  3. import (
  4. json "encoding/json"
  5. storage "github.com/chromedp/cdproto/storage"
  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 easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage(in *jlexer.Lexer, out *RequestEntriesReturns) {
  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 "cacheDataEntries":
  37. if in.IsNull() {
  38. in.Skip()
  39. out.CacheDataEntries = nil
  40. } else {
  41. in.Delim('[')
  42. if out.CacheDataEntries == nil {
  43. if !in.IsDelim(']') {
  44. out.CacheDataEntries = make([]*DataEntry, 0, 8)
  45. } else {
  46. out.CacheDataEntries = []*DataEntry{}
  47. }
  48. } else {
  49. out.CacheDataEntries = (out.CacheDataEntries)[:0]
  50. }
  51. for !in.IsDelim(']') {
  52. var v1 *DataEntry
  53. if in.IsNull() {
  54. in.Skip()
  55. v1 = nil
  56. } else {
  57. if v1 == nil {
  58. v1 = new(DataEntry)
  59. }
  60. (*v1).UnmarshalEasyJSON(in)
  61. }
  62. out.CacheDataEntries = append(out.CacheDataEntries, v1)
  63. in.WantComma()
  64. }
  65. in.Delim(']')
  66. }
  67. case "returnCount":
  68. out.ReturnCount = float64(in.Float64())
  69. default:
  70. in.SkipRecursive()
  71. }
  72. in.WantComma()
  73. }
  74. in.Delim('}')
  75. if isTopLevel {
  76. in.Consumed()
  77. }
  78. }
  79. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage(out *jwriter.Writer, in RequestEntriesReturns) {
  80. out.RawByte('{')
  81. first := true
  82. _ = first
  83. if len(in.CacheDataEntries) != 0 {
  84. const prefix string = ",\"cacheDataEntries\":"
  85. first = false
  86. out.RawString(prefix[1:])
  87. {
  88. out.RawByte('[')
  89. for v2, v3 := range in.CacheDataEntries {
  90. if v2 > 0 {
  91. out.RawByte(',')
  92. }
  93. if v3 == nil {
  94. out.RawString("null")
  95. } else {
  96. (*v3).MarshalEasyJSON(out)
  97. }
  98. }
  99. out.RawByte(']')
  100. }
  101. }
  102. if in.ReturnCount != 0 {
  103. const prefix string = ",\"returnCount\":"
  104. if first {
  105. first = false
  106. out.RawString(prefix[1:])
  107. } else {
  108. out.RawString(prefix)
  109. }
  110. out.Float64(float64(in.ReturnCount))
  111. }
  112. out.RawByte('}')
  113. }
  114. // MarshalJSON supports json.Marshaler interface
  115. func (v RequestEntriesReturns) MarshalJSON() ([]byte, error) {
  116. w := jwriter.Writer{}
  117. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage(&w, v)
  118. return w.Buffer.BuildBytes(), w.Error
  119. }
  120. // MarshalEasyJSON supports easyjson.Marshaler interface
  121. func (v RequestEntriesReturns) MarshalEasyJSON(w *jwriter.Writer) {
  122. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage(w, v)
  123. }
  124. // UnmarshalJSON supports json.Unmarshaler interface
  125. func (v *RequestEntriesReturns) UnmarshalJSON(data []byte) error {
  126. r := jlexer.Lexer{Data: data}
  127. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage(&r, v)
  128. return r.Error()
  129. }
  130. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  131. func (v *RequestEntriesReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
  132. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage(l, v)
  133. }
  134. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage1(in *jlexer.Lexer, out *RequestEntriesParams) {
  135. isTopLevel := in.IsStart()
  136. if in.IsNull() {
  137. if isTopLevel {
  138. in.Consumed()
  139. }
  140. in.Skip()
  141. return
  142. }
  143. in.Delim('{')
  144. for !in.IsDelim('}') {
  145. key := in.UnsafeFieldName(false)
  146. in.WantColon()
  147. if in.IsNull() {
  148. in.Skip()
  149. in.WantComma()
  150. continue
  151. }
  152. switch key {
  153. case "cacheId":
  154. out.CacheID = CacheID(in.String())
  155. case "skipCount":
  156. out.SkipCount = int64(in.Int64())
  157. case "pageSize":
  158. out.PageSize = int64(in.Int64())
  159. case "pathFilter":
  160. out.PathFilter = string(in.String())
  161. default:
  162. in.SkipRecursive()
  163. }
  164. in.WantComma()
  165. }
  166. in.Delim('}')
  167. if isTopLevel {
  168. in.Consumed()
  169. }
  170. }
  171. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage1(out *jwriter.Writer, in RequestEntriesParams) {
  172. out.RawByte('{')
  173. first := true
  174. _ = first
  175. {
  176. const prefix string = ",\"cacheId\":"
  177. out.RawString(prefix[1:])
  178. out.String(string(in.CacheID))
  179. }
  180. if in.SkipCount != 0 {
  181. const prefix string = ",\"skipCount\":"
  182. out.RawString(prefix)
  183. out.Int64(int64(in.SkipCount))
  184. }
  185. if in.PageSize != 0 {
  186. const prefix string = ",\"pageSize\":"
  187. out.RawString(prefix)
  188. out.Int64(int64(in.PageSize))
  189. }
  190. if in.PathFilter != "" {
  191. const prefix string = ",\"pathFilter\":"
  192. out.RawString(prefix)
  193. out.String(string(in.PathFilter))
  194. }
  195. out.RawByte('}')
  196. }
  197. // MarshalJSON supports json.Marshaler interface
  198. func (v RequestEntriesParams) MarshalJSON() ([]byte, error) {
  199. w := jwriter.Writer{}
  200. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage1(&w, v)
  201. return w.Buffer.BuildBytes(), w.Error
  202. }
  203. // MarshalEasyJSON supports easyjson.Marshaler interface
  204. func (v RequestEntriesParams) MarshalEasyJSON(w *jwriter.Writer) {
  205. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage1(w, v)
  206. }
  207. // UnmarshalJSON supports json.Unmarshaler interface
  208. func (v *RequestEntriesParams) UnmarshalJSON(data []byte) error {
  209. r := jlexer.Lexer{Data: data}
  210. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage1(&r, v)
  211. return r.Error()
  212. }
  213. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  214. func (v *RequestEntriesParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  215. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage1(l, v)
  216. }
  217. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage2(in *jlexer.Lexer, out *RequestCachedResponseReturns) {
  218. isTopLevel := in.IsStart()
  219. if in.IsNull() {
  220. if isTopLevel {
  221. in.Consumed()
  222. }
  223. in.Skip()
  224. return
  225. }
  226. in.Delim('{')
  227. for !in.IsDelim('}') {
  228. key := in.UnsafeFieldName(false)
  229. in.WantColon()
  230. if in.IsNull() {
  231. in.Skip()
  232. in.WantComma()
  233. continue
  234. }
  235. switch key {
  236. case "response":
  237. if in.IsNull() {
  238. in.Skip()
  239. out.Response = nil
  240. } else {
  241. if out.Response == nil {
  242. out.Response = new(CachedResponse)
  243. }
  244. (*out.Response).UnmarshalEasyJSON(in)
  245. }
  246. default:
  247. in.SkipRecursive()
  248. }
  249. in.WantComma()
  250. }
  251. in.Delim('}')
  252. if isTopLevel {
  253. in.Consumed()
  254. }
  255. }
  256. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage2(out *jwriter.Writer, in RequestCachedResponseReturns) {
  257. out.RawByte('{')
  258. first := true
  259. _ = first
  260. if in.Response != nil {
  261. const prefix string = ",\"response\":"
  262. first = false
  263. out.RawString(prefix[1:])
  264. (*in.Response).MarshalEasyJSON(out)
  265. }
  266. out.RawByte('}')
  267. }
  268. // MarshalJSON supports json.Marshaler interface
  269. func (v RequestCachedResponseReturns) MarshalJSON() ([]byte, error) {
  270. w := jwriter.Writer{}
  271. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage2(&w, v)
  272. return w.Buffer.BuildBytes(), w.Error
  273. }
  274. // MarshalEasyJSON supports easyjson.Marshaler interface
  275. func (v RequestCachedResponseReturns) MarshalEasyJSON(w *jwriter.Writer) {
  276. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage2(w, v)
  277. }
  278. // UnmarshalJSON supports json.Unmarshaler interface
  279. func (v *RequestCachedResponseReturns) UnmarshalJSON(data []byte) error {
  280. r := jlexer.Lexer{Data: data}
  281. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage2(&r, v)
  282. return r.Error()
  283. }
  284. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  285. func (v *RequestCachedResponseReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
  286. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage2(l, v)
  287. }
  288. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage3(in *jlexer.Lexer, out *RequestCachedResponseParams) {
  289. isTopLevel := in.IsStart()
  290. if in.IsNull() {
  291. if isTopLevel {
  292. in.Consumed()
  293. }
  294. in.Skip()
  295. return
  296. }
  297. in.Delim('{')
  298. for !in.IsDelim('}') {
  299. key := in.UnsafeFieldName(false)
  300. in.WantColon()
  301. if in.IsNull() {
  302. in.Skip()
  303. in.WantComma()
  304. continue
  305. }
  306. switch key {
  307. case "cacheId":
  308. out.CacheID = CacheID(in.String())
  309. case "requestURL":
  310. out.RequestURL = string(in.String())
  311. case "requestHeaders":
  312. if in.IsNull() {
  313. in.Skip()
  314. out.RequestHeaders = nil
  315. } else {
  316. in.Delim('[')
  317. if out.RequestHeaders == nil {
  318. if !in.IsDelim(']') {
  319. out.RequestHeaders = make([]*Header, 0, 8)
  320. } else {
  321. out.RequestHeaders = []*Header{}
  322. }
  323. } else {
  324. out.RequestHeaders = (out.RequestHeaders)[:0]
  325. }
  326. for !in.IsDelim(']') {
  327. var v4 *Header
  328. if in.IsNull() {
  329. in.Skip()
  330. v4 = nil
  331. } else {
  332. if v4 == nil {
  333. v4 = new(Header)
  334. }
  335. (*v4).UnmarshalEasyJSON(in)
  336. }
  337. out.RequestHeaders = append(out.RequestHeaders, v4)
  338. in.WantComma()
  339. }
  340. in.Delim(']')
  341. }
  342. default:
  343. in.SkipRecursive()
  344. }
  345. in.WantComma()
  346. }
  347. in.Delim('}')
  348. if isTopLevel {
  349. in.Consumed()
  350. }
  351. }
  352. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage3(out *jwriter.Writer, in RequestCachedResponseParams) {
  353. out.RawByte('{')
  354. first := true
  355. _ = first
  356. {
  357. const prefix string = ",\"cacheId\":"
  358. out.RawString(prefix[1:])
  359. out.String(string(in.CacheID))
  360. }
  361. {
  362. const prefix string = ",\"requestURL\":"
  363. out.RawString(prefix)
  364. out.String(string(in.RequestURL))
  365. }
  366. {
  367. const prefix string = ",\"requestHeaders\":"
  368. out.RawString(prefix)
  369. if in.RequestHeaders == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  370. out.RawString("null")
  371. } else {
  372. out.RawByte('[')
  373. for v5, v6 := range in.RequestHeaders {
  374. if v5 > 0 {
  375. out.RawByte(',')
  376. }
  377. if v6 == nil {
  378. out.RawString("null")
  379. } else {
  380. (*v6).MarshalEasyJSON(out)
  381. }
  382. }
  383. out.RawByte(']')
  384. }
  385. }
  386. out.RawByte('}')
  387. }
  388. // MarshalJSON supports json.Marshaler interface
  389. func (v RequestCachedResponseParams) MarshalJSON() ([]byte, error) {
  390. w := jwriter.Writer{}
  391. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage3(&w, v)
  392. return w.Buffer.BuildBytes(), w.Error
  393. }
  394. // MarshalEasyJSON supports easyjson.Marshaler interface
  395. func (v RequestCachedResponseParams) MarshalEasyJSON(w *jwriter.Writer) {
  396. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage3(w, v)
  397. }
  398. // UnmarshalJSON supports json.Unmarshaler interface
  399. func (v *RequestCachedResponseParams) UnmarshalJSON(data []byte) error {
  400. r := jlexer.Lexer{Data: data}
  401. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage3(&r, v)
  402. return r.Error()
  403. }
  404. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  405. func (v *RequestCachedResponseParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  406. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage3(l, v)
  407. }
  408. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage4(in *jlexer.Lexer, out *RequestCacheNamesReturns) {
  409. isTopLevel := in.IsStart()
  410. if in.IsNull() {
  411. if isTopLevel {
  412. in.Consumed()
  413. }
  414. in.Skip()
  415. return
  416. }
  417. in.Delim('{')
  418. for !in.IsDelim('}') {
  419. key := in.UnsafeFieldName(false)
  420. in.WantColon()
  421. if in.IsNull() {
  422. in.Skip()
  423. in.WantComma()
  424. continue
  425. }
  426. switch key {
  427. case "caches":
  428. if in.IsNull() {
  429. in.Skip()
  430. out.Caches = nil
  431. } else {
  432. in.Delim('[')
  433. if out.Caches == nil {
  434. if !in.IsDelim(']') {
  435. out.Caches = make([]*Cache, 0, 8)
  436. } else {
  437. out.Caches = []*Cache{}
  438. }
  439. } else {
  440. out.Caches = (out.Caches)[:0]
  441. }
  442. for !in.IsDelim(']') {
  443. var v7 *Cache
  444. if in.IsNull() {
  445. in.Skip()
  446. v7 = nil
  447. } else {
  448. if v7 == nil {
  449. v7 = new(Cache)
  450. }
  451. (*v7).UnmarshalEasyJSON(in)
  452. }
  453. out.Caches = append(out.Caches, v7)
  454. in.WantComma()
  455. }
  456. in.Delim(']')
  457. }
  458. default:
  459. in.SkipRecursive()
  460. }
  461. in.WantComma()
  462. }
  463. in.Delim('}')
  464. if isTopLevel {
  465. in.Consumed()
  466. }
  467. }
  468. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage4(out *jwriter.Writer, in RequestCacheNamesReturns) {
  469. out.RawByte('{')
  470. first := true
  471. _ = first
  472. if len(in.Caches) != 0 {
  473. const prefix string = ",\"caches\":"
  474. first = false
  475. out.RawString(prefix[1:])
  476. {
  477. out.RawByte('[')
  478. for v8, v9 := range in.Caches {
  479. if v8 > 0 {
  480. out.RawByte(',')
  481. }
  482. if v9 == nil {
  483. out.RawString("null")
  484. } else {
  485. (*v9).MarshalEasyJSON(out)
  486. }
  487. }
  488. out.RawByte(']')
  489. }
  490. }
  491. out.RawByte('}')
  492. }
  493. // MarshalJSON supports json.Marshaler interface
  494. func (v RequestCacheNamesReturns) MarshalJSON() ([]byte, error) {
  495. w := jwriter.Writer{}
  496. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage4(&w, v)
  497. return w.Buffer.BuildBytes(), w.Error
  498. }
  499. // MarshalEasyJSON supports easyjson.Marshaler interface
  500. func (v RequestCacheNamesReturns) MarshalEasyJSON(w *jwriter.Writer) {
  501. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage4(w, v)
  502. }
  503. // UnmarshalJSON supports json.Unmarshaler interface
  504. func (v *RequestCacheNamesReturns) UnmarshalJSON(data []byte) error {
  505. r := jlexer.Lexer{Data: data}
  506. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage4(&r, v)
  507. return r.Error()
  508. }
  509. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  510. func (v *RequestCacheNamesReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
  511. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage4(l, v)
  512. }
  513. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage5(in *jlexer.Lexer, out *RequestCacheNamesParams) {
  514. isTopLevel := in.IsStart()
  515. if in.IsNull() {
  516. if isTopLevel {
  517. in.Consumed()
  518. }
  519. in.Skip()
  520. return
  521. }
  522. in.Delim('{')
  523. for !in.IsDelim('}') {
  524. key := in.UnsafeFieldName(false)
  525. in.WantColon()
  526. if in.IsNull() {
  527. in.Skip()
  528. in.WantComma()
  529. continue
  530. }
  531. switch key {
  532. case "securityOrigin":
  533. out.SecurityOrigin = string(in.String())
  534. case "storageKey":
  535. out.StorageKey = string(in.String())
  536. case "storageBucket":
  537. if in.IsNull() {
  538. in.Skip()
  539. out.StorageBucket = nil
  540. } else {
  541. if out.StorageBucket == nil {
  542. out.StorageBucket = new(storage.Bucket)
  543. }
  544. (*out.StorageBucket).UnmarshalEasyJSON(in)
  545. }
  546. default:
  547. in.SkipRecursive()
  548. }
  549. in.WantComma()
  550. }
  551. in.Delim('}')
  552. if isTopLevel {
  553. in.Consumed()
  554. }
  555. }
  556. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage5(out *jwriter.Writer, in RequestCacheNamesParams) {
  557. out.RawByte('{')
  558. first := true
  559. _ = first
  560. if in.SecurityOrigin != "" {
  561. const prefix string = ",\"securityOrigin\":"
  562. first = false
  563. out.RawString(prefix[1:])
  564. out.String(string(in.SecurityOrigin))
  565. }
  566. if in.StorageKey != "" {
  567. const prefix string = ",\"storageKey\":"
  568. if first {
  569. first = false
  570. out.RawString(prefix[1:])
  571. } else {
  572. out.RawString(prefix)
  573. }
  574. out.String(string(in.StorageKey))
  575. }
  576. if in.StorageBucket != nil {
  577. const prefix string = ",\"storageBucket\":"
  578. if first {
  579. first = false
  580. out.RawString(prefix[1:])
  581. } else {
  582. out.RawString(prefix)
  583. }
  584. (*in.StorageBucket).MarshalEasyJSON(out)
  585. }
  586. out.RawByte('}')
  587. }
  588. // MarshalJSON supports json.Marshaler interface
  589. func (v RequestCacheNamesParams) MarshalJSON() ([]byte, error) {
  590. w := jwriter.Writer{}
  591. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage5(&w, v)
  592. return w.Buffer.BuildBytes(), w.Error
  593. }
  594. // MarshalEasyJSON supports easyjson.Marshaler interface
  595. func (v RequestCacheNamesParams) MarshalEasyJSON(w *jwriter.Writer) {
  596. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage5(w, v)
  597. }
  598. // UnmarshalJSON supports json.Unmarshaler interface
  599. func (v *RequestCacheNamesParams) UnmarshalJSON(data []byte) error {
  600. r := jlexer.Lexer{Data: data}
  601. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage5(&r, v)
  602. return r.Error()
  603. }
  604. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  605. func (v *RequestCacheNamesParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  606. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage5(l, v)
  607. }
  608. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage6(in *jlexer.Lexer, out *Header) {
  609. isTopLevel := in.IsStart()
  610. if in.IsNull() {
  611. if isTopLevel {
  612. in.Consumed()
  613. }
  614. in.Skip()
  615. return
  616. }
  617. in.Delim('{')
  618. for !in.IsDelim('}') {
  619. key := in.UnsafeFieldName(false)
  620. in.WantColon()
  621. if in.IsNull() {
  622. in.Skip()
  623. in.WantComma()
  624. continue
  625. }
  626. switch key {
  627. case "name":
  628. out.Name = string(in.String())
  629. case "value":
  630. out.Value = string(in.String())
  631. default:
  632. in.SkipRecursive()
  633. }
  634. in.WantComma()
  635. }
  636. in.Delim('}')
  637. if isTopLevel {
  638. in.Consumed()
  639. }
  640. }
  641. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage6(out *jwriter.Writer, in Header) {
  642. out.RawByte('{')
  643. first := true
  644. _ = first
  645. {
  646. const prefix string = ",\"name\":"
  647. out.RawString(prefix[1:])
  648. out.String(string(in.Name))
  649. }
  650. {
  651. const prefix string = ",\"value\":"
  652. out.RawString(prefix)
  653. out.String(string(in.Value))
  654. }
  655. out.RawByte('}')
  656. }
  657. // MarshalJSON supports json.Marshaler interface
  658. func (v Header) MarshalJSON() ([]byte, error) {
  659. w := jwriter.Writer{}
  660. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage6(&w, v)
  661. return w.Buffer.BuildBytes(), w.Error
  662. }
  663. // MarshalEasyJSON supports easyjson.Marshaler interface
  664. func (v Header) MarshalEasyJSON(w *jwriter.Writer) {
  665. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage6(w, v)
  666. }
  667. // UnmarshalJSON supports json.Unmarshaler interface
  668. func (v *Header) UnmarshalJSON(data []byte) error {
  669. r := jlexer.Lexer{Data: data}
  670. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage6(&r, v)
  671. return r.Error()
  672. }
  673. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  674. func (v *Header) UnmarshalEasyJSON(l *jlexer.Lexer) {
  675. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage6(l, v)
  676. }
  677. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage7(in *jlexer.Lexer, out *DeleteEntryParams) {
  678. isTopLevel := in.IsStart()
  679. if in.IsNull() {
  680. if isTopLevel {
  681. in.Consumed()
  682. }
  683. in.Skip()
  684. return
  685. }
  686. in.Delim('{')
  687. for !in.IsDelim('}') {
  688. key := in.UnsafeFieldName(false)
  689. in.WantColon()
  690. if in.IsNull() {
  691. in.Skip()
  692. in.WantComma()
  693. continue
  694. }
  695. switch key {
  696. case "cacheId":
  697. out.CacheID = CacheID(in.String())
  698. case "request":
  699. out.Request = string(in.String())
  700. default:
  701. in.SkipRecursive()
  702. }
  703. in.WantComma()
  704. }
  705. in.Delim('}')
  706. if isTopLevel {
  707. in.Consumed()
  708. }
  709. }
  710. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage7(out *jwriter.Writer, in DeleteEntryParams) {
  711. out.RawByte('{')
  712. first := true
  713. _ = first
  714. {
  715. const prefix string = ",\"cacheId\":"
  716. out.RawString(prefix[1:])
  717. out.String(string(in.CacheID))
  718. }
  719. {
  720. const prefix string = ",\"request\":"
  721. out.RawString(prefix)
  722. out.String(string(in.Request))
  723. }
  724. out.RawByte('}')
  725. }
  726. // MarshalJSON supports json.Marshaler interface
  727. func (v DeleteEntryParams) MarshalJSON() ([]byte, error) {
  728. w := jwriter.Writer{}
  729. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage7(&w, v)
  730. return w.Buffer.BuildBytes(), w.Error
  731. }
  732. // MarshalEasyJSON supports easyjson.Marshaler interface
  733. func (v DeleteEntryParams) MarshalEasyJSON(w *jwriter.Writer) {
  734. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage7(w, v)
  735. }
  736. // UnmarshalJSON supports json.Unmarshaler interface
  737. func (v *DeleteEntryParams) UnmarshalJSON(data []byte) error {
  738. r := jlexer.Lexer{Data: data}
  739. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage7(&r, v)
  740. return r.Error()
  741. }
  742. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  743. func (v *DeleteEntryParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  744. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage7(l, v)
  745. }
  746. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage8(in *jlexer.Lexer, out *DeleteCacheParams) {
  747. isTopLevel := in.IsStart()
  748. if in.IsNull() {
  749. if isTopLevel {
  750. in.Consumed()
  751. }
  752. in.Skip()
  753. return
  754. }
  755. in.Delim('{')
  756. for !in.IsDelim('}') {
  757. key := in.UnsafeFieldName(false)
  758. in.WantColon()
  759. if in.IsNull() {
  760. in.Skip()
  761. in.WantComma()
  762. continue
  763. }
  764. switch key {
  765. case "cacheId":
  766. out.CacheID = CacheID(in.String())
  767. default:
  768. in.SkipRecursive()
  769. }
  770. in.WantComma()
  771. }
  772. in.Delim('}')
  773. if isTopLevel {
  774. in.Consumed()
  775. }
  776. }
  777. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage8(out *jwriter.Writer, in DeleteCacheParams) {
  778. out.RawByte('{')
  779. first := true
  780. _ = first
  781. {
  782. const prefix string = ",\"cacheId\":"
  783. out.RawString(prefix[1:])
  784. out.String(string(in.CacheID))
  785. }
  786. out.RawByte('}')
  787. }
  788. // MarshalJSON supports json.Marshaler interface
  789. func (v DeleteCacheParams) MarshalJSON() ([]byte, error) {
  790. w := jwriter.Writer{}
  791. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage8(&w, v)
  792. return w.Buffer.BuildBytes(), w.Error
  793. }
  794. // MarshalEasyJSON supports easyjson.Marshaler interface
  795. func (v DeleteCacheParams) MarshalEasyJSON(w *jwriter.Writer) {
  796. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage8(w, v)
  797. }
  798. // UnmarshalJSON supports json.Unmarshaler interface
  799. func (v *DeleteCacheParams) UnmarshalJSON(data []byte) error {
  800. r := jlexer.Lexer{Data: data}
  801. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage8(&r, v)
  802. return r.Error()
  803. }
  804. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  805. func (v *DeleteCacheParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  806. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage8(l, v)
  807. }
  808. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage9(in *jlexer.Lexer, out *DataEntry) {
  809. isTopLevel := in.IsStart()
  810. if in.IsNull() {
  811. if isTopLevel {
  812. in.Consumed()
  813. }
  814. in.Skip()
  815. return
  816. }
  817. in.Delim('{')
  818. for !in.IsDelim('}') {
  819. key := in.UnsafeFieldName(false)
  820. in.WantColon()
  821. if in.IsNull() {
  822. in.Skip()
  823. in.WantComma()
  824. continue
  825. }
  826. switch key {
  827. case "requestURL":
  828. out.RequestURL = string(in.String())
  829. case "requestMethod":
  830. out.RequestMethod = string(in.String())
  831. case "requestHeaders":
  832. if in.IsNull() {
  833. in.Skip()
  834. out.RequestHeaders = nil
  835. } else {
  836. in.Delim('[')
  837. if out.RequestHeaders == nil {
  838. if !in.IsDelim(']') {
  839. out.RequestHeaders = make([]*Header, 0, 8)
  840. } else {
  841. out.RequestHeaders = []*Header{}
  842. }
  843. } else {
  844. out.RequestHeaders = (out.RequestHeaders)[:0]
  845. }
  846. for !in.IsDelim(']') {
  847. var v10 *Header
  848. if in.IsNull() {
  849. in.Skip()
  850. v10 = nil
  851. } else {
  852. if v10 == nil {
  853. v10 = new(Header)
  854. }
  855. (*v10).UnmarshalEasyJSON(in)
  856. }
  857. out.RequestHeaders = append(out.RequestHeaders, v10)
  858. in.WantComma()
  859. }
  860. in.Delim(']')
  861. }
  862. case "responseTime":
  863. out.ResponseTime = float64(in.Float64())
  864. case "responseStatus":
  865. out.ResponseStatus = int64(in.Int64())
  866. case "responseStatusText":
  867. out.ResponseStatusText = string(in.String())
  868. case "responseType":
  869. (out.ResponseType).UnmarshalEasyJSON(in)
  870. case "responseHeaders":
  871. if in.IsNull() {
  872. in.Skip()
  873. out.ResponseHeaders = nil
  874. } else {
  875. in.Delim('[')
  876. if out.ResponseHeaders == nil {
  877. if !in.IsDelim(']') {
  878. out.ResponseHeaders = make([]*Header, 0, 8)
  879. } else {
  880. out.ResponseHeaders = []*Header{}
  881. }
  882. } else {
  883. out.ResponseHeaders = (out.ResponseHeaders)[:0]
  884. }
  885. for !in.IsDelim(']') {
  886. var v11 *Header
  887. if in.IsNull() {
  888. in.Skip()
  889. v11 = nil
  890. } else {
  891. if v11 == nil {
  892. v11 = new(Header)
  893. }
  894. (*v11).UnmarshalEasyJSON(in)
  895. }
  896. out.ResponseHeaders = append(out.ResponseHeaders, v11)
  897. in.WantComma()
  898. }
  899. in.Delim(']')
  900. }
  901. default:
  902. in.SkipRecursive()
  903. }
  904. in.WantComma()
  905. }
  906. in.Delim('}')
  907. if isTopLevel {
  908. in.Consumed()
  909. }
  910. }
  911. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage9(out *jwriter.Writer, in DataEntry) {
  912. out.RawByte('{')
  913. first := true
  914. _ = first
  915. {
  916. const prefix string = ",\"requestURL\":"
  917. out.RawString(prefix[1:])
  918. out.String(string(in.RequestURL))
  919. }
  920. {
  921. const prefix string = ",\"requestMethod\":"
  922. out.RawString(prefix)
  923. out.String(string(in.RequestMethod))
  924. }
  925. {
  926. const prefix string = ",\"requestHeaders\":"
  927. out.RawString(prefix)
  928. if in.RequestHeaders == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  929. out.RawString("null")
  930. } else {
  931. out.RawByte('[')
  932. for v12, v13 := range in.RequestHeaders {
  933. if v12 > 0 {
  934. out.RawByte(',')
  935. }
  936. if v13 == nil {
  937. out.RawString("null")
  938. } else {
  939. (*v13).MarshalEasyJSON(out)
  940. }
  941. }
  942. out.RawByte(']')
  943. }
  944. }
  945. {
  946. const prefix string = ",\"responseTime\":"
  947. out.RawString(prefix)
  948. out.Float64(float64(in.ResponseTime))
  949. }
  950. {
  951. const prefix string = ",\"responseStatus\":"
  952. out.RawString(prefix)
  953. out.Int64(int64(in.ResponseStatus))
  954. }
  955. {
  956. const prefix string = ",\"responseStatusText\":"
  957. out.RawString(prefix)
  958. out.String(string(in.ResponseStatusText))
  959. }
  960. {
  961. const prefix string = ",\"responseType\":"
  962. out.RawString(prefix)
  963. (in.ResponseType).MarshalEasyJSON(out)
  964. }
  965. {
  966. const prefix string = ",\"responseHeaders\":"
  967. out.RawString(prefix)
  968. if in.ResponseHeaders == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  969. out.RawString("null")
  970. } else {
  971. out.RawByte('[')
  972. for v14, v15 := range in.ResponseHeaders {
  973. if v14 > 0 {
  974. out.RawByte(',')
  975. }
  976. if v15 == nil {
  977. out.RawString("null")
  978. } else {
  979. (*v15).MarshalEasyJSON(out)
  980. }
  981. }
  982. out.RawByte(']')
  983. }
  984. }
  985. out.RawByte('}')
  986. }
  987. // MarshalJSON supports json.Marshaler interface
  988. func (v DataEntry) MarshalJSON() ([]byte, error) {
  989. w := jwriter.Writer{}
  990. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage9(&w, v)
  991. return w.Buffer.BuildBytes(), w.Error
  992. }
  993. // MarshalEasyJSON supports easyjson.Marshaler interface
  994. func (v DataEntry) MarshalEasyJSON(w *jwriter.Writer) {
  995. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage9(w, v)
  996. }
  997. // UnmarshalJSON supports json.Unmarshaler interface
  998. func (v *DataEntry) UnmarshalJSON(data []byte) error {
  999. r := jlexer.Lexer{Data: data}
  1000. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage9(&r, v)
  1001. return r.Error()
  1002. }
  1003. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  1004. func (v *DataEntry) UnmarshalEasyJSON(l *jlexer.Lexer) {
  1005. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage9(l, v)
  1006. }
  1007. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage10(in *jlexer.Lexer, out *CachedResponse) {
  1008. isTopLevel := in.IsStart()
  1009. if in.IsNull() {
  1010. if isTopLevel {
  1011. in.Consumed()
  1012. }
  1013. in.Skip()
  1014. return
  1015. }
  1016. in.Delim('{')
  1017. for !in.IsDelim('}') {
  1018. key := in.UnsafeFieldName(false)
  1019. in.WantColon()
  1020. if in.IsNull() {
  1021. in.Skip()
  1022. in.WantComma()
  1023. continue
  1024. }
  1025. switch key {
  1026. case "body":
  1027. out.Body = string(in.String())
  1028. default:
  1029. in.SkipRecursive()
  1030. }
  1031. in.WantComma()
  1032. }
  1033. in.Delim('}')
  1034. if isTopLevel {
  1035. in.Consumed()
  1036. }
  1037. }
  1038. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage10(out *jwriter.Writer, in CachedResponse) {
  1039. out.RawByte('{')
  1040. first := true
  1041. _ = first
  1042. {
  1043. const prefix string = ",\"body\":"
  1044. out.RawString(prefix[1:])
  1045. out.String(string(in.Body))
  1046. }
  1047. out.RawByte('}')
  1048. }
  1049. // MarshalJSON supports json.Marshaler interface
  1050. func (v CachedResponse) MarshalJSON() ([]byte, error) {
  1051. w := jwriter.Writer{}
  1052. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage10(&w, v)
  1053. return w.Buffer.BuildBytes(), w.Error
  1054. }
  1055. // MarshalEasyJSON supports easyjson.Marshaler interface
  1056. func (v CachedResponse) MarshalEasyJSON(w *jwriter.Writer) {
  1057. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage10(w, v)
  1058. }
  1059. // UnmarshalJSON supports json.Unmarshaler interface
  1060. func (v *CachedResponse) UnmarshalJSON(data []byte) error {
  1061. r := jlexer.Lexer{Data: data}
  1062. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage10(&r, v)
  1063. return r.Error()
  1064. }
  1065. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  1066. func (v *CachedResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
  1067. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage10(l, v)
  1068. }
  1069. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage11(in *jlexer.Lexer, out *Cache) {
  1070. isTopLevel := in.IsStart()
  1071. if in.IsNull() {
  1072. if isTopLevel {
  1073. in.Consumed()
  1074. }
  1075. in.Skip()
  1076. return
  1077. }
  1078. in.Delim('{')
  1079. for !in.IsDelim('}') {
  1080. key := in.UnsafeFieldName(false)
  1081. in.WantColon()
  1082. if in.IsNull() {
  1083. in.Skip()
  1084. in.WantComma()
  1085. continue
  1086. }
  1087. switch key {
  1088. case "cacheId":
  1089. out.CacheID = CacheID(in.String())
  1090. case "securityOrigin":
  1091. out.SecurityOrigin = string(in.String())
  1092. case "storageKey":
  1093. out.StorageKey = string(in.String())
  1094. case "storageBucket":
  1095. if in.IsNull() {
  1096. in.Skip()
  1097. out.StorageBucket = nil
  1098. } else {
  1099. if out.StorageBucket == nil {
  1100. out.StorageBucket = new(storage.Bucket)
  1101. }
  1102. (*out.StorageBucket).UnmarshalEasyJSON(in)
  1103. }
  1104. case "cacheName":
  1105. out.CacheName = string(in.String())
  1106. default:
  1107. in.SkipRecursive()
  1108. }
  1109. in.WantComma()
  1110. }
  1111. in.Delim('}')
  1112. if isTopLevel {
  1113. in.Consumed()
  1114. }
  1115. }
  1116. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage11(out *jwriter.Writer, in Cache) {
  1117. out.RawByte('{')
  1118. first := true
  1119. _ = first
  1120. {
  1121. const prefix string = ",\"cacheId\":"
  1122. out.RawString(prefix[1:])
  1123. out.String(string(in.CacheID))
  1124. }
  1125. {
  1126. const prefix string = ",\"securityOrigin\":"
  1127. out.RawString(prefix)
  1128. out.String(string(in.SecurityOrigin))
  1129. }
  1130. {
  1131. const prefix string = ",\"storageKey\":"
  1132. out.RawString(prefix)
  1133. out.String(string(in.StorageKey))
  1134. }
  1135. if in.StorageBucket != nil {
  1136. const prefix string = ",\"storageBucket\":"
  1137. out.RawString(prefix)
  1138. (*in.StorageBucket).MarshalEasyJSON(out)
  1139. }
  1140. {
  1141. const prefix string = ",\"cacheName\":"
  1142. out.RawString(prefix)
  1143. out.String(string(in.CacheName))
  1144. }
  1145. out.RawByte('}')
  1146. }
  1147. // MarshalJSON supports json.Marshaler interface
  1148. func (v Cache) MarshalJSON() ([]byte, error) {
  1149. w := jwriter.Writer{}
  1150. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage11(&w, v)
  1151. return w.Buffer.BuildBytes(), w.Error
  1152. }
  1153. // MarshalEasyJSON supports easyjson.Marshaler interface
  1154. func (v Cache) MarshalEasyJSON(w *jwriter.Writer) {
  1155. easyjsonC5a4559bEncodeGithubComChromedpCdprotoCachestorage11(w, v)
  1156. }
  1157. // UnmarshalJSON supports json.Unmarshaler interface
  1158. func (v *Cache) UnmarshalJSON(data []byte) error {
  1159. r := jlexer.Lexer{Data: data}
  1160. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage11(&r, v)
  1161. return r.Error()
  1162. }
  1163. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  1164. func (v *Cache) UnmarshalEasyJSON(l *jlexer.Lexer) {
  1165. easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage11(l, v)
  1166. }