//------------------------------------------------------------------------------
// Automatically generated by the Fast Binary Encoding compiler, do not modify!
// https://github.com/chronoxor/FastBinaryEncoding
// Source: test.fbe
// FBE version: 1.15.0.0
//------------------------------------------------------------------------------

package test

import "errors"
import "../fbe"
import "../proto"

// Workaround for Go unused imports issue
var _ = errors.New
var _ = fbe.Version
var _ = proto.Version

// Fast Binary Encoding StructOptional field model
type FieldModelStructOptional struct {
    // Field model buffer
    buffer *fbe.Buffer
    // Field model buffer offset
    offset int

    *FieldModelStructSimple
    F100 *FieldModelOptionalBool
    F101 *FieldModelOptionalBool
    F102 *FieldModelOptionalBool
    F103 *FieldModelOptionalByte
    F104 *FieldModelOptionalByte
    F105 *FieldModelOptionalByte
    F106 *FieldModelOptionalChar
    F107 *FieldModelOptionalChar
    F108 *FieldModelOptionalChar
    F109 *FieldModelOptionalWChar
    F110 *FieldModelOptionalWChar
    F111 *FieldModelOptionalWChar
    F112 *FieldModelOptionalInt8
    F113 *FieldModelOptionalInt8
    F114 *FieldModelOptionalInt8
    F115 *FieldModelOptionalUInt8
    F116 *FieldModelOptionalUInt8
    F117 *FieldModelOptionalUInt8
    F118 *FieldModelOptionalInt16
    F119 *FieldModelOptionalInt16
    F120 *FieldModelOptionalInt16
    F121 *FieldModelOptionalUInt16
    F122 *FieldModelOptionalUInt16
    F123 *FieldModelOptionalUInt16
    F124 *FieldModelOptionalInt32
    F125 *FieldModelOptionalInt32
    F126 *FieldModelOptionalInt32
    F127 *FieldModelOptionalUInt32
    F128 *FieldModelOptionalUInt32
    F129 *FieldModelOptionalUInt32
    F130 *FieldModelOptionalInt64
    F131 *FieldModelOptionalInt64
    F132 *FieldModelOptionalInt64
    F133 *FieldModelOptionalUInt64
    F134 *FieldModelOptionalUInt64
    F135 *FieldModelOptionalUInt64
    F136 *FieldModelOptionalFloat
    F137 *FieldModelOptionalFloat
    F138 *FieldModelOptionalFloat
    F139 *FieldModelOptionalDouble
    F140 *FieldModelOptionalDouble
    F141 *FieldModelOptionalDouble
    F142 *FieldModelOptionalDecimal
    F143 *FieldModelOptionalDecimal
    F144 *FieldModelOptionalDecimal
    F145 *FieldModelOptionalString
    F146 *FieldModelOptionalString
    F147 *FieldModelOptionalString
    F148 *FieldModelOptionalTimestamp
    F149 *FieldModelOptionalTimestamp
    F150 *FieldModelOptionalTimestamp
    F151 *FieldModelOptionalUUID
    F152 *FieldModelOptionalUUID
    F153 *FieldModelOptionalUUID
    F154 *FieldModelOptionalprotoOrderSide
    F155 *FieldModelOptionalprotoOrderSide
    F156 *FieldModelOptionalprotoOrderType
    F157 *FieldModelOptionalprotoOrderType
    F158 *FieldModelOptionalprotoOrder
    F159 *FieldModelOptionalprotoOrder
    F160 *FieldModelOptionalprotoBalance
    F161 *FieldModelOptionalprotoBalance
    F162 *FieldModelOptionalprotoState
    F163 *FieldModelOptionalprotoState
    F164 *FieldModelOptionalprotoAccount
    F165 *FieldModelOptionalprotoAccount
}

