#NEWLINE# def _to_firewall_policy( self , data ) : #NEWLINE# #INDENT# rules = [ ] #NEWLINE# for item in data . get ( 'rules' , [ ] ) : #NEWLINE# #INDENT# rule = CloudSigmaFirewallPolicyRule ( action = item [ 'action' ] , direction = item [ 'direction' ] , ip_proto = item [ 'ip_proto' ] , src_ip = policy [ 'src_ip' ] , src_port = item [ 'src_port' ] , dst_ip = item [ 'dst_ip' ] , dst_port = item [ 'dst_port' ] , comment = item [ 'comment' ] ) #NEWLINE# rules . append ( rule ) #NEWLINE# #UNINDENT# policy = CloudSigmaFirewallPolicy ( id = data [ 'uuid' ] , name = data [ 'name' ] , rules = rules ) #NEWLINE# return policy