googlewebmasters.pp 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041
  1. unit googlewebmasters;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TApiDataRow = Class;
  9. TApiDimensionFilter = Class;
  10. TApiDimensionFilterGroup = Class;
  11. TSearchAnalyticsQueryRequest = Class;
  12. TSearchAnalyticsQueryResponse = Class;
  13. TSitemapsListResponse = Class;
  14. TSitesListResponse = Class;
  15. TUrlCrawlErrorCount = Class;
  16. TUrlCrawlErrorCountsPerType = Class;
  17. TUrlCrawlErrorsCountsQueryResponse = Class;
  18. TUrlCrawlErrorsSample = Class;
  19. TUrlCrawlErrorsSamplesListResponse = Class;
  20. TUrlSampleDetails = Class;
  21. TWmxSite = Class;
  22. TWmxSitemap = Class;
  23. TWmxSitemapContent = Class;
  24. TApiDataRowArray = Array of TApiDataRow;
  25. TApiDimensionFilterArray = Array of TApiDimensionFilter;
  26. TApiDimensionFilterGroupArray = Array of TApiDimensionFilterGroup;
  27. TSearchAnalyticsQueryRequestArray = Array of TSearchAnalyticsQueryRequest;
  28. TSearchAnalyticsQueryResponseArray = Array of TSearchAnalyticsQueryResponse;
  29. TSitemapsListResponseArray = Array of TSitemapsListResponse;
  30. TSitesListResponseArray = Array of TSitesListResponse;
  31. TUrlCrawlErrorCountArray = Array of TUrlCrawlErrorCount;
  32. TUrlCrawlErrorCountsPerTypeArray = Array of TUrlCrawlErrorCountsPerType;
  33. TUrlCrawlErrorsCountsQueryResponseArray = Array of TUrlCrawlErrorsCountsQueryResponse;
  34. TUrlCrawlErrorsSampleArray = Array of TUrlCrawlErrorsSample;
  35. TUrlCrawlErrorsSamplesListResponseArray = Array of TUrlCrawlErrorsSamplesListResponse;
  36. TUrlSampleDetailsArray = Array of TUrlSampleDetails;
  37. TWmxSiteArray = Array of TWmxSite;
  38. TWmxSitemapArray = Array of TWmxSitemap;
  39. TWmxSitemapContentArray = Array of TWmxSitemapContent;
  40. //Anonymous types, using auto-generated names
  41. TApiDimensionFilterGroupTypefiltersArray = Array of TApiDimensionFilter;
  42. TSearchAnalyticsQueryRequestTypedimensionFilterGroupsArray = Array of TApiDimensionFilterGroup;
  43. TSearchAnalyticsQueryResponseTyperowsArray = Array of TApiDataRow;
  44. TSitemapsListResponseTypesitemapArray = Array of TWmxSitemap;
  45. TSitesListResponseTypesiteEntryArray = Array of TWmxSite;
  46. TUrlCrawlErrorCountsPerTypeTypeentriesArray = Array of TUrlCrawlErrorCount;
  47. TUrlCrawlErrorsCountsQueryResponseTypecountPerTypesArray = Array of TUrlCrawlErrorCountsPerType;
  48. TUrlCrawlErrorsSamplesListResponseTypeurlCrawlErrorSampleArray = Array of TUrlCrawlErrorsSample;
  49. TWmxSitemapTypecontentsArray = Array of TWmxSitemapContent;
  50. { --------------------------------------------------------------------
  51. TApiDataRow
  52. --------------------------------------------------------------------}
  53. TApiDataRow = Class(TGoogleBaseObject)
  54. Private
  55. Fclicks : double;
  56. Fctr : double;
  57. Fimpressions : double;
  58. Fkeys : TStringArray;
  59. Fposition : double;
  60. Protected
  61. //Property setters
  62. Procedure Setclicks(AIndex : Integer; const AValue : double); virtual;
  63. Procedure Setctr(AIndex : Integer; const AValue : double); virtual;
  64. Procedure Setimpressions(AIndex : Integer; const AValue : double); virtual;
  65. Procedure Setkeys(AIndex : Integer; const AValue : TStringArray); virtual;
  66. Procedure Setposition(AIndex : Integer; const AValue : double); virtual;
  67. //2.6.4. bug workaround
  68. {$IFDEF VER2_6}
  69. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  70. {$ENDIF VER2_6}
  71. Public
  72. Published
  73. Property clicks : double Index 0 Read Fclicks Write Setclicks;
  74. Property ctr : double Index 8 Read Fctr Write Setctr;
  75. Property impressions : double Index 16 Read Fimpressions Write Setimpressions;
  76. Property keys : TStringArray Index 24 Read Fkeys Write Setkeys;
  77. Property position : double Index 32 Read Fposition Write Setposition;
  78. end;
  79. TApiDataRowClass = Class of TApiDataRow;
  80. { --------------------------------------------------------------------
  81. TApiDimensionFilter
  82. --------------------------------------------------------------------}
  83. TApiDimensionFilter = Class(TGoogleBaseObject)
  84. Private
  85. Fdimension : String;
  86. Fexpression : String;
  87. F_operator : String;
  88. Protected
  89. Class Function ExportPropertyName(Const AName : String) : string; override;
  90. //Property setters
  91. Procedure Setdimension(AIndex : Integer; const AValue : String); virtual;
  92. Procedure Setexpression(AIndex : Integer; const AValue : String); virtual;
  93. Procedure Set_operator(AIndex : Integer; const AValue : String); virtual;
  94. Public
  95. Published
  96. Property dimension : String Index 0 Read Fdimension Write Setdimension;
  97. Property expression : String Index 8 Read Fexpression Write Setexpression;
  98. Property _operator : String Index 16 Read F_operator Write Set_operator;
  99. end;
  100. TApiDimensionFilterClass = Class of TApiDimensionFilter;
  101. { --------------------------------------------------------------------
  102. TApiDimensionFilterGroup
  103. --------------------------------------------------------------------}
  104. TApiDimensionFilterGroup = Class(TGoogleBaseObject)
  105. Private
  106. Ffilters : TApiDimensionFilterGroupTypefiltersArray;
  107. FgroupType : String;
  108. Protected
  109. //Property setters
  110. Procedure Setfilters(AIndex : Integer; const AValue : TApiDimensionFilterGroupTypefiltersArray); virtual;
  111. Procedure SetgroupType(AIndex : Integer; const AValue : String); virtual;
  112. //2.6.4. bug workaround
  113. {$IFDEF VER2_6}
  114. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  115. {$ENDIF VER2_6}
  116. Public
  117. Published
  118. Property filters : TApiDimensionFilterGroupTypefiltersArray Index 0 Read Ffilters Write Setfilters;
  119. Property groupType : String Index 8 Read FgroupType Write SetgroupType;
  120. end;
  121. TApiDimensionFilterGroupClass = Class of TApiDimensionFilterGroup;
  122. { --------------------------------------------------------------------
  123. TSearchAnalyticsQueryRequest
  124. --------------------------------------------------------------------}
  125. TSearchAnalyticsQueryRequest = Class(TGoogleBaseObject)
  126. Private
  127. FaggregationType : String;
  128. FdimensionFilterGroups : TSearchAnalyticsQueryRequestTypedimensionFilterGroupsArray;
  129. Fdimensions : TStringArray;
  130. FendDate : String;
  131. FrowLimit : integer;
  132. FsearchType : String;
  133. FstartDate : String;
  134. FstartRow : integer;
  135. Protected
  136. //Property setters
  137. Procedure SetaggregationType(AIndex : Integer; const AValue : String); virtual;
  138. Procedure SetdimensionFilterGroups(AIndex : Integer; const AValue : TSearchAnalyticsQueryRequestTypedimensionFilterGroupsArray); virtual;
  139. Procedure Setdimensions(AIndex : Integer; const AValue : TStringArray); virtual;
  140. Procedure SetendDate(AIndex : Integer; const AValue : String); virtual;
  141. Procedure SetrowLimit(AIndex : Integer; const AValue : integer); virtual;
  142. Procedure SetsearchType(AIndex : Integer; const AValue : String); virtual;
  143. Procedure SetstartDate(AIndex : Integer; const AValue : String); virtual;
  144. Procedure SetstartRow(AIndex : Integer; const AValue : integer); virtual;
  145. //2.6.4. bug workaround
  146. {$IFDEF VER2_6}
  147. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  148. {$ENDIF VER2_6}
  149. Public
  150. Published
  151. Property aggregationType : String Index 0 Read FaggregationType Write SetaggregationType;
  152. Property dimensionFilterGroups : TSearchAnalyticsQueryRequestTypedimensionFilterGroupsArray Index 8 Read FdimensionFilterGroups Write SetdimensionFilterGroups;
  153. Property dimensions : TStringArray Index 16 Read Fdimensions Write Setdimensions;
  154. Property endDate : String Index 24 Read FendDate Write SetendDate;
  155. Property rowLimit : integer Index 32 Read FrowLimit Write SetrowLimit;
  156. Property searchType : String Index 40 Read FsearchType Write SetsearchType;
  157. Property startDate : String Index 48 Read FstartDate Write SetstartDate;
  158. Property startRow : integer Index 56 Read FstartRow Write SetstartRow;
  159. end;
  160. TSearchAnalyticsQueryRequestClass = Class of TSearchAnalyticsQueryRequest;
  161. { --------------------------------------------------------------------
  162. TSearchAnalyticsQueryResponse
  163. --------------------------------------------------------------------}
  164. TSearchAnalyticsQueryResponse = Class(TGoogleBaseObject)
  165. Private
  166. FresponseAggregationType : String;
  167. Frows : TSearchAnalyticsQueryResponseTyperowsArray;
  168. Protected
  169. //Property setters
  170. Procedure SetresponseAggregationType(AIndex : Integer; const AValue : String); virtual;
  171. Procedure Setrows(AIndex : Integer; const AValue : TSearchAnalyticsQueryResponseTyperowsArray); virtual;
  172. //2.6.4. bug workaround
  173. {$IFDEF VER2_6}
  174. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  175. {$ENDIF VER2_6}
  176. Public
  177. Published
  178. Property responseAggregationType : String Index 0 Read FresponseAggregationType Write SetresponseAggregationType;
  179. Property rows : TSearchAnalyticsQueryResponseTyperowsArray Index 8 Read Frows Write Setrows;
  180. end;
  181. TSearchAnalyticsQueryResponseClass = Class of TSearchAnalyticsQueryResponse;
  182. { --------------------------------------------------------------------
  183. TSitemapsListResponse
  184. --------------------------------------------------------------------}
  185. TSitemapsListResponse = Class(TGoogleBaseObject)
  186. Private
  187. Fsitemap : TSitemapsListResponseTypesitemapArray;
  188. Protected
  189. //Property setters
  190. Procedure Setsitemap(AIndex : Integer; const AValue : TSitemapsListResponseTypesitemapArray); virtual;
  191. //2.6.4. bug workaround
  192. {$IFDEF VER2_6}
  193. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  194. {$ENDIF VER2_6}
  195. Public
  196. Published
  197. Property sitemap : TSitemapsListResponseTypesitemapArray Index 0 Read Fsitemap Write Setsitemap;
  198. end;
  199. TSitemapsListResponseClass = Class of TSitemapsListResponse;
  200. { --------------------------------------------------------------------
  201. TSitesListResponse
  202. --------------------------------------------------------------------}
  203. TSitesListResponse = Class(TGoogleBaseObject)
  204. Private
  205. FsiteEntry : TSitesListResponseTypesiteEntryArray;
  206. Protected
  207. //Property setters
  208. Procedure SetsiteEntry(AIndex : Integer; const AValue : TSitesListResponseTypesiteEntryArray); virtual;
  209. //2.6.4. bug workaround
  210. {$IFDEF VER2_6}
  211. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  212. {$ENDIF VER2_6}
  213. Public
  214. Published
  215. Property siteEntry : TSitesListResponseTypesiteEntryArray Index 0 Read FsiteEntry Write SetsiteEntry;
  216. end;
  217. TSitesListResponseClass = Class of TSitesListResponse;
  218. { --------------------------------------------------------------------
  219. TUrlCrawlErrorCount
  220. --------------------------------------------------------------------}
  221. TUrlCrawlErrorCount = Class(TGoogleBaseObject)
  222. Private
  223. Fcount : String;
  224. Ftimestamp : TDatetime;
  225. Protected
  226. //Property setters
  227. Procedure Setcount(AIndex : Integer; const AValue : String); virtual;
  228. Procedure Settimestamp(AIndex : Integer; const AValue : TDatetime); virtual;
  229. Public
  230. Published
  231. Property count : String Index 0 Read Fcount Write Setcount;
  232. Property timestamp : TDatetime Index 8 Read Ftimestamp Write Settimestamp;
  233. end;
  234. TUrlCrawlErrorCountClass = Class of TUrlCrawlErrorCount;
  235. { --------------------------------------------------------------------
  236. TUrlCrawlErrorCountsPerType
  237. --------------------------------------------------------------------}
  238. TUrlCrawlErrorCountsPerType = Class(TGoogleBaseObject)
  239. Private
  240. Fcategory : String;
  241. Fentries : TUrlCrawlErrorCountsPerTypeTypeentriesArray;
  242. Fplatform : String;
  243. Protected
  244. //Property setters
  245. Procedure Setcategory(AIndex : Integer; const AValue : String); virtual;
  246. Procedure Setentries(AIndex : Integer; const AValue : TUrlCrawlErrorCountsPerTypeTypeentriesArray); virtual;
  247. Procedure Setplatform(AIndex : Integer; const AValue : String); virtual;
  248. //2.6.4. bug workaround
  249. {$IFDEF VER2_6}
  250. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  251. {$ENDIF VER2_6}
  252. Public
  253. Published
  254. Property category : String Index 0 Read Fcategory Write Setcategory;
  255. Property entries : TUrlCrawlErrorCountsPerTypeTypeentriesArray Index 8 Read Fentries Write Setentries;
  256. Property platform : String Index 16 Read Fplatform Write Setplatform;
  257. end;
  258. TUrlCrawlErrorCountsPerTypeClass = Class of TUrlCrawlErrorCountsPerType;
  259. { --------------------------------------------------------------------
  260. TUrlCrawlErrorsCountsQueryResponse
  261. --------------------------------------------------------------------}
  262. TUrlCrawlErrorsCountsQueryResponse = Class(TGoogleBaseObject)
  263. Private
  264. FcountPerTypes : TUrlCrawlErrorsCountsQueryResponseTypecountPerTypesArray;
  265. Protected
  266. //Property setters
  267. Procedure SetcountPerTypes(AIndex : Integer; const AValue : TUrlCrawlErrorsCountsQueryResponseTypecountPerTypesArray); virtual;
  268. //2.6.4. bug workaround
  269. {$IFDEF VER2_6}
  270. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  271. {$ENDIF VER2_6}
  272. Public
  273. Published
  274. Property countPerTypes : TUrlCrawlErrorsCountsQueryResponseTypecountPerTypesArray Index 0 Read FcountPerTypes Write SetcountPerTypes;
  275. end;
  276. TUrlCrawlErrorsCountsQueryResponseClass = Class of TUrlCrawlErrorsCountsQueryResponse;
  277. { --------------------------------------------------------------------
  278. TUrlCrawlErrorsSample
  279. --------------------------------------------------------------------}
  280. TUrlCrawlErrorsSample = Class(TGoogleBaseObject)
  281. Private
  282. Ffirst_detected : TDatetime;
  283. Flast_crawled : TDatetime;
  284. FpageUrl : String;
  285. FresponseCode : integer;
  286. FurlDetails : TUrlSampleDetails;
  287. Protected
  288. //Property setters
  289. Procedure Setfirst_detected(AIndex : Integer; const AValue : TDatetime); virtual;
  290. Procedure Setlast_crawled(AIndex : Integer; const AValue : TDatetime); virtual;
  291. Procedure SetpageUrl(AIndex : Integer; const AValue : String); virtual;
  292. Procedure SetresponseCode(AIndex : Integer; const AValue : integer); virtual;
  293. Procedure SeturlDetails(AIndex : Integer; const AValue : TUrlSampleDetails); virtual;
  294. Public
  295. Published
  296. Property first_detected : TDatetime Index 0 Read Ffirst_detected Write Setfirst_detected;
  297. Property last_crawled : TDatetime Index 8 Read Flast_crawled Write Setlast_crawled;
  298. Property pageUrl : String Index 16 Read FpageUrl Write SetpageUrl;
  299. Property responseCode : integer Index 24 Read FresponseCode Write SetresponseCode;
  300. Property urlDetails : TUrlSampleDetails Index 32 Read FurlDetails Write SeturlDetails;
  301. end;
  302. TUrlCrawlErrorsSampleClass = Class of TUrlCrawlErrorsSample;
  303. { --------------------------------------------------------------------
  304. TUrlCrawlErrorsSamplesListResponse
  305. --------------------------------------------------------------------}
  306. TUrlCrawlErrorsSamplesListResponse = Class(TGoogleBaseObject)
  307. Private
  308. FurlCrawlErrorSample : TUrlCrawlErrorsSamplesListResponseTypeurlCrawlErrorSampleArray;
  309. Protected
  310. //Property setters
  311. Procedure SeturlCrawlErrorSample(AIndex : Integer; const AValue : TUrlCrawlErrorsSamplesListResponseTypeurlCrawlErrorSampleArray); 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 urlCrawlErrorSample : TUrlCrawlErrorsSamplesListResponseTypeurlCrawlErrorSampleArray Index 0 Read FurlCrawlErrorSample Write SeturlCrawlErrorSample;
  319. end;
  320. TUrlCrawlErrorsSamplesListResponseClass = Class of TUrlCrawlErrorsSamplesListResponse;
  321. { --------------------------------------------------------------------
  322. TUrlSampleDetails
  323. --------------------------------------------------------------------}
  324. TUrlSampleDetails = Class(TGoogleBaseObject)
  325. Private
  326. FcontainingSitemaps : TStringArray;
  327. FlinkedFromUrls : TStringArray;
  328. Protected
  329. //Property setters
  330. Procedure SetcontainingSitemaps(AIndex : Integer; const AValue : TStringArray); virtual;
  331. Procedure SetlinkedFromUrls(AIndex : Integer; const AValue : TStringArray); virtual;
  332. //2.6.4. bug workaround
  333. {$IFDEF VER2_6}
  334. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  335. {$ENDIF VER2_6}
  336. Public
  337. Published
  338. Property containingSitemaps : TStringArray Index 0 Read FcontainingSitemaps Write SetcontainingSitemaps;
  339. Property linkedFromUrls : TStringArray Index 8 Read FlinkedFromUrls Write SetlinkedFromUrls;
  340. end;
  341. TUrlSampleDetailsClass = Class of TUrlSampleDetails;
  342. { --------------------------------------------------------------------
  343. TWmxSite
  344. --------------------------------------------------------------------}
  345. TWmxSite = Class(TGoogleBaseObject)
  346. Private
  347. FpermissionLevel : String;
  348. FsiteUrl : String;
  349. Protected
  350. //Property setters
  351. Procedure SetpermissionLevel(AIndex : Integer; const AValue : String); virtual;
  352. Procedure SetsiteUrl(AIndex : Integer; const AValue : String); virtual;
  353. Public
  354. Published
  355. Property permissionLevel : String Index 0 Read FpermissionLevel Write SetpermissionLevel;
  356. Property siteUrl : String Index 8 Read FsiteUrl Write SetsiteUrl;
  357. end;
  358. TWmxSiteClass = Class of TWmxSite;
  359. { --------------------------------------------------------------------
  360. TWmxSitemap
  361. --------------------------------------------------------------------}
  362. TWmxSitemap = Class(TGoogleBaseObject)
  363. Private
  364. Fcontents : TWmxSitemapTypecontentsArray;
  365. Ferrors : String;
  366. FisPending : boolean;
  367. FisSitemapsIndex : boolean;
  368. FlastDownloaded : TDatetime;
  369. FlastSubmitted : TDatetime;
  370. Fpath : String;
  371. F_type : String;
  372. Fwarnings : String;
  373. Protected
  374. Class Function ExportPropertyName(Const AName : String) : string; override;
  375. //Property setters
  376. Procedure Setcontents(AIndex : Integer; const AValue : TWmxSitemapTypecontentsArray); virtual;
  377. Procedure Seterrors(AIndex : Integer; const AValue : String); virtual;
  378. Procedure SetisPending(AIndex : Integer; const AValue : boolean); virtual;
  379. Procedure SetisSitemapsIndex(AIndex : Integer; const AValue : boolean); virtual;
  380. Procedure SetlastDownloaded(AIndex : Integer; const AValue : TDatetime); virtual;
  381. Procedure SetlastSubmitted(AIndex : Integer; const AValue : TDatetime); virtual;
  382. Procedure Setpath(AIndex : Integer; const AValue : String); virtual;
  383. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  384. Procedure Setwarnings(AIndex : Integer; const AValue : String); virtual;
  385. //2.6.4. bug workaround
  386. {$IFDEF VER2_6}
  387. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  388. {$ENDIF VER2_6}
  389. Public
  390. Published
  391. Property contents : TWmxSitemapTypecontentsArray Index 0 Read Fcontents Write Setcontents;
  392. Property errors : String Index 8 Read Ferrors Write Seterrors;
  393. Property isPending : boolean Index 16 Read FisPending Write SetisPending;
  394. Property isSitemapsIndex : boolean Index 24 Read FisSitemapsIndex Write SetisSitemapsIndex;
  395. Property lastDownloaded : TDatetime Index 32 Read FlastDownloaded Write SetlastDownloaded;
  396. Property lastSubmitted : TDatetime Index 40 Read FlastSubmitted Write SetlastSubmitted;
  397. Property path : String Index 48 Read Fpath Write Setpath;
  398. Property _type : String Index 56 Read F_type Write Set_type;
  399. Property warnings : String Index 64 Read Fwarnings Write Setwarnings;
  400. end;
  401. TWmxSitemapClass = Class of TWmxSitemap;
  402. { --------------------------------------------------------------------
  403. TWmxSitemapContent
  404. --------------------------------------------------------------------}
  405. TWmxSitemapContent = Class(TGoogleBaseObject)
  406. Private
  407. Findexed : String;
  408. Fsubmitted : String;
  409. F_type : String;
  410. Protected
  411. Class Function ExportPropertyName(Const AName : String) : string; override;
  412. //Property setters
  413. Procedure Setindexed(AIndex : Integer; const AValue : String); virtual;
  414. Procedure Setsubmitted(AIndex : Integer; const AValue : String); virtual;
  415. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  416. Public
  417. Published
  418. Property indexed : String Index 0 Read Findexed Write Setindexed;
  419. Property submitted : String Index 8 Read Fsubmitted Write Setsubmitted;
  420. Property _type : String Index 16 Read F_type Write Set_type;
  421. end;
  422. TWmxSitemapContentClass = Class of TWmxSitemapContent;
  423. { --------------------------------------------------------------------
  424. TSearchanalyticsResource
  425. --------------------------------------------------------------------}
  426. TSearchanalyticsResource = Class(TGoogleResource)
  427. Public
  428. Class Function ResourceName : String; override;
  429. Class Function DefaultAPI : TGoogleAPIClass; override;
  430. Function Query(siteUrl: string; aSearchAnalyticsQueryRequest : TSearchAnalyticsQueryRequest) : TSearchAnalyticsQueryResponse;
  431. end;
  432. { --------------------------------------------------------------------
  433. TSitemapsResource
  434. --------------------------------------------------------------------}
  435. //Optional query Options for TSitemapsResource, method List
  436. TSitemapsListOptions = Record
  437. sitemapIndex : String;
  438. end;
  439. TSitemapsResource = Class(TGoogleResource)
  440. Public
  441. Class Function ResourceName : String; override;
  442. Class Function DefaultAPI : TGoogleAPIClass; override;
  443. Procedure Delete(feedpath: string; siteUrl: string);
  444. Function Get(feedpath: string; siteUrl: string) : TWmxSitemap;
  445. Function List(siteUrl: string; AQuery : string = '') : TSitemapsListResponse;
  446. Function List(siteUrl: string; AQuery : TSitemapslistOptions) : TSitemapsListResponse;
  447. Procedure Submit(feedpath: string; siteUrl: string);
  448. end;
  449. { --------------------------------------------------------------------
  450. TSitesResource
  451. --------------------------------------------------------------------}
  452. TSitesResource = Class(TGoogleResource)
  453. Public
  454. Class Function ResourceName : String; override;
  455. Class Function DefaultAPI : TGoogleAPIClass; override;
  456. Procedure Add(siteUrl: string);
  457. Procedure Delete(siteUrl: string);
  458. Function Get(siteUrl: string) : TWmxSite;
  459. Function List : TSitesListResponse;
  460. end;
  461. { --------------------------------------------------------------------
  462. TUrlcrawlerrorscountsResource
  463. --------------------------------------------------------------------}
  464. //Optional query Options for TUrlcrawlerrorscountsResource, method Query
  465. TUrlcrawlerrorscountsQueryOptions = Record
  466. category : String;
  467. latestCountsOnly : boolean;
  468. platform : String;
  469. end;
  470. TUrlcrawlerrorscountsResource = Class(TGoogleResource)
  471. Public
  472. Class Function ResourceName : String; override;
  473. Class Function DefaultAPI : TGoogleAPIClass; override;
  474. Function Query(siteUrl: string; AQuery : string = '') : TUrlCrawlErrorsCountsQueryResponse;
  475. Function Query(siteUrl: string; AQuery : TUrlcrawlerrorscountsqueryOptions) : TUrlCrawlErrorsCountsQueryResponse;
  476. end;
  477. { --------------------------------------------------------------------
  478. TUrlcrawlerrorssamplesResource
  479. --------------------------------------------------------------------}
  480. //Optional query Options for TUrlcrawlerrorssamplesResource, method Get
  481. TUrlcrawlerrorssamplesGetOptions = Record
  482. category : String;
  483. platform : String;
  484. end;
  485. //Optional query Options for TUrlcrawlerrorssamplesResource, method List
  486. TUrlcrawlerrorssamplesListOptions = Record
  487. category : String;
  488. platform : String;
  489. end;
  490. //Optional query Options for TUrlcrawlerrorssamplesResource, method MarkAsFixed
  491. TUrlcrawlerrorssamplesMarkAsFixedOptions = Record
  492. category : String;
  493. platform : String;
  494. end;
  495. TUrlcrawlerrorssamplesResource = Class(TGoogleResource)
  496. Public
  497. Class Function ResourceName : String; override;
  498. Class Function DefaultAPI : TGoogleAPIClass; override;
  499. Function Get(siteUrl: string; url: string; AQuery : string = '') : TUrlCrawlErrorsSample;
  500. Function Get(siteUrl: string; url: string; AQuery : TUrlcrawlerrorssamplesgetOptions) : TUrlCrawlErrorsSample;
  501. Function List(siteUrl: string; AQuery : string = '') : TUrlCrawlErrorsSamplesListResponse;
  502. Function List(siteUrl: string; AQuery : TUrlcrawlerrorssampleslistOptions) : TUrlCrawlErrorsSamplesListResponse;
  503. Procedure MarkAsFixed(siteUrl: string; url: string; AQuery : string = '');
  504. Procedure MarkAsFixed(siteUrl: string; url: string; AQuery : TUrlcrawlerrorssamplesmarkAsFixedOptions);
  505. end;
  506. { --------------------------------------------------------------------
  507. TWebmastersAPI
  508. --------------------------------------------------------------------}
  509. TWebmastersAPI = Class(TGoogleAPI)
  510. Private
  511. FSearchanalyticsInstance : TSearchanalyticsResource;
  512. FSitemapsInstance : TSitemapsResource;
  513. FSitesInstance : TSitesResource;
  514. FUrlcrawlerrorscountsInstance : TUrlcrawlerrorscountsResource;
  515. FUrlcrawlerrorssamplesInstance : TUrlcrawlerrorssamplesResource;
  516. Function GetSearchanalyticsInstance : TSearchanalyticsResource;virtual;
  517. Function GetSitemapsInstance : TSitemapsResource;virtual;
  518. Function GetSitesInstance : TSitesResource;virtual;
  519. Function GetUrlcrawlerrorscountsInstance : TUrlcrawlerrorscountsResource;virtual;
  520. Function GetUrlcrawlerrorssamplesInstance : TUrlcrawlerrorssamplesResource;virtual;
  521. Public
  522. //Override class functions with API info
  523. Class Function APIName : String; override;
  524. Class Function APIVersion : String; override;
  525. Class Function APIRevision : String; override;
  526. Class Function APIID : String; override;
  527. Class Function APITitle : String; override;
  528. Class Function APIDescription : String; override;
  529. Class Function APIOwnerDomain : String; override;
  530. Class Function APIOwnerName : String; override;
  531. Class Function APIIcon16 : String; override;
  532. Class Function APIIcon32 : String; override;
  533. Class Function APIdocumentationLink : String; override;
  534. Class Function APIrootUrl : string; override;
  535. Class Function APIbasePath : string;override;
  536. Class Function APIbaseURL : String;override;
  537. Class Function APIProtocol : string;override;
  538. Class Function APIservicePath : string;override;
  539. Class Function APIbatchPath : String;override;
  540. Class Function APIAuthScopes : TScopeInfoArray;override;
  541. Class Function APINeedsAuth : Boolean;override;
  542. Class Procedure RegisterAPIResources; override;
  543. //Add create function for resources
  544. Function CreateSearchanalyticsResource(AOwner : TComponent) : TSearchanalyticsResource;virtual;overload;
  545. Function CreateSearchanalyticsResource : TSearchanalyticsResource;virtual;overload;
  546. Function CreateSitemapsResource(AOwner : TComponent) : TSitemapsResource;virtual;overload;
  547. Function CreateSitemapsResource : TSitemapsResource;virtual;overload;
  548. Function CreateSitesResource(AOwner : TComponent) : TSitesResource;virtual;overload;
  549. Function CreateSitesResource : TSitesResource;virtual;overload;
  550. Function CreateUrlcrawlerrorscountsResource(AOwner : TComponent) : TUrlcrawlerrorscountsResource;virtual;overload;
  551. Function CreateUrlcrawlerrorscountsResource : TUrlcrawlerrorscountsResource;virtual;overload;
  552. Function CreateUrlcrawlerrorssamplesResource(AOwner : TComponent) : TUrlcrawlerrorssamplesResource;virtual;overload;
  553. Function CreateUrlcrawlerrorssamplesResource : TUrlcrawlerrorssamplesResource;virtual;overload;
  554. //Add default on-demand instances for resources
  555. Property SearchanalyticsResource : TSearchanalyticsResource Read GetSearchanalyticsInstance;
  556. Property SitemapsResource : TSitemapsResource Read GetSitemapsInstance;
  557. Property SitesResource : TSitesResource Read GetSitesInstance;
  558. Property UrlcrawlerrorscountsResource : TUrlcrawlerrorscountsResource Read GetUrlcrawlerrorscountsInstance;
  559. Property UrlcrawlerrorssamplesResource : TUrlcrawlerrorssamplesResource Read GetUrlcrawlerrorssamplesInstance;
  560. end;
  561. implementation
  562. { --------------------------------------------------------------------
  563. TApiDataRow
  564. --------------------------------------------------------------------}
  565. Procedure TApiDataRow.Setclicks(AIndex : Integer; const AValue : double);
  566. begin
  567. If (Fclicks=AValue) then exit;
  568. Fclicks:=AValue;
  569. MarkPropertyChanged(AIndex);
  570. end;
  571. Procedure TApiDataRow.Setctr(AIndex : Integer; const AValue : double);
  572. begin
  573. If (Fctr=AValue) then exit;
  574. Fctr:=AValue;
  575. MarkPropertyChanged(AIndex);
  576. end;
  577. Procedure TApiDataRow.Setimpressions(AIndex : Integer; const AValue : double);
  578. begin
  579. If (Fimpressions=AValue) then exit;
  580. Fimpressions:=AValue;
  581. MarkPropertyChanged(AIndex);
  582. end;
  583. Procedure TApiDataRow.Setkeys(AIndex : Integer; const AValue : TStringArray);
  584. begin
  585. If (Fkeys=AValue) then exit;
  586. Fkeys:=AValue;
  587. MarkPropertyChanged(AIndex);
  588. end;
  589. Procedure TApiDataRow.Setposition(AIndex : Integer; const AValue : double);
  590. begin
  591. If (Fposition=AValue) then exit;
  592. Fposition:=AValue;
  593. MarkPropertyChanged(AIndex);
  594. end;
  595. //2.6.4. bug workaround
  596. {$IFDEF VER2_6}
  597. Procedure TApiDataRow.SetArrayLength(Const AName : String; ALength : Longint);
  598. begin
  599. Case AName of
  600. 'keys' : SetLength(Fkeys,ALength);
  601. else
  602. Inherited SetArrayLength(AName,ALength);
  603. end;
  604. end;
  605. {$ENDIF VER2_6}
  606. { --------------------------------------------------------------------
  607. TApiDimensionFilter
  608. --------------------------------------------------------------------}
  609. Procedure TApiDimensionFilter.Setdimension(AIndex : Integer; const AValue : String);
  610. begin
  611. If (Fdimension=AValue) then exit;
  612. Fdimension:=AValue;
  613. MarkPropertyChanged(AIndex);
  614. end;
  615. Procedure TApiDimensionFilter.Setexpression(AIndex : Integer; const AValue : String);
  616. begin
  617. If (Fexpression=AValue) then exit;
  618. Fexpression:=AValue;
  619. MarkPropertyChanged(AIndex);
  620. end;
  621. Procedure TApiDimensionFilter.Set_operator(AIndex : Integer; const AValue : String);
  622. begin
  623. If (F_operator=AValue) then exit;
  624. F_operator:=AValue;
  625. MarkPropertyChanged(AIndex);
  626. end;
  627. Class Function TApiDimensionFilter.ExportPropertyName(Const AName : String) :String;
  628. begin
  629. Case AName of
  630. '_operator' : Result:='operator';
  631. else
  632. Result:=Inherited ExportPropertyName(AName);
  633. end;
  634. end;
  635. { --------------------------------------------------------------------
  636. TApiDimensionFilterGroup
  637. --------------------------------------------------------------------}
  638. Procedure TApiDimensionFilterGroup.Setfilters(AIndex : Integer; const AValue : TApiDimensionFilterGroupTypefiltersArray);
  639. begin
  640. If (Ffilters=AValue) then exit;
  641. Ffilters:=AValue;
  642. MarkPropertyChanged(AIndex);
  643. end;
  644. Procedure TApiDimensionFilterGroup.SetgroupType(AIndex : Integer; const AValue : String);
  645. begin
  646. If (FgroupType=AValue) then exit;
  647. FgroupType:=AValue;
  648. MarkPropertyChanged(AIndex);
  649. end;
  650. //2.6.4. bug workaround
  651. {$IFDEF VER2_6}
  652. Procedure TApiDimensionFilterGroup.SetArrayLength(Const AName : String; ALength : Longint);
  653. begin
  654. Case AName of
  655. 'filters' : SetLength(Ffilters,ALength);
  656. else
  657. Inherited SetArrayLength(AName,ALength);
  658. end;
  659. end;
  660. {$ENDIF VER2_6}
  661. { --------------------------------------------------------------------
  662. TSearchAnalyticsQueryRequest
  663. --------------------------------------------------------------------}
  664. Procedure TSearchAnalyticsQueryRequest.SetaggregationType(AIndex : Integer; const AValue : String);
  665. begin
  666. If (FaggregationType=AValue) then exit;
  667. FaggregationType:=AValue;
  668. MarkPropertyChanged(AIndex);
  669. end;
  670. Procedure TSearchAnalyticsQueryRequest.SetdimensionFilterGroups(AIndex : Integer; const AValue : TSearchAnalyticsQueryRequestTypedimensionFilterGroupsArray);
  671. begin
  672. If (FdimensionFilterGroups=AValue) then exit;
  673. FdimensionFilterGroups:=AValue;
  674. MarkPropertyChanged(AIndex);
  675. end;
  676. Procedure TSearchAnalyticsQueryRequest.Setdimensions(AIndex : Integer; const AValue : TStringArray);
  677. begin
  678. If (Fdimensions=AValue) then exit;
  679. Fdimensions:=AValue;
  680. MarkPropertyChanged(AIndex);
  681. end;
  682. Procedure TSearchAnalyticsQueryRequest.SetendDate(AIndex : Integer; const AValue : String);
  683. begin
  684. If (FendDate=AValue) then exit;
  685. FendDate:=AValue;
  686. MarkPropertyChanged(AIndex);
  687. end;
  688. Procedure TSearchAnalyticsQueryRequest.SetrowLimit(AIndex : Integer; const AValue : integer);
  689. begin
  690. If (FrowLimit=AValue) then exit;
  691. FrowLimit:=AValue;
  692. MarkPropertyChanged(AIndex);
  693. end;
  694. Procedure TSearchAnalyticsQueryRequest.SetsearchType(AIndex : Integer; const AValue : String);
  695. begin
  696. If (FsearchType=AValue) then exit;
  697. FsearchType:=AValue;
  698. MarkPropertyChanged(AIndex);
  699. end;
  700. Procedure TSearchAnalyticsQueryRequest.SetstartDate(AIndex : Integer; const AValue : String);
  701. begin
  702. If (FstartDate=AValue) then exit;
  703. FstartDate:=AValue;
  704. MarkPropertyChanged(AIndex);
  705. end;
  706. Procedure TSearchAnalyticsQueryRequest.SetstartRow(AIndex : Integer; const AValue : integer);
  707. begin
  708. If (FstartRow=AValue) then exit;
  709. FstartRow:=AValue;
  710. MarkPropertyChanged(AIndex);
  711. end;
  712. //2.6.4. bug workaround
  713. {$IFDEF VER2_6}
  714. Procedure TSearchAnalyticsQueryRequest.SetArrayLength(Const AName : String; ALength : Longint);
  715. begin
  716. Case AName of
  717. 'dimensionfiltergroups' : SetLength(FdimensionFilterGroups,ALength);
  718. 'dimensions' : SetLength(Fdimensions,ALength);
  719. else
  720. Inherited SetArrayLength(AName,ALength);
  721. end;
  722. end;
  723. {$ENDIF VER2_6}
  724. { --------------------------------------------------------------------
  725. TSearchAnalyticsQueryResponse
  726. --------------------------------------------------------------------}
  727. Procedure TSearchAnalyticsQueryResponse.SetresponseAggregationType(AIndex : Integer; const AValue : String);
  728. begin
  729. If (FresponseAggregationType=AValue) then exit;
  730. FresponseAggregationType:=AValue;
  731. MarkPropertyChanged(AIndex);
  732. end;
  733. Procedure TSearchAnalyticsQueryResponse.Setrows(AIndex : Integer; const AValue : TSearchAnalyticsQueryResponseTyperowsArray);
  734. begin
  735. If (Frows=AValue) then exit;
  736. Frows:=AValue;
  737. MarkPropertyChanged(AIndex);
  738. end;
  739. //2.6.4. bug workaround
  740. {$IFDEF VER2_6}
  741. Procedure TSearchAnalyticsQueryResponse.SetArrayLength(Const AName : String; ALength : Longint);
  742. begin
  743. Case AName of
  744. 'rows' : SetLength(Frows,ALength);
  745. else
  746. Inherited SetArrayLength(AName,ALength);
  747. end;
  748. end;
  749. {$ENDIF VER2_6}
  750. { --------------------------------------------------------------------
  751. TSitemapsListResponse
  752. --------------------------------------------------------------------}
  753. Procedure TSitemapsListResponse.Setsitemap(AIndex : Integer; const AValue : TSitemapsListResponseTypesitemapArray);
  754. begin
  755. If (Fsitemap=AValue) then exit;
  756. Fsitemap:=AValue;
  757. MarkPropertyChanged(AIndex);
  758. end;
  759. //2.6.4. bug workaround
  760. {$IFDEF VER2_6}
  761. Procedure TSitemapsListResponse.SetArrayLength(Const AName : String; ALength : Longint);
  762. begin
  763. Case AName of
  764. 'sitemap' : SetLength(Fsitemap,ALength);
  765. else
  766. Inherited SetArrayLength(AName,ALength);
  767. end;
  768. end;
  769. {$ENDIF VER2_6}
  770. { --------------------------------------------------------------------
  771. TSitesListResponse
  772. --------------------------------------------------------------------}
  773. Procedure TSitesListResponse.SetsiteEntry(AIndex : Integer; const AValue : TSitesListResponseTypesiteEntryArray);
  774. begin
  775. If (FsiteEntry=AValue) then exit;
  776. FsiteEntry:=AValue;
  777. MarkPropertyChanged(AIndex);
  778. end;
  779. //2.6.4. bug workaround
  780. {$IFDEF VER2_6}
  781. Procedure TSitesListResponse.SetArrayLength(Const AName : String; ALength : Longint);
  782. begin
  783. Case AName of
  784. 'siteentry' : SetLength(FsiteEntry,ALength);
  785. else
  786. Inherited SetArrayLength(AName,ALength);
  787. end;
  788. end;
  789. {$ENDIF VER2_6}
  790. { --------------------------------------------------------------------
  791. TUrlCrawlErrorCount
  792. --------------------------------------------------------------------}
  793. Procedure TUrlCrawlErrorCount.Setcount(AIndex : Integer; const AValue : String);
  794. begin
  795. If (Fcount=AValue) then exit;
  796. Fcount:=AValue;
  797. MarkPropertyChanged(AIndex);
  798. end;
  799. Procedure TUrlCrawlErrorCount.Settimestamp(AIndex : Integer; const AValue : TDatetime);
  800. begin
  801. If (Ftimestamp=AValue) then exit;
  802. Ftimestamp:=AValue;
  803. MarkPropertyChanged(AIndex);
  804. end;
  805. { --------------------------------------------------------------------
  806. TUrlCrawlErrorCountsPerType
  807. --------------------------------------------------------------------}
  808. Procedure TUrlCrawlErrorCountsPerType.Setcategory(AIndex : Integer; const AValue : String);
  809. begin
  810. If (Fcategory=AValue) then exit;
  811. Fcategory:=AValue;
  812. MarkPropertyChanged(AIndex);
  813. end;
  814. Procedure TUrlCrawlErrorCountsPerType.Setentries(AIndex : Integer; const AValue : TUrlCrawlErrorCountsPerTypeTypeentriesArray);
  815. begin
  816. If (Fentries=AValue) then exit;
  817. Fentries:=AValue;
  818. MarkPropertyChanged(AIndex);
  819. end;
  820. Procedure TUrlCrawlErrorCountsPerType.Setplatform(AIndex : Integer; const AValue : String);
  821. begin
  822. If (Fplatform=AValue) then exit;
  823. Fplatform:=AValue;
  824. MarkPropertyChanged(AIndex);
  825. end;
  826. //2.6.4. bug workaround
  827. {$IFDEF VER2_6}
  828. Procedure TUrlCrawlErrorCountsPerType.SetArrayLength(Const AName : String; ALength : Longint);
  829. begin
  830. Case AName of
  831. 'entries' : SetLength(Fentries,ALength);
  832. else
  833. Inherited SetArrayLength(AName,ALength);
  834. end;
  835. end;
  836. {$ENDIF VER2_6}
  837. { --------------------------------------------------------------------
  838. TUrlCrawlErrorsCountsQueryResponse
  839. --------------------------------------------------------------------}
  840. Procedure TUrlCrawlErrorsCountsQueryResponse.SetcountPerTypes(AIndex : Integer; const AValue : TUrlCrawlErrorsCountsQueryResponseTypecountPerTypesArray);
  841. begin
  842. If (FcountPerTypes=AValue) then exit;
  843. FcountPerTypes:=AValue;
  844. MarkPropertyChanged(AIndex);
  845. end;
  846. //2.6.4. bug workaround
  847. {$IFDEF VER2_6}
  848. Procedure TUrlCrawlErrorsCountsQueryResponse.SetArrayLength(Const AName : String; ALength : Longint);
  849. begin
  850. Case AName of
  851. 'countpertypes' : SetLength(FcountPerTypes,ALength);
  852. else
  853. Inherited SetArrayLength(AName,ALength);
  854. end;
  855. end;
  856. {$ENDIF VER2_6}
  857. { --------------------------------------------------------------------
  858. TUrlCrawlErrorsSample
  859. --------------------------------------------------------------------}
  860. Procedure TUrlCrawlErrorsSample.Setfirst_detected(AIndex : Integer; const AValue : TDatetime);
  861. begin
  862. If (Ffirst_detected=AValue) then exit;
  863. Ffirst_detected:=AValue;
  864. MarkPropertyChanged(AIndex);
  865. end;
  866. Procedure TUrlCrawlErrorsSample.Setlast_crawled(AIndex : Integer; const AValue : TDatetime);
  867. begin
  868. If (Flast_crawled=AValue) then exit;
  869. Flast_crawled:=AValue;
  870. MarkPropertyChanged(AIndex);
  871. end;
  872. Procedure TUrlCrawlErrorsSample.SetpageUrl(AIndex : Integer; const AValue : String);
  873. begin
  874. If (FpageUrl=AValue) then exit;
  875. FpageUrl:=AValue;
  876. MarkPropertyChanged(AIndex);
  877. end;
  878. Procedure TUrlCrawlErrorsSample.SetresponseCode(AIndex : Integer; const AValue : integer);
  879. begin
  880. If (FresponseCode=AValue) then exit;
  881. FresponseCode:=AValue;
  882. MarkPropertyChanged(AIndex);
  883. end;
  884. Procedure TUrlCrawlErrorsSample.SeturlDetails(AIndex : Integer; const AValue : TUrlSampleDetails);
  885. begin
  886. If (FurlDetails=AValue) then exit;
  887. FurlDetails:=AValue;
  888. MarkPropertyChanged(AIndex);
  889. end;
  890. { --------------------------------------------------------------------
  891. TUrlCrawlErrorsSamplesListResponse
  892. --------------------------------------------------------------------}
  893. Procedure TUrlCrawlErrorsSamplesListResponse.SeturlCrawlErrorSample(AIndex : Integer; const AValue : TUrlCrawlErrorsSamplesListResponseTypeurlCrawlErrorSampleArray);
  894. begin
  895. If (FurlCrawlErrorSample=AValue) then exit;
  896. FurlCrawlErrorSample:=AValue;
  897. MarkPropertyChanged(AIndex);
  898. end;
  899. //2.6.4. bug workaround
  900. {$IFDEF VER2_6}
  901. Procedure TUrlCrawlErrorsSamplesListResponse.SetArrayLength(Const AName : String; ALength : Longint);
  902. begin
  903. Case AName of
  904. 'urlcrawlerrorsample' : SetLength(FurlCrawlErrorSample,ALength);
  905. else
  906. Inherited SetArrayLength(AName,ALength);
  907. end;
  908. end;
  909. {$ENDIF VER2_6}
  910. { --------------------------------------------------------------------
  911. TUrlSampleDetails
  912. --------------------------------------------------------------------}
  913. Procedure TUrlSampleDetails.SetcontainingSitemaps(AIndex : Integer; const AValue : TStringArray);
  914. begin
  915. If (FcontainingSitemaps=AValue) then exit;
  916. FcontainingSitemaps:=AValue;
  917. MarkPropertyChanged(AIndex);
  918. end;
  919. Procedure TUrlSampleDetails.SetlinkedFromUrls(AIndex : Integer; const AValue : TStringArray);
  920. begin
  921. If (FlinkedFromUrls=AValue) then exit;
  922. FlinkedFromUrls:=AValue;
  923. MarkPropertyChanged(AIndex);
  924. end;
  925. //2.6.4. bug workaround
  926. {$IFDEF VER2_6}
  927. Procedure TUrlSampleDetails.SetArrayLength(Const AName : String; ALength : Longint);
  928. begin
  929. Case AName of
  930. 'containingsitemaps' : SetLength(FcontainingSitemaps,ALength);
  931. 'linkedfromurls' : SetLength(FlinkedFromUrls,ALength);
  932. else
  933. Inherited SetArrayLength(AName,ALength);
  934. end;
  935. end;
  936. {$ENDIF VER2_6}
  937. { --------------------------------------------------------------------
  938. TWmxSite
  939. --------------------------------------------------------------------}
  940. Procedure TWmxSite.SetpermissionLevel(AIndex : Integer; const AValue : String);
  941. begin
  942. If (FpermissionLevel=AValue) then exit;
  943. FpermissionLevel:=AValue;
  944. MarkPropertyChanged(AIndex);
  945. end;
  946. Procedure TWmxSite.SetsiteUrl(AIndex : Integer; const AValue : String);
  947. begin
  948. If (FsiteUrl=AValue) then exit;
  949. FsiteUrl:=AValue;
  950. MarkPropertyChanged(AIndex);
  951. end;
  952. { --------------------------------------------------------------------
  953. TWmxSitemap
  954. --------------------------------------------------------------------}
  955. Procedure TWmxSitemap.Setcontents(AIndex : Integer; const AValue : TWmxSitemapTypecontentsArray);
  956. begin
  957. If (Fcontents=AValue) then exit;
  958. Fcontents:=AValue;
  959. MarkPropertyChanged(AIndex);
  960. end;
  961. Procedure TWmxSitemap.Seterrors(AIndex : Integer; const AValue : String);
  962. begin
  963. If (Ferrors=AValue) then exit;
  964. Ferrors:=AValue;
  965. MarkPropertyChanged(AIndex);
  966. end;
  967. Procedure TWmxSitemap.SetisPending(AIndex : Integer; const AValue : boolean);
  968. begin
  969. If (FisPending=AValue) then exit;
  970. FisPending:=AValue;
  971. MarkPropertyChanged(AIndex);
  972. end;
  973. Procedure TWmxSitemap.SetisSitemapsIndex(AIndex : Integer; const AValue : boolean);
  974. begin
  975. If (FisSitemapsIndex=AValue) then exit;
  976. FisSitemapsIndex:=AValue;
  977. MarkPropertyChanged(AIndex);
  978. end;
  979. Procedure TWmxSitemap.SetlastDownloaded(AIndex : Integer; const AValue : TDatetime);
  980. begin
  981. If (FlastDownloaded=AValue) then exit;
  982. FlastDownloaded:=AValue;
  983. MarkPropertyChanged(AIndex);
  984. end;
  985. Procedure TWmxSitemap.SetlastSubmitted(AIndex : Integer; const AValue : TDatetime);
  986. begin
  987. If (FlastSubmitted=AValue) then exit;
  988. FlastSubmitted:=AValue;
  989. MarkPropertyChanged(AIndex);
  990. end;
  991. Procedure TWmxSitemap.Setpath(AIndex : Integer; const AValue : String);
  992. begin
  993. If (Fpath=AValue) then exit;
  994. Fpath:=AValue;
  995. MarkPropertyChanged(AIndex);
  996. end;
  997. Procedure TWmxSitemap.Set_type(AIndex : Integer; const AValue : String);
  998. begin
  999. If (F_type=AValue) then exit;
  1000. F_type:=AValue;
  1001. MarkPropertyChanged(AIndex);
  1002. end;
  1003. Procedure TWmxSitemap.Setwarnings(AIndex : Integer; const AValue : String);
  1004. begin
  1005. If (Fwarnings=AValue) then exit;
  1006. Fwarnings:=AValue;
  1007. MarkPropertyChanged(AIndex);
  1008. end;
  1009. Class Function TWmxSitemap.ExportPropertyName(Const AName : String) :String;
  1010. begin
  1011. Case AName of
  1012. '_type' : Result:='type';
  1013. else
  1014. Result:=Inherited ExportPropertyName(AName);
  1015. end;
  1016. end;
  1017. //2.6.4. bug workaround
  1018. {$IFDEF VER2_6}
  1019. Procedure TWmxSitemap.SetArrayLength(Const AName : String; ALength : Longint);
  1020. begin
  1021. Case AName of
  1022. 'contents' : SetLength(Fcontents,ALength);
  1023. else
  1024. Inherited SetArrayLength(AName,ALength);
  1025. end;
  1026. end;
  1027. {$ENDIF VER2_6}
  1028. { --------------------------------------------------------------------
  1029. TWmxSitemapContent
  1030. --------------------------------------------------------------------}
  1031. Procedure TWmxSitemapContent.Setindexed(AIndex : Integer; const AValue : String);
  1032. begin
  1033. If (Findexed=AValue) then exit;
  1034. Findexed:=AValue;
  1035. MarkPropertyChanged(AIndex);
  1036. end;
  1037. Procedure TWmxSitemapContent.Setsubmitted(AIndex : Integer; const AValue : String);
  1038. begin
  1039. If (Fsubmitted=AValue) then exit;
  1040. Fsubmitted:=AValue;
  1041. MarkPropertyChanged(AIndex);
  1042. end;
  1043. Procedure TWmxSitemapContent.Set_type(AIndex : Integer; const AValue : String);
  1044. begin
  1045. If (F_type=AValue) then exit;
  1046. F_type:=AValue;
  1047. MarkPropertyChanged(AIndex);
  1048. end;
  1049. Class Function TWmxSitemapContent.ExportPropertyName(Const AName : String) :String;
  1050. begin
  1051. Case AName of
  1052. '_type' : Result:='type';
  1053. else
  1054. Result:=Inherited ExportPropertyName(AName);
  1055. end;
  1056. end;
  1057. { --------------------------------------------------------------------
  1058. TSearchanalyticsResource
  1059. --------------------------------------------------------------------}
  1060. Class Function TSearchanalyticsResource.ResourceName : String;
  1061. begin
  1062. Result:='searchanalytics';
  1063. end;
  1064. Class Function TSearchanalyticsResource.DefaultAPI : TGoogleAPIClass;
  1065. begin
  1066. Result:=TwebmastersAPI;
  1067. end;
  1068. Function TSearchanalyticsResource.Query(siteUrl: string; aSearchAnalyticsQueryRequest : TSearchAnalyticsQueryRequest) : TSearchAnalyticsQueryResponse;
  1069. Const
  1070. _HTTPMethod = 'POST';
  1071. _Path = 'sites/{siteUrl}/searchAnalytics/query';
  1072. _Methodid = 'webmasters.searchanalytics.query';
  1073. Var
  1074. _P : String;
  1075. begin
  1076. _P:=SubstitutePath(_Path,['siteUrl',siteUrl]);
  1077. Result:=ServiceCall(_HTTPMethod,_P,'',aSearchAnalyticsQueryRequest,TSearchAnalyticsQueryResponse) as TSearchAnalyticsQueryResponse;
  1078. end;
  1079. { --------------------------------------------------------------------
  1080. TSitemapsResource
  1081. --------------------------------------------------------------------}
  1082. Class Function TSitemapsResource.ResourceName : String;
  1083. begin
  1084. Result:='sitemaps';
  1085. end;
  1086. Class Function TSitemapsResource.DefaultAPI : TGoogleAPIClass;
  1087. begin
  1088. Result:=TwebmastersAPI;
  1089. end;
  1090. Procedure TSitemapsResource.Delete(feedpath: string; siteUrl: string);
  1091. Const
  1092. _HTTPMethod = 'DELETE';
  1093. _Path = 'sites/{siteUrl}/sitemaps/{feedpath}';
  1094. _Methodid = 'webmasters.sitemaps.delete';
  1095. Var
  1096. _P : String;
  1097. begin
  1098. _P:=SubstitutePath(_Path,['feedpath',feedpath,'siteUrl',siteUrl]);
  1099. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  1100. end;
  1101. Function TSitemapsResource.Get(feedpath: string; siteUrl: string) : TWmxSitemap;
  1102. Const
  1103. _HTTPMethod = 'GET';
  1104. _Path = 'sites/{siteUrl}/sitemaps/{feedpath}';
  1105. _Methodid = 'webmasters.sitemaps.get';
  1106. Var
  1107. _P : String;
  1108. begin
  1109. _P:=SubstitutePath(_Path,['feedpath',feedpath,'siteUrl',siteUrl]);
  1110. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TWmxSitemap) as TWmxSitemap;
  1111. end;
  1112. Function TSitemapsResource.List(siteUrl: string; AQuery : string = '') : TSitemapsListResponse;
  1113. Const
  1114. _HTTPMethod = 'GET';
  1115. _Path = 'sites/{siteUrl}/sitemaps';
  1116. _Methodid = 'webmasters.sitemaps.list';
  1117. Var
  1118. _P : String;
  1119. begin
  1120. _P:=SubstitutePath(_Path,['siteUrl',siteUrl]);
  1121. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TSitemapsListResponse) as TSitemapsListResponse;
  1122. end;
  1123. Function TSitemapsResource.List(siteUrl: string; AQuery : TSitemapslistOptions) : TSitemapsListResponse;
  1124. Var
  1125. _Q : String;
  1126. begin
  1127. _Q:='';
  1128. AddToQuery(_Q,'sitemapIndex',AQuery.sitemapIndex);
  1129. Result:=List(siteUrl,_Q);
  1130. end;
  1131. Procedure TSitemapsResource.Submit(feedpath: string; siteUrl: string);
  1132. Const
  1133. _HTTPMethod = 'PUT';
  1134. _Path = 'sites/{siteUrl}/sitemaps/{feedpath}';
  1135. _Methodid = 'webmasters.sitemaps.submit';
  1136. Var
  1137. _P : String;
  1138. begin
  1139. _P:=SubstitutePath(_Path,['feedpath',feedpath,'siteUrl',siteUrl]);
  1140. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  1141. end;
  1142. { --------------------------------------------------------------------
  1143. TSitesResource
  1144. --------------------------------------------------------------------}
  1145. Class Function TSitesResource.ResourceName : String;
  1146. begin
  1147. Result:='sites';
  1148. end;
  1149. Class Function TSitesResource.DefaultAPI : TGoogleAPIClass;
  1150. begin
  1151. Result:=TwebmastersAPI;
  1152. end;
  1153. Procedure TSitesResource.Add(siteUrl: string);
  1154. Const
  1155. _HTTPMethod = 'PUT';
  1156. _Path = 'sites/{siteUrl}';
  1157. _Methodid = 'webmasters.sites.add';
  1158. Var
  1159. _P : String;
  1160. begin
  1161. _P:=SubstitutePath(_Path,['siteUrl',siteUrl]);
  1162. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  1163. end;
  1164. Procedure TSitesResource.Delete(siteUrl: string);
  1165. Const
  1166. _HTTPMethod = 'DELETE';
  1167. _Path = 'sites/{siteUrl}';
  1168. _Methodid = 'webmasters.sites.delete';
  1169. Var
  1170. _P : String;
  1171. begin
  1172. _P:=SubstitutePath(_Path,['siteUrl',siteUrl]);
  1173. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  1174. end;
  1175. Function TSitesResource.Get(siteUrl: string) : TWmxSite;
  1176. Const
  1177. _HTTPMethod = 'GET';
  1178. _Path = 'sites/{siteUrl}';
  1179. _Methodid = 'webmasters.sites.get';
  1180. Var
  1181. _P : String;
  1182. begin
  1183. _P:=SubstitutePath(_Path,['siteUrl',siteUrl]);
  1184. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TWmxSite) as TWmxSite;
  1185. end;
  1186. Function TSitesResource.List : TSitesListResponse;
  1187. Const
  1188. _HTTPMethod = 'GET';
  1189. _Path = 'sites';
  1190. _Methodid = 'webmasters.sites.list';
  1191. begin
  1192. Result:=ServiceCall(_HTTPMethod,_Path,'',Nil,TSitesListResponse) as TSitesListResponse;
  1193. end;
  1194. { --------------------------------------------------------------------
  1195. TUrlcrawlerrorscountsResource
  1196. --------------------------------------------------------------------}
  1197. Class Function TUrlcrawlerrorscountsResource.ResourceName : String;
  1198. begin
  1199. Result:='urlcrawlerrorscounts';
  1200. end;
  1201. Class Function TUrlcrawlerrorscountsResource.DefaultAPI : TGoogleAPIClass;
  1202. begin
  1203. Result:=TwebmastersAPI;
  1204. end;
  1205. Function TUrlcrawlerrorscountsResource.Query(siteUrl: string; AQuery : string = '') : TUrlCrawlErrorsCountsQueryResponse;
  1206. Const
  1207. _HTTPMethod = 'GET';
  1208. _Path = 'sites/{siteUrl}/urlCrawlErrorsCounts/query';
  1209. _Methodid = 'webmasters.urlcrawlerrorscounts.query';
  1210. Var
  1211. _P : String;
  1212. begin
  1213. _P:=SubstitutePath(_Path,['siteUrl',siteUrl]);
  1214. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TUrlCrawlErrorsCountsQueryResponse) as TUrlCrawlErrorsCountsQueryResponse;
  1215. end;
  1216. Function TUrlcrawlerrorscountsResource.Query(siteUrl: string; AQuery : TUrlcrawlerrorscountsqueryOptions) : TUrlCrawlErrorsCountsQueryResponse;
  1217. Var
  1218. _Q : String;
  1219. begin
  1220. _Q:='';
  1221. AddToQuery(_Q,'category',AQuery.category);
  1222. AddToQuery(_Q,'latestCountsOnly',AQuery.latestCountsOnly);
  1223. AddToQuery(_Q,'platform',AQuery.platform);
  1224. Result:=Query(siteUrl,_Q);
  1225. end;
  1226. { --------------------------------------------------------------------
  1227. TUrlcrawlerrorssamplesResource
  1228. --------------------------------------------------------------------}
  1229. Class Function TUrlcrawlerrorssamplesResource.ResourceName : String;
  1230. begin
  1231. Result:='urlcrawlerrorssamples';
  1232. end;
  1233. Class Function TUrlcrawlerrorssamplesResource.DefaultAPI : TGoogleAPIClass;
  1234. begin
  1235. Result:=TwebmastersAPI;
  1236. end;
  1237. Function TUrlcrawlerrorssamplesResource.Get(siteUrl: string; url: string; AQuery : string = '') : TUrlCrawlErrorsSample;
  1238. Const
  1239. _HTTPMethod = 'GET';
  1240. _Path = 'sites/{siteUrl}/urlCrawlErrorsSamples/{url}';
  1241. _Methodid = 'webmasters.urlcrawlerrorssamples.get';
  1242. Var
  1243. _P : String;
  1244. begin
  1245. _P:=SubstitutePath(_Path,['siteUrl',siteUrl,'url',url]);
  1246. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TUrlCrawlErrorsSample) as TUrlCrawlErrorsSample;
  1247. end;
  1248. Function TUrlcrawlerrorssamplesResource.Get(siteUrl: string; url: string; AQuery : TUrlcrawlerrorssamplesgetOptions) : TUrlCrawlErrorsSample;
  1249. Var
  1250. _Q : String;
  1251. begin
  1252. _Q:='';
  1253. AddToQuery(_Q,'category',AQuery.category);
  1254. AddToQuery(_Q,'platform',AQuery.platform);
  1255. Result:=Get(siteUrl,url,_Q);
  1256. end;
  1257. Function TUrlcrawlerrorssamplesResource.List(siteUrl: string; AQuery : string = '') : TUrlCrawlErrorsSamplesListResponse;
  1258. Const
  1259. _HTTPMethod = 'GET';
  1260. _Path = 'sites/{siteUrl}/urlCrawlErrorsSamples';
  1261. _Methodid = 'webmasters.urlcrawlerrorssamples.list';
  1262. Var
  1263. _P : String;
  1264. begin
  1265. _P:=SubstitutePath(_Path,['siteUrl',siteUrl]);
  1266. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TUrlCrawlErrorsSamplesListResponse) as TUrlCrawlErrorsSamplesListResponse;
  1267. end;
  1268. Function TUrlcrawlerrorssamplesResource.List(siteUrl: string; AQuery : TUrlcrawlerrorssampleslistOptions) : TUrlCrawlErrorsSamplesListResponse;
  1269. Var
  1270. _Q : String;
  1271. begin
  1272. _Q:='';
  1273. AddToQuery(_Q,'category',AQuery.category);
  1274. AddToQuery(_Q,'platform',AQuery.platform);
  1275. Result:=List(siteUrl,_Q);
  1276. end;
  1277. Procedure TUrlcrawlerrorssamplesResource.MarkAsFixed(siteUrl: string; url: string; AQuery : string = '');
  1278. Const
  1279. _HTTPMethod = 'DELETE';
  1280. _Path = 'sites/{siteUrl}/urlCrawlErrorsSamples/{url}';
  1281. _Methodid = 'webmasters.urlcrawlerrorssamples.markAsFixed';
  1282. Var
  1283. _P : String;
  1284. begin
  1285. _P:=SubstitutePath(_Path,['siteUrl',siteUrl,'url',url]);
  1286. ServiceCall(_HTTPMethod,_P,AQuery,Nil,Nil);
  1287. end;
  1288. Procedure TUrlcrawlerrorssamplesResource.MarkAsFixed(siteUrl: string; url: string; AQuery : TUrlcrawlerrorssamplesmarkAsFixedOptions);
  1289. Var
  1290. _Q : String;
  1291. begin
  1292. _Q:='';
  1293. AddToQuery(_Q,'category',AQuery.category);
  1294. AddToQuery(_Q,'platform',AQuery.platform);
  1295. MarkAsFixed(siteUrl,url,_Q);
  1296. end;
  1297. { --------------------------------------------------------------------
  1298. TWebmastersAPI
  1299. --------------------------------------------------------------------}
  1300. Class Function TWebmastersAPI.APIName : String;
  1301. begin
  1302. Result:='webmasters';
  1303. end;
  1304. Class Function TWebmastersAPI.APIVersion : String;
  1305. begin
  1306. Result:='v3';
  1307. end;
  1308. Class Function TWebmastersAPI.APIRevision : String;
  1309. begin
  1310. Result:='20160317';
  1311. end;
  1312. Class Function TWebmastersAPI.APIID : String;
  1313. begin
  1314. Result:='webmasters:v3';
  1315. end;
  1316. Class Function TWebmastersAPI.APITitle : String;
  1317. begin
  1318. Result:='Search Console API';
  1319. end;
  1320. Class Function TWebmastersAPI.APIDescription : String;
  1321. begin
  1322. Result:='View Google Search Console data for your verified sites.';
  1323. end;
  1324. Class Function TWebmastersAPI.APIOwnerDomain : String;
  1325. begin
  1326. Result:='google.com';
  1327. end;
  1328. Class Function TWebmastersAPI.APIOwnerName : String;
  1329. begin
  1330. Result:='Google';
  1331. end;
  1332. Class Function TWebmastersAPI.APIIcon16 : String;
  1333. begin
  1334. Result:='https://www.google.com/images/icons/product/webmaster_tools-16.png';
  1335. end;
  1336. Class Function TWebmastersAPI.APIIcon32 : String;
  1337. begin
  1338. Result:='https://www.google.com/images/icons/product/webmaster_tools-32.png';
  1339. end;
  1340. Class Function TWebmastersAPI.APIdocumentationLink : String;
  1341. begin
  1342. Result:='https://developers.google.com/webmaster-tools/';
  1343. end;
  1344. Class Function TWebmastersAPI.APIrootUrl : string;
  1345. begin
  1346. Result:='https://www.googleapis.com/';
  1347. end;
  1348. Class Function TWebmastersAPI.APIbasePath : string;
  1349. begin
  1350. Result:='/webmasters/v3/';
  1351. end;
  1352. Class Function TWebmastersAPI.APIbaseURL : String;
  1353. begin
  1354. Result:='https://www.googleapis.com/webmasters/v3/';
  1355. end;
  1356. Class Function TWebmastersAPI.APIProtocol : string;
  1357. begin
  1358. Result:='rest';
  1359. end;
  1360. Class Function TWebmastersAPI.APIservicePath : string;
  1361. begin
  1362. Result:='webmasters/v3/';
  1363. end;
  1364. Class Function TWebmastersAPI.APIbatchPath : String;
  1365. begin
  1366. Result:='batch';
  1367. end;
  1368. Class Function TWebmastersAPI.APIAuthScopes : TScopeInfoArray;
  1369. begin
  1370. SetLength(Result,2);
  1371. Result[0].Name:='https://www.googleapis.com/auth/webmasters';
  1372. Result[0].Description:='View and manage Search Console data for your verified sites';
  1373. Result[1].Name:='https://www.googleapis.com/auth/webmasters.readonly';
  1374. Result[1].Description:='View Search Console data for your verified sites';
  1375. end;
  1376. Class Function TWebmastersAPI.APINeedsAuth : Boolean;
  1377. begin
  1378. Result:=True;
  1379. end;
  1380. Class Procedure TWebmastersAPI.RegisterAPIResources;
  1381. begin
  1382. TApiDataRow.RegisterObject;
  1383. TApiDimensionFilter.RegisterObject;
  1384. TApiDimensionFilterGroup.RegisterObject;
  1385. TSearchAnalyticsQueryRequest.RegisterObject;
  1386. TSearchAnalyticsQueryResponse.RegisterObject;
  1387. TSitemapsListResponse.RegisterObject;
  1388. TSitesListResponse.RegisterObject;
  1389. TUrlCrawlErrorCount.RegisterObject;
  1390. TUrlCrawlErrorCountsPerType.RegisterObject;
  1391. TUrlCrawlErrorsCountsQueryResponse.RegisterObject;
  1392. TUrlCrawlErrorsSample.RegisterObject;
  1393. TUrlCrawlErrorsSamplesListResponse.RegisterObject;
  1394. TUrlSampleDetails.RegisterObject;
  1395. TWmxSite.RegisterObject;
  1396. TWmxSitemap.RegisterObject;
  1397. TWmxSitemapContent.RegisterObject;
  1398. end;
  1399. Function TWebmastersAPI.GetSearchanalyticsInstance : TSearchanalyticsResource;
  1400. begin
  1401. if (FSearchanalyticsInstance=Nil) then
  1402. FSearchanalyticsInstance:=CreateSearchanalyticsResource;
  1403. Result:=FSearchanalyticsInstance;
  1404. end;
  1405. Function TWebmastersAPI.CreateSearchanalyticsResource : TSearchanalyticsResource;
  1406. begin
  1407. Result:=CreateSearchanalyticsResource(Self);
  1408. end;
  1409. Function TWebmastersAPI.CreateSearchanalyticsResource(AOwner : TComponent) : TSearchanalyticsResource;
  1410. begin
  1411. Result:=TSearchanalyticsResource.Create(AOwner);
  1412. Result.API:=Self.API;
  1413. end;
  1414. Function TWebmastersAPI.GetSitemapsInstance : TSitemapsResource;
  1415. begin
  1416. if (FSitemapsInstance=Nil) then
  1417. FSitemapsInstance:=CreateSitemapsResource;
  1418. Result:=FSitemapsInstance;
  1419. end;
  1420. Function TWebmastersAPI.CreateSitemapsResource : TSitemapsResource;
  1421. begin
  1422. Result:=CreateSitemapsResource(Self);
  1423. end;
  1424. Function TWebmastersAPI.CreateSitemapsResource(AOwner : TComponent) : TSitemapsResource;
  1425. begin
  1426. Result:=TSitemapsResource.Create(AOwner);
  1427. Result.API:=Self.API;
  1428. end;
  1429. Function TWebmastersAPI.GetSitesInstance : TSitesResource;
  1430. begin
  1431. if (FSitesInstance=Nil) then
  1432. FSitesInstance:=CreateSitesResource;
  1433. Result:=FSitesInstance;
  1434. end;
  1435. Function TWebmastersAPI.CreateSitesResource : TSitesResource;
  1436. begin
  1437. Result:=CreateSitesResource(Self);
  1438. end;
  1439. Function TWebmastersAPI.CreateSitesResource(AOwner : TComponent) : TSitesResource;
  1440. begin
  1441. Result:=TSitesResource.Create(AOwner);
  1442. Result.API:=Self.API;
  1443. end;
  1444. Function TWebmastersAPI.GetUrlcrawlerrorscountsInstance : TUrlcrawlerrorscountsResource;
  1445. begin
  1446. if (FUrlcrawlerrorscountsInstance=Nil) then
  1447. FUrlcrawlerrorscountsInstance:=CreateUrlcrawlerrorscountsResource;
  1448. Result:=FUrlcrawlerrorscountsInstance;
  1449. end;
  1450. Function TWebmastersAPI.CreateUrlcrawlerrorscountsResource : TUrlcrawlerrorscountsResource;
  1451. begin
  1452. Result:=CreateUrlcrawlerrorscountsResource(Self);
  1453. end;
  1454. Function TWebmastersAPI.CreateUrlcrawlerrorscountsResource(AOwner : TComponent) : TUrlcrawlerrorscountsResource;
  1455. begin
  1456. Result:=TUrlcrawlerrorscountsResource.Create(AOwner);
  1457. Result.API:=Self.API;
  1458. end;
  1459. Function TWebmastersAPI.GetUrlcrawlerrorssamplesInstance : TUrlcrawlerrorssamplesResource;
  1460. begin
  1461. if (FUrlcrawlerrorssamplesInstance=Nil) then
  1462. FUrlcrawlerrorssamplesInstance:=CreateUrlcrawlerrorssamplesResource;
  1463. Result:=FUrlcrawlerrorssamplesInstance;
  1464. end;
  1465. Function TWebmastersAPI.CreateUrlcrawlerrorssamplesResource : TUrlcrawlerrorssamplesResource;
  1466. begin
  1467. Result:=CreateUrlcrawlerrorssamplesResource(Self);
  1468. end;
  1469. Function TWebmastersAPI.CreateUrlcrawlerrorssamplesResource(AOwner : TComponent) : TUrlcrawlerrorssamplesResource;
  1470. begin
  1471. Result:=TUrlcrawlerrorssamplesResource.Create(AOwner);
  1472. Result.API:=Self.API;
  1473. end;
  1474. initialization
  1475. TWebmastersAPI.RegisterAPI;
  1476. end.