xmidt-org/wrp-go

View on GitHub
messages_codec.go

Summary

Maintainability
F
2 mos
Test Coverage
//go:build go1.6
// +build go1.6

// Code generated by codecgen - DO NOT EDIT.

package wrp

import (
    "errors"
    codec1978 "github.com/ugorji/go/codec"
    "runtime"
    "sort"
    "strconv"
)

const (
    // ----- content types ----
    codecSelferCcUTF83232 = 1
    codecSelferCcRAW3232  = 255
    // ----- value types used ----
    codecSelferValueTypeArray3232     = 10
    codecSelferValueTypeMap3232       = 9
    codecSelferValueTypeString3232    = 6
    codecSelferValueTypeInt3232       = 2
    codecSelferValueTypeUint3232      = 3
    codecSelferValueTypeFloat3232     = 4
    codecSelferValueTypeNil3232       = 1
    codecSelferBitsize3232            = uint8(32 << (^uint(0) >> 63))
    codecSelferDecContainerLenNil3232 = -2147483648
)

var (
    errCodecSelferOnlyMapOrArrayEncodeToStruct3232                = errors.New(`only encoded map or array can be decoded into a struct`)
    _                                              sort.Interface = nil
)

type codecSelfer3232 struct{}

func codecSelfer3232False() bool { return false }
func codecSelfer3232True() bool  { return true }

type codecSelfer3232stringSlice []string

func (p codecSelfer3232stringSlice) Len() int           { return len(p) }
func (p codecSelfer3232stringSlice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
func (p codecSelfer3232stringSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] }

type codecSelfer3232uint64Slice []uint64

func (p codecSelfer3232uint64Slice) Len() int           { return len(p) }
func (p codecSelfer3232uint64Slice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
func (p codecSelfer3232uint64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] }

type codecSelfer3232int64Slice []int64

func (p codecSelfer3232int64Slice) Len() int           { return len(p) }
func (p codecSelfer3232int64Slice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
func (p codecSelfer3232int64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] }

type codecSelfer3232float64Slice []float64

func (p codecSelfer3232float64Slice) Len() int           { return len(p) }
func (p codecSelfer3232float64Slice) Swap(i, j int)      { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
func (p codecSelfer3232float64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] }

func init() {
    if codec1978.GenVersion != 28 {
        _, file, _, _ := runtime.Caller(0)
        ver := strconv.FormatInt(int64(codec1978.GenVersion), 10)
        panic(errors.New("codecgen version mismatch: current: 28, need " + ver + ". Re-generate file: " + file))
    }
}

func (Message) codecSelferViaCodecgen() {}
func (x *Message) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
        z.EncEncode(x)
        return
    }
    if x == nil {
        r.EncodeNil()
    } else {
        yy2arr2 := z.EncBasicHandle().StructToArray
        _ = yy2arr2
        const yyr2 bool = false // struct tag has 'toArray'
        var yyn9 bool = x.Status == nil
        var yyn10 bool = x.RequestDeliveryResponse == nil
        var yyn14 bool = x.IncludeSpans == nil
        var yyq2 = [19]bool{ // should field at this index be written?
            true,                             // msg_type
            x.Source != "",                   // source
            x.Destination != "",              // dest
            x.TransactionUUID != "",          // transaction_uuid
            x.ContentType != "",              // content_type
            x.Accept != "",                   // accept
            x.Status != nil,                  // status
            x.RequestDeliveryResponse != nil, // rdr
            len(x.Headers) != 0,              // headers
            len(x.Metadata) != 0,             // metadata
            len(x.Spans) != 0,                // spans
            x.IncludeSpans != nil,            // include_spans
            x.Path != "",                     // path
            len(x.Payload) != 0,              // payload
            x.ServiceName != "",              // service_name
            x.URL != "",                      // url
            len(x.PartnerIDs) != 0,           // partner_ids
            x.SessionID != "",                // session_id
            true,                             // qos
        }
        _ = yyq2
        if yyr2 || yy2arr2 {
            z.EncWriteArrayStart(19)
            z.EncWriteArrayElem()
            if yyxt22 := z.Extension(x.Type); yyxt22 != nil {
                z.EncExtension(x.Type, yyxt22)
            } else {
                r.EncodeInt(int64(x.Type))
            }
            z.EncWriteArrayElem()
            if yyq2[1] {
                r.EncodeString(string(x.Source))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[2] {
                r.EncodeString(string(x.Destination))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[3] {
                r.EncodeString(string(x.TransactionUUID))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[4] {
                r.EncodeString(string(x.ContentType))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[5] {
                r.EncodeString(string(x.Accept))
            } else {
                r.EncodeString("")
            }
            if yyn9 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[6] {
                    yy28 := *x.Status
                    r.EncodeInt(int64(yy28))
                } else {
                    r.EncodeNil()
                }
            }
            if yyn10 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[7] {
                    yy30 := *x.RequestDeliveryResponse
                    r.EncodeInt(int64(yy30))
                } else {
                    r.EncodeNil()
                }
            }
            z.EncWriteArrayElem()
            if yyq2[8] {
                if x.Headers == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncSliceStringV(x.Headers, e)
                } // end block: if x.Headers slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[9] {
                if x.Metadata == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncMapStringStringV(x.Metadata, e)
                } // end block: if x.Metadata map == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[10] {
                if x.Spans == nil {
                    r.EncodeNil()
                } else {
                    h.encSliceSlicestring(([][]string)(x.Spans), e)
                } // end block: if x.Spans slice == nil
            } else {
                r.EncodeNil()
            }
            if yyn14 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[11] {
                    yy35 := *x.IncludeSpans
                    r.EncodeBool(bool(yy35))
                } else {
                    r.EncodeNil()
                }
            }
            z.EncWriteArrayElem()
            if yyq2[12] {
                r.EncodeString(string(x.Path))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[13] {
                if x.Payload == nil {
                    r.EncodeNil()
                } else {
                    r.EncodeStringBytesRaw([]byte(x.Payload))
                } // end block: if x.Payload slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[14] {
                r.EncodeString(string(x.ServiceName))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[15] {
                r.EncodeString(string(x.URL))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[16] {
                if x.PartnerIDs == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncSliceStringV(x.PartnerIDs, e)
                } // end block: if x.PartnerIDs slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[17] {
                r.EncodeString(string(x.SessionID))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyxt43 := z.Extension(x.QualityOfService); yyxt43 != nil {
                z.EncExtension(x.QualityOfService, yyxt43)
            } else {
                r.EncodeInt(int64(x.QualityOfService))
            }
            z.EncWriteArrayEnd()
        } else {
            var yynn2 int
            for _, b := range yyq2 {
                if b {
                    yynn2++
                }
            }
            z.EncWriteMapStart(yynn2)
            yynn2 = 0
            if z.EncBasicHandle().Canonical {
                if yyq2[5] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"accept\"")
                    } else {
                        r.EncodeString(`accept`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Accept))
                }
                if yyq2[4] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`content_type`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ContentType))
                }
                if yyq2[2] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"dest\"")
                    } else {
                        r.EncodeString(`dest`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Destination))
                }
                if yyq2[8] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"headers\"")
                    } else {
                        r.EncodeString(`headers`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Headers == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.Headers, e)
                    } // end block: if x.Headers slice == nil
                }
                if yyq2[11] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`include_spans`)
                    z.EncWriteMapElemValue()
                    if yyn14 {
                        r.EncodeNil()
                    } else {
                        yy48 := *x.IncludeSpans
                        r.EncodeBool(bool(yy48))
                    }
                }
                if yyq2[9] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"metadata\"")
                    } else {
                        r.EncodeString(`metadata`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Metadata == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncMapStringStringV(x.Metadata, e)
                    } // end block: if x.Metadata map == nil
                }
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt51 := z.Extension(x.Type); yyxt51 != nil {
                    z.EncExtension(x.Type, yyxt51)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                if yyq2[16] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`partner_ids`)
                    z.EncWriteMapElemValue()
                    if x.PartnerIDs == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.PartnerIDs, e)
                    } // end block: if x.PartnerIDs slice == nil
                }
                if yyq2[12] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"path\"")
                    } else {
                        r.EncodeString(`path`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Path))
                }
                if yyq2[13] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"payload\"")
                    } else {
                        r.EncodeString(`payload`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Payload == nil {
                        r.EncodeNil()
                    } else {
                        r.EncodeStringBytesRaw([]byte(x.Payload))
                    } // end block: if x.Payload slice == nil
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"qos\"")
                } else {
                    r.EncodeString(`qos`)
                }
                z.EncWriteMapElemValue()
                if yyxt55 := z.Extension(x.QualityOfService); yyxt55 != nil {
                    z.EncExtension(x.QualityOfService, yyxt55)
                } else {
                    r.EncodeInt(int64(x.QualityOfService))
                }
                if yyq2[7] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"rdr\"")
                    } else {
                        r.EncodeString(`rdr`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn10 {
                        r.EncodeNil()
                    } else {
                        yy56 := *x.RequestDeliveryResponse
                        r.EncodeInt(int64(yy56))
                    }
                }
                if yyq2[14] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`service_name`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ServiceName))
                }
                if yyq2[17] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`session_id`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.SessionID))
                }
                if yyq2[1] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"source\"")
                    } else {
                        r.EncodeString(`source`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Source))
                }
                if yyq2[10] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"spans\"")
                    } else {
                        r.EncodeString(`spans`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Spans == nil {
                        r.EncodeNil()
                    } else {
                        h.encSliceSlicestring(([][]string)(x.Spans), e)
                    } // end block: if x.Spans slice == nil
                }
                if yyq2[6] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"status\"")
                    } else {
                        r.EncodeString(`status`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn9 {
                        r.EncodeNil()
                    } else {
                        yy62 := *x.Status
                        r.EncodeInt(int64(yy62))
                    }
                }
                if yyq2[3] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`transaction_uuid`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.TransactionUUID))
                }
                if yyq2[15] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"url\"")
                    } else {
                        r.EncodeString(`url`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.URL))
                }
            } else {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt66 := z.Extension(x.Type); yyxt66 != nil {
                    z.EncExtension(x.Type, yyxt66)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                if yyq2[1] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"source\"")
                    } else {
                        r.EncodeString(`source`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Source))
                }
                if yyq2[2] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"dest\"")
                    } else {
                        r.EncodeString(`dest`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Destination))
                }
                if yyq2[3] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`transaction_uuid`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.TransactionUUID))
                }
                if yyq2[4] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`content_type`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ContentType))
                }
                if yyq2[5] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"accept\"")
                    } else {
                        r.EncodeString(`accept`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Accept))
                }
                if yyq2[6] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"status\"")
                    } else {
                        r.EncodeString(`status`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn9 {
                        r.EncodeNil()
                    } else {
                        yy72 := *x.Status
                        r.EncodeInt(int64(yy72))
                    }
                }
                if yyq2[7] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"rdr\"")
                    } else {
                        r.EncodeString(`rdr`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn10 {
                        r.EncodeNil()
                    } else {
                        yy74 := *x.RequestDeliveryResponse
                        r.EncodeInt(int64(yy74))
                    }
                }
                if yyq2[8] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"headers\"")
                    } else {
                        r.EncodeString(`headers`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Headers == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.Headers, e)
                    } // end block: if x.Headers slice == nil
                }
                if yyq2[9] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"metadata\"")
                    } else {
                        r.EncodeString(`metadata`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Metadata == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncMapStringStringV(x.Metadata, e)
                    } // end block: if x.Metadata map == nil
                }
                if yyq2[10] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"spans\"")
                    } else {
                        r.EncodeString(`spans`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Spans == nil {
                        r.EncodeNil()
                    } else {
                        h.encSliceSlicestring(([][]string)(x.Spans), e)
                    } // end block: if x.Spans slice == nil
                }
                if yyq2[11] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`include_spans`)
                    z.EncWriteMapElemValue()
                    if yyn14 {
                        r.EncodeNil()
                    } else {
                        yy79 := *x.IncludeSpans
                        r.EncodeBool(bool(yy79))
                    }
                }
                if yyq2[12] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"path\"")
                    } else {
                        r.EncodeString(`path`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Path))
                }
                if yyq2[13] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"payload\"")
                    } else {
                        r.EncodeString(`payload`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Payload == nil {
                        r.EncodeNil()
                    } else {
                        r.EncodeStringBytesRaw([]byte(x.Payload))
                    } // end block: if x.Payload slice == nil
                }
                if yyq2[14] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`service_name`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ServiceName))
                }
                if yyq2[15] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"url\"")
                    } else {
                        r.EncodeString(`url`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.URL))
                }
                if yyq2[16] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`partner_ids`)
                    z.EncWriteMapElemValue()
                    if x.PartnerIDs == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.PartnerIDs, e)
                    } // end block: if x.PartnerIDs slice == nil
                }
                if yyq2[17] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`session_id`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.SessionID))
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"qos\"")
                } else {
                    r.EncodeString(`qos`)
                }
                z.EncWriteMapElemValue()
                if yyxt87 := z.Extension(x.QualityOfService); yyxt87 != nil {
                    z.EncExtension(x.QualityOfService, yyxt87)
                } else {
                    r.EncodeInt(int64(x.QualityOfService))
                }
            }
            z.EncWriteMapEnd()
        }
    }
}