// Create a new StructOptional field model
func NewFieldModelStructOptional(buffer *fbe.Buffer, offset int) *FieldModelStructOptional {
    fbeResult := FieldModelStructOptional{buffer: buffer, offset: offset}
    fbeResult.FieldModelStructSimple = NewFieldModelStructSimple(buffer, 4 + 4)
    fbeResult.F100 = NewFieldModelOptionalBool(buffer, fbeResult.FieldModelStructSimple.FBEOffset() + fbeResult.FieldModelStructSimple.FBEBody() - 4 - 4)
    fbeResult.F101 = NewFieldModelOptionalBool(buffer, fbeResult.F100.FBEOffset() + fbeResult.F100.FBESize())
    fbeResult.F102 = NewFieldModelOptionalBool(buffer, fbeResult.F101.FBEOffset() + fbeResult.F101.FBESize())
    fbeResult.F103 = NewFieldModelOptionalByte(buffer, fbeResult.F102.FBEOffset() + fbeResult.F102.FBESize())
    fbeResult.F104 = NewFieldModelOptionalByte(buffer, fbeResult.F103.FBEOffset() + fbeResult.F103.FBESize())
    fbeResult.F105 = NewFieldModelOptionalByte(buffer, fbeResult.F104.FBEOffset() + fbeResult.F104.FBESize())
    fbeResult.F106 = NewFieldModelOptionalChar(buffer, fbeResult.F105.FBEOffset() + fbeResult.F105.FBESize())
    fbeResult.F107 = NewFieldModelOptionalChar(buffer, fbeResult.F106.FBEOffset() + fbeResult.F106.FBESize())
    fbeResult.F108 = NewFieldModelOptionalChar(buffer, fbeResult.F107.FBEOffset() + fbeResult.F107.FBESize())
    fbeResult.F109 = NewFieldModelOptionalWChar(buffer, fbeResult.F108.FBEOffset() + fbeResult.F108.FBESize())
    fbeResult.F110 = NewFieldModelOptionalWChar(buffer, fbeResult.F109.FBEOffset() + fbeResult.F109.FBESize())
    fbeResult.F111 = NewFieldModelOptionalWChar(buffer, fbeResult.F110.FBEOffset() + fbeResult.F110.FBESize())
    fbeResult.F112 = NewFieldModelOptionalInt8(buffer, fbeResult.F111.FBEOffset() + fbeResult.F111.FBESize())
    fbeResult.F113 = NewFieldModelOptionalInt8(buffer, fbeResult.F112.FBEOffset() + fbeResult.F112.FBESize())
    fbeResult.F114 = NewFieldModelOptionalInt8(buffer, fbeResult.F113.FBEOffset() + fbeResult.F113.FBESize())
    fbeResult.F115 = NewFieldModelOptionalUInt8(buffer, fbeResult.F114.FBEOffset() + fbeResult.F114.FBESize())
    fbeResult.F116 = NewFieldModelOptionalUInt8(buffer, fbeResult.F115.FBEOffset() + fbeResult.F115.FBESize())
    fbeResult.F117 = NewFieldModelOptionalUInt8(buffer, fbeResult.F116.FBEOffset() + fbeResult.F116.FBESize())
    fbeResult.F118 = NewFieldModelOptionalInt16(buffer, fbeResult.F117.FBEOffset() + fbeResult.F117.FBESize())
    fbeResult.F119 = NewFieldModelOptionalInt16(buffer, fbeResult.F118.FBEOffset() + fbeResult.F118.FBESize())
    fbeResult.F120 = NewFieldModelOptionalInt16(buffer, fbeResult.F119.FBEOffset() + fbeResult.F119.FBESize())
    fbeResult.F121 = NewFieldModelOptionalUInt16(buffer, fbeResult.F120.FBEOffset() + fbeResult.F120.FBESize())
    fbeResult.F122 = NewFieldModelOptionalUInt16(buffer, fbeResult.F121.FBEOffset() + fbeResult.F121.FBESize())
    fbeResult.F123 = NewFieldModelOptionalUInt16(buffer, fbeResult.F122.FBEOffset() + fbeResult.F122.FBESize())
    fbeResult.F124 = NewFieldModelOptionalInt32(buffer, fbeResult.F123.FBEOffset() + fbeResult.F123.FBESize())
    fbeResult.F125 = NewFieldModelOptionalInt32(buffer, fbeResult.F124.FBEOffset() + fbeResult.F124.FBESize())
    fbeResult.F126 = NewFieldModelOptionalInt32(buffer, fbeResult.F125.FBEOffset() + fbeResult.F125.FBESize())
    fbeResult.F127 = NewFieldModelOptionalUInt32(buffer, fbeResult.F126.FBEOffset() + fbeResult.F126.FBESize())
    fbeResult.F128 = NewFieldModelOptionalUInt32(buffer, fbeResult.F127.FBEOffset() + fbeResult.F127.FBESize())
    fbeResult.F129 = NewFieldModelOptionalUInt32(buffer, fbeResult.F128.FBEOffset() + fbeResult.F128.FBESize())
    fbeResult.F130 = NewFieldModelOptionalInt64(buffer, fbeResult.F129.FBEOffset() + fbeResult.F129.FBESize())
    fbeResult.F131 = NewFieldModelOptionalInt64(buffer, fbeResult.F130.FBEOffset() + fbeResult.F130.FBESize())
    fbeResult.F132 = NewFieldModelOptionalInt64(buffer, fbeResult.F131.FBEOffset() + fbeResult.F131.FBESize())
    fbeResult.F133 = NewFieldModelOptionalUInt64(buffer, fbeResult.F132.FBEOffset() + fbeResult.F132.FBESize())
    fbeResult.F134 = NewFieldModelOptionalUInt64(buffer, fbeResult.F133.FBEOffset() + fbeResult.F133.FBESize())
    fbeResult.F135 = NewFieldModelOptionalUInt64(buffer, fbeResult.F134.FBEOffset() + fbeResult.F134.FBESize())
    fbeResult.F136 = NewFieldModelOptionalFloat(buffer, fbeResult.F135.FBEOffset() + fbeResult.F135.FBESize())
    fbeResult.F137 = NewFieldModelOptionalFloat(buffer, fbeResult.F136.FBEOffset() + fbeResult.F136.FBESize())
    fbeResult.F138 = NewFieldModelOptionalFloat(buffer, fbeResult.F137.FBEOffset() + fbeResult.F137.FBESize())
    fbeResult.F139 = NewFieldModelOptionalDouble(buffer, fbeResult.F138.FBEOffset() + fbeResult.F138.FBESize())
    fbeResult.F140 = NewFieldModelOptionalDouble(buffer, fbeResult.F139.FBEOffset() + fbeResult.F139.FBESize())
    fbeResult.F141 = NewFieldModelOptionalDouble(buffer, fbeResult.F140.FBEOffset() + fbeResult.F140.FBESize())
    fbeResult.F142 = NewFieldModelOptionalDecimal(buffer, fbeResult.F141.FBEOffset() + fbeResult.F141.FBESize())
    fbeResult.F143 = NewFieldModelOptionalDecimal(buffer, fbeResult.F142.FBEOffset() + fbeResult.F142.FBESize())
    fbeResult.F144 = NewFieldModelOptionalDecimal(buffer, fbeResult.F143.FBEOffset() + fbeResult.F143.FBESize())
    fbeResult.F145 = NewFieldModelOptionalString(buffer, fbeResult.F144.FBEOffset() + fbeResult.F144.FBESize())
    fbeResult.F146 = NewFieldModelOptionalString(buffer, fbeResult.F145.FBEOffset() + fbeResult.F145.FBESize())
    fbeResult.F147 = NewFieldModelOptionalString(buffer, fbeResult.F146.FBEOffset() + fbeResult.F146.FBESize())
    fbeResult.F148 = NewFieldModelOptionalTimestamp(buffer, fbeResult.F147.FBEOffset() + fbeResult.F147.FBESize())
    fbeResult.F149 = NewFieldModelOptionalTimestamp(buffer, fbeResult.F148.FBEOffset() + fbeResult.F148.FBESize())
    fbeResult.F150 = NewFieldModelOptionalTimestamp(buffer, fbeResult.F149.FBEOffset() + fbeResult.F149.FBESize())
    fbeResult.F151 = NewFieldModelOptionalUUID(buffer, fbeResult.F150.FBEOffset() + fbeResult.F150.FBESize())
    fbeResult.F152 = NewFieldModelOptionalUUID(buffer, fbeResult.F151.FBEOffset() + fbeResult.F151.FBESize())
    fbeResult.F153 = NewFieldModelOptionalUUID(buffer, fbeResult.F152.FBEOffset() + fbeResult.F152.FBESize())
    fbeResult.F154 = NewFieldModelOptionalprotoOrderSide(buffer, fbeResult.F153.FBEOffset() + fbeResult.F153.FBESize())
    fbeResult.F155 = NewFieldModelOptionalprotoOrderSide(buffer, fbeResult.F154.FBEOffset() + fbeResult.F154.FBESize())
    fbeResult.F156 = NewFieldModelOptionalprotoOrderType(buffer, fbeResult.F155.FBEOffset() + fbeResult.F155.FBESize())
    fbeResult.F157 = NewFieldModelOptionalprotoOrderType(buffer, fbeResult.F156.FBEOffset() + fbeResult.F156.FBESize())
    fbeResult.F158 = NewFieldModelOptionalprotoOrder(buffer, fbeResult.F157.FBEOffset() + fbeResult.F157.FBESize())
    fbeResult.F159 = NewFieldModelOptionalprotoOrder(buffer, fbeResult.F158.FBEOffset() + fbeResult.F158.FBESize())
    fbeResult.F160 = NewFieldModelOptionalprotoBalance(buffer, fbeResult.F159.FBEOffset() + fbeResult.F159.FBESize())
    fbeResult.F161 = NewFieldModelOptionalprotoBalance(buffer, fbeResult.F160.FBEOffset() + fbeResult.F160.FBESize())
    fbeResult.F162 = NewFieldModelOptionalprotoState(buffer, fbeResult.F161.FBEOffset() + fbeResult.F161.FBESize())
    fbeResult.F163 = NewFieldModelOptionalprotoState(buffer, fbeResult.F162.FBEOffset() + fbeResult.F162.FBESize())
    fbeResult.F164 = NewFieldModelOptionalprotoAccount(buffer, fbeResult.F163.FBEOffset() + fbeResult.F163.FBESize())
    fbeResult.F165 = NewFieldModelOptionalprotoAccount(buffer, fbeResult.F164.FBEOffset() + fbeResult.F164.FBESize())
    return &fbeResult
}

// Get the field size
func (fm *FieldModelStructOptional) FBESize() int { return 4 }

