// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
// protoc-gen-go-vtproto version: v0.6.0
// source: frostdb/table/v1alpha1/config.proto

package tablev1alpha1

import (
	fmt 
	protohelpers 
	v1alpha1 
	v1alpha2 
	protoimpl 
	io 
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

func ( *TableConfig) () ( []byte,  error) {
	if  == nil {
		return nil, nil
	}
	 := .SizeVT()
	 = make([]byte, )
	,  := .MarshalToSizedBufferVT([:])
	if  != nil {
		return nil, 
	}
	return [:], nil
}

func ( *TableConfig) ( []byte) (int, error) {
	 := .SizeVT()
	return .MarshalToSizedBufferVT([:])
}

func ( *TableConfig) ( []byte) (int, error) {
	if  == nil {
		return 0, nil
	}
	 := len()
	_ = 
	var  int
	_ = 
	if .unknownFields != nil {
		 -= len(.unknownFields)
		copy([:], .unknownFields)
	}
	if ,  := .Schema.(interface {
		([]byte) (int, error)
	});  {
		,  := .([:])
		if  != nil {
			return 0, 
		}
		 -= 
	}
	if .DisableWal {
		--
		if .DisableWal {
			[] = 1
		} else {
			[] = 0
		}
		--
		[] = 0x28
	}
	if .BlockReaderLimit != 0 {
		 = protohelpers.EncodeVarint(, , uint64(.BlockReaderLimit))
		--
		[] = 0x20
	}
	if .RowGroupSize != 0 {
		 = protohelpers.EncodeVarint(, , uint64(.RowGroupSize))
		--
		[] = 0x18
	}
	return len() - , nil
}

func ( *TableConfig_DeprecatedSchema) ( []byte) (int, error) {
	 := .SizeVT()
	return .MarshalToSizedBufferVT([:])
}

func ( *TableConfig_DeprecatedSchema) ( []byte) (int, error) {
	 := len()
	if .DeprecatedSchema != nil {
		,  := .DeprecatedSchema.MarshalToSizedBufferVT([:])
		if  != nil {
			return 0, 
		}
		 -= 
		 = protohelpers.EncodeVarint(, , uint64())
		--
		[] = 0xa
	}
	return len() - , nil
}
func ( *TableConfig_SchemaV2) ( []byte) (int, error) {
	 := .SizeVT()
	return .MarshalToSizedBufferVT([:])
}

func ( *TableConfig_SchemaV2) ( []byte) (int, error) {
	 := len()
	if .SchemaV2 != nil {
		,  := .SchemaV2.MarshalToSizedBufferVT([:])
		if  != nil {
			return 0, 
		}
		 -= 
		 = protohelpers.EncodeVarint(, , uint64())
		--
		[] = 0x12
	}
	return len() - , nil
}
func ( *TableConfig) () ( int) {
	if  == nil {
		return 0
	}
	var  int
	_ = 
	if ,  := .Schema.(interface{ () int });  {
		 += .()
	}
	if .RowGroupSize != 0 {
		 += 1 + protohelpers.SizeOfVarint(uint64(.RowGroupSize))
	}
	if .BlockReaderLimit != 0 {
		 += 1 + protohelpers.SizeOfVarint(uint64(.BlockReaderLimit))
	}
	if .DisableWal {
		 += 2
	}
	 += len(.unknownFields)
	return 
}

func ( *TableConfig_DeprecatedSchema) () ( int) {
	if  == nil {
		return 0
	}
	var  int
	_ = 
	if .DeprecatedSchema != nil {
		 = .DeprecatedSchema.SizeVT()
		 += 1 +  + protohelpers.SizeOfVarint(uint64())
	}
	return 
}
func ( *TableConfig_SchemaV2) () ( int) {
	if  == nil {
		return 0
	}
	var  int
	_ = 
	if .SchemaV2 != nil {
		 = .SchemaV2.SizeVT()
		 += 1 +  + protohelpers.SizeOfVarint(uint64())
	}
	return 
}
func ( *TableConfig) ( []byte) error {
	 := len()
	 := 0
	for  <  {
		 := 
		var  uint64
		for  := uint(0); ;  += 7 {
			if  >= 64 {
				return protohelpers.ErrIntOverflow
			}
			if  >=  {
				return io.ErrUnexpectedEOF
			}
			 := []
			++
			 |= uint64(&0x7F) << 
			if  < 0x80 {
				break
			}
		}
		 := int32( >> 3)
		 := int( & 0x7)
		if  == 4 {
			return fmt.Errorf("proto: TableConfig: wiretype end group for non-group")
		}
		if  <= 0 {
			return fmt.Errorf("proto: TableConfig: illegal tag %d (wire type %d)", , )
		}
		switch  {
		case 1:
			if  != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedSchema", )
			}
			var  int
			for  := uint(0); ;  += 7 {
				if  >= 64 {
					return protohelpers.ErrIntOverflow
				}
				if  >=  {
					return io.ErrUnexpectedEOF
				}
				 := []
				++
				 |= int(&0x7F) << 
				if  < 0x80 {
					break
				}
			}
			if  < 0 {
				return protohelpers.ErrInvalidLength
			}
			 :=  + 
			if  < 0 {
				return protohelpers.ErrInvalidLength
			}
			if  >  {
				return io.ErrUnexpectedEOF
			}
			if ,  := .Schema.(*TableConfig_DeprecatedSchema);  {
				if  := .DeprecatedSchema.UnmarshalVT([:]);  != nil {
					return 
				}
			} else {
				 := &v1alpha1.Schema{}
				if  := .UnmarshalVT([:]);  != nil {
					return 
				}
				.Schema = &TableConfig_DeprecatedSchema{DeprecatedSchema: }
			}
			 = 
		case 2:
			if  != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field SchemaV2", )
			}
			var  int
			for  := uint(0); ;  += 7 {
				if  >= 64 {
					return protohelpers.ErrIntOverflow
				}
				if  >=  {
					return io.ErrUnexpectedEOF
				}
				 := []
				++
				 |= int(&0x7F) << 
				if  < 0x80 {
					break
				}
			}
			if  < 0 {
				return protohelpers.ErrInvalidLength
			}
			 :=  + 
			if  < 0 {
				return protohelpers.ErrInvalidLength
			}
			if  >  {
				return io.ErrUnexpectedEOF
			}
			if ,  := .Schema.(*TableConfig_SchemaV2);  {
				if  := .SchemaV2.UnmarshalVT([:]);  != nil {
					return 
				}
			} else {
				 := &v1alpha2.Schema{}
				if  := .UnmarshalVT([:]);  != nil {
					return 
				}
				.Schema = &TableConfig_SchemaV2{SchemaV2: }
			}
			 = 
		case 3:
			if  != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field RowGroupSize", )
			}
			.RowGroupSize = 0
			for  := uint(0); ;  += 7 {
				if  >= 64 {
					return protohelpers.ErrIntOverflow
				}
				if  >=  {
					return io.ErrUnexpectedEOF
				}
				 := []
				++
				.RowGroupSize |= uint64(&0x7F) << 
				if  < 0x80 {
					break
				}
			}
		case 4:
			if  != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field BlockReaderLimit", )
			}
			.BlockReaderLimit = 0
			for  := uint(0); ;  += 7 {
				if  >= 64 {
					return protohelpers.ErrIntOverflow
				}
				if  >=  {
					return io.ErrUnexpectedEOF
				}
				 := []
				++
				.BlockReaderLimit |= uint64(&0x7F) << 
				if  < 0x80 {
					break
				}
			}
		case 5:
			if  != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field DisableWal", )
			}
			var  int
			for  := uint(0); ;  += 7 {
				if  >= 64 {
					return protohelpers.ErrIntOverflow
				}
				if  >=  {
					return io.ErrUnexpectedEOF
				}
				 := []
				++
				 |= int(&0x7F) << 
				if  < 0x80 {
					break
				}
			}
			.DisableWal = bool( != 0)
		default:
			 = 
			,  := protohelpers.Skip([:])
			if  != nil {
				return 
			}
			if ( < 0) || (+) < 0 {
				return protohelpers.ErrInvalidLength
			}
			if ( + ) >  {
				return io.ErrUnexpectedEOF
			}
			.unknownFields = append(.unknownFields, [:+]...)
			 += 
		}
	}

	if  >  {
		return io.ErrUnexpectedEOF
	}
	return nil
}