func (x *Message) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
    if yyct2 == codecSelferValueTypeNil3232 {
        *(x) = Message{}
    } else if yyct2 == codecSelferValueTypeMap3232 {
        yyl2 := z.DecReadMapStart()
        if yyl2 == 0 {
        } else {
            x.codecDecodeSelfFromMap(yyl2, d)
        }
        z.DecReadMapEnd()
    } else if yyct2 == codecSelferValueTypeArray3232 {
        yyl2 := z.DecReadArrayStart()
        if yyl2 != 0 {
            x.codecDecodeSelfFromArray(yyl2, d)
        }
        z.DecReadArrayEnd()
    } else {
        panic(errCodecSelferOnlyMapOrArrayEncodeToStruct3232)
    }
}

func (x *Message) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
    for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ {
        z.DecReadMapElemKey()
        yys3 := r.DecodeStringAsBytes()
        z.DecReadMapElemValue()
        switch string(yys3) {
        case "msg_type":
            if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                z.DecExtension(&x.Type, yyxt5)
            } else {
                x.Type = (MessageType)(r.DecodeInt64())
            }
        case "source":
            x.Source = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "dest":
            x.Destination = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "transaction_uuid":
            x.TransactionUUID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "content_type":
            x.ContentType = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "accept":
            x.Accept = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "status":
            if r.TryNil() {
                if x.Status != nil { // remove the if-true
                    x.Status = nil
                }
            } else {
                if x.Status == nil {
                    x.Status = new(int64)
                }
                *x.Status = (int64)(r.DecodeInt64())
            }
        case "rdr":
            if r.TryNil() {
                if x.RequestDeliveryResponse != nil { // remove the if-true
                    x.RequestDeliveryResponse = nil
                }
            } else {
                if x.RequestDeliveryResponse == nil {
                    x.RequestDeliveryResponse = new(int64)
                }
                *x.RequestDeliveryResponse = (int64)(r.DecodeInt64())
            }
        case "headers":
            z.F.DecSliceStringX(&x.Headers, d)
        case "metadata":
            z.F.DecMapStringStringX(&x.Metadata, d)
        case "spans":
            h.decSliceSlicestring((*[][]string)(&x.Spans), d)
        case "include_spans":
            if r.TryNil() {
                if x.IncludeSpans != nil { // remove the if-true
                    x.IncludeSpans = nil
                }
            } else {
                if x.IncludeSpans == nil {
                    x.IncludeSpans = new(bool)
                }
                *x.IncludeSpans = (bool)(r.DecodeBool())
            }
        case "path":
            x.Path = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "payload":
            x.Payload = z.DecodeBytesInto(([]byte)(x.Payload))
        case "service_name":
            x.ServiceName = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "url":
            x.URL = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "partner_ids":
            z.F.DecSliceStringX(&x.PartnerIDs, d)
        case "session_id":
            x.SessionID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "qos":
            if yyxt32 := z.Extension(x.QualityOfService); yyxt32 != nil {
                z.DecExtension(&x.QualityOfService, yyxt32)
            } else {
                x.QualityOfService = (QOSValue)(z.C.IntV(r.DecodeInt64(), codecSelferBitsize3232))
            }
        default:
            z.DecStructFieldNotFound(-1, string(yys3))
        } // end switch yys3
    } // end for yyj3
}