// Get the field body size
func (fm *FieldModelStructOptional) FBEBody() int {
    fbeResult := 4 + 4 +
        fm.FieldModelStructSimple.FBEBody() - 4 - 4 +
        fm.F100.FBESize() +
        fm.F101.FBESize() +
        fm.F102.FBESize() +
        fm.F103.FBESize() +
        fm.F104.FBESize() +
        fm.F105.FBESize() +
        fm.F106.FBESize() +
        fm.F107.FBESize() +
        fm.F108.FBESize() +
        fm.F109.FBESize() +
        fm.F110.FBESize() +
        fm.F111.FBESize() +
        fm.F112.FBESize() +
        fm.F113.FBESize() +
        fm.F114.FBESize() +
        fm.F115.FBESize() +
        fm.F116.FBESize() +
        fm.F117.FBESize() +
        fm.F118.FBESize() +
        fm.F119.FBESize() +
        fm.F120.FBESize() +
        fm.F121.FBESize() +
        fm.F122.FBESize() +
        fm.F123.FBESize() +
        fm.F124.FBESize() +
        fm.F125.FBESize() +
        fm.F126.FBESize() +
        fm.F127.FBESize() +
        fm.F128.FBESize() +
        fm.F129.FBESize() +
        fm.F130.FBESize() +
        fm.F131.FBESize() +
        fm.F132.FBESize() +
        fm.F133.FBESize() +
        fm.F134.FBESize() +
        fm.F135.FBESize() +
        fm.F136.FBESize() +
        fm.F137.FBESize() +
        fm.F138.FBESize() +
        fm.F139.FBESize() +
        fm.F140.FBESize() +
        fm.F141.FBESize() +
        fm.F142.FBESize() +
        fm.F143.FBESize() +
        fm.F144.FBESize() +
        fm.F145.FBESize() +
        fm.F146.FBESize() +
        fm.F147.FBESize() +
        fm.F148.FBESize() +
        fm.F149.FBESize() +
        fm.F150.FBESize() +
        fm.F151.FBESize() +
        fm.F152.FBESize() +
        fm.F153.FBESize() +
        fm.F154.FBESize() +
        fm.F155.FBESize() +
        fm.F156.FBESize() +
        fm.F157.FBESize() +
        fm.F158.FBESize() +
        fm.F159.FBESize() +
        fm.F160.FBESize() +
        fm.F161.FBESize() +
        fm.F162.FBESize() +
        fm.F163.FBESize() +
        fm.F164.FBESize() +
        fm.F165.FBESize() +
        0
    return fbeResult
}

// Get the field extra size
func (fm *FieldModelStructOptional) FBEExtra() int {
    if (fm.buffer.Offset() + fm.FBEOffset() + fm.FBESize()) > fm.buffer.Size() {
        return 0
    }

    fbeStructOffset := int(fbe.ReadUInt32(fm.buffer.Data(), fm.buffer.Offset() + fm.FBEOffset()))
    if (fbeStructOffset == 0) || ((fm.buffer.Offset() + fbeStructOffset + 4) > fm.buffer.Size()) {
        return 0
    }

    fm.buffer.Shift(fbeStructOffset)

    fbeResult := fm.FBEBody() +
        fm.FieldModelStructSimple.FBEExtra() + 
        fm.F100.FBEExtra() +
        fm.F101.FBEExtra() +
        fm.F102.FBEExtra() +
        fm.F103.FBEExtra() +
        fm.F104.FBEExtra() +
        fm.F105.FBEExtra() +
        fm.F106.FBEExtra() +
        fm.F107.FBEExtra() +
        fm.F108.FBEExtra() +
        fm.F109.FBEExtra() +
        fm.F110.FBEExtra() +
        fm.F111.FBEExtra() +
        fm.F112.FBEExtra() +
        fm.F113.FBEExtra() +
        fm.F114.FBEExtra() +
        fm.F115.FBEExtra() +
        fm.F116.FBEExtra() +
        fm.F117.FBEExtra() +
        fm.F118.FBEExtra() +
        fm.F119.FBEExtra() +
        fm.F120.FBEExtra() +
        fm.F121.FBEExtra() +
        fm.F122.FBEExtra() +
        fm.F123.FBEExtra() +
        fm.F124.FBEExtra() +
        fm.F125.FBEExtra() +
        fm.F126.FBEExtra() +
        fm.F127.FBEExtra() +
        fm.F128.FBEExtra() +
        fm.F129.FBEExtra() +
        fm.F130.FBEExtra() +
        fm.F131.FBEExtra() +
        fm.F132.FBEExtra() +
        fm.F133.FBEExtra() +
        fm.F134.FBEExtra() +
        fm.F135.FBEExtra() +
        fm.F136.FBEExtra() +
        fm.F137.FBEExtra() +
        fm.F138.FBEExtra() +
        fm.F139.FBEExtra() +
        fm.F140.FBEExtra() +
        fm.F141.FBEExtra() +
        fm.F142.FBEExtra() +
        fm.F143.FBEExtra() +
        fm.F144.FBEExtra() +
        fm.F145.FBEExtra() +
        fm.F146.FBEExtra() +
        fm.F147.FBEExtra() +
        fm.F148.FBEExtra() +
        fm.F149.FBEExtra() +
        fm.F150.FBEExtra() +
        fm.F151.FBEExtra() +
        fm.F152.FBEExtra() +
        fm.F153.FBEExtra() +
        fm.F154.FBEExtra() +
        fm.F155.FBEExtra() +
        fm.F156.FBEExtra() +
        fm.F157.FBEExtra() +
        fm.F158.FBEExtra() +
        fm.F159.FBEExtra() +
        fm.F160.FBEExtra() +
        fm.F161.FBEExtra() +
        fm.F162.FBEExtra() +
        fm.F163.FBEExtra() +
        fm.F164.FBEExtra() +
        fm.F165.FBEExtra() +
        0

    fm.buffer.Unshift(fbeStructOffset)

    return fbeResult
}

// Get the field type
func (fm *FieldModelStructOptional) FBEType() int { return 111 }

// Get the field offset
func (fm *FieldModelStructOptional) FBEOffset() int { return fm.offset }
// Set the field offset
func (fm *FieldModelStructOptional) SetFBEOffset(value int) { fm.offset = value }

// Shift the current field offset
func (fm *FieldModelStructOptional) FBEShift(size int) { fm.offset += size }
// Unshift the current field offset
func (fm *FieldModelStructOptional) FBEUnshift(size int) { fm.offset -= size }

// Check if the struct value is valid
func (fm *FieldModelStructOptional) Verify() bool { return fm.VerifyType(true) }

// Check if the struct value and its type are valid
func (fm *FieldModelStructOptional) VerifyType(fbeVerifyType bool) bool {
    if (fm.buffer.Offset() + fm.FBEOffset() + fm.FBESize()) > fm.buffer.Size() {
        return true
    }

    fbeStructOffset := int(fbe.ReadUInt32(fm.buffer.Data(), fm.buffer.Offset() + fm.FBEOffset()))
    if (fbeStructOffset == 0) || ((fm.buffer.Offset() + fbeStructOffset + 4 + 4) > fm.buffer.Size()) {
        return false
    }

    fbeStructSize := int(fbe.ReadUInt32(fm.buffer.Data(), fm.buffer.Offset() + fbeStructOffset))
    if fbeStructSize < (4 + 4) {
        return false
    }

    fbeStructType := int(fbe.ReadUInt32(fm.buffer.Data(), fm.buffer.Offset() + fbeStructOffset + 4))
    if fbeVerifyType && (fbeStructType != fm.FBEType()) {
        return false
    }

    fm.buffer.Shift(fbeStructOffset)
    fbeResult := fm.VerifyFields(fbeStructSize)
    fm.buffer.Unshift(fbeStructOffset)
    return fbeResult
}

