googlesafebrowsing.pp 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011
  1. unit googlesafebrowsing;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TFindThreatMatchesRequest = Class;
  9. TClientInfo = Class;
  10. TThreatInfo = Class;
  11. TThreatEntry = Class;
  12. TFindThreatMatchesResponse = Class;
  13. TThreatMatch = Class;
  14. TThreatEntryMetadata = Class;
  15. TMetadataEntry = Class;
  16. TFetchThreatListUpdatesRequest = Class;
  17. TListUpdateRequest = Class;
  18. TConstraints = Class;
  19. TFetchThreatListUpdatesResponse = Class;
  20. TListUpdateResponse = Class;
  21. TThreatEntrySet = Class;
  22. TRawHashes = Class;
  23. TRawIndices = Class;
  24. TRiceDeltaEncoding = Class;
  25. TChecksum = Class;
  26. TFindFullHashesRequest = Class;
  27. TFindFullHashesResponse = Class;
  28. TListThreatListsResponse = Class;
  29. TThreatListDescriptor = Class;
  30. TFindThreatMatchesRequestArray = Array of TFindThreatMatchesRequest;
  31. TClientInfoArray = Array of TClientInfo;
  32. TThreatInfoArray = Array of TThreatInfo;
  33. TThreatEntryArray = Array of TThreatEntry;
  34. TFindThreatMatchesResponseArray = Array of TFindThreatMatchesResponse;
  35. TThreatMatchArray = Array of TThreatMatch;
  36. TThreatEntryMetadataArray = Array of TThreatEntryMetadata;
  37. TMetadataEntryArray = Array of TMetadataEntry;
  38. TFetchThreatListUpdatesRequestArray = Array of TFetchThreatListUpdatesRequest;
  39. TListUpdateRequestArray = Array of TListUpdateRequest;
  40. TConstraintsArray = Array of TConstraints;
  41. TFetchThreatListUpdatesResponseArray = Array of TFetchThreatListUpdatesResponse;
  42. TListUpdateResponseArray = Array of TListUpdateResponse;
  43. TThreatEntrySetArray = Array of TThreatEntrySet;
  44. TRawHashesArray = Array of TRawHashes;
  45. TRawIndicesArray = Array of TRawIndices;
  46. TRiceDeltaEncodingArray = Array of TRiceDeltaEncoding;
  47. TChecksumArray = Array of TChecksum;
  48. TFindFullHashesRequestArray = Array of TFindFullHashesRequest;
  49. TFindFullHashesResponseArray = Array of TFindFullHashesResponse;
  50. TListThreatListsResponseArray = Array of TListThreatListsResponse;
  51. TThreatListDescriptorArray = Array of TThreatListDescriptor;
  52. //Anonymous types, using auto-generated names
  53. TThreatInfoTypethreatEntriesArray = Array of TThreatEntry;
  54. TFindThreatMatchesResponseTypematchesArray = Array of TThreatMatch;
  55. TThreatEntryMetadataTypeentriesArray = Array of TMetadataEntry;
  56. TFetchThreatListUpdatesRequestTypelistUpdateRequestsArray = Array of TListUpdateRequest;
  57. TFetchThreatListUpdatesResponseTypelistUpdateResponsesArray = Array of TListUpdateResponse;
  58. TListUpdateResponseTypeadditionsArray = Array of TThreatEntrySet;
  59. TListUpdateResponseTyperemovalsArray = Array of TThreatEntrySet;
  60. TFindFullHashesResponseTypematchesArray = Array of TThreatMatch;
  61. TListThreatListsResponseTypethreatListsArray = Array of TThreatListDescriptor;
  62. { --------------------------------------------------------------------
  63. TFindThreatMatchesRequest
  64. --------------------------------------------------------------------}
  65. TFindThreatMatchesRequest = Class(TGoogleBaseObject)
  66. Private
  67. Fclient : TClientInfo;
  68. FthreatInfo : TThreatInfo;
  69. Protected
  70. //Property setters
  71. Procedure Setclient(AIndex : Integer; const AValue : TClientInfo); virtual;
  72. Procedure SetthreatInfo(AIndex : Integer; const AValue : TThreatInfo); virtual;
  73. Public
  74. Published
  75. Property client : TClientInfo Index 0 Read Fclient Write Setclient;
  76. Property threatInfo : TThreatInfo Index 8 Read FthreatInfo Write SetthreatInfo;
  77. end;
  78. TFindThreatMatchesRequestClass = Class of TFindThreatMatchesRequest;
  79. { --------------------------------------------------------------------
  80. TClientInfo
  81. --------------------------------------------------------------------}
  82. TClientInfo = Class(TGoogleBaseObject)
  83. Private
  84. FclientId : String;
  85. FclientVersion : String;
  86. Protected
  87. //Property setters
  88. Procedure SetclientId(AIndex : Integer; const AValue : String); virtual;
  89. Procedure SetclientVersion(AIndex : Integer; const AValue : String); virtual;
  90. Public
  91. Published
  92. Property clientId : String Index 0 Read FclientId Write SetclientId;
  93. Property clientVersion : String Index 8 Read FclientVersion Write SetclientVersion;
  94. end;
  95. TClientInfoClass = Class of TClientInfo;
  96. { --------------------------------------------------------------------
  97. TThreatInfo
  98. --------------------------------------------------------------------}
  99. TThreatInfo = Class(TGoogleBaseObject)
  100. Private
  101. FthreatTypes : TStringArray;
  102. FplatformTypes : TStringArray;
  103. FthreatEntryTypes : TStringArray;
  104. FthreatEntries : TThreatInfoTypethreatEntriesArray;
  105. Protected
  106. //Property setters
  107. Procedure SetthreatTypes(AIndex : Integer; const AValue : TStringArray); virtual;
  108. Procedure SetplatformTypes(AIndex : Integer; const AValue : TStringArray); virtual;
  109. Procedure SetthreatEntryTypes(AIndex : Integer; const AValue : TStringArray); virtual;
  110. Procedure SetthreatEntries(AIndex : Integer; const AValue : TThreatInfoTypethreatEntriesArray); virtual;
  111. //2.6.4. bug workaround
  112. {$IFDEF VER2_6}
  113. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  114. {$ENDIF VER2_6}
  115. Public
  116. Published
  117. Property threatTypes : TStringArray Index 0 Read FthreatTypes Write SetthreatTypes;
  118. Property platformTypes : TStringArray Index 8 Read FplatformTypes Write SetplatformTypes;
  119. Property threatEntryTypes : TStringArray Index 16 Read FthreatEntryTypes Write SetthreatEntryTypes;
  120. Property threatEntries : TThreatInfoTypethreatEntriesArray Index 24 Read FthreatEntries Write SetthreatEntries;
  121. end;
  122. TThreatInfoClass = Class of TThreatInfo;
  123. { --------------------------------------------------------------------
  124. TThreatEntry
  125. --------------------------------------------------------------------}
  126. TThreatEntry = Class(TGoogleBaseObject)
  127. Private
  128. Fhash : String;
  129. Furl : String;
  130. Fdigest : String;
  131. Protected
  132. //Property setters
  133. Procedure Sethash(AIndex : Integer; const AValue : String); virtual;
  134. Procedure Seturl(AIndex : Integer; const AValue : String); virtual;
  135. Procedure Setdigest(AIndex : Integer; const AValue : String); virtual;
  136. Public
  137. Published
  138. Property hash : String Index 0 Read Fhash Write Sethash;
  139. Property url : String Index 8 Read Furl Write Seturl;
  140. Property digest : String Index 16 Read Fdigest Write Setdigest;
  141. end;
  142. TThreatEntryClass = Class of TThreatEntry;
  143. { --------------------------------------------------------------------
  144. TFindThreatMatchesResponse
  145. --------------------------------------------------------------------}
  146. TFindThreatMatchesResponse = Class(TGoogleBaseObject)
  147. Private
  148. Fmatches : TFindThreatMatchesResponseTypematchesArray;
  149. Protected
  150. //Property setters
  151. Procedure Setmatches(AIndex : Integer; const AValue : TFindThreatMatchesResponseTypematchesArray); virtual;
  152. //2.6.4. bug workaround
  153. {$IFDEF VER2_6}
  154. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  155. {$ENDIF VER2_6}
  156. Public
  157. Published
  158. Property matches : TFindThreatMatchesResponseTypematchesArray Index 0 Read Fmatches Write Setmatches;
  159. end;
  160. TFindThreatMatchesResponseClass = Class of TFindThreatMatchesResponse;
  161. { --------------------------------------------------------------------
  162. TThreatMatch
  163. --------------------------------------------------------------------}
  164. TThreatMatch = Class(TGoogleBaseObject)
  165. Private
  166. FthreatType : String;
  167. FplatformType : String;
  168. FthreatEntryType : String;
  169. Fthreat : TThreatEntry;
  170. FthreatEntryMetadata : TThreatEntryMetadata;
  171. FcacheDuration : String;
  172. Protected
  173. //Property setters
  174. Procedure SetthreatType(AIndex : Integer; const AValue : String); virtual;
  175. Procedure SetplatformType(AIndex : Integer; const AValue : String); virtual;
  176. Procedure SetthreatEntryType(AIndex : Integer; const AValue : String); virtual;
  177. Procedure Setthreat(AIndex : Integer; const AValue : TThreatEntry); virtual;
  178. Procedure SetthreatEntryMetadata(AIndex : Integer; const AValue : TThreatEntryMetadata); virtual;
  179. Procedure SetcacheDuration(AIndex : Integer; const AValue : String); virtual;
  180. Public
  181. Published
  182. Property threatType : String Index 0 Read FthreatType Write SetthreatType;
  183. Property platformType : String Index 8 Read FplatformType Write SetplatformType;
  184. Property threatEntryType : String Index 16 Read FthreatEntryType Write SetthreatEntryType;
  185. Property threat : TThreatEntry Index 24 Read Fthreat Write Setthreat;
  186. Property threatEntryMetadata : TThreatEntryMetadata Index 32 Read FthreatEntryMetadata Write SetthreatEntryMetadata;
  187. Property cacheDuration : String Index 40 Read FcacheDuration Write SetcacheDuration;
  188. end;
  189. TThreatMatchClass = Class of TThreatMatch;
  190. { --------------------------------------------------------------------
  191. TThreatEntryMetadata
  192. --------------------------------------------------------------------}
  193. TThreatEntryMetadata = Class(TGoogleBaseObject)
  194. Private
  195. Fentries : TThreatEntryMetadataTypeentriesArray;
  196. Protected
  197. //Property setters
  198. Procedure Setentries(AIndex : Integer; const AValue : TThreatEntryMetadataTypeentriesArray); virtual;
  199. //2.6.4. bug workaround
  200. {$IFDEF VER2_6}
  201. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  202. {$ENDIF VER2_6}
  203. Public
  204. Published
  205. Property entries : TThreatEntryMetadataTypeentriesArray Index 0 Read Fentries Write Setentries;
  206. end;
  207. TThreatEntryMetadataClass = Class of TThreatEntryMetadata;
  208. { --------------------------------------------------------------------
  209. TMetadataEntry
  210. --------------------------------------------------------------------}
  211. TMetadataEntry = Class(TGoogleBaseObject)
  212. Private
  213. Fkey : String;
  214. Fvalue : String;
  215. Protected
  216. //Property setters
  217. Procedure Setkey(AIndex : Integer; const AValue : String); virtual;
  218. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  219. Public
  220. Published
  221. Property key : String Index 0 Read Fkey Write Setkey;
  222. Property value : String Index 8 Read Fvalue Write Setvalue;
  223. end;
  224. TMetadataEntryClass = Class of TMetadataEntry;
  225. { --------------------------------------------------------------------
  226. TFetchThreatListUpdatesRequest
  227. --------------------------------------------------------------------}
  228. TFetchThreatListUpdatesRequest = Class(TGoogleBaseObject)
  229. Private
  230. Fclient : TClientInfo;
  231. FlistUpdateRequests : TFetchThreatListUpdatesRequestTypelistUpdateRequestsArray;
  232. Protected
  233. //Property setters
  234. Procedure Setclient(AIndex : Integer; const AValue : TClientInfo); virtual;
  235. Procedure SetlistUpdateRequests(AIndex : Integer; const AValue : TFetchThreatListUpdatesRequestTypelistUpdateRequestsArray); virtual;
  236. //2.6.4. bug workaround
  237. {$IFDEF VER2_6}
  238. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  239. {$ENDIF VER2_6}
  240. Public
  241. Published
  242. Property client : TClientInfo Index 0 Read Fclient Write Setclient;
  243. Property listUpdateRequests : TFetchThreatListUpdatesRequestTypelistUpdateRequestsArray Index 8 Read FlistUpdateRequests Write SetlistUpdateRequests;
  244. end;
  245. TFetchThreatListUpdatesRequestClass = Class of TFetchThreatListUpdatesRequest;
  246. { --------------------------------------------------------------------
  247. TListUpdateRequest
  248. --------------------------------------------------------------------}
  249. TListUpdateRequest = Class(TGoogleBaseObject)
  250. Private
  251. FthreatType : String;
  252. FplatformType : String;
  253. FthreatEntryType : String;
  254. Fstate : String;
  255. Fconstraints : TConstraints;
  256. Protected
  257. //Property setters
  258. Procedure SetthreatType(AIndex : Integer; const AValue : String); virtual;
  259. Procedure SetplatformType(AIndex : Integer; const AValue : String); virtual;
  260. Procedure SetthreatEntryType(AIndex : Integer; const AValue : String); virtual;
  261. Procedure Setstate(AIndex : Integer; const AValue : String); virtual;
  262. Procedure Setconstraints(AIndex : Integer; const AValue : TConstraints); virtual;
  263. Public
  264. Published
  265. Property threatType : String Index 0 Read FthreatType Write SetthreatType;
  266. Property platformType : String Index 8 Read FplatformType Write SetplatformType;
  267. Property threatEntryType : String Index 16 Read FthreatEntryType Write SetthreatEntryType;
  268. Property state : String Index 24 Read Fstate Write Setstate;
  269. Property constraints : TConstraints Index 32 Read Fconstraints Write Setconstraints;
  270. end;
  271. TListUpdateRequestClass = Class of TListUpdateRequest;
  272. { --------------------------------------------------------------------
  273. TConstraints
  274. --------------------------------------------------------------------}
  275. TConstraints = Class(TGoogleBaseObject)
  276. Private
  277. FmaxUpdateEntries : integer;
  278. FmaxDatabaseEntries : integer;
  279. Fregion : String;
  280. FsupportedCompressions : TStringArray;
  281. Protected
  282. //Property setters
  283. Procedure SetmaxUpdateEntries(AIndex : Integer; const AValue : integer); virtual;
  284. Procedure SetmaxDatabaseEntries(AIndex : Integer; const AValue : integer); virtual;
  285. Procedure Setregion(AIndex : Integer; const AValue : String); virtual;
  286. Procedure SetsupportedCompressions(AIndex : Integer; const AValue : TStringArray); virtual;
  287. //2.6.4. bug workaround
  288. {$IFDEF VER2_6}
  289. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  290. {$ENDIF VER2_6}
  291. Public
  292. Published
  293. Property maxUpdateEntries : integer Index 0 Read FmaxUpdateEntries Write SetmaxUpdateEntries;
  294. Property maxDatabaseEntries : integer Index 8 Read FmaxDatabaseEntries Write SetmaxDatabaseEntries;
  295. Property region : String Index 16 Read Fregion Write Setregion;
  296. Property supportedCompressions : TStringArray Index 24 Read FsupportedCompressions Write SetsupportedCompressions;
  297. end;
  298. TConstraintsClass = Class of TConstraints;
  299. { --------------------------------------------------------------------
  300. TFetchThreatListUpdatesResponse
  301. --------------------------------------------------------------------}
  302. TFetchThreatListUpdatesResponse = Class(TGoogleBaseObject)
  303. Private
  304. FlistUpdateResponses : TFetchThreatListUpdatesResponseTypelistUpdateResponsesArray;
  305. FminimumWaitDuration : String;
  306. Protected
  307. //Property setters
  308. Procedure SetlistUpdateResponses(AIndex : Integer; const AValue : TFetchThreatListUpdatesResponseTypelistUpdateResponsesArray); virtual;
  309. Procedure SetminimumWaitDuration(AIndex : Integer; const AValue : String); virtual;
  310. //2.6.4. bug workaround
  311. {$IFDEF VER2_6}
  312. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  313. {$ENDIF VER2_6}
  314. Public
  315. Published
  316. Property listUpdateResponses : TFetchThreatListUpdatesResponseTypelistUpdateResponsesArray Index 0 Read FlistUpdateResponses Write SetlistUpdateResponses;
  317. Property minimumWaitDuration : String Index 8 Read FminimumWaitDuration Write SetminimumWaitDuration;
  318. end;
  319. TFetchThreatListUpdatesResponseClass = Class of TFetchThreatListUpdatesResponse;
  320. { --------------------------------------------------------------------
  321. TListUpdateResponse
  322. --------------------------------------------------------------------}
  323. TListUpdateResponse = Class(TGoogleBaseObject)
  324. Private
  325. FthreatType : String;
  326. FthreatEntryType : String;
  327. FplatformType : String;
  328. FresponseType : String;
  329. Fadditions : TListUpdateResponseTypeadditionsArray;
  330. Fremovals : TListUpdateResponseTyperemovalsArray;
  331. FnewClientState : String;
  332. Fchecksum : TChecksum;
  333. Protected
  334. //Property setters
  335. Procedure SetthreatType(AIndex : Integer; const AValue : String); virtual;
  336. Procedure SetthreatEntryType(AIndex : Integer; const AValue : String); virtual;
  337. Procedure SetplatformType(AIndex : Integer; const AValue : String); virtual;
  338. Procedure SetresponseType(AIndex : Integer; const AValue : String); virtual;
  339. Procedure Setadditions(AIndex : Integer; const AValue : TListUpdateResponseTypeadditionsArray); virtual;
  340. Procedure Setremovals(AIndex : Integer; const AValue : TListUpdateResponseTyperemovalsArray); virtual;
  341. Procedure SetnewClientState(AIndex : Integer; const AValue : String); virtual;
  342. Procedure Setchecksum(AIndex : Integer; const AValue : TChecksum); virtual;
  343. //2.6.4. bug workaround
  344. {$IFDEF VER2_6}
  345. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  346. {$ENDIF VER2_6}
  347. Public
  348. Published
  349. Property threatType : String Index 0 Read FthreatType Write SetthreatType;
  350. Property threatEntryType : String Index 8 Read FthreatEntryType Write SetthreatEntryType;
  351. Property platformType : String Index 16 Read FplatformType Write SetplatformType;
  352. Property responseType : String Index 24 Read FresponseType Write SetresponseType;
  353. Property additions : TListUpdateResponseTypeadditionsArray Index 32 Read Fadditions Write Setadditions;
  354. Property removals : TListUpdateResponseTyperemovalsArray Index 40 Read Fremovals Write Setremovals;
  355. Property newClientState : String Index 48 Read FnewClientState Write SetnewClientState;
  356. Property checksum : TChecksum Index 56 Read Fchecksum Write Setchecksum;
  357. end;
  358. TListUpdateResponseClass = Class of TListUpdateResponse;
  359. { --------------------------------------------------------------------
  360. TThreatEntrySet
  361. --------------------------------------------------------------------}
  362. TThreatEntrySet = Class(TGoogleBaseObject)
  363. Private
  364. FcompressionType : String;
  365. FrawHashes : TRawHashes;
  366. FrawIndices : TRawIndices;
  367. FriceHashes : TRiceDeltaEncoding;
  368. FriceIndices : TRiceDeltaEncoding;
  369. Protected
  370. //Property setters
  371. Procedure SetcompressionType(AIndex : Integer; const AValue : String); virtual;
  372. Procedure SetrawHashes(AIndex : Integer; const AValue : TRawHashes); virtual;
  373. Procedure SetrawIndices(AIndex : Integer; const AValue : TRawIndices); virtual;
  374. Procedure SetriceHashes(AIndex : Integer; const AValue : TRiceDeltaEncoding); virtual;
  375. Procedure SetriceIndices(AIndex : Integer; const AValue : TRiceDeltaEncoding); virtual;
  376. Public
  377. Published
  378. Property compressionType : String Index 0 Read FcompressionType Write SetcompressionType;
  379. Property rawHashes : TRawHashes Index 8 Read FrawHashes Write SetrawHashes;
  380. Property rawIndices : TRawIndices Index 16 Read FrawIndices Write SetrawIndices;
  381. Property riceHashes : TRiceDeltaEncoding Index 24 Read FriceHashes Write SetriceHashes;
  382. Property riceIndices : TRiceDeltaEncoding Index 32 Read FriceIndices Write SetriceIndices;
  383. end;
  384. TThreatEntrySetClass = Class of TThreatEntrySet;
  385. { --------------------------------------------------------------------
  386. TRawHashes
  387. --------------------------------------------------------------------}
  388. TRawHashes = Class(TGoogleBaseObject)
  389. Private
  390. FprefixSize : integer;
  391. FrawHashes : String;
  392. Protected
  393. //Property setters
  394. Procedure SetprefixSize(AIndex : Integer; const AValue : integer); virtual;
  395. Procedure SetrawHashes(AIndex : Integer; const AValue : String); virtual;
  396. Public
  397. Published
  398. Property prefixSize : integer Index 0 Read FprefixSize Write SetprefixSize;
  399. Property rawHashes : String Index 8 Read FrawHashes Write SetrawHashes;
  400. end;
  401. TRawHashesClass = Class of TRawHashes;
  402. { --------------------------------------------------------------------
  403. TRawIndices
  404. --------------------------------------------------------------------}
  405. TRawIndices = Class(TGoogleBaseObject)
  406. Private
  407. Findices : TintegerArray;
  408. Protected
  409. //Property setters
  410. Procedure Setindices(AIndex : Integer; const AValue : TintegerArray); virtual;
  411. //2.6.4. bug workaround
  412. {$IFDEF VER2_6}
  413. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  414. {$ENDIF VER2_6}
  415. Public
  416. Published
  417. Property indices : TintegerArray Index 0 Read Findices Write Setindices;
  418. end;
  419. TRawIndicesClass = Class of TRawIndices;
  420. { --------------------------------------------------------------------
  421. TRiceDeltaEncoding
  422. --------------------------------------------------------------------}
  423. TRiceDeltaEncoding = Class(TGoogleBaseObject)
  424. Private
  425. FfirstValue : String;
  426. FriceParameter : integer;
  427. FnumEntries : integer;
  428. FencodedData : String;
  429. Protected
  430. //Property setters
  431. Procedure SetfirstValue(AIndex : Integer; const AValue : String); virtual;
  432. Procedure SetriceParameter(AIndex : Integer; const AValue : integer); virtual;
  433. Procedure SetnumEntries(AIndex : Integer; const AValue : integer); virtual;
  434. Procedure SetencodedData(AIndex : Integer; const AValue : String); virtual;
  435. Public
  436. Published
  437. Property firstValue : String Index 0 Read FfirstValue Write SetfirstValue;
  438. Property riceParameter : integer Index 8 Read FriceParameter Write SetriceParameter;
  439. Property numEntries : integer Index 16 Read FnumEntries Write SetnumEntries;
  440. Property encodedData : String Index 24 Read FencodedData Write SetencodedData;
  441. end;
  442. TRiceDeltaEncodingClass = Class of TRiceDeltaEncoding;
  443. { --------------------------------------------------------------------
  444. TChecksum
  445. --------------------------------------------------------------------}
  446. TChecksum = Class(TGoogleBaseObject)
  447. Private
  448. Fsha256 : String;
  449. Protected
  450. //Property setters
  451. Procedure Setsha256(AIndex : Integer; const AValue : String); virtual;
  452. Public
  453. Published
  454. Property sha256 : String Index 0 Read Fsha256 Write Setsha256;
  455. end;
  456. TChecksumClass = Class of TChecksum;
  457. { --------------------------------------------------------------------
  458. TFindFullHashesRequest
  459. --------------------------------------------------------------------}
  460. TFindFullHashesRequest = Class(TGoogleBaseObject)
  461. Private
  462. Fclient : TClientInfo;
  463. FclientStates : TStringArray;
  464. FthreatInfo : TThreatInfo;
  465. Protected
  466. //Property setters
  467. Procedure Setclient(AIndex : Integer; const AValue : TClientInfo); virtual;
  468. Procedure SetclientStates(AIndex : Integer; const AValue : TStringArray); virtual;
  469. Procedure SetthreatInfo(AIndex : Integer; const AValue : TThreatInfo); virtual;
  470. //2.6.4. bug workaround
  471. {$IFDEF VER2_6}
  472. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  473. {$ENDIF VER2_6}
  474. Public
  475. Published
  476. Property client : TClientInfo Index 0 Read Fclient Write Setclient;
  477. Property clientStates : TStringArray Index 8 Read FclientStates Write SetclientStates;
  478. Property threatInfo : TThreatInfo Index 16 Read FthreatInfo Write SetthreatInfo;
  479. end;
  480. TFindFullHashesRequestClass = Class of TFindFullHashesRequest;
  481. { --------------------------------------------------------------------
  482. TFindFullHashesResponse
  483. --------------------------------------------------------------------}
  484. TFindFullHashesResponse = Class(TGoogleBaseObject)
  485. Private
  486. Fmatches : TFindFullHashesResponseTypematchesArray;
  487. FminimumWaitDuration : String;
  488. FnegativeCacheDuration : String;
  489. Protected
  490. //Property setters
  491. Procedure Setmatches(AIndex : Integer; const AValue : TFindFullHashesResponseTypematchesArray); virtual;
  492. Procedure SetminimumWaitDuration(AIndex : Integer; const AValue : String); virtual;
  493. Procedure SetnegativeCacheDuration(AIndex : Integer; const AValue : String); virtual;
  494. //2.6.4. bug workaround
  495. {$IFDEF VER2_6}
  496. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  497. {$ENDIF VER2_6}
  498. Public
  499. Published
  500. Property matches : TFindFullHashesResponseTypematchesArray Index 0 Read Fmatches Write Setmatches;
  501. Property minimumWaitDuration : String Index 8 Read FminimumWaitDuration Write SetminimumWaitDuration;
  502. Property negativeCacheDuration : String Index 16 Read FnegativeCacheDuration Write SetnegativeCacheDuration;
  503. end;
  504. TFindFullHashesResponseClass = Class of TFindFullHashesResponse;
  505. { --------------------------------------------------------------------
  506. TListThreatListsResponse
  507. --------------------------------------------------------------------}
  508. TListThreatListsResponse = Class(TGoogleBaseObject)
  509. Private
  510. FthreatLists : TListThreatListsResponseTypethreatListsArray;
  511. Protected
  512. //Property setters
  513. Procedure SetthreatLists(AIndex : Integer; const AValue : TListThreatListsResponseTypethreatListsArray); virtual;
  514. //2.6.4. bug workaround
  515. {$IFDEF VER2_6}
  516. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  517. {$ENDIF VER2_6}
  518. Public
  519. Published
  520. Property threatLists : TListThreatListsResponseTypethreatListsArray Index 0 Read FthreatLists Write SetthreatLists;
  521. end;
  522. TListThreatListsResponseClass = Class of TListThreatListsResponse;
  523. { --------------------------------------------------------------------
  524. TThreatListDescriptor
  525. --------------------------------------------------------------------}
  526. TThreatListDescriptor = Class(TGoogleBaseObject)
  527. Private
  528. FthreatType : String;
  529. FplatformType : String;
  530. FthreatEntryType : String;
  531. Protected
  532. //Property setters
  533. Procedure SetthreatType(AIndex : Integer; const AValue : String); virtual;
  534. Procedure SetplatformType(AIndex : Integer; const AValue : String); virtual;
  535. Procedure SetthreatEntryType(AIndex : Integer; const AValue : String); virtual;
  536. Public
  537. Published
  538. Property threatType : String Index 0 Read FthreatType Write SetthreatType;
  539. Property platformType : String Index 8 Read FplatformType Write SetplatformType;
  540. Property threatEntryType : String Index 16 Read FthreatEntryType Write SetthreatEntryType;
  541. end;
  542. TThreatListDescriptorClass = Class of TThreatListDescriptor;
  543. { --------------------------------------------------------------------
  544. TThreatMatchesResource
  545. --------------------------------------------------------------------}
  546. TThreatMatchesResource = Class(TGoogleResource)
  547. Public
  548. Class Function ResourceName : String; override;
  549. Class Function DefaultAPI : TGoogleAPIClass; override;
  550. Function Find(aFindThreatMatchesRequest : TFindThreatMatchesRequest) : TFindThreatMatchesResponse;
  551. end;
  552. { --------------------------------------------------------------------
  553. TThreatListUpdatesResource
  554. --------------------------------------------------------------------}
  555. TThreatListUpdatesResource = Class(TGoogleResource)
  556. Public
  557. Class Function ResourceName : String; override;
  558. Class Function DefaultAPI : TGoogleAPIClass; override;
  559. Function Fetch(aFetchThreatListUpdatesRequest : TFetchThreatListUpdatesRequest) : TFetchThreatListUpdatesResponse;
  560. end;
  561. { --------------------------------------------------------------------
  562. TFullHashesResource
  563. --------------------------------------------------------------------}
  564. TFullHashesResource = Class(TGoogleResource)
  565. Public
  566. Class Function ResourceName : String; override;
  567. Class Function DefaultAPI : TGoogleAPIClass; override;
  568. Function Find(aFindFullHashesRequest : TFindFullHashesRequest) : TFindFullHashesResponse;
  569. end;
  570. { --------------------------------------------------------------------
  571. TThreatListsResource
  572. --------------------------------------------------------------------}
  573. TThreatListsResource = Class(TGoogleResource)
  574. Public
  575. Class Function ResourceName : String; override;
  576. Class Function DefaultAPI : TGoogleAPIClass; override;
  577. Function List : TListThreatListsResponse;
  578. end;
  579. { --------------------------------------------------------------------
  580. TSafebrowsingAPI
  581. --------------------------------------------------------------------}
  582. TSafebrowsingAPI = Class(TGoogleAPI)
  583. Private
  584. FThreatMatchesInstance : TThreatMatchesResource;
  585. FThreatListUpdatesInstance : TThreatListUpdatesResource;
  586. FFullHashesInstance : TFullHashesResource;
  587. FThreatListsInstance : TThreatListsResource;
  588. Function GetThreatMatchesInstance : TThreatMatchesResource;virtual;
  589. Function GetThreatListUpdatesInstance : TThreatListUpdatesResource;virtual;
  590. Function GetFullHashesInstance : TFullHashesResource;virtual;
  591. Function GetThreatListsInstance : TThreatListsResource;virtual;
  592. Public
  593. //Override class functions with API info
  594. Class Function APIName : String; override;
  595. Class Function APIVersion : String; override;
  596. Class Function APIRevision : String; override;
  597. Class Function APIID : String; override;
  598. Class Function APITitle : String; override;
  599. Class Function APIDescription : String; override;
  600. Class Function APIOwnerDomain : String; override;
  601. Class Function APIOwnerName : String; override;
  602. Class Function APIIcon16 : String; override;
  603. Class Function APIIcon32 : String; override;
  604. Class Function APIdocumentationLink : String; override;
  605. Class Function APIrootUrl : string; override;
  606. Class Function APIbasePath : string;override;
  607. Class Function APIbaseURL : String;override;
  608. Class Function APIProtocol : string;override;
  609. Class Function APIservicePath : string;override;
  610. Class Function APIbatchPath : String;override;
  611. Class Function APIAuthScopes : TScopeInfoArray;override;
  612. Class Function APINeedsAuth : Boolean;override;
  613. Class Procedure RegisterAPIResources; override;
  614. //Add create function for resources
  615. Function CreateThreatMatchesResource(AOwner : TComponent) : TThreatMatchesResource;virtual;overload;
  616. Function CreateThreatMatchesResource : TThreatMatchesResource;virtual;overload;
  617. Function CreateThreatListUpdatesResource(AOwner : TComponent) : TThreatListUpdatesResource;virtual;overload;
  618. Function CreateThreatListUpdatesResource : TThreatListUpdatesResource;virtual;overload;
  619. Function CreateFullHashesResource(AOwner : TComponent) : TFullHashesResource;virtual;overload;
  620. Function CreateFullHashesResource : TFullHashesResource;virtual;overload;
  621. Function CreateThreatListsResource(AOwner : TComponent) : TThreatListsResource;virtual;overload;
  622. Function CreateThreatListsResource : TThreatListsResource;virtual;overload;
  623. //Add default on-demand instances for resources
  624. Property ThreatMatchesResource : TThreatMatchesResource Read GetThreatMatchesInstance;
  625. Property ThreatListUpdatesResource : TThreatListUpdatesResource Read GetThreatListUpdatesInstance;
  626. Property FullHashesResource : TFullHashesResource Read GetFullHashesInstance;
  627. Property ThreatListsResource : TThreatListsResource Read GetThreatListsInstance;
  628. end;
  629. implementation
  630. { --------------------------------------------------------------------
  631. TFindThreatMatchesRequest
  632. --------------------------------------------------------------------}
  633. Procedure TFindThreatMatchesRequest.Setclient(AIndex : Integer; const AValue : TClientInfo);
  634. begin
  635. If (Fclient=AValue) then exit;
  636. Fclient:=AValue;
  637. MarkPropertyChanged(AIndex);
  638. end;
  639. Procedure TFindThreatMatchesRequest.SetthreatInfo(AIndex : Integer; const AValue : TThreatInfo);
  640. begin
  641. If (FthreatInfo=AValue) then exit;
  642. FthreatInfo:=AValue;
  643. MarkPropertyChanged(AIndex);
  644. end;
  645. { --------------------------------------------------------------------
  646. TClientInfo
  647. --------------------------------------------------------------------}
  648. Procedure TClientInfo.SetclientId(AIndex : Integer; const AValue : String);
  649. begin
  650. If (FclientId=AValue) then exit;
  651. FclientId:=AValue;
  652. MarkPropertyChanged(AIndex);
  653. end;
  654. Procedure TClientInfo.SetclientVersion(AIndex : Integer; const AValue : String);
  655. begin
  656. If (FclientVersion=AValue) then exit;
  657. FclientVersion:=AValue;
  658. MarkPropertyChanged(AIndex);
  659. end;
  660. { --------------------------------------------------------------------
  661. TThreatInfo
  662. --------------------------------------------------------------------}
  663. Procedure TThreatInfo.SetthreatTypes(AIndex : Integer; const AValue : TStringArray);
  664. begin
  665. If (FthreatTypes=AValue) then exit;
  666. FthreatTypes:=AValue;
  667. MarkPropertyChanged(AIndex);
  668. end;
  669. Procedure TThreatInfo.SetplatformTypes(AIndex : Integer; const AValue : TStringArray);
  670. begin
  671. If (FplatformTypes=AValue) then exit;
  672. FplatformTypes:=AValue;
  673. MarkPropertyChanged(AIndex);
  674. end;
  675. Procedure TThreatInfo.SetthreatEntryTypes(AIndex : Integer; const AValue : TStringArray);
  676. begin
  677. If (FthreatEntryTypes=AValue) then exit;
  678. FthreatEntryTypes:=AValue;
  679. MarkPropertyChanged(AIndex);
  680. end;
  681. Procedure TThreatInfo.SetthreatEntries(AIndex : Integer; const AValue : TThreatInfoTypethreatEntriesArray);
  682. begin
  683. If (FthreatEntries=AValue) then exit;
  684. FthreatEntries:=AValue;
  685. MarkPropertyChanged(AIndex);
  686. end;
  687. //2.6.4. bug workaround
  688. {$IFDEF VER2_6}
  689. Procedure TThreatInfo.SetArrayLength(Const AName : String; ALength : Longint);
  690. begin
  691. Case AName of
  692. 'threattypes' : SetLength(FthreatTypes,ALength);
  693. 'platformtypes' : SetLength(FplatformTypes,ALength);
  694. 'threatentrytypes' : SetLength(FthreatEntryTypes,ALength);
  695. 'threatentries' : SetLength(FthreatEntries,ALength);
  696. else
  697. Inherited SetArrayLength(AName,ALength);
  698. end;
  699. end;
  700. {$ENDIF VER2_6}
  701. { --------------------------------------------------------------------
  702. TThreatEntry
  703. --------------------------------------------------------------------}
  704. Procedure TThreatEntry.Sethash(AIndex : Integer; const AValue : String);
  705. begin
  706. If (Fhash=AValue) then exit;
  707. Fhash:=AValue;
  708. MarkPropertyChanged(AIndex);
  709. end;
  710. Procedure TThreatEntry.Seturl(AIndex : Integer; const AValue : String);
  711. begin
  712. If (Furl=AValue) then exit;
  713. Furl:=AValue;
  714. MarkPropertyChanged(AIndex);
  715. end;
  716. Procedure TThreatEntry.Setdigest(AIndex : Integer; const AValue : String);
  717. begin
  718. If (Fdigest=AValue) then exit;
  719. Fdigest:=AValue;
  720. MarkPropertyChanged(AIndex);
  721. end;
  722. { --------------------------------------------------------------------
  723. TFindThreatMatchesResponse
  724. --------------------------------------------------------------------}
  725. Procedure TFindThreatMatchesResponse.Setmatches(AIndex : Integer; const AValue : TFindThreatMatchesResponseTypematchesArray);
  726. begin
  727. If (Fmatches=AValue) then exit;
  728. Fmatches:=AValue;
  729. MarkPropertyChanged(AIndex);
  730. end;
  731. //2.6.4. bug workaround
  732. {$IFDEF VER2_6}
  733. Procedure TFindThreatMatchesResponse.SetArrayLength(Const AName : String; ALength : Longint);
  734. begin
  735. Case AName of
  736. 'matches' : SetLength(Fmatches,ALength);
  737. else
  738. Inherited SetArrayLength(AName,ALength);
  739. end;
  740. end;
  741. {$ENDIF VER2_6}
  742. { --------------------------------------------------------------------
  743. TThreatMatch
  744. --------------------------------------------------------------------}
  745. Procedure TThreatMatch.SetthreatType(AIndex : Integer; const AValue : String);
  746. begin
  747. If (FthreatType=AValue) then exit;
  748. FthreatType:=AValue;
  749. MarkPropertyChanged(AIndex);
  750. end;
  751. Procedure TThreatMatch.SetplatformType(AIndex : Integer; const AValue : String);
  752. begin
  753. If (FplatformType=AValue) then exit;
  754. FplatformType:=AValue;
  755. MarkPropertyChanged(AIndex);
  756. end;
  757. Procedure TThreatMatch.SetthreatEntryType(AIndex : Integer; const AValue : String);
  758. begin
  759. If (FthreatEntryType=AValue) then exit;
  760. FthreatEntryType:=AValue;
  761. MarkPropertyChanged(AIndex);
  762. end;
  763. Procedure TThreatMatch.Setthreat(AIndex : Integer; const AValue : TThreatEntry);
  764. begin
  765. If (Fthreat=AValue) then exit;
  766. Fthreat:=AValue;
  767. MarkPropertyChanged(AIndex);
  768. end;
  769. Procedure TThreatMatch.SetthreatEntryMetadata(AIndex : Integer; const AValue : TThreatEntryMetadata);
  770. begin
  771. If (FthreatEntryMetadata=AValue) then exit;
  772. FthreatEntryMetadata:=AValue;
  773. MarkPropertyChanged(AIndex);
  774. end;
  775. Procedure TThreatMatch.SetcacheDuration(AIndex : Integer; const AValue : String);
  776. begin
  777. If (FcacheDuration=AValue) then exit;
  778. FcacheDuration:=AValue;
  779. MarkPropertyChanged(AIndex);
  780. end;
  781. { --------------------------------------------------------------------
  782. TThreatEntryMetadata
  783. --------------------------------------------------------------------}
  784. Procedure TThreatEntryMetadata.Setentries(AIndex : Integer; const AValue : TThreatEntryMetadataTypeentriesArray);
  785. begin
  786. If (Fentries=AValue) then exit;
  787. Fentries:=AValue;
  788. MarkPropertyChanged(AIndex);
  789. end;
  790. //2.6.4. bug workaround
  791. {$IFDEF VER2_6}
  792. Procedure TThreatEntryMetadata.SetArrayLength(Const AName : String; ALength : Longint);
  793. begin
  794. Case AName of
  795. 'entries' : SetLength(Fentries,ALength);
  796. else
  797. Inherited SetArrayLength(AName,ALength);
  798. end;
  799. end;
  800. {$ENDIF VER2_6}
  801. { --------------------------------------------------------------------
  802. TMetadataEntry
  803. --------------------------------------------------------------------}
  804. Procedure TMetadataEntry.Setkey(AIndex : Integer; const AValue : String);
  805. begin
  806. If (Fkey=AValue) then exit;
  807. Fkey:=AValue;
  808. MarkPropertyChanged(AIndex);
  809. end;
  810. Procedure TMetadataEntry.Setvalue(AIndex : Integer; const AValue : String);
  811. begin
  812. If (Fvalue=AValue) then exit;
  813. Fvalue:=AValue;
  814. MarkPropertyChanged(AIndex);
  815. end;
  816. { --------------------------------------------------------------------
  817. TFetchThreatListUpdatesRequest
  818. --------------------------------------------------------------------}
  819. Procedure TFetchThreatListUpdatesRequest.Setclient(AIndex : Integer; const AValue : TClientInfo);
  820. begin
  821. If (Fclient=AValue) then exit;
  822. Fclient:=AValue;
  823. MarkPropertyChanged(AIndex);
  824. end;
  825. Procedure TFetchThreatListUpdatesRequest.SetlistUpdateRequests(AIndex : Integer; const AValue : TFetchThreatListUpdatesRequestTypelistUpdateRequestsArray);
  826. begin
  827. If (FlistUpdateRequests=AValue) then exit;
  828. FlistUpdateRequests:=AValue;
  829. MarkPropertyChanged(AIndex);
  830. end;
  831. //2.6.4. bug workaround
  832. {$IFDEF VER2_6}
  833. Procedure TFetchThreatListUpdatesRequest.SetArrayLength(Const AName : String; ALength : Longint);
  834. begin
  835. Case AName of
  836. 'listupdaterequests' : SetLength(FlistUpdateRequests,ALength);
  837. else
  838. Inherited SetArrayLength(AName,ALength);
  839. end;
  840. end;
  841. {$ENDIF VER2_6}
  842. { --------------------------------------------------------------------
  843. TListUpdateRequest
  844. --------------------------------------------------------------------}
  845. Procedure TListUpdateRequest.SetthreatType(AIndex : Integer; const AValue : String);
  846. begin
  847. If (FthreatType=AValue) then exit;
  848. FthreatType:=AValue;
  849. MarkPropertyChanged(AIndex);
  850. end;
  851. Procedure TListUpdateRequest.SetplatformType(AIndex : Integer; const AValue : String);
  852. begin
  853. If (FplatformType=AValue) then exit;
  854. FplatformType:=AValue;
  855. MarkPropertyChanged(AIndex);
  856. end;
  857. Procedure TListUpdateRequest.SetthreatEntryType(AIndex : Integer; const AValue : String);
  858. begin
  859. If (FthreatEntryType=AValue) then exit;
  860. FthreatEntryType:=AValue;
  861. MarkPropertyChanged(AIndex);
  862. end;
  863. Procedure TListUpdateRequest.Setstate(AIndex : Integer; const AValue : String);
  864. begin
  865. If (Fstate=AValue) then exit;
  866. Fstate:=AValue;
  867. MarkPropertyChanged(AIndex);
  868. end;
  869. Procedure TListUpdateRequest.Setconstraints(AIndex : Integer; const AValue : TConstraints);
  870. begin
  871. If (Fconstraints=AValue) then exit;
  872. Fconstraints:=AValue;
  873. MarkPropertyChanged(AIndex);
  874. end;
  875. { --------------------------------------------------------------------
  876. TConstraints
  877. --------------------------------------------------------------------}
  878. Procedure TConstraints.SetmaxUpdateEntries(AIndex : Integer; const AValue : integer);
  879. begin
  880. If (FmaxUpdateEntries=AValue) then exit;
  881. FmaxUpdateEntries:=AValue;
  882. MarkPropertyChanged(AIndex);
  883. end;
  884. Procedure TConstraints.SetmaxDatabaseEntries(AIndex : Integer; const AValue : integer);
  885. begin
  886. If (FmaxDatabaseEntries=AValue) then exit;
  887. FmaxDatabaseEntries:=AValue;
  888. MarkPropertyChanged(AIndex);
  889. end;
  890. Procedure TConstraints.Setregion(AIndex : Integer; const AValue : String);
  891. begin
  892. If (Fregion=AValue) then exit;
  893. Fregion:=AValue;
  894. MarkPropertyChanged(AIndex);
  895. end;
  896. Procedure TConstraints.SetsupportedCompressions(AIndex : Integer; const AValue : TStringArray);
  897. begin
  898. If (FsupportedCompressions=AValue) then exit;
  899. FsupportedCompressions:=AValue;
  900. MarkPropertyChanged(AIndex);
  901. end;
  902. //2.6.4. bug workaround
  903. {$IFDEF VER2_6}
  904. Procedure TConstraints.SetArrayLength(Const AName : String; ALength : Longint);
  905. begin
  906. Case AName of
  907. 'supportedcompressions' : SetLength(FsupportedCompressions,ALength);
  908. else
  909. Inherited SetArrayLength(AName,ALength);
  910. end;
  911. end;
  912. {$ENDIF VER2_6}
  913. { --------------------------------------------------------------------
  914. TFetchThreatListUpdatesResponse
  915. --------------------------------------------------------------------}
  916. Procedure TFetchThreatListUpdatesResponse.SetlistUpdateResponses(AIndex : Integer; const AValue : TFetchThreatListUpdatesResponseTypelistUpdateResponsesArray);
  917. begin
  918. If (FlistUpdateResponses=AValue) then exit;
  919. FlistUpdateResponses:=AValue;
  920. MarkPropertyChanged(AIndex);
  921. end;
  922. Procedure TFetchThreatListUpdatesResponse.SetminimumWaitDuration(AIndex : Integer; const AValue : String);
  923. begin
  924. If (FminimumWaitDuration=AValue) then exit;
  925. FminimumWaitDuration:=AValue;
  926. MarkPropertyChanged(AIndex);
  927. end;
  928. //2.6.4. bug workaround
  929. {$IFDEF VER2_6}
  930. Procedure TFetchThreatListUpdatesResponse.SetArrayLength(Const AName : String; ALength : Longint);
  931. begin
  932. Case AName of
  933. 'listupdateresponses' : SetLength(FlistUpdateResponses,ALength);
  934. else
  935. Inherited SetArrayLength(AName,ALength);
  936. end;
  937. end;
  938. {$ENDIF VER2_6}
  939. { --------------------------------------------------------------------
  940. TListUpdateResponse
  941. --------------------------------------------------------------------}
  942. Procedure TListUpdateResponse.SetthreatType(AIndex : Integer; const AValue : String);
  943. begin
  944. If (FthreatType=AValue) then exit;
  945. FthreatType:=AValue;
  946. MarkPropertyChanged(AIndex);
  947. end;
  948. Procedure TListUpdateResponse.SetthreatEntryType(AIndex : Integer; const AValue : String);
  949. begin
  950. If (FthreatEntryType=AValue) then exit;
  951. FthreatEntryType:=AValue;
  952. MarkPropertyChanged(AIndex);
  953. end;
  954. Procedure TListUpdateResponse.SetplatformType(AIndex : Integer; const AValue : String);
  955. begin
  956. If (FplatformType=AValue) then exit;
  957. FplatformType:=AValue;
  958. MarkPropertyChanged(AIndex);
  959. end;
  960. Procedure TListUpdateResponse.SetresponseType(AIndex : Integer; const AValue : String);
  961. begin
  962. If (FresponseType=AValue) then exit;
  963. FresponseType:=AValue;
  964. MarkPropertyChanged(AIndex);
  965. end;
  966. Procedure TListUpdateResponse.Setadditions(AIndex : Integer; const AValue : TListUpdateResponseTypeadditionsArray);
  967. begin
  968. If (Fadditions=AValue) then exit;
  969. Fadditions:=AValue;
  970. MarkPropertyChanged(AIndex);
  971. end;
  972. Procedure TListUpdateResponse.Setremovals(AIndex : Integer; const AValue : TListUpdateResponseTyperemovalsArray);
  973. begin
  974. If (Fremovals=AValue) then exit;
  975. Fremovals:=AValue;
  976. MarkPropertyChanged(AIndex);
  977. end;
  978. Procedure TListUpdateResponse.SetnewClientState(AIndex : Integer; const AValue : String);
  979. begin
  980. If (FnewClientState=AValue) then exit;
  981. FnewClientState:=AValue;
  982. MarkPropertyChanged(AIndex);
  983. end;
  984. Procedure TListUpdateResponse.Setchecksum(AIndex : Integer; const AValue : TChecksum);
  985. begin
  986. If (Fchecksum=AValue) then exit;
  987. Fchecksum:=AValue;
  988. MarkPropertyChanged(AIndex);
  989. end;
  990. //2.6.4. bug workaround
  991. {$IFDEF VER2_6}
  992. Procedure TListUpdateResponse.SetArrayLength(Const AName : String; ALength : Longint);
  993. begin
  994. Case AName of
  995. 'additions' : SetLength(Fadditions,ALength);
  996. 'removals' : SetLength(Fremovals,ALength);
  997. else
  998. Inherited SetArrayLength(AName,ALength);
  999. end;
  1000. end;
  1001. {$ENDIF VER2_6}
  1002. { --------------------------------------------------------------------
  1003. TThreatEntrySet
  1004. --------------------------------------------------------------------}
  1005. Procedure TThreatEntrySet.SetcompressionType(AIndex : Integer; const AValue : String);
  1006. begin
  1007. If (FcompressionType=AValue) then exit;
  1008. FcompressionType:=AValue;
  1009. MarkPropertyChanged(AIndex);
  1010. end;
  1011. Procedure TThreatEntrySet.SetrawHashes(AIndex : Integer; const AValue : TRawHashes);
  1012. begin
  1013. If (FrawHashes=AValue) then exit;
  1014. FrawHashes:=AValue;
  1015. MarkPropertyChanged(AIndex);
  1016. end;
  1017. Procedure TThreatEntrySet.SetrawIndices(AIndex : Integer; const AValue : TRawIndices);
  1018. begin
  1019. If (FrawIndices=AValue) then exit;
  1020. FrawIndices:=AValue;
  1021. MarkPropertyChanged(AIndex);
  1022. end;
  1023. Procedure TThreatEntrySet.SetriceHashes(AIndex : Integer; const AValue : TRiceDeltaEncoding);
  1024. begin
  1025. If (FriceHashes=AValue) then exit;
  1026. FriceHashes:=AValue;
  1027. MarkPropertyChanged(AIndex);
  1028. end;
  1029. Procedure TThreatEntrySet.SetriceIndices(AIndex : Integer; const AValue : TRiceDeltaEncoding);
  1030. begin
  1031. If (FriceIndices=AValue) then exit;
  1032. FriceIndices:=AValue;
  1033. MarkPropertyChanged(AIndex);
  1034. end;
  1035. { --------------------------------------------------------------------
  1036. TRawHashes
  1037. --------------------------------------------------------------------}
  1038. Procedure TRawHashes.SetprefixSize(AIndex : Integer; const AValue : integer);
  1039. begin
  1040. If (FprefixSize=AValue) then exit;
  1041. FprefixSize:=AValue;
  1042. MarkPropertyChanged(AIndex);
  1043. end;
  1044. Procedure TRawHashes.SetrawHashes(AIndex : Integer; const AValue : String);
  1045. begin
  1046. If (FrawHashes=AValue) then exit;
  1047. FrawHashes:=AValue;
  1048. MarkPropertyChanged(AIndex);
  1049. end;
  1050. { --------------------------------------------------------------------
  1051. TRawIndices
  1052. --------------------------------------------------------------------}
  1053. Procedure TRawIndices.Setindices(AIndex : Integer; const AValue : TintegerArray);
  1054. begin
  1055. If (Findices=AValue) then exit;
  1056. Findices:=AValue;
  1057. MarkPropertyChanged(AIndex);
  1058. end;
  1059. //2.6.4. bug workaround
  1060. {$IFDEF VER2_6}
  1061. Procedure TRawIndices.SetArrayLength(Const AName : String; ALength : Longint);
  1062. begin
  1063. Case AName of
  1064. 'indices' : SetLength(Findices,ALength);
  1065. else
  1066. Inherited SetArrayLength(AName,ALength);
  1067. end;
  1068. end;
  1069. {$ENDIF VER2_6}
  1070. { --------------------------------------------------------------------
  1071. TRiceDeltaEncoding
  1072. --------------------------------------------------------------------}
  1073. Procedure TRiceDeltaEncoding.SetfirstValue(AIndex : Integer; const AValue : String);
  1074. begin
  1075. If (FfirstValue=AValue) then exit;
  1076. FfirstValue:=AValue;
  1077. MarkPropertyChanged(AIndex);
  1078. end;
  1079. Procedure TRiceDeltaEncoding.SetriceParameter(AIndex : Integer; const AValue : integer);
  1080. begin
  1081. If (FriceParameter=AValue) then exit;
  1082. FriceParameter:=AValue;
  1083. MarkPropertyChanged(AIndex);
  1084. end;
  1085. Procedure TRiceDeltaEncoding.SetnumEntries(AIndex : Integer; const AValue : integer);
  1086. begin
  1087. If (FnumEntries=AValue) then exit;
  1088. FnumEntries:=AValue;
  1089. MarkPropertyChanged(AIndex);
  1090. end;
  1091. Procedure TRiceDeltaEncoding.SetencodedData(AIndex : Integer; const AValue : String);
  1092. begin
  1093. If (FencodedData=AValue) then exit;
  1094. FencodedData:=AValue;
  1095. MarkPropertyChanged(AIndex);
  1096. end;
  1097. { --------------------------------------------------------------------
  1098. TChecksum
  1099. --------------------------------------------------------------------}
  1100. Procedure TChecksum.Setsha256(AIndex : Integer; const AValue : String);
  1101. begin
  1102. If (Fsha256=AValue) then exit;
  1103. Fsha256:=AValue;
  1104. MarkPropertyChanged(AIndex);
  1105. end;
  1106. { --------------------------------------------------------------------
  1107. TFindFullHashesRequest
  1108. --------------------------------------------------------------------}
  1109. Procedure TFindFullHashesRequest.Setclient(AIndex : Integer; const AValue : TClientInfo);
  1110. begin
  1111. If (Fclient=AValue) then exit;
  1112. Fclient:=AValue;
  1113. MarkPropertyChanged(AIndex);
  1114. end;
  1115. Procedure TFindFullHashesRequest.SetclientStates(AIndex : Integer; const AValue : TStringArray);
  1116. begin
  1117. If (FclientStates=AValue) then exit;
  1118. FclientStates:=AValue;
  1119. MarkPropertyChanged(AIndex);
  1120. end;
  1121. Procedure TFindFullHashesRequest.SetthreatInfo(AIndex : Integer; const AValue : TThreatInfo);
  1122. begin
  1123. If (FthreatInfo=AValue) then exit;
  1124. FthreatInfo:=AValue;
  1125. MarkPropertyChanged(AIndex);
  1126. end;
  1127. //2.6.4. bug workaround
  1128. {$IFDEF VER2_6}
  1129. Procedure TFindFullHashesRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1130. begin
  1131. Case AName of
  1132. 'clientstates' : SetLength(FclientStates,ALength);
  1133. else
  1134. Inherited SetArrayLength(AName,ALength);
  1135. end;
  1136. end;
  1137. {$ENDIF VER2_6}
  1138. { --------------------------------------------------------------------
  1139. TFindFullHashesResponse
  1140. --------------------------------------------------------------------}
  1141. Procedure TFindFullHashesResponse.Setmatches(AIndex : Integer; const AValue : TFindFullHashesResponseTypematchesArray);
  1142. begin
  1143. If (Fmatches=AValue) then exit;
  1144. Fmatches:=AValue;
  1145. MarkPropertyChanged(AIndex);
  1146. end;
  1147. Procedure TFindFullHashesResponse.SetminimumWaitDuration(AIndex : Integer; const AValue : String);
  1148. begin
  1149. If (FminimumWaitDuration=AValue) then exit;
  1150. FminimumWaitDuration:=AValue;
  1151. MarkPropertyChanged(AIndex);
  1152. end;
  1153. Procedure TFindFullHashesResponse.SetnegativeCacheDuration(AIndex : Integer; const AValue : String);
  1154. begin
  1155. If (FnegativeCacheDuration=AValue) then exit;
  1156. FnegativeCacheDuration:=AValue;
  1157. MarkPropertyChanged(AIndex);
  1158. end;
  1159. //2.6.4. bug workaround
  1160. {$IFDEF VER2_6}
  1161. Procedure TFindFullHashesResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1162. begin
  1163. Case AName of
  1164. 'matches' : SetLength(Fmatches,ALength);
  1165. else
  1166. Inherited SetArrayLength(AName,ALength);
  1167. end;
  1168. end;
  1169. {$ENDIF VER2_6}
  1170. { --------------------------------------------------------------------
  1171. TListThreatListsResponse
  1172. --------------------------------------------------------------------}
  1173. Procedure TListThreatListsResponse.SetthreatLists(AIndex : Integer; const AValue : TListThreatListsResponseTypethreatListsArray);
  1174. begin
  1175. If (FthreatLists=AValue) then exit;
  1176. FthreatLists:=AValue;
  1177. MarkPropertyChanged(AIndex);
  1178. end;
  1179. //2.6.4. bug workaround
  1180. {$IFDEF VER2_6}
  1181. Procedure TListThreatListsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1182. begin
  1183. Case AName of
  1184. 'threatlists' : SetLength(FthreatLists,ALength);
  1185. else
  1186. Inherited SetArrayLength(AName,ALength);
  1187. end;
  1188. end;
  1189. {$ENDIF VER2_6}
  1190. { --------------------------------------------------------------------
  1191. TThreatListDescriptor
  1192. --------------------------------------------------------------------}
  1193. Procedure TThreatListDescriptor.SetthreatType(AIndex : Integer; const AValue : String);
  1194. begin
  1195. If (FthreatType=AValue) then exit;
  1196. FthreatType:=AValue;
  1197. MarkPropertyChanged(AIndex);
  1198. end;
  1199. Procedure TThreatListDescriptor.SetplatformType(AIndex : Integer; const AValue : String);
  1200. begin
  1201. If (FplatformType=AValue) then exit;
  1202. FplatformType:=AValue;
  1203. MarkPropertyChanged(AIndex);
  1204. end;
  1205. Procedure TThreatListDescriptor.SetthreatEntryType(AIndex : Integer; const AValue : String);
  1206. begin
  1207. If (FthreatEntryType=AValue) then exit;
  1208. FthreatEntryType:=AValue;
  1209. MarkPropertyChanged(AIndex);
  1210. end;
  1211. { --------------------------------------------------------------------
  1212. TThreatMatchesResource
  1213. --------------------------------------------------------------------}
  1214. Class Function TThreatMatchesResource.ResourceName : String;
  1215. begin
  1216. Result:='threatMatches';
  1217. end;
  1218. Class Function TThreatMatchesResource.DefaultAPI : TGoogleAPIClass;
  1219. begin
  1220. Result:=TsafebrowsingAPI;
  1221. end;
  1222. Function TThreatMatchesResource.Find(aFindThreatMatchesRequest : TFindThreatMatchesRequest) : TFindThreatMatchesResponse;
  1223. Const
  1224. _HTTPMethod = 'POST';
  1225. _Path = 'v4/threatMatches:find';
  1226. _Methodid = 'safebrowsing.threatMatches.find';
  1227. begin
  1228. Result:=ServiceCall(_HTTPMethod,_Path,'',aFindThreatMatchesRequest,TFindThreatMatchesResponse) as TFindThreatMatchesResponse;
  1229. end;
  1230. { --------------------------------------------------------------------
  1231. TThreatListUpdatesResource
  1232. --------------------------------------------------------------------}
  1233. Class Function TThreatListUpdatesResource.ResourceName : String;
  1234. begin
  1235. Result:='threatListUpdates';
  1236. end;
  1237. Class Function TThreatListUpdatesResource.DefaultAPI : TGoogleAPIClass;
  1238. begin
  1239. Result:=TsafebrowsingAPI;
  1240. end;
  1241. Function TThreatListUpdatesResource.Fetch(aFetchThreatListUpdatesRequest : TFetchThreatListUpdatesRequest) : TFetchThreatListUpdatesResponse;
  1242. Const
  1243. _HTTPMethod = 'POST';
  1244. _Path = 'v4/threatListUpdates:fetch';
  1245. _Methodid = 'safebrowsing.threatListUpdates.fetch';
  1246. begin
  1247. Result:=ServiceCall(_HTTPMethod,_Path,'',aFetchThreatListUpdatesRequest,TFetchThreatListUpdatesResponse) as TFetchThreatListUpdatesResponse;
  1248. end;
  1249. { --------------------------------------------------------------------
  1250. TFullHashesResource
  1251. --------------------------------------------------------------------}
  1252. Class Function TFullHashesResource.ResourceName : String;
  1253. begin
  1254. Result:='fullHashes';
  1255. end;
  1256. Class Function TFullHashesResource.DefaultAPI : TGoogleAPIClass;
  1257. begin
  1258. Result:=TsafebrowsingAPI;
  1259. end;
  1260. Function TFullHashesResource.Find(aFindFullHashesRequest : TFindFullHashesRequest) : TFindFullHashesResponse;
  1261. Const
  1262. _HTTPMethod = 'POST';
  1263. _Path = 'v4/fullHashes:find';
  1264. _Methodid = 'safebrowsing.fullHashes.find';
  1265. begin
  1266. Result:=ServiceCall(_HTTPMethod,_Path,'',aFindFullHashesRequest,TFindFullHashesResponse) as TFindFullHashesResponse;
  1267. end;
  1268. { --------------------------------------------------------------------
  1269. TThreatListsResource
  1270. --------------------------------------------------------------------}
  1271. Class Function TThreatListsResource.ResourceName : String;
  1272. begin
  1273. Result:='threatLists';
  1274. end;
  1275. Class Function TThreatListsResource.DefaultAPI : TGoogleAPIClass;
  1276. begin
  1277. Result:=TsafebrowsingAPI;
  1278. end;
  1279. Function TThreatListsResource.List : TListThreatListsResponse;
  1280. Const
  1281. _HTTPMethod = 'GET';
  1282. _Path = 'v4/threatLists';
  1283. _Methodid = 'safebrowsing.threatLists.list';
  1284. begin
  1285. Result:=ServiceCall(_HTTPMethod,_Path,'',Nil,TListThreatListsResponse) as TListThreatListsResponse;
  1286. end;
  1287. { --------------------------------------------------------------------
  1288. TSafebrowsingAPI
  1289. --------------------------------------------------------------------}
  1290. Class Function TSafebrowsingAPI.APIName : String;
  1291. begin
  1292. Result:='safebrowsing';
  1293. end;
  1294. Class Function TSafebrowsingAPI.APIVersion : String;
  1295. begin
  1296. Result:='v4';
  1297. end;
  1298. Class Function TSafebrowsingAPI.APIRevision : String;
  1299. begin
  1300. Result:='20160520';
  1301. end;
  1302. Class Function TSafebrowsingAPI.APIID : String;
  1303. begin
  1304. Result:='safebrowsing:v4';
  1305. end;
  1306. Class Function TSafebrowsingAPI.APITitle : String;
  1307. begin
  1308. Result:='Safe Browsing APIs';
  1309. end;
  1310. Class Function TSafebrowsingAPI.APIDescription : String;
  1311. begin
  1312. Result:='Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources.';
  1313. end;
  1314. Class Function TSafebrowsingAPI.APIOwnerDomain : String;
  1315. begin
  1316. Result:='google.com';
  1317. end;
  1318. Class Function TSafebrowsingAPI.APIOwnerName : String;
  1319. begin
  1320. Result:='Google';
  1321. end;
  1322. Class Function TSafebrowsingAPI.APIIcon16 : String;
  1323. begin
  1324. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1325. end;
  1326. Class Function TSafebrowsingAPI.APIIcon32 : String;
  1327. begin
  1328. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1329. end;
  1330. Class Function TSafebrowsingAPI.APIdocumentationLink : String;
  1331. begin
  1332. Result:='https://developers.google.com/safe-browsing/';
  1333. end;
  1334. Class Function TSafebrowsingAPI.APIrootUrl : string;
  1335. begin
  1336. Result:='https://safebrowsing.googleapis.com/';
  1337. end;
  1338. Class Function TSafebrowsingAPI.APIbasePath : string;
  1339. begin
  1340. Result:='';
  1341. end;
  1342. Class Function TSafebrowsingAPI.APIbaseURL : String;
  1343. begin
  1344. Result:='https://safebrowsing.googleapis.com/';
  1345. end;
  1346. Class Function TSafebrowsingAPI.APIProtocol : string;
  1347. begin
  1348. Result:='rest';
  1349. end;
  1350. Class Function TSafebrowsingAPI.APIservicePath : string;
  1351. begin
  1352. Result:='';
  1353. end;
  1354. Class Function TSafebrowsingAPI.APIbatchPath : String;
  1355. begin
  1356. Result:='batch';
  1357. end;
  1358. Class Function TSafebrowsingAPI.APIAuthScopes : TScopeInfoArray;
  1359. begin
  1360. SetLength(Result,0);
  1361. end;
  1362. Class Function TSafebrowsingAPI.APINeedsAuth : Boolean;
  1363. begin
  1364. Result:=False;
  1365. end;
  1366. Class Procedure TSafebrowsingAPI.RegisterAPIResources;
  1367. begin
  1368. TFindThreatMatchesRequest.RegisterObject;
  1369. TClientInfo.RegisterObject;
  1370. TThreatInfo.RegisterObject;
  1371. TThreatEntry.RegisterObject;
  1372. TFindThreatMatchesResponse.RegisterObject;
  1373. TThreatMatch.RegisterObject;
  1374. TThreatEntryMetadata.RegisterObject;
  1375. TMetadataEntry.RegisterObject;
  1376. TFetchThreatListUpdatesRequest.RegisterObject;
  1377. TListUpdateRequest.RegisterObject;
  1378. TConstraints.RegisterObject;
  1379. TFetchThreatListUpdatesResponse.RegisterObject;
  1380. TListUpdateResponse.RegisterObject;
  1381. TThreatEntrySet.RegisterObject;
  1382. TRawHashes.RegisterObject;
  1383. TRawIndices.RegisterObject;
  1384. TRiceDeltaEncoding.RegisterObject;
  1385. TChecksum.RegisterObject;
  1386. TFindFullHashesRequest.RegisterObject;
  1387. TFindFullHashesResponse.RegisterObject;
  1388. TListThreatListsResponse.RegisterObject;
  1389. TThreatListDescriptor.RegisterObject;
  1390. end;
  1391. Function TSafebrowsingAPI.GetThreatMatchesInstance : TThreatMatchesResource;
  1392. begin
  1393. if (FThreatMatchesInstance=Nil) then
  1394. FThreatMatchesInstance:=CreateThreatMatchesResource;
  1395. Result:=FThreatMatchesInstance;
  1396. end;
  1397. Function TSafebrowsingAPI.CreateThreatMatchesResource : TThreatMatchesResource;
  1398. begin
  1399. Result:=CreateThreatMatchesResource(Self);
  1400. end;
  1401. Function TSafebrowsingAPI.CreateThreatMatchesResource(AOwner : TComponent) : TThreatMatchesResource;
  1402. begin
  1403. Result:=TThreatMatchesResource.Create(AOwner);
  1404. Result.API:=Self.API;
  1405. end;
  1406. Function TSafebrowsingAPI.GetThreatListUpdatesInstance : TThreatListUpdatesResource;
  1407. begin
  1408. if (FThreatListUpdatesInstance=Nil) then
  1409. FThreatListUpdatesInstance:=CreateThreatListUpdatesResource;
  1410. Result:=FThreatListUpdatesInstance;
  1411. end;
  1412. Function TSafebrowsingAPI.CreateThreatListUpdatesResource : TThreatListUpdatesResource;
  1413. begin
  1414. Result:=CreateThreatListUpdatesResource(Self);
  1415. end;
  1416. Function TSafebrowsingAPI.CreateThreatListUpdatesResource(AOwner : TComponent) : TThreatListUpdatesResource;
  1417. begin
  1418. Result:=TThreatListUpdatesResource.Create(AOwner);
  1419. Result.API:=Self.API;
  1420. end;
  1421. Function TSafebrowsingAPI.GetFullHashesInstance : TFullHashesResource;
  1422. begin
  1423. if (FFullHashesInstance=Nil) then
  1424. FFullHashesInstance:=CreateFullHashesResource;
  1425. Result:=FFullHashesInstance;
  1426. end;
  1427. Function TSafebrowsingAPI.CreateFullHashesResource : TFullHashesResource;
  1428. begin
  1429. Result:=CreateFullHashesResource(Self);
  1430. end;
  1431. Function TSafebrowsingAPI.CreateFullHashesResource(AOwner : TComponent) : TFullHashesResource;
  1432. begin
  1433. Result:=TFullHashesResource.Create(AOwner);
  1434. Result.API:=Self.API;
  1435. end;
  1436. Function TSafebrowsingAPI.GetThreatListsInstance : TThreatListsResource;
  1437. begin
  1438. if (FThreatListsInstance=Nil) then
  1439. FThreatListsInstance:=CreateThreatListsResource;
  1440. Result:=FThreatListsInstance;
  1441. end;
  1442. Function TSafebrowsingAPI.CreateThreatListsResource : TThreatListsResource;
  1443. begin
  1444. Result:=CreateThreatListsResource(Self);
  1445. end;
  1446. Function TSafebrowsingAPI.CreateThreatListsResource(AOwner : TComponent) : TThreatListsResource;
  1447. begin
  1448. Result:=TThreatListsResource.Create(AOwner);
  1449. Result.API:=Self.API;
  1450. end;
  1451. initialization
  1452. TSafebrowsingAPI.RegisterAPI;
  1453. end.