googlepagespeedonline.pp 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301
  1. unit googlepagespeedonline;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TPagespeedApiFormatStringV2 = Class;
  9. TPagespeedApiImageV2 = Class;
  10. TResult = Class;
  11. TPagespeedApiFormatStringV2Array = Array of TPagespeedApiFormatStringV2;
  12. TPagespeedApiImageV2Array = Array of TPagespeedApiImageV2;
  13. TResultArray = Array of TResult;
  14. //Anonymous types, using auto-generated names
  15. TPagespeedApiFormatStringV2TypeargsItemTyperectsItem = Class;
  16. TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem = Class;
  17. TPagespeedApiFormatStringV2TypeargsItem = Class;
  18. TPagespeedApiImageV2Typepage_rect = Class;
  19. TResultTypeformattedResultsTyperuleResults = Class;
  20. TResultTypeformattedResults = Class;
  21. TResultTypepageStats = Class;
  22. TResultTyperuleGroups = Class;
  23. TResultTypeversion = Class;
  24. TPagespeedApiFormatStringV2TypeargsItemTyperectsArray = Array of TPagespeedApiFormatStringV2TypeargsItemTyperectsItem;
  25. TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsArray = Array of TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem;
  26. TPagespeedApiFormatStringV2TypeargsArray = Array of TPagespeedApiFormatStringV2TypeargsItem;
  27. { --------------------------------------------------------------------
  28. TPagespeedApiFormatStringV2TypeargsItemTyperectsItem
  29. --------------------------------------------------------------------}
  30. TPagespeedApiFormatStringV2TypeargsItemTyperectsItem = Class(TGoogleBaseObject)
  31. Private
  32. Fheight : integer;
  33. Fleft : integer;
  34. Ftop : integer;
  35. Fwidth : integer;
  36. Protected
  37. //Property setters
  38. Procedure Setheight(AIndex : Integer; const AValue : integer); virtual;
  39. Procedure Setleft(AIndex : Integer; const AValue : integer); virtual;
  40. Procedure Settop(AIndex : Integer; const AValue : integer); virtual;
  41. Procedure Setwidth(AIndex : Integer; const AValue : integer); virtual;
  42. Public
  43. Published
  44. Property height : integer Index 0 Read Fheight Write Setheight;
  45. Property left : integer Index 8 Read Fleft Write Setleft;
  46. Property top : integer Index 16 Read Ftop Write Settop;
  47. Property width : integer Index 24 Read Fwidth Write Setwidth;
  48. end;
  49. TPagespeedApiFormatStringV2TypeargsItemTyperectsItemClass = Class of TPagespeedApiFormatStringV2TypeargsItemTyperectsItem;
  50. { --------------------------------------------------------------------
  51. TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem
  52. --------------------------------------------------------------------}
  53. TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem = Class(TGoogleBaseObject)
  54. Private
  55. Fheight : integer;
  56. Fleft : integer;
  57. Ftop : integer;
  58. Fwidth : integer;
  59. Protected
  60. //Property setters
  61. Procedure Setheight(AIndex : Integer; const AValue : integer); virtual;
  62. Procedure Setleft(AIndex : Integer; const AValue : integer); virtual;
  63. Procedure Settop(AIndex : Integer; const AValue : integer); virtual;
  64. Procedure Setwidth(AIndex : Integer; const AValue : integer); virtual;
  65. Public
  66. Published
  67. Property height : integer Index 0 Read Fheight Write Setheight;
  68. Property left : integer Index 8 Read Fleft Write Setleft;
  69. Property top : integer Index 16 Read Ftop Write Settop;
  70. Property width : integer Index 24 Read Fwidth Write Setwidth;
  71. end;
  72. TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItemClass = Class of TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem;
  73. { --------------------------------------------------------------------
  74. TPagespeedApiFormatStringV2TypeargsItem
  75. --------------------------------------------------------------------}
  76. TPagespeedApiFormatStringV2TypeargsItem = Class(TGoogleBaseObject)
  77. Private
  78. Fkey : String;
  79. Frects : TPagespeedApiFormatStringV2TypeargsItemTyperectsArray;
  80. Fsecondary_rects : TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsArray;
  81. F_type : String;
  82. Fvalue : String;
  83. Protected
  84. Class Function ExportPropertyName(Const AName : String) : string; override;
  85. //Property setters
  86. Procedure Setkey(AIndex : Integer; const AValue : String); virtual;
  87. Procedure Setrects(AIndex : Integer; const AValue : TPagespeedApiFormatStringV2TypeargsItemTyperectsArray); virtual;
  88. Procedure Setsecondary_rects(AIndex : Integer; const AValue : TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsArray); virtual;
  89. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  90. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  91. //2.6.4. bug workaround
  92. {$IFDEF VER2_6}
  93. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  94. {$ENDIF VER2_6}
  95. Public
  96. Published
  97. Property key : String Index 0 Read Fkey Write Setkey;
  98. Property rects : TPagespeedApiFormatStringV2TypeargsItemTyperectsArray Index 8 Read Frects Write Setrects;
  99. Property secondary_rects : TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsArray Index 16 Read Fsecondary_rects Write Setsecondary_rects;
  100. Property _type : String Index 24 Read F_type Write Set_type;
  101. Property value : String Index 32 Read Fvalue Write Setvalue;
  102. end;
  103. TPagespeedApiFormatStringV2TypeargsItemClass = Class of TPagespeedApiFormatStringV2TypeargsItem;
  104. { --------------------------------------------------------------------
  105. TPagespeedApiFormatStringV2
  106. --------------------------------------------------------------------}
  107. TPagespeedApiFormatStringV2 = Class(TGoogleBaseObject)
  108. Private
  109. Fargs : TPagespeedApiFormatStringV2TypeargsArray;
  110. Fformat : String;
  111. Protected
  112. //Property setters
  113. Procedure Setargs(AIndex : Integer; const AValue : TPagespeedApiFormatStringV2TypeargsArray); virtual;
  114. Procedure Setformat(AIndex : Integer; const AValue : String); virtual;
  115. //2.6.4. bug workaround
  116. {$IFDEF VER2_6}
  117. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  118. {$ENDIF VER2_6}
  119. Public
  120. Published
  121. Property args : TPagespeedApiFormatStringV2TypeargsArray Index 0 Read Fargs Write Setargs;
  122. Property format : String Index 8 Read Fformat Write Setformat;
  123. end;
  124. TPagespeedApiFormatStringV2Class = Class of TPagespeedApiFormatStringV2;
  125. { --------------------------------------------------------------------
  126. TPagespeedApiImageV2Typepage_rect
  127. --------------------------------------------------------------------}
  128. TPagespeedApiImageV2Typepage_rect = Class(TGoogleBaseObject)
  129. Private
  130. Fheight : integer;
  131. Fleft : integer;
  132. Ftop : integer;
  133. Fwidth : integer;
  134. Protected
  135. //Property setters
  136. Procedure Setheight(AIndex : Integer; const AValue : integer); virtual;
  137. Procedure Setleft(AIndex : Integer; const AValue : integer); virtual;
  138. Procedure Settop(AIndex : Integer; const AValue : integer); virtual;
  139. Procedure Setwidth(AIndex : Integer; const AValue : integer); virtual;
  140. Public
  141. Published
  142. Property height : integer Index 0 Read Fheight Write Setheight;
  143. Property left : integer Index 8 Read Fleft Write Setleft;
  144. Property top : integer Index 16 Read Ftop Write Settop;
  145. Property width : integer Index 24 Read Fwidth Write Setwidth;
  146. end;
  147. TPagespeedApiImageV2Typepage_rectClass = Class of TPagespeedApiImageV2Typepage_rect;
  148. { --------------------------------------------------------------------
  149. TPagespeedApiImageV2
  150. --------------------------------------------------------------------}
  151. TPagespeedApiImageV2 = Class(TGoogleBaseObject)
  152. Private
  153. Fdata : String;
  154. Fheight : integer;
  155. Fkey : String;
  156. Fmime_type : String;
  157. Fpage_rect : TPagespeedApiImageV2Typepage_rect;
  158. Fwidth : integer;
  159. Protected
  160. //Property setters
  161. Procedure Setdata(AIndex : Integer; const AValue : String); virtual;
  162. Procedure Setheight(AIndex : Integer; const AValue : integer); virtual;
  163. Procedure Setkey(AIndex : Integer; const AValue : String); virtual;
  164. Procedure Setmime_type(AIndex : Integer; const AValue : String); virtual;
  165. Procedure Setpage_rect(AIndex : Integer; const AValue : TPagespeedApiImageV2Typepage_rect); virtual;
  166. Procedure Setwidth(AIndex : Integer; const AValue : integer); virtual;
  167. Public
  168. Published
  169. Property data : String Index 0 Read Fdata Write Setdata;
  170. Property height : integer Index 8 Read Fheight Write Setheight;
  171. Property key : String Index 16 Read Fkey Write Setkey;
  172. Property mime_type : String Index 24 Read Fmime_type Write Setmime_type;
  173. Property page_rect : TPagespeedApiImageV2Typepage_rect Index 32 Read Fpage_rect Write Setpage_rect;
  174. Property width : integer Index 40 Read Fwidth Write Setwidth;
  175. end;
  176. TPagespeedApiImageV2Class = Class of TPagespeedApiImageV2;
  177. { --------------------------------------------------------------------
  178. TResultTypeformattedResultsTyperuleResults
  179. --------------------------------------------------------------------}
  180. TResultTypeformattedResultsTyperuleResults = Class(TGoogleBaseObject)
  181. Private
  182. Protected
  183. //Property setters
  184. Public
  185. Class Function AllowAdditionalProperties : Boolean; override;
  186. Published
  187. end;
  188. TResultTypeformattedResultsTyperuleResultsClass = Class of TResultTypeformattedResultsTyperuleResults;
  189. { --------------------------------------------------------------------
  190. TResultTypeformattedResults
  191. --------------------------------------------------------------------}
  192. TResultTypeformattedResults = Class(TGoogleBaseObject)
  193. Private
  194. Flocale : String;
  195. FruleResults : TResultTypeformattedResultsTyperuleResults;
  196. Protected
  197. //Property setters
  198. Procedure Setlocale(AIndex : Integer; const AValue : String); virtual;
  199. Procedure SetruleResults(AIndex : Integer; const AValue : TResultTypeformattedResultsTyperuleResults); virtual;
  200. Public
  201. Published
  202. Property locale : String Index 0 Read Flocale Write Setlocale;
  203. Property ruleResults : TResultTypeformattedResultsTyperuleResults Index 8 Read FruleResults Write SetruleResults;
  204. end;
  205. TResultTypeformattedResultsClass = Class of TResultTypeformattedResults;
  206. { --------------------------------------------------------------------
  207. TResultTypepageStats
  208. --------------------------------------------------------------------}
  209. TResultTypepageStats = Class(TGoogleBaseObject)
  210. Private
  211. FcssResponseBytes : String;
  212. FflashResponseBytes : String;
  213. FhtmlResponseBytes : String;
  214. FimageResponseBytes : String;
  215. FjavascriptResponseBytes : String;
  216. FnumberCssResources : integer;
  217. FnumberHosts : integer;
  218. FnumberJsResources : integer;
  219. FnumberResources : integer;
  220. FnumberStaticResources : integer;
  221. FotherResponseBytes : String;
  222. FtextResponseBytes : String;
  223. FtotalRequestBytes : String;
  224. Protected
  225. //Property setters
  226. Procedure SetcssResponseBytes(AIndex : Integer; const AValue : String); virtual;
  227. Procedure SetflashResponseBytes(AIndex : Integer; const AValue : String); virtual;
  228. Procedure SethtmlResponseBytes(AIndex : Integer; const AValue : String); virtual;
  229. Procedure SetimageResponseBytes(AIndex : Integer; const AValue : String); virtual;
  230. Procedure SetjavascriptResponseBytes(AIndex : Integer; const AValue : String); virtual;
  231. Procedure SetnumberCssResources(AIndex : Integer; const AValue : integer); virtual;
  232. Procedure SetnumberHosts(AIndex : Integer; const AValue : integer); virtual;
  233. Procedure SetnumberJsResources(AIndex : Integer; const AValue : integer); virtual;
  234. Procedure SetnumberResources(AIndex : Integer; const AValue : integer); virtual;
  235. Procedure SetnumberStaticResources(AIndex : Integer; const AValue : integer); virtual;
  236. Procedure SetotherResponseBytes(AIndex : Integer; const AValue : String); virtual;
  237. Procedure SettextResponseBytes(AIndex : Integer; const AValue : String); virtual;
  238. Procedure SettotalRequestBytes(AIndex : Integer; const AValue : String); virtual;
  239. Public
  240. Published
  241. Property cssResponseBytes : String Index 0 Read FcssResponseBytes Write SetcssResponseBytes;
  242. Property flashResponseBytes : String Index 8 Read FflashResponseBytes Write SetflashResponseBytes;
  243. Property htmlResponseBytes : String Index 16 Read FhtmlResponseBytes Write SethtmlResponseBytes;
  244. Property imageResponseBytes : String Index 24 Read FimageResponseBytes Write SetimageResponseBytes;
  245. Property javascriptResponseBytes : String Index 32 Read FjavascriptResponseBytes Write SetjavascriptResponseBytes;
  246. Property numberCssResources : integer Index 40 Read FnumberCssResources Write SetnumberCssResources;
  247. Property numberHosts : integer Index 48 Read FnumberHosts Write SetnumberHosts;
  248. Property numberJsResources : integer Index 56 Read FnumberJsResources Write SetnumberJsResources;
  249. Property numberResources : integer Index 64 Read FnumberResources Write SetnumberResources;
  250. Property numberStaticResources : integer Index 72 Read FnumberStaticResources Write SetnumberStaticResources;
  251. Property otherResponseBytes : String Index 80 Read FotherResponseBytes Write SetotherResponseBytes;
  252. Property textResponseBytes : String Index 88 Read FtextResponseBytes Write SettextResponseBytes;
  253. Property totalRequestBytes : String Index 96 Read FtotalRequestBytes Write SettotalRequestBytes;
  254. end;
  255. TResultTypepageStatsClass = Class of TResultTypepageStats;
  256. { --------------------------------------------------------------------
  257. TResultTyperuleGroups
  258. --------------------------------------------------------------------}
  259. TResultTyperuleGroups = Class(TGoogleBaseObject)
  260. Private
  261. Protected
  262. //Property setters
  263. Public
  264. Class Function AllowAdditionalProperties : Boolean; override;
  265. Published
  266. end;
  267. TResultTyperuleGroupsClass = Class of TResultTyperuleGroups;
  268. { --------------------------------------------------------------------
  269. TResultTypeversion
  270. --------------------------------------------------------------------}
  271. TResultTypeversion = Class(TGoogleBaseObject)
  272. Private
  273. Fmajor : integer;
  274. Fminor : integer;
  275. Protected
  276. //Property setters
  277. Procedure Setmajor(AIndex : Integer; const AValue : integer); virtual;
  278. Procedure Setminor(AIndex : Integer; const AValue : integer); virtual;
  279. Public
  280. Published
  281. Property major : integer Index 0 Read Fmajor Write Setmajor;
  282. Property minor : integer Index 8 Read Fminor Write Setminor;
  283. end;
  284. TResultTypeversionClass = Class of TResultTypeversion;
  285. { --------------------------------------------------------------------
  286. TResult
  287. --------------------------------------------------------------------}
  288. TResult = Class(TGoogleBaseObject)
  289. Private
  290. FformattedResults : TResultTypeformattedResults;
  291. Fid : String;
  292. FinvalidRules : TStringArray;
  293. Fkind : String;
  294. FpageStats : TResultTypepageStats;
  295. FresponseCode : integer;
  296. FruleGroups : TResultTyperuleGroups;
  297. Fscreenshot : TPagespeedApiImageV2;
  298. Ftitle : String;
  299. Fversion : TResultTypeversion;
  300. Protected
  301. //Property setters
  302. Procedure SetformattedResults(AIndex : Integer; const AValue : TResultTypeformattedResults); virtual;
  303. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  304. Procedure SetinvalidRules(AIndex : Integer; const AValue : TStringArray); virtual;
  305. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  306. Procedure SetpageStats(AIndex : Integer; const AValue : TResultTypepageStats); virtual;
  307. Procedure SetresponseCode(AIndex : Integer; const AValue : integer); virtual;
  308. Procedure SetruleGroups(AIndex : Integer; const AValue : TResultTyperuleGroups); virtual;
  309. Procedure Setscreenshot(AIndex : Integer; const AValue : TPagespeedApiImageV2); virtual;
  310. Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
  311. Procedure Setversion(AIndex : Integer; const AValue : TResultTypeversion); virtual;
  312. //2.6.4. bug workaround
  313. {$IFDEF VER2_6}
  314. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  315. {$ENDIF VER2_6}
  316. Public
  317. Published
  318. Property formattedResults : TResultTypeformattedResults Index 0 Read FformattedResults Write SetformattedResults;
  319. Property id : String Index 8 Read Fid Write Setid;
  320. Property invalidRules : TStringArray Index 16 Read FinvalidRules Write SetinvalidRules;
  321. Property kind : String Index 24 Read Fkind Write Setkind;
  322. Property pageStats : TResultTypepageStats Index 32 Read FpageStats Write SetpageStats;
  323. Property responseCode : integer Index 40 Read FresponseCode Write SetresponseCode;
  324. Property ruleGroups : TResultTyperuleGroups Index 48 Read FruleGroups Write SetruleGroups;
  325. Property screenshot : TPagespeedApiImageV2 Index 56 Read Fscreenshot Write Setscreenshot;
  326. Property title : String Index 64 Read Ftitle Write Settitle;
  327. Property version : TResultTypeversion Index 72 Read Fversion Write Setversion;
  328. end;
  329. TResultClass = Class of TResult;
  330. { --------------------------------------------------------------------
  331. TPagespeedapiResource
  332. --------------------------------------------------------------------}
  333. //Optional query Options for TPagespeedapiResource, method Runpagespeed
  334. TPagespeedapiRunpagespeedOptions = Record
  335. filter_third_party_resources : boolean;
  336. locale : String;
  337. rule : String;
  338. screenshot : boolean;
  339. strategy : String;
  340. url : String;
  341. end;
  342. TPagespeedapiResource = Class(TGoogleResource)
  343. Public
  344. Class Function ResourceName : String; override;
  345. Class Function DefaultAPI : TGoogleAPIClass; override;
  346. Function Runpagespeed(AQuery : string = '') : TResult;
  347. Function Runpagespeed(AQuery : TPagespeedapirunpagespeedOptions) : TResult;
  348. end;
  349. { --------------------------------------------------------------------
  350. TPagespeedonlineAPI
  351. --------------------------------------------------------------------}
  352. TPagespeedonlineAPI = Class(TGoogleAPI)
  353. Private
  354. FPagespeedapiInstance : TPagespeedapiResource;
  355. Function GetPagespeedapiInstance : TPagespeedapiResource;virtual;
  356. Public
  357. //Override class functions with API info
  358. Class Function APIName : String; override;
  359. Class Function APIVersion : String; override;
  360. Class Function APIRevision : String; override;
  361. Class Function APIID : String; override;
  362. Class Function APITitle : String; override;
  363. Class Function APIDescription : String; override;
  364. Class Function APIOwnerDomain : String; override;
  365. Class Function APIOwnerName : String; override;
  366. Class Function APIIcon16 : String; override;
  367. Class Function APIIcon32 : String; override;
  368. Class Function APIdocumentationLink : String; override;
  369. Class Function APIrootUrl : string; override;
  370. Class Function APIbasePath : string;override;
  371. Class Function APIbaseURL : String;override;
  372. Class Function APIProtocol : string;override;
  373. Class Function APIservicePath : string;override;
  374. Class Function APIbatchPath : String;override;
  375. Class Function APIAuthScopes : TScopeInfoArray;override;
  376. Class Function APINeedsAuth : Boolean;override;
  377. Class Procedure RegisterAPIResources; override;
  378. //Add create function for resources
  379. Function CreatePagespeedapiResource(AOwner : TComponent) : TPagespeedapiResource;virtual;overload;
  380. Function CreatePagespeedapiResource : TPagespeedapiResource;virtual;overload;
  381. //Add default on-demand instances for resources
  382. Property PagespeedapiResource : TPagespeedapiResource Read GetPagespeedapiInstance;
  383. end;
  384. implementation
  385. { --------------------------------------------------------------------
  386. TPagespeedApiFormatStringV2TypeargsItemTyperectsItem
  387. --------------------------------------------------------------------}
  388. Procedure TPagespeedApiFormatStringV2TypeargsItemTyperectsItem.Setheight(AIndex : Integer; const AValue : integer);
  389. begin
  390. If (Fheight=AValue) then exit;
  391. Fheight:=AValue;
  392. MarkPropertyChanged(AIndex);
  393. end;
  394. Procedure TPagespeedApiFormatStringV2TypeargsItemTyperectsItem.Setleft(AIndex : Integer; const AValue : integer);
  395. begin
  396. If (Fleft=AValue) then exit;
  397. Fleft:=AValue;
  398. MarkPropertyChanged(AIndex);
  399. end;
  400. Procedure TPagespeedApiFormatStringV2TypeargsItemTyperectsItem.Settop(AIndex : Integer; const AValue : integer);
  401. begin
  402. If (Ftop=AValue) then exit;
  403. Ftop:=AValue;
  404. MarkPropertyChanged(AIndex);
  405. end;
  406. Procedure TPagespeedApiFormatStringV2TypeargsItemTyperectsItem.Setwidth(AIndex : Integer; const AValue : integer);
  407. begin
  408. If (Fwidth=AValue) then exit;
  409. Fwidth:=AValue;
  410. MarkPropertyChanged(AIndex);
  411. end;
  412. { --------------------------------------------------------------------
  413. TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem
  414. --------------------------------------------------------------------}
  415. Procedure TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem.Setheight(AIndex : Integer; const AValue : integer);
  416. begin
  417. If (Fheight=AValue) then exit;
  418. Fheight:=AValue;
  419. MarkPropertyChanged(AIndex);
  420. end;
  421. Procedure TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem.Setleft(AIndex : Integer; const AValue : integer);
  422. begin
  423. If (Fleft=AValue) then exit;
  424. Fleft:=AValue;
  425. MarkPropertyChanged(AIndex);
  426. end;
  427. Procedure TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem.Settop(AIndex : Integer; const AValue : integer);
  428. begin
  429. If (Ftop=AValue) then exit;
  430. Ftop:=AValue;
  431. MarkPropertyChanged(AIndex);
  432. end;
  433. Procedure TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem.Setwidth(AIndex : Integer; const AValue : integer);
  434. begin
  435. If (Fwidth=AValue) then exit;
  436. Fwidth:=AValue;
  437. MarkPropertyChanged(AIndex);
  438. end;
  439. { --------------------------------------------------------------------
  440. TPagespeedApiFormatStringV2TypeargsItem
  441. --------------------------------------------------------------------}
  442. Procedure TPagespeedApiFormatStringV2TypeargsItem.Setkey(AIndex : Integer; const AValue : String);
  443. begin
  444. If (Fkey=AValue) then exit;
  445. Fkey:=AValue;
  446. MarkPropertyChanged(AIndex);
  447. end;
  448. Procedure TPagespeedApiFormatStringV2TypeargsItem.Setrects(AIndex : Integer; const AValue : TPagespeedApiFormatStringV2TypeargsItemTyperectsArray);
  449. begin
  450. If (Frects=AValue) then exit;
  451. Frects:=AValue;
  452. MarkPropertyChanged(AIndex);
  453. end;
  454. Procedure TPagespeedApiFormatStringV2TypeargsItem.Setsecondary_rects(AIndex : Integer; const AValue : TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsArray);
  455. begin
  456. If (Fsecondary_rects=AValue) then exit;
  457. Fsecondary_rects:=AValue;
  458. MarkPropertyChanged(AIndex);
  459. end;
  460. Procedure TPagespeedApiFormatStringV2TypeargsItem.Set_type(AIndex : Integer; const AValue : String);
  461. begin
  462. If (F_type=AValue) then exit;
  463. F_type:=AValue;
  464. MarkPropertyChanged(AIndex);
  465. end;
  466. Procedure TPagespeedApiFormatStringV2TypeargsItem.Setvalue(AIndex : Integer; const AValue : String);
  467. begin
  468. If (Fvalue=AValue) then exit;
  469. Fvalue:=AValue;
  470. MarkPropertyChanged(AIndex);
  471. end;
  472. Class Function TPagespeedApiFormatStringV2TypeargsItem.ExportPropertyName(Const AName : String) :String;
  473. begin
  474. Case AName of
  475. '_type' : Result:='type';
  476. else
  477. Result:=Inherited ExportPropertyName(AName);
  478. end;
  479. end;
  480. //2.6.4. bug workaround
  481. {$IFDEF VER2_6}
  482. Procedure TPagespeedApiFormatStringV2TypeargsItem.SetArrayLength(Const AName : String; ALength : Longint);
  483. begin
  484. Case AName of
  485. 'rects' : SetLength(Frects,ALength);
  486. 'secondary_rects' : SetLength(Fsecondary_rects,ALength);
  487. else
  488. Inherited SetArrayLength(AName,ALength);
  489. end;
  490. end;
  491. {$ENDIF VER2_6}
  492. { --------------------------------------------------------------------
  493. TPagespeedApiFormatStringV2
  494. --------------------------------------------------------------------}
  495. Procedure TPagespeedApiFormatStringV2.Setargs(AIndex : Integer; const AValue : TPagespeedApiFormatStringV2TypeargsArray);
  496. begin
  497. If (Fargs=AValue) then exit;
  498. Fargs:=AValue;
  499. MarkPropertyChanged(AIndex);
  500. end;
  501. Procedure TPagespeedApiFormatStringV2.Setformat(AIndex : Integer; const AValue : String);
  502. begin
  503. If (Fformat=AValue) then exit;
  504. Fformat:=AValue;
  505. MarkPropertyChanged(AIndex);
  506. end;
  507. //2.6.4. bug workaround
  508. {$IFDEF VER2_6}
  509. Procedure TPagespeedApiFormatStringV2.SetArrayLength(Const AName : String; ALength : Longint);
  510. begin
  511. Case AName of
  512. 'args' : SetLength(Fargs,ALength);
  513. else
  514. Inherited SetArrayLength(AName,ALength);
  515. end;
  516. end;
  517. {$ENDIF VER2_6}
  518. { --------------------------------------------------------------------
  519. TPagespeedApiImageV2Typepage_rect
  520. --------------------------------------------------------------------}
  521. Procedure TPagespeedApiImageV2Typepage_rect.Setheight(AIndex : Integer; const AValue : integer);
  522. begin
  523. If (Fheight=AValue) then exit;
  524. Fheight:=AValue;
  525. MarkPropertyChanged(AIndex);
  526. end;
  527. Procedure TPagespeedApiImageV2Typepage_rect.Setleft(AIndex : Integer; const AValue : integer);
  528. begin
  529. If (Fleft=AValue) then exit;
  530. Fleft:=AValue;
  531. MarkPropertyChanged(AIndex);
  532. end;
  533. Procedure TPagespeedApiImageV2Typepage_rect.Settop(AIndex : Integer; const AValue : integer);
  534. begin
  535. If (Ftop=AValue) then exit;
  536. Ftop:=AValue;
  537. MarkPropertyChanged(AIndex);
  538. end;
  539. Procedure TPagespeedApiImageV2Typepage_rect.Setwidth(AIndex : Integer; const AValue : integer);
  540. begin
  541. If (Fwidth=AValue) then exit;
  542. Fwidth:=AValue;
  543. MarkPropertyChanged(AIndex);
  544. end;
  545. { --------------------------------------------------------------------
  546. TPagespeedApiImageV2
  547. --------------------------------------------------------------------}
  548. Procedure TPagespeedApiImageV2.Setdata(AIndex : Integer; const AValue : String);
  549. begin
  550. If (Fdata=AValue) then exit;
  551. Fdata:=AValue;
  552. MarkPropertyChanged(AIndex);
  553. end;
  554. Procedure TPagespeedApiImageV2.Setheight(AIndex : Integer; const AValue : integer);
  555. begin
  556. If (Fheight=AValue) then exit;
  557. Fheight:=AValue;
  558. MarkPropertyChanged(AIndex);
  559. end;
  560. Procedure TPagespeedApiImageV2.Setkey(AIndex : Integer; const AValue : String);
  561. begin
  562. If (Fkey=AValue) then exit;
  563. Fkey:=AValue;
  564. MarkPropertyChanged(AIndex);
  565. end;
  566. Procedure TPagespeedApiImageV2.Setmime_type(AIndex : Integer; const AValue : String);
  567. begin
  568. If (Fmime_type=AValue) then exit;
  569. Fmime_type:=AValue;
  570. MarkPropertyChanged(AIndex);
  571. end;
  572. Procedure TPagespeedApiImageV2.Setpage_rect(AIndex : Integer; const AValue : TPagespeedApiImageV2Typepage_rect);
  573. begin
  574. If (Fpage_rect=AValue) then exit;
  575. Fpage_rect:=AValue;
  576. MarkPropertyChanged(AIndex);
  577. end;
  578. Procedure TPagespeedApiImageV2.Setwidth(AIndex : Integer; const AValue : integer);
  579. begin
  580. If (Fwidth=AValue) then exit;
  581. Fwidth:=AValue;
  582. MarkPropertyChanged(AIndex);
  583. end;
  584. { --------------------------------------------------------------------
  585. TResultTypeformattedResultsTyperuleResults
  586. --------------------------------------------------------------------}
  587. Class Function TResultTypeformattedResultsTyperuleResults.AllowAdditionalProperties : Boolean;
  588. begin
  589. Result:=True;
  590. end;
  591. { --------------------------------------------------------------------
  592. TResultTypeformattedResults
  593. --------------------------------------------------------------------}
  594. Procedure TResultTypeformattedResults.Setlocale(AIndex : Integer; const AValue : String);
  595. begin
  596. If (Flocale=AValue) then exit;
  597. Flocale:=AValue;
  598. MarkPropertyChanged(AIndex);
  599. end;
  600. Procedure TResultTypeformattedResults.SetruleResults(AIndex : Integer; const AValue : TResultTypeformattedResultsTyperuleResults);
  601. begin
  602. If (FruleResults=AValue) then exit;
  603. FruleResults:=AValue;
  604. MarkPropertyChanged(AIndex);
  605. end;
  606. { --------------------------------------------------------------------
  607. TResultTypepageStats
  608. --------------------------------------------------------------------}
  609. Procedure TResultTypepageStats.SetcssResponseBytes(AIndex : Integer; const AValue : String);
  610. begin
  611. If (FcssResponseBytes=AValue) then exit;
  612. FcssResponseBytes:=AValue;
  613. MarkPropertyChanged(AIndex);
  614. end;
  615. Procedure TResultTypepageStats.SetflashResponseBytes(AIndex : Integer; const AValue : String);
  616. begin
  617. If (FflashResponseBytes=AValue) then exit;
  618. FflashResponseBytes:=AValue;
  619. MarkPropertyChanged(AIndex);
  620. end;
  621. Procedure TResultTypepageStats.SethtmlResponseBytes(AIndex : Integer; const AValue : String);
  622. begin
  623. If (FhtmlResponseBytes=AValue) then exit;
  624. FhtmlResponseBytes:=AValue;
  625. MarkPropertyChanged(AIndex);
  626. end;
  627. Procedure TResultTypepageStats.SetimageResponseBytes(AIndex : Integer; const AValue : String);
  628. begin
  629. If (FimageResponseBytes=AValue) then exit;
  630. FimageResponseBytes:=AValue;
  631. MarkPropertyChanged(AIndex);
  632. end;
  633. Procedure TResultTypepageStats.SetjavascriptResponseBytes(AIndex : Integer; const AValue : String);
  634. begin
  635. If (FjavascriptResponseBytes=AValue) then exit;
  636. FjavascriptResponseBytes:=AValue;
  637. MarkPropertyChanged(AIndex);
  638. end;
  639. Procedure TResultTypepageStats.SetnumberCssResources(AIndex : Integer; const AValue : integer);
  640. begin
  641. If (FnumberCssResources=AValue) then exit;
  642. FnumberCssResources:=AValue;
  643. MarkPropertyChanged(AIndex);
  644. end;
  645. Procedure TResultTypepageStats.SetnumberHosts(AIndex : Integer; const AValue : integer);
  646. begin
  647. If (FnumberHosts=AValue) then exit;
  648. FnumberHosts:=AValue;
  649. MarkPropertyChanged(AIndex);
  650. end;
  651. Procedure TResultTypepageStats.SetnumberJsResources(AIndex : Integer; const AValue : integer);
  652. begin
  653. If (FnumberJsResources=AValue) then exit;
  654. FnumberJsResources:=AValue;
  655. MarkPropertyChanged(AIndex);
  656. end;
  657. Procedure TResultTypepageStats.SetnumberResources(AIndex : Integer; const AValue : integer);
  658. begin
  659. If (FnumberResources=AValue) then exit;
  660. FnumberResources:=AValue;
  661. MarkPropertyChanged(AIndex);
  662. end;
  663. Procedure TResultTypepageStats.SetnumberStaticResources(AIndex : Integer; const AValue : integer);
  664. begin
  665. If (FnumberStaticResources=AValue) then exit;
  666. FnumberStaticResources:=AValue;
  667. MarkPropertyChanged(AIndex);
  668. end;
  669. Procedure TResultTypepageStats.SetotherResponseBytes(AIndex : Integer; const AValue : String);
  670. begin
  671. If (FotherResponseBytes=AValue) then exit;
  672. FotherResponseBytes:=AValue;
  673. MarkPropertyChanged(AIndex);
  674. end;
  675. Procedure TResultTypepageStats.SettextResponseBytes(AIndex : Integer; const AValue : String);
  676. begin
  677. If (FtextResponseBytes=AValue) then exit;
  678. FtextResponseBytes:=AValue;
  679. MarkPropertyChanged(AIndex);
  680. end;
  681. Procedure TResultTypepageStats.SettotalRequestBytes(AIndex : Integer; const AValue : String);
  682. begin
  683. If (FtotalRequestBytes=AValue) then exit;
  684. FtotalRequestBytes:=AValue;
  685. MarkPropertyChanged(AIndex);
  686. end;
  687. { --------------------------------------------------------------------
  688. TResultTyperuleGroups
  689. --------------------------------------------------------------------}
  690. Class Function TResultTyperuleGroups.AllowAdditionalProperties : Boolean;
  691. begin
  692. Result:=True;
  693. end;
  694. { --------------------------------------------------------------------
  695. TResultTypeversion
  696. --------------------------------------------------------------------}
  697. Procedure TResultTypeversion.Setmajor(AIndex : Integer; const AValue : integer);
  698. begin
  699. If (Fmajor=AValue) then exit;
  700. Fmajor:=AValue;
  701. MarkPropertyChanged(AIndex);
  702. end;
  703. Procedure TResultTypeversion.Setminor(AIndex : Integer; const AValue : integer);
  704. begin
  705. If (Fminor=AValue) then exit;
  706. Fminor:=AValue;
  707. MarkPropertyChanged(AIndex);
  708. end;
  709. { --------------------------------------------------------------------
  710. TResult
  711. --------------------------------------------------------------------}
  712. Procedure TResult.SetformattedResults(AIndex : Integer; const AValue : TResultTypeformattedResults);
  713. begin
  714. If (FformattedResults=AValue) then exit;
  715. FformattedResults:=AValue;
  716. MarkPropertyChanged(AIndex);
  717. end;
  718. Procedure TResult.Setid(AIndex : Integer; const AValue : String);
  719. begin
  720. If (Fid=AValue) then exit;
  721. Fid:=AValue;
  722. MarkPropertyChanged(AIndex);
  723. end;
  724. Procedure TResult.SetinvalidRules(AIndex : Integer; const AValue : TStringArray);
  725. begin
  726. If (FinvalidRules=AValue) then exit;
  727. FinvalidRules:=AValue;
  728. MarkPropertyChanged(AIndex);
  729. end;
  730. Procedure TResult.Setkind(AIndex : Integer; const AValue : String);
  731. begin
  732. If (Fkind=AValue) then exit;
  733. Fkind:=AValue;
  734. MarkPropertyChanged(AIndex);
  735. end;
  736. Procedure TResult.SetpageStats(AIndex : Integer; const AValue : TResultTypepageStats);
  737. begin
  738. If (FpageStats=AValue) then exit;
  739. FpageStats:=AValue;
  740. MarkPropertyChanged(AIndex);
  741. end;
  742. Procedure TResult.SetresponseCode(AIndex : Integer; const AValue : integer);
  743. begin
  744. If (FresponseCode=AValue) then exit;
  745. FresponseCode:=AValue;
  746. MarkPropertyChanged(AIndex);
  747. end;
  748. Procedure TResult.SetruleGroups(AIndex : Integer; const AValue : TResultTyperuleGroups);
  749. begin
  750. If (FruleGroups=AValue) then exit;
  751. FruleGroups:=AValue;
  752. MarkPropertyChanged(AIndex);
  753. end;
  754. Procedure TResult.Setscreenshot(AIndex : Integer; const AValue : TPagespeedApiImageV2);
  755. begin
  756. If (Fscreenshot=AValue) then exit;
  757. Fscreenshot:=AValue;
  758. MarkPropertyChanged(AIndex);
  759. end;
  760. Procedure TResult.Settitle(AIndex : Integer; const AValue : String);
  761. begin
  762. If (Ftitle=AValue) then exit;
  763. Ftitle:=AValue;
  764. MarkPropertyChanged(AIndex);
  765. end;
  766. Procedure TResult.Setversion(AIndex : Integer; const AValue : TResultTypeversion);
  767. begin
  768. If (Fversion=AValue) then exit;
  769. Fversion:=AValue;
  770. MarkPropertyChanged(AIndex);
  771. end;
  772. //2.6.4. bug workaround
  773. {$IFDEF VER2_6}
  774. Procedure TResult.SetArrayLength(Const AName : String; ALength : Longint);
  775. begin
  776. Case AName of
  777. 'invalidrules' : SetLength(FinvalidRules,ALength);
  778. else
  779. Inherited SetArrayLength(AName,ALength);
  780. end;
  781. end;
  782. {$ENDIF VER2_6}
  783. { --------------------------------------------------------------------
  784. TPagespeedapiResource
  785. --------------------------------------------------------------------}
  786. Class Function TPagespeedapiResource.ResourceName : String;
  787. begin
  788. Result:='pagespeedapi';
  789. end;
  790. Class Function TPagespeedapiResource.DefaultAPI : TGoogleAPIClass;
  791. begin
  792. Result:=TpagespeedonlineAPI;
  793. end;
  794. Function TPagespeedapiResource.Runpagespeed(AQuery : string = '') : TResult;
  795. Const
  796. _HTTPMethod = 'GET';
  797. _Path = 'runPagespeed';
  798. _Methodid = 'pagespeedonline.pagespeedapi.runpagespeed';
  799. begin
  800. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TResult) as TResult;
  801. end;
  802. Function TPagespeedapiResource.Runpagespeed(AQuery : TPagespeedapirunpagespeedOptions) : TResult;
  803. Var
  804. _Q : String;
  805. begin
  806. _Q:='';
  807. AddToQuery(_Q,'filter_third_party_resources',AQuery.filter_third_party_resources);
  808. AddToQuery(_Q,'locale',AQuery.locale);
  809. AddToQuery(_Q,'rule',AQuery.rule);
  810. AddToQuery(_Q,'screenshot',AQuery.screenshot);
  811. AddToQuery(_Q,'strategy',AQuery.strategy);
  812. AddToQuery(_Q,'url',AQuery.url);
  813. Result:=Runpagespeed(_Q);
  814. end;
  815. { --------------------------------------------------------------------
  816. TPagespeedonlineAPI
  817. --------------------------------------------------------------------}
  818. Class Function TPagespeedonlineAPI.APIName : String;
  819. begin
  820. Result:='pagespeedonline';
  821. end;
  822. Class Function TPagespeedonlineAPI.APIVersion : String;
  823. begin
  824. Result:='v2';
  825. end;
  826. Class Function TPagespeedonlineAPI.APIRevision : String;
  827. begin
  828. Result:='20160516';
  829. end;
  830. Class Function TPagespeedonlineAPI.APIID : String;
  831. begin
  832. Result:='pagespeedonline:v2';
  833. end;
  834. Class Function TPagespeedonlineAPI.APITitle : String;
  835. begin
  836. Result:='PageSpeed Insights API';
  837. end;
  838. Class Function TPagespeedonlineAPI.APIDescription : String;
  839. begin
  840. Result:='Analyzes the performance of a web page and provides tailored suggestions to make that page faster.';
  841. end;
  842. Class Function TPagespeedonlineAPI.APIOwnerDomain : String;
  843. begin
  844. Result:='google.com';
  845. end;
  846. Class Function TPagespeedonlineAPI.APIOwnerName : String;
  847. begin
  848. Result:='Google';
  849. end;
  850. Class Function TPagespeedonlineAPI.APIIcon16 : String;
  851. begin
  852. Result:='https://www.google.com/images/icons/product/pagespeed-16.png';
  853. end;
  854. Class Function TPagespeedonlineAPI.APIIcon32 : String;
  855. begin
  856. Result:='https://www.google.com/images/icons/product/pagespeed-32.png';
  857. end;
  858. Class Function TPagespeedonlineAPI.APIdocumentationLink : String;
  859. begin
  860. Result:='https://developers.google.com/speed/docs/insights/v2/getting-started';
  861. end;
  862. Class Function TPagespeedonlineAPI.APIrootUrl : string;
  863. begin
  864. Result:='https://www.googleapis.com/';
  865. end;
  866. Class Function TPagespeedonlineAPI.APIbasePath : string;
  867. begin
  868. Result:='/pagespeedonline/v2/';
  869. end;
  870. Class Function TPagespeedonlineAPI.APIbaseURL : String;
  871. begin
  872. Result:='https://www.googleapis.com/pagespeedonline/v2/';
  873. end;
  874. Class Function TPagespeedonlineAPI.APIProtocol : string;
  875. begin
  876. Result:='rest';
  877. end;
  878. Class Function TPagespeedonlineAPI.APIservicePath : string;
  879. begin
  880. Result:='pagespeedonline/v2/';
  881. end;
  882. Class Function TPagespeedonlineAPI.APIbatchPath : String;
  883. begin
  884. Result:='batch';
  885. end;
  886. Class Function TPagespeedonlineAPI.APIAuthScopes : TScopeInfoArray;
  887. begin
  888. SetLength(Result,0);
  889. end;
  890. Class Function TPagespeedonlineAPI.APINeedsAuth : Boolean;
  891. begin
  892. Result:=False;
  893. end;
  894. Class Procedure TPagespeedonlineAPI.RegisterAPIResources;
  895. begin
  896. TPagespeedApiFormatStringV2TypeargsItemTyperectsItem.RegisterObject;
  897. TPagespeedApiFormatStringV2TypeargsItemTypesecondary_rectsItem.RegisterObject;
  898. TPagespeedApiFormatStringV2TypeargsItem.RegisterObject;
  899. TPagespeedApiFormatStringV2.RegisterObject;
  900. TPagespeedApiImageV2Typepage_rect.RegisterObject;
  901. TPagespeedApiImageV2.RegisterObject;
  902. TResultTypeformattedResultsTyperuleResults.RegisterObject;
  903. TResultTypeformattedResults.RegisterObject;
  904. TResultTypepageStats.RegisterObject;
  905. TResultTyperuleGroups.RegisterObject;
  906. TResultTypeversion.RegisterObject;
  907. TResult.RegisterObject;
  908. end;
  909. Function TPagespeedonlineAPI.GetPagespeedapiInstance : TPagespeedapiResource;
  910. begin
  911. if (FPagespeedapiInstance=Nil) then
  912. FPagespeedapiInstance:=CreatePagespeedapiResource;
  913. Result:=FPagespeedapiInstance;
  914. end;
  915. Function TPagespeedonlineAPI.CreatePagespeedapiResource : TPagespeedapiResource;
  916. begin
  917. Result:=CreatePagespeedapiResource(Self);
  918. end;
  919. Function TPagespeedonlineAPI.CreatePagespeedapiResource(AOwner : TComponent) : TPagespeedapiResource;
  920. begin
  921. Result:=TPagespeedapiResource.Create(AOwner);
  922. Result.API:=Self.API;
  923. end;
  924. initialization
  925. TPagespeedonlineAPI.RegisterAPI;
  926. end.