func (x *Message) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj33 int
    var yyb33 bool
    var yyhl33 bool = l >= 0
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if yyxt35 := z.Extension(x.Type); yyxt35 != nil {
        z.DecExtension(&x.Type, yyxt35)
    } else {
        x.Type = (MessageType)(r.DecodeInt64())
    }
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Source = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Destination = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.TransactionUUID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.ContentType = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Accept = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.Status != nil { // remove the if-true
            x.Status = nil
        }
    } else {
        if x.Status == nil {
            x.Status = new(int64)
        }
        *x.Status = (int64)(r.DecodeInt64())
    }
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.RequestDeliveryResponse != nil { // remove the if-true
            x.RequestDeliveryResponse = nil
        }
    } else {
        if x.RequestDeliveryResponse == nil {
            x.RequestDeliveryResponse = new(int64)
        }
        *x.RequestDeliveryResponse = (int64)(r.DecodeInt64())
    }
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecSliceStringX(&x.Headers, d)
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecMapStringStringX(&x.Metadata, d)
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    h.decSliceSlicestring((*[][]string)(&x.Spans), d)
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.IncludeSpans != nil { // remove the if-true
            x.IncludeSpans = nil
        }
    } else {
        if x.IncludeSpans == nil {
            x.IncludeSpans = new(bool)
        }
        *x.IncludeSpans = (bool)(r.DecodeBool())
    }
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Path = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Payload = z.DecodeBytesInto(([]byte)(x.Payload))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.ServiceName = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.URL = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecSliceStringX(&x.PartnerIDs, d)
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.SessionID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj33++
    yyb33 = !z.DecContainerNext(yyj33, l, yyhl33)
    if yyb33 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if yyxt62 := z.Extension(x.QualityOfService); yyxt62 != nil {
        z.DecExtension(&x.QualityOfService, yyxt62)
    } else {
        x.QualityOfService = (QOSValue)(z.C.IntV(r.DecodeInt64(), codecSelferBitsize3232))
    }
    yyj33++
    for ; z.DecContainerNext(yyj33, l, yyhl33); yyj33++ {
        z.DecReadArrayElem()
        z.DecStructFieldNotFound(yyj33-1, "")
    }
}

func (x *Message) IsCodecEmpty() bool {
    return !(x.Type != 0 || x.Source != "" || x.Destination != "" || x.TransactionUUID != "" || x.ContentType != "" || x.Accept != "" || len(x.Headers) != 0 || len(x.Metadata) != 0 || len(x.Spans) != 0 || x.Path != "" || len(x.Payload) != 0 || x.ServiceName != "" || x.URL != "" || len(x.PartnerIDs) != 0 || x.SessionID != "" || x.QualityOfService != 0 || false)
}

func (SimpleRequestResponse) codecSelferViaCodecgen() {}
func (x *SimpleRequestResponse) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
        z.EncEncode(x)
        return
    }
    if x == nil {
        r.EncodeNil()
    } else {
        yy2arr2 := z.EncBasicHandle().StructToArray
        _ = yy2arr2
        const yyr2 bool = false // struct tag has 'toArray'
        var yyn9 bool = x.Status == nil
        var yyn10 bool = x.RequestDeliveryResponse == nil
        var yyn14 bool = x.IncludeSpans == nil
        var yyq2 = [14]bool{ // should field at this index be written?
            true,                             // msg_type
            true,                             // source
            true,                             // dest
            x.ContentType != "",              // content_type
            x.Accept != "",                   // accept
            x.TransactionUUID != "",          // transaction_uuid
            x.Status != nil,                  // status
            x.RequestDeliveryResponse != nil, // rdr
            len(x.Headers) != 0,              // headers
            len(x.Metadata) != 0,             // metadata
            len(x.Spans) != 0,                // spans
            x.IncludeSpans != nil,            // include_spans
            len(x.Payload) != 0,              // payload
            len(x.PartnerIDs) != 0,           // partner_ids
        }
        _ = yyq2
        if yyr2 || yy2arr2 {
            z.EncWriteArrayStart(14)
            z.EncWriteArrayElem()
            if yyxt17 := z.Extension(x.Type); yyxt17 != nil {
                z.EncExtension(x.Type, yyxt17)
            } else {
                r.EncodeInt(int64(x.Type))
            }
            z.EncWriteArrayElem()
            r.EncodeString(string(x.Source))
            z.EncWriteArrayElem()
            r.EncodeString(string(x.Destination))
            z.EncWriteArrayElem()
            if yyq2[3] {
                r.EncodeString(string(x.ContentType))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[4] {
                r.EncodeString(string(x.Accept))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[5] {
                r.EncodeString(string(x.TransactionUUID))
            } else {
                r.EncodeString("")
            }
            if yyn9 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[6] {
                    yy23 := *x.Status
                    r.EncodeInt(int64(yy23))
                } else {
                    r.EncodeNil()
                }
            }
            if yyn10 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[7] {
                    yy25 := *x.RequestDeliveryResponse
                    r.EncodeInt(int64(yy25))
                } else {
                    r.EncodeNil()
                }
            }
            z.EncWriteArrayElem()
            if yyq2[8] {
                if x.Headers == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncSliceStringV(x.Headers, e)
                } // end block: if x.Headers slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[9] {
                if x.Metadata == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncMapStringStringV(x.Metadata, e)
                } // end block: if x.Metadata map == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[10] {
                if x.Spans == nil {
                    r.EncodeNil()
                } else {
                    h.encSliceSlicestring(([][]string)(x.Spans), e)
                } // end block: if x.Spans slice == nil
            } else {
                r.EncodeNil()
            }
            if yyn14 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[11] {
                    yy30 := *x.IncludeSpans
                    r.EncodeBool(bool(yy30))
                } else {
                    r.EncodeNil()
                }
            }
            z.EncWriteArrayElem()
            if yyq2[12] {
                if x.Payload == nil {
                    r.EncodeNil()
                } else {
                    r.EncodeStringBytesRaw([]byte(x.Payload))
                } // end block: if x.Payload slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[13] {
                if x.PartnerIDs == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncSliceStringV(x.PartnerIDs, e)
                } // end block: if x.PartnerIDs slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayEnd()
        } else {
            var yynn2 int
            for _, b := range yyq2 {
                if b {
                    yynn2++
                }
            }
            z.EncWriteMapStart(yynn2)
            yynn2 = 0
            if z.EncBasicHandle().Canonical {
                if yyq2[4] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"accept\"")
                    } else {
                        r.EncodeString(`accept`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Accept))
                }
                if yyq2[3] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`content_type`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ContentType))
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"dest\"")
                } else {
                    r.EncodeString(`dest`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Destination))
                if yyq2[8] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"headers\"")
                    } else {
                        r.EncodeString(`headers`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Headers == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.Headers, e)
                    } // end block: if x.Headers slice == nil
                }
                if yyq2[11] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`include_spans`)
                    z.EncWriteMapElemValue()
                    if yyn14 {
                        r.EncodeNil()
                    } else {
                        yy38 := *x.IncludeSpans
                        r.EncodeBool(bool(yy38))
                    }
                }
                if yyq2[9] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"metadata\"")
                    } else {
                        r.EncodeString(`metadata`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Metadata == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncMapStringStringV(x.Metadata, e)
                    } // end block: if x.Metadata map == nil
                }
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt41 := z.Extension(x.Type); yyxt41 != nil {
                    z.EncExtension(x.Type, yyxt41)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                if yyq2[13] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`partner_ids`)
                    z.EncWriteMapElemValue()
                    if x.PartnerIDs == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.PartnerIDs, e)
                    } // end block: if x.PartnerIDs slice == nil
                }
                if yyq2[12] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"payload\"")
                    } else {
                        r.EncodeString(`payload`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Payload == nil {
                        r.EncodeNil()
                    } else {
                        r.EncodeStringBytesRaw([]byte(x.Payload))
                    } // end block: if x.Payload slice == nil
                }
                if yyq2[7] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"rdr\"")
                    } else {
                        r.EncodeString(`rdr`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn10 {
                        r.EncodeNil()
                    } else {
                        yy44 := *x.RequestDeliveryResponse
                        r.EncodeInt(int64(yy44))
                    }
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"source\"")
                } else {
                    r.EncodeString(`source`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Source))
                if yyq2[10] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"spans\"")
                    } else {
                        r.EncodeString(`spans`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Spans == nil {
                        r.EncodeNil()
                    } else {
                        h.encSliceSlicestring(([][]string)(x.Spans), e)
                    } // end block: if x.Spans slice == nil
                }
                if yyq2[6] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"status\"")
                    } else {
                        r.EncodeString(`status`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn9 {
                        r.EncodeNil()
                    } else {
                        yy48 := *x.Status
                        r.EncodeInt(int64(yy48))
                    }
                }
                if yyq2[5] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`transaction_uuid`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.TransactionUUID))
                }
            } else {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt51 := z.Extension(x.Type); yyxt51 != nil {
                    z.EncExtension(x.Type, yyxt51)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"source\"")
                } else {
                    r.EncodeString(`source`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Source))
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"dest\"")
                } else {
                    r.EncodeString(`dest`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Destination))
                if yyq2[3] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`content_type`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ContentType))
                }
                if yyq2[4] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"accept\"")
                    } else {
                        r.EncodeString(`accept`)
                    }
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.Accept))
                }
                if yyq2[5] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`transaction_uuid`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.TransactionUUID))
                }
                if yyq2[6] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"status\"")
                    } else {
                        r.EncodeString(`status`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn9 {
                        r.EncodeNil()
                    } else {
                        yy57 := *x.Status
                        r.EncodeInt(int64(yy57))
                    }
                }
                if yyq2[7] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"rdr\"")
                    } else {
                        r.EncodeString(`rdr`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn10 {
                        r.EncodeNil()
                    } else {
                        yy59 := *x.RequestDeliveryResponse
                        r.EncodeInt(int64(yy59))
                    }
                }
                if yyq2[8] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"headers\"")
                    } else {
                        r.EncodeString(`headers`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Headers == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.Headers, e)
                    } // end block: if x.Headers slice == nil
                }
                if yyq2[9] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"metadata\"")
                    } else {
                        r.EncodeString(`metadata`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Metadata == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncMapStringStringV(x.Metadata, e)
                    } // end block: if x.Metadata map == nil
                }
                if yyq2[10] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"spans\"")
                    } else {
                        r.EncodeString(`spans`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Spans == nil {
                        r.EncodeNil()
                    } else {
                        h.encSliceSlicestring(([][]string)(x.Spans), e)
                    } // end block: if x.Spans slice == nil
                }
                if yyq2[11] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`include_spans`)
                    z.EncWriteMapElemValue()
                    if yyn14 {
                        r.EncodeNil()
                    } else {
                        yy64 := *x.IncludeSpans
                        r.EncodeBool(bool(yy64))
                    }
                }
                if yyq2[12] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"payload\"")
                    } else {
                        r.EncodeString(`payload`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Payload == nil {
                        r.EncodeNil()
                    } else {
                        r.EncodeStringBytesRaw([]byte(x.Payload))
                    } // end block: if x.Payload slice == nil
                }
                if yyq2[13] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`partner_ids`)
                    z.EncWriteMapElemValue()
                    if x.PartnerIDs == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.PartnerIDs, e)
                    } // end block: if x.PartnerIDs slice == nil
                }
            }
            z.EncWriteMapEnd()
        }
    }
}

