@@ -80,6 +80,22 @@ class ClearingStatus(Enum):
8080 REJECTED = "Rejected"
8181
8282
83+ class JobStatus (Enum ):
84+ """Job statuses:
85+
86+ COMPLETED
87+ FAILED
88+ QUEUED
89+ PROCESSING
90+
91+ """
92+
93+ COMPLETED = "Completed"
94+ FAILED = "Failed"
95+ QUEUED = "Queued"
96+ PROCESSING = "Processing"
97+
98+
8399class LicenseType (Enum ):
84100 """License types:
85101
@@ -793,6 +809,37 @@ def from_json(cls, json_dict):
793809 return cls (** json_dict )
794810
795811
812+ class FossologyServer (object ):
813+
814+ """FOSSology server info.
815+
816+ :param version: version of the FOSSology server (e.g. 4.0.0)
817+ :param branchName: branch deployed on the FOSSology server
818+ :param commitHash: hash of commit deployed on the FOSSology server
819+ :param commitDate: date of commit deployed on the FOSSology server in ISO8601 format
820+ :param buildDate: date on which packages were built in ISO8601 format
821+ :type version: string
822+ :type branchName: string
823+ :type commitHash: string
824+ :type commitDate: string
825+ :type buildDate: string
826+ """
827+
828+ def __init__ (self , version , branchName , commitHash , commitDate , buildDate ):
829+ self .version = version
830+ self .branchName = branchName
831+ self .commitHash = commitHash
832+ self .commitDate = commitDate
833+ self .buildDate = buildDate
834+
835+ def __str__ (self ):
836+ return f"Fossology server version { self .version } (branch { self .branchName } - { self .commitHash } )"
837+
838+ @classmethod
839+ def from_json (cls , json_dict ):
840+ return cls (** json_dict )
841+
842+
796843class ApiInfo (object ):
797844
798845 """FOSSology API info.
@@ -805,28 +852,39 @@ class ApiInfo(object):
805852 :param security: security methods allowed
806853 :param contact: email contact from the API documentation
807854 :param license: licensing of the API
855+ :param fossology: information about FOSSology server
808856 :type name: string
809857 :type description: string
810858 :type version: string
811859 :type security: list
812860 :type contact: string
813861 :type license: ApiLicense object
862+ :type fossology: FossologyServer object
814863 :type kwargs: key word argument
815864 """
816865
817866 def __init__ (
818- self , name , description , version , security , contact , license , ** kwargs
867+ self ,
868+ name ,
869+ description ,
870+ version ,
871+ security ,
872+ contact ,
873+ license ,
874+ fossology ,
875+ ** kwargs ,
819876 ):
820877 self .name = name
821878 self .description = description
822879 self .version = version
823880 self .security = security
824881 self .contact = contact
825882 self .license = ApiLicense .from_json (license )
883+ self .fossology = FossologyServer .from_json (fossology )
826884 self .additional_info = kwargs
827885
828886 def __str__ (self ):
829- return f"FOSSology API { self .name } is deployed with version { self .version } "
887+ return f"{ self .name } is deployed with version { self .version } "
830888
831889 @classmethod
832890 def from_json (cls , json_dict ):
0 commit comments