@@ -22,33 +22,33 @@ func TypeToYDB(t Type, a *allocator.Allocator) *Ydb.Type {
2222}
2323
2424func TypeFromYDB (x * Ydb.Type ) Type {
25- switch v := x .Type .(type ) {
25+ switch v := x .GetType () .(type ) {
2626 case * Ydb.Type_TypeId :
2727 return primitiveTypeFromYDB (v .TypeId )
2828
2929 case * Ydb.Type_OptionalType :
30- return NewOptional (TypeFromYDB (v .OptionalType .Item ))
30+ return NewOptional (TypeFromYDB (v .OptionalType .GetItem () ))
3131
3232 case * Ydb.Type_ListType :
33- return NewList (TypeFromYDB (v .ListType .Item ))
33+ return NewList (TypeFromYDB (v .ListType .GetItem () ))
3434
3535 case * Ydb.Type_DecimalType :
3636 d := v .DecimalType
3737
38- return NewDecimal (d .Precision , d .Scale )
38+ return NewDecimal (d .GetPrecision () , d .GetScale () )
3939
4040 case * Ydb.Type_TupleType :
4141 t := v .TupleType
4242
43- return NewTuple (FromYDB (t .Elements )... )
43+ return NewTuple (FromYDB (t .GetElements () )... )
4444
4545 case * Ydb.Type_StructType :
4646 s := v .StructType
4747
48- return NewStruct (StructFields (s .Members )... )
48+ return NewStruct (StructFields (s .GetMembers () )... )
4949
5050 case * Ydb.Type_DictType :
51- keyType , valueType := TypeFromYDB (v .DictType .Key ) , TypeFromYDB (v .DictType .Payload )
51+ keyType , valueType := TypeFromYDB (v .DictType .GetKey ()) , TypeFromYDB (v .DictType .GetPayload () )
5252 if valueType .equalsTo (NewVoid ()) {
5353 return NewSet (keyType )
5454 }
@@ -57,11 +57,11 @@ func TypeFromYDB(x *Ydb.Type) Type {
5757
5858 case * Ydb.Type_VariantType :
5959 t := v .VariantType
60- switch x := t .Type .(type ) {
60+ switch x := t .GetType () .(type ) {
6161 case * Ydb.VariantType_TupleItems :
62- return NewVariantTuple (FromYDB (x .TupleItems .Elements )... )
62+ return NewVariantTuple (FromYDB (x .TupleItems .GetElements () )... )
6363 case * Ydb.VariantType_StructItems :
64- return NewVariantStruct (StructFields (x .StructItems .Members )... )
64+ return NewVariantStruct (StructFields (x .StructItems .GetMembers () )... )
6565 default :
6666 panic ("ydb: unknown variant type" )
6767 }
@@ -645,7 +645,7 @@ func (v *Struct) ToYDB(a *allocator.Allocator) *Ydb.Type {
645645 structMember .Name = v .fields [i ].Name
646646 structMember .Type = v .fields [i ].T .ToYDB (a )
647647 typeStruct .StructType .Members = append (
648- typeStruct .StructType .Members ,
648+ typeStruct .StructType .GetMembers () ,
649649 structMember ,
650650 )
651651 }
@@ -665,8 +665,8 @@ func StructFields(ms []*Ydb.StructMember) []StructField {
665665 fs := make ([]StructField , len (ms ))
666666 for i , m := range ms {
667667 fs [i ] = StructField {
668- Name : m .Name ,
669- T : TypeFromYDB (m .Type ),
668+ Name : m .GetName () ,
669+ T : TypeFromYDB (m .GetType () ),
670670 }
671671 }
672672
@@ -733,7 +733,7 @@ func (v *Tuple) ToYDB(a *allocator.Allocator) *Ydb.Type {
733733 typeTuple .TupleType = a .Tuple ()
734734
735735 for _ , vv := range items {
736- typeTuple .TupleType .Elements = append (typeTuple .TupleType .Elements , vv .ToYDB (a ))
736+ typeTuple .TupleType .Elements = append (typeTuple .TupleType .GetElements () , vv .ToYDB (a ))
737737 }
738738
739739 t .Type = typeTuple
@@ -787,7 +787,7 @@ func (v *VariantStruct) ToYDB(a *allocator.Allocator) *Ydb.Type {
787787 typeVariant .VariantType = a .Variant ()
788788
789789 structItems := a .VariantStructItems ()
790- structItems .StructItems = v .Struct .ToYDB (a ).Type .(* Ydb.Type_StructType ).StructType
790+ structItems .StructItems = v .Struct .ToYDB (a ).GetType () .(* Ydb.Type_StructType ).StructType
791791
792792 typeVariant .VariantType .Type = structItems
793793
@@ -840,7 +840,7 @@ func (v *VariantTuple) ToYDB(a *allocator.Allocator) *Ydb.Type {
840840 typeVariant .VariantType = a .Variant ()
841841
842842 tupleItems := a .VariantTupleItems ()
843- tupleItems .TupleItems = v .Tuple .ToYDB (a ).Type .(* Ydb.Type_TupleType ).TupleType
843+ tupleItems .TupleItems = v .Tuple .ToYDB (a ).GetType () .(* Ydb.Type_TupleType ).TupleType
844844
845845 typeVariant .VariantType .Type = tupleItems
846846
0 commit comments