// MarshalLayout encodes a layout to binary protobuf format.
545089
func MarshalLayout(l chronograf.Layout) ([]byte, error) {
	cells := make([]*Cell, len(l.Cells))
	for i, c := range l.Cells {
		queries := make([]*Query, len(c.Queries))
		for j, q := range c.Queries {
			r := new(Range)
			if q.Range != nil {
				r.Upper, r.Lower = q.Range.Upper, q.Range.Lower
			}
			queries[j] = &Query{
				Command:  q.Command,
				DB:       q.DB,
				RP:       q.RP,
				GroupBys: q.GroupBys,
				Wheres:   q.Wheres,
				Label:    q.Label,
				Range:    r,
			}
		}

		axes := make(map[string]*Axis, len(c.Axes))
		for a, r := range c.Axes {
			axes[a] = &Axis{
				Bounds: r.Bounds,
				Label:  r.Label,
			}
		}

		cells[i] = &Cell{
			X:       c.X,
			Y:       c.Y,
			W:       c.W,
			H:       c.H,
			I:       c.I,
			Name:    c.Name,
			Queries: queries,
			Type:    c.Type,
			Axes:    axes,
		}
	}
	return proto.Marshal(&Layout{
		ID:          l.ID,
		Measurement: l.Measurement,
		Application: l.Application,
		Autoflow:    l.Autoflow,
		Cells:       cells,
	})
}
20877
func (v *LargeDeltas) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.B1 != nil {
		err = multierr.Append(err, enc.AddObject("b1", v.B1))
	}
	if v.B10 != nil {
		err = multierr.Append(err, enc.AddObject("b10", v.B10))
	}
	if v.B100 != nil {
		err = multierr.Append(err, enc.AddObject("b100", v.B100))
	}
	if v.CheckTrue != nil {
		enc.AddBool("check_true", *v.CheckTrue)
	}
	if v.B1000 != nil {
		err = multierr.Append(err, enc.AddObject("b1000", v.B1000))
	}
	if v.CheckFalse != nil {
		enc.AddBool("check_false", *v.CheckFalse)
	}
	if v.Vertwo2000 != nil {
		err = multierr.Append(err, enc.AddObject("vertwo2000", v.Vertwo2000))
	}
	if v.ASet2500 != nil {
		err = multierr.Append(err, enc.AddArray("a_set2500", (_Set_String_Zapper)(v.ASet2500)))
	}
	if v.Vertwo3000 != nil {
		err = multierr.Append(err, enc.AddObject("vertwo3000", v.Vertwo3000))
	}
	if v.BigNumbers != nil {
		err = multierr.Append(err, enc.AddArray("big_numbers", (_List_I32_Zapper)(v.BigNumbers)))
	}
	return err
}
904024
func (v *Hello_Echo_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Echo != nil {
		err = multierr.Append(err, enc.AddObject("echo", v.Echo))
	}
	return err
}
29595
func (v *Xception2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ErrorCode != nil {
		enc.AddInt32("errorCode", *v.ErrorCode)
	}
	if v.StructThing != nil {
		err = multierr.Append(err, enc.AddObject("struct_thing", v.StructThing))
	}
	return err
}
1053949
func (l CFList) MarshalBinary() ([]byte, error) {
	out := make([]byte, 16)

	b, err := l.Payload.MarshalBinary()
	if err != nil {
		return nil, err
	}
	copy(out, b)
	out[15] = byte(l.CFListType)

	return out, nil
}
1292092
func (v *HandshakeRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	return err
}
978333
func (v *Plugin_Handshake_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Success != nil {
		err = multierr.Append(err, enc.AddObject("success", v.Success))
	}
	return err
}
836501
func (v *Xception) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ErrorCode != nil {
		enc.AddInt32("errorCode", *v.ErrorCode)
	}
	if v.Message != nil {
		enc.AddString("message", *v.Message)
	}
	return err
}
390410
func (p PingSlotChannelAnsPayload) MarshalBinary() ([]byte, error) {
	var b byte
	if p.ChannelFrequencyOK {
		b = (1 << 0)
	}
	if p.DataRateOK {
		b = b | (1 << 1)
	}

	return []byte{b}, nil
}
639900
func (v *Ping) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("beep", v.Beep)
	return err
}
1122484
func (v _Map_Numberz_UserId_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	err = multierr.Append(err, enc.AddObject("key", v.Key))
	enc.AddInt64("value", (int64)(v.Value))
	return err
}
568110
func (v MediumPayload) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonB0500db0EncodeGithubComFrancoispqtGojayBenchmarks(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
610639
func (p LinkCheckAnsPayload) MarshalBinary() ([]byte, error) {
	return []byte{byte(p.Margin), byte(p.GwCnt)}, nil
}
1071161
func (v *HandshakeResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("name", v.Name)
	enc.AddInt32("apiVersion", v.APIVersion)
	err = multierr.Append(err, enc.AddArray("features", (_List_Feature_Zapper)(v.Features)))
	if v.LibraryVersion != nil {
		enc.AddString("libraryVersion", *v.LibraryVersion)
	}
	return err
}
936620
func (m *Prefilter) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
733166
func MarshalBuild(b chronograf.BuildInfo) ([]byte, error) {
	return proto.Marshal(&BuildInfo{
		Version: b.Version,
		Commit:  b.Commit,
	})
}
1161346
func (v *Bonk) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Message != nil {
		enc.AddString("message", *v.Message)
	}
	if v.Type != nil {
		enc.AddInt32("type", *v.Type)
	}
	return err
}