googleaudit.pp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. unit googleaudit;
  2. {
  3. **********************************************************************
  4. This file is part of the Free Component Library (FCL)
  5. Copyright (c) 2015 The free pascal team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************
  12. }
  13. //Generated on: 16-5-15 08:52:58
  14. {$MODE objfpc}
  15. {$H+}
  16. interface
  17. uses sysutils, classes, googleservice, restbase, googlebase;
  18. type
  19. //Top-level schema types
  20. TActivities = Class;
  21. TActivity = Class;
  22. TActivitiesArray = Array of TActivities;
  23. TActivityArray = Array of TActivity;
  24. //Anonymous types, using auto-generated names
  25. TActivityTypeactor = Class;
  26. TActivityTypeeventsItemTypeparametersItem = Class;
  27. TActivityTypeeventsItem = Class;
  28. TActivityTypeid = Class;
  29. TActivitiesTypeitemsArray = Array of TActivity;
  30. TActivityTypeeventsItemTypeparametersArray = Array of TActivityTypeeventsItemTypeparametersItem;
  31. TActivityTypeeventsArray = Array of TActivityTypeeventsItem;
  32. { --------------------------------------------------------------------
  33. TActivities
  34. --------------------------------------------------------------------}
  35. TActivities = Class(TGoogleBaseObject)
  36. Private
  37. Fitems : TActivitiesTypeitemsArray;
  38. Fkind : String;
  39. Fnext : String;
  40. Protected
  41. //Property setters
  42. Procedure Setitems(AIndex : Integer; AValue : TActivitiesTypeitemsArray); virtual;
  43. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  44. Procedure Setnext(AIndex : Integer; const AValue : String); virtual;
  45. //2.6.4. bug workaround
  46. {$IFDEF VER2_6}
  47. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  48. {$ENDIF VER2_6}
  49. Public
  50. Published
  51. Property items : TActivitiesTypeitemsArray Index 0 Read Fitems Write Setitems;
  52. Property kind : String Index 8 Read Fkind Write Setkind;
  53. Property next : String Index 16 Read Fnext Write Setnext;
  54. end;
  55. TActivitiesClass = Class of TActivities;
  56. { --------------------------------------------------------------------
  57. TActivityTypeactor
  58. --------------------------------------------------------------------}
  59. TActivityTypeactor = Class(TGoogleBaseObject)
  60. Private
  61. FapplicationId : String;
  62. FcallerType : String;
  63. Femail : String;
  64. Fkey : String;
  65. Protected
  66. //Property setters
  67. Procedure SetapplicationId(AIndex : Integer; const AValue : String); virtual;
  68. Procedure SetcallerType(AIndex : Integer; const AValue : String); virtual;
  69. Procedure Setemail(AIndex : Integer; const AValue : String); virtual;
  70. Procedure Setkey(AIndex : Integer; const AValue : String); virtual;
  71. Public
  72. Published
  73. Property applicationId : String Index 0 Read FapplicationId Write SetapplicationId;
  74. Property callerType : String Index 8 Read FcallerType Write SetcallerType;
  75. Property email : String Index 16 Read Femail Write Setemail;
  76. Property key : String Index 24 Read Fkey Write Setkey;
  77. end;
  78. TActivityTypeactorClass = Class of TActivityTypeactor;
  79. { --------------------------------------------------------------------
  80. TActivityTypeeventsItemTypeparametersItem
  81. --------------------------------------------------------------------}
  82. TActivityTypeeventsItemTypeparametersItem = Class(TGoogleBaseObject)
  83. Private
  84. Fname : String;
  85. Fvalue : String;
  86. Protected
  87. //Property setters
  88. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  89. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  90. Public
  91. Published
  92. Property name : String Index 0 Read Fname Write Setname;
  93. Property value : String Index 8 Read Fvalue Write Setvalue;
  94. end;
  95. TActivityTypeeventsItemTypeparametersItemClass = Class of TActivityTypeeventsItemTypeparametersItem;
  96. { --------------------------------------------------------------------
  97. TActivityTypeeventsItem
  98. --------------------------------------------------------------------}
  99. TActivityTypeeventsItem = Class(TGoogleBaseObject)
  100. Private
  101. FeventType : String;
  102. Fname : String;
  103. Fparameters : TActivityTypeeventsItemTypeparametersArray;
  104. Protected
  105. //Property setters
  106. Procedure SeteventType(AIndex : Integer; const AValue : String); virtual;
  107. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  108. Procedure Setparameters(AIndex : Integer; AValue : TActivityTypeeventsItemTypeparametersArray); virtual;
  109. //2.6.4. bug workaround
  110. {$IFDEF VER2_6}
  111. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  112. {$ENDIF VER2_6}
  113. Public
  114. Published
  115. Property eventType : String Index 0 Read FeventType Write SeteventType;
  116. Property name : String Index 8 Read Fname Write Setname;
  117. Property parameters : TActivityTypeeventsItemTypeparametersArray Index 16 Read Fparameters Write Setparameters;
  118. end;
  119. TActivityTypeeventsItemClass = Class of TActivityTypeeventsItem;
  120. { --------------------------------------------------------------------
  121. TActivityTypeid
  122. --------------------------------------------------------------------}
  123. TActivityTypeid = Class(TGoogleBaseObject)
  124. Private
  125. FapplicationId : String;
  126. FcustomerId : String;
  127. Ftime : TDatetime;
  128. FuniqQualifier : String;
  129. Protected
  130. //Property setters
  131. Procedure SetapplicationId(AIndex : Integer; const AValue : String); virtual;
  132. Procedure SetcustomerId(AIndex : Integer; const AValue : String); virtual;
  133. Procedure Settime(AIndex : Integer; AValue : TDatetime); virtual;
  134. Procedure SetuniqQualifier(AIndex : Integer; const AValue : String); virtual;
  135. Public
  136. Published
  137. Property applicationId : String Index 0 Read FapplicationId Write SetapplicationId;
  138. Property customerId : String Index 8 Read FcustomerId Write SetcustomerId;
  139. Property time : TDatetime Index 16 Read Ftime Write Settime;
  140. Property uniqQualifier : String Index 24 Read FuniqQualifier Write SetuniqQualifier;
  141. end;
  142. TActivityTypeidClass = Class of TActivityTypeid;
  143. { --------------------------------------------------------------------
  144. TActivity
  145. --------------------------------------------------------------------}
  146. TActivity = Class(TGoogleBaseObject)
  147. Private
  148. Factor : TActivityTypeactor;
  149. Fevents : TActivityTypeeventsArray;
  150. Fid : TActivityTypeid;
  151. FipAddress : String;
  152. Fkind : String;
  153. FownerDomain : String;
  154. Protected
  155. //Property setters
  156. Procedure Setactor(AIndex : Integer; AValue : TActivityTypeactor); virtual;
  157. Procedure Setevents(AIndex : Integer; AValue : TActivityTypeeventsArray); virtual;
  158. Procedure Setid(AIndex : Integer; AValue : TActivityTypeid); virtual;
  159. Procedure SetipAddress(AIndex : Integer; const AValue : String); virtual;
  160. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  161. Procedure SetownerDomain(AIndex : Integer; const AValue : String); virtual;
  162. //2.6.4. bug workaround
  163. {$IFDEF VER2_6}
  164. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  165. {$ENDIF VER2_6}
  166. Public
  167. Published
  168. Property actor : TActivityTypeactor Index 0 Read Factor Write Setactor;
  169. Property events : TActivityTypeeventsArray Index 8 Read Fevents Write Setevents;
  170. Property id : TActivityTypeid Index 16 Read Fid Write Setid;
  171. Property ipAddress : String Index 24 Read FipAddress Write SetipAddress;
  172. Property kind : String Index 32 Read Fkind Write Setkind;
  173. Property ownerDomain : String Index 40 Read FownerDomain Write SetownerDomain;
  174. end;
  175. TActivityClass = Class of TActivity;
  176. { --------------------------------------------------------------------
  177. TActivitiesResource
  178. --------------------------------------------------------------------}
  179. //Optional query Options for TActivitiesResource, method List
  180. TActivitiesListOptions = Record
  181. actorApplicationId : int64;
  182. actorEmail : String;
  183. actorIpAddress : String;
  184. caller : String;
  185. continuationToken : String;
  186. endTime : String;
  187. eventName : String;
  188. maxResults : integer;
  189. startTime : String;
  190. end;
  191. TActivitiesResource = Class(TGoogleResource)
  192. Public
  193. Class Function ResourceName : String; override;
  194. Class Function DefaultAPI : TGoogleAPIClass; override;
  195. Function List(applicationId: string; customerId: string; AQuery : string = '') : TActivities;
  196. Function List(applicationId: string; customerId: string; AQuery : TActivitieslistOptions) : TActivities;
  197. end;
  198. { --------------------------------------------------------------------
  199. TAuditAPI
  200. --------------------------------------------------------------------}
  201. TAuditAPI = Class(TGoogleAPI)
  202. Private
  203. FActivitiesInstance : TActivitiesResource;
  204. Function GetActivitiesInstance : TActivitiesResource;virtual;
  205. Public
  206. //Override class functions with API info
  207. Class Function APIName : String; override;
  208. Class Function APIVersion : String; override;
  209. Class Function APIRevision : String; override;
  210. Class Function APIID : String; override;
  211. Class Function APITitle : String; override;
  212. Class Function APIDescription : String; override;
  213. Class Function APIOwnerDomain : String; override;
  214. Class Function APIOwnerName : String; override;
  215. Class Function APIIcon16 : String; override;
  216. Class Function APIIcon32 : String; override;
  217. Class Function APIdocumentationLink : String; override;
  218. Class Function APIrootUrl : string; override;
  219. Class Function APIbasePath : string;override;
  220. Class Function APIbaseURL : String;override;
  221. Class Function APIProtocol : string;override;
  222. Class Function APIservicePath : string;override;
  223. Class Function APIbatchPath : String;override;
  224. Class Function APIAuthScopes : TScopeInfoArray;override;
  225. Class Function APINeedsAuth : Boolean;override;
  226. Class Procedure RegisterAPIResources; override;
  227. //Add create function for resources
  228. Function CreateActivitiesResource(AOwner : TComponent) : TActivitiesResource;virtual;overload;
  229. Function CreateActivitiesResource : TActivitiesResource;virtual;overload;
  230. //Add default on-demand instances for resources
  231. Property ActivitiesResource : TActivitiesResource Read GetActivitiesInstance;
  232. end;
  233. implementation
  234. { --------------------------------------------------------------------
  235. TActivities
  236. --------------------------------------------------------------------}
  237. Procedure TActivities.Setitems(AIndex : Integer; AValue : TActivitiesTypeitemsArray);
  238. begin
  239. If (Fitems=AValue) then exit;
  240. Fitems:=AValue;
  241. MarkPropertyChanged(AIndex);
  242. end;
  243. Procedure TActivities.Setkind(AIndex : Integer; const AValue : String);
  244. begin
  245. If (Fkind=AValue) then exit;
  246. Fkind:=AValue;
  247. MarkPropertyChanged(AIndex);
  248. end;
  249. Procedure TActivities.Setnext(AIndex : Integer; const AValue : String);
  250. begin
  251. If (Fnext=AValue) then exit;
  252. Fnext:=AValue;
  253. MarkPropertyChanged(AIndex);
  254. end;
  255. //2.6.4. bug workaround
  256. {$IFDEF VER2_6}
  257. Procedure TActivities.SetArrayLength(Const AName : String; ALength : Longint);
  258. begin
  259. Case AName of
  260. 'items' : SetLength(Fitems,ALength);
  261. else
  262. Inherited SetArrayLength(AName,ALength);
  263. end;
  264. end;
  265. {$ENDIF VER2_6}
  266. { --------------------------------------------------------------------
  267. TActivityTypeactor
  268. --------------------------------------------------------------------}
  269. Procedure TActivityTypeactor.SetapplicationId(AIndex : Integer; const AValue : String);
  270. begin
  271. If (FapplicationId=AValue) then exit;
  272. FapplicationId:=AValue;
  273. MarkPropertyChanged(AIndex);
  274. end;
  275. Procedure TActivityTypeactor.SetcallerType(AIndex : Integer; const AValue : String);
  276. begin
  277. If (FcallerType=AValue) then exit;
  278. FcallerType:=AValue;
  279. MarkPropertyChanged(AIndex);
  280. end;
  281. Procedure TActivityTypeactor.Setemail(AIndex : Integer; const AValue : String);
  282. begin
  283. If (Femail=AValue) then exit;
  284. Femail:=AValue;
  285. MarkPropertyChanged(AIndex);
  286. end;
  287. Procedure TActivityTypeactor.Setkey(AIndex : Integer; const AValue : String);
  288. begin
  289. If (Fkey=AValue) then exit;
  290. Fkey:=AValue;
  291. MarkPropertyChanged(AIndex);
  292. end;
  293. { --------------------------------------------------------------------
  294. TActivityTypeeventsItemTypeparametersItem
  295. --------------------------------------------------------------------}
  296. Procedure TActivityTypeeventsItemTypeparametersItem.Setname(AIndex : Integer; const AValue : String);
  297. begin
  298. If (Fname=AValue) then exit;
  299. Fname:=AValue;
  300. MarkPropertyChanged(AIndex);
  301. end;
  302. Procedure TActivityTypeeventsItemTypeparametersItem.Setvalue(AIndex : Integer; const AValue : String);
  303. begin
  304. If (Fvalue=AValue) then exit;
  305. Fvalue:=AValue;
  306. MarkPropertyChanged(AIndex);
  307. end;
  308. { --------------------------------------------------------------------
  309. TActivityTypeeventsItem
  310. --------------------------------------------------------------------}
  311. Procedure TActivityTypeeventsItem.SeteventType(AIndex : Integer; const AValue : String);
  312. begin
  313. If (FeventType=AValue) then exit;
  314. FeventType:=AValue;
  315. MarkPropertyChanged(AIndex);
  316. end;
  317. Procedure TActivityTypeeventsItem.Setname(AIndex : Integer; const AValue : String);
  318. begin
  319. If (Fname=AValue) then exit;
  320. Fname:=AValue;
  321. MarkPropertyChanged(AIndex);
  322. end;
  323. Procedure TActivityTypeeventsItem.Setparameters(AIndex : Integer; AValue : TActivityTypeeventsItemTypeparametersArray);
  324. begin
  325. If (Fparameters=AValue) then exit;
  326. Fparameters:=AValue;
  327. MarkPropertyChanged(AIndex);
  328. end;
  329. //2.6.4. bug workaround
  330. {$IFDEF VER2_6}
  331. Procedure TActivityTypeeventsItem.SetArrayLength(Const AName : String; ALength : Longint);
  332. begin
  333. Case AName of
  334. 'parameters' : SetLength(Fparameters,ALength);
  335. else
  336. Inherited SetArrayLength(AName,ALength);
  337. end;
  338. end;
  339. {$ENDIF VER2_6}
  340. { --------------------------------------------------------------------
  341. TActivityTypeid
  342. --------------------------------------------------------------------}
  343. Procedure TActivityTypeid.SetapplicationId(AIndex : Integer; const AValue : String);
  344. begin
  345. If (FapplicationId=AValue) then exit;
  346. FapplicationId:=AValue;
  347. MarkPropertyChanged(AIndex);
  348. end;
  349. Procedure TActivityTypeid.SetcustomerId(AIndex : Integer; const AValue : String);
  350. begin
  351. If (FcustomerId=AValue) then exit;
  352. FcustomerId:=AValue;
  353. MarkPropertyChanged(AIndex);
  354. end;
  355. Procedure TActivityTypeid.Settime(AIndex : Integer; AValue : TDatetime);
  356. begin
  357. If (Ftime=AValue) then exit;
  358. Ftime:=AValue;
  359. MarkPropertyChanged(AIndex);
  360. end;
  361. Procedure TActivityTypeid.SetuniqQualifier(AIndex : Integer; const AValue : String);
  362. begin
  363. If (FuniqQualifier=AValue) then exit;
  364. FuniqQualifier:=AValue;
  365. MarkPropertyChanged(AIndex);
  366. end;
  367. { --------------------------------------------------------------------
  368. TActivity
  369. --------------------------------------------------------------------}
  370. Procedure TActivity.Setactor(AIndex : Integer; AValue : TActivityTypeactor);
  371. begin
  372. If (Factor=AValue) then exit;
  373. Factor:=AValue;
  374. MarkPropertyChanged(AIndex);
  375. end;
  376. Procedure TActivity.Setevents(AIndex : Integer; AValue : TActivityTypeeventsArray);
  377. begin
  378. If (Fevents=AValue) then exit;
  379. Fevents:=AValue;
  380. MarkPropertyChanged(AIndex);
  381. end;
  382. Procedure TActivity.Setid(AIndex : Integer; AValue : TActivityTypeid);
  383. begin
  384. If (Fid=AValue) then exit;
  385. Fid:=AValue;
  386. MarkPropertyChanged(AIndex);
  387. end;
  388. Procedure TActivity.SetipAddress(AIndex : Integer; const AValue : String);
  389. begin
  390. If (FipAddress=AValue) then exit;
  391. FipAddress:=AValue;
  392. MarkPropertyChanged(AIndex);
  393. end;
  394. Procedure TActivity.Setkind(AIndex : Integer; const AValue : String);
  395. begin
  396. If (Fkind=AValue) then exit;
  397. Fkind:=AValue;
  398. MarkPropertyChanged(AIndex);
  399. end;
  400. Procedure TActivity.SetownerDomain(AIndex : Integer; const AValue : String);
  401. begin
  402. If (FownerDomain=AValue) then exit;
  403. FownerDomain:=AValue;
  404. MarkPropertyChanged(AIndex);
  405. end;
  406. //2.6.4. bug workaround
  407. {$IFDEF VER2_6}
  408. Procedure TActivity.SetArrayLength(Const AName : String; ALength : Longint);
  409. begin
  410. Case AName of
  411. 'events' : SetLength(Fevents,ALength);
  412. else
  413. Inherited SetArrayLength(AName,ALength);
  414. end;
  415. end;
  416. {$ENDIF VER2_6}
  417. { --------------------------------------------------------------------
  418. TActivitiesResource
  419. --------------------------------------------------------------------}
  420. Class Function TActivitiesResource.ResourceName : String;
  421. begin
  422. Result:='activities';
  423. end;
  424. Class Function TActivitiesResource.DefaultAPI : TGoogleAPIClass;
  425. begin
  426. Result:=TauditAPI;
  427. end;
  428. Function TActivitiesResource.List(applicationId: string; customerId: string; AQuery : string = '') : TActivities;
  429. Const
  430. _HTTPMethod = 'GET';
  431. _Path = '{customerId}/{applicationId}';
  432. _Methodid = 'audit.activities.list';
  433. Var
  434. _P : String;
  435. begin
  436. _P:=SubstitutePath(_Path,['applicationId',applicationId,'customerId',customerId]);
  437. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TActivities) as TActivities;
  438. end;
  439. Function TActivitiesResource.List(applicationId: string; customerId: string; AQuery : TActivitieslistOptions) : TActivities;
  440. Var
  441. _Q : String;
  442. begin
  443. _Q:='';
  444. AddToQuery(_Q,'actorApplicationId',AQuery.actorApplicationId);
  445. AddToQuery(_Q,'actorEmail',AQuery.actorEmail);
  446. AddToQuery(_Q,'actorIpAddress',AQuery.actorIpAddress);
  447. AddToQuery(_Q,'caller',AQuery.caller);
  448. AddToQuery(_Q,'continuationToken',AQuery.continuationToken);
  449. AddToQuery(_Q,'endTime',AQuery.endTime);
  450. AddToQuery(_Q,'eventName',AQuery.eventName);
  451. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  452. AddToQuery(_Q,'startTime',AQuery.startTime);
  453. Result:=List(applicationId,customerId,_Q);
  454. end;
  455. { --------------------------------------------------------------------
  456. TAuditAPI
  457. --------------------------------------------------------------------}
  458. Class Function TAuditAPI.APIName : String;
  459. begin
  460. Result:='audit';
  461. end;
  462. Class Function TAuditAPI.APIVersion : String;
  463. begin
  464. Result:='v1';
  465. end;
  466. Class Function TAuditAPI.APIRevision : String;
  467. begin
  468. Result:='20150419';
  469. end;
  470. Class Function TAuditAPI.APIID : String;
  471. begin
  472. Result:='audit:v1';
  473. end;
  474. Class Function TAuditAPI.APITitle : String;
  475. begin
  476. Result:='Enterprise Audit API';
  477. end;
  478. Class Function TAuditAPI.APIDescription : String;
  479. begin
  480. Result:='Lets you access user activities in your enterprise made through various applications.';
  481. end;
  482. Class Function TAuditAPI.APIOwnerDomain : String;
  483. begin
  484. Result:='google.com';
  485. end;
  486. Class Function TAuditAPI.APIOwnerName : String;
  487. begin
  488. Result:='Google';
  489. end;
  490. Class Function TAuditAPI.APIIcon16 : String;
  491. begin
  492. Result:='http://www.google.com/images/icons/product/search-16.gif';
  493. end;
  494. Class Function TAuditAPI.APIIcon32 : String;
  495. begin
  496. Result:='http://www.google.com/images/icons/product/search-32.gif';
  497. end;
  498. Class Function TAuditAPI.APIdocumentationLink : String;
  499. begin
  500. Result:='https://developers.google.com/google-apps/admin-audit/get_started';
  501. end;
  502. Class Function TAuditAPI.APIrootUrl : string;
  503. begin
  504. Result:='https://www.googleapis.com:443/';
  505. end;
  506. Class Function TAuditAPI.APIbasePath : string;
  507. begin
  508. Result:='/apps/reporting/audit/v1/';
  509. end;
  510. Class Function TAuditAPI.APIbaseURL : String;
  511. begin
  512. Result:='https://www.googleapis.com:443/apps/reporting/audit/v1/';
  513. end;
  514. Class Function TAuditAPI.APIProtocol : string;
  515. begin
  516. Result:='rest';
  517. end;
  518. Class Function TAuditAPI.APIservicePath : string;
  519. begin
  520. Result:='apps/reporting/audit/v1/';
  521. end;
  522. Class Function TAuditAPI.APIbatchPath : String;
  523. begin
  524. Result:='batch';
  525. end;
  526. Class Function TAuditAPI.APIAuthScopes : TScopeInfoArray;
  527. begin
  528. SetLength(Result,0);
  529. end;
  530. Class Function TAuditAPI.APINeedsAuth : Boolean;
  531. begin
  532. Result:=False;
  533. end;
  534. Class Procedure TAuditAPI.RegisterAPIResources;
  535. begin
  536. TActivities.RegisterObject;
  537. TActivityTypeactor.RegisterObject;
  538. TActivityTypeeventsItemTypeparametersItem.RegisterObject;
  539. TActivityTypeeventsItem.RegisterObject;
  540. TActivityTypeid.RegisterObject;
  541. TActivity.RegisterObject;
  542. end;
  543. Function TAuditAPI.GetActivitiesInstance : TActivitiesResource;
  544. begin
  545. if (FActivitiesInstance=Nil) then
  546. FActivitiesInstance:=CreateActivitiesResource;
  547. Result:=FActivitiesInstance;
  548. end;
  549. Function TAuditAPI.CreateActivitiesResource : TActivitiesResource;
  550. begin
  551. Result:=CreateActivitiesResource(Self);
  552. end;
  553. Function TAuditAPI.CreateActivitiesResource(AOwner : TComponent) : TActivitiesResource;
  554. begin
  555. Result:=TActivitiesResource.Create(AOwner);
  556. Result.API:=Self.API;
  557. end;
  558. initialization
  559. TAuditAPI.RegisterAPI;
  560. end.