googlepubsub.pp 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138
  1. unit googlepubsub;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TSetIamPolicyRequest = Class;
  9. TPolicy = Class;
  10. TBinding = Class;
  11. TTestIamPermissionsRequest = Class;
  12. TTestIamPermissionsResponse = Class;
  13. TTopic = Class;
  14. TPublishRequest = Class;
  15. TPubsubMessage = Class;
  16. TPublishResponse = Class;
  17. TListTopicsResponse = Class;
  18. TListTopicSubscriptionsResponse = Class;
  19. TEmpty = Class;
  20. TSubscription = Class;
  21. TPushConfig = Class;
  22. TListSubscriptionsResponse = Class;
  23. TModifyAckDeadlineRequest = Class;
  24. TAcknowledgeRequest = Class;
  25. TPullRequest = Class;
  26. TPullResponse = Class;
  27. TReceivedMessage = Class;
  28. TModifyPushConfigRequest = Class;
  29. TSetIamPolicyRequestArray = Array of TSetIamPolicyRequest;
  30. TPolicyArray = Array of TPolicy;
  31. TBindingArray = Array of TBinding;
  32. TTestIamPermissionsRequestArray = Array of TTestIamPermissionsRequest;
  33. TTestIamPermissionsResponseArray = Array of TTestIamPermissionsResponse;
  34. TTopicArray = Array of TTopic;
  35. TPublishRequestArray = Array of TPublishRequest;
  36. TPubsubMessageArray = Array of TPubsubMessage;
  37. TPublishResponseArray = Array of TPublishResponse;
  38. TListTopicsResponseArray = Array of TListTopicsResponse;
  39. TListTopicSubscriptionsResponseArray = Array of TListTopicSubscriptionsResponse;
  40. TEmptyArray = Array of TEmpty;
  41. TSubscriptionArray = Array of TSubscription;
  42. TPushConfigArray = Array of TPushConfig;
  43. TListSubscriptionsResponseArray = Array of TListSubscriptionsResponse;
  44. TModifyAckDeadlineRequestArray = Array of TModifyAckDeadlineRequest;
  45. TAcknowledgeRequestArray = Array of TAcknowledgeRequest;
  46. TPullRequestArray = Array of TPullRequest;
  47. TPullResponseArray = Array of TPullResponse;
  48. TReceivedMessageArray = Array of TReceivedMessage;
  49. TModifyPushConfigRequestArray = Array of TModifyPushConfigRequest;
  50. //Anonymous types, using auto-generated names
  51. TPubsubMessageTypeattributes = Class;
  52. TPushConfigTypeattributes = Class;
  53. TPolicyTypebindingsArray = Array of TBinding;
  54. TPublishRequestTypemessagesArray = Array of TPubsubMessage;
  55. TListTopicsResponseTypetopicsArray = Array of TTopic;
  56. TListSubscriptionsResponseTypesubscriptionsArray = Array of TSubscription;
  57. TPullResponseTypereceivedMessagesArray = Array of TReceivedMessage;
  58. { --------------------------------------------------------------------
  59. TSetIamPolicyRequest
  60. --------------------------------------------------------------------}
  61. TSetIamPolicyRequest = Class(TGoogleBaseObject)
  62. Private
  63. Fpolicy : TPolicy;
  64. Protected
  65. //Property setters
  66. Procedure Setpolicy(AIndex : Integer; const AValue : TPolicy); virtual;
  67. Public
  68. Published
  69. Property policy : TPolicy Index 0 Read Fpolicy Write Setpolicy;
  70. end;
  71. TSetIamPolicyRequestClass = Class of TSetIamPolicyRequest;
  72. { --------------------------------------------------------------------
  73. TPolicy
  74. --------------------------------------------------------------------}
  75. TPolicy = Class(TGoogleBaseObject)
  76. Private
  77. Fversion : integer;
  78. Fbindings : TPolicyTypebindingsArray;
  79. Fetag : String;
  80. Protected
  81. //Property setters
  82. Procedure Setversion(AIndex : Integer; const AValue : integer); virtual;
  83. Procedure Setbindings(AIndex : Integer; const AValue : TPolicyTypebindingsArray); virtual;
  84. Procedure Setetag(AIndex : Integer; const AValue : String); virtual;
  85. //2.6.4. bug workaround
  86. {$IFDEF VER2_6}
  87. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  88. {$ENDIF VER2_6}
  89. Public
  90. Published
  91. Property version : integer Index 0 Read Fversion Write Setversion;
  92. Property bindings : TPolicyTypebindingsArray Index 8 Read Fbindings Write Setbindings;
  93. Property etag : String Index 16 Read Fetag Write Setetag;
  94. end;
  95. TPolicyClass = Class of TPolicy;
  96. { --------------------------------------------------------------------
  97. TBinding
  98. --------------------------------------------------------------------}
  99. TBinding = Class(TGoogleBaseObject)
  100. Private
  101. Frole : String;
  102. Fmembers : TStringArray;
  103. Protected
  104. //Property setters
  105. Procedure Setrole(AIndex : Integer; const AValue : String); virtual;
  106. Procedure Setmembers(AIndex : Integer; const AValue : TStringArray); virtual;
  107. //2.6.4. bug workaround
  108. {$IFDEF VER2_6}
  109. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  110. {$ENDIF VER2_6}
  111. Public
  112. Published
  113. Property role : String Index 0 Read Frole Write Setrole;
  114. Property members : TStringArray Index 8 Read Fmembers Write Setmembers;
  115. end;
  116. TBindingClass = Class of TBinding;
  117. { --------------------------------------------------------------------
  118. TTestIamPermissionsRequest
  119. --------------------------------------------------------------------}
  120. TTestIamPermissionsRequest = Class(TGoogleBaseObject)
  121. Private
  122. Fpermissions : TStringArray;
  123. Protected
  124. //Property setters
  125. Procedure Setpermissions(AIndex : Integer; const AValue : TStringArray); virtual;
  126. //2.6.4. bug workaround
  127. {$IFDEF VER2_6}
  128. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  129. {$ENDIF VER2_6}
  130. Public
  131. Published
  132. Property permissions : TStringArray Index 0 Read Fpermissions Write Setpermissions;
  133. end;
  134. TTestIamPermissionsRequestClass = Class of TTestIamPermissionsRequest;
  135. { --------------------------------------------------------------------
  136. TTestIamPermissionsResponse
  137. --------------------------------------------------------------------}
  138. TTestIamPermissionsResponse = Class(TGoogleBaseObject)
  139. Private
  140. Fpermissions : TStringArray;
  141. Protected
  142. //Property setters
  143. Procedure Setpermissions(AIndex : Integer; const AValue : TStringArray); virtual;
  144. //2.6.4. bug workaround
  145. {$IFDEF VER2_6}
  146. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  147. {$ENDIF VER2_6}
  148. Public
  149. Published
  150. Property permissions : TStringArray Index 0 Read Fpermissions Write Setpermissions;
  151. end;
  152. TTestIamPermissionsResponseClass = Class of TTestIamPermissionsResponse;
  153. { --------------------------------------------------------------------
  154. TTopic
  155. --------------------------------------------------------------------}
  156. TTopic = Class(TGoogleBaseObject)
  157. Private
  158. Fname : String;
  159. Protected
  160. //Property setters
  161. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  162. Public
  163. Published
  164. Property name : String Index 0 Read Fname Write Setname;
  165. end;
  166. TTopicClass = Class of TTopic;
  167. { --------------------------------------------------------------------
  168. TPublishRequest
  169. --------------------------------------------------------------------}
  170. TPublishRequest = Class(TGoogleBaseObject)
  171. Private
  172. Fmessages : TPublishRequestTypemessagesArray;
  173. Protected
  174. //Property setters
  175. Procedure Setmessages(AIndex : Integer; const AValue : TPublishRequestTypemessagesArray); virtual;
  176. //2.6.4. bug workaround
  177. {$IFDEF VER2_6}
  178. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  179. {$ENDIF VER2_6}
  180. Public
  181. Published
  182. Property messages : TPublishRequestTypemessagesArray Index 0 Read Fmessages Write Setmessages;
  183. end;
  184. TPublishRequestClass = Class of TPublishRequest;
  185. { --------------------------------------------------------------------
  186. TPubsubMessageTypeattributes
  187. --------------------------------------------------------------------}
  188. TPubsubMessageTypeattributes = Class(TGoogleBaseObject)
  189. Private
  190. Protected
  191. //Property setters
  192. Public
  193. Class Function AllowAdditionalProperties : Boolean; override;
  194. Published
  195. end;
  196. TPubsubMessageTypeattributesClass = Class of TPubsubMessageTypeattributes;
  197. { --------------------------------------------------------------------
  198. TPubsubMessage
  199. --------------------------------------------------------------------}
  200. TPubsubMessage = Class(TGoogleBaseObject)
  201. Private
  202. Fdata : String;
  203. Fattributes : TPubsubMessageTypeattributes;
  204. FmessageId : String;
  205. FpublishTime : String;
  206. Protected
  207. //Property setters
  208. Procedure Setdata(AIndex : Integer; const AValue : String); virtual;
  209. Procedure Setattributes(AIndex : Integer; const AValue : TPubsubMessageTypeattributes); virtual;
  210. Procedure SetmessageId(AIndex : Integer; const AValue : String); virtual;
  211. Procedure SetpublishTime(AIndex : Integer; const AValue : String); virtual;
  212. Public
  213. Published
  214. Property data : String Index 0 Read Fdata Write Setdata;
  215. Property attributes : TPubsubMessageTypeattributes Index 8 Read Fattributes Write Setattributes;
  216. Property messageId : String Index 16 Read FmessageId Write SetmessageId;
  217. Property publishTime : String Index 24 Read FpublishTime Write SetpublishTime;
  218. end;
  219. TPubsubMessageClass = Class of TPubsubMessage;
  220. { --------------------------------------------------------------------
  221. TPublishResponse
  222. --------------------------------------------------------------------}
  223. TPublishResponse = Class(TGoogleBaseObject)
  224. Private
  225. FmessageIds : TStringArray;
  226. Protected
  227. //Property setters
  228. Procedure SetmessageIds(AIndex : Integer; const AValue : TStringArray); virtual;
  229. //2.6.4. bug workaround
  230. {$IFDEF VER2_6}
  231. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  232. {$ENDIF VER2_6}
  233. Public
  234. Published
  235. Property messageIds : TStringArray Index 0 Read FmessageIds Write SetmessageIds;
  236. end;
  237. TPublishResponseClass = Class of TPublishResponse;
  238. { --------------------------------------------------------------------
  239. TListTopicsResponse
  240. --------------------------------------------------------------------}
  241. TListTopicsResponse = Class(TGoogleBaseObject)
  242. Private
  243. Ftopics : TListTopicsResponseTypetopicsArray;
  244. FnextPageToken : String;
  245. Protected
  246. //Property setters
  247. Procedure Settopics(AIndex : Integer; const AValue : TListTopicsResponseTypetopicsArray); virtual;
  248. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  249. //2.6.4. bug workaround
  250. {$IFDEF VER2_6}
  251. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  252. {$ENDIF VER2_6}
  253. Public
  254. Published
  255. Property topics : TListTopicsResponseTypetopicsArray Index 0 Read Ftopics Write Settopics;
  256. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  257. end;
  258. TListTopicsResponseClass = Class of TListTopicsResponse;
  259. { --------------------------------------------------------------------
  260. TListTopicSubscriptionsResponse
  261. --------------------------------------------------------------------}
  262. TListTopicSubscriptionsResponse = Class(TGoogleBaseObject)
  263. Private
  264. Fsubscriptions : TStringArray;
  265. FnextPageToken : String;
  266. Protected
  267. //Property setters
  268. Procedure Setsubscriptions(AIndex : Integer; const AValue : TStringArray); virtual;
  269. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  270. //2.6.4. bug workaround
  271. {$IFDEF VER2_6}
  272. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  273. {$ENDIF VER2_6}
  274. Public
  275. Published
  276. Property subscriptions : TStringArray Index 0 Read Fsubscriptions Write Setsubscriptions;
  277. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  278. end;
  279. TListTopicSubscriptionsResponseClass = Class of TListTopicSubscriptionsResponse;
  280. { --------------------------------------------------------------------
  281. TEmpty
  282. --------------------------------------------------------------------}
  283. TEmpty = Class(TGoogleBaseObject)
  284. Private
  285. Protected
  286. //Property setters
  287. Public
  288. Published
  289. end;
  290. TEmptyClass = Class of TEmpty;
  291. { --------------------------------------------------------------------
  292. TSubscription
  293. --------------------------------------------------------------------}
  294. TSubscription = Class(TGoogleBaseObject)
  295. Private
  296. Fname : String;
  297. Ftopic : String;
  298. FpushConfig : TPushConfig;
  299. FackDeadlineSeconds : integer;
  300. Protected
  301. //Property setters
  302. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  303. Procedure Settopic(AIndex : Integer; const AValue : String); virtual;
  304. Procedure SetpushConfig(AIndex : Integer; const AValue : TPushConfig); virtual;
  305. Procedure SetackDeadlineSeconds(AIndex : Integer; const AValue : integer); virtual;
  306. Public
  307. Published
  308. Property name : String Index 0 Read Fname Write Setname;
  309. Property topic : String Index 8 Read Ftopic Write Settopic;
  310. Property pushConfig : TPushConfig Index 16 Read FpushConfig Write SetpushConfig;
  311. Property ackDeadlineSeconds : integer Index 24 Read FackDeadlineSeconds Write SetackDeadlineSeconds;
  312. end;
  313. TSubscriptionClass = Class of TSubscription;
  314. { --------------------------------------------------------------------
  315. TPushConfigTypeattributes
  316. --------------------------------------------------------------------}
  317. TPushConfigTypeattributes = Class(TGoogleBaseObject)
  318. Private
  319. Protected
  320. //Property setters
  321. Public
  322. Class Function AllowAdditionalProperties : Boolean; override;
  323. Published
  324. end;
  325. TPushConfigTypeattributesClass = Class of TPushConfigTypeattributes;
  326. { --------------------------------------------------------------------
  327. TPushConfig
  328. --------------------------------------------------------------------}
  329. TPushConfig = Class(TGoogleBaseObject)
  330. Private
  331. FpushEndpoint : String;
  332. Fattributes : TPushConfigTypeattributes;
  333. Protected
  334. //Property setters
  335. Procedure SetpushEndpoint(AIndex : Integer; const AValue : String); virtual;
  336. Procedure Setattributes(AIndex : Integer; const AValue : TPushConfigTypeattributes); virtual;
  337. Public
  338. Published
  339. Property pushEndpoint : String Index 0 Read FpushEndpoint Write SetpushEndpoint;
  340. Property attributes : TPushConfigTypeattributes Index 8 Read Fattributes Write Setattributes;
  341. end;
  342. TPushConfigClass = Class of TPushConfig;
  343. { --------------------------------------------------------------------
  344. TListSubscriptionsResponse
  345. --------------------------------------------------------------------}
  346. TListSubscriptionsResponse = Class(TGoogleBaseObject)
  347. Private
  348. Fsubscriptions : TListSubscriptionsResponseTypesubscriptionsArray;
  349. FnextPageToken : String;
  350. Protected
  351. //Property setters
  352. Procedure Setsubscriptions(AIndex : Integer; const AValue : TListSubscriptionsResponseTypesubscriptionsArray); virtual;
  353. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  354. //2.6.4. bug workaround
  355. {$IFDEF VER2_6}
  356. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  357. {$ENDIF VER2_6}
  358. Public
  359. Published
  360. Property subscriptions : TListSubscriptionsResponseTypesubscriptionsArray Index 0 Read Fsubscriptions Write Setsubscriptions;
  361. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  362. end;
  363. TListSubscriptionsResponseClass = Class of TListSubscriptionsResponse;
  364. { --------------------------------------------------------------------
  365. TModifyAckDeadlineRequest
  366. --------------------------------------------------------------------}
  367. TModifyAckDeadlineRequest = Class(TGoogleBaseObject)
  368. Private
  369. FackIds : TStringArray;
  370. FackDeadlineSeconds : integer;
  371. Protected
  372. //Property setters
  373. Procedure SetackIds(AIndex : Integer; const AValue : TStringArray); virtual;
  374. Procedure SetackDeadlineSeconds(AIndex : Integer; const AValue : integer); virtual;
  375. //2.6.4. bug workaround
  376. {$IFDEF VER2_6}
  377. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  378. {$ENDIF VER2_6}
  379. Public
  380. Published
  381. Property ackIds : TStringArray Index 0 Read FackIds Write SetackIds;
  382. Property ackDeadlineSeconds : integer Index 8 Read FackDeadlineSeconds Write SetackDeadlineSeconds;
  383. end;
  384. TModifyAckDeadlineRequestClass = Class of TModifyAckDeadlineRequest;
  385. { --------------------------------------------------------------------
  386. TAcknowledgeRequest
  387. --------------------------------------------------------------------}
  388. TAcknowledgeRequest = Class(TGoogleBaseObject)
  389. Private
  390. FackIds : TStringArray;
  391. Protected
  392. //Property setters
  393. Procedure SetackIds(AIndex : Integer; const AValue : TStringArray); virtual;
  394. //2.6.4. bug workaround
  395. {$IFDEF VER2_6}
  396. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  397. {$ENDIF VER2_6}
  398. Public
  399. Published
  400. Property ackIds : TStringArray Index 0 Read FackIds Write SetackIds;
  401. end;
  402. TAcknowledgeRequestClass = Class of TAcknowledgeRequest;
  403. { --------------------------------------------------------------------
  404. TPullRequest
  405. --------------------------------------------------------------------}
  406. TPullRequest = Class(TGoogleBaseObject)
  407. Private
  408. FreturnImmediately : boolean;
  409. FmaxMessages : integer;
  410. Protected
  411. //Property setters
  412. Procedure SetreturnImmediately(AIndex : Integer; const AValue : boolean); virtual;
  413. Procedure SetmaxMessages(AIndex : Integer; const AValue : integer); virtual;
  414. Public
  415. Published
  416. Property returnImmediately : boolean Index 0 Read FreturnImmediately Write SetreturnImmediately;
  417. Property maxMessages : integer Index 8 Read FmaxMessages Write SetmaxMessages;
  418. end;
  419. TPullRequestClass = Class of TPullRequest;
  420. { --------------------------------------------------------------------
  421. TPullResponse
  422. --------------------------------------------------------------------}
  423. TPullResponse = Class(TGoogleBaseObject)
  424. Private
  425. FreceivedMessages : TPullResponseTypereceivedMessagesArray;
  426. Protected
  427. //Property setters
  428. Procedure SetreceivedMessages(AIndex : Integer; const AValue : TPullResponseTypereceivedMessagesArray); virtual;
  429. //2.6.4. bug workaround
  430. {$IFDEF VER2_6}
  431. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  432. {$ENDIF VER2_6}
  433. Public
  434. Published
  435. Property receivedMessages : TPullResponseTypereceivedMessagesArray Index 0 Read FreceivedMessages Write SetreceivedMessages;
  436. end;
  437. TPullResponseClass = Class of TPullResponse;
  438. { --------------------------------------------------------------------
  439. TReceivedMessage
  440. --------------------------------------------------------------------}
  441. TReceivedMessage = Class(TGoogleBaseObject)
  442. Private
  443. FackId : String;
  444. Fmessage : TPubsubMessage;
  445. Protected
  446. //Property setters
  447. Procedure SetackId(AIndex : Integer; const AValue : String); virtual;
  448. Procedure Setmessage(AIndex : Integer; const AValue : TPubsubMessage); virtual;
  449. Public
  450. Published
  451. Property ackId : String Index 0 Read FackId Write SetackId;
  452. Property message : TPubsubMessage Index 8 Read Fmessage Write Setmessage;
  453. end;
  454. TReceivedMessageClass = Class of TReceivedMessage;
  455. { --------------------------------------------------------------------
  456. TModifyPushConfigRequest
  457. --------------------------------------------------------------------}
  458. TModifyPushConfigRequest = Class(TGoogleBaseObject)
  459. Private
  460. FpushConfig : TPushConfig;
  461. Protected
  462. //Property setters
  463. Procedure SetpushConfig(AIndex : Integer; const AValue : TPushConfig); virtual;
  464. Public
  465. Published
  466. Property pushConfig : TPushConfig Index 0 Read FpushConfig Write SetpushConfig;
  467. end;
  468. TModifyPushConfigRequestClass = Class of TModifyPushConfigRequest;
  469. { --------------------------------------------------------------------
  470. TProjectsTopicsSubscriptionsResource
  471. --------------------------------------------------------------------}
  472. //Optional query Options for TProjectsTopicsSubscriptionsResource, method List
  473. TProjectsTopicsSubscriptionsListOptions = Record
  474. pageSize : integer;
  475. pageToken : String;
  476. end;
  477. TProjectsTopicsSubscriptionsResource = Class(TGoogleResource)
  478. Public
  479. Class Function ResourceName : String; override;
  480. Class Function DefaultAPI : TGoogleAPIClass; override;
  481. Function List(topic: string; AQuery : string = '') : TListTopicSubscriptionsResponse;
  482. Function List(topic: string; AQuery : TProjectsTopicsSubscriptionslistOptions) : TListTopicSubscriptionsResponse;
  483. end;
  484. { --------------------------------------------------------------------
  485. TProjectsTopicsResource
  486. --------------------------------------------------------------------}
  487. //Optional query Options for TProjectsTopicsResource, method List
  488. TProjectsTopicsListOptions = Record
  489. pageSize : integer;
  490. pageToken : String;
  491. end;
  492. TProjectsTopicsResource = Class(TGoogleResource)
  493. Private
  494. FSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;
  495. Function GetSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;virtual;
  496. Public
  497. Class Function ResourceName : String; override;
  498. Class Function DefaultAPI : TGoogleAPIClass; override;
  499. Function SetIamPolicy(resource: string; aSetIamPolicyRequest : TSetIamPolicyRequest) : TPolicy;
  500. Function GetIamPolicy(resource: string) : TPolicy;
  501. Function TestIamPermissions(resource: string; aTestIamPermissionsRequest : TTestIamPermissionsRequest) : TTestIamPermissionsResponse;
  502. Function Create(_name: string; aTopic : TTopic) : TTopic;overload;
  503. Function Publish(topic: string; aPublishRequest : TPublishRequest) : TPublishResponse;
  504. Function Get(topic: string) : TTopic;
  505. Function List(project: string; AQuery : string = '') : TListTopicsResponse;
  506. Function List(project: string; AQuery : TProjectsTopicslistOptions) : TListTopicsResponse;
  507. Function Delete(topic: string) : TEmpty;
  508. Function CreateSubscriptionsResource(AOwner : TComponent) : TProjectsTopicsSubscriptionsResource;virtual;overload;
  509. Function CreateSubscriptionsResource : TProjectsTopicsSubscriptionsResource;virtual;overload;
  510. Property SubscriptionsResource : TProjectsTopicsSubscriptionsResource Read GetSubscriptionsInstance;
  511. end;
  512. { --------------------------------------------------------------------
  513. TProjectsSubscriptionsResource
  514. --------------------------------------------------------------------}
  515. //Optional query Options for TProjectsSubscriptionsResource, method List
  516. TProjectsSubscriptionsListOptions = Record
  517. pageSize : integer;
  518. pageToken : String;
  519. end;
  520. TProjectsSubscriptionsResource = Class(TGoogleResource)
  521. Public
  522. Class Function ResourceName : String; override;
  523. Class Function DefaultAPI : TGoogleAPIClass; override;
  524. Function SetIamPolicy(resource: string; aSetIamPolicyRequest : TSetIamPolicyRequest) : TPolicy;
  525. Function GetIamPolicy(resource: string) : TPolicy;
  526. Function TestIamPermissions(resource: string; aTestIamPermissionsRequest : TTestIamPermissionsRequest) : TTestIamPermissionsResponse;
  527. Function Create(_name: string; aSubscription : TSubscription) : TSubscription;overload;
  528. Function Get(subscription: string) : TSubscription;
  529. Function List(project: string; AQuery : string = '') : TListSubscriptionsResponse;
  530. Function List(project: string; AQuery : TProjectsSubscriptionslistOptions) : TListSubscriptionsResponse;
  531. Function Delete(subscription: string) : TEmpty;
  532. Function ModifyAckDeadline(subscription: string; aModifyAckDeadlineRequest : TModifyAckDeadlineRequest) : TEmpty;
  533. Function Acknowledge(subscription: string; aAcknowledgeRequest : TAcknowledgeRequest) : TEmpty;
  534. Function Pull(subscription: string; aPullRequest : TPullRequest) : TPullResponse;
  535. Function ModifyPushConfig(subscription: string; aModifyPushConfigRequest : TModifyPushConfigRequest) : TEmpty;
  536. end;
  537. { --------------------------------------------------------------------
  538. TProjectsResource
  539. --------------------------------------------------------------------}
  540. TProjectsResource = Class(TGoogleResource)
  541. Private
  542. FTopicsSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;
  543. FTopicsInstance : TProjectsTopicsResource;
  544. FSubscriptionsInstance : TProjectsSubscriptionsResource;
  545. Function GetTopicsSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;virtual;
  546. Function GetTopicsInstance : TProjectsTopicsResource;virtual;
  547. Function GetSubscriptionsInstance : TProjectsSubscriptionsResource;virtual;
  548. Public
  549. Class Function ResourceName : String; override;
  550. Class Function DefaultAPI : TGoogleAPIClass; override;
  551. Function CreateTopicsSubscriptionsResource(AOwner : TComponent) : TProjectsTopicsSubscriptionsResource;virtual;overload;
  552. Function CreateTopicsSubscriptionsResource : TProjectsTopicsSubscriptionsResource;virtual;overload;
  553. Function CreateTopicsResource(AOwner : TComponent) : TProjectsTopicsResource;virtual;overload;
  554. Function CreateTopicsResource : TProjectsTopicsResource;virtual;overload;
  555. Function CreateSubscriptionsResource(AOwner : TComponent) : TProjectsSubscriptionsResource;virtual;overload;
  556. Function CreateSubscriptionsResource : TProjectsSubscriptionsResource;virtual;overload;
  557. Property TopicsSubscriptionsResource : TProjectsTopicsSubscriptionsResource Read GetTopicsSubscriptionsInstance;
  558. Property TopicsResource : TProjectsTopicsResource Read GetTopicsInstance;
  559. Property SubscriptionsResource : TProjectsSubscriptionsResource Read GetSubscriptionsInstance;
  560. end;
  561. { --------------------------------------------------------------------
  562. TPubsubAPI
  563. --------------------------------------------------------------------}
  564. TPubsubAPI = Class(TGoogleAPI)
  565. Private
  566. FProjectsTopicsSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;
  567. FProjectsTopicsInstance : TProjectsTopicsResource;
  568. FProjectsSubscriptionsInstance : TProjectsSubscriptionsResource;
  569. FProjectsInstance : TProjectsResource;
  570. Function GetProjectsTopicsSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;virtual;
  571. Function GetProjectsTopicsInstance : TProjectsTopicsResource;virtual;
  572. Function GetProjectsSubscriptionsInstance : TProjectsSubscriptionsResource;virtual;
  573. Function GetProjectsInstance : TProjectsResource;virtual;
  574. Public
  575. //Override class functions with API info
  576. Class Function APIName : String; override;
  577. Class Function APIVersion : String; override;
  578. Class Function APIRevision : String; override;
  579. Class Function APIID : String; override;
  580. Class Function APITitle : String; override;
  581. Class Function APIDescription : String; override;
  582. Class Function APIOwnerDomain : String; override;
  583. Class Function APIOwnerName : String; override;
  584. Class Function APIIcon16 : String; override;
  585. Class Function APIIcon32 : String; override;
  586. Class Function APIdocumentationLink : String; override;
  587. Class Function APIrootUrl : string; override;
  588. Class Function APIbasePath : string;override;
  589. Class Function APIbaseURL : String;override;
  590. Class Function APIProtocol : string;override;
  591. Class Function APIservicePath : string;override;
  592. Class Function APIbatchPath : String;override;
  593. Class Function APIAuthScopes : TScopeInfoArray;override;
  594. Class Function APINeedsAuth : Boolean;override;
  595. Class Procedure RegisterAPIResources; override;
  596. //Add create function for resources
  597. Function CreateProjectsTopicsSubscriptionsResource(AOwner : TComponent) : TProjectsTopicsSubscriptionsResource;virtual;overload;
  598. Function CreateProjectsTopicsSubscriptionsResource : TProjectsTopicsSubscriptionsResource;virtual;overload;
  599. Function CreateProjectsTopicsResource(AOwner : TComponent) : TProjectsTopicsResource;virtual;overload;
  600. Function CreateProjectsTopicsResource : TProjectsTopicsResource;virtual;overload;
  601. Function CreateProjectsSubscriptionsResource(AOwner : TComponent) : TProjectsSubscriptionsResource;virtual;overload;
  602. Function CreateProjectsSubscriptionsResource : TProjectsSubscriptionsResource;virtual;overload;
  603. Function CreateProjectsResource(AOwner : TComponent) : TProjectsResource;virtual;overload;
  604. Function CreateProjectsResource : TProjectsResource;virtual;overload;
  605. //Add default on-demand instances for resources
  606. Property ProjectsTopicsSubscriptionsResource : TProjectsTopicsSubscriptionsResource Read GetProjectsTopicsSubscriptionsInstance;
  607. Property ProjectsTopicsResource : TProjectsTopicsResource Read GetProjectsTopicsInstance;
  608. Property ProjectsSubscriptionsResource : TProjectsSubscriptionsResource Read GetProjectsSubscriptionsInstance;
  609. Property ProjectsResource : TProjectsResource Read GetProjectsInstance;
  610. end;
  611. implementation
  612. { --------------------------------------------------------------------
  613. TSetIamPolicyRequest
  614. --------------------------------------------------------------------}
  615. Procedure TSetIamPolicyRequest.Setpolicy(AIndex : Integer; const AValue : TPolicy);
  616. begin
  617. If (Fpolicy=AValue) then exit;
  618. Fpolicy:=AValue;
  619. MarkPropertyChanged(AIndex);
  620. end;
  621. { --------------------------------------------------------------------
  622. TPolicy
  623. --------------------------------------------------------------------}
  624. Procedure TPolicy.Setversion(AIndex : Integer; const AValue : integer);
  625. begin
  626. If (Fversion=AValue) then exit;
  627. Fversion:=AValue;
  628. MarkPropertyChanged(AIndex);
  629. end;
  630. Procedure TPolicy.Setbindings(AIndex : Integer; const AValue : TPolicyTypebindingsArray);
  631. begin
  632. If (Fbindings=AValue) then exit;
  633. Fbindings:=AValue;
  634. MarkPropertyChanged(AIndex);
  635. end;
  636. Procedure TPolicy.Setetag(AIndex : Integer; const AValue : String);
  637. begin
  638. If (Fetag=AValue) then exit;
  639. Fetag:=AValue;
  640. MarkPropertyChanged(AIndex);
  641. end;
  642. //2.6.4. bug workaround
  643. {$IFDEF VER2_6}
  644. Procedure TPolicy.SetArrayLength(Const AName : String; ALength : Longint);
  645. begin
  646. Case AName of
  647. 'bindings' : SetLength(Fbindings,ALength);
  648. else
  649. Inherited SetArrayLength(AName,ALength);
  650. end;
  651. end;
  652. {$ENDIF VER2_6}
  653. { --------------------------------------------------------------------
  654. TBinding
  655. --------------------------------------------------------------------}
  656. Procedure TBinding.Setrole(AIndex : Integer; const AValue : String);
  657. begin
  658. If (Frole=AValue) then exit;
  659. Frole:=AValue;
  660. MarkPropertyChanged(AIndex);
  661. end;
  662. Procedure TBinding.Setmembers(AIndex : Integer; const AValue : TStringArray);
  663. begin
  664. If (Fmembers=AValue) then exit;
  665. Fmembers:=AValue;
  666. MarkPropertyChanged(AIndex);
  667. end;
  668. //2.6.4. bug workaround
  669. {$IFDEF VER2_6}
  670. Procedure TBinding.SetArrayLength(Const AName : String; ALength : Longint);
  671. begin
  672. Case AName of
  673. 'members' : SetLength(Fmembers,ALength);
  674. else
  675. Inherited SetArrayLength(AName,ALength);
  676. end;
  677. end;
  678. {$ENDIF VER2_6}
  679. { --------------------------------------------------------------------
  680. TTestIamPermissionsRequest
  681. --------------------------------------------------------------------}
  682. Procedure TTestIamPermissionsRequest.Setpermissions(AIndex : Integer; const AValue : TStringArray);
  683. begin
  684. If (Fpermissions=AValue) then exit;
  685. Fpermissions:=AValue;
  686. MarkPropertyChanged(AIndex);
  687. end;
  688. //2.6.4. bug workaround
  689. {$IFDEF VER2_6}
  690. Procedure TTestIamPermissionsRequest.SetArrayLength(Const AName : String; ALength : Longint);
  691. begin
  692. Case AName of
  693. 'permissions' : SetLength(Fpermissions,ALength);
  694. else
  695. Inherited SetArrayLength(AName,ALength);
  696. end;
  697. end;
  698. {$ENDIF VER2_6}
  699. { --------------------------------------------------------------------
  700. TTestIamPermissionsResponse
  701. --------------------------------------------------------------------}
  702. Procedure TTestIamPermissionsResponse.Setpermissions(AIndex : Integer; const AValue : TStringArray);
  703. begin
  704. If (Fpermissions=AValue) then exit;
  705. Fpermissions:=AValue;
  706. MarkPropertyChanged(AIndex);
  707. end;
  708. //2.6.4. bug workaround
  709. {$IFDEF VER2_6}
  710. Procedure TTestIamPermissionsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  711. begin
  712. Case AName of
  713. 'permissions' : SetLength(Fpermissions,ALength);
  714. else
  715. Inherited SetArrayLength(AName,ALength);
  716. end;
  717. end;
  718. {$ENDIF VER2_6}
  719. { --------------------------------------------------------------------
  720. TTopic
  721. --------------------------------------------------------------------}
  722. Procedure TTopic.Setname(AIndex : Integer; const AValue : String);
  723. begin
  724. If (Fname=AValue) then exit;
  725. Fname:=AValue;
  726. MarkPropertyChanged(AIndex);
  727. end;
  728. { --------------------------------------------------------------------
  729. TPublishRequest
  730. --------------------------------------------------------------------}
  731. Procedure TPublishRequest.Setmessages(AIndex : Integer; const AValue : TPublishRequestTypemessagesArray);
  732. begin
  733. If (Fmessages=AValue) then exit;
  734. Fmessages:=AValue;
  735. MarkPropertyChanged(AIndex);
  736. end;
  737. //2.6.4. bug workaround
  738. {$IFDEF VER2_6}
  739. Procedure TPublishRequest.SetArrayLength(Const AName : String; ALength : Longint);
  740. begin
  741. Case AName of
  742. 'messages' : SetLength(Fmessages,ALength);
  743. else
  744. Inherited SetArrayLength(AName,ALength);
  745. end;
  746. end;
  747. {$ENDIF VER2_6}
  748. { --------------------------------------------------------------------
  749. TPubsubMessageTypeattributes
  750. --------------------------------------------------------------------}
  751. Class Function TPubsubMessageTypeattributes.AllowAdditionalProperties : Boolean;
  752. begin
  753. Result:=True;
  754. end;
  755. { --------------------------------------------------------------------
  756. TPubsubMessage
  757. --------------------------------------------------------------------}
  758. Procedure TPubsubMessage.Setdata(AIndex : Integer; const AValue : String);
  759. begin
  760. If (Fdata=AValue) then exit;
  761. Fdata:=AValue;
  762. MarkPropertyChanged(AIndex);
  763. end;
  764. Procedure TPubsubMessage.Setattributes(AIndex : Integer; const AValue : TPubsubMessageTypeattributes);
  765. begin
  766. If (Fattributes=AValue) then exit;
  767. Fattributes:=AValue;
  768. MarkPropertyChanged(AIndex);
  769. end;
  770. Procedure TPubsubMessage.SetmessageId(AIndex : Integer; const AValue : String);
  771. begin
  772. If (FmessageId=AValue) then exit;
  773. FmessageId:=AValue;
  774. MarkPropertyChanged(AIndex);
  775. end;
  776. Procedure TPubsubMessage.SetpublishTime(AIndex : Integer; const AValue : String);
  777. begin
  778. If (FpublishTime=AValue) then exit;
  779. FpublishTime:=AValue;
  780. MarkPropertyChanged(AIndex);
  781. end;
  782. { --------------------------------------------------------------------
  783. TPublishResponse
  784. --------------------------------------------------------------------}
  785. Procedure TPublishResponse.SetmessageIds(AIndex : Integer; const AValue : TStringArray);
  786. begin
  787. If (FmessageIds=AValue) then exit;
  788. FmessageIds:=AValue;
  789. MarkPropertyChanged(AIndex);
  790. end;
  791. //2.6.4. bug workaround
  792. {$IFDEF VER2_6}
  793. Procedure TPublishResponse.SetArrayLength(Const AName : String; ALength : Longint);
  794. begin
  795. Case AName of
  796. 'messageids' : SetLength(FmessageIds,ALength);
  797. else
  798. Inherited SetArrayLength(AName,ALength);
  799. end;
  800. end;
  801. {$ENDIF VER2_6}
  802. { --------------------------------------------------------------------
  803. TListTopicsResponse
  804. --------------------------------------------------------------------}
  805. Procedure TListTopicsResponse.Settopics(AIndex : Integer; const AValue : TListTopicsResponseTypetopicsArray);
  806. begin
  807. If (Ftopics=AValue) then exit;
  808. Ftopics:=AValue;
  809. MarkPropertyChanged(AIndex);
  810. end;
  811. Procedure TListTopicsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  812. begin
  813. If (FnextPageToken=AValue) then exit;
  814. FnextPageToken:=AValue;
  815. MarkPropertyChanged(AIndex);
  816. end;
  817. //2.6.4. bug workaround
  818. {$IFDEF VER2_6}
  819. Procedure TListTopicsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  820. begin
  821. Case AName of
  822. 'topics' : SetLength(Ftopics,ALength);
  823. else
  824. Inherited SetArrayLength(AName,ALength);
  825. end;
  826. end;
  827. {$ENDIF VER2_6}
  828. { --------------------------------------------------------------------
  829. TListTopicSubscriptionsResponse
  830. --------------------------------------------------------------------}
  831. Procedure TListTopicSubscriptionsResponse.Setsubscriptions(AIndex : Integer; const AValue : TStringArray);
  832. begin
  833. If (Fsubscriptions=AValue) then exit;
  834. Fsubscriptions:=AValue;
  835. MarkPropertyChanged(AIndex);
  836. end;
  837. Procedure TListTopicSubscriptionsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  838. begin
  839. If (FnextPageToken=AValue) then exit;
  840. FnextPageToken:=AValue;
  841. MarkPropertyChanged(AIndex);
  842. end;
  843. //2.6.4. bug workaround
  844. {$IFDEF VER2_6}
  845. Procedure TListTopicSubscriptionsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  846. begin
  847. Case AName of
  848. 'subscriptions' : SetLength(Fsubscriptions,ALength);
  849. else
  850. Inherited SetArrayLength(AName,ALength);
  851. end;
  852. end;
  853. {$ENDIF VER2_6}
  854. { --------------------------------------------------------------------
  855. TEmpty
  856. --------------------------------------------------------------------}
  857. { --------------------------------------------------------------------
  858. TSubscription
  859. --------------------------------------------------------------------}
  860. Procedure TSubscription.Setname(AIndex : Integer; const AValue : String);
  861. begin
  862. If (Fname=AValue) then exit;
  863. Fname:=AValue;
  864. MarkPropertyChanged(AIndex);
  865. end;
  866. Procedure TSubscription.Settopic(AIndex : Integer; const AValue : String);
  867. begin
  868. If (Ftopic=AValue) then exit;
  869. Ftopic:=AValue;
  870. MarkPropertyChanged(AIndex);
  871. end;
  872. Procedure TSubscription.SetpushConfig(AIndex : Integer; const AValue : TPushConfig);
  873. begin
  874. If (FpushConfig=AValue) then exit;
  875. FpushConfig:=AValue;
  876. MarkPropertyChanged(AIndex);
  877. end;
  878. Procedure TSubscription.SetackDeadlineSeconds(AIndex : Integer; const AValue : integer);
  879. begin
  880. If (FackDeadlineSeconds=AValue) then exit;
  881. FackDeadlineSeconds:=AValue;
  882. MarkPropertyChanged(AIndex);
  883. end;
  884. { --------------------------------------------------------------------
  885. TPushConfigTypeattributes
  886. --------------------------------------------------------------------}
  887. Class Function TPushConfigTypeattributes.AllowAdditionalProperties : Boolean;
  888. begin
  889. Result:=True;
  890. end;
  891. { --------------------------------------------------------------------
  892. TPushConfig
  893. --------------------------------------------------------------------}
  894. Procedure TPushConfig.SetpushEndpoint(AIndex : Integer; const AValue : String);
  895. begin
  896. If (FpushEndpoint=AValue) then exit;
  897. FpushEndpoint:=AValue;
  898. MarkPropertyChanged(AIndex);
  899. end;
  900. Procedure TPushConfig.Setattributes(AIndex : Integer; const AValue : TPushConfigTypeattributes);
  901. begin
  902. If (Fattributes=AValue) then exit;
  903. Fattributes:=AValue;
  904. MarkPropertyChanged(AIndex);
  905. end;
  906. { --------------------------------------------------------------------
  907. TListSubscriptionsResponse
  908. --------------------------------------------------------------------}
  909. Procedure TListSubscriptionsResponse.Setsubscriptions(AIndex : Integer; const AValue : TListSubscriptionsResponseTypesubscriptionsArray);
  910. begin
  911. If (Fsubscriptions=AValue) then exit;
  912. Fsubscriptions:=AValue;
  913. MarkPropertyChanged(AIndex);
  914. end;
  915. Procedure TListSubscriptionsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  916. begin
  917. If (FnextPageToken=AValue) then exit;
  918. FnextPageToken:=AValue;
  919. MarkPropertyChanged(AIndex);
  920. end;
  921. //2.6.4. bug workaround
  922. {$IFDEF VER2_6}
  923. Procedure TListSubscriptionsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  924. begin
  925. Case AName of
  926. 'subscriptions' : SetLength(Fsubscriptions,ALength);
  927. else
  928. Inherited SetArrayLength(AName,ALength);
  929. end;
  930. end;
  931. {$ENDIF VER2_6}
  932. { --------------------------------------------------------------------
  933. TModifyAckDeadlineRequest
  934. --------------------------------------------------------------------}
  935. Procedure TModifyAckDeadlineRequest.SetackIds(AIndex : Integer; const AValue : TStringArray);
  936. begin
  937. If (FackIds=AValue) then exit;
  938. FackIds:=AValue;
  939. MarkPropertyChanged(AIndex);
  940. end;
  941. Procedure TModifyAckDeadlineRequest.SetackDeadlineSeconds(AIndex : Integer; const AValue : integer);
  942. begin
  943. If (FackDeadlineSeconds=AValue) then exit;
  944. FackDeadlineSeconds:=AValue;
  945. MarkPropertyChanged(AIndex);
  946. end;
  947. //2.6.4. bug workaround
  948. {$IFDEF VER2_6}
  949. Procedure TModifyAckDeadlineRequest.SetArrayLength(Const AName : String; ALength : Longint);
  950. begin
  951. Case AName of
  952. 'ackids' : SetLength(FackIds,ALength);
  953. else
  954. Inherited SetArrayLength(AName,ALength);
  955. end;
  956. end;
  957. {$ENDIF VER2_6}
  958. { --------------------------------------------------------------------
  959. TAcknowledgeRequest
  960. --------------------------------------------------------------------}
  961. Procedure TAcknowledgeRequest.SetackIds(AIndex : Integer; const AValue : TStringArray);
  962. begin
  963. If (FackIds=AValue) then exit;
  964. FackIds:=AValue;
  965. MarkPropertyChanged(AIndex);
  966. end;
  967. //2.6.4. bug workaround
  968. {$IFDEF VER2_6}
  969. Procedure TAcknowledgeRequest.SetArrayLength(Const AName : String; ALength : Longint);
  970. begin
  971. Case AName of
  972. 'ackids' : SetLength(FackIds,ALength);
  973. else
  974. Inherited SetArrayLength(AName,ALength);
  975. end;
  976. end;
  977. {$ENDIF VER2_6}
  978. { --------------------------------------------------------------------
  979. TPullRequest
  980. --------------------------------------------------------------------}
  981. Procedure TPullRequest.SetreturnImmediately(AIndex : Integer; const AValue : boolean);
  982. begin
  983. If (FreturnImmediately=AValue) then exit;
  984. FreturnImmediately:=AValue;
  985. MarkPropertyChanged(AIndex);
  986. end;
  987. Procedure TPullRequest.SetmaxMessages(AIndex : Integer; const AValue : integer);
  988. begin
  989. If (FmaxMessages=AValue) then exit;
  990. FmaxMessages:=AValue;
  991. MarkPropertyChanged(AIndex);
  992. end;
  993. { --------------------------------------------------------------------
  994. TPullResponse
  995. --------------------------------------------------------------------}
  996. Procedure TPullResponse.SetreceivedMessages(AIndex : Integer; const AValue : TPullResponseTypereceivedMessagesArray);
  997. begin
  998. If (FreceivedMessages=AValue) then exit;
  999. FreceivedMessages:=AValue;
  1000. MarkPropertyChanged(AIndex);
  1001. end;
  1002. //2.6.4. bug workaround
  1003. {$IFDEF VER2_6}
  1004. Procedure TPullResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1005. begin
  1006. Case AName of
  1007. 'receivedmessages' : SetLength(FreceivedMessages,ALength);
  1008. else
  1009. Inherited SetArrayLength(AName,ALength);
  1010. end;
  1011. end;
  1012. {$ENDIF VER2_6}
  1013. { --------------------------------------------------------------------
  1014. TReceivedMessage
  1015. --------------------------------------------------------------------}
  1016. Procedure TReceivedMessage.SetackId(AIndex : Integer; const AValue : String);
  1017. begin
  1018. If (FackId=AValue) then exit;
  1019. FackId:=AValue;
  1020. MarkPropertyChanged(AIndex);
  1021. end;
  1022. Procedure TReceivedMessage.Setmessage(AIndex : Integer; const AValue : TPubsubMessage);
  1023. begin
  1024. If (Fmessage=AValue) then exit;
  1025. Fmessage:=AValue;
  1026. MarkPropertyChanged(AIndex);
  1027. end;
  1028. { --------------------------------------------------------------------
  1029. TModifyPushConfigRequest
  1030. --------------------------------------------------------------------}
  1031. Procedure TModifyPushConfigRequest.SetpushConfig(AIndex : Integer; const AValue : TPushConfig);
  1032. begin
  1033. If (FpushConfig=AValue) then exit;
  1034. FpushConfig:=AValue;
  1035. MarkPropertyChanged(AIndex);
  1036. end;
  1037. { --------------------------------------------------------------------
  1038. TProjectsTopicsSubscriptionsResource
  1039. --------------------------------------------------------------------}
  1040. Class Function TProjectsTopicsSubscriptionsResource.ResourceName : String;
  1041. begin
  1042. Result:='subscriptions';
  1043. end;
  1044. Class Function TProjectsTopicsSubscriptionsResource.DefaultAPI : TGoogleAPIClass;
  1045. begin
  1046. Result:=TpubsubAPI;
  1047. end;
  1048. Function TProjectsTopicsSubscriptionsResource.List(topic: string; AQuery : string = '') : TListTopicSubscriptionsResponse;
  1049. Const
  1050. _HTTPMethod = 'GET';
  1051. _Path = 'v1/{+topic}/subscriptions';
  1052. _Methodid = 'pubsub.projects.topics.subscriptions.list';
  1053. Var
  1054. _P : String;
  1055. begin
  1056. _P:=SubstitutePath(_Path,['topic',topic]);
  1057. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListTopicSubscriptionsResponse) as TListTopicSubscriptionsResponse;
  1058. end;
  1059. Function TProjectsTopicsSubscriptionsResource.List(topic: string; AQuery : TProjectsTopicsSubscriptionslistOptions) : TListTopicSubscriptionsResponse;
  1060. Var
  1061. _Q : String;
  1062. begin
  1063. _Q:='';
  1064. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  1065. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1066. Result:=List(topic,_Q);
  1067. end;
  1068. { --------------------------------------------------------------------
  1069. TProjectsTopicsResource
  1070. --------------------------------------------------------------------}
  1071. Class Function TProjectsTopicsResource.ResourceName : String;
  1072. begin
  1073. Result:='topics';
  1074. end;
  1075. Class Function TProjectsTopicsResource.DefaultAPI : TGoogleAPIClass;
  1076. begin
  1077. Result:=TpubsubAPI;
  1078. end;
  1079. Function TProjectsTopicsResource.SetIamPolicy(resource: string; aSetIamPolicyRequest : TSetIamPolicyRequest) : TPolicy;
  1080. Const
  1081. _HTTPMethod = 'POST';
  1082. _Path = 'v1/{+resource}:setIamPolicy';
  1083. _Methodid = 'pubsub.projects.topics.setIamPolicy';
  1084. Var
  1085. _P : String;
  1086. begin
  1087. _P:=SubstitutePath(_Path,['resource',resource]);
  1088. Result:=ServiceCall(_HTTPMethod,_P,'',aSetIamPolicyRequest,TPolicy) as TPolicy;
  1089. end;
  1090. Function TProjectsTopicsResource.GetIamPolicy(resource: string) : TPolicy;
  1091. Const
  1092. _HTTPMethod = 'GET';
  1093. _Path = 'v1/{+resource}:getIamPolicy';
  1094. _Methodid = 'pubsub.projects.topics.getIamPolicy';
  1095. Var
  1096. _P : String;
  1097. begin
  1098. _P:=SubstitutePath(_Path,['resource',resource]);
  1099. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TPolicy) as TPolicy;
  1100. end;
  1101. Function TProjectsTopicsResource.TestIamPermissions(resource: string; aTestIamPermissionsRequest : TTestIamPermissionsRequest) : TTestIamPermissionsResponse;
  1102. Const
  1103. _HTTPMethod = 'POST';
  1104. _Path = 'v1/{+resource}:testIamPermissions';
  1105. _Methodid = 'pubsub.projects.topics.testIamPermissions';
  1106. Var
  1107. _P : String;
  1108. begin
  1109. _P:=SubstitutePath(_Path,['resource',resource]);
  1110. Result:=ServiceCall(_HTTPMethod,_P,'',aTestIamPermissionsRequest,TTestIamPermissionsResponse) as TTestIamPermissionsResponse;
  1111. end;
  1112. Function TProjectsTopicsResource.Create(_name: string; aTopic : TTopic) : TTopic;
  1113. Const
  1114. _HTTPMethod = 'PUT';
  1115. _Path = 'v1/{+name}';
  1116. _Methodid = 'pubsub.projects.topics.create';
  1117. Var
  1118. _P : String;
  1119. begin
  1120. _P:=SubstitutePath(_Path,['name',_name]);
  1121. Result:=ServiceCall(_HTTPMethod,_P,'',aTopic,TTopic) as TTopic;
  1122. end;
  1123. Function TProjectsTopicsResource.Publish(topic: string; aPublishRequest : TPublishRequest) : TPublishResponse;
  1124. Const
  1125. _HTTPMethod = 'POST';
  1126. _Path = 'v1/{+topic}:publish';
  1127. _Methodid = 'pubsub.projects.topics.publish';
  1128. Var
  1129. _P : String;
  1130. begin
  1131. _P:=SubstitutePath(_Path,['topic',topic]);
  1132. Result:=ServiceCall(_HTTPMethod,_P,'',aPublishRequest,TPublishResponse) as TPublishResponse;
  1133. end;
  1134. Function TProjectsTopicsResource.Get(topic: string) : TTopic;
  1135. Const
  1136. _HTTPMethod = 'GET';
  1137. _Path = 'v1/{+topic}';
  1138. _Methodid = 'pubsub.projects.topics.get';
  1139. Var
  1140. _P : String;
  1141. begin
  1142. _P:=SubstitutePath(_Path,['topic',topic]);
  1143. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TTopic) as TTopic;
  1144. end;
  1145. Function TProjectsTopicsResource.List(project: string; AQuery : string = '') : TListTopicsResponse;
  1146. Const
  1147. _HTTPMethod = 'GET';
  1148. _Path = 'v1/{+project}/topics';
  1149. _Methodid = 'pubsub.projects.topics.list';
  1150. Var
  1151. _P : String;
  1152. begin
  1153. _P:=SubstitutePath(_Path,['project',project]);
  1154. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListTopicsResponse) as TListTopicsResponse;
  1155. end;
  1156. Function TProjectsTopicsResource.List(project: string; AQuery : TProjectsTopicslistOptions) : TListTopicsResponse;
  1157. Var
  1158. _Q : String;
  1159. begin
  1160. _Q:='';
  1161. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  1162. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1163. Result:=List(project,_Q);
  1164. end;
  1165. Function TProjectsTopicsResource.Delete(topic: string) : TEmpty;
  1166. Const
  1167. _HTTPMethod = 'DELETE';
  1168. _Path = 'v1/{+topic}';
  1169. _Methodid = 'pubsub.projects.topics.delete';
  1170. Var
  1171. _P : String;
  1172. begin
  1173. _P:=SubstitutePath(_Path,['topic',topic]);
  1174. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TEmpty) as TEmpty;
  1175. end;
  1176. Function TProjectsTopicsResource.GetSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;
  1177. begin
  1178. if (FSubscriptionsInstance=Nil) then
  1179. FSubscriptionsInstance:=CreateSubscriptionsResource;
  1180. Result:=FSubscriptionsInstance;
  1181. end;
  1182. Function TProjectsTopicsResource.CreateSubscriptionsResource : TProjectsTopicsSubscriptionsResource;
  1183. begin
  1184. Result:=CreateSubscriptionsResource(Self);
  1185. end;
  1186. Function TProjectsTopicsResource.CreateSubscriptionsResource(AOwner : TComponent) : TProjectsTopicsSubscriptionsResource;
  1187. begin
  1188. Result:=TProjectsTopicsSubscriptionsResource.Create(AOwner);
  1189. Result.API:=Self.API;
  1190. end;
  1191. { --------------------------------------------------------------------
  1192. TProjectsSubscriptionsResource
  1193. --------------------------------------------------------------------}
  1194. Class Function TProjectsSubscriptionsResource.ResourceName : String;
  1195. begin
  1196. Result:='subscriptions';
  1197. end;
  1198. Class Function TProjectsSubscriptionsResource.DefaultAPI : TGoogleAPIClass;
  1199. begin
  1200. Result:=TpubsubAPI;
  1201. end;
  1202. Function TProjectsSubscriptionsResource.SetIamPolicy(resource: string; aSetIamPolicyRequest : TSetIamPolicyRequest) : TPolicy;
  1203. Const
  1204. _HTTPMethod = 'POST';
  1205. _Path = 'v1/{+resource}:setIamPolicy';
  1206. _Methodid = 'pubsub.projects.subscriptions.setIamPolicy';
  1207. Var
  1208. _P : String;
  1209. begin
  1210. _P:=SubstitutePath(_Path,['resource',resource]);
  1211. Result:=ServiceCall(_HTTPMethod,_P,'',aSetIamPolicyRequest,TPolicy) as TPolicy;
  1212. end;
  1213. Function TProjectsSubscriptionsResource.GetIamPolicy(resource: string) : TPolicy;
  1214. Const
  1215. _HTTPMethod = 'GET';
  1216. _Path = 'v1/{+resource}:getIamPolicy';
  1217. _Methodid = 'pubsub.projects.subscriptions.getIamPolicy';
  1218. Var
  1219. _P : String;
  1220. begin
  1221. _P:=SubstitutePath(_Path,['resource',resource]);
  1222. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TPolicy) as TPolicy;
  1223. end;
  1224. Function TProjectsSubscriptionsResource.TestIamPermissions(resource: string; aTestIamPermissionsRequest : TTestIamPermissionsRequest) : TTestIamPermissionsResponse;
  1225. Const
  1226. _HTTPMethod = 'POST';
  1227. _Path = 'v1/{+resource}:testIamPermissions';
  1228. _Methodid = 'pubsub.projects.subscriptions.testIamPermissions';
  1229. Var
  1230. _P : String;
  1231. begin
  1232. _P:=SubstitutePath(_Path,['resource',resource]);
  1233. Result:=ServiceCall(_HTTPMethod,_P,'',aTestIamPermissionsRequest,TTestIamPermissionsResponse) as TTestIamPermissionsResponse;
  1234. end;
  1235. Function TProjectsSubscriptionsResource.Create(_name: string; aSubscription : TSubscription) : TSubscription;
  1236. Const
  1237. _HTTPMethod = 'PUT';
  1238. _Path = 'v1/{+name}';
  1239. _Methodid = 'pubsub.projects.subscriptions.create';
  1240. Var
  1241. _P : String;
  1242. begin
  1243. _P:=SubstitutePath(_Path,['name',_name]);
  1244. Result:=ServiceCall(_HTTPMethod,_P,'',aSubscription,TSubscription) as TSubscription;
  1245. end;
  1246. Function TProjectsSubscriptionsResource.Get(subscription: string) : TSubscription;
  1247. Const
  1248. _HTTPMethod = 'GET';
  1249. _Path = 'v1/{+subscription}';
  1250. _Methodid = 'pubsub.projects.subscriptions.get';
  1251. Var
  1252. _P : String;
  1253. begin
  1254. _P:=SubstitutePath(_Path,['subscription',subscription]);
  1255. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TSubscription) as TSubscription;
  1256. end;
  1257. Function TProjectsSubscriptionsResource.List(project: string; AQuery : string = '') : TListSubscriptionsResponse;
  1258. Const
  1259. _HTTPMethod = 'GET';
  1260. _Path = 'v1/{+project}/subscriptions';
  1261. _Methodid = 'pubsub.projects.subscriptions.list';
  1262. Var
  1263. _P : String;
  1264. begin
  1265. _P:=SubstitutePath(_Path,['project',project]);
  1266. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListSubscriptionsResponse) as TListSubscriptionsResponse;
  1267. end;
  1268. Function TProjectsSubscriptionsResource.List(project: string; AQuery : TProjectsSubscriptionslistOptions) : TListSubscriptionsResponse;
  1269. Var
  1270. _Q : String;
  1271. begin
  1272. _Q:='';
  1273. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  1274. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1275. Result:=List(project,_Q);
  1276. end;
  1277. Function TProjectsSubscriptionsResource.Delete(subscription: string) : TEmpty;
  1278. Const
  1279. _HTTPMethod = 'DELETE';
  1280. _Path = 'v1/{+subscription}';
  1281. _Methodid = 'pubsub.projects.subscriptions.delete';
  1282. Var
  1283. _P : String;
  1284. begin
  1285. _P:=SubstitutePath(_Path,['subscription',subscription]);
  1286. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TEmpty) as TEmpty;
  1287. end;
  1288. Function TProjectsSubscriptionsResource.ModifyAckDeadline(subscription: string; aModifyAckDeadlineRequest : TModifyAckDeadlineRequest) : TEmpty;
  1289. Const
  1290. _HTTPMethod = 'POST';
  1291. _Path = 'v1/{+subscription}:modifyAckDeadline';
  1292. _Methodid = 'pubsub.projects.subscriptions.modifyAckDeadline';
  1293. Var
  1294. _P : String;
  1295. begin
  1296. _P:=SubstitutePath(_Path,['subscription',subscription]);
  1297. Result:=ServiceCall(_HTTPMethod,_P,'',aModifyAckDeadlineRequest,TEmpty) as TEmpty;
  1298. end;
  1299. Function TProjectsSubscriptionsResource.Acknowledge(subscription: string; aAcknowledgeRequest : TAcknowledgeRequest) : TEmpty;
  1300. Const
  1301. _HTTPMethod = 'POST';
  1302. _Path = 'v1/{+subscription}:acknowledge';
  1303. _Methodid = 'pubsub.projects.subscriptions.acknowledge';
  1304. Var
  1305. _P : String;
  1306. begin
  1307. _P:=SubstitutePath(_Path,['subscription',subscription]);
  1308. Result:=ServiceCall(_HTTPMethod,_P,'',aAcknowledgeRequest,TEmpty) as TEmpty;
  1309. end;
  1310. Function TProjectsSubscriptionsResource.Pull(subscription: string; aPullRequest : TPullRequest) : TPullResponse;
  1311. Const
  1312. _HTTPMethod = 'POST';
  1313. _Path = 'v1/{+subscription}:pull';
  1314. _Methodid = 'pubsub.projects.subscriptions.pull';
  1315. Var
  1316. _P : String;
  1317. begin
  1318. _P:=SubstitutePath(_Path,['subscription',subscription]);
  1319. Result:=ServiceCall(_HTTPMethod,_P,'',aPullRequest,TPullResponse) as TPullResponse;
  1320. end;
  1321. Function TProjectsSubscriptionsResource.ModifyPushConfig(subscription: string; aModifyPushConfigRequest : TModifyPushConfigRequest) : TEmpty;
  1322. Const
  1323. _HTTPMethod = 'POST';
  1324. _Path = 'v1/{+subscription}:modifyPushConfig';
  1325. _Methodid = 'pubsub.projects.subscriptions.modifyPushConfig';
  1326. Var
  1327. _P : String;
  1328. begin
  1329. _P:=SubstitutePath(_Path,['subscription',subscription]);
  1330. Result:=ServiceCall(_HTTPMethod,_P,'',aModifyPushConfigRequest,TEmpty) as TEmpty;
  1331. end;
  1332. { --------------------------------------------------------------------
  1333. TProjectsResource
  1334. --------------------------------------------------------------------}
  1335. Class Function TProjectsResource.ResourceName : String;
  1336. begin
  1337. Result:='projects';
  1338. end;
  1339. Class Function TProjectsResource.DefaultAPI : TGoogleAPIClass;
  1340. begin
  1341. Result:=TpubsubAPI;
  1342. end;
  1343. Function TProjectsResource.GetTopicsSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;
  1344. begin
  1345. if (FTopicsSubscriptionsInstance=Nil) then
  1346. FTopicsSubscriptionsInstance:=CreateTopicsSubscriptionsResource;
  1347. Result:=FTopicsSubscriptionsInstance;
  1348. end;
  1349. Function TProjectsResource.CreateTopicsSubscriptionsResource : TProjectsTopicsSubscriptionsResource;
  1350. begin
  1351. Result:=CreateTopicsSubscriptionsResource(Self);
  1352. end;
  1353. Function TProjectsResource.CreateTopicsSubscriptionsResource(AOwner : TComponent) : TProjectsTopicsSubscriptionsResource;
  1354. begin
  1355. Result:=TProjectsTopicsSubscriptionsResource.Create(AOwner);
  1356. Result.API:=Self.API;
  1357. end;
  1358. Function TProjectsResource.GetTopicsInstance : TProjectsTopicsResource;
  1359. begin
  1360. if (FTopicsInstance=Nil) then
  1361. FTopicsInstance:=CreateTopicsResource;
  1362. Result:=FTopicsInstance;
  1363. end;
  1364. Function TProjectsResource.CreateTopicsResource : TProjectsTopicsResource;
  1365. begin
  1366. Result:=CreateTopicsResource(Self);
  1367. end;
  1368. Function TProjectsResource.CreateTopicsResource(AOwner : TComponent) : TProjectsTopicsResource;
  1369. begin
  1370. Result:=TProjectsTopicsResource.Create(AOwner);
  1371. Result.API:=Self.API;
  1372. end;
  1373. Function TProjectsResource.GetSubscriptionsInstance : TProjectsSubscriptionsResource;
  1374. begin
  1375. if (FSubscriptionsInstance=Nil) then
  1376. FSubscriptionsInstance:=CreateSubscriptionsResource;
  1377. Result:=FSubscriptionsInstance;
  1378. end;
  1379. Function TProjectsResource.CreateSubscriptionsResource : TProjectsSubscriptionsResource;
  1380. begin
  1381. Result:=CreateSubscriptionsResource(Self);
  1382. end;
  1383. Function TProjectsResource.CreateSubscriptionsResource(AOwner : TComponent) : TProjectsSubscriptionsResource;
  1384. begin
  1385. Result:=TProjectsSubscriptionsResource.Create(AOwner);
  1386. Result.API:=Self.API;
  1387. end;
  1388. { --------------------------------------------------------------------
  1389. TPubsubAPI
  1390. --------------------------------------------------------------------}
  1391. Class Function TPubsubAPI.APIName : String;
  1392. begin
  1393. Result:='pubsub';
  1394. end;
  1395. Class Function TPubsubAPI.APIVersion : String;
  1396. begin
  1397. Result:='v1';
  1398. end;
  1399. Class Function TPubsubAPI.APIRevision : String;
  1400. begin
  1401. Result:='20160317';
  1402. end;
  1403. Class Function TPubsubAPI.APIID : String;
  1404. begin
  1405. Result:='pubsub:v1';
  1406. end;
  1407. Class Function TPubsubAPI.APITitle : String;
  1408. begin
  1409. Result:='Google Cloud Pub/Sub API';
  1410. end;
  1411. Class Function TPubsubAPI.APIDescription : String;
  1412. begin
  1413. Result:='Provides reliable, many-to-many, asynchronous messaging between applications.';
  1414. end;
  1415. Class Function TPubsubAPI.APIOwnerDomain : String;
  1416. begin
  1417. Result:='google.com';
  1418. end;
  1419. Class Function TPubsubAPI.APIOwnerName : String;
  1420. begin
  1421. Result:='Google';
  1422. end;
  1423. Class Function TPubsubAPI.APIIcon16 : String;
  1424. begin
  1425. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1426. end;
  1427. Class Function TPubsubAPI.APIIcon32 : String;
  1428. begin
  1429. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1430. end;
  1431. Class Function TPubsubAPI.APIdocumentationLink : String;
  1432. begin
  1433. Result:='https://cloud.google.com/pubsub/docs';
  1434. end;
  1435. Class Function TPubsubAPI.APIrootUrl : string;
  1436. begin
  1437. Result:='https://pubsub.googleapis.com/';
  1438. end;
  1439. Class Function TPubsubAPI.APIbasePath : string;
  1440. begin
  1441. Result:='';
  1442. end;
  1443. Class Function TPubsubAPI.APIbaseURL : String;
  1444. begin
  1445. Result:='https://pubsub.googleapis.com/';
  1446. end;
  1447. Class Function TPubsubAPI.APIProtocol : string;
  1448. begin
  1449. Result:='rest';
  1450. end;
  1451. Class Function TPubsubAPI.APIservicePath : string;
  1452. begin
  1453. Result:='';
  1454. end;
  1455. Class Function TPubsubAPI.APIbatchPath : String;
  1456. begin
  1457. Result:='batch';
  1458. end;
  1459. Class Function TPubsubAPI.APIAuthScopes : TScopeInfoArray;
  1460. begin
  1461. SetLength(Result,2);
  1462. Result[0].Name:='https://www.googleapis.com/auth/cloud-platform';
  1463. Result[0].Description:='View and manage your data across Google Cloud Platform services';
  1464. Result[1].Name:='https://www.googleapis.com/auth/pubsub';
  1465. Result[1].Description:='View and manage Pub/Sub topics and subscriptions';
  1466. end;
  1467. Class Function TPubsubAPI.APINeedsAuth : Boolean;
  1468. begin
  1469. Result:=True;
  1470. end;
  1471. Class Procedure TPubsubAPI.RegisterAPIResources;
  1472. begin
  1473. TSetIamPolicyRequest.RegisterObject;
  1474. TPolicy.RegisterObject;
  1475. TBinding.RegisterObject;
  1476. TTestIamPermissionsRequest.RegisterObject;
  1477. TTestIamPermissionsResponse.RegisterObject;
  1478. TTopic.RegisterObject;
  1479. TPublishRequest.RegisterObject;
  1480. TPubsubMessageTypeattributes.RegisterObject;
  1481. TPubsubMessage.RegisterObject;
  1482. TPublishResponse.RegisterObject;
  1483. TListTopicsResponse.RegisterObject;
  1484. TListTopicSubscriptionsResponse.RegisterObject;
  1485. TEmpty.RegisterObject;
  1486. TSubscription.RegisterObject;
  1487. TPushConfigTypeattributes.RegisterObject;
  1488. TPushConfig.RegisterObject;
  1489. TListSubscriptionsResponse.RegisterObject;
  1490. TModifyAckDeadlineRequest.RegisterObject;
  1491. TAcknowledgeRequest.RegisterObject;
  1492. TPullRequest.RegisterObject;
  1493. TPullResponse.RegisterObject;
  1494. TReceivedMessage.RegisterObject;
  1495. TModifyPushConfigRequest.RegisterObject;
  1496. end;
  1497. Function TPubsubAPI.GetProjectsTopicsSubscriptionsInstance : TProjectsTopicsSubscriptionsResource;
  1498. begin
  1499. if (FProjectsTopicsSubscriptionsInstance=Nil) then
  1500. FProjectsTopicsSubscriptionsInstance:=CreateProjectsTopicsSubscriptionsResource;
  1501. Result:=FProjectsTopicsSubscriptionsInstance;
  1502. end;
  1503. Function TPubsubAPI.CreateProjectsTopicsSubscriptionsResource : TProjectsTopicsSubscriptionsResource;
  1504. begin
  1505. Result:=CreateProjectsTopicsSubscriptionsResource(Self);
  1506. end;
  1507. Function TPubsubAPI.CreateProjectsTopicsSubscriptionsResource(AOwner : TComponent) : TProjectsTopicsSubscriptionsResource;
  1508. begin
  1509. Result:=TProjectsTopicsSubscriptionsResource.Create(AOwner);
  1510. Result.API:=Self.API;
  1511. end;
  1512. Function TPubsubAPI.GetProjectsTopicsInstance : TProjectsTopicsResource;
  1513. begin
  1514. if (FProjectsTopicsInstance=Nil) then
  1515. FProjectsTopicsInstance:=CreateProjectsTopicsResource;
  1516. Result:=FProjectsTopicsInstance;
  1517. end;
  1518. Function TPubsubAPI.CreateProjectsTopicsResource : TProjectsTopicsResource;
  1519. begin
  1520. Result:=CreateProjectsTopicsResource(Self);
  1521. end;
  1522. Function TPubsubAPI.CreateProjectsTopicsResource(AOwner : TComponent) : TProjectsTopicsResource;
  1523. begin
  1524. Result:=TProjectsTopicsResource.Create(AOwner);
  1525. Result.API:=Self.API;
  1526. end;
  1527. Function TPubsubAPI.GetProjectsSubscriptionsInstance : TProjectsSubscriptionsResource;
  1528. begin
  1529. if (FProjectsSubscriptionsInstance=Nil) then
  1530. FProjectsSubscriptionsInstance:=CreateProjectsSubscriptionsResource;
  1531. Result:=FProjectsSubscriptionsInstance;
  1532. end;
  1533. Function TPubsubAPI.CreateProjectsSubscriptionsResource : TProjectsSubscriptionsResource;
  1534. begin
  1535. Result:=CreateProjectsSubscriptionsResource(Self);
  1536. end;
  1537. Function TPubsubAPI.CreateProjectsSubscriptionsResource(AOwner : TComponent) : TProjectsSubscriptionsResource;
  1538. begin
  1539. Result:=TProjectsSubscriptionsResource.Create(AOwner);
  1540. Result.API:=Self.API;
  1541. end;
  1542. Function TPubsubAPI.GetProjectsInstance : TProjectsResource;
  1543. begin
  1544. if (FProjectsInstance=Nil) then
  1545. FProjectsInstance:=CreateProjectsResource;
  1546. Result:=FProjectsInstance;
  1547. end;
  1548. Function TPubsubAPI.CreateProjectsResource : TProjectsResource;
  1549. begin
  1550. Result:=CreateProjectsResource(Self);
  1551. end;
  1552. Function TPubsubAPI.CreateProjectsResource(AOwner : TComponent) : TProjectsResource;
  1553. begin
  1554. Result:=TProjectsResource.Create(AOwner);
  1555. Result.API:=Self.API;
  1556. end;
  1557. initialization
  1558. TPubsubAPI.RegisterAPI;
  1559. end.