github.com/antihax/goesi@v0.0.0-20240126031043-6c54d0cb7f95/meta/model_get_verify_ok_easyjson.go (about) 1 // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. 2 3 package meta 4 5 import ( 6 json "encoding/json" 7 8 easyjson "github.com/mailru/easyjson" 9 jlexer "github.com/mailru/easyjson/jlexer" 10 jwriter "github.com/mailru/easyjson/jwriter" 11 ) 12 13 // suppress unused package warning 14 var ( 15 _ *json.RawMessage 16 _ *jlexer.Lexer 17 _ *jwriter.Writer 18 _ easyjson.Marshaler 19 ) 20 21 func easyjson8356b13dDecodeGithubComAntihaxGoesiMeta(in *jlexer.Lexer, out *GetVerifyOkList) { 22 isTopLevel := in.IsStart() 23 if in.IsNull() { 24 in.Skip() 25 *out = nil 26 } else { 27 in.Delim('[') 28 if *out == nil { 29 if !in.IsDelim(']') { 30 *out = make(GetVerifyOkList, 0, 0) 31 } else { 32 *out = GetVerifyOkList{} 33 } 34 } else { 35 *out = (*out)[:0] 36 } 37 for !in.IsDelim(']') { 38 var v1 GetVerifyOk 39 (v1).UnmarshalEasyJSON(in) 40 *out = append(*out, v1) 41 in.WantComma() 42 } 43 in.Delim(']') 44 } 45 if isTopLevel { 46 in.Consumed() 47 } 48 } 49 func easyjson8356b13dEncodeGithubComAntihaxGoesiMeta(out *jwriter.Writer, in GetVerifyOkList) { 50 if in == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { 51 out.RawString("null") 52 } else { 53 out.RawByte('[') 54 for v2, v3 := range in { 55 if v2 > 0 { 56 out.RawByte(',') 57 } 58 (v3).MarshalEasyJSON(out) 59 } 60 out.RawByte(']') 61 } 62 } 63 64 // MarshalJSON supports json.Marshaler interface 65 func (v GetVerifyOkList) MarshalJSON() ([]byte, error) { 66 w := jwriter.Writer{} 67 easyjson8356b13dEncodeGithubComAntihaxGoesiMeta(&w, v) 68 return w.Buffer.BuildBytes(), w.Error 69 } 70 71 // MarshalEasyJSON supports easyjson.Marshaler interface 72 func (v GetVerifyOkList) MarshalEasyJSON(w *jwriter.Writer) { 73 easyjson8356b13dEncodeGithubComAntihaxGoesiMeta(w, v) 74 } 75 76 // UnmarshalJSON supports json.Unmarshaler interface 77 func (v *GetVerifyOkList) UnmarshalJSON(data []byte) error { 78 r := jlexer.Lexer{Data: data} 79 easyjson8356b13dDecodeGithubComAntihaxGoesiMeta(&r, v) 80 return r.Error() 81 } 82 83 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 84 func (v *GetVerifyOkList) UnmarshalEasyJSON(l *jlexer.Lexer) { 85 easyjson8356b13dDecodeGithubComAntihaxGoesiMeta(l, v) 86 } 87 func easyjson8356b13dDecodeGithubComAntihaxGoesiMeta1(in *jlexer.Lexer, out *GetVerifyOk) { 88 isTopLevel := in.IsStart() 89 if in.IsNull() { 90 if isTopLevel { 91 in.Consumed() 92 } 93 in.Skip() 94 return 95 } 96 in.Delim('{') 97 for !in.IsDelim('}') { 98 key := in.UnsafeFieldName(false) 99 in.WantColon() 100 if in.IsNull() { 101 in.Skip() 102 in.WantComma() 103 continue 104 } 105 switch key { 106 case "CharacterID": 107 out.CharacterID = int32(in.Int32()) 108 case "CharacterName": 109 out.CharacterName = string(in.String()) 110 case "CharacterOwnerHash": 111 out.CharacterOwnerHash = string(in.String()) 112 case "ExpiresOn": 113 out.ExpiresOn = string(in.String()) 114 case "IntellectualProperty": 115 out.IntellectualProperty = string(in.String()) 116 case "Scopes": 117 out.Scopes = string(in.String()) 118 case "TokenType": 119 out.TokenType = string(in.String()) 120 default: 121 in.SkipRecursive() 122 } 123 in.WantComma() 124 } 125 in.Delim('}') 126 if isTopLevel { 127 in.Consumed() 128 } 129 } 130 func easyjson8356b13dEncodeGithubComAntihaxGoesiMeta1(out *jwriter.Writer, in GetVerifyOk) { 131 out.RawByte('{') 132 first := true 133 _ = first 134 if in.CharacterID != 0 { 135 const prefix string = ",\"CharacterID\":" 136 first = false 137 out.RawString(prefix[1:]) 138 out.Int32(int32(in.CharacterID)) 139 } 140 if in.CharacterName != "" { 141 const prefix string = ",\"CharacterName\":" 142 if first { 143 first = false 144 out.RawString(prefix[1:]) 145 } else { 146 out.RawString(prefix) 147 } 148 out.String(string(in.CharacterName)) 149 } 150 if in.CharacterOwnerHash != "" { 151 const prefix string = ",\"CharacterOwnerHash\":" 152 if first { 153 first = false 154 out.RawString(prefix[1:]) 155 } else { 156 out.RawString(prefix) 157 } 158 out.String(string(in.CharacterOwnerHash)) 159 } 160 if in.ExpiresOn != "" { 161 const prefix string = ",\"ExpiresOn\":" 162 if first { 163 first = false 164 out.RawString(prefix[1:]) 165 } else { 166 out.RawString(prefix) 167 } 168 out.String(string(in.ExpiresOn)) 169 } 170 if in.IntellectualProperty != "" { 171 const prefix string = ",\"IntellectualProperty\":" 172 if first { 173 first = false 174 out.RawString(prefix[1:]) 175 } else { 176 out.RawString(prefix) 177 } 178 out.String(string(in.IntellectualProperty)) 179 } 180 if in.Scopes != "" { 181 const prefix string = ",\"Scopes\":" 182 if first { 183 first = false 184 out.RawString(prefix[1:]) 185 } else { 186 out.RawString(prefix) 187 } 188 out.String(string(in.Scopes)) 189 } 190 if in.TokenType != "" { 191 const prefix string = ",\"TokenType\":" 192 if first { 193 first = false 194 out.RawString(prefix[1:]) 195 } else { 196 out.RawString(prefix) 197 } 198 out.String(string(in.TokenType)) 199 } 200 out.RawByte('}') 201 } 202 203 // MarshalJSON supports json.Marshaler interface 204 func (v GetVerifyOk) MarshalJSON() ([]byte, error) { 205 w := jwriter.Writer{} 206 easyjson8356b13dEncodeGithubComAntihaxGoesiMeta1(&w, v) 207 return w.Buffer.BuildBytes(), w.Error 208 } 209 210 // MarshalEasyJSON supports easyjson.Marshaler interface 211 func (v GetVerifyOk) MarshalEasyJSON(w *jwriter.Writer) { 212 easyjson8356b13dEncodeGithubComAntihaxGoesiMeta1(w, v) 213 } 214 215 // UnmarshalJSON supports json.Unmarshaler interface 216 func (v *GetVerifyOk) UnmarshalJSON(data []byte) error { 217 r := jlexer.Lexer{Data: data} 218 easyjson8356b13dDecodeGithubComAntihaxGoesiMeta1(&r, v) 219 return r.Error() 220 } 221 222 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 223 func (v *GetVerifyOk) UnmarshalEasyJSON(l *jlexer.Lexer) { 224 easyjson8356b13dDecodeGithubComAntihaxGoesiMeta1(l, v) 225 }