@@ -684,6 +684,100 @@ Types.optional = function(st_operation) {
684684 } ;
685685} ;
686686
687+ Types . indexed_optional = function ( st_operation , index ) {
688+ v . required ( st_operation , "st_operation" ) ;
689+ return {
690+ fromByteBuffer ( b ) {
691+ if ( ! ( b . readVarint32 ( ) === index ) ) {
692+ return undefined ;
693+ }
694+ return st_operation . fromByteBuffer ( b ) ;
695+ } ,
696+ appendByteBuffer ( b , object ) {
697+ if ( object !== null && object !== undefined ) {
698+ b . writeVarint32 ( index ) ;
699+ st_operation . appendByteBuffer ( b , object ) ;
700+ }
701+ return ;
702+ } ,
703+ fromObject ( object ) {
704+ if ( object === undefined ) {
705+ return undefined ;
706+ }
707+ return st_operation . fromObject ( object ) ;
708+ } ,
709+ toObject ( object , debug = { } ) {
710+ // toObject is only null save if use_default is true
711+ var result_object = ( ( ) => {
712+ if ( ! debug . use_default && object === undefined ) {
713+ return undefined ;
714+ } else {
715+ return st_operation . toObject ( object , debug ) ;
716+ }
717+ } ) ( ) ;
718+
719+ if ( debug . annotate ) {
720+ if ( typeof result_object === "object" ) {
721+ result_object . __optional = "parent is optional" ;
722+ } else {
723+ result_object = { __optional : result_object } ;
724+ }
725+ }
726+ return result_object ;
727+ }
728+ } ;
729+ } ;
730+
731+ Types . extension = function ( st_operation ) {
732+ v . required ( st_operation , "st_operation" ) ;
733+ return {
734+ fromByteBuffer ( b ) {
735+ if ( ! ( b . readVarint32 ( ) === 1 ) ) {
736+ return undefined ;
737+ }
738+ return st_operation . fromByteBuffer ( b ) ;
739+ } ,
740+ appendByteBuffer ( b , object ) {
741+ if (
742+ object !== null &&
743+ object !== undefined &&
744+ ! ( typeof object == "object" && Object . keys ( object ) . length == 0 )
745+ ) {
746+ b . writeVarint32 ( 1 ) ;
747+ st_operation . appendByteBuffer ( b , object ) ;
748+ } else {
749+ b . writeVarint32 ( 0 ) ;
750+ }
751+ return ;
752+ } ,
753+ fromObject ( object ) {
754+ if ( object === undefined ) {
755+ return undefined ;
756+ }
757+ return st_operation . fromObject ( object ) ;
758+ } ,
759+ toObject ( object , debug = { } ) {
760+ // toObject is only null save if use_default is true
761+ var result_object = ( ( ) => {
762+ if ( ! debug . use_default && object === undefined ) {
763+ return undefined ;
764+ } else {
765+ return st_operation . toObject ( object , debug ) ;
766+ }
767+ } ) ( ) ;
768+
769+ if ( debug . annotate ) {
770+ if ( typeof result_object === "object" ) {
771+ result_object . __optional = "parent is optional" ;
772+ } else {
773+ result_object = { __optional : result_object } ;
774+ }
775+ }
776+ return result_object ;
777+ }
778+ } ;
779+ } ;
780+
687781Types . static_variant = function ( _st_operations ) {
688782 return {
689783 nosort : true ,
0 commit comments