export function parseService ( typeArray , configArguments , configElements , state ) { if ( typeArray . field . length === 0 ) { configArguments = null ; configElements [ typeArray . name ] = { name : typeArray . name , type : "TYPE_MESSAGE" , label : "LABEL_OPTIONAL" , } ; } else { typeArray . field . forEach ( f => { if ( f . type !== "TYPE_MESSAGE" && f . label !== "LABEL_REPEATED" ) { configArguments [ f . name ] = null ; configElements [ f . name ] = { messageName : typeArray . name , type : f . type , label : f . label , } ; } if ( f . type !== "TYPE_MESSAGE" && f . label === "LABEL_REPEATED" ) { configArguments [ f . name ] = [ null ] ; configElements [ f . name ] = { name : f . name , messageName : typeArray . name , type : f . type , label : f . label , } ; } if ( f . type === "TYPE_MESSAGE" && f . label !== "LABEL_REPEATED" ) { configArguments [ f . name ] = { } ; configElements [ f . name ] = { name : f . name , label : f . label , type : f . type , typeName : f . typeName , } ; parseService ( state . messageList [ f . typeName ] . type , configArguments [ f . name ] , configElements [ f . name ] , state ) ; } if ( f . type === "TYPE_MESSAGE" && f . label === "LABEL_REPEATED" ) { configArguments [ f . name ] = [ { } ] ; configElements [ f . name ] = [ { messageName : typeArray . name , label : f . label , type : f . type , typeName : f . typeName , } , ] ; parseService ( state . messageList [ f . typeName ] . type , configArguments [ f . name ] [ 0 ] , configElements [ f . name ] [ 0 ] , state ) ; } } ) ; } }