#NEWLINE# def definition_to_api_parameters( definition ) : #NEWLINE# #INDENT# if ( 'parameters' not in definition ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# parameter_objects = [ ] #NEWLINE# for element in definition [ 'parameters' ] : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# parameter_id = element . pop ( 'id' ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise PipelineDefinitionError ( ( 'Missing "id" key of parameter: %s' % json . dumps ( element ) ) , definition ) #NEWLINE# #UNINDENT# parameter_object = { #NEWLINE# #INDENT# 'id' : parameter_id , #NEWLINE# #UNINDENT# } #NEWLINE# attributes = [ ] #NEWLINE# for ( key , value ) in sorted ( element . items ( ) ) : #NEWLINE# #INDENT# attributes . extend ( _parse_each_field ( key , value ) ) #NEWLINE# #UNINDENT# parameter_object [ 'attributes' ] = attributes #NEWLINE# parameter_objects . append ( parameter_object ) #NEWLINE# #UNINDENT# return parameter_objects