// Code generated by github.com/actgardner/gogen-avro/v10. DO NOT EDIT.
/*
 * SOURCE:
 *     schema.avsc
 */
package avro

import (
	"encoding/json"
	"io"

	"github.com/actgardner/gogen-avro/v10/util"
	"github.com/actgardner/gogen-avro/v10/vm/types"
)

func writeTestFixedDefaultType(r TestFixedDefaultType, w io.Writer) error {
	_, err := w.Write(r[:])
	return err
}

type TestFixedDefaultTypeWrapper struct {
	Target *TestFixedDefaultType
}

type TestFixedDefaultType [12]byte

func (b *TestFixedDefaultType) UnmarshalJSON(data []byte) error {
	var s string
	if err := json.Unmarshal(data, &s); err != nil {
		return err
	}
	codepoints := util.DecodeByteString(s)
	copy((*b)[:], codepoints)
	return nil
}

func (b TestFixedDefaultType) MarshalJSON() ([]byte, error) {
	return []byte(util.EncodeByteString(b[:])), nil
}

func (_ TestFixedDefaultTypeWrapper) SetBoolean(v bool)   { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) SetInt(v int32)      { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) SetLong(v int64)     { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) SetFloat(v float32)  { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) SetDouble(v float64) { panic("Unsupported operation") }
func (r TestFixedDefaultTypeWrapper) SetBytes(v []byte) {
	copy((*r.Target)[:], v)
}
func (_ TestFixedDefaultTypeWrapper) SetString(v string)    { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) SetUnionElem(v int64)  { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) Get(i int) types.Field { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) AppendMap(key string) types.Field {
	panic("Unsupported operation")
}
func (_ TestFixedDefaultTypeWrapper) AppendArray() types.Field { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) NullField(int)            { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) HintSize(int)             { panic("Unsupported operation") }
func (_ TestFixedDefaultTypeWrapper) Finalize()                {}
func (_ TestFixedDefaultTypeWrapper) SetDefault(i int)         { panic("Unsupported operation") }