// // Check if the struct value fields are valid
func (fm *FieldModelStructOptional) VerifyFields(fbeStructSize int) bool {
    fbeCurrentSize := 4 + 4

    if (fbeCurrentSize + fm.FieldModelStructSimple.FBEBody() - 4 - 4) > fbeStructSize {
        return true
    }
    if !fm.FieldModelStructSimple.VerifyFields(fbeStructSize) {
        return false
    }
    fbeCurrentSize += fm.FieldModelStructSimple.FBEBody() - 4 - 4

    if (fbeCurrentSize + fm.F100.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F100.Verify() {
        return false
    }
    fbeCurrentSize += fm.F100.FBESize()

    if (fbeCurrentSize + fm.F101.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F101.Verify() {
        return false
    }
    fbeCurrentSize += fm.F101.FBESize()

    if (fbeCurrentSize + fm.F102.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F102.Verify() {
        return false
    }
    fbeCurrentSize += fm.F102.FBESize()

    if (fbeCurrentSize + fm.F103.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F103.Verify() {
        return false
    }
    fbeCurrentSize += fm.F103.FBESize()

    if (fbeCurrentSize + fm.F104.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F104.Verify() {
        return false
    }
    fbeCurrentSize += fm.F104.FBESize()

    if (fbeCurrentSize + fm.F105.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F105.Verify() {
        return false
    }
    fbeCurrentSize += fm.F105.FBESize()

    if (fbeCurrentSize + fm.F106.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F106.Verify() {
        return false
    }
    fbeCurrentSize += fm.F106.FBESize()

    if (fbeCurrentSize + fm.F107.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F107.Verify() {
        return false
    }
    fbeCurrentSize += fm.F107.FBESize()

    if (fbeCurrentSize + fm.F108.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F108.Verify() {
        return false
    }
    fbeCurrentSize += fm.F108.FBESize()

    if (fbeCurrentSize + fm.F109.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F109.Verify() {
        return false
    }
    fbeCurrentSize += fm.F109.FBESize()

    if (fbeCurrentSize + fm.F110.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F110.Verify() {
        return false
    }
    fbeCurrentSize += fm.F110.FBESize()

    if (fbeCurrentSize + fm.F111.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F111.Verify() {
        return false
    }
    fbeCurrentSize += fm.F111.FBESize()

    if (fbeCurrentSize + fm.F112.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F112.Verify() {
        return false
    }
    fbeCurrentSize += fm.F112.FBESize()

    if (fbeCurrentSize + fm.F113.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F113.Verify() {
        return false
    }
    fbeCurrentSize += fm.F113.FBESize()

    if (fbeCurrentSize + fm.F114.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F114.Verify() {
        return false
    }
    fbeCurrentSize += fm.F114.FBESize()

    if (fbeCurrentSize + fm.F115.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F115.Verify() {
        return false
    }
    fbeCurrentSize += fm.F115.FBESize()

    if (fbeCurrentSize + fm.F116.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F116.Verify() {
        return false
    }
    fbeCurrentSize += fm.F116.FBESize()

    if (fbeCurrentSize + fm.F117.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F117.Verify() {
        return false
    }
    fbeCurrentSize += fm.F117.FBESize()

    if (fbeCurrentSize + fm.F118.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F118.Verify() {
        return false
    }
    fbeCurrentSize += fm.F118.FBESize()

    if (fbeCurrentSize + fm.F119.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F119.Verify() {
        return false
    }
    fbeCurrentSize += fm.F119.FBESize()

    if (fbeCurrentSize + fm.F120.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F120.Verify() {
        return false
    }
    fbeCurrentSize += fm.F120.FBESize()

    if (fbeCurrentSize + fm.F121.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F121.Verify() {
        return false
    }
    fbeCurrentSize += fm.F121.FBESize()

    if (fbeCurrentSize + fm.F122.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F122.Verify() {
        return false
    }
    fbeCurrentSize += fm.F122.FBESize()

    if (fbeCurrentSize + fm.F123.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F123.Verify() {
        return false
    }
    fbeCurrentSize += fm.F123.FBESize()

    if (fbeCurrentSize + fm.F124.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F124.Verify() {
        return false
    }
    fbeCurrentSize += fm.F124.FBESize()

    if (fbeCurrentSize + fm.F125.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F125.Verify() {
        return false
    }
    fbeCurrentSize += fm.F125.FBESize()

    if (fbeCurrentSize + fm.F126.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F126.Verify() {
        return false
    }
    fbeCurrentSize += fm.F126.FBESize()

    if (fbeCurrentSize + fm.F127.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F127.Verify() {
        return false
    }
    fbeCurrentSize += fm.F127.FBESize()

    if (fbeCurrentSize + fm.F128.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F128.Verify() {
        return false
    }
    fbeCurrentSize += fm.F128.FBESize()

    if (fbeCurrentSize + fm.F129.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F129.Verify() {
        return false
    }
    fbeCurrentSize += fm.F129.FBESize()

    if (fbeCurrentSize + fm.F130.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F130.Verify() {
        return false
    }
    fbeCurrentSize += fm.F130.FBESize()

    if (fbeCurrentSize + fm.F131.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F131.Verify() {
        return false
    }
    fbeCurrentSize += fm.F131.FBESize()

    if (fbeCurrentSize + fm.F132.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F132.Verify() {
        return false
    }
    fbeCurrentSize += fm.F132.FBESize()

    if (fbeCurrentSize + fm.F133.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F133.Verify() {
        return false
    }
    fbeCurrentSize += fm.F133.FBESize()

    if (fbeCurrentSize + fm.F134.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F134.Verify() {
        return false
    }
    fbeCurrentSize += fm.F134.FBESize()

    if (fbeCurrentSize + fm.F135.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F135.Verify() {
        return false
    }
    fbeCurrentSize += fm.F135.FBESize()

    if (fbeCurrentSize + fm.F136.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F136.Verify() {
        return false
    }
    fbeCurrentSize += fm.F136.FBESize()

    if (fbeCurrentSize + fm.F137.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F137.Verify() {
        return false
    }
    fbeCurrentSize += fm.F137.FBESize()

    if (fbeCurrentSize + fm.F138.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F138.Verify() {
        return false
    }
    fbeCurrentSize += fm.F138.FBESize()

    if (fbeCurrentSize + fm.F139.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F139.Verify() {
        return false
    }
    fbeCurrentSize += fm.F139.FBESize()

    if (fbeCurrentSize + fm.F140.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F140.Verify() {
        return false
    }
    fbeCurrentSize += fm.F140.FBESize()

    if (fbeCurrentSize + fm.F141.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F141.Verify() {
        return false
    }
    fbeCurrentSize += fm.F141.FBESize()

    if (fbeCurrentSize + fm.F142.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F142.Verify() {
        return false
    }
    fbeCurrentSize += fm.F142.FBESize()

    if (fbeCurrentSize + fm.F143.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F143.Verify() {
        return false
    }
    fbeCurrentSize += fm.F143.FBESize()

    if (fbeCurrentSize + fm.F144.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F144.Verify() {
        return false
    }
    fbeCurrentSize += fm.F144.FBESize()

    if (fbeCurrentSize + fm.F145.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F145.Verify() {
        return false
    }
    fbeCurrentSize += fm.F145.FBESize()

    if (fbeCurrentSize + fm.F146.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F146.Verify() {
        return false
    }
    fbeCurrentSize += fm.F146.FBESize()

    if (fbeCurrentSize + fm.F147.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F147.Verify() {
        return false
    }
    fbeCurrentSize += fm.F147.FBESize()

    if (fbeCurrentSize + fm.F148.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F148.Verify() {
        return false
    }
    fbeCurrentSize += fm.F148.FBESize()

    if (fbeCurrentSize + fm.F149.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F149.Verify() {
        return false
    }
    fbeCurrentSize += fm.F149.FBESize()

    if (fbeCurrentSize + fm.F150.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F150.Verify() {
        return false
    }
    fbeCurrentSize += fm.F150.FBESize()

    if (fbeCurrentSize + fm.F151.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F151.Verify() {
        return false
    }
    fbeCurrentSize += fm.F151.FBESize()

    if (fbeCurrentSize + fm.F152.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F152.Verify() {
        return false
    }
    fbeCurrentSize += fm.F152.FBESize()

    if (fbeCurrentSize + fm.F153.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F153.Verify() {
        return false
    }
    fbeCurrentSize += fm.F153.FBESize()

    if (fbeCurrentSize + fm.F154.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F154.Verify() {
        return false
    }
    fbeCurrentSize += fm.F154.FBESize()

    if (fbeCurrentSize + fm.F155.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F155.Verify() {
        return false
    }
    fbeCurrentSize += fm.F155.FBESize()

    if (fbeCurrentSize + fm.F156.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F156.Verify() {
        return false
    }
    fbeCurrentSize += fm.F156.FBESize()

    if (fbeCurrentSize + fm.F157.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F157.Verify() {
        return false
    }
    fbeCurrentSize += fm.F157.FBESize()

    if (fbeCurrentSize + fm.F158.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F158.Verify() {
        return false
    }
    fbeCurrentSize += fm.F158.FBESize()

    if (fbeCurrentSize + fm.F159.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F159.Verify() {
        return false
    }
    fbeCurrentSize += fm.F159.FBESize()

    if (fbeCurrentSize + fm.F160.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F160.Verify() {
        return false
    }
    fbeCurrentSize += fm.F160.FBESize()

    if (fbeCurrentSize + fm.F161.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F161.Verify() {
        return false
    }
    fbeCurrentSize += fm.F161.FBESize()

    if (fbeCurrentSize + fm.F162.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F162.Verify() {
        return false
    }
    fbeCurrentSize += fm.F162.FBESize()

    if (fbeCurrentSize + fm.F163.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F163.Verify() {
        return false
    }
    fbeCurrentSize += fm.F163.FBESize()

    if (fbeCurrentSize + fm.F164.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F164.Verify() {
        return false
    }
    fbeCurrentSize += fm.F164.FBESize()

    if (fbeCurrentSize + fm.F165.FBESize()) > fbeStructSize {
        return true
    }
    if !fm.F165.Verify() {
        return false
    }
    fbeCurrentSize += fm.F165.FBESize()

    return true
}

// Get the struct value (begin phase)
func (fm *FieldModelStructOptional) GetBegin() (int, error) {
    if (fm.buffer.Offset() + fm.FBEOffset() + fm.FBESize()) > fm.buffer.Size() {
        return 0, nil
    }

    fbeStructOffset := int(fbe.ReadUInt32(fm.buffer.Data(), fm.buffer.Offset() + fm.FBEOffset()))
    if (fbeStructOffset == 0) || ((fm.buffer.Offset() + fbeStructOffset + 4 + 4) > fm.buffer.Size()) {
        return 0, errors.New("model is broken")
    }

    fbeStructSize := int(fbe.ReadUInt32(fm.buffer.Data(), fm.buffer.Offset() + fbeStructOffset))
    if fbeStructSize < (4 + 4) {
        return 0, errors.New("model is broken")
    }

    fm.buffer.Shift(fbeStructOffset)
    return fbeStructOffset, nil
}

// Get the struct value (end phase)
func (fm *FieldModelStructOptional) GetEnd(fbeBegin int) {
    fm.buffer.Unshift(fbeBegin)
}

// Get the struct value
func (fm *FieldModelStructOptional) Get() (*StructOptional, error) {
    fbeResult := NewStructOptional()
    return fbeResult, fm.GetValue(fbeResult)
}

// Get the struct value by the given pointer
func (fm *FieldModelStructOptional) GetValue(fbeValue *StructOptional) error {
    fbeBegin, err := fm.GetBegin()
    if fbeBegin == 0 {
        return err
    }

    fbeStructSize := int(fbe.ReadUInt32(fm.buffer.Data(), fm.buffer.Offset()))
    fm.GetFields(fbeValue, fbeStructSize)
    fm.GetEnd(fbeBegin)
    return nil
}

// Get the struct fields values
func (fm *FieldModelStructOptional) GetFields(fbeValue *StructOptional, fbeStructSize int) {
    fbeCurrentSize := 4 + 4

    if (fbeCurrentSize + fm.FieldModelStructSimple.FBEBody() - 4 - 4) <= fbeStructSize {
        fm.FieldModelStructSimple.GetFields(fbeValue.StructSimple, fbeStructSize)
    }
    fbeCurrentSize += fm.FieldModelStructSimple.FBEBody() - 4 - 4

    if (fbeCurrentSize + fm.F100.FBESize()) <= fbeStructSize {
        fbeValue.F100, _ = fm.F100.Get()
    } else {
        fbeValue.F100 = nil
    }
    fbeCurrentSize += fm.F100.FBESize()

    if (fbeCurrentSize + fm.F101.FBESize()) <= fbeStructSize {
        fbeValue.F101, _ = fm.F101.Get()
    } else {
        fbeValue.F101 = fbe.OptionalBool(true)
    }
    fbeCurrentSize += fm.F101.FBESize()

    if (fbeCurrentSize + fm.F102.FBESize()) <= fbeStructSize {
        fbeValue.F102, _ = fm.F102.Get()
    } else {
        fbeValue.F102 = nil
    }
    fbeCurrentSize += fm.F102.FBESize()

    if (fbeCurrentSize + fm.F103.FBESize()) <= fbeStructSize {
        fbeValue.F103, _ = fm.F103.Get()
    } else {
        fbeValue.F103 = nil
    }
    fbeCurrentSize += fm.F103.FBESize()

    if (fbeCurrentSize + fm.F104.FBESize()) <= fbeStructSize {
        fbeValue.F104, _ = fm.F104.Get()
    } else {
        fbeValue.F104 = fbe.OptionalByte(255)
    }
    fbeCurrentSize += fm.F104.FBESize()

    if (fbeCurrentSize + fm.F105.FBESize()) <= fbeStructSize {
        fbeValue.F105, _ = fm.F105.Get()
    } else {
        fbeValue.F105 = nil
    }
    fbeCurrentSize += fm.F105.FBESize()

    if (fbeCurrentSize + fm.F106.FBESize()) <= fbeStructSize {
        fbeValue.F106, _ = fm.F106.Get()
    } else {
        fbeValue.F106 = nil
    }
    fbeCurrentSize += fm.F106.FBESize()

    if (fbeCurrentSize + fm.F107.FBESize()) <= fbeStructSize {
        fbeValue.F107, _ = fm.F107.Get()
    } else {
        fbeValue.F107 = fbe.OptionalRune('!')
    }
    fbeCurrentSize += fm.F107.FBESize()

    if (fbeCurrentSize + fm.F108.FBESize()) <= fbeStructSize {
        fbeValue.F108, _ = fm.F108.Get()
    } else {
        fbeValue.F108 = nil
    }
    fbeCurrentSize += fm.F108.FBESize()

    if (fbeCurrentSize + fm.F109.FBESize()) <= fbeStructSize {
        fbeValue.F109, _ = fm.F109.Get()
    } else {
        fbeValue.F109 = nil
    }
    fbeCurrentSize += fm.F109.FBESize()

    if (fbeCurrentSize + fm.F110.FBESize()) <= fbeStructSize {
        fbeValue.F110, _ = fm.F110.Get()
    } else {
        fbeValue.F110 = fbe.OptionalRune(rune(0x0444))
    }
    fbeCurrentSize += fm.F110.FBESize()

    if (fbeCurrentSize + fm.F111.FBESize()) <= fbeStructSize {
        fbeValue.F111, _ = fm.F111.Get()
    } else {
        fbeValue.F111 = nil
    }
    fbeCurrentSize += fm.F111.FBESize()

    if (fbeCurrentSize + fm.F112.FBESize()) <= fbeStructSize {
        fbeValue.F112, _ = fm.F112.Get()
    } else {
        fbeValue.F112 = nil
    }
    fbeCurrentSize += fm.F112.FBESize()

    if (fbeCurrentSize + fm.F113.FBESize()) <= fbeStructSize {
        fbeValue.F113, _ = fm.F113.Get()
    } else {
        fbeValue.F113 = fbe.OptionalInt8(127)
    }
    fbeCurrentSize += fm.F113.FBESize()

    if (fbeCurrentSize + fm.F114.FBESize()) <= fbeStructSize {
        fbeValue.F114, _ = fm.F114.Get()
    } else {
        fbeValue.F114 = nil
    }
    fbeCurrentSize += fm.F114.FBESize()

    if (fbeCurrentSize + fm.F115.FBESize()) <= fbeStructSize {
        fbeValue.F115, _ = fm.F115.Get()
    } else {
        fbeValue.F115 = nil
    }
    fbeCurrentSize += fm.F115.FBESize()

    if (fbeCurrentSize + fm.F116.FBESize()) <= fbeStructSize {
        fbeValue.F116, _ = fm.F116.Get()
    } else {
        fbeValue.F116 = fbe.OptionalUInt8(255)
    }
    fbeCurrentSize += fm.F116.FBESize()

    if (fbeCurrentSize + fm.F117.FBESize()) <= fbeStructSize {
        fbeValue.F117, _ = fm.F117.Get()
    } else {
        fbeValue.F117 = nil
    }
    fbeCurrentSize += fm.F117.FBESize()

    if (fbeCurrentSize + fm.F118.FBESize()) <= fbeStructSize {
        fbeValue.F118, _ = fm.F118.Get()
    } else {
        fbeValue.F118 = nil
    }
    fbeCurrentSize += fm.F118.FBESize()

    if (fbeCurrentSize + fm.F119.FBESize()) <= fbeStructSize {
        fbeValue.F119, _ = fm.F119.Get()
    } else {
        fbeValue.F119 = fbe.OptionalInt16(32767)
    }
    fbeCurrentSize += fm.F119.FBESize()

    if (fbeCurrentSize + fm.F120.FBESize()) <= fbeStructSize {
        fbeValue.F120, _ = fm.F120.Get()
    } else {
        fbeValue.F120 = nil
    }
    fbeCurrentSize += fm.F120.FBESize()

    if (fbeCurrentSize + fm.F121.FBESize()) <= fbeStructSize {
        fbeValue.F121, _ = fm.F121.Get()
    } else {
        fbeValue.F121 = nil
    }
    fbeCurrentSize += fm.F121.FBESize()

    if (fbeCurrentSize + fm.F122.FBESize()) <= fbeStructSize {
        fbeValue.F122, _ = fm.F122.Get()
    } else {
        fbeValue.F122 = fbe.OptionalUInt16(65535)
    }
    fbeCurrentSize += fm.F122.FBESize()

    if (fbeCurrentSize + fm.F123.FBESize()) <= fbeStructSize {
        fbeValue.F123, _ = fm.F123.Get()
    } else {
        fbeValue.F123 = nil
    }
    fbeCurrentSize += fm.F123.FBESize()

    if (fbeCurrentSize + fm.F124.FBESize()) <= fbeStructSize {
        fbeValue.F124, _ = fm.F124.Get()
    } else {
        fbeValue.F124 = nil
    }
    fbeCurrentSize += fm.F124.FBESize()

    if (fbeCurrentSize + fm.F125.FBESize()) <= fbeStructSize {
        fbeValue.F125, _ = fm.F125.Get()
    } else {
        fbeValue.F125 = fbe.OptionalInt32(2147483647)
    }
    fbeCurrentSize += fm.F125.FBESize()

    if (fbeCurrentSize + fm.F126.FBESize()) <= fbeStructSize {
        fbeValue.F126, _ = fm.F126.Get()
    } else {
        fbeValue.F126 = nil
    }
    fbeCurrentSize += fm.F126.FBESize()

    if (fbeCurrentSize + fm.F127.FBESize()) <= fbeStructSize {
        fbeValue.F127, _ = fm.F127.Get()
    } else {
        fbeValue.F127 = nil
    }
    fbeCurrentSize += fm.F127.FBESize()

    if (fbeCurrentSize + fm.F128.FBESize()) <= fbeStructSize {
        fbeValue.F128, _ = fm.F128.Get()
    } else {
        fbeValue.F128 = fbe.OptionalUInt32(4294967295)
    }
    fbeCurrentSize += fm.F128.FBESize()

    if (fbeCurrentSize + fm.F129.FBESize()) <= fbeStructSize {
        fbeValue.F129, _ = fm.F129.Get()
    } else {
        fbeValue.F129 = nil
    }
    fbeCurrentSize += fm.F129.FBESize()

    if (fbeCurrentSize + fm.F130.FBESize()) <= fbeStructSize {
        fbeValue.F130, _ = fm.F130.Get()
    } else {
        fbeValue.F130 = nil
    }
    fbeCurrentSize += fm.F130.FBESize()

    if (fbeCurrentSize + fm.F131.FBESize()) <= fbeStructSize {
        fbeValue.F131, _ = fm.F131.Get()
    } else {
        fbeValue.F131 = fbe.OptionalInt64(9223372036854775807)
    }
    fbeCurrentSize += fm.F131.FBESize()

    if (fbeCurrentSize + fm.F132.FBESize()) <= fbeStructSize {
        fbeValue.F132, _ = fm.F132.Get()
    } else {
        fbeValue.F132 = nil
    }
    fbeCurrentSize += fm.F132.FBESize()

    if (fbeCurrentSize + fm.F133.FBESize()) <= fbeStructSize {
        fbeValue.F133, _ = fm.F133.Get()
    } else {
        fbeValue.F133 = nil
    }
    fbeCurrentSize += fm.F133.FBESize()

    if (fbeCurrentSize + fm.F134.FBESize()) <= fbeStructSize {
        fbeValue.F134, _ = fm.F134.Get()
    } else {
        fbeValue.F134 = fbe.OptionalUInt64(18446744073709551615)
    }
    fbeCurrentSize += fm.F134.FBESize()

    if (fbeCurrentSize + fm.F135.FBESize()) <= fbeStructSize {
        fbeValue.F135, _ = fm.F135.Get()
    } else {
        fbeValue.F135 = nil
    }
    fbeCurrentSize += fm.F135.FBESize()

    if (fbeCurrentSize + fm.F136.FBESize()) <= fbeStructSize {
        fbeValue.F136, _ = fm.F136.Get()
    } else {
        fbeValue.F136 = nil
    }
    fbeCurrentSize += fm.F136.FBESize()

    if (fbeCurrentSize + fm.F137.FBESize()) <= fbeStructSize {
        fbeValue.F137, _ = fm.F137.Get()
    } else {
        fbeValue.F137 = fbe.OptionalFloat32(float32(123.456))
    }
    fbeCurrentSize += fm.F137.FBESize()

    if (fbeCurrentSize + fm.F138.FBESize()) <= fbeStructSize {
        fbeValue.F138, _ = fm.F138.Get()
    } else {
        fbeValue.F138 = nil
    }
    fbeCurrentSize += fm.F138.FBESize()

    if (fbeCurrentSize + fm.F139.FBESize()) <= fbeStructSize {
        fbeValue.F139, _ = fm.F139.Get()
    } else {
        fbeValue.F139 = nil
    }
    fbeCurrentSize += fm.F139.FBESize()

    if (fbeCurrentSize + fm.F140.FBESize()) <= fbeStructSize {
        fbeValue.F140, _ = fm.F140.Get()
    } else {
        fbeValue.F140 = fbe.OptionalFloat64(float64(-123.456e+123))
    }
    fbeCurrentSize += fm.F140.FBESize()

    if (fbeCurrentSize + fm.F141.FBESize()) <= fbeStructSize {
        fbeValue.F141, _ = fm.F141.Get()
    } else {
        fbeValue.F141 = nil
    }
    fbeCurrentSize += fm.F141.FBESize()

    if (fbeCurrentSize + fm.F142.FBESize()) <= fbeStructSize {
        fbeValue.F142, _ = fm.F142.Get()
    } else {
        fbeValue.F142 = nil
    }
    fbeCurrentSize += fm.F142.FBESize()

    if (fbeCurrentSize + fm.F143.FBESize()) <= fbeStructSize {
        fbeValue.F143, _ = fm.F143.Get()
    } else {
        fbeValue.F143 = fbe.OptionalDecimal(fbe.DecimalFromString("123456.123456"))
    }
    fbeCurrentSize += fm.F143.FBESize()

    if (fbeCurrentSize + fm.F144.FBESize()) <= fbeStructSize {
        fbeValue.F144, _ = fm.F144.Get()
    } else {
        fbeValue.F144 = nil
    }
    fbeCurrentSize += fm.F144.FBESize()

    if (fbeCurrentSize + fm.F145.FBESize()) <= fbeStructSize {
        fbeValue.F145, _ = fm.F145.Get()
    } else {
        fbeValue.F145 = nil
    }
    fbeCurrentSize += fm.F145.FBESize()

    if (fbeCurrentSize + fm.F146.FBESize()) <= fbeStructSize {
        fbeValue.F146, _ = fm.F146.Get()
    } else {
        fbeValue.F146 = fbe.OptionalString("Initial string!")
    }
    fbeCurrentSize += fm.F146.FBESize()

    if (fbeCurrentSize + fm.F147.FBESize()) <= fbeStructSize {
        fbeValue.F147, _ = fm.F147.Get()
    } else {
        fbeValue.F147 = nil
    }
    fbeCurrentSize += fm.F147.FBESize()

    if (fbeCurrentSize + fm.F148.FBESize()) <= fbeStructSize {
        fbeValue.F148, _ = fm.F148.Get()
    } else {
        fbeValue.F148 = nil
    }
    fbeCurrentSize += fm.F148.FBESize()

    if (fbeCurrentSize + fm.F149.FBESize()) <= fbeStructSize {
        fbeValue.F149, _ = fm.F149.Get()
    } else {
        fbeValue.F149 = fbe.OptionalTimestamp(fbe.TimestampUTC())
    }
    fbeCurrentSize += fm.F149.FBESize()

    if (fbeCurrentSize + fm.F150.FBESize()) <= fbeStructSize {
        fbeValue.F150, _ = fm.F150.Get()
    } else {
        fbeValue.F150 = nil
    }
    fbeCurrentSize += fm.F150.FBESize()

    if (fbeCurrentSize + fm.F151.FBESize()) <= fbeStructSize {
        fbeValue.F151, _ = fm.F151.Get()
    } else {
        fbeValue.F151 = nil
    }
    fbeCurrentSize += fm.F151.FBESize()

    if (fbeCurrentSize + fm.F152.FBESize()) <= fbeStructSize {
        fbeValue.F152, _ = fm.F152.Get()
    } else {
        fbeValue.F152 = fbe.OptionalUUID(fbe.UUIDFromString("123e4567-e89b-12d3-a456-426655440000"))
    }
    fbeCurrentSize += fm.F152.FBESize()

    if (fbeCurrentSize + fm.F153.FBESize()) <= fbeStructSize {
        fbeValue.F153, _ = fm.F153.Get()
    } else {
        fbeValue.F153 = nil
    }
    fbeCurrentSize += fm.F153.FBESize()

    if (fbeCurrentSize + fm.F154.FBESize()) <= fbeStructSize {
        fbeValue.F154, _ = fm.F154.Get()
    } else {
        fbeValue.F154 = nil
    }
    fbeCurrentSize += fm.F154.FBESize()

    if (fbeCurrentSize + fm.F155.FBESize()) <= fbeStructSize {
        fbeValue.F155, _ = fm.F155.Get()
    } else {
        fbeValue.F155 = nil
    }
    fbeCurrentSize += fm.F155.FBESize()

    if (fbeCurrentSize + fm.F156.FBESize()) <= fbeStructSize {
        fbeValue.F156, _ = fm.F156.Get()
    } else {
        fbeValue.F156 = nil
    }
    fbeCurrentSize += fm.F156.FBESize()

    if (fbeCurrentSize + fm.F157.FBESize()) <= fbeStructSize {
        fbeValue.F157, _ = fm.F157.Get()
    } else {
        fbeValue.F157 = nil
    }
    fbeCurrentSize += fm.F157.FBESize()

    if (fbeCurrentSize + fm.F158.FBESize()) <= fbeStructSize {
        fbeValue.F158, _ = fm.F158.Get()
    } else {
        fbeValue.F158 = nil
    }
    fbeCurrentSize += fm.F158.FBESize()

    if (fbeCurrentSize + fm.F159.FBESize()) <= fbeStructSize {
        fbeValue.F159, _ = fm.F159.Get()
    } else {
        fbeValue.F159 = nil
    }
    fbeCurrentSize += fm.F159.FBESize()

    if (fbeCurrentSize + fm.F160.FBESize()) <= fbeStructSize {
        fbeValue.F160, _ = fm.F160.Get()
    } else {
        fbeValue.F160 = nil
    }
    fbeCurrentSize += fm.F160.FBESize()

    if (fbeCurrentSize + fm.F161.FBESize()) <= fbeStructSize {
        fbeValue.F161, _ = fm.F161.Get()
    } else {
        fbeValue.F161 = nil
    }
    fbeCurrentSize += fm.F161.FBESize()

    if (fbeCurrentSize + fm.F162.FBESize()) <= fbeStructSize {
        fbeValue.F162, _ = fm.F162.Get()
    } else {
        fbeValue.F162 = nil
    }
    fbeCurrentSize += fm.F162.FBESize()

    if (fbeCurrentSize + fm.F163.FBESize()) <= fbeStructSize {
        fbeValue.F163, _ = fm.F163.Get()
    } else {
        fbeValue.F163 = nil
    }
    fbeCurrentSize += fm.F163.FBESize()

    if (fbeCurrentSize + fm.F164.FBESize()) <= fbeStructSize {
        fbeValue.F164, _ = fm.F164.Get()
    } else {
        fbeValue.F164 = nil
    }
    fbeCurrentSize += fm.F164.FBESize()

    if (fbeCurrentSize + fm.F165.FBESize()) <= fbeStructSize {
        fbeValue.F165, _ = fm.F165.Get()
    } else {
        fbeValue.F165 = nil
    }
    fbeCurrentSize += fm.F165.FBESize()
}

// Set the struct value (begin phase)
func (fm *FieldModelStructOptional) SetBegin() (int, error) {
    if (fm.buffer.Offset() + fm.FBEOffset() + fm.FBESize()) > fm.buffer.Size() {
        return 0, errors.New("model is broken")
    }

    fbeStructSize := fm.FBEBody()
    fbeStructOffset := fm.buffer.Allocate(fbeStructSize) - fm.buffer.Offset()
    if (fbeStructOffset <= 0) || ((fm.buffer.Offset() + fbeStructOffset + fbeStructSize) > fm.buffer.Size()) {
        return 0, errors.New("model is broken")
    }

    fbe.WriteUInt32(fm.buffer.Data(), fm.buffer.Offset() + fm.FBEOffset(), uint32(fbeStructOffset))
    fbe.WriteUInt32(fm.buffer.Data(), fm.buffer.Offset() + fbeStructOffset, uint32(fbeStructSize))
    fbe.WriteUInt32(fm.buffer.Data(), fm.buffer.Offset() + fbeStructOffset + 4, uint32(fm.FBEType()))

    fm.buffer.Shift(fbeStructOffset)
    return fbeStructOffset, nil
}

// Set the struct value (end phase)
func (fm *FieldModelStructOptional) SetEnd(fbeBegin int) {
    fm.buffer.Unshift(fbeBegin)
}

// Set the struct value
func (fm *FieldModelStructOptional) Set(fbeValue *StructOptional) error {
    fbeBegin, err := fm.SetBegin()
    if fbeBegin == 0 {
        return err
    }

    err = fm.SetFields(fbeValue)
    fm.SetEnd(fbeBegin)
    return err
}

// Set the struct fields values
func (fm *FieldModelStructOptional) SetFields(fbeValue *StructOptional) error {
    var err error = nil

    if err = fm.FieldModelStructSimple.SetFields(fbeValue.StructSimple); err != nil {
        return err
    }
    if err = fm.F100.Set(fbeValue.F100); err != nil {
        return err
    }
    if err = fm.F101.Set(fbeValue.F101); err != nil {
        return err
    }
    if err = fm.F102.Set(fbeValue.F102); err != nil {
        return err
    }
    if err = fm.F103.Set(fbeValue.F103); err != nil {
        return err
    }
    if err = fm.F104.Set(fbeValue.F104); err != nil {
        return err
    }
    if err = fm.F105.Set(fbeValue.F105); err != nil {
        return err
    }
    if err = fm.F106.Set(fbeValue.F106); err != nil {
        return err
    }
    if err = fm.F107.Set(fbeValue.F107); err != nil {
        return err
    }
    if err = fm.F108.Set(fbeValue.F108); err != nil {
        return err
    }
    if err = fm.F109.Set(fbeValue.F109); err != nil {
        return err
    }
    if err = fm.F110.Set(fbeValue.F110); err != nil {
        return err
    }
    if err = fm.F111.Set(fbeValue.F111); err != nil {
        return err
    }
    if err = fm.F112.Set(fbeValue.F112); err != nil {
        return err
    }
    if err = fm.F113.Set(fbeValue.F113); err != nil {
        return err
    }
    if err = fm.F114.Set(fbeValue.F114); err != nil {
        return err
    }
    if err = fm.F115.Set(fbeValue.F115); err != nil {
        return err
    }
    if err = fm.F116.Set(fbeValue.F116); err != nil {
        return err
    }
    if err = fm.F117.Set(fbeValue.F117); err != nil {
        return err
    }
    if err = fm.F118.Set(fbeValue.F118); err != nil {
        return err
    }
    if err = fm.F119.Set(fbeValue.F119); err != nil {
        return err
    }
    if err = fm.F120.Set(fbeValue.F120); err != nil {
        return err
    }
    if err = fm.F121.Set(fbeValue.F121); err != nil {
        return err
    }
    if err = fm.F122.Set(fbeValue.F122); err != nil {
        return err
    }
    if err = fm.F123.Set(fbeValue.F123); err != nil {
        return err
    }
    if err = fm.F124.Set(fbeValue.F124); err != nil {
        return err
    }
    if err = fm.F125.Set(fbeValue.F125); err != nil {
        return err
    }
    if err = fm.F126.Set(fbeValue.F126); err != nil {
        return err
    }
    if err = fm.F127.Set(fbeValue.F127); err != nil {
        return err
    }
    if err = fm.F128.Set(fbeValue.F128); err != nil {
        return err
    }
    if err = fm.F129.Set(fbeValue.F129); err != nil {
        return err
    }
    if err = fm.F130.Set(fbeValue.F130); err != nil {
        return err
    }
    if err = fm.F131.Set(fbeValue.F131); err != nil {
        return err
    }
    if err = fm.F132.Set(fbeValue.F132); err != nil {
        return err
    }
    if err = fm.F133.Set(fbeValue.F133); err != nil {
        return err
    }
    if err = fm.F134.Set(fbeValue.F134); err != nil {
        return err
    }
    if err = fm.F135.Set(fbeValue.F135); err != nil {
        return err
    }
    if err = fm.F136.Set(fbeValue.F136); err != nil {
        return err
    }
    if err = fm.F137.Set(fbeValue.F137); err != nil {
        return err
    }
    if err = fm.F138.Set(fbeValue.F138); err != nil {
        return err
    }
    if err = fm.F139.Set(fbeValue.F139); err != nil {
        return err
    }
    if err = fm.F140.Set(fbeValue.F140); err != nil {
        return err
    }
    if err = fm.F141.Set(fbeValue.F141); err != nil {
        return err
    }
    if err = fm.F142.Set(fbeValue.F142); err != nil {
        return err
    }
    if err = fm.F143.Set(fbeValue.F143); err != nil {
        return err
    }
    if err = fm.F144.Set(fbeValue.F144); err != nil {
        return err
    }
    if err = fm.F145.Set(fbeValue.F145); err != nil {
        return err
    }
    if err = fm.F146.Set(fbeValue.F146); err != nil {
        return err
    }
    if err = fm.F147.Set(fbeValue.F147); err != nil {
        return err
    }
    if err = fm.F148.Set(fbeValue.F148); err != nil {
        return err
    }
    if err = fm.F149.Set(fbeValue.F149); err != nil {
        return err
    }
    if err = fm.F150.Set(fbeValue.F150); err != nil {
        return err
    }
    if err = fm.F151.Set(fbeValue.F151); err != nil {
        return err
    }
    if err = fm.F152.Set(fbeValue.F152); err != nil {
        return err
    }
    if err = fm.F153.Set(fbeValue.F153); err != nil {
        return err
    }
    if err = fm.F154.Set(fbeValue.F154); err != nil {
        return err
    }
    if err = fm.F155.Set(fbeValue.F155); err != nil {
        return err
    }
    if err = fm.F156.Set(fbeValue.F156); err != nil {
        return err
    }
    if err = fm.F157.Set(fbeValue.F157); err != nil {
        return err
    }
    if err = fm.F158.Set(fbeValue.F158); err != nil {
        return err
    }
    if err = fm.F159.Set(fbeValue.F159); err != nil {
        return err
    }
    if err = fm.F160.Set(fbeValue.F160); err != nil {
        return err
    }
    if err = fm.F161.Set(fbeValue.F161); err != nil {
        return err
    }
    if err = fm.F162.Set(fbeValue.F162); err != nil {
        return err
    }
    if err = fm.F163.Set(fbeValue.F163); err != nil {
        return err
    }
    if err = fm.F164.Set(fbeValue.F164); err != nil {
        return err
    }
    if err = fm.F165.Set(fbeValue.F165); err != nil {
        return err
    }
    return err
}
