private List < GeneratorTask > createWaiterOpFunctionClassTasks ( ) throws IOException { List < GeneratorTask > generatorTasks = new ArrayList <> ( ) ; List < String > generatedOperations = new ArrayList <> ( ) ; for ( Map . Entry < String , WaiterDefinitionModel > entry : model . getWaiters ( ) . entrySet ( ) ) { final WaiterDefinitionModel waiterModel = entry . getValue ( ) ; if ( ! generatedOperations . contains ( waiterModel . getOperationName ( ) ) ) { generatedOperations . add ( waiterModel . getOperationName ( ) ) ; Map < String , Object > dataModel = ImmutableMapParameter . of ( "fileHeader" , model . getFileHeader ( ) , "waiter" , waiterModel , "operation" , model . getOperation ( waiterModel . getOperationName ( ) ) , "metadata" , model . getMetadata ( ) ) ; final String className = waiterModel . getOperationModel ( ) . getOperationName ( ) + "Function" ; generatorTasks . add ( new FreemarkerGeneratorTask ( waiterClassDir , className , freemarker . getWaiterSDKFunctionTemplate ( ) , dataModel ) ) ; } } return generatorTasks ; }
Constructs the data model and submits tasks for every generating SDKFunction for every unique operation in the waiter intermediate model