123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
- package model
- import (
- json "encoding/json"
- easyjson "github.com/mailru/easyjson"
- jlexer "github.com/mailru/easyjson/jlexer"
- jwriter "github.com/mailru/easyjson/jwriter"
- )
- // suppress unused package warning
- var (
- _ *json.RawMessage
- _ *jlexer.Lexer
- _ *jwriter.Writer
- _ easyjson.Marshaler
- )
- func easyjson142f204aDecodeGitBeejayKimCraftApiModel(in *jlexer.Lexer, out *PageInfo) {
- isTopLevel := in.IsStart()
- if in.IsNull() {
- if isTopLevel {
- in.Consumed()
- }
- in.Skip()
- return
- }
- in.Delim('{')
- for !in.IsDelim('}') {
- key := in.UnsafeFieldName(false)
- in.WantColon()
- if in.IsNull() {
- in.Skip()
- in.WantComma()
- continue
- }
- switch key {
- case "total":
- out.Total = int(in.Int())
- case "start_cursor":
- if in.IsNull() {
- in.Skip()
- out.StartCursor = nil
- } else {
- if out.StartCursor == nil {
- out.StartCursor = new(string)
- }
- *out.StartCursor = string(in.String())
- }
- case "end_cursor":
- if in.IsNull() {
- in.Skip()
- out.EndCursor = nil
- } else {
- if out.EndCursor == nil {
- out.EndCursor = new(string)
- }
- *out.EndCursor = string(in.String())
- }
- case "has_next_page":
- out.HasNextPage = bool(in.Bool())
- case "has_previous_page":
- out.HasPreviousPage = bool(in.Bool())
- default:
- in.SkipRecursive()
- }
- in.WantComma()
- }
- in.Delim('}')
- if isTopLevel {
- in.Consumed()
- }
- }
- func easyjson142f204aEncodeGitBeejayKimCraftApiModel(out *jwriter.Writer, in PageInfo) {
- out.RawByte('{')
- first := true
- _ = first
- {
- const prefix string = ",\"total\":"
- out.RawString(prefix[1:])
- out.Int(int(in.Total))
- }
- if in.StartCursor != nil {
- const prefix string = ",\"start_cursor\":"
- out.RawString(prefix)
- out.String(string(*in.StartCursor))
- }
- if in.EndCursor != nil {
- const prefix string = ",\"end_cursor\":"
- out.RawString(prefix)
- out.String(string(*in.EndCursor))
- }
- {
- const prefix string = ",\"has_next_page\":"
- out.RawString(prefix)
- out.Bool(bool(in.HasNextPage))
- }
- {
- const prefix string = ",\"has_previous_page\":"
- out.RawString(prefix)
- out.Bool(bool(in.HasPreviousPage))
- }
- out.RawByte('}')
- }
- // MarshalJSON supports json.Marshaler interface
- func (v PageInfo) MarshalJSON() ([]byte, error) {
- w := jwriter.Writer{}
- easyjson142f204aEncodeGitBeejayKimCraftApiModel(&w, v)
- return w.Buffer.BuildBytes(), w.Error
- }
- // MarshalEasyJSON supports easyjson.Marshaler interface
- func (v PageInfo) MarshalEasyJSON(w *jwriter.Writer) {
- easyjson142f204aEncodeGitBeejayKimCraftApiModel(w, v)
- }
- // UnmarshalJSON supports json.Unmarshaler interface
- func (v *PageInfo) UnmarshalJSON(data []byte) error {
- r := jlexer.Lexer{Data: data}
- easyjson142f204aDecodeGitBeejayKimCraftApiModel(&r, v)
- return r.Error()
- }
- // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
- func (v *PageInfo) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjson142f204aDecodeGitBeejayKimCraftApiModel(l, v)
- }
|