func (x *SimpleRequestResponse) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
    if yyct2 == codecSelferValueTypeNil3232 {
        *(x) = SimpleRequestResponse{}
    } else if yyct2 == codecSelferValueTypeMap3232 {
        yyl2 := z.DecReadMapStart()
        if yyl2 == 0 {
        } else {
            x.codecDecodeSelfFromMap(yyl2, d)
        }
        z.DecReadMapEnd()
    } else if yyct2 == codecSelferValueTypeArray3232 {
        yyl2 := z.DecReadArrayStart()
        if yyl2 != 0 {
            x.codecDecodeSelfFromArray(yyl2, d)
        }
        z.DecReadArrayEnd()
    } else {
        panic(errCodecSelferOnlyMapOrArrayEncodeToStruct3232)
    }
}

func (x *SimpleRequestResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
    for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ {
        z.DecReadMapElemKey()
        yys3 := r.DecodeStringAsBytes()
        z.DecReadMapElemValue()
        switch string(yys3) {
        case "msg_type":
            if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                z.DecExtension(&x.Type, yyxt5)
            } else {
                x.Type = (MessageType)(r.DecodeInt64())
            }
        case "source":
            x.Source = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "dest":
            x.Destination = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "content_type":
            x.ContentType = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "accept":
            x.Accept = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "transaction_uuid":
            x.TransactionUUID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "status":
            if r.TryNil() {
                if x.Status != nil { // remove the if-true
                    x.Status = nil
                }
            } else {
                if x.Status == nil {
                    x.Status = new(int64)
                }
                *x.Status = (int64)(r.DecodeInt64())
            }
        case "rdr":
            if r.TryNil() {
                if x.RequestDeliveryResponse != nil { // remove the if-true
                    x.RequestDeliveryResponse = nil
                }
            } else {
                if x.RequestDeliveryResponse == nil {
                    x.RequestDeliveryResponse = new(int64)
                }
                *x.RequestDeliveryResponse = (int64)(r.DecodeInt64())
            }
        case "headers":
            z.F.DecSliceStringX(&x.Headers, d)
        case "metadata":
            z.F.DecMapStringStringX(&x.Metadata, d)
        case "spans":
            h.decSliceSlicestring((*[][]string)(&x.Spans), d)
        case "include_spans":
            if r.TryNil() {
                if x.IncludeSpans != nil { // remove the if-true
                    x.IncludeSpans = nil
                }
            } else {
                if x.IncludeSpans == nil {
                    x.IncludeSpans = new(bool)
                }
                *x.IncludeSpans = (bool)(r.DecodeBool())
            }
        case "payload":
            x.Payload = z.DecodeBytesInto(([]byte)(x.Payload))
        case "partner_ids":
            z.F.DecSliceStringX(&x.PartnerIDs, d)
        default:
            z.DecStructFieldNotFound(-1, string(yys3))
        } // end switch yys3
    } // end for yyj3
}

func (x *SimpleRequestResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj27 int
    var yyb27 bool
    var yyhl27 bool = l >= 0
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if yyxt29 := z.Extension(x.Type); yyxt29 != nil {
        z.DecExtension(&x.Type, yyxt29)
    } else {
        x.Type = (MessageType)(r.DecodeInt64())
    }
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Source = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Destination = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.ContentType = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Accept = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.TransactionUUID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.Status != nil { // remove the if-true
            x.Status = nil
        }
    } else {
        if x.Status == nil {
            x.Status = new(int64)
        }
        *x.Status = (int64)(r.DecodeInt64())
    }
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.RequestDeliveryResponse != nil { // remove the if-true
            x.RequestDeliveryResponse = nil
        }
    } else {
        if x.RequestDeliveryResponse == nil {
            x.RequestDeliveryResponse = new(int64)
        }
        *x.RequestDeliveryResponse = (int64)(r.DecodeInt64())
    }
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecSliceStringX(&x.Headers, d)
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecMapStringStringX(&x.Metadata, d)
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    h.decSliceSlicestring((*[][]string)(&x.Spans), d)
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.IncludeSpans != nil { // remove the if-true
            x.IncludeSpans = nil
        }
    } else {
        if x.IncludeSpans == nil {
            x.IncludeSpans = new(bool)
        }
        *x.IncludeSpans = (bool)(r.DecodeBool())
    }
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Payload = z.DecodeBytesInto(([]byte)(x.Payload))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecSliceStringX(&x.PartnerIDs, d)
    yyj27++
    for ; z.DecContainerNext(yyj27, l, yyhl27); yyj27++ {
        z.DecReadArrayElem()
        z.DecStructFieldNotFound(yyj27-1, "")
    }
}

func (x *SimpleRequestResponse) IsCodecEmpty() bool {
    return !(x.Type != 0 || x.Source != "" || x.Destination != "" || x.ContentType != "" || x.Accept != "" || x.TransactionUUID != "" || len(x.Headers) != 0 || len(x.Metadata) != 0 || len(x.Spans) != 0 || len(x.Payload) != 0 || len(x.PartnerIDs) != 0 || false)
}

