// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.

package audit

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 easyjsonF2c44427EncodeAudit(out *jwriter.Writer, in event) {
	out.RawByte('{')
	first := true
	_ = first
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"start\":")
	out.Raw((in.Start).MarshalJSON())
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"end\":")
	out.Raw((in.End).MarshalJSON())
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"cost\":")
	out.Int64(int64(in.Cost))
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"user\":")
	out.String(string(in.User))
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"user_host\":")
	out.String(string(in.UserHost))
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"thread_id\":")
	out.Uint32(uint32(in.ThreadID))
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"command_type\":")
	out.String(string(in.CommandType))
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"argument\":")
	out.String(string(in.Argument))
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"status\":")
	out.Uint32(uint32(in.Status))
	if !first {
		out.RawByte(',')
	}
	first = false
	out.RawString("\"query_rows\":")
	out.Uint64(uint64(in.QueryRows))
	out.RawByte('}')
}

// MarshalJSON supports json.Marshaler interface
func (v event) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonF2c44427EncodeAudit(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
