// WriteValue writes the given Thrift value to the underlying stream using the
// Thrift Binary Protocol.
546204
func (bw *Writer) WriteValue(v wire.Value) error {
	switch v.Type() {
	case wire.TBool:
		if v.GetBool() {
			return bw.writeByte(1)
		}
		return bw.writeByte(0)

	case wire.TI8:
		return bw.writeByte(byte(v.GetI8()))

	case wire.TDouble:
		value := math.Float64bits(v.GetDouble())
		return bw.writeInt64(int64(value))

	case wire.TI16:
		return bw.writeInt16(v.GetI16())

	case wire.TI32:
		return bw.writeInt32(v.GetI32())

	case wire.TI64:
		return bw.writeInt64(v.GetI64())

	case wire.TBinary:
		b := v.GetBinary()
		if err := bw.writeInt32(int32(len(b))); err != nil {
			return err
		}
		return bw.write(b)

	case wire.TStruct:
		return bw.writeStruct(v.GetStruct())

	case wire.TMap:
		return bw.writeMap(v.GetMap())

	case wire.TSet:
		return bw.writeSet(v.GetSet())

	case wire.TList:
		return bw.writeList(v.GetList())

	default:
		return fmt.Errorf("unknown ttype %v", v.Type())
	}
}
203803
func (s *CacheNodeTypeSpecificValue) SetValue(v string) *CacheNodeTypeSpecificValue {
	s.Value = &v
	return s
}
686599
func (s *RecordTag) SetValue(v string) *RecordTag {
	s.Value = &v
	return s
}
565553
func (s *HistogramEntry) SetValue(v float64) *HistogramEntry {
	s.Value = &v
	return s
}
1231921
func (s *ListRecordHistorySearchFilter) SetValue(v string) *ListRecordHistorySearchFilter {
	s.Value = &v
	return s
}
121850
func (m *MonitorValues) FlattenDiskWriteValue() ([]FlatMonitorValue, error) {
	return m.flattenValue(func(v *MonitorValue) *float64 { return v.Write })
}
98124
func ToValue(value interface{}) (Value, error) {
	result := Value{}
	err := catchPanic(func() {
		result = toValue(value)
	})
	return result, err
}
651699
func (s *FileSystemSize) SetValue(v int64) *FileSystemSize {
	s.Value = &v
	return s
}
368021
func (l *ByteIntervalList) insertValue(v ByteInterval, at *ByteIntervalElement) *ByteIntervalElement {
	return l.insert(&ByteIntervalElement{Value: v}, at)
}
447529
func (s *AttributeType) SetValue(v string) *AttributeType {
	s.Value = &v
	return s
}
92931
func StringValue(i interface{}) string {
	var buf bytes.Buffer
	stringValue(reflect.ValueOf(i), 0, &buf)
	return buf.String()
}
656997
func (all *assetLruList) insertValue(v *assetLruListEntry, at *assetLruListElement) *assetLruListElement {
	return all.insert(&assetLruListElement{Value: v}, at)
}
1041496
func (w *ByteWriter) MustWriteVal(val interface{}, offset int) int {
	if off, err := w.WriteVal(val, offset); err != nil {
		panic(err)
	} else {
		return off
	}
}
903887
func (s *CreateApiKeyInput) SetValue(v string) *CreateApiKeyInput {
	s.Value = &v
	return s
}
521688
func (s *Ssml) SetValue(v string) *Ssml {
	s.Value = &v
	return s
}
1217331
func (s *ProvisioningParameter) SetValue(v string) *ProvisioningParameter {
	s.Value = &v
	return s
}
133898
func (l *PacketIntervalList) insertValue(v PacketInterval, at *PacketIntervalElement) *PacketIntervalElement {
	return l.insert(&PacketIntervalElement{Value: v}, at)
}