<s> from . . import models <EOL> from . generic import Manager , AllMixin , GetByIdMixin , SyncMixin <EOL> class FiltersManager ( Manager , AllMixin , GetByIdMixin , SyncMixin ) : <EOL> state_name = '<STR_LIT>' <EOL> object_type = '<STR_LIT>' <EOL> resource_type = '<STR_LIT>' <EOL> def add ( self , name , query , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> obj = models . Filter ( { '<STR_LIT:name>' : name , '<STR_LIT>' : query } , self . api ) <EOL> obj . temp_id = obj [ '<STR_LIT:id>' ] = self . api . generate_uuid ( ) <EOL> obj . data . update ( kwargs ) <EOL> self . state [ self . state_name ] . append ( obj ) <EOL> cmd = { <EOL> '<STR_LIT:type>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : obj . temp_id , <EOL> '<STR_LIT>' : self . api . generate_uuid ( ) , <EOL> '<STR_LIT:args>' : obj . data , <EOL> } <EOL> self . queue . append ( cmd ) <EOL> return obj <EOL> def update ( self , filter_id , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> args = { '<STR_LIT:id>' : filter_id } <EOL> args . update ( kwargs ) <EOL> cmd = { <EOL> '<STR_LIT:type>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : self . api . generate_uuid ( ) , <EOL> '<STR_LIT:args>' : args , <EOL> } <EOL> self . queue . append ( cmd ) <EOL> def delete ( self , filter_id ) : <EOL> """<STR_LIT>""" <EOL> cmd = { <EOL> '<STR_LIT:type>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : self . api . generate_uuid ( ) , <EOL> '<STR_LIT:args>' : { <EOL> '<STR_LIT:id>' : filter_id , <EOL> } , <EOL> } <EOL> self . queue . append ( cmd ) <EOL> def update_orders ( self , id_order_mapping ) : <EOL> """<STR_LIT>""" <EOL> cmd = { <EOL> '<STR_LIT:type>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : self . api . generate_uuid ( ) , <EOL> '<STR_LIT:args>' : { <EOL> '<STR_LIT>' : id_order_mapping , <EOL> } , <EOL> } <EOL> self . queue . append ( cmd ) </s>
