bulk_delete_request_easyjson.go 5.3 KB

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