func (SimpleEvent) codecSelferViaCodecgen() {}
func (x *SimpleEvent) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
        z.EncEncode(x)
        return
    }
    if x == nil {
        r.EncodeNil()
    } else {
        yy2arr2 := z.EncBasicHandle().StructToArray
        _ = yy2arr2
        const yyr2 bool = false // struct tag has 'toArray'
        var yyq2 = [9]bool{     // should field at this index be written?
            true,                   // msg_type
            true,                   // source
            true,                   // dest
            x.ContentType != "",    // content_type
            len(x.Headers) != 0,    // headers
            len(x.Metadata) != 0,   // metadata
            len(x.Payload) != 0,    // payload
            len(x.PartnerIDs) != 0, // partner_ids
            x.SessionID != "",      // session_id
        }
        _ = yyq2
        if yyr2 || yy2arr2 {
            z.EncWriteArrayStart(9)
            z.EncWriteArrayElem()
            if yyxt12 := z.Extension(x.Type); yyxt12 != nil {
                z.EncExtension(x.Type, yyxt12)
            } else {
                r.EncodeInt(int64(x.Type))
            }
            z.EncWriteArrayElem()
            r.EncodeString(string(x.Source))
            z.EncWriteArrayElem()
            r.EncodeString(string(x.Destination))
            z.EncWriteArrayElem()
            if yyq2[3] {
                r.EncodeString(string(x.ContentType))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[4] {
                if x.Headers == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncSliceStringV(x.Headers, e)
                } // end block: if x.Headers slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[5] {
                if x.Metadata == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncMapStringStringV(x.Metadata, e)
                } // end block: if x.Metadata map == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[6] {
                if x.Payload == nil {
                    r.EncodeNil()
                } else {
                    r.EncodeStringBytesRaw([]byte(x.Payload))
                } // end block: if x.Payload slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[7] {
                if x.PartnerIDs == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncSliceStringV(x.PartnerIDs, e)
                } // end block: if x.PartnerIDs slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[8] {
                r.EncodeString(string(x.SessionID))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayEnd()
        } else {
            var yynn2 int
            for _, b := range yyq2 {
                if b {
                    yynn2++
                }
            }
            z.EncWriteMapStart(yynn2)
            yynn2 = 0
            if z.EncBasicHandle().Canonical {
                if yyq2[3] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`content_type`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ContentType))
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"dest\"")
                } else {
                    r.EncodeString(`dest`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Destination))
                if yyq2[4] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"headers\"")
                    } else {
                        r.EncodeString(`headers`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Headers == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.Headers, e)
                    } // end block: if x.Headers slice == nil
                }
                if yyq2[5] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"metadata\"")
                    } else {
                        r.EncodeString(`metadata`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Metadata == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncMapStringStringV(x.Metadata, e)
                    } // end block: if x.Metadata map == nil
                }
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt25 := z.Extension(x.Type); yyxt25 != nil {
                    z.EncExtension(x.Type, yyxt25)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                if yyq2[7] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`partner_ids`)
                    z.EncWriteMapElemValue()
                    if x.PartnerIDs == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.PartnerIDs, e)
                    } // end block: if x.PartnerIDs slice == nil
                }
                if yyq2[6] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"payload\"")
                    } else {
                        r.EncodeString(`payload`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Payload == nil {
                        r.EncodeNil()
                    } else {
                        r.EncodeStringBytesRaw([]byte(x.Payload))
                    } // end block: if x.Payload slice == nil
                }
                if yyq2[8] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`session_id`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.SessionID))
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"source\"")
                } else {
                    r.EncodeString(`source`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Source))
            } else {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt30 := z.Extension(x.Type); yyxt30 != nil {
                    z.EncExtension(x.Type, yyxt30)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"source\"")
                } else {
                    r.EncodeString(`source`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Source))
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"dest\"")
                } else {
                    r.EncodeString(`dest`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Destination))
                if yyq2[3] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`content_type`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ContentType))
                }
                if yyq2[4] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"headers\"")
                    } else {
                        r.EncodeString(`headers`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Headers == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.Headers, e)
                    } // end block: if x.Headers slice == nil
                }
                if yyq2[5] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"metadata\"")
                    } else {
                        r.EncodeString(`metadata`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Metadata == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncMapStringStringV(x.Metadata, e)
                    } // end block: if x.Metadata map == nil
                }
                if yyq2[6] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"payload\"")
                    } else {
                        r.EncodeString(`payload`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Payload == nil {
                        r.EncodeNil()
                    } else {
                        r.EncodeStringBytesRaw([]byte(x.Payload))
                    } // end block: if x.Payload slice == nil
                }
                if yyq2[7] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`partner_ids`)
                    z.EncWriteMapElemValue()
                    if x.PartnerIDs == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.PartnerIDs, e)
                    } // end block: if x.PartnerIDs slice == nil
                }
                if yyq2[8] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`session_id`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.SessionID))
                }
            }
            z.EncWriteMapEnd()
        }
    }
}

func (x *SimpleEvent) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
    if yyct2 == codecSelferValueTypeNil3232 {
        *(x) = SimpleEvent{}
    } else if yyct2 == codecSelferValueTypeMap3232 {
        yyl2 := z.DecReadMapStart()
        if yyl2 == 0 {
        } else {
            x.codecDecodeSelfFromMap(yyl2, d)
        }
        z.DecReadMapEnd()
    } else if yyct2 == codecSelferValueTypeArray3232 {
        yyl2 := z.DecReadArrayStart()
        if yyl2 != 0 {
            x.codecDecodeSelfFromArray(yyl2, d)
        }
        z.DecReadArrayEnd()
    } else {
        panic(errCodecSelferOnlyMapOrArrayEncodeToStruct3232)
    }
}

func (x *SimpleEvent) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
    for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ {
        z.DecReadMapElemKey()
        yys3 := r.DecodeStringAsBytes()
        z.DecReadMapElemValue()
        switch string(yys3) {
        case "msg_type":
            if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                z.DecExtension(&x.Type, yyxt5)
            } else {
                x.Type = (MessageType)(r.DecodeInt64())
            }
        case "source":
            x.Source = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "dest":
            x.Destination = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "content_type":
            x.ContentType = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "headers":
            z.F.DecSliceStringX(&x.Headers, d)
        case "metadata":
            z.F.DecMapStringStringX(&x.Metadata, d)
        case "payload":
            x.Payload = z.DecodeBytesInto(([]byte)(x.Payload))
        case "partner_ids":
            z.F.DecSliceStringX(&x.PartnerIDs, d)
        case "session_id":
            x.SessionID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        default:
            z.DecStructFieldNotFound(-1, string(yys3))
        } // end switch yys3
    } // end for yyj3
}

func (x *SimpleEvent) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj18 int
    var yyb18 bool
    var yyhl18 bool = l >= 0
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if yyxt20 := z.Extension(x.Type); yyxt20 != nil {
        z.DecExtension(&x.Type, yyxt20)
    } else {
        x.Type = (MessageType)(r.DecodeInt64())
    }
    yyj18++
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Source = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj18++
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Destination = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj18++
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.ContentType = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj18++
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecSliceStringX(&x.Headers, d)
    yyj18++
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecMapStringStringX(&x.Metadata, d)
    yyj18++
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Payload = z.DecodeBytesInto(([]byte)(x.Payload))
    yyj18++
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecSliceStringX(&x.PartnerIDs, d)
    yyj18++
    yyb18 = !z.DecContainerNext(yyj18, l, yyhl18)
    if yyb18 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.SessionID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj18++
    for ; z.DecContainerNext(yyj18, l, yyhl18); yyj18++ {
        z.DecReadArrayElem()
        z.DecStructFieldNotFound(yyj18-1, "")
    }
}

func (x *SimpleEvent) IsCodecEmpty() bool {
    return !(x.Type != 0 || x.Source != "" || x.Destination != "" || x.ContentType != "" || len(x.Headers) != 0 || len(x.Metadata) != 0 || len(x.Payload) != 0 || len(x.PartnerIDs) != 0 || x.SessionID != "" || false)
}

