googlegroupssettings.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. {$IFNDEF FPC_DOTTEDUNITS}
  2. unit googlegroupssettings;
  3. {$ENDIF FPC_DOTTEDUNITS}
  4. {$MODE objfpc}
  5. {$H+}
  6. interface
  7. {$IFDEF FPC_DOTTEDUNITS}
  8. uses System.SysUtils, System.Classes, GoogleApi.Service, FpWeb.Rest.Base, GoogleApi.Base;
  9. {$ELSE FPC_DOTTEDUNITS}
  10. uses sysutils, classes, googleservice, restbase, googlebase;
  11. {$ENDIF FPC_DOTTEDUNITS}
  12. type
  13. //Top-level schema types
  14. TGroups = Class;
  15. TGroupsArray = Array of TGroups;
  16. //Anonymous types, using auto-generated names
  17. { --------------------------------------------------------------------
  18. TGroups
  19. --------------------------------------------------------------------}
  20. TGroups = Class(TGoogleBaseObject)
  21. Private
  22. FallowExternalMembers : String;
  23. FallowGoogleCommunication : String;
  24. FallowWebPosting : String;
  25. FarchiveOnly : String;
  26. FcustomReplyTo : String;
  27. FdefaultMessageDenyNotificationText : String;
  28. Fdescription : String;
  29. Femail : String;
  30. FincludeInGlobalAddressList : String;
  31. FisArchived : String;
  32. Fkind : String;
  33. FmaxMessageBytes : integer;
  34. FmembersCanPostAsTheGroup : String;
  35. FmessageDisplayFont : String;
  36. FmessageModerationLevel : String;
  37. Fname : String;
  38. FprimaryLanguage : String;
  39. FreplyTo : String;
  40. FsendMessageDenyNotification : String;
  41. FshowInGroupDirectory : String;
  42. FspamModerationLevel : String;
  43. FwhoCanAdd : String;
  44. FwhoCanContactOwner : String;
  45. FwhoCanInvite : String;
  46. FwhoCanJoin : String;
  47. FwhoCanLeaveGroup : String;
  48. FwhoCanPostMessage : String;
  49. FwhoCanViewGroup : String;
  50. FwhoCanViewMembership : String;
  51. Protected
  52. //Property setters
  53. Procedure SetallowExternalMembers(AIndex : Integer; const AValue : String); virtual;
  54. Procedure SetallowGoogleCommunication(AIndex : Integer; const AValue : String); virtual;
  55. Procedure SetallowWebPosting(AIndex : Integer; const AValue : String); virtual;
  56. Procedure SetarchiveOnly(AIndex : Integer; const AValue : String); virtual;
  57. Procedure SetcustomReplyTo(AIndex : Integer; const AValue : String); virtual;
  58. Procedure SetdefaultMessageDenyNotificationText(AIndex : Integer; const AValue : String); virtual;
  59. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  60. Procedure Setemail(AIndex : Integer; const AValue : String); virtual;
  61. Procedure SetincludeInGlobalAddressList(AIndex : Integer; const AValue : String); virtual;
  62. Procedure SetisArchived(AIndex : Integer; const AValue : String); virtual;
  63. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  64. Procedure SetmaxMessageBytes(AIndex : Integer; const AValue : integer); virtual;
  65. Procedure SetmembersCanPostAsTheGroup(AIndex : Integer; const AValue : String); virtual;
  66. Procedure SetmessageDisplayFont(AIndex : Integer; const AValue : String); virtual;
  67. Procedure SetmessageModerationLevel(AIndex : Integer; const AValue : String); virtual;
  68. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  69. Procedure SetprimaryLanguage(AIndex : Integer; const AValue : String); virtual;
  70. Procedure SetreplyTo(AIndex : Integer; const AValue : String); virtual;
  71. Procedure SetsendMessageDenyNotification(AIndex : Integer; const AValue : String); virtual;
  72. Procedure SetshowInGroupDirectory(AIndex : Integer; const AValue : String); virtual;
  73. Procedure SetspamModerationLevel(AIndex : Integer; const AValue : String); virtual;
  74. Procedure SetwhoCanAdd(AIndex : Integer; const AValue : String); virtual;
  75. Procedure SetwhoCanContactOwner(AIndex : Integer; const AValue : String); virtual;
  76. Procedure SetwhoCanInvite(AIndex : Integer; const AValue : String); virtual;
  77. Procedure SetwhoCanJoin(AIndex : Integer; const AValue : String); virtual;
  78. Procedure SetwhoCanLeaveGroup(AIndex : Integer; const AValue : String); virtual;
  79. Procedure SetwhoCanPostMessage(AIndex : Integer; const AValue : String); virtual;
  80. Procedure SetwhoCanViewGroup(AIndex : Integer; const AValue : String); virtual;
  81. Procedure SetwhoCanViewMembership(AIndex : Integer; const AValue : String); virtual;
  82. Public
  83. Published
  84. Property allowExternalMembers : String Index 0 Read FallowExternalMembers Write SetallowExternalMembers;
  85. Property allowGoogleCommunication : String Index 8 Read FallowGoogleCommunication Write SetallowGoogleCommunication;
  86. Property allowWebPosting : String Index 16 Read FallowWebPosting Write SetallowWebPosting;
  87. Property archiveOnly : String Index 24 Read FarchiveOnly Write SetarchiveOnly;
  88. Property customReplyTo : String Index 32 Read FcustomReplyTo Write SetcustomReplyTo;
  89. Property defaultMessageDenyNotificationText : String Index 40 Read FdefaultMessageDenyNotificationText Write SetdefaultMessageDenyNotificationText;
  90. Property description : String Index 48 Read Fdescription Write Setdescription;
  91. Property email : String Index 56 Read Femail Write Setemail;
  92. Property includeInGlobalAddressList : String Index 64 Read FincludeInGlobalAddressList Write SetincludeInGlobalAddressList;
  93. Property isArchived : String Index 72 Read FisArchived Write SetisArchived;
  94. Property kind : String Index 80 Read Fkind Write Setkind;
  95. Property maxMessageBytes : integer Index 88 Read FmaxMessageBytes Write SetmaxMessageBytes;
  96. Property membersCanPostAsTheGroup : String Index 96 Read FmembersCanPostAsTheGroup Write SetmembersCanPostAsTheGroup;
  97. Property messageDisplayFont : String Index 104 Read FmessageDisplayFont Write SetmessageDisplayFont;
  98. Property messageModerationLevel : String Index 112 Read FmessageModerationLevel Write SetmessageModerationLevel;
  99. Property name : String Index 120 Read Fname Write Setname;
  100. Property primaryLanguage : String Index 128 Read FprimaryLanguage Write SetprimaryLanguage;
  101. Property replyTo : String Index 136 Read FreplyTo Write SetreplyTo;
  102. Property sendMessageDenyNotification : String Index 144 Read FsendMessageDenyNotification Write SetsendMessageDenyNotification;
  103. Property showInGroupDirectory : String Index 152 Read FshowInGroupDirectory Write SetshowInGroupDirectory;
  104. Property spamModerationLevel : String Index 160 Read FspamModerationLevel Write SetspamModerationLevel;
  105. Property whoCanAdd : String Index 168 Read FwhoCanAdd Write SetwhoCanAdd;
  106. Property whoCanContactOwner : String Index 176 Read FwhoCanContactOwner Write SetwhoCanContactOwner;
  107. Property whoCanInvite : String Index 184 Read FwhoCanInvite Write SetwhoCanInvite;
  108. Property whoCanJoin : String Index 192 Read FwhoCanJoin Write SetwhoCanJoin;
  109. Property whoCanLeaveGroup : String Index 200 Read FwhoCanLeaveGroup Write SetwhoCanLeaveGroup;
  110. Property whoCanPostMessage : String Index 208 Read FwhoCanPostMessage Write SetwhoCanPostMessage;
  111. Property whoCanViewGroup : String Index 216 Read FwhoCanViewGroup Write SetwhoCanViewGroup;
  112. Property whoCanViewMembership : String Index 224 Read FwhoCanViewMembership Write SetwhoCanViewMembership;
  113. end;
  114. TGroupsClass = Class of TGroups;
  115. { --------------------------------------------------------------------
  116. TGroupsResource
  117. --------------------------------------------------------------------}
  118. TGroupsResource = Class(TGoogleResource)
  119. Public
  120. Class Function ResourceName : String; override;
  121. Class Function DefaultAPI : TGoogleAPIClass; override;
  122. Function Get(groupUniqueId: string) : TGroups;
  123. Function Patch(groupUniqueId: string; aGroups : TGroups) : TGroups;
  124. Function Update(groupUniqueId: string; aGroups : TGroups) : TGroups;
  125. end;
  126. { --------------------------------------------------------------------
  127. TGroupssettingsAPI
  128. --------------------------------------------------------------------}
  129. TGroupssettingsAPI = Class(TGoogleAPI)
  130. Private
  131. FGroupsInstance : TGroupsResource;
  132. Function GetGroupsInstance : TGroupsResource;virtual;
  133. Public
  134. //Override class functions with API info
  135. Class Function APIName : String; override;
  136. Class Function APIVersion : String; override;
  137. Class Function APIRevision : String; override;
  138. Class Function APIID : String; override;
  139. Class Function APITitle : String; override;
  140. Class Function APIDescription : String; override;
  141. Class Function APIOwnerDomain : String; override;
  142. Class Function APIOwnerName : String; override;
  143. Class Function APIIcon16 : String; override;
  144. Class Function APIIcon32 : String; override;
  145. Class Function APIdocumentationLink : String; override;
  146. Class Function APIrootUrl : string; override;
  147. Class Function APIbasePath : string;override;
  148. Class Function APIbaseURL : String;override;
  149. Class Function APIProtocol : string;override;
  150. Class Function APIservicePath : string;override;
  151. Class Function APIbatchPath : String;override;
  152. Class Function APIAuthScopes : TScopeInfoArray;override;
  153. Class Function APINeedsAuth : Boolean;override;
  154. Class Procedure RegisterAPIResources; override;
  155. //Add create function for resources
  156. Function CreateGroupsResource(AOwner : TComponent) : TGroupsResource;virtual;overload;
  157. Function CreateGroupsResource : TGroupsResource;virtual;overload;
  158. //Add default on-demand instances for resources
  159. Property GroupsResource : TGroupsResource Read GetGroupsInstance;
  160. end;
  161. implementation
  162. { --------------------------------------------------------------------
  163. TGroups
  164. --------------------------------------------------------------------}
  165. Procedure TGroups.SetallowExternalMembers(AIndex : Integer; const AValue : String);
  166. begin
  167. If (FallowExternalMembers=AValue) then exit;
  168. FallowExternalMembers:=AValue;
  169. MarkPropertyChanged(AIndex);
  170. end;
  171. Procedure TGroups.SetallowGoogleCommunication(AIndex : Integer; const AValue : String);
  172. begin
  173. If (FallowGoogleCommunication=AValue) then exit;
  174. FallowGoogleCommunication:=AValue;
  175. MarkPropertyChanged(AIndex);
  176. end;
  177. Procedure TGroups.SetallowWebPosting(AIndex : Integer; const AValue : String);
  178. begin
  179. If (FallowWebPosting=AValue) then exit;
  180. FallowWebPosting:=AValue;
  181. MarkPropertyChanged(AIndex);
  182. end;
  183. Procedure TGroups.SetarchiveOnly(AIndex : Integer; const AValue : String);
  184. begin
  185. If (FarchiveOnly=AValue) then exit;
  186. FarchiveOnly:=AValue;
  187. MarkPropertyChanged(AIndex);
  188. end;
  189. Procedure TGroups.SetcustomReplyTo(AIndex : Integer; const AValue : String);
  190. begin
  191. If (FcustomReplyTo=AValue) then exit;
  192. FcustomReplyTo:=AValue;
  193. MarkPropertyChanged(AIndex);
  194. end;
  195. Procedure TGroups.SetdefaultMessageDenyNotificationText(AIndex : Integer; const AValue : String);
  196. begin
  197. If (FdefaultMessageDenyNotificationText=AValue) then exit;
  198. FdefaultMessageDenyNotificationText:=AValue;
  199. MarkPropertyChanged(AIndex);
  200. end;
  201. Procedure TGroups.Setdescription(AIndex : Integer; const AValue : String);
  202. begin
  203. If (Fdescription=AValue) then exit;
  204. Fdescription:=AValue;
  205. MarkPropertyChanged(AIndex);
  206. end;
  207. Procedure TGroups.Setemail(AIndex : Integer; const AValue : String);
  208. begin
  209. If (Femail=AValue) then exit;
  210. Femail:=AValue;
  211. MarkPropertyChanged(AIndex);
  212. end;
  213. Procedure TGroups.SetincludeInGlobalAddressList(AIndex : Integer; const AValue : String);
  214. begin
  215. If (FincludeInGlobalAddressList=AValue) then exit;
  216. FincludeInGlobalAddressList:=AValue;
  217. MarkPropertyChanged(AIndex);
  218. end;
  219. Procedure TGroups.SetisArchived(AIndex : Integer; const AValue : String);
  220. begin
  221. If (FisArchived=AValue) then exit;
  222. FisArchived:=AValue;
  223. MarkPropertyChanged(AIndex);
  224. end;
  225. Procedure TGroups.Setkind(AIndex : Integer; const AValue : String);
  226. begin
  227. If (Fkind=AValue) then exit;
  228. Fkind:=AValue;
  229. MarkPropertyChanged(AIndex);
  230. end;
  231. Procedure TGroups.SetmaxMessageBytes(AIndex : Integer; const AValue : integer);
  232. begin
  233. If (FmaxMessageBytes=AValue) then exit;
  234. FmaxMessageBytes:=AValue;
  235. MarkPropertyChanged(AIndex);
  236. end;
  237. Procedure TGroups.SetmembersCanPostAsTheGroup(AIndex : Integer; const AValue : String);
  238. begin
  239. If (FmembersCanPostAsTheGroup=AValue) then exit;
  240. FmembersCanPostAsTheGroup:=AValue;
  241. MarkPropertyChanged(AIndex);
  242. end;
  243. Procedure TGroups.SetmessageDisplayFont(AIndex : Integer; const AValue : String);
  244. begin
  245. If (FmessageDisplayFont=AValue) then exit;
  246. FmessageDisplayFont:=AValue;
  247. MarkPropertyChanged(AIndex);
  248. end;
  249. Procedure TGroups.SetmessageModerationLevel(AIndex : Integer; const AValue : String);
  250. begin
  251. If (FmessageModerationLevel=AValue) then exit;
  252. FmessageModerationLevel:=AValue;
  253. MarkPropertyChanged(AIndex);
  254. end;
  255. Procedure TGroups.Setname(AIndex : Integer; const AValue : String);
  256. begin
  257. If (Fname=AValue) then exit;
  258. Fname:=AValue;
  259. MarkPropertyChanged(AIndex);
  260. end;
  261. Procedure TGroups.SetprimaryLanguage(AIndex : Integer; const AValue : String);
  262. begin
  263. If (FprimaryLanguage=AValue) then exit;
  264. FprimaryLanguage:=AValue;
  265. MarkPropertyChanged(AIndex);
  266. end;
  267. Procedure TGroups.SetreplyTo(AIndex : Integer; const AValue : String);
  268. begin
  269. If (FreplyTo=AValue) then exit;
  270. FreplyTo:=AValue;
  271. MarkPropertyChanged(AIndex);
  272. end;
  273. Procedure TGroups.SetsendMessageDenyNotification(AIndex : Integer; const AValue : String);
  274. begin
  275. If (FsendMessageDenyNotification=AValue) then exit;
  276. FsendMessageDenyNotification:=AValue;
  277. MarkPropertyChanged(AIndex);
  278. end;
  279. Procedure TGroups.SetshowInGroupDirectory(AIndex : Integer; const AValue : String);
  280. begin
  281. If (FshowInGroupDirectory=AValue) then exit;
  282. FshowInGroupDirectory:=AValue;
  283. MarkPropertyChanged(AIndex);
  284. end;
  285. Procedure TGroups.SetspamModerationLevel(AIndex : Integer; const AValue : String);
  286. begin
  287. If (FspamModerationLevel=AValue) then exit;
  288. FspamModerationLevel:=AValue;
  289. MarkPropertyChanged(AIndex);
  290. end;
  291. Procedure TGroups.SetwhoCanAdd(AIndex : Integer; const AValue : String);
  292. begin
  293. If (FwhoCanAdd=AValue) then exit;
  294. FwhoCanAdd:=AValue;
  295. MarkPropertyChanged(AIndex);
  296. end;
  297. Procedure TGroups.SetwhoCanContactOwner(AIndex : Integer; const AValue : String);
  298. begin
  299. If (FwhoCanContactOwner=AValue) then exit;
  300. FwhoCanContactOwner:=AValue;
  301. MarkPropertyChanged(AIndex);
  302. end;
  303. Procedure TGroups.SetwhoCanInvite(AIndex : Integer; const AValue : String);
  304. begin
  305. If (FwhoCanInvite=AValue) then exit;
  306. FwhoCanInvite:=AValue;
  307. MarkPropertyChanged(AIndex);
  308. end;
  309. Procedure TGroups.SetwhoCanJoin(AIndex : Integer; const AValue : String);
  310. begin
  311. If (FwhoCanJoin=AValue) then exit;
  312. FwhoCanJoin:=AValue;
  313. MarkPropertyChanged(AIndex);
  314. end;
  315. Procedure TGroups.SetwhoCanLeaveGroup(AIndex : Integer; const AValue : String);
  316. begin
  317. If (FwhoCanLeaveGroup=AValue) then exit;
  318. FwhoCanLeaveGroup:=AValue;
  319. MarkPropertyChanged(AIndex);
  320. end;
  321. Procedure TGroups.SetwhoCanPostMessage(AIndex : Integer; const AValue : String);
  322. begin
  323. If (FwhoCanPostMessage=AValue) then exit;
  324. FwhoCanPostMessage:=AValue;
  325. MarkPropertyChanged(AIndex);
  326. end;
  327. Procedure TGroups.SetwhoCanViewGroup(AIndex : Integer; const AValue : String);
  328. begin
  329. If (FwhoCanViewGroup=AValue) then exit;
  330. FwhoCanViewGroup:=AValue;
  331. MarkPropertyChanged(AIndex);
  332. end;
  333. Procedure TGroups.SetwhoCanViewMembership(AIndex : Integer; const AValue : String);
  334. begin
  335. If (FwhoCanViewMembership=AValue) then exit;
  336. FwhoCanViewMembership:=AValue;
  337. MarkPropertyChanged(AIndex);
  338. end;
  339. { --------------------------------------------------------------------
  340. TGroupsResource
  341. --------------------------------------------------------------------}
  342. Class Function TGroupsResource.ResourceName : String;
  343. begin
  344. Result:='groups';
  345. end;
  346. Class Function TGroupsResource.DefaultAPI : TGoogleAPIClass;
  347. begin
  348. Result:=TgroupssettingsAPI;
  349. end;
  350. Function TGroupsResource.Get(groupUniqueId: string) : TGroups;
  351. Const
  352. _HTTPMethod = 'GET';
  353. _Path = '{groupUniqueId}';
  354. _Methodid = 'groupsSettings.groups.get';
  355. Var
  356. _P : String;
  357. begin
  358. _P:=SubstitutePath(_Path,['groupUniqueId',groupUniqueId]);
  359. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TGroups) as TGroups;
  360. end;
  361. Function TGroupsResource.Patch(groupUniqueId: string; aGroups : TGroups) : TGroups;
  362. Const
  363. _HTTPMethod = 'PATCH';
  364. _Path = '{groupUniqueId}';
  365. _Methodid = 'groupsSettings.groups.patch';
  366. Var
  367. _P : String;
  368. begin
  369. _P:=SubstitutePath(_Path,['groupUniqueId',groupUniqueId]);
  370. Result:=ServiceCall(_HTTPMethod,_P,'',aGroups,TGroups) as TGroups;
  371. end;
  372. Function TGroupsResource.Update(groupUniqueId: string; aGroups : TGroups) : TGroups;
  373. Const
  374. _HTTPMethod = 'PUT';
  375. _Path = '{groupUniqueId}';
  376. _Methodid = 'groupsSettings.groups.update';
  377. Var
  378. _P : String;
  379. begin
  380. _P:=SubstitutePath(_Path,['groupUniqueId',groupUniqueId]);
  381. Result:=ServiceCall(_HTTPMethod,_P,'',aGroups,TGroups) as TGroups;
  382. end;
  383. { --------------------------------------------------------------------
  384. TGroupssettingsAPI
  385. --------------------------------------------------------------------}
  386. Class Function TGroupssettingsAPI.APIName : String;
  387. begin
  388. Result:='groupssettings';
  389. end;
  390. Class Function TGroupssettingsAPI.APIVersion : String;
  391. begin
  392. Result:='v1';
  393. end;
  394. Class Function TGroupssettingsAPI.APIRevision : String;
  395. begin
  396. Result:='20160323';
  397. end;
  398. Class Function TGroupssettingsAPI.APIID : String;
  399. begin
  400. Result:='groupssettings:v1';
  401. end;
  402. Class Function TGroupssettingsAPI.APITitle : String;
  403. begin
  404. Result:='Groups Settings API';
  405. end;
  406. Class Function TGroupssettingsAPI.APIDescription : String;
  407. begin
  408. Result:='Lets you manage permission levels and related settings of a group.';
  409. end;
  410. Class Function TGroupssettingsAPI.APIOwnerDomain : String;
  411. begin
  412. Result:='google.com';
  413. end;
  414. Class Function TGroupssettingsAPI.APIOwnerName : String;
  415. begin
  416. Result:='Google';
  417. end;
  418. Class Function TGroupssettingsAPI.APIIcon16 : String;
  419. begin
  420. Result:='http://www.google.com/images/icons/product/search-16.gif';
  421. end;
  422. Class Function TGroupssettingsAPI.APIIcon32 : String;
  423. begin
  424. Result:='http://www.google.com/images/icons/product/search-32.gif';
  425. end;
  426. Class Function TGroupssettingsAPI.APIdocumentationLink : String;
  427. begin
  428. Result:='https://developers.google.com/google-apps/groups-settings/get_started';
  429. end;
  430. Class Function TGroupssettingsAPI.APIrootUrl : string;
  431. begin
  432. Result:='https://www.googleapis.com/';
  433. end;
  434. Class Function TGroupssettingsAPI.APIbasePath : string;
  435. begin
  436. Result:='/groups/v1/groups/';
  437. end;
  438. Class Function TGroupssettingsAPI.APIbaseURL : String;
  439. begin
  440. Result:='https://www.googleapis.com/groups/v1/groups/';
  441. end;
  442. Class Function TGroupssettingsAPI.APIProtocol : string;
  443. begin
  444. Result:='rest';
  445. end;
  446. Class Function TGroupssettingsAPI.APIservicePath : string;
  447. begin
  448. Result:='groups/v1/groups/';
  449. end;
  450. Class Function TGroupssettingsAPI.APIbatchPath : String;
  451. begin
  452. Result:='batch';
  453. end;
  454. Class Function TGroupssettingsAPI.APIAuthScopes : TScopeInfoArray;
  455. begin
  456. SetLength(Result,1);
  457. Result[0].Name:='https://www.googleapis.com/auth/apps.groups.settings';
  458. Result[0].Description:='View and manage the settings of a Google Apps Group';
  459. end;
  460. Class Function TGroupssettingsAPI.APINeedsAuth : Boolean;
  461. begin
  462. Result:=True;
  463. end;
  464. Class Procedure TGroupssettingsAPI.RegisterAPIResources;
  465. begin
  466. TGroups.RegisterObject;
  467. end;
  468. Function TGroupssettingsAPI.GetGroupsInstance : TGroupsResource;
  469. begin
  470. if (FGroupsInstance=Nil) then
  471. FGroupsInstance:=CreateGroupsResource;
  472. Result:=FGroupsInstance;
  473. end;
  474. Function TGroupssettingsAPI.CreateGroupsResource : TGroupsResource;
  475. begin
  476. Result:=CreateGroupsResource(Self);
  477. end;
  478. Function TGroupssettingsAPI.CreateGroupsResource(AOwner : TComponent) : TGroupsResource;
  479. begin
  480. Result:=TGroupsResource.Create(AOwner);
  481. Result.API:=Self.API;
  482. end;
  483. initialization
  484. TGroupssettingsAPI.RegisterAPI;
  485. end.