googleiam.pp 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937
  1. unit googleiam;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TListServiceAccountsResponse = Class;
  9. TServiceAccount = Class;
  10. TCreateServiceAccountRequest = Class;
  11. TEmpty = Class;
  12. TListServiceAccountKeysResponse = Class;
  13. TServiceAccountKey = Class;
  14. TCreateServiceAccountKeyRequest = Class;
  15. TSignBlobRequest = Class;
  16. TSignBlobResponse = Class;
  17. TPolicy = Class;
  18. TBinding = Class;
  19. TRule = Class;
  20. TCondition = Class;
  21. TLogConfig = Class;
  22. TCounterOptions = Class;
  23. TDataAccessOptions = Class;
  24. TCloudAuditOptions = Class;
  25. TSetIamPolicyRequest = Class;
  26. TTestIamPermissionsRequest = Class;
  27. TTestIamPermissionsResponse = Class;
  28. TListServiceAccountsResponseArray = Array of TListServiceAccountsResponse;
  29. TServiceAccountArray = Array of TServiceAccount;
  30. TCreateServiceAccountRequestArray = Array of TCreateServiceAccountRequest;
  31. TEmptyArray = Array of TEmpty;
  32. TListServiceAccountKeysResponseArray = Array of TListServiceAccountKeysResponse;
  33. TServiceAccountKeyArray = Array of TServiceAccountKey;
  34. TCreateServiceAccountKeyRequestArray = Array of TCreateServiceAccountKeyRequest;
  35. TSignBlobRequestArray = Array of TSignBlobRequest;
  36. TSignBlobResponseArray = Array of TSignBlobResponse;
  37. TPolicyArray = Array of TPolicy;
  38. TBindingArray = Array of TBinding;
  39. TRuleArray = Array of TRule;
  40. TConditionArray = Array of TCondition;
  41. TLogConfigArray = Array of TLogConfig;
  42. TCounterOptionsArray = Array of TCounterOptions;
  43. TDataAccessOptionsArray = Array of TDataAccessOptions;
  44. TCloudAuditOptionsArray = Array of TCloudAuditOptions;
  45. TSetIamPolicyRequestArray = Array of TSetIamPolicyRequest;
  46. TTestIamPermissionsRequestArray = Array of TTestIamPermissionsRequest;
  47. TTestIamPermissionsResponseArray = Array of TTestIamPermissionsResponse;
  48. //Anonymous types, using auto-generated names
  49. TListServiceAccountsResponseTypeaccountsArray = Array of TServiceAccount;
  50. TListServiceAccountKeysResponseTypekeysArray = Array of TServiceAccountKey;
  51. TPolicyTypebindingsArray = Array of TBinding;
  52. TPolicyTyperulesArray = Array of TRule;
  53. TRuleTypeconditionsArray = Array of TCondition;
  54. TRuleTypelogConfigArray = Array of TLogConfig;
  55. { --------------------------------------------------------------------
  56. TListServiceAccountsResponse
  57. --------------------------------------------------------------------}
  58. TListServiceAccountsResponse = Class(TGoogleBaseObject)
  59. Private
  60. Faccounts : TListServiceAccountsResponseTypeaccountsArray;
  61. FnextPageToken : String;
  62. Protected
  63. //Property setters
  64. Procedure Setaccounts(AIndex : Integer; const AValue : TListServiceAccountsResponseTypeaccountsArray); virtual;
  65. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  66. //2.6.4. bug workaround
  67. {$IFDEF VER2_6}
  68. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  69. {$ENDIF VER2_6}
  70. Public
  71. Published
  72. Property accounts : TListServiceAccountsResponseTypeaccountsArray Index 0 Read Faccounts Write Setaccounts;
  73. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  74. end;
  75. TListServiceAccountsResponseClass = Class of TListServiceAccountsResponse;
  76. { --------------------------------------------------------------------
  77. TServiceAccount
  78. --------------------------------------------------------------------}
  79. TServiceAccount = Class(TGoogleBaseObject)
  80. Private
  81. Fname : String;
  82. FprojectId : String;
  83. FuniqueId : String;
  84. Femail : String;
  85. FdisplayName : String;
  86. Fetag : String;
  87. Foauth2ClientId : String;
  88. Protected
  89. //Property setters
  90. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  91. Procedure SetprojectId(AIndex : Integer; const AValue : String); virtual;
  92. Procedure SetuniqueId(AIndex : Integer; const AValue : String); virtual;
  93. Procedure Setemail(AIndex : Integer; const AValue : String); virtual;
  94. Procedure SetdisplayName(AIndex : Integer; const AValue : String); virtual;
  95. Procedure Setetag(AIndex : Integer; const AValue : String); virtual;
  96. Procedure Setoauth2ClientId(AIndex : Integer; const AValue : String); virtual;
  97. Public
  98. Published
  99. Property name : String Index 0 Read Fname Write Setname;
  100. Property projectId : String Index 8 Read FprojectId Write SetprojectId;
  101. Property uniqueId : String Index 16 Read FuniqueId Write SetuniqueId;
  102. Property email : String Index 24 Read Femail Write Setemail;
  103. Property displayName : String Index 32 Read FdisplayName Write SetdisplayName;
  104. Property etag : String Index 40 Read Fetag Write Setetag;
  105. Property oauth2ClientId : String Index 48 Read Foauth2ClientId Write Setoauth2ClientId;
  106. end;
  107. TServiceAccountClass = Class of TServiceAccount;
  108. { --------------------------------------------------------------------
  109. TCreateServiceAccountRequest
  110. --------------------------------------------------------------------}
  111. TCreateServiceAccountRequest = Class(TGoogleBaseObject)
  112. Private
  113. FaccountId : String;
  114. FserviceAccount : TServiceAccount;
  115. Protected
  116. //Property setters
  117. Procedure SetaccountId(AIndex : Integer; const AValue : String); virtual;
  118. Procedure SetserviceAccount(AIndex : Integer; const AValue : TServiceAccount); virtual;
  119. Public
  120. Published
  121. Property accountId : String Index 0 Read FaccountId Write SetaccountId;
  122. Property serviceAccount : TServiceAccount Index 8 Read FserviceAccount Write SetserviceAccount;
  123. end;
  124. TCreateServiceAccountRequestClass = Class of TCreateServiceAccountRequest;
  125. { --------------------------------------------------------------------
  126. TEmpty
  127. --------------------------------------------------------------------}
  128. TEmpty = Class(TGoogleBaseObject)
  129. Private
  130. Protected
  131. //Property setters
  132. Public
  133. Published
  134. end;
  135. TEmptyClass = Class of TEmpty;
  136. { --------------------------------------------------------------------
  137. TListServiceAccountKeysResponse
  138. --------------------------------------------------------------------}
  139. TListServiceAccountKeysResponse = Class(TGoogleBaseObject)
  140. Private
  141. Fkeys : TListServiceAccountKeysResponseTypekeysArray;
  142. Protected
  143. //Property setters
  144. Procedure Setkeys(AIndex : Integer; const AValue : TListServiceAccountKeysResponseTypekeysArray); 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 keys : TListServiceAccountKeysResponseTypekeysArray Index 0 Read Fkeys Write Setkeys;
  152. end;
  153. TListServiceAccountKeysResponseClass = Class of TListServiceAccountKeysResponse;
  154. { --------------------------------------------------------------------
  155. TServiceAccountKey
  156. --------------------------------------------------------------------}
  157. TServiceAccountKey = Class(TGoogleBaseObject)
  158. Private
  159. Fname : String;
  160. FprivateKeyType : String;
  161. FprivateKeyData : String;
  162. FvalidAfterTime : String;
  163. FvalidBeforeTime : String;
  164. Protected
  165. //Property setters
  166. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  167. Procedure SetprivateKeyType(AIndex : Integer; const AValue : String); virtual;
  168. Procedure SetprivateKeyData(AIndex : Integer; const AValue : String); virtual;
  169. Procedure SetvalidAfterTime(AIndex : Integer; const AValue : String); virtual;
  170. Procedure SetvalidBeforeTime(AIndex : Integer; const AValue : String); virtual;
  171. Public
  172. Published
  173. Property name : String Index 0 Read Fname Write Setname;
  174. Property privateKeyType : String Index 8 Read FprivateKeyType Write SetprivateKeyType;
  175. Property privateKeyData : String Index 16 Read FprivateKeyData Write SetprivateKeyData;
  176. Property validAfterTime : String Index 24 Read FvalidAfterTime Write SetvalidAfterTime;
  177. Property validBeforeTime : String Index 32 Read FvalidBeforeTime Write SetvalidBeforeTime;
  178. end;
  179. TServiceAccountKeyClass = Class of TServiceAccountKey;
  180. { --------------------------------------------------------------------
  181. TCreateServiceAccountKeyRequest
  182. --------------------------------------------------------------------}
  183. TCreateServiceAccountKeyRequest = Class(TGoogleBaseObject)
  184. Private
  185. FprivateKeyType : String;
  186. Protected
  187. //Property setters
  188. Procedure SetprivateKeyType(AIndex : Integer; const AValue : String); virtual;
  189. Public
  190. Published
  191. Property privateKeyType : String Index 0 Read FprivateKeyType Write SetprivateKeyType;
  192. end;
  193. TCreateServiceAccountKeyRequestClass = Class of TCreateServiceAccountKeyRequest;
  194. { --------------------------------------------------------------------
  195. TSignBlobRequest
  196. --------------------------------------------------------------------}
  197. TSignBlobRequest = Class(TGoogleBaseObject)
  198. Private
  199. FbytesToSign : String;
  200. Protected
  201. //Property setters
  202. Procedure SetbytesToSign(AIndex : Integer; const AValue : String); virtual;
  203. Public
  204. Published
  205. Property bytesToSign : String Index 0 Read FbytesToSign Write SetbytesToSign;
  206. end;
  207. TSignBlobRequestClass = Class of TSignBlobRequest;
  208. { --------------------------------------------------------------------
  209. TSignBlobResponse
  210. --------------------------------------------------------------------}
  211. TSignBlobResponse = Class(TGoogleBaseObject)
  212. Private
  213. FkeyId : String;
  214. Fsignature : String;
  215. Protected
  216. //Property setters
  217. Procedure SetkeyId(AIndex : Integer; const AValue : String); virtual;
  218. Procedure Setsignature(AIndex : Integer; const AValue : String); virtual;
  219. Public
  220. Published
  221. Property keyId : String Index 0 Read FkeyId Write SetkeyId;
  222. Property signature : String Index 8 Read Fsignature Write Setsignature;
  223. end;
  224. TSignBlobResponseClass = Class of TSignBlobResponse;
  225. { --------------------------------------------------------------------
  226. TPolicy
  227. --------------------------------------------------------------------}
  228. TPolicy = Class(TGoogleBaseObject)
  229. Private
  230. Fversion : integer;
  231. Fbindings : TPolicyTypebindingsArray;
  232. Frules : TPolicyTyperulesArray;
  233. Fetag : String;
  234. Protected
  235. //Property setters
  236. Procedure Setversion(AIndex : Integer; const AValue : integer); virtual;
  237. Procedure Setbindings(AIndex : Integer; const AValue : TPolicyTypebindingsArray); virtual;
  238. Procedure Setrules(AIndex : Integer; const AValue : TPolicyTyperulesArray); virtual;
  239. Procedure Setetag(AIndex : Integer; const AValue : String); virtual;
  240. //2.6.4. bug workaround
  241. {$IFDEF VER2_6}
  242. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  243. {$ENDIF VER2_6}
  244. Public
  245. Published
  246. Property version : integer Index 0 Read Fversion Write Setversion;
  247. Property bindings : TPolicyTypebindingsArray Index 8 Read Fbindings Write Setbindings;
  248. Property rules : TPolicyTyperulesArray Index 16 Read Frules Write Setrules;
  249. Property etag : String Index 24 Read Fetag Write Setetag;
  250. end;
  251. TPolicyClass = Class of TPolicy;
  252. { --------------------------------------------------------------------
  253. TBinding
  254. --------------------------------------------------------------------}
  255. TBinding = Class(TGoogleBaseObject)
  256. Private
  257. Frole : String;
  258. Fmembers : TStringArray;
  259. Protected
  260. //Property setters
  261. Procedure Setrole(AIndex : Integer; const AValue : String); virtual;
  262. Procedure Setmembers(AIndex : Integer; const AValue : TStringArray); virtual;
  263. //2.6.4. bug workaround
  264. {$IFDEF VER2_6}
  265. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  266. {$ENDIF VER2_6}
  267. Public
  268. Published
  269. Property role : String Index 0 Read Frole Write Setrole;
  270. Property members : TStringArray Index 8 Read Fmembers Write Setmembers;
  271. end;
  272. TBindingClass = Class of TBinding;
  273. { --------------------------------------------------------------------
  274. TRule
  275. --------------------------------------------------------------------}
  276. TRule = Class(TGoogleBaseObject)
  277. Private
  278. Fdescription : String;
  279. Fpermissions : TStringArray;
  280. Faction : String;
  281. F_in : TStringArray;
  282. FnotIn : TStringArray;
  283. Fconditions : TRuleTypeconditionsArray;
  284. FlogConfig : TRuleTypelogConfigArray;
  285. Protected
  286. Class Function ExportPropertyName(Const AName : String) : string; override;
  287. //Property setters
  288. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  289. Procedure Setpermissions(AIndex : Integer; const AValue : TStringArray); virtual;
  290. Procedure Setaction(AIndex : Integer; const AValue : String); virtual;
  291. Procedure Set_in(AIndex : Integer; const AValue : TStringArray); virtual;
  292. Procedure SetnotIn(AIndex : Integer; const AValue : TStringArray); virtual;
  293. Procedure Setconditions(AIndex : Integer; const AValue : TRuleTypeconditionsArray); virtual;
  294. Procedure SetlogConfig(AIndex : Integer; const AValue : TRuleTypelogConfigArray); virtual;
  295. //2.6.4. bug workaround
  296. {$IFDEF VER2_6}
  297. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  298. {$ENDIF VER2_6}
  299. Public
  300. Published
  301. Property description : String Index 0 Read Fdescription Write Setdescription;
  302. Property permissions : TStringArray Index 8 Read Fpermissions Write Setpermissions;
  303. Property action : String Index 16 Read Faction Write Setaction;
  304. Property _in : TStringArray Index 24 Read F_in Write Set_in;
  305. Property notIn : TStringArray Index 32 Read FnotIn Write SetnotIn;
  306. Property conditions : TRuleTypeconditionsArray Index 40 Read Fconditions Write Setconditions;
  307. Property logConfig : TRuleTypelogConfigArray Index 48 Read FlogConfig Write SetlogConfig;
  308. end;
  309. TRuleClass = Class of TRule;
  310. { --------------------------------------------------------------------
  311. TCondition
  312. --------------------------------------------------------------------}
  313. TCondition = Class(TGoogleBaseObject)
  314. Private
  315. Fiam : String;
  316. Fsys : String;
  317. Fsvc : String;
  318. Fop : String;
  319. Fvalue : String;
  320. Fvalues : TStringArray;
  321. Protected
  322. //Property setters
  323. Procedure Setiam(AIndex : Integer; const AValue : String); virtual;
  324. Procedure Setsys(AIndex : Integer; const AValue : String); virtual;
  325. Procedure Setsvc(AIndex : Integer; const AValue : String); virtual;
  326. Procedure Setop(AIndex : Integer; const AValue : String); virtual;
  327. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  328. Procedure Setvalues(AIndex : Integer; const AValue : TStringArray); virtual;
  329. //2.6.4. bug workaround
  330. {$IFDEF VER2_6}
  331. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  332. {$ENDIF VER2_6}
  333. Public
  334. Published
  335. Property iam : String Index 0 Read Fiam Write Setiam;
  336. Property sys : String Index 8 Read Fsys Write Setsys;
  337. Property svc : String Index 16 Read Fsvc Write Setsvc;
  338. Property op : String Index 24 Read Fop Write Setop;
  339. Property value : String Index 32 Read Fvalue Write Setvalue;
  340. Property values : TStringArray Index 40 Read Fvalues Write Setvalues;
  341. end;
  342. TConditionClass = Class of TCondition;
  343. { --------------------------------------------------------------------
  344. TLogConfig
  345. --------------------------------------------------------------------}
  346. TLogConfig = Class(TGoogleBaseObject)
  347. Private
  348. Fcounter : TCounterOptions;
  349. FdataAccess : TDataAccessOptions;
  350. FcloudAudit : TCloudAuditOptions;
  351. Protected
  352. //Property setters
  353. Procedure Setcounter(AIndex : Integer; const AValue : TCounterOptions); virtual;
  354. Procedure SetdataAccess(AIndex : Integer; const AValue : TDataAccessOptions); virtual;
  355. Procedure SetcloudAudit(AIndex : Integer; const AValue : TCloudAuditOptions); virtual;
  356. Public
  357. Published
  358. Property counter : TCounterOptions Index 0 Read Fcounter Write Setcounter;
  359. Property dataAccess : TDataAccessOptions Index 8 Read FdataAccess Write SetdataAccess;
  360. Property cloudAudit : TCloudAuditOptions Index 16 Read FcloudAudit Write SetcloudAudit;
  361. end;
  362. TLogConfigClass = Class of TLogConfig;
  363. { --------------------------------------------------------------------
  364. TCounterOptions
  365. --------------------------------------------------------------------}
  366. TCounterOptions = Class(TGoogleBaseObject)
  367. Private
  368. Fmetric : String;
  369. Ffield : String;
  370. Protected
  371. //Property setters
  372. Procedure Setmetric(AIndex : Integer; const AValue : String); virtual;
  373. Procedure Setfield(AIndex : Integer; const AValue : String); virtual;
  374. Public
  375. Published
  376. Property metric : String Index 0 Read Fmetric Write Setmetric;
  377. Property field : String Index 8 Read Ffield Write Setfield;
  378. end;
  379. TCounterOptionsClass = Class of TCounterOptions;
  380. { --------------------------------------------------------------------
  381. TDataAccessOptions
  382. --------------------------------------------------------------------}
  383. TDataAccessOptions = Class(TGoogleBaseObject)
  384. Private
  385. Protected
  386. //Property setters
  387. Public
  388. Published
  389. end;
  390. TDataAccessOptionsClass = Class of TDataAccessOptions;
  391. { --------------------------------------------------------------------
  392. TCloudAuditOptions
  393. --------------------------------------------------------------------}
  394. TCloudAuditOptions = Class(TGoogleBaseObject)
  395. Private
  396. Protected
  397. //Property setters
  398. Public
  399. Published
  400. end;
  401. TCloudAuditOptionsClass = Class of TCloudAuditOptions;
  402. { --------------------------------------------------------------------
  403. TSetIamPolicyRequest
  404. --------------------------------------------------------------------}
  405. TSetIamPolicyRequest = Class(TGoogleBaseObject)
  406. Private
  407. Fpolicy : TPolicy;
  408. Protected
  409. //Property setters
  410. Procedure Setpolicy(AIndex : Integer; const AValue : TPolicy); virtual;
  411. Public
  412. Published
  413. Property policy : TPolicy Index 0 Read Fpolicy Write Setpolicy;
  414. end;
  415. TSetIamPolicyRequestClass = Class of TSetIamPolicyRequest;
  416. { --------------------------------------------------------------------
  417. TTestIamPermissionsRequest
  418. --------------------------------------------------------------------}
  419. TTestIamPermissionsRequest = Class(TGoogleBaseObject)
  420. Private
  421. Fpermissions : TStringArray;
  422. Protected
  423. //Property setters
  424. Procedure Setpermissions(AIndex : Integer; const AValue : TStringArray); virtual;
  425. //2.6.4. bug workaround
  426. {$IFDEF VER2_6}
  427. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  428. {$ENDIF VER2_6}
  429. Public
  430. Published
  431. Property permissions : TStringArray Index 0 Read Fpermissions Write Setpermissions;
  432. end;
  433. TTestIamPermissionsRequestClass = Class of TTestIamPermissionsRequest;
  434. { --------------------------------------------------------------------
  435. TTestIamPermissionsResponse
  436. --------------------------------------------------------------------}
  437. TTestIamPermissionsResponse = Class(TGoogleBaseObject)
  438. Private
  439. Fpermissions : TStringArray;
  440. Protected
  441. //Property setters
  442. Procedure Setpermissions(AIndex : Integer; const AValue : TStringArray); virtual;
  443. //2.6.4. bug workaround
  444. {$IFDEF VER2_6}
  445. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  446. {$ENDIF VER2_6}
  447. Public
  448. Published
  449. Property permissions : TStringArray Index 0 Read Fpermissions Write Setpermissions;
  450. end;
  451. TTestIamPermissionsResponseClass = Class of TTestIamPermissionsResponse;
  452. { --------------------------------------------------------------------
  453. TProjectsServiceAccountsKeysResource
  454. --------------------------------------------------------------------}
  455. //Optional query Options for TProjectsServiceAccountsKeysResource, method List
  456. TProjectsServiceAccountsKeysListOptions = Record
  457. keyTypes : String;
  458. end;
  459. TProjectsServiceAccountsKeysResource = Class(TGoogleResource)
  460. Public
  461. Class Function ResourceName : String; override;
  462. Class Function DefaultAPI : TGoogleAPIClass; override;
  463. Function List(_name: string; AQuery : string = '') : TListServiceAccountKeysResponse;
  464. Function List(_name: string; AQuery : TProjectsServiceAccountsKeyslistOptions) : TListServiceAccountKeysResponse;
  465. Function Get(_name: string) : TServiceAccountKey;
  466. Function Create(_name: string; aCreateServiceAccountKeyRequest : TCreateServiceAccountKeyRequest) : TServiceAccountKey;overload;
  467. Function Delete(_name: string) : TEmpty;
  468. end;
  469. { --------------------------------------------------------------------
  470. TProjectsServiceAccountsResource
  471. --------------------------------------------------------------------}
  472. //Optional query Options for TProjectsServiceAccountsResource, method List
  473. TProjectsServiceAccountsListOptions = Record
  474. pageSize : integer;
  475. pageToken : String;
  476. end;
  477. TProjectsServiceAccountsResource = Class(TGoogleResource)
  478. Private
  479. FKeysInstance : TProjectsServiceAccountsKeysResource;
  480. Function GetKeysInstance : TProjectsServiceAccountsKeysResource;virtual;
  481. Public
  482. Class Function ResourceName : String; override;
  483. Class Function DefaultAPI : TGoogleAPIClass; override;
  484. Function List(_name: string; AQuery : string = '') : TListServiceAccountsResponse;
  485. Function List(_name: string; AQuery : TProjectsServiceAccountslistOptions) : TListServiceAccountsResponse;
  486. Function Get(_name: string) : TServiceAccount;
  487. Function Create(_name: string; aCreateServiceAccountRequest : TCreateServiceAccountRequest) : TServiceAccount;overload;
  488. Function Update(_name: string; aServiceAccount : TServiceAccount) : TServiceAccount;
  489. Function Delete(_name: string) : TEmpty;
  490. Function SignBlob(_name: string; aSignBlobRequest : TSignBlobRequest) : TSignBlobResponse;
  491. Function GetIamPolicy(resource: string) : TPolicy;
  492. Function SetIamPolicy(resource: string; aSetIamPolicyRequest : TSetIamPolicyRequest) : TPolicy;
  493. Function TestIamPermissions(resource: string; aTestIamPermissionsRequest : TTestIamPermissionsRequest) : TTestIamPermissionsResponse;
  494. Function CreateKeysResource(AOwner : TComponent) : TProjectsServiceAccountsKeysResource;virtual;overload;
  495. Function CreateKeysResource : TProjectsServiceAccountsKeysResource;virtual;overload;
  496. Property KeysResource : TProjectsServiceAccountsKeysResource Read GetKeysInstance;
  497. end;
  498. { --------------------------------------------------------------------
  499. TProjectsResource
  500. --------------------------------------------------------------------}
  501. TProjectsResource = Class(TGoogleResource)
  502. Private
  503. FServiceAccountsKeysInstance : TProjectsServiceAccountsKeysResource;
  504. FServiceAccountsInstance : TProjectsServiceAccountsResource;
  505. Function GetServiceAccountsKeysInstance : TProjectsServiceAccountsKeysResource;virtual;
  506. Function GetServiceAccountsInstance : TProjectsServiceAccountsResource;virtual;
  507. Public
  508. Class Function ResourceName : String; override;
  509. Class Function DefaultAPI : TGoogleAPIClass; override;
  510. Function CreateServiceAccountsKeysResource(AOwner : TComponent) : TProjectsServiceAccountsKeysResource;virtual;overload;
  511. Function CreateServiceAccountsKeysResource : TProjectsServiceAccountsKeysResource;virtual;overload;
  512. Function CreateServiceAccountsResource(AOwner : TComponent) : TProjectsServiceAccountsResource;virtual;overload;
  513. Function CreateServiceAccountsResource : TProjectsServiceAccountsResource;virtual;overload;
  514. Property ServiceAccountsKeysResource : TProjectsServiceAccountsKeysResource Read GetServiceAccountsKeysInstance;
  515. Property ServiceAccountsResource : TProjectsServiceAccountsResource Read GetServiceAccountsInstance;
  516. end;
  517. { --------------------------------------------------------------------
  518. TIamAPI
  519. --------------------------------------------------------------------}
  520. TIamAPI = Class(TGoogleAPI)
  521. Private
  522. FProjectsServiceAccountsKeysInstance : TProjectsServiceAccountsKeysResource;
  523. FProjectsServiceAccountsInstance : TProjectsServiceAccountsResource;
  524. FProjectsInstance : TProjectsResource;
  525. Function GetProjectsServiceAccountsKeysInstance : TProjectsServiceAccountsKeysResource;virtual;
  526. Function GetProjectsServiceAccountsInstance : TProjectsServiceAccountsResource;virtual;
  527. Function GetProjectsInstance : TProjectsResource;virtual;
  528. Public
  529. //Override class functions with API info
  530. Class Function APIName : String; override;
  531. Class Function APIVersion : String; override;
  532. Class Function APIRevision : String; override;
  533. Class Function APIID : String; override;
  534. Class Function APITitle : String; override;
  535. Class Function APIDescription : String; override;
  536. Class Function APIOwnerDomain : String; override;
  537. Class Function APIOwnerName : String; override;
  538. Class Function APIIcon16 : String; override;
  539. Class Function APIIcon32 : String; override;
  540. Class Function APIdocumentationLink : String; override;
  541. Class Function APIrootUrl : string; override;
  542. Class Function APIbasePath : string;override;
  543. Class Function APIbaseURL : String;override;
  544. Class Function APIProtocol : string;override;
  545. Class Function APIservicePath : string;override;
  546. Class Function APIbatchPath : String;override;
  547. Class Function APIAuthScopes : TScopeInfoArray;override;
  548. Class Function APINeedsAuth : Boolean;override;
  549. Class Procedure RegisterAPIResources; override;
  550. //Add create function for resources
  551. Function CreateProjectsServiceAccountsKeysResource(AOwner : TComponent) : TProjectsServiceAccountsKeysResource;virtual;overload;
  552. Function CreateProjectsServiceAccountsKeysResource : TProjectsServiceAccountsKeysResource;virtual;overload;
  553. Function CreateProjectsServiceAccountsResource(AOwner : TComponent) : TProjectsServiceAccountsResource;virtual;overload;
  554. Function CreateProjectsServiceAccountsResource : TProjectsServiceAccountsResource;virtual;overload;
  555. Function CreateProjectsResource(AOwner : TComponent) : TProjectsResource;virtual;overload;
  556. Function CreateProjectsResource : TProjectsResource;virtual;overload;
  557. //Add default on-demand instances for resources
  558. Property ProjectsServiceAccountsKeysResource : TProjectsServiceAccountsKeysResource Read GetProjectsServiceAccountsKeysInstance;
  559. Property ProjectsServiceAccountsResource : TProjectsServiceAccountsResource Read GetProjectsServiceAccountsInstance;
  560. Property ProjectsResource : TProjectsResource Read GetProjectsInstance;
  561. end;
  562. implementation
  563. { --------------------------------------------------------------------
  564. TListServiceAccountsResponse
  565. --------------------------------------------------------------------}
  566. Procedure TListServiceAccountsResponse.Setaccounts(AIndex : Integer; const AValue : TListServiceAccountsResponseTypeaccountsArray);
  567. begin
  568. If (Faccounts=AValue) then exit;
  569. Faccounts:=AValue;
  570. MarkPropertyChanged(AIndex);
  571. end;
  572. Procedure TListServiceAccountsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  573. begin
  574. If (FnextPageToken=AValue) then exit;
  575. FnextPageToken:=AValue;
  576. MarkPropertyChanged(AIndex);
  577. end;
  578. //2.6.4. bug workaround
  579. {$IFDEF VER2_6}
  580. Procedure TListServiceAccountsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  581. begin
  582. Case AName of
  583. 'accounts' : SetLength(Faccounts,ALength);
  584. else
  585. Inherited SetArrayLength(AName,ALength);
  586. end;
  587. end;
  588. {$ENDIF VER2_6}
  589. { --------------------------------------------------------------------
  590. TServiceAccount
  591. --------------------------------------------------------------------}
  592. Procedure TServiceAccount.Setname(AIndex : Integer; const AValue : String);
  593. begin
  594. If (Fname=AValue) then exit;
  595. Fname:=AValue;
  596. MarkPropertyChanged(AIndex);
  597. end;
  598. Procedure TServiceAccount.SetprojectId(AIndex : Integer; const AValue : String);
  599. begin
  600. If (FprojectId=AValue) then exit;
  601. FprojectId:=AValue;
  602. MarkPropertyChanged(AIndex);
  603. end;
  604. Procedure TServiceAccount.SetuniqueId(AIndex : Integer; const AValue : String);
  605. begin
  606. If (FuniqueId=AValue) then exit;
  607. FuniqueId:=AValue;
  608. MarkPropertyChanged(AIndex);
  609. end;
  610. Procedure TServiceAccount.Setemail(AIndex : Integer; const AValue : String);
  611. begin
  612. If (Femail=AValue) then exit;
  613. Femail:=AValue;
  614. MarkPropertyChanged(AIndex);
  615. end;
  616. Procedure TServiceAccount.SetdisplayName(AIndex : Integer; const AValue : String);
  617. begin
  618. If (FdisplayName=AValue) then exit;
  619. FdisplayName:=AValue;
  620. MarkPropertyChanged(AIndex);
  621. end;
  622. Procedure TServiceAccount.Setetag(AIndex : Integer; const AValue : String);
  623. begin
  624. If (Fetag=AValue) then exit;
  625. Fetag:=AValue;
  626. MarkPropertyChanged(AIndex);
  627. end;
  628. Procedure TServiceAccount.Setoauth2ClientId(AIndex : Integer; const AValue : String);
  629. begin
  630. If (Foauth2ClientId=AValue) then exit;
  631. Foauth2ClientId:=AValue;
  632. MarkPropertyChanged(AIndex);
  633. end;
  634. { --------------------------------------------------------------------
  635. TCreateServiceAccountRequest
  636. --------------------------------------------------------------------}
  637. Procedure TCreateServiceAccountRequest.SetaccountId(AIndex : Integer; const AValue : String);
  638. begin
  639. If (FaccountId=AValue) then exit;
  640. FaccountId:=AValue;
  641. MarkPropertyChanged(AIndex);
  642. end;
  643. Procedure TCreateServiceAccountRequest.SetserviceAccount(AIndex : Integer; const AValue : TServiceAccount);
  644. begin
  645. If (FserviceAccount=AValue) then exit;
  646. FserviceAccount:=AValue;
  647. MarkPropertyChanged(AIndex);
  648. end;
  649. { --------------------------------------------------------------------
  650. TEmpty
  651. --------------------------------------------------------------------}
  652. { --------------------------------------------------------------------
  653. TListServiceAccountKeysResponse
  654. --------------------------------------------------------------------}
  655. Procedure TListServiceAccountKeysResponse.Setkeys(AIndex : Integer; const AValue : TListServiceAccountKeysResponseTypekeysArray);
  656. begin
  657. If (Fkeys=AValue) then exit;
  658. Fkeys:=AValue;
  659. MarkPropertyChanged(AIndex);
  660. end;
  661. //2.6.4. bug workaround
  662. {$IFDEF VER2_6}
  663. Procedure TListServiceAccountKeysResponse.SetArrayLength(Const AName : String; ALength : Longint);
  664. begin
  665. Case AName of
  666. 'keys' : SetLength(Fkeys,ALength);
  667. else
  668. Inherited SetArrayLength(AName,ALength);
  669. end;
  670. end;
  671. {$ENDIF VER2_6}
  672. { --------------------------------------------------------------------
  673. TServiceAccountKey
  674. --------------------------------------------------------------------}
  675. Procedure TServiceAccountKey.Setname(AIndex : Integer; const AValue : String);
  676. begin
  677. If (Fname=AValue) then exit;
  678. Fname:=AValue;
  679. MarkPropertyChanged(AIndex);
  680. end;
  681. Procedure TServiceAccountKey.SetprivateKeyType(AIndex : Integer; const AValue : String);
  682. begin
  683. If (FprivateKeyType=AValue) then exit;
  684. FprivateKeyType:=AValue;
  685. MarkPropertyChanged(AIndex);
  686. end;
  687. Procedure TServiceAccountKey.SetprivateKeyData(AIndex : Integer; const AValue : String);
  688. begin
  689. If (FprivateKeyData=AValue) then exit;
  690. FprivateKeyData:=AValue;
  691. MarkPropertyChanged(AIndex);
  692. end;
  693. Procedure TServiceAccountKey.SetvalidAfterTime(AIndex : Integer; const AValue : String);
  694. begin
  695. If (FvalidAfterTime=AValue) then exit;
  696. FvalidAfterTime:=AValue;
  697. MarkPropertyChanged(AIndex);
  698. end;
  699. Procedure TServiceAccountKey.SetvalidBeforeTime(AIndex : Integer; const AValue : String);
  700. begin
  701. If (FvalidBeforeTime=AValue) then exit;
  702. FvalidBeforeTime:=AValue;
  703. MarkPropertyChanged(AIndex);
  704. end;
  705. { --------------------------------------------------------------------
  706. TCreateServiceAccountKeyRequest
  707. --------------------------------------------------------------------}
  708. Procedure TCreateServiceAccountKeyRequest.SetprivateKeyType(AIndex : Integer; const AValue : String);
  709. begin
  710. If (FprivateKeyType=AValue) then exit;
  711. FprivateKeyType:=AValue;
  712. MarkPropertyChanged(AIndex);
  713. end;
  714. { --------------------------------------------------------------------
  715. TSignBlobRequest
  716. --------------------------------------------------------------------}
  717. Procedure TSignBlobRequest.SetbytesToSign(AIndex : Integer; const AValue : String);
  718. begin
  719. If (FbytesToSign=AValue) then exit;
  720. FbytesToSign:=AValue;
  721. MarkPropertyChanged(AIndex);
  722. end;
  723. { --------------------------------------------------------------------
  724. TSignBlobResponse
  725. --------------------------------------------------------------------}
  726. Procedure TSignBlobResponse.SetkeyId(AIndex : Integer; const AValue : String);
  727. begin
  728. If (FkeyId=AValue) then exit;
  729. FkeyId:=AValue;
  730. MarkPropertyChanged(AIndex);
  731. end;
  732. Procedure TSignBlobResponse.Setsignature(AIndex : Integer; const AValue : String);
  733. begin
  734. If (Fsignature=AValue) then exit;
  735. Fsignature:=AValue;
  736. MarkPropertyChanged(AIndex);
  737. end;
  738. { --------------------------------------------------------------------
  739. TPolicy
  740. --------------------------------------------------------------------}
  741. Procedure TPolicy.Setversion(AIndex : Integer; const AValue : integer);
  742. begin
  743. If (Fversion=AValue) then exit;
  744. Fversion:=AValue;
  745. MarkPropertyChanged(AIndex);
  746. end;
  747. Procedure TPolicy.Setbindings(AIndex : Integer; const AValue : TPolicyTypebindingsArray);
  748. begin
  749. If (Fbindings=AValue) then exit;
  750. Fbindings:=AValue;
  751. MarkPropertyChanged(AIndex);
  752. end;
  753. Procedure TPolicy.Setrules(AIndex : Integer; const AValue : TPolicyTyperulesArray);
  754. begin
  755. If (Frules=AValue) then exit;
  756. Frules:=AValue;
  757. MarkPropertyChanged(AIndex);
  758. end;
  759. Procedure TPolicy.Setetag(AIndex : Integer; const AValue : String);
  760. begin
  761. If (Fetag=AValue) then exit;
  762. Fetag:=AValue;
  763. MarkPropertyChanged(AIndex);
  764. end;
  765. //2.6.4. bug workaround
  766. {$IFDEF VER2_6}
  767. Procedure TPolicy.SetArrayLength(Const AName : String; ALength : Longint);
  768. begin
  769. Case AName of
  770. 'bindings' : SetLength(Fbindings,ALength);
  771. 'rules' : SetLength(Frules,ALength);
  772. else
  773. Inherited SetArrayLength(AName,ALength);
  774. end;
  775. end;
  776. {$ENDIF VER2_6}
  777. { --------------------------------------------------------------------
  778. TBinding
  779. --------------------------------------------------------------------}
  780. Procedure TBinding.Setrole(AIndex : Integer; const AValue : String);
  781. begin
  782. If (Frole=AValue) then exit;
  783. Frole:=AValue;
  784. MarkPropertyChanged(AIndex);
  785. end;
  786. Procedure TBinding.Setmembers(AIndex : Integer; const AValue : TStringArray);
  787. begin
  788. If (Fmembers=AValue) then exit;
  789. Fmembers:=AValue;
  790. MarkPropertyChanged(AIndex);
  791. end;
  792. //2.6.4. bug workaround
  793. {$IFDEF VER2_6}
  794. Procedure TBinding.SetArrayLength(Const AName : String; ALength : Longint);
  795. begin
  796. Case AName of
  797. 'members' : SetLength(Fmembers,ALength);
  798. else
  799. Inherited SetArrayLength(AName,ALength);
  800. end;
  801. end;
  802. {$ENDIF VER2_6}
  803. { --------------------------------------------------------------------
  804. TRule
  805. --------------------------------------------------------------------}
  806. Procedure TRule.Setdescription(AIndex : Integer; const AValue : String);
  807. begin
  808. If (Fdescription=AValue) then exit;
  809. Fdescription:=AValue;
  810. MarkPropertyChanged(AIndex);
  811. end;
  812. Procedure TRule.Setpermissions(AIndex : Integer; const AValue : TStringArray);
  813. begin
  814. If (Fpermissions=AValue) then exit;
  815. Fpermissions:=AValue;
  816. MarkPropertyChanged(AIndex);
  817. end;
  818. Procedure TRule.Setaction(AIndex : Integer; const AValue : String);
  819. begin
  820. If (Faction=AValue) then exit;
  821. Faction:=AValue;
  822. MarkPropertyChanged(AIndex);
  823. end;
  824. Procedure TRule.Set_in(AIndex : Integer; const AValue : TStringArray);
  825. begin
  826. If (F_in=AValue) then exit;
  827. F_in:=AValue;
  828. MarkPropertyChanged(AIndex);
  829. end;
  830. Procedure TRule.SetnotIn(AIndex : Integer; const AValue : TStringArray);
  831. begin
  832. If (FnotIn=AValue) then exit;
  833. FnotIn:=AValue;
  834. MarkPropertyChanged(AIndex);
  835. end;
  836. Procedure TRule.Setconditions(AIndex : Integer; const AValue : TRuleTypeconditionsArray);
  837. begin
  838. If (Fconditions=AValue) then exit;
  839. Fconditions:=AValue;
  840. MarkPropertyChanged(AIndex);
  841. end;
  842. Procedure TRule.SetlogConfig(AIndex : Integer; const AValue : TRuleTypelogConfigArray);
  843. begin
  844. If (FlogConfig=AValue) then exit;
  845. FlogConfig:=AValue;
  846. MarkPropertyChanged(AIndex);
  847. end;
  848. Class Function TRule.ExportPropertyName(Const AName : String) :String;
  849. begin
  850. Case AName of
  851. '_in' : Result:='in';
  852. else
  853. Result:=Inherited ExportPropertyName(AName);
  854. end;
  855. end;
  856. //2.6.4. bug workaround
  857. {$IFDEF VER2_6}
  858. Procedure TRule.SetArrayLength(Const AName : String; ALength : Longint);
  859. begin
  860. Case AName of
  861. 'permissions' : SetLength(Fpermissions,ALength);
  862. '_in' : SetLength(F_in,ALength);
  863. 'notin' : SetLength(FnotIn,ALength);
  864. 'conditions' : SetLength(Fconditions,ALength);
  865. 'logconfig' : SetLength(FlogConfig,ALength);
  866. else
  867. Inherited SetArrayLength(AName,ALength);
  868. end;
  869. end;
  870. {$ENDIF VER2_6}
  871. { --------------------------------------------------------------------
  872. TCondition
  873. --------------------------------------------------------------------}
  874. Procedure TCondition.Setiam(AIndex : Integer; const AValue : String);
  875. begin
  876. If (Fiam=AValue) then exit;
  877. Fiam:=AValue;
  878. MarkPropertyChanged(AIndex);
  879. end;
  880. Procedure TCondition.Setsys(AIndex : Integer; const AValue : String);
  881. begin
  882. If (Fsys=AValue) then exit;
  883. Fsys:=AValue;
  884. MarkPropertyChanged(AIndex);
  885. end;
  886. Procedure TCondition.Setsvc(AIndex : Integer; const AValue : String);
  887. begin
  888. If (Fsvc=AValue) then exit;
  889. Fsvc:=AValue;
  890. MarkPropertyChanged(AIndex);
  891. end;
  892. Procedure TCondition.Setop(AIndex : Integer; const AValue : String);
  893. begin
  894. If (Fop=AValue) then exit;
  895. Fop:=AValue;
  896. MarkPropertyChanged(AIndex);
  897. end;
  898. Procedure TCondition.Setvalue(AIndex : Integer; const AValue : String);
  899. begin
  900. If (Fvalue=AValue) then exit;
  901. Fvalue:=AValue;
  902. MarkPropertyChanged(AIndex);
  903. end;
  904. Procedure TCondition.Setvalues(AIndex : Integer; const AValue : TStringArray);
  905. begin
  906. If (Fvalues=AValue) then exit;
  907. Fvalues:=AValue;
  908. MarkPropertyChanged(AIndex);
  909. end;
  910. //2.6.4. bug workaround
  911. {$IFDEF VER2_6}
  912. Procedure TCondition.SetArrayLength(Const AName : String; ALength : Longint);
  913. begin
  914. Case AName of
  915. 'values' : SetLength(Fvalues,ALength);
  916. else
  917. Inherited SetArrayLength(AName,ALength);
  918. end;
  919. end;
  920. {$ENDIF VER2_6}
  921. { --------------------------------------------------------------------
  922. TLogConfig
  923. --------------------------------------------------------------------}
  924. Procedure TLogConfig.Setcounter(AIndex : Integer; const AValue : TCounterOptions);
  925. begin
  926. If (Fcounter=AValue) then exit;
  927. Fcounter:=AValue;
  928. MarkPropertyChanged(AIndex);
  929. end;
  930. Procedure TLogConfig.SetdataAccess(AIndex : Integer; const AValue : TDataAccessOptions);
  931. begin
  932. If (FdataAccess=AValue) then exit;
  933. FdataAccess:=AValue;
  934. MarkPropertyChanged(AIndex);
  935. end;
  936. Procedure TLogConfig.SetcloudAudit(AIndex : Integer; const AValue : TCloudAuditOptions);
  937. begin
  938. If (FcloudAudit=AValue) then exit;
  939. FcloudAudit:=AValue;
  940. MarkPropertyChanged(AIndex);
  941. end;
  942. { --------------------------------------------------------------------
  943. TCounterOptions
  944. --------------------------------------------------------------------}
  945. Procedure TCounterOptions.Setmetric(AIndex : Integer; const AValue : String);
  946. begin
  947. If (Fmetric=AValue) then exit;
  948. Fmetric:=AValue;
  949. MarkPropertyChanged(AIndex);
  950. end;
  951. Procedure TCounterOptions.Setfield(AIndex : Integer; const AValue : String);
  952. begin
  953. If (Ffield=AValue) then exit;
  954. Ffield:=AValue;
  955. MarkPropertyChanged(AIndex);
  956. end;
  957. { --------------------------------------------------------------------
  958. TDataAccessOptions
  959. --------------------------------------------------------------------}
  960. { --------------------------------------------------------------------
  961. TCloudAuditOptions
  962. --------------------------------------------------------------------}
  963. { --------------------------------------------------------------------
  964. TSetIamPolicyRequest
  965. --------------------------------------------------------------------}
  966. Procedure TSetIamPolicyRequest.Setpolicy(AIndex : Integer; const AValue : TPolicy);
  967. begin
  968. If (Fpolicy=AValue) then exit;
  969. Fpolicy:=AValue;
  970. MarkPropertyChanged(AIndex);
  971. end;
  972. { --------------------------------------------------------------------
  973. TTestIamPermissionsRequest
  974. --------------------------------------------------------------------}
  975. Procedure TTestIamPermissionsRequest.Setpermissions(AIndex : Integer; const AValue : TStringArray);
  976. begin
  977. If (Fpermissions=AValue) then exit;
  978. Fpermissions:=AValue;
  979. MarkPropertyChanged(AIndex);
  980. end;
  981. //2.6.4. bug workaround
  982. {$IFDEF VER2_6}
  983. Procedure TTestIamPermissionsRequest.SetArrayLength(Const AName : String; ALength : Longint);
  984. begin
  985. Case AName of
  986. 'permissions' : SetLength(Fpermissions,ALength);
  987. else
  988. Inherited SetArrayLength(AName,ALength);
  989. end;
  990. end;
  991. {$ENDIF VER2_6}
  992. { --------------------------------------------------------------------
  993. TTestIamPermissionsResponse
  994. --------------------------------------------------------------------}
  995. Procedure TTestIamPermissionsResponse.Setpermissions(AIndex : Integer; const AValue : TStringArray);
  996. begin
  997. If (Fpermissions=AValue) then exit;
  998. Fpermissions:=AValue;
  999. MarkPropertyChanged(AIndex);
  1000. end;
  1001. //2.6.4. bug workaround
  1002. {$IFDEF VER2_6}
  1003. Procedure TTestIamPermissionsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1004. begin
  1005. Case AName of
  1006. 'permissions' : SetLength(Fpermissions,ALength);
  1007. else
  1008. Inherited SetArrayLength(AName,ALength);
  1009. end;
  1010. end;
  1011. {$ENDIF VER2_6}
  1012. { --------------------------------------------------------------------
  1013. TProjectsServiceAccountsKeysResource
  1014. --------------------------------------------------------------------}
  1015. Class Function TProjectsServiceAccountsKeysResource.ResourceName : String;
  1016. begin
  1017. Result:='keys';
  1018. end;
  1019. Class Function TProjectsServiceAccountsKeysResource.DefaultAPI : TGoogleAPIClass;
  1020. begin
  1021. Result:=TiamAPI;
  1022. end;
  1023. Function TProjectsServiceAccountsKeysResource.List(_name: string; AQuery : string = '') : TListServiceAccountKeysResponse;
  1024. Const
  1025. _HTTPMethod = 'GET';
  1026. _Path = 'v1/{+name}/keys';
  1027. _Methodid = 'iam.projects.serviceAccounts.keys.list';
  1028. Var
  1029. _P : String;
  1030. begin
  1031. _P:=SubstitutePath(_Path,['name',_name]);
  1032. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListServiceAccountKeysResponse) as TListServiceAccountKeysResponse;
  1033. end;
  1034. Function TProjectsServiceAccountsKeysResource.List(_name: string; AQuery : TProjectsServiceAccountsKeyslistOptions) : TListServiceAccountKeysResponse;
  1035. Var
  1036. _Q : String;
  1037. begin
  1038. _Q:='';
  1039. AddToQuery(_Q,'keyTypes',AQuery.keyTypes);
  1040. Result:=List(_name,_Q);
  1041. end;
  1042. Function TProjectsServiceAccountsKeysResource.Get(_name: string) : TServiceAccountKey;
  1043. Const
  1044. _HTTPMethod = 'GET';
  1045. _Path = 'v1/{+name}';
  1046. _Methodid = 'iam.projects.serviceAccounts.keys.get';
  1047. Var
  1048. _P : String;
  1049. begin
  1050. _P:=SubstitutePath(_Path,['name',_name]);
  1051. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TServiceAccountKey) as TServiceAccountKey;
  1052. end;
  1053. Function TProjectsServiceAccountsKeysResource.Create(_name: string; aCreateServiceAccountKeyRequest : TCreateServiceAccountKeyRequest) : TServiceAccountKey;
  1054. Const
  1055. _HTTPMethod = 'POST';
  1056. _Path = 'v1/{+name}/keys';
  1057. _Methodid = 'iam.projects.serviceAccounts.keys.create';
  1058. Var
  1059. _P : String;
  1060. begin
  1061. _P:=SubstitutePath(_Path,['name',_name]);
  1062. Result:=ServiceCall(_HTTPMethod,_P,'',aCreateServiceAccountKeyRequest,TServiceAccountKey) as TServiceAccountKey;
  1063. end;
  1064. Function TProjectsServiceAccountsKeysResource.Delete(_name: string) : TEmpty;
  1065. Const
  1066. _HTTPMethod = 'DELETE';
  1067. _Path = 'v1/{+name}';
  1068. _Methodid = 'iam.projects.serviceAccounts.keys.delete';
  1069. Var
  1070. _P : String;
  1071. begin
  1072. _P:=SubstitutePath(_Path,['name',_name]);
  1073. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TEmpty) as TEmpty;
  1074. end;
  1075. { --------------------------------------------------------------------
  1076. TProjectsServiceAccountsResource
  1077. --------------------------------------------------------------------}
  1078. Class Function TProjectsServiceAccountsResource.ResourceName : String;
  1079. begin
  1080. Result:='serviceAccounts';
  1081. end;
  1082. Class Function TProjectsServiceAccountsResource.DefaultAPI : TGoogleAPIClass;
  1083. begin
  1084. Result:=TiamAPI;
  1085. end;
  1086. Function TProjectsServiceAccountsResource.List(_name: string; AQuery : string = '') : TListServiceAccountsResponse;
  1087. Const
  1088. _HTTPMethod = 'GET';
  1089. _Path = 'v1/{+name}/serviceAccounts';
  1090. _Methodid = 'iam.projects.serviceAccounts.list';
  1091. Var
  1092. _P : String;
  1093. begin
  1094. _P:=SubstitutePath(_Path,['name',_name]);
  1095. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListServiceAccountsResponse) as TListServiceAccountsResponse;
  1096. end;
  1097. Function TProjectsServiceAccountsResource.List(_name: string; AQuery : TProjectsServiceAccountslistOptions) : TListServiceAccountsResponse;
  1098. Var
  1099. _Q : String;
  1100. begin
  1101. _Q:='';
  1102. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  1103. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1104. Result:=List(_name,_Q);
  1105. end;
  1106. Function TProjectsServiceAccountsResource.Get(_name: string) : TServiceAccount;
  1107. Const
  1108. _HTTPMethod = 'GET';
  1109. _Path = 'v1/{+name}';
  1110. _Methodid = 'iam.projects.serviceAccounts.get';
  1111. Var
  1112. _P : String;
  1113. begin
  1114. _P:=SubstitutePath(_Path,['name',_name]);
  1115. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TServiceAccount) as TServiceAccount;
  1116. end;
  1117. Function TProjectsServiceAccountsResource.Create(_name: string; aCreateServiceAccountRequest : TCreateServiceAccountRequest) : TServiceAccount;
  1118. Const
  1119. _HTTPMethod = 'POST';
  1120. _Path = 'v1/{+name}/serviceAccounts';
  1121. _Methodid = 'iam.projects.serviceAccounts.create';
  1122. Var
  1123. _P : String;
  1124. begin
  1125. _P:=SubstitutePath(_Path,['name',_name]);
  1126. Result:=ServiceCall(_HTTPMethod,_P,'',aCreateServiceAccountRequest,TServiceAccount) as TServiceAccount;
  1127. end;
  1128. Function TProjectsServiceAccountsResource.Update(_name: string; aServiceAccount : TServiceAccount) : TServiceAccount;
  1129. Const
  1130. _HTTPMethod = 'PUT';
  1131. _Path = 'v1/{+name}';
  1132. _Methodid = 'iam.projects.serviceAccounts.update';
  1133. Var
  1134. _P : String;
  1135. begin
  1136. _P:=SubstitutePath(_Path,['name',_name]);
  1137. Result:=ServiceCall(_HTTPMethod,_P,'',aServiceAccount,TServiceAccount) as TServiceAccount;
  1138. end;
  1139. Function TProjectsServiceAccountsResource.Delete(_name: string) : TEmpty;
  1140. Const
  1141. _HTTPMethod = 'DELETE';
  1142. _Path = 'v1/{+name}';
  1143. _Methodid = 'iam.projects.serviceAccounts.delete';
  1144. Var
  1145. _P : String;
  1146. begin
  1147. _P:=SubstitutePath(_Path,['name',_name]);
  1148. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TEmpty) as TEmpty;
  1149. end;
  1150. Function TProjectsServiceAccountsResource.SignBlob(_name: string; aSignBlobRequest : TSignBlobRequest) : TSignBlobResponse;
  1151. Const
  1152. _HTTPMethod = 'POST';
  1153. _Path = 'v1/{+name}:signBlob';
  1154. _Methodid = 'iam.projects.serviceAccounts.signBlob';
  1155. Var
  1156. _P : String;
  1157. begin
  1158. _P:=SubstitutePath(_Path,['name',_name]);
  1159. Result:=ServiceCall(_HTTPMethod,_P,'',aSignBlobRequest,TSignBlobResponse) as TSignBlobResponse;
  1160. end;
  1161. Function TProjectsServiceAccountsResource.GetIamPolicy(resource: string) : TPolicy;
  1162. Const
  1163. _HTTPMethod = 'POST';
  1164. _Path = 'v1/{+resource}:getIamPolicy';
  1165. _Methodid = 'iam.projects.serviceAccounts.getIamPolicy';
  1166. Var
  1167. _P : String;
  1168. begin
  1169. _P:=SubstitutePath(_Path,['resource',resource]);
  1170. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TPolicy) as TPolicy;
  1171. end;
  1172. Function TProjectsServiceAccountsResource.SetIamPolicy(resource: string; aSetIamPolicyRequest : TSetIamPolicyRequest) : TPolicy;
  1173. Const
  1174. _HTTPMethod = 'POST';
  1175. _Path = 'v1/{+resource}:setIamPolicy';
  1176. _Methodid = 'iam.projects.serviceAccounts.setIamPolicy';
  1177. Var
  1178. _P : String;
  1179. begin
  1180. _P:=SubstitutePath(_Path,['resource',resource]);
  1181. Result:=ServiceCall(_HTTPMethod,_P,'',aSetIamPolicyRequest,TPolicy) as TPolicy;
  1182. end;
  1183. Function TProjectsServiceAccountsResource.TestIamPermissions(resource: string; aTestIamPermissionsRequest : TTestIamPermissionsRequest) : TTestIamPermissionsResponse;
  1184. Const
  1185. _HTTPMethod = 'POST';
  1186. _Path = 'v1/{+resource}:testIamPermissions';
  1187. _Methodid = 'iam.projects.serviceAccounts.testIamPermissions';
  1188. Var
  1189. _P : String;
  1190. begin
  1191. _P:=SubstitutePath(_Path,['resource',resource]);
  1192. Result:=ServiceCall(_HTTPMethod,_P,'',aTestIamPermissionsRequest,TTestIamPermissionsResponse) as TTestIamPermissionsResponse;
  1193. end;
  1194. Function TProjectsServiceAccountsResource.GetKeysInstance : TProjectsServiceAccountsKeysResource;
  1195. begin
  1196. if (FKeysInstance=Nil) then
  1197. FKeysInstance:=CreateKeysResource;
  1198. Result:=FKeysInstance;
  1199. end;
  1200. Function TProjectsServiceAccountsResource.CreateKeysResource : TProjectsServiceAccountsKeysResource;
  1201. begin
  1202. Result:=CreateKeysResource(Self);
  1203. end;
  1204. Function TProjectsServiceAccountsResource.CreateKeysResource(AOwner : TComponent) : TProjectsServiceAccountsKeysResource;
  1205. begin
  1206. Result:=TProjectsServiceAccountsKeysResource.Create(AOwner);
  1207. Result.API:=Self.API;
  1208. end;
  1209. { --------------------------------------------------------------------
  1210. TProjectsResource
  1211. --------------------------------------------------------------------}
  1212. Class Function TProjectsResource.ResourceName : String;
  1213. begin
  1214. Result:='projects';
  1215. end;
  1216. Class Function TProjectsResource.DefaultAPI : TGoogleAPIClass;
  1217. begin
  1218. Result:=TiamAPI;
  1219. end;
  1220. Function TProjectsResource.GetServiceAccountsKeysInstance : TProjectsServiceAccountsKeysResource;
  1221. begin
  1222. if (FServiceAccountsKeysInstance=Nil) then
  1223. FServiceAccountsKeysInstance:=CreateServiceAccountsKeysResource;
  1224. Result:=FServiceAccountsKeysInstance;
  1225. end;
  1226. Function TProjectsResource.CreateServiceAccountsKeysResource : TProjectsServiceAccountsKeysResource;
  1227. begin
  1228. Result:=CreateServiceAccountsKeysResource(Self);
  1229. end;
  1230. Function TProjectsResource.CreateServiceAccountsKeysResource(AOwner : TComponent) : TProjectsServiceAccountsKeysResource;
  1231. begin
  1232. Result:=TProjectsServiceAccountsKeysResource.Create(AOwner);
  1233. Result.API:=Self.API;
  1234. end;
  1235. Function TProjectsResource.GetServiceAccountsInstance : TProjectsServiceAccountsResource;
  1236. begin
  1237. if (FServiceAccountsInstance=Nil) then
  1238. FServiceAccountsInstance:=CreateServiceAccountsResource;
  1239. Result:=FServiceAccountsInstance;
  1240. end;
  1241. Function TProjectsResource.CreateServiceAccountsResource : TProjectsServiceAccountsResource;
  1242. begin
  1243. Result:=CreateServiceAccountsResource(Self);
  1244. end;
  1245. Function TProjectsResource.CreateServiceAccountsResource(AOwner : TComponent) : TProjectsServiceAccountsResource;
  1246. begin
  1247. Result:=TProjectsServiceAccountsResource.Create(AOwner);
  1248. Result.API:=Self.API;
  1249. end;
  1250. { --------------------------------------------------------------------
  1251. TIamAPI
  1252. --------------------------------------------------------------------}
  1253. Class Function TIamAPI.APIName : String;
  1254. begin
  1255. Result:='iam';
  1256. end;
  1257. Class Function TIamAPI.APIVersion : String;
  1258. begin
  1259. Result:='v1';
  1260. end;
  1261. Class Function TIamAPI.APIRevision : String;
  1262. begin
  1263. Result:='20160129';
  1264. end;
  1265. Class Function TIamAPI.APIID : String;
  1266. begin
  1267. Result:='iam:v1';
  1268. end;
  1269. Class Function TIamAPI.APITitle : String;
  1270. begin
  1271. Result:='Google Identity and Access Management API';
  1272. end;
  1273. Class Function TIamAPI.APIDescription : String;
  1274. begin
  1275. Result:='Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.';
  1276. end;
  1277. Class Function TIamAPI.APIOwnerDomain : String;
  1278. begin
  1279. Result:='google.com';
  1280. end;
  1281. Class Function TIamAPI.APIOwnerName : String;
  1282. begin
  1283. Result:='Google';
  1284. end;
  1285. Class Function TIamAPI.APIIcon16 : String;
  1286. begin
  1287. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1288. end;
  1289. Class Function TIamAPI.APIIcon32 : String;
  1290. begin
  1291. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1292. end;
  1293. Class Function TIamAPI.APIdocumentationLink : String;
  1294. begin
  1295. Result:='https://cloud.google.com/iam/';
  1296. end;
  1297. Class Function TIamAPI.APIrootUrl : string;
  1298. begin
  1299. Result:='https://iam.googleapis.com/';
  1300. end;
  1301. Class Function TIamAPI.APIbasePath : string;
  1302. begin
  1303. Result:='';
  1304. end;
  1305. Class Function TIamAPI.APIbaseURL : String;
  1306. begin
  1307. Result:='https://iam.googleapis.com/';
  1308. end;
  1309. Class Function TIamAPI.APIProtocol : string;
  1310. begin
  1311. Result:='rest';
  1312. end;
  1313. Class Function TIamAPI.APIservicePath : string;
  1314. begin
  1315. Result:='';
  1316. end;
  1317. Class Function TIamAPI.APIbatchPath : String;
  1318. begin
  1319. Result:='batch';
  1320. end;
  1321. Class Function TIamAPI.APIAuthScopes : TScopeInfoArray;
  1322. begin
  1323. SetLength(Result,1);
  1324. Result[0].Name:='https://www.googleapis.com/auth/cloud-platform';
  1325. Result[0].Description:='View and manage your data across Google Cloud Platform services';
  1326. end;
  1327. Class Function TIamAPI.APINeedsAuth : Boolean;
  1328. begin
  1329. Result:=True;
  1330. end;
  1331. Class Procedure TIamAPI.RegisterAPIResources;
  1332. begin
  1333. TListServiceAccountsResponse.RegisterObject;
  1334. TServiceAccount.RegisterObject;
  1335. TCreateServiceAccountRequest.RegisterObject;
  1336. TEmpty.RegisterObject;
  1337. TListServiceAccountKeysResponse.RegisterObject;
  1338. TServiceAccountKey.RegisterObject;
  1339. TCreateServiceAccountKeyRequest.RegisterObject;
  1340. TSignBlobRequest.RegisterObject;
  1341. TSignBlobResponse.RegisterObject;
  1342. TPolicy.RegisterObject;
  1343. TBinding.RegisterObject;
  1344. TRule.RegisterObject;
  1345. TCondition.RegisterObject;
  1346. TLogConfig.RegisterObject;
  1347. TCounterOptions.RegisterObject;
  1348. TDataAccessOptions.RegisterObject;
  1349. TCloudAuditOptions.RegisterObject;
  1350. TSetIamPolicyRequest.RegisterObject;
  1351. TTestIamPermissionsRequest.RegisterObject;
  1352. TTestIamPermissionsResponse.RegisterObject;
  1353. end;
  1354. Function TIamAPI.GetProjectsServiceAccountsKeysInstance : TProjectsServiceAccountsKeysResource;
  1355. begin
  1356. if (FProjectsServiceAccountsKeysInstance=Nil) then
  1357. FProjectsServiceAccountsKeysInstance:=CreateProjectsServiceAccountsKeysResource;
  1358. Result:=FProjectsServiceAccountsKeysInstance;
  1359. end;
  1360. Function TIamAPI.CreateProjectsServiceAccountsKeysResource : TProjectsServiceAccountsKeysResource;
  1361. begin
  1362. Result:=CreateProjectsServiceAccountsKeysResource(Self);
  1363. end;
  1364. Function TIamAPI.CreateProjectsServiceAccountsKeysResource(AOwner : TComponent) : TProjectsServiceAccountsKeysResource;
  1365. begin
  1366. Result:=TProjectsServiceAccountsKeysResource.Create(AOwner);
  1367. Result.API:=Self.API;
  1368. end;
  1369. Function TIamAPI.GetProjectsServiceAccountsInstance : TProjectsServiceAccountsResource;
  1370. begin
  1371. if (FProjectsServiceAccountsInstance=Nil) then
  1372. FProjectsServiceAccountsInstance:=CreateProjectsServiceAccountsResource;
  1373. Result:=FProjectsServiceAccountsInstance;
  1374. end;
  1375. Function TIamAPI.CreateProjectsServiceAccountsResource : TProjectsServiceAccountsResource;
  1376. begin
  1377. Result:=CreateProjectsServiceAccountsResource(Self);
  1378. end;
  1379. Function TIamAPI.CreateProjectsServiceAccountsResource(AOwner : TComponent) : TProjectsServiceAccountsResource;
  1380. begin
  1381. Result:=TProjectsServiceAccountsResource.Create(AOwner);
  1382. Result.API:=Self.API;
  1383. end;
  1384. Function TIamAPI.GetProjectsInstance : TProjectsResource;
  1385. begin
  1386. if (FProjectsInstance=Nil) then
  1387. FProjectsInstance:=CreateProjectsResource;
  1388. Result:=FProjectsInstance;
  1389. end;
  1390. Function TIamAPI.CreateProjectsResource : TProjectsResource;
  1391. begin
  1392. Result:=CreateProjectsResource(Self);
  1393. end;
  1394. Function TIamAPI.CreateProjectsResource(AOwner : TComponent) : TProjectsResource;
  1395. begin
  1396. Result:=TProjectsResource.Create(AOwner);
  1397. Result.API:=Self.API;
  1398. end;
  1399. initialization
  1400. TIamAPI.RegisterAPI;
  1401. end.