googlesiteverification.pp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. unit googlesiteVerification;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TSiteVerificationWebResourceGettokenRequest = Class;
  9. TSiteVerificationWebResourceGettokenResponse = Class;
  10. TSiteVerificationWebResourceListResponse = Class;
  11. TSiteVerificationWebResourceResource = Class;
  12. TSiteVerificationWebResourceGettokenRequestArray = Array of TSiteVerificationWebResourceGettokenRequest;
  13. TSiteVerificationWebResourceGettokenResponseArray = Array of TSiteVerificationWebResourceGettokenResponse;
  14. TSiteVerificationWebResourceListResponseArray = Array of TSiteVerificationWebResourceListResponse;
  15. TSiteVerificationWebResourceResourceArray = Array of TSiteVerificationWebResourceResource;
  16. //Anonymous types, using auto-generated names
  17. TSiteVerificationWebResourceGettokenRequestTypesite = Class;
  18. TSiteVerificationWebResourceResourceTypesite = Class;
  19. TSiteVerificationWebResourceListResponseTypeitemsArray = Array of TSiteVerificationWebResourceResource;
  20. { --------------------------------------------------------------------
  21. TSiteVerificationWebResourceGettokenRequestTypesite
  22. --------------------------------------------------------------------}
  23. TSiteVerificationWebResourceGettokenRequestTypesite = Class(TGoogleBaseObject)
  24. Private
  25. Fidentifier : String;
  26. F_type : String;
  27. Protected
  28. Class Function ExportPropertyName(Const AName : String) : string; override;
  29. //Property setters
  30. Procedure Setidentifier(AIndex : Integer; const AValue : String); virtual;
  31. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  32. Public
  33. Published
  34. Property identifier : String Index 0 Read Fidentifier Write Setidentifier;
  35. Property _type : String Index 8 Read F_type Write Set_type;
  36. end;
  37. TSiteVerificationWebResourceGettokenRequestTypesiteClass = Class of TSiteVerificationWebResourceGettokenRequestTypesite;
  38. { --------------------------------------------------------------------
  39. TSiteVerificationWebResourceGettokenRequest
  40. --------------------------------------------------------------------}
  41. TSiteVerificationWebResourceGettokenRequest = Class(TGoogleBaseObject)
  42. Private
  43. Fsite : TSiteVerificationWebResourceGettokenRequestTypesite;
  44. FverificationMethod : String;
  45. Protected
  46. //Property setters
  47. Procedure Setsite(AIndex : Integer; const AValue : TSiteVerificationWebResourceGettokenRequestTypesite); virtual;
  48. Procedure SetverificationMethod(AIndex : Integer; const AValue : String); virtual;
  49. Public
  50. Published
  51. Property site : TSiteVerificationWebResourceGettokenRequestTypesite Index 0 Read Fsite Write Setsite;
  52. Property verificationMethod : String Index 8 Read FverificationMethod Write SetverificationMethod;
  53. end;
  54. TSiteVerificationWebResourceGettokenRequestClass = Class of TSiteVerificationWebResourceGettokenRequest;
  55. { --------------------------------------------------------------------
  56. TSiteVerificationWebResourceGettokenResponse
  57. --------------------------------------------------------------------}
  58. TSiteVerificationWebResourceGettokenResponse = Class(TGoogleBaseObject)
  59. Private
  60. Fmethod : String;
  61. Ftoken : String;
  62. Protected
  63. //Property setters
  64. Procedure Setmethod(AIndex : Integer; const AValue : String); virtual;
  65. Procedure Settoken(AIndex : Integer; const AValue : String); virtual;
  66. Public
  67. Published
  68. Property method : String Index 0 Read Fmethod Write Setmethod;
  69. Property token : String Index 8 Read Ftoken Write Settoken;
  70. end;
  71. TSiteVerificationWebResourceGettokenResponseClass = Class of TSiteVerificationWebResourceGettokenResponse;
  72. { --------------------------------------------------------------------
  73. TSiteVerificationWebResourceListResponse
  74. --------------------------------------------------------------------}
  75. TSiteVerificationWebResourceListResponse = Class(TGoogleBaseObject)
  76. Private
  77. Fitems : TSiteVerificationWebResourceListResponseTypeitemsArray;
  78. Protected
  79. //Property setters
  80. Procedure Setitems(AIndex : Integer; const AValue : TSiteVerificationWebResourceListResponseTypeitemsArray); virtual;
  81. //2.6.4. bug workaround
  82. {$IFDEF VER2_6}
  83. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  84. {$ENDIF VER2_6}
  85. Public
  86. Published
  87. Property items : TSiteVerificationWebResourceListResponseTypeitemsArray Index 0 Read Fitems Write Setitems;
  88. end;
  89. TSiteVerificationWebResourceListResponseClass = Class of TSiteVerificationWebResourceListResponse;
  90. { --------------------------------------------------------------------
  91. TSiteVerificationWebResourceResourceTypesite
  92. --------------------------------------------------------------------}
  93. TSiteVerificationWebResourceResourceTypesite = Class(TGoogleBaseObject)
  94. Private
  95. Fidentifier : String;
  96. F_type : String;
  97. Protected
  98. Class Function ExportPropertyName(Const AName : String) : string; override;
  99. //Property setters
  100. Procedure Setidentifier(AIndex : Integer; const AValue : String); virtual;
  101. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  102. Public
  103. Published
  104. Property identifier : String Index 0 Read Fidentifier Write Setidentifier;
  105. Property _type : String Index 8 Read F_type Write Set_type;
  106. end;
  107. TSiteVerificationWebResourceResourceTypesiteClass = Class of TSiteVerificationWebResourceResourceTypesite;
  108. { --------------------------------------------------------------------
  109. TSiteVerificationWebResourceResource
  110. --------------------------------------------------------------------}
  111. TSiteVerificationWebResourceResource = Class(TGoogleBaseObject)
  112. Private
  113. Fid : String;
  114. Fowners : TStringArray;
  115. Fsite : TSiteVerificationWebResourceResourceTypesite;
  116. Protected
  117. //Property setters
  118. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  119. Procedure Setowners(AIndex : Integer; const AValue : TStringArray); virtual;
  120. Procedure Setsite(AIndex : Integer; const AValue : TSiteVerificationWebResourceResourceTypesite); virtual;
  121. //2.6.4. bug workaround
  122. {$IFDEF VER2_6}
  123. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  124. {$ENDIF VER2_6}
  125. Public
  126. Published
  127. Property id : String Index 0 Read Fid Write Setid;
  128. Property owners : TStringArray Index 8 Read Fowners Write Setowners;
  129. Property site : TSiteVerificationWebResourceResourceTypesite Index 16 Read Fsite Write Setsite;
  130. end;
  131. TSiteVerificationWebResourceResourceClass = Class of TSiteVerificationWebResourceResource;
  132. { --------------------------------------------------------------------
  133. TWebResourceResource
  134. --------------------------------------------------------------------}
  135. //Optional query Options for TWebResourceResource, method Insert
  136. TWebResourceInsertOptions = Record
  137. verificationMethod : String;
  138. end;
  139. TWebResourceResource = Class(TGoogleResource)
  140. Public
  141. Class Function ResourceName : String; override;
  142. Class Function DefaultAPI : TGoogleAPIClass; override;
  143. Procedure Delete(id: string);
  144. Function Get(id: string) : TSiteVerificationWebResourceResource;
  145. Function GetToken(aSiteVerificationWebResourceGettokenRequest : TSiteVerificationWebResourceGettokenRequest) : TSiteVerificationWebResourceGettokenResponse;
  146. Function Insert(aSiteVerificationWebResourceResource : TSiteVerificationWebResourceResource; AQuery : string = '') : TSiteVerificationWebResourceResource;
  147. Function Insert(aSiteVerificationWebResourceResource : TSiteVerificationWebResourceResource; AQuery : TWebResourceinsertOptions) : TSiteVerificationWebResourceResource;
  148. Function List : TSiteVerificationWebResourceListResponse;
  149. Function Patch(id: string; aSiteVerificationWebResourceResource : TSiteVerificationWebResourceResource) : TSiteVerificationWebResourceResource;
  150. Function Update(id: string; aSiteVerificationWebResourceResource : TSiteVerificationWebResourceResource) : TSiteVerificationWebResourceResource;
  151. end;
  152. { --------------------------------------------------------------------
  153. TSiteVerificationAPI
  154. --------------------------------------------------------------------}
  155. TSiteVerificationAPI = Class(TGoogleAPI)
  156. Private
  157. FWebResourceInstance : TWebResourceResource;
  158. Function GetWebResourceInstance : TWebResourceResource;virtual;
  159. Public
  160. //Override class functions with API info
  161. Class Function APIName : String; override;
  162. Class Function APIVersion : String; override;
  163. Class Function APIRevision : String; override;
  164. Class Function APIID : String; override;
  165. Class Function APITitle : String; override;
  166. Class Function APIDescription : String; override;
  167. Class Function APIOwnerDomain : String; override;
  168. Class Function APIOwnerName : String; override;
  169. Class Function APIIcon16 : String; override;
  170. Class Function APIIcon32 : String; override;
  171. Class Function APIdocumentationLink : String; override;
  172. Class Function APIrootUrl : string; override;
  173. Class Function APIbasePath : string;override;
  174. Class Function APIbaseURL : String;override;
  175. Class Function APIProtocol : string;override;
  176. Class Function APIservicePath : string;override;
  177. Class Function APIbatchPath : String;override;
  178. Class Function APIAuthScopes : TScopeInfoArray;override;
  179. Class Function APINeedsAuth : Boolean;override;
  180. Class Procedure RegisterAPIResources; override;
  181. //Add create function for resources
  182. Function CreateWebResourceResource(AOwner : TComponent) : TWebResourceResource;virtual;overload;
  183. Function CreateWebResourceResource : TWebResourceResource;virtual;overload;
  184. //Add default on-demand instances for resources
  185. Property WebResourceResource : TWebResourceResource Read GetWebResourceInstance;
  186. end;
  187. implementation
  188. { --------------------------------------------------------------------
  189. TSiteVerificationWebResourceGettokenRequestTypesite
  190. --------------------------------------------------------------------}
  191. Procedure TSiteVerificationWebResourceGettokenRequestTypesite.Setidentifier(AIndex : Integer; const AValue : String);
  192. begin
  193. If (Fidentifier=AValue) then exit;
  194. Fidentifier:=AValue;
  195. MarkPropertyChanged(AIndex);
  196. end;
  197. Procedure TSiteVerificationWebResourceGettokenRequestTypesite.Set_type(AIndex : Integer; const AValue : String);
  198. begin
  199. If (F_type=AValue) then exit;
  200. F_type:=AValue;
  201. MarkPropertyChanged(AIndex);
  202. end;
  203. Class Function TSiteVerificationWebResourceGettokenRequestTypesite.ExportPropertyName(Const AName : String) :String;
  204. begin
  205. Case AName of
  206. '_type' : Result:='type';
  207. else
  208. Result:=Inherited ExportPropertyName(AName);
  209. end;
  210. end;
  211. { --------------------------------------------------------------------
  212. TSiteVerificationWebResourceGettokenRequest
  213. --------------------------------------------------------------------}
  214. Procedure TSiteVerificationWebResourceGettokenRequest.Setsite(AIndex : Integer; const AValue : TSiteVerificationWebResourceGettokenRequestTypesite);
  215. begin
  216. If (Fsite=AValue) then exit;
  217. Fsite:=AValue;
  218. MarkPropertyChanged(AIndex);
  219. end;
  220. Procedure TSiteVerificationWebResourceGettokenRequest.SetverificationMethod(AIndex : Integer; const AValue : String);
  221. begin
  222. If (FverificationMethod=AValue) then exit;
  223. FverificationMethod:=AValue;
  224. MarkPropertyChanged(AIndex);
  225. end;
  226. { --------------------------------------------------------------------
  227. TSiteVerificationWebResourceGettokenResponse
  228. --------------------------------------------------------------------}
  229. Procedure TSiteVerificationWebResourceGettokenResponse.Setmethod(AIndex : Integer; const AValue : String);
  230. begin
  231. If (Fmethod=AValue) then exit;
  232. Fmethod:=AValue;
  233. MarkPropertyChanged(AIndex);
  234. end;
  235. Procedure TSiteVerificationWebResourceGettokenResponse.Settoken(AIndex : Integer; const AValue : String);
  236. begin
  237. If (Ftoken=AValue) then exit;
  238. Ftoken:=AValue;
  239. MarkPropertyChanged(AIndex);
  240. end;
  241. { --------------------------------------------------------------------
  242. TSiteVerificationWebResourceListResponse
  243. --------------------------------------------------------------------}
  244. Procedure TSiteVerificationWebResourceListResponse.Setitems(AIndex : Integer; const AValue : TSiteVerificationWebResourceListResponseTypeitemsArray);
  245. begin
  246. If (Fitems=AValue) then exit;
  247. Fitems:=AValue;
  248. MarkPropertyChanged(AIndex);
  249. end;
  250. //2.6.4. bug workaround
  251. {$IFDEF VER2_6}
  252. Procedure TSiteVerificationWebResourceListResponse.SetArrayLength(Const AName : String; ALength : Longint);
  253. begin
  254. Case AName of
  255. 'items' : SetLength(Fitems,ALength);
  256. else
  257. Inherited SetArrayLength(AName,ALength);
  258. end;
  259. end;
  260. {$ENDIF VER2_6}
  261. { --------------------------------------------------------------------
  262. TSiteVerificationWebResourceResourceTypesite
  263. --------------------------------------------------------------------}
  264. Procedure TSiteVerificationWebResourceResourceTypesite.Setidentifier(AIndex : Integer; const AValue : String);
  265. begin
  266. If (Fidentifier=AValue) then exit;
  267. Fidentifier:=AValue;
  268. MarkPropertyChanged(AIndex);
  269. end;
  270. Procedure TSiteVerificationWebResourceResourceTypesite.Set_type(AIndex : Integer; const AValue : String);
  271. begin
  272. If (F_type=AValue) then exit;
  273. F_type:=AValue;
  274. MarkPropertyChanged(AIndex);
  275. end;
  276. Class Function TSiteVerificationWebResourceResourceTypesite.ExportPropertyName(Const AName : String) :String;
  277. begin
  278. Case AName of
  279. '_type' : Result:='type';
  280. else
  281. Result:=Inherited ExportPropertyName(AName);
  282. end;
  283. end;
  284. { --------------------------------------------------------------------
  285. TSiteVerificationWebResourceResource
  286. --------------------------------------------------------------------}
  287. Procedure TSiteVerificationWebResourceResource.Setid(AIndex : Integer; const AValue : String);
  288. begin
  289. If (Fid=AValue) then exit;
  290. Fid:=AValue;
  291. MarkPropertyChanged(AIndex);
  292. end;
  293. Procedure TSiteVerificationWebResourceResource.Setowners(AIndex : Integer; const AValue : TStringArray);
  294. begin
  295. If (Fowners=AValue) then exit;
  296. Fowners:=AValue;
  297. MarkPropertyChanged(AIndex);
  298. end;
  299. Procedure TSiteVerificationWebResourceResource.Setsite(AIndex : Integer; const AValue : TSiteVerificationWebResourceResourceTypesite);
  300. begin
  301. If (Fsite=AValue) then exit;
  302. Fsite:=AValue;
  303. MarkPropertyChanged(AIndex);
  304. end;
  305. //2.6.4. bug workaround
  306. {$IFDEF VER2_6}
  307. Procedure TSiteVerificationWebResourceResource.SetArrayLength(Const AName : String; ALength : Longint);
  308. begin
  309. Case AName of
  310. 'owners' : SetLength(Fowners,ALength);
  311. else
  312. Inherited SetArrayLength(AName,ALength);
  313. end;
  314. end;
  315. {$ENDIF VER2_6}
  316. { --------------------------------------------------------------------
  317. TWebResourceResource
  318. --------------------------------------------------------------------}
  319. Class Function TWebResourceResource.ResourceName : String;
  320. begin
  321. Result:='webResource';
  322. end;
  323. Class Function TWebResourceResource.DefaultAPI : TGoogleAPIClass;
  324. begin
  325. Result:=TsiteVerificationAPI;
  326. end;
  327. Procedure TWebResourceResource.Delete(id: string);
  328. Const
  329. _HTTPMethod = 'DELETE';
  330. _Path = 'webResource/{id}';
  331. _Methodid = 'siteVerification.webResource.delete';
  332. Var
  333. _P : String;
  334. begin
  335. _P:=SubstitutePath(_Path,['id',id]);
  336. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  337. end;
  338. Function TWebResourceResource.Get(id: string) : TSiteVerificationWebResourceResource;
  339. Const
  340. _HTTPMethod = 'GET';
  341. _Path = 'webResource/{id}';
  342. _Methodid = 'siteVerification.webResource.get';
  343. Var
  344. _P : String;
  345. begin
  346. _P:=SubstitutePath(_Path,['id',id]);
  347. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TSiteVerificationWebResourceResource) as TSiteVerificationWebResourceResource;
  348. end;
  349. Function TWebResourceResource.GetToken(aSiteVerificationWebResourceGettokenRequest : TSiteVerificationWebResourceGettokenRequest) : TSiteVerificationWebResourceGettokenResponse;
  350. Const
  351. _HTTPMethod = 'POST';
  352. _Path = 'token';
  353. _Methodid = 'siteVerification.webResource.getToken';
  354. begin
  355. Result:=ServiceCall(_HTTPMethod,_Path,'',aSiteVerificationWebResourceGettokenRequest,TSiteVerificationWebResourceGettokenResponse) as TSiteVerificationWebResourceGettokenResponse;
  356. end;
  357. Function TWebResourceResource.Insert(aSiteVerificationWebResourceResource : TSiteVerificationWebResourceResource; AQuery : string = '') : TSiteVerificationWebResourceResource;
  358. Const
  359. _HTTPMethod = 'POST';
  360. _Path = 'webResource';
  361. _Methodid = 'siteVerification.webResource.insert';
  362. begin
  363. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,aSiteVerificationWebResourceResource,TSiteVerificationWebResourceResource) as TSiteVerificationWebResourceResource;
  364. end;
  365. Function TWebResourceResource.Insert(aSiteVerificationWebResourceResource : TSiteVerificationWebResourceResource; AQuery : TWebResourceinsertOptions) : TSiteVerificationWebResourceResource;
  366. Var
  367. _Q : String;
  368. begin
  369. _Q:='';
  370. AddToQuery(_Q,'verificationMethod',AQuery.verificationMethod);
  371. Result:=Insert(aSiteVerificationWebResourceResource,_Q);
  372. end;
  373. Function TWebResourceResource.List : TSiteVerificationWebResourceListResponse;
  374. Const
  375. _HTTPMethod = 'GET';
  376. _Path = 'webResource';
  377. _Methodid = 'siteVerification.webResource.list';
  378. begin
  379. Result:=ServiceCall(_HTTPMethod,_Path,'',Nil,TSiteVerificationWebResourceListResponse) as TSiteVerificationWebResourceListResponse;
  380. end;
  381. Function TWebResourceResource.Patch(id: string; aSiteVerificationWebResourceResource : TSiteVerificationWebResourceResource) : TSiteVerificationWebResourceResource;
  382. Const
  383. _HTTPMethod = 'PATCH';
  384. _Path = 'webResource/{id}';
  385. _Methodid = 'siteVerification.webResource.patch';
  386. Var
  387. _P : String;
  388. begin
  389. _P:=SubstitutePath(_Path,['id',id]);
  390. Result:=ServiceCall(_HTTPMethod,_P,'',aSiteVerificationWebResourceResource,TSiteVerificationWebResourceResource) as TSiteVerificationWebResourceResource;
  391. end;
  392. Function TWebResourceResource.Update(id: string; aSiteVerificationWebResourceResource : TSiteVerificationWebResourceResource) : TSiteVerificationWebResourceResource;
  393. Const
  394. _HTTPMethod = 'PUT';
  395. _Path = 'webResource/{id}';
  396. _Methodid = 'siteVerification.webResource.update';
  397. Var
  398. _P : String;
  399. begin
  400. _P:=SubstitutePath(_Path,['id',id]);
  401. Result:=ServiceCall(_HTTPMethod,_P,'',aSiteVerificationWebResourceResource,TSiteVerificationWebResourceResource) as TSiteVerificationWebResourceResource;
  402. end;
  403. { --------------------------------------------------------------------
  404. TSiteVerificationAPI
  405. --------------------------------------------------------------------}
  406. Class Function TSiteVerificationAPI.APIName : String;
  407. begin
  408. Result:='siteVerification';
  409. end;
  410. Class Function TSiteVerificationAPI.APIVersion : String;
  411. begin
  412. Result:='v1';
  413. end;
  414. Class Function TSiteVerificationAPI.APIRevision : String;
  415. begin
  416. Result:='20160228';
  417. end;
  418. Class Function TSiteVerificationAPI.APIID : String;
  419. begin
  420. Result:='siteVerification:v1';
  421. end;
  422. Class Function TSiteVerificationAPI.APITitle : String;
  423. begin
  424. Result:='Google Site Verification API';
  425. end;
  426. Class Function TSiteVerificationAPI.APIDescription : String;
  427. begin
  428. Result:='Verifies ownership of websites or domains with Google.';
  429. end;
  430. Class Function TSiteVerificationAPI.APIOwnerDomain : String;
  431. begin
  432. Result:='google.com';
  433. end;
  434. Class Function TSiteVerificationAPI.APIOwnerName : String;
  435. begin
  436. Result:='Google';
  437. end;
  438. Class Function TSiteVerificationAPI.APIIcon16 : String;
  439. begin
  440. Result:='http://www.google.com/images/icons/product/search-16.gif';
  441. end;
  442. Class Function TSiteVerificationAPI.APIIcon32 : String;
  443. begin
  444. Result:='http://www.google.com/images/icons/product/search-32.gif';
  445. end;
  446. Class Function TSiteVerificationAPI.APIdocumentationLink : String;
  447. begin
  448. Result:='https://developers.google.com/site-verification/';
  449. end;
  450. Class Function TSiteVerificationAPI.APIrootUrl : string;
  451. begin
  452. Result:='https://www.googleapis.com/';
  453. end;
  454. Class Function TSiteVerificationAPI.APIbasePath : string;
  455. begin
  456. Result:='/siteVerification/v1/';
  457. end;
  458. Class Function TSiteVerificationAPI.APIbaseURL : String;
  459. begin
  460. Result:='https://www.googleapis.com/siteVerification/v1/';
  461. end;
  462. Class Function TSiteVerificationAPI.APIProtocol : string;
  463. begin
  464. Result:='rest';
  465. end;
  466. Class Function TSiteVerificationAPI.APIservicePath : string;
  467. begin
  468. Result:='siteVerification/v1/';
  469. end;
  470. Class Function TSiteVerificationAPI.APIbatchPath : String;
  471. begin
  472. Result:='batch';
  473. end;
  474. Class Function TSiteVerificationAPI.APIAuthScopes : TScopeInfoArray;
  475. begin
  476. SetLength(Result,2);
  477. Result[0].Name:='https://www.googleapis.com/auth/siteverification';
  478. Result[0].Description:='Manage the list of sites and domains you control';
  479. Result[1].Name:='https://www.googleapis.com/auth/siteverification.verify_only';
  480. Result[1].Description:='Manage your new site verifications with Google';
  481. end;
  482. Class Function TSiteVerificationAPI.APINeedsAuth : Boolean;
  483. begin
  484. Result:=True;
  485. end;
  486. Class Procedure TSiteVerificationAPI.RegisterAPIResources;
  487. begin
  488. TSiteVerificationWebResourceGettokenRequestTypesite.RegisterObject;
  489. TSiteVerificationWebResourceGettokenRequest.RegisterObject;
  490. TSiteVerificationWebResourceGettokenResponse.RegisterObject;
  491. TSiteVerificationWebResourceListResponse.RegisterObject;
  492. TSiteVerificationWebResourceResourceTypesite.RegisterObject;
  493. TSiteVerificationWebResourceResource.RegisterObject;
  494. end;
  495. Function TSiteVerificationAPI.GetWebResourceInstance : TWebResourceResource;
  496. begin
  497. if (FWebResourceInstance=Nil) then
  498. FWebResourceInstance:=CreateWebResourceResource;
  499. Result:=FWebResourceInstance;
  500. end;
  501. Function TSiteVerificationAPI.CreateWebResourceResource : TWebResourceResource;
  502. begin
  503. Result:=CreateWebResourceResource(Self);
  504. end;
  505. Function TSiteVerificationAPI.CreateWebResourceResource(AOwner : TComponent) : TWebResourceResource;
  506. begin
  507. Result:=TWebResourceResource.Create(AOwner);
  508. Result.API:=Self.API;
  509. end;
  510. initialization
  511. TSiteVerificationAPI.RegisterAPI;
  512. end.