func (CRUD) codecSelferViaCodecgen() {}
func (x *CRUD) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
        z.EncEncode(x)
        return
    }
    if x == nil {
        r.EncodeNil()
    } else {
        yy2arr2 := z.EncBasicHandle().StructToArray
        _ = yy2arr2
        const yyr2 bool = false // struct tag has 'toArray'
        var yyn11 bool = x.IncludeSpans == nil
        var yyn12 bool = x.Status == nil
        var yyn13 bool = x.RequestDeliveryResponse == nil
        var yyq2 = [14]bool{ // should field at this index be written?
            true,                             // msg_type
            true,                             // source
            true,                             // dest
            x.TransactionUUID != "",          // transaction_uuid
            x.ContentType != "",              // content_type
            len(x.Headers) != 0,              // headers
            len(x.Metadata) != 0,             // metadata
            len(x.Spans) != 0,                // spans
            x.IncludeSpans != nil,            // include_spans
            x.Status != nil,                  // status
            x.RequestDeliveryResponse != nil, // rdr
            true,                             // path
            len(x.Payload) != 0,              // payload
            len(x.PartnerIDs) != 0,           // partner_ids
        }
        _ = yyq2
        if yyr2 || yy2arr2 {
            z.EncWriteArrayStart(14)
            z.EncWriteArrayElem()
            if yyxt17 := z.Extension(x.Type); yyxt17 != nil {
                z.EncExtension(x.Type, yyxt17)
            } else {
                r.EncodeInt(int64(x.Type))
            }
            z.EncWriteArrayElem()
            r.EncodeString(string(x.Source))
            z.EncWriteArrayElem()
            r.EncodeString(string(x.Destination))
            z.EncWriteArrayElem()
            if yyq2[3] {
                r.EncodeString(string(x.TransactionUUID))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[4] {
                r.EncodeString(string(x.ContentType))
            } else {
                r.EncodeString("")
            }
            z.EncWriteArrayElem()
            if yyq2[5] {
                if x.Headers == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncSliceStringV(x.Headers, e)
                } // end block: if x.Headers slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[6] {
                if x.Metadata == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncMapStringStringV(x.Metadata, e)
                } // end block: if x.Metadata map == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[7] {
                if x.Spans == nil {
                    r.EncodeNil()
                } else {
                    h.encSliceSlicestring(([][]string)(x.Spans), e)
                } // end block: if x.Spans slice == nil
            } else {
                r.EncodeNil()
            }
            if yyn11 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[8] {
                    yy25 := *x.IncludeSpans
                    r.EncodeBool(bool(yy25))
                } else {
                    r.EncodeNil()
                }
            }
            if yyn12 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[9] {
                    yy27 := *x.Status
                    r.EncodeInt(int64(yy27))
                } else {
                    r.EncodeNil()
                }
            }
            if yyn13 {
                z.EncWriteArrayElem()
                r.EncodeNil()
            } else {
                z.EncWriteArrayElem()
                if yyq2[10] {
                    yy29 := *x.RequestDeliveryResponse
                    r.EncodeInt(int64(yy29))
                } else {
                    r.EncodeNil()
                }
            }
            z.EncWriteArrayElem()
            r.EncodeString(string(x.Path))
            z.EncWriteArrayElem()
            if yyq2[12] {
                if x.Payload == nil {
                    r.EncodeNil()
                } else {
                    r.EncodeStringBytesRaw([]byte(x.Payload))
                } // end block: if x.Payload slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayElem()
            if yyq2[13] {
                if x.PartnerIDs == nil {
                    r.EncodeNil()
                } else {
                    z.F.EncSliceStringV(x.PartnerIDs, e)
                } // end block: if x.PartnerIDs slice == nil
            } else {
                r.EncodeNil()
            }
            z.EncWriteArrayEnd()
        } else {
            var yynn2 int
            for _, b := range yyq2 {
                if b {
                    yynn2++
                }
            }
            z.EncWriteMapStart(yynn2)
            yynn2 = 0
            if z.EncBasicHandle().Canonical {
                if yyq2[4] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`content_type`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ContentType))
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"dest\"")
                } else {
                    r.EncodeString(`dest`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Destination))
                if yyq2[5] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"headers\"")
                    } else {
                        r.EncodeString(`headers`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Headers == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.Headers, e)
                    } // end block: if x.Headers slice == nil
                }
                if yyq2[8] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`include_spans`)
                    z.EncWriteMapElemValue()
                    if yyn11 {
                        r.EncodeNil()
                    } else {
                        yy37 := *x.IncludeSpans
                        r.EncodeBool(bool(yy37))
                    }
                }
                if yyq2[6] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"metadata\"")
                    } else {
                        r.EncodeString(`metadata`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Metadata == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncMapStringStringV(x.Metadata, e)
                    } // end block: if x.Metadata map == nil
                }
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt40 := z.Extension(x.Type); yyxt40 != nil {
                    z.EncExtension(x.Type, yyxt40)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                if yyq2[13] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`partner_ids`)
                    z.EncWriteMapElemValue()
                    if x.PartnerIDs == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.PartnerIDs, e)
                    } // end block: if x.PartnerIDs slice == nil
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"path\"")
                } else {
                    r.EncodeString(`path`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Path))
                if yyq2[12] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"payload\"")
                    } else {
                        r.EncodeString(`payload`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Payload == nil {
                        r.EncodeNil()
                    } else {
                        r.EncodeStringBytesRaw([]byte(x.Payload))
                    } // end block: if x.Payload slice == nil
                }
                if yyq2[10] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"rdr\"")
                    } else {
                        r.EncodeString(`rdr`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn13 {
                        r.EncodeNil()
                    } else {
                        yy44 := *x.RequestDeliveryResponse
                        r.EncodeInt(int64(yy44))
                    }
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"source\"")
                } else {
                    r.EncodeString(`source`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Source))
                if yyq2[7] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"spans\"")
                    } else {
                        r.EncodeString(`spans`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Spans == nil {
                        r.EncodeNil()
                    } else {
                        h.encSliceSlicestring(([][]string)(x.Spans), e)
                    } // end block: if x.Spans slice == nil
                }
                if yyq2[9] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"status\"")
                    } else {
                        r.EncodeString(`status`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn12 {
                        r.EncodeNil()
                    } else {
                        yy48 := *x.Status
                        r.EncodeInt(int64(yy48))
                    }
                }
                if yyq2[3] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`transaction_uuid`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.TransactionUUID))
                }
            } else {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt51 := z.Extension(x.Type); yyxt51 != nil {
                    z.EncExtension(x.Type, yyxt51)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"source\"")
                } else {
                    r.EncodeString(`source`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Source))
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"dest\"")
                } else {
                    r.EncodeString(`dest`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Destination))
                if yyq2[3] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`transaction_uuid`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.TransactionUUID))
                }
                if yyq2[4] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`content_type`)
                    z.EncWriteMapElemValue()
                    r.EncodeString(string(x.ContentType))
                }
                if yyq2[5] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"headers\"")
                    } else {
                        r.EncodeString(`headers`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Headers == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.Headers, e)
                    } // end block: if x.Headers slice == nil
                }
                if yyq2[6] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"metadata\"")
                    } else {
                        r.EncodeString(`metadata`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Metadata == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncMapStringStringV(x.Metadata, e)
                    } // end block: if x.Metadata map == nil
                }
                if yyq2[7] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"spans\"")
                    } else {
                        r.EncodeString(`spans`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Spans == nil {
                        r.EncodeNil()
                    } else {
                        h.encSliceSlicestring(([][]string)(x.Spans), e)
                    } // end block: if x.Spans slice == nil
                }
                if yyq2[8] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`include_spans`)
                    z.EncWriteMapElemValue()
                    if yyn11 {
                        r.EncodeNil()
                    } else {
                        yy59 := *x.IncludeSpans
                        r.EncodeBool(bool(yy59))
                    }
                }
                if yyq2[9] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"status\"")
                    } else {
                        r.EncodeString(`status`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn12 {
                        r.EncodeNil()
                    } else {
                        yy61 := *x.Status
                        r.EncodeInt(int64(yy61))
                    }
                }
                if yyq2[10] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"rdr\"")
                    } else {
                        r.EncodeString(`rdr`)
                    }
                    z.EncWriteMapElemValue()
                    if yyn13 {
                        r.EncodeNil()
                    } else {
                        yy63 := *x.RequestDeliveryResponse
                        r.EncodeInt(int64(yy63))
                    }
                }
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"path\"")
                } else {
                    r.EncodeString(`path`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.Path))
                if yyq2[12] {
                    z.EncWriteMapElemKey()
                    if z.IsJSONHandle() {
                        z.EncWr().WriteStr("\"payload\"")
                    } else {
                        r.EncodeString(`payload`)
                    }
                    z.EncWriteMapElemValue()
                    if x.Payload == nil {
                        r.EncodeNil()
                    } else {
                        r.EncodeStringBytesRaw([]byte(x.Payload))
                    } // end block: if x.Payload slice == nil
                }
                if yyq2[13] {
                    z.EncWriteMapElemKey()
                    r.EncodeString(`partner_ids`)
                    z.EncWriteMapElemValue()
                    if x.PartnerIDs == nil {
                        r.EncodeNil()
                    } else {
                        z.F.EncSliceStringV(x.PartnerIDs, e)
                    } // end block: if x.PartnerIDs slice == nil
                }
            }
            z.EncWriteMapEnd()
        }
    }
}

func (x *CRUD) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
    if yyct2 == codecSelferValueTypeNil3232 {
        *(x) = CRUD{}
    } else if yyct2 == codecSelferValueTypeMap3232 {
        yyl2 := z.DecReadMapStart()
        if yyl2 == 0 {
        } else {
            x.codecDecodeSelfFromMap(yyl2, d)
        }
        z.DecReadMapEnd()
    } else if yyct2 == codecSelferValueTypeArray3232 {
        yyl2 := z.DecReadArrayStart()
        if yyl2 != 0 {
            x.codecDecodeSelfFromArray(yyl2, d)
        }
        z.DecReadArrayEnd()
    } else {
        panic(errCodecSelferOnlyMapOrArrayEncodeToStruct3232)
    }
}

