Debian Codegraph @

bulk_delete_request_easyjson.go

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