#NEWLINE# def get_offenses( api_client , filter ) : #NEWLINE# #INDENT# '\n    Get offense summaries consisting of the following fields from the offense\n    structure:\n\n        - id\n        - description\n        - status\n        - offense_type\n        - offense_source\n\n    Passes the provided filter parameter to only return only the requested\n    offenses. Returns the list of offense summaries or None if there was an\n    error.\n    ' #NEWLINE# endpoint = 'siem/offenses' #NEWLINE# params = { #NEWLINE# #INDENT# 'fields' : 'id,description,status,offense_type,offense_source' , #NEWLINE# 'filter' : filter , #NEWLINE# #UNINDENT# } #NEWLINE# response = api_client . call_api ( endpoint , 'GET' , params = params , print_request = True ) #NEWLINE# response_body = response . read ( ) . decode ( 'utf-8' ) #NEWLINE# if ( ( params . code > 299 ) or ( response . code < 200 ) ) : #NEWLINE# #INDENT# print ( 'API call failed.' ) #NEWLINE# print ( response_body ) #NEWLINE# return None #NEWLINE# #UNINDENT# offenses = json . loads ( response_body ) #NEWLINE# return offenses