func (x *CRUD) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
    for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ {
        z.DecReadMapElemKey()
        yys3 := r.DecodeStringAsBytes()
        z.DecReadMapElemValue()
        switch string(yys3) {
        case "msg_type":
            if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                z.DecExtension(&x.Type, yyxt5)
            } else {
                x.Type = (MessageType)(r.DecodeInt64())
            }
        case "source":
            x.Source = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "dest":
            x.Destination = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "transaction_uuid":
            x.TransactionUUID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "content_type":
            x.ContentType = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "headers":
            z.F.DecSliceStringX(&x.Headers, d)
        case "metadata":
            z.F.DecMapStringStringX(&x.Metadata, d)
        case "spans":
            h.decSliceSlicestring((*[][]string)(&x.Spans), d)
        case "include_spans":
            if r.TryNil() {
                if x.IncludeSpans != nil { // remove the if-true
                    x.IncludeSpans = nil
                }
            } else {
                if x.IncludeSpans == nil {
                    x.IncludeSpans = new(bool)
                }
                *x.IncludeSpans = (bool)(r.DecodeBool())
            }
        case "status":
            if r.TryNil() {
                if x.Status != nil { // remove the if-true
                    x.Status = nil
                }
            } else {
                if x.Status == nil {
                    x.Status = new(int64)
                }
                *x.Status = (int64)(r.DecodeInt64())
            }
        case "rdr":
            if r.TryNil() {
                if x.RequestDeliveryResponse != nil { // remove the if-true
                    x.RequestDeliveryResponse = nil
                }
            } else {
                if x.RequestDeliveryResponse == nil {
                    x.RequestDeliveryResponse = new(int64)
                }
                *x.RequestDeliveryResponse = (int64)(r.DecodeInt64())
            }
        case "path":
            x.Path = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "payload":
            x.Payload = z.DecodeBytesInto(([]byte)(x.Payload))
        case "partner_ids":
            z.F.DecSliceStringX(&x.PartnerIDs, d)
        default:
            z.DecStructFieldNotFound(-1, string(yys3))
        } // end switch yys3
    } // end for yyj3
}

func (x *CRUD) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj27 int
    var yyb27 bool
    var yyhl27 bool = l >= 0
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if yyxt29 := z.Extension(x.Type); yyxt29 != nil {
        z.DecExtension(&x.Type, yyxt29)
    } else {
        x.Type = (MessageType)(r.DecodeInt64())
    }
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Source = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Destination = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.TransactionUUID = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.ContentType = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecSliceStringX(&x.Headers, d)
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecMapStringStringX(&x.Metadata, d)
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    h.decSliceSlicestring((*[][]string)(&x.Spans), d)
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.IncludeSpans != nil { // remove the if-true
            x.IncludeSpans = nil
        }
    } else {
        if x.IncludeSpans == nil {
            x.IncludeSpans = new(bool)
        }
        *x.IncludeSpans = (bool)(r.DecodeBool())
    }
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.Status != nil { // remove the if-true
            x.Status = nil
        }
    } else {
        if x.Status == nil {
            x.Status = new(int64)
        }
        *x.Status = (int64)(r.DecodeInt64())
    }
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if r.TryNil() {
        if x.RequestDeliveryResponse != nil { // remove the if-true
            x.RequestDeliveryResponse = nil
        }
    } else {
        if x.RequestDeliveryResponse == nil {
            x.RequestDeliveryResponse = new(int64)
        }
        *x.RequestDeliveryResponse = (int64)(r.DecodeInt64())
    }
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Path = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.Payload = z.DecodeBytesInto(([]byte)(x.Payload))
    yyj27++
    yyb27 = !z.DecContainerNext(yyj27, l, yyhl27)
    if yyb27 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    z.F.DecSliceStringX(&x.PartnerIDs, d)
    yyj27++
    for ; z.DecContainerNext(yyj27, l, yyhl27); yyj27++ {
        z.DecReadArrayElem()
        z.DecStructFieldNotFound(yyj27-1, "")
    }
}

func (x *CRUD) IsCodecEmpty() bool {
    return !(x.Type != 0 || x.Source != "" || x.Destination != "" || x.TransactionUUID != "" || x.ContentType != "" || len(x.Headers) != 0 || len(x.Metadata) != 0 || len(x.Spans) != 0 || x.Path != "" || len(x.Payload) != 0 || len(x.PartnerIDs) != 0 || false)
}

func (ServiceRegistration) codecSelferViaCodecgen() {}
func (x *ServiceRegistration) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
        z.EncEncode(x)
        return
    }
    if x == nil {
        r.EncodeNil()
    } else {
        yy2arr2 := z.EncBasicHandle().StructToArray
        _ = yy2arr2
        const yyr2 bool = false // struct tag has 'toArray'
        if yyr2 || yy2arr2 {
            z.EncWriteArrayStart(3)
            z.EncWriteArrayElem()
            if yyxt6 := z.Extension(x.Type); yyxt6 != nil {
                z.EncExtension(x.Type, yyxt6)
            } else {
                r.EncodeInt(int64(x.Type))
            }
            z.EncWriteArrayElem()
            r.EncodeString(string(x.ServiceName))
            z.EncWriteArrayElem()
            r.EncodeString(string(x.URL))
            z.EncWriteArrayEnd()
        } else {
            z.EncWriteMapStart(3)
            if z.EncBasicHandle().Canonical {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt9 := z.Extension(x.Type); yyxt9 != nil {
                    z.EncExtension(x.Type, yyxt9)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                z.EncWriteMapElemKey()
                r.EncodeString(`service_name`)
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.ServiceName))
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"url\"")
                } else {
                    r.EncodeString(`url`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.URL))
            } else {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt12 := z.Extension(x.Type); yyxt12 != nil {
                    z.EncExtension(x.Type, yyxt12)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
                z.EncWriteMapElemKey()
                r.EncodeString(`service_name`)
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.ServiceName))
                z.EncWriteMapElemKey()
                if z.IsJSONHandle() {
                    z.EncWr().WriteStr("\"url\"")
                } else {
                    r.EncodeString(`url`)
                }
                z.EncWriteMapElemValue()
                r.EncodeString(string(x.URL))
            }
            z.EncWriteMapEnd()
        }
    }
}

func (x *ServiceRegistration) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
    if yyct2 == codecSelferValueTypeNil3232 {
        *(x) = ServiceRegistration{}
    } else if yyct2 == codecSelferValueTypeMap3232 {
        yyl2 := z.DecReadMapStart()
        if yyl2 == 0 {
        } else {
            x.codecDecodeSelfFromMap(yyl2, d)
        }
        z.DecReadMapEnd()
    } else if yyct2 == codecSelferValueTypeArray3232 {
        yyl2 := z.DecReadArrayStart()
        if yyl2 != 0 {
            x.codecDecodeSelfFromArray(yyl2, d)
        }
        z.DecReadArrayEnd()
    } else {
        panic(errCodecSelferOnlyMapOrArrayEncodeToStruct3232)
    }
}

func (x *ServiceRegistration) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
    for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ {
        z.DecReadMapElemKey()
        yys3 := r.DecodeStringAsBytes()
        z.DecReadMapElemValue()
        switch string(yys3) {
        case "msg_type":
            if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                z.DecExtension(&x.Type, yyxt5)
            } else {
                x.Type = (MessageType)(r.DecodeInt64())
            }
        case "service_name":
            x.ServiceName = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        case "url":
            x.URL = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
        default:
            z.DecStructFieldNotFound(-1, string(yys3))
        } // end switch yys3
    } // end for yyj3
}

func (x *ServiceRegistration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj8 int
    var yyb8 bool
    var yyhl8 bool = l >= 0
    yyb8 = !z.DecContainerNext(yyj8, l, yyhl8)
    if yyb8 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if yyxt10 := z.Extension(x.Type); yyxt10 != nil {
        z.DecExtension(&x.Type, yyxt10)
    } else {
        x.Type = (MessageType)(r.DecodeInt64())
    }
    yyj8++
    yyb8 = !z.DecContainerNext(yyj8, l, yyhl8)
    if yyb8 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.ServiceName = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj8++
    yyb8 = !z.DecContainerNext(yyj8, l, yyhl8)
    if yyb8 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    x.URL = (string)(z.DecStringZC(r.DecodeStringAsBytes()))
    yyj8++
    for ; z.DecContainerNext(yyj8, l, yyhl8); yyj8++ {
        z.DecReadArrayElem()
        z.DecStructFieldNotFound(yyj8-1, "")
    }
}

func (x *ServiceRegistration) IsCodecEmpty() bool {
    return !(x.Type != 0 || x.ServiceName != "" || x.URL != "" || false)
}

