#NEWLINE# def update( self , definition , scope = 'private' , id = None ) : #NEWLINE# #INDENT# self . _ensure_not_empty ( definition = definition ) #NEWLINE# url_pre = ( ( '/workflows/%s' % id ) if id else '/workflows' ) #NEWLINE# definition = utils . get_contents_if_file ( definition ) #NEWLINE# resp = self . client . http_client . put ( ( '%s?scope=%s' % ( url_pre , scope ) ) , definition , headers = { #NEWLINE# #INDENT# 'content-type' : 'text/plain' , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( resp . status_code != 200 ) : #NEWLINE# #INDENT# self . _raise_api_exception ( self ) #NEWLINE# #UNINDENT# if id : #NEWLINE# #INDENT# return self . resource_class ( self , base . extract_json ( resp , None ) ) #NEWLINE# #UNINDENT# return [ self . resource_class ( self , resource_data ) for resource_data in base . extract_json ( resp , 'workflows' ) ]