@@ -545,7 +545,7 @@ def multi_content_scan(
545545
546546 def scan_and_create_incidents (
547547 self ,
548- documents : List [Dict [str , str ]],
548+ documents : List [Dict [str , Any ]],
549549 source_uuid : UUID ,
550550 * ,
551551 extra_headers : Optional [Dict [str , str ]] = None ,
@@ -557,8 +557,8 @@ def scan_and_create_incidents(
557557 character.
558558
559559 :param documents: List of dictionaries containing the keys document
560- and, optionally, filename.
561- example: [{"document":"example content","filename":"intro.py"}]
560+ and, optionally, filename and location .
561+ example: [{"document":"example content","filename":"intro.py","location":{"url":"https://example.com"} }]
562562 :param source_uuid: the source UUID that will be used to identify the custom source, for which
563563 incidents will be created
564564 :param extra_headers: additional headers to add to the request
@@ -587,8 +587,9 @@ def scan_and_create_incidents(
587587 "source_uuid" : source_uuid ,
588588 "documents" : [
589589 {
590- "filename" : document ["filename" ],
591- "document" : document ["document" ],
590+ key : document [key ]
591+ for key in ("filename" , "document" , "location" )
592+ if document .get (key ) is not None
592593 }
593594 for document in request_obj
594595 ],
0 commit comments