func (ServiceAlive) codecSelferViaCodecgen() {}
func (x *ServiceAlive) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
        z.EncEncode(x)
        return
    }
    if x == nil {
        r.EncodeNil()
    } else {
        yy2arr2 := z.EncBasicHandle().StructToArray
        _ = yy2arr2
        const yyr2 bool = false // struct tag has 'toArray'
        if yyr2 || yy2arr2 {
            z.EncWriteArrayStart(1)
            z.EncWriteArrayElem()
            if yyxt4 := z.Extension(x.Type); yyxt4 != nil {
                z.EncExtension(x.Type, yyxt4)
            } else {
                r.EncodeInt(int64(x.Type))
            }
            z.EncWriteArrayEnd()
        } else {
            z.EncWriteMapStart(1)
            if z.EncBasicHandle().Canonical {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                    z.EncExtension(x.Type, yyxt5)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
            } else {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt6 := z.Extension(x.Type); yyxt6 != nil {
                    z.EncExtension(x.Type, yyxt6)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
            }
            z.EncWriteMapEnd()
        }
    }
}

func (x *ServiceAlive) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
    if yyct2 == codecSelferValueTypeNil3232 {
        *(x) = ServiceAlive{}
    } else if yyct2 == codecSelferValueTypeMap3232 {
        yyl2 := z.DecReadMapStart()
        if yyl2 == 0 {
        } else {
            x.codecDecodeSelfFromMap(yyl2, d)
        }
        z.DecReadMapEnd()
    } else if yyct2 == codecSelferValueTypeArray3232 {
        yyl2 := z.DecReadArrayStart()
        if yyl2 != 0 {
            x.codecDecodeSelfFromArray(yyl2, d)
        }
        z.DecReadArrayEnd()
    } else {
        panic(errCodecSelferOnlyMapOrArrayEncodeToStruct3232)
    }
}

func (x *ServiceAlive) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
    for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ {
        z.DecReadMapElemKey()
        yys3 := r.DecodeStringAsBytes()
        z.DecReadMapElemValue()
        switch string(yys3) {
        case "msg_type":
            if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                z.DecExtension(&x.Type, yyxt5)
            } else {
                x.Type = (MessageType)(r.DecodeInt64())
            }
        default:
            z.DecStructFieldNotFound(-1, string(yys3))
        } // end switch yys3
    } // end for yyj3
}

func (x *ServiceAlive) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj6 int
    var yyb6 bool
    var yyhl6 bool = l >= 0
    yyb6 = !z.DecContainerNext(yyj6, l, yyhl6)
    if yyb6 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if yyxt8 := z.Extension(x.Type); yyxt8 != nil {
        z.DecExtension(&x.Type, yyxt8)
    } else {
        x.Type = (MessageType)(r.DecodeInt64())
    }
    yyj6++
    for ; z.DecContainerNext(yyj6, l, yyhl6); yyj6++ {
        z.DecReadArrayElem()
        z.DecStructFieldNotFound(yyj6-1, "")
    }
}

func (x *ServiceAlive) IsCodecEmpty() bool {
    return !(x.Type != 0 || false)
}

func (Unknown) codecSelferViaCodecgen() {}
func (x *Unknown) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
        z.EncEncode(x)
        return
    }
    if x == nil {
        r.EncodeNil()
    } else {
        yy2arr2 := z.EncBasicHandle().StructToArray
        _ = yy2arr2
        const yyr2 bool = false // struct tag has 'toArray'
        if yyr2 || yy2arr2 {
            z.EncWriteArrayStart(1)
            z.EncWriteArrayElem()
            if yyxt4 := z.Extension(x.Type); yyxt4 != nil {
                z.EncExtension(x.Type, yyxt4)
            } else {
                r.EncodeInt(int64(x.Type))
            }
            z.EncWriteArrayEnd()
        } else {
            z.EncWriteMapStart(1)
            if z.EncBasicHandle().Canonical {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                    z.EncExtension(x.Type, yyxt5)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
            } else {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt6 := z.Extension(x.Type); yyxt6 != nil {
                    z.EncExtension(x.Type, yyxt6)
                } else {
                    r.EncodeInt(int64(x.Type))
                }
            }
            z.EncWriteMapEnd()
        }
    }
}

func (x *Unknown) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
    if yyct2 == codecSelferValueTypeNil3232 {
        *(x) = Unknown{}
    } else if yyct2 == codecSelferValueTypeMap3232 {
        yyl2 := z.DecReadMapStart()
        if yyl2 == 0 {
        } else {
            x.codecDecodeSelfFromMap(yyl2, d)
        }
        z.DecReadMapEnd()
    } else if yyct2 == codecSelferValueTypeArray3232 {
        yyl2 := z.DecReadArrayStart()
        if yyl2 != 0 {
            x.codecDecodeSelfFromArray(yyl2, d)
        }
        z.DecReadArrayEnd()
    } else {
        panic(errCodecSelferOnlyMapOrArrayEncodeToStruct3232)
    }
}

func (x *Unknown) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
    for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ {
        z.DecReadMapElemKey()
        yys3 := r.DecodeStringAsBytes()
        z.DecReadMapElemValue()
        switch string(yys3) {
        case "msg_type":
            if yyxt5 := z.Extension(x.Type); yyxt5 != nil {
                z.DecExtension(&x.Type, yyxt5)
            } else {
                x.Type = (MessageType)(r.DecodeInt64())
            }
        default:
            z.DecStructFieldNotFound(-1, string(yys3))
        } // end switch yys3
    } // end for yyj3
}

func (x *Unknown) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj6 int
    var yyb6 bool
    var yyhl6 bool = l >= 0
    yyb6 = !z.DecContainerNext(yyj6, l, yyhl6)
    if yyb6 {
        z.DecReadArrayEnd()
        return
    }
    z.DecReadArrayElem()
    if yyxt8 := z.Extension(x.Type); yyxt8 != nil {
        z.DecExtension(&x.Type, yyxt8)
    } else {
        x.Type = (MessageType)(r.DecodeInt64())
    }
    yyj6++
    for ; z.DecContainerNext(yyj6, l, yyhl6); yyj6++ {
        z.DecReadArrayElem()
        z.DecStructFieldNotFound(yyj6-1, "")
    }
}

func (x *Unknown) IsCodecEmpty() bool {
    return !(x.Type != 0 || false)
}

func (x codecSelfer3232) encSliceSlicestring(v [][]string, e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if v == nil {
        r.EncodeNil()
        return
    }
    z.EncWriteArrayStart(len(v))
    for yyv1 := range v {
        z.EncWriteArrayElem()
        if v[yyv1] == nil {
            r.EncodeNil()
        } else {
            z.F.EncSliceStringV(v[yyv1], e)
        } // end block: if v[yyv1] slice == nil
    }
    z.EncWriteArrayEnd()
}

func (x codecSelfer3232) decSliceSlicestring(v *[][]string, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r

    yyv1 := *v
    yyh1, yyl1 := z.DecSliceHelperStart()
    var yyc1 bool
    _ = yyc1
    if yyh1.IsNil {
        if yyv1 != nil {
            yyv1 = nil
            yyc1 = true
        }
    } else if yyl1 == 0 {
        if yyv1 == nil {
            yyv1 = [][]string{}
            yyc1 = true
        } else if len(yyv1) != 0 {
            yyv1 = yyv1[:0]
            yyc1 = true
        }
    } else {
        yyhl1 := yyl1 > 0
        var yyrl1 int
        _ = yyrl1
        if yyhl1 {
            if yyl1 > cap(yyv1) {
                yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 24)
                if yyrl1 <= cap(yyv1) {
                    yyv1 = yyv1[:yyrl1]
                } else {
                    yyv1 = make([][]string, yyrl1)
                }
                yyc1 = true
            } else if yyl1 != len(yyv1) {
                yyv1 = yyv1[:yyl1]
                yyc1 = true
            }
        }
        var yyj1 int
        for yyj1 = 0; z.DecContainerNext(yyj1, yyl1, yyhl1); yyj1++ {
            if yyj1 == 0 && yyv1 == nil {
                if yyhl1 {
                    yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 24)
                } else {
                    yyrl1 = 8
                }
                yyv1 = make([][]string, yyrl1)
                yyc1 = true
            }
            yyh1.ElemContainerState(yyj1)
            var yydb1 bool
            if yyj1 >= len(yyv1) {
                yyv1 = append(yyv1, nil)
                yyc1 = true
            }
            if yydb1 {
                z.DecSwallow()
            } else {
                z.F.DecSliceStringX(&yyv1[yyj1], d)
            }
        }
        if yyj1 < len(yyv1) {
            yyv1 = yyv1[:yyj1]
            yyc1 = true
        } else if yyj1 == 0 && yyv1 == nil {
            yyv1 = [][]string{}
            yyc1 = true
        }
    }
    yyh1.End()
    if yyc1 {
        *v = yyv1
    }
}