@@ -486,6 +486,16 @@ def from_dict(cls, data: dict) -> "DiffArtifact":
486486
487487 score_data = data .get ("score" ) or data .get ("scores" )
488488 score = SocketScore .from_dict (score_data ) if score_data else None
489+ license_details_source = data .get ("licenseDetails" )
490+ if license_details_source :
491+ license_details = [LicenseDetail .from_dict (detail ) for detail in license_details_source ]
492+ else :
493+ license_details = []
494+ license_attrib_source = data .get ("licenseAttrib" )
495+ if license_attrib_source :
496+ license_attrib = [LicenseAttribution .from_dict (attrib ) for attrib in license_attrib_source ]
497+ else :
498+ license_attrib = []
489499
490500 return cls (
491501 diffType = DiffType (data ["diffType" ]),
@@ -495,7 +505,7 @@ def from_dict(cls, data: dict) -> "DiffArtifact":
495505 score = score ,
496506 version = data ["version" ],
497507 alerts = [SocketAlert .from_dict (alert ) for alert in data .get ("alerts" , [])],
498- licenseDetails = [ LicenseDetail . from_dict ( detail ) for detail in data [ "licenseDetails" ]] ,
508+ licenseDetails = license_details ,
499509 files = data .get ("files" ),
500510 license = data .get ("license" ),
501511 capabilities = SecurityCapabilities .from_dict (data ["capabilities" ]) if data .get ("capabilities" ) else None ,
@@ -510,7 +520,7 @@ def from_dict(cls, data: dict) -> "DiffArtifact":
510520 author = data .get ("author" , []),
511521 state = data .get ("state" ),
512522 error = data .get ("error" ),
513- licenseAttrib = [ LicenseAttribution . from_dict ( attrib ) for attrib in data [ "licenseAttrib" ]]
523+ licenseAttrib = license_attrib
514524 if data .get ("licenseAttrib" )
515525 else None ,
516526 )
@@ -766,9 +776,18 @@ def delete(self, org_slug: str, full_scan_id: str) -> dict:
766776 return {}
767777
768778 def stream_diff (
769- self , org_slug : str , before : str , after : str , use_types : bool = False
779+ self ,
780+ org_slug : str ,
781+ before : str ,
782+ after : str ,
783+ use_types : bool = True ,
784+ include_license_details : bool = False ,
785+ ** kwargs ,
770786 ) -> Union [dict , StreamDiffResponse ]:
771- path = f"orgs/{ org_slug } /full-scans/diff?before={ before } &after={ after } "
787+ path = f"orgs/{ org_slug } /full-scans/diff?before={ before } &after={ after } &{ include_license_details } "
788+ if kwargs :
789+ for key , value in kwargs .items ():
790+ path += f"&{ key } ={ value } "
772791
773792 response = self .api .do_request (path = path , method = "GET" )
774793
0 commit comments