googleautoscaler.pp 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068
  1. unit googleautoscaler;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TAutoscaler = Class;
  9. TAutoscalerListResponse = Class;
  10. TAutoscalingPolicy = Class;
  11. TAutoscalingPolicyCpuUtilization = Class;
  12. TAutoscalingPolicyCustomMetricUtilization = Class;
  13. TAutoscalingPolicyLoadBalancingUtilization = Class;
  14. TDeprecationStatus = Class;
  15. TOperation = Class;
  16. TOperationList = Class;
  17. TZone = Class;
  18. TZoneList = Class;
  19. TAutoscalerArray = Array of TAutoscaler;
  20. TAutoscalerListResponseArray = Array of TAutoscalerListResponse;
  21. TAutoscalingPolicyArray = Array of TAutoscalingPolicy;
  22. TAutoscalingPolicyCpuUtilizationArray = Array of TAutoscalingPolicyCpuUtilization;
  23. TAutoscalingPolicyCustomMetricUtilizationArray = Array of TAutoscalingPolicyCustomMetricUtilization;
  24. TAutoscalingPolicyLoadBalancingUtilizationArray = Array of TAutoscalingPolicyLoadBalancingUtilization;
  25. TDeprecationStatusArray = Array of TDeprecationStatus;
  26. TOperationArray = Array of TOperation;
  27. TOperationListArray = Array of TOperationList;
  28. TZoneArray = Array of TZone;
  29. TZoneListArray = Array of TZoneList;
  30. //Anonymous types, using auto-generated names
  31. TOperationTypeerrorTypeerrorsItem = Class;
  32. TOperationTypeerror = Class;
  33. TOperationTypewarningsItemTypedataItem = Class;
  34. TOperationTypewarningsItem = Class;
  35. TAutoscalerListResponseTypeitemsArray = Array of TAutoscaler;
  36. TAutoscalingPolicyTypecustomMetricUtilizationsArray = Array of TAutoscalingPolicyCustomMetricUtilization;
  37. TOperationTypeerrorTypeerrorsArray = Array of TOperationTypeerrorTypeerrorsItem;
  38. TOperationTypewarningsItemTypedataArray = Array of TOperationTypewarningsItemTypedataItem;
  39. TOperationTypewarningsArray = Array of TOperationTypewarningsItem;
  40. TOperationListTypeitemsArray = Array of TOperation;
  41. TZoneListTypeitemsArray = Array of TZone;
  42. { --------------------------------------------------------------------
  43. TAutoscaler
  44. --------------------------------------------------------------------}
  45. TAutoscaler = Class(TGoogleBaseObject)
  46. Private
  47. FautoscalingPolicy : TAutoscalingPolicy;
  48. FcreationTimestamp : String;
  49. Fdescription : String;
  50. Fid : String;
  51. Fkind : String;
  52. Fname : String;
  53. FselfLink : String;
  54. Ftarget : String;
  55. Protected
  56. //Property setters
  57. Procedure SetautoscalingPolicy(AIndex : Integer; const AValue : TAutoscalingPolicy); virtual;
  58. Procedure SetcreationTimestamp(AIndex : Integer; const AValue : String); virtual;
  59. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  60. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  61. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  62. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  63. Procedure SetselfLink(AIndex : Integer; const AValue : String); virtual;
  64. Procedure Settarget(AIndex : Integer; const AValue : String); virtual;
  65. Public
  66. Published
  67. Property autoscalingPolicy : TAutoscalingPolicy Index 0 Read FautoscalingPolicy Write SetautoscalingPolicy;
  68. Property creationTimestamp : String Index 8 Read FcreationTimestamp Write SetcreationTimestamp;
  69. Property description : String Index 16 Read Fdescription Write Setdescription;
  70. Property id : String Index 24 Read Fid Write Setid;
  71. Property kind : String Index 32 Read Fkind Write Setkind;
  72. Property name : String Index 40 Read Fname Write Setname;
  73. Property selfLink : String Index 48 Read FselfLink Write SetselfLink;
  74. Property target : String Index 56 Read Ftarget Write Settarget;
  75. end;
  76. TAutoscalerClass = Class of TAutoscaler;
  77. { --------------------------------------------------------------------
  78. TAutoscalerListResponse
  79. --------------------------------------------------------------------}
  80. TAutoscalerListResponse = Class(TGoogleBaseObject)
  81. Private
  82. Fitems : TAutoscalerListResponseTypeitemsArray;
  83. Fkind : String;
  84. FnextPageToken : String;
  85. Protected
  86. //Property setters
  87. Procedure Setitems(AIndex : Integer; const AValue : TAutoscalerListResponseTypeitemsArray); virtual;
  88. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  89. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  90. //2.6.4. bug workaround
  91. {$IFDEF VER2_6}
  92. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  93. {$ENDIF VER2_6}
  94. Public
  95. Published
  96. Property items : TAutoscalerListResponseTypeitemsArray Index 0 Read Fitems Write Setitems;
  97. Property kind : String Index 8 Read Fkind Write Setkind;
  98. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  99. end;
  100. TAutoscalerListResponseClass = Class of TAutoscalerListResponse;
  101. { --------------------------------------------------------------------
  102. TAutoscalingPolicy
  103. --------------------------------------------------------------------}
  104. TAutoscalingPolicy = Class(TGoogleBaseObject)
  105. Private
  106. FcoolDownPeriodSec : integer;
  107. FcpuUtilization : TAutoscalingPolicyCpuUtilization;
  108. FcustomMetricUtilizations : TAutoscalingPolicyTypecustomMetricUtilizationsArray;
  109. FloadBalancingUtilization : TAutoscalingPolicyLoadBalancingUtilization;
  110. FmaxNumReplicas : integer;
  111. FminNumReplicas : integer;
  112. Protected
  113. //Property setters
  114. Procedure SetcoolDownPeriodSec(AIndex : Integer; const AValue : integer); virtual;
  115. Procedure SetcpuUtilization(AIndex : Integer; const AValue : TAutoscalingPolicyCpuUtilization); virtual;
  116. Procedure SetcustomMetricUtilizations(AIndex : Integer; const AValue : TAutoscalingPolicyTypecustomMetricUtilizationsArray); virtual;
  117. Procedure SetloadBalancingUtilization(AIndex : Integer; const AValue : TAutoscalingPolicyLoadBalancingUtilization); virtual;
  118. Procedure SetmaxNumReplicas(AIndex : Integer; const AValue : integer); virtual;
  119. Procedure SetminNumReplicas(AIndex : Integer; const AValue : integer); virtual;
  120. //2.6.4. bug workaround
  121. {$IFDEF VER2_6}
  122. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  123. {$ENDIF VER2_6}
  124. Public
  125. Published
  126. Property coolDownPeriodSec : integer Index 0 Read FcoolDownPeriodSec Write SetcoolDownPeriodSec;
  127. Property cpuUtilization : TAutoscalingPolicyCpuUtilization Index 8 Read FcpuUtilization Write SetcpuUtilization;
  128. Property customMetricUtilizations : TAutoscalingPolicyTypecustomMetricUtilizationsArray Index 16 Read FcustomMetricUtilizations Write SetcustomMetricUtilizations;
  129. Property loadBalancingUtilization : TAutoscalingPolicyLoadBalancingUtilization Index 24 Read FloadBalancingUtilization Write SetloadBalancingUtilization;
  130. Property maxNumReplicas : integer Index 32 Read FmaxNumReplicas Write SetmaxNumReplicas;
  131. Property minNumReplicas : integer Index 40 Read FminNumReplicas Write SetminNumReplicas;
  132. end;
  133. TAutoscalingPolicyClass = Class of TAutoscalingPolicy;
  134. { --------------------------------------------------------------------
  135. TAutoscalingPolicyCpuUtilization
  136. --------------------------------------------------------------------}
  137. TAutoscalingPolicyCpuUtilization = Class(TGoogleBaseObject)
  138. Private
  139. FutilizationTarget : double;
  140. Protected
  141. //Property setters
  142. Procedure SetutilizationTarget(AIndex : Integer; const AValue : double); virtual;
  143. Public
  144. Published
  145. Property utilizationTarget : double Index 0 Read FutilizationTarget Write SetutilizationTarget;
  146. end;
  147. TAutoscalingPolicyCpuUtilizationClass = Class of TAutoscalingPolicyCpuUtilization;
  148. { --------------------------------------------------------------------
  149. TAutoscalingPolicyCustomMetricUtilization
  150. --------------------------------------------------------------------}
  151. TAutoscalingPolicyCustomMetricUtilization = Class(TGoogleBaseObject)
  152. Private
  153. Fmetric : String;
  154. FutilizationTarget : double;
  155. FutilizationTargetType : String;
  156. Protected
  157. //Property setters
  158. Procedure Setmetric(AIndex : Integer; const AValue : String); virtual;
  159. Procedure SetutilizationTarget(AIndex : Integer; const AValue : double); virtual;
  160. Procedure SetutilizationTargetType(AIndex : Integer; const AValue : String); virtual;
  161. Public
  162. Published
  163. Property metric : String Index 0 Read Fmetric Write Setmetric;
  164. Property utilizationTarget : double Index 8 Read FutilizationTarget Write SetutilizationTarget;
  165. Property utilizationTargetType : String Index 16 Read FutilizationTargetType Write SetutilizationTargetType;
  166. end;
  167. TAutoscalingPolicyCustomMetricUtilizationClass = Class of TAutoscalingPolicyCustomMetricUtilization;
  168. { --------------------------------------------------------------------
  169. TAutoscalingPolicyLoadBalancingUtilization
  170. --------------------------------------------------------------------}
  171. TAutoscalingPolicyLoadBalancingUtilization = Class(TGoogleBaseObject)
  172. Private
  173. FutilizationTarget : double;
  174. Protected
  175. //Property setters
  176. Procedure SetutilizationTarget(AIndex : Integer; const AValue : double); virtual;
  177. Public
  178. Published
  179. Property utilizationTarget : double Index 0 Read FutilizationTarget Write SetutilizationTarget;
  180. end;
  181. TAutoscalingPolicyLoadBalancingUtilizationClass = Class of TAutoscalingPolicyLoadBalancingUtilization;
  182. { --------------------------------------------------------------------
  183. TDeprecationStatus
  184. --------------------------------------------------------------------}
  185. TDeprecationStatus = Class(TGoogleBaseObject)
  186. Private
  187. Fdeleted : String;
  188. Fdeprecated : String;
  189. Fobsolete : String;
  190. Freplacement : String;
  191. Fstate : String;
  192. Protected
  193. //Property setters
  194. Procedure Setdeleted(AIndex : Integer; const AValue : String); virtual;
  195. Procedure Setdeprecated(AIndex : Integer; const AValue : String); virtual;
  196. Procedure Setobsolete(AIndex : Integer; const AValue : String); virtual;
  197. Procedure Setreplacement(AIndex : Integer; const AValue : String); virtual;
  198. Procedure Setstate(AIndex : Integer; const AValue : String); virtual;
  199. Public
  200. Published
  201. Property deleted : String Index 0 Read Fdeleted Write Setdeleted;
  202. Property deprecated : String Index 8 Read Fdeprecated Write Setdeprecated;
  203. Property obsolete : String Index 16 Read Fobsolete Write Setobsolete;
  204. Property replacement : String Index 24 Read Freplacement Write Setreplacement;
  205. Property state : String Index 32 Read Fstate Write Setstate;
  206. end;
  207. TDeprecationStatusClass = Class of TDeprecationStatus;
  208. { --------------------------------------------------------------------
  209. TOperationTypeerrorTypeerrorsItem
  210. --------------------------------------------------------------------}
  211. TOperationTypeerrorTypeerrorsItem = Class(TGoogleBaseObject)
  212. Private
  213. Fcode : String;
  214. Flocation : String;
  215. Fmessage : String;
  216. Protected
  217. //Property setters
  218. Procedure Setcode(AIndex : Integer; const AValue : String); virtual;
  219. Procedure Setlocation(AIndex : Integer; const AValue : String); virtual;
  220. Procedure Setmessage(AIndex : Integer; const AValue : String); virtual;
  221. Public
  222. Published
  223. Property code : String Index 0 Read Fcode Write Setcode;
  224. Property location : String Index 8 Read Flocation Write Setlocation;
  225. Property message : String Index 16 Read Fmessage Write Setmessage;
  226. end;
  227. TOperationTypeerrorTypeerrorsItemClass = Class of TOperationTypeerrorTypeerrorsItem;
  228. { --------------------------------------------------------------------
  229. TOperationTypeerror
  230. --------------------------------------------------------------------}
  231. TOperationTypeerror = Class(TGoogleBaseObject)
  232. Private
  233. Ferrors : TOperationTypeerrorTypeerrorsArray;
  234. Protected
  235. //Property setters
  236. Procedure Seterrors(AIndex : Integer; const AValue : TOperationTypeerrorTypeerrorsArray); virtual;
  237. //2.6.4. bug workaround
  238. {$IFDEF VER2_6}
  239. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  240. {$ENDIF VER2_6}
  241. Public
  242. Published
  243. Property errors : TOperationTypeerrorTypeerrorsArray Index 0 Read Ferrors Write Seterrors;
  244. end;
  245. TOperationTypeerrorClass = Class of TOperationTypeerror;
  246. { --------------------------------------------------------------------
  247. TOperationTypewarningsItemTypedataItem
  248. --------------------------------------------------------------------}
  249. TOperationTypewarningsItemTypedataItem = Class(TGoogleBaseObject)
  250. Private
  251. Fkey : String;
  252. Fvalue : String;
  253. Protected
  254. //Property setters
  255. Procedure Setkey(AIndex : Integer; const AValue : String); virtual;
  256. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  257. Public
  258. Published
  259. Property key : String Index 0 Read Fkey Write Setkey;
  260. Property value : String Index 8 Read Fvalue Write Setvalue;
  261. end;
  262. TOperationTypewarningsItemTypedataItemClass = Class of TOperationTypewarningsItemTypedataItem;
  263. { --------------------------------------------------------------------
  264. TOperationTypewarningsItem
  265. --------------------------------------------------------------------}
  266. TOperationTypewarningsItem = Class(TGoogleBaseObject)
  267. Private
  268. Fcode : String;
  269. Fdata : TOperationTypewarningsItemTypedataArray;
  270. Fmessage : String;
  271. Protected
  272. //Property setters
  273. Procedure Setcode(AIndex : Integer; const AValue : String); virtual;
  274. Procedure Setdata(AIndex : Integer; const AValue : TOperationTypewarningsItemTypedataArray); virtual;
  275. Procedure Setmessage(AIndex : Integer; const AValue : String); virtual;
  276. //2.6.4. bug workaround
  277. {$IFDEF VER2_6}
  278. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  279. {$ENDIF VER2_6}
  280. Public
  281. Published
  282. Property code : String Index 0 Read Fcode Write Setcode;
  283. Property data : TOperationTypewarningsItemTypedataArray Index 8 Read Fdata Write Setdata;
  284. Property message : String Index 16 Read Fmessage Write Setmessage;
  285. end;
  286. TOperationTypewarningsItemClass = Class of TOperationTypewarningsItem;
  287. { --------------------------------------------------------------------
  288. TOperation
  289. --------------------------------------------------------------------}
  290. TOperation = Class(TGoogleBaseObject)
  291. Private
  292. FclientOperationId : String;
  293. FcreationTimestamp : String;
  294. Fdescription : String;
  295. FendTime : String;
  296. Ferror : TOperationTypeerror;
  297. FhttpErrorMessage : String;
  298. FhttpErrorStatusCode : integer;
  299. Fid : String;
  300. FinsertTime : String;
  301. Fkind : String;
  302. Fname : String;
  303. FoperationType : String;
  304. Fprogress : integer;
  305. Fregion : String;
  306. FselfLink : String;
  307. FstartTime : String;
  308. Fstatus : String;
  309. FstatusMessage : String;
  310. FtargetId : String;
  311. FtargetLink : String;
  312. Fuser : String;
  313. Fwarnings : TOperationTypewarningsArray;
  314. Fzone : String;
  315. Protected
  316. //Property setters
  317. Procedure SetclientOperationId(AIndex : Integer; const AValue : String); virtual;
  318. Procedure SetcreationTimestamp(AIndex : Integer; const AValue : String); virtual;
  319. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  320. Procedure SetendTime(AIndex : Integer; const AValue : String); virtual;
  321. Procedure Seterror(AIndex : Integer; const AValue : TOperationTypeerror); virtual;
  322. Procedure SethttpErrorMessage(AIndex : Integer; const AValue : String); virtual;
  323. Procedure SethttpErrorStatusCode(AIndex : Integer; const AValue : integer); virtual;
  324. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  325. Procedure SetinsertTime(AIndex : Integer; const AValue : String); virtual;
  326. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  327. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  328. Procedure SetoperationType(AIndex : Integer; const AValue : String); virtual;
  329. Procedure Setprogress(AIndex : Integer; const AValue : integer); virtual;
  330. Procedure Setregion(AIndex : Integer; const AValue : String); virtual;
  331. Procedure SetselfLink(AIndex : Integer; const AValue : String); virtual;
  332. Procedure SetstartTime(AIndex : Integer; const AValue : String); virtual;
  333. Procedure Setstatus(AIndex : Integer; const AValue : String); virtual;
  334. Procedure SetstatusMessage(AIndex : Integer; const AValue : String); virtual;
  335. Procedure SettargetId(AIndex : Integer; const AValue : String); virtual;
  336. Procedure SettargetLink(AIndex : Integer; const AValue : String); virtual;
  337. Procedure Setuser(AIndex : Integer; const AValue : String); virtual;
  338. Procedure Setwarnings(AIndex : Integer; const AValue : TOperationTypewarningsArray); virtual;
  339. Procedure Setzone(AIndex : Integer; const AValue : String); virtual;
  340. //2.6.4. bug workaround
  341. {$IFDEF VER2_6}
  342. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  343. {$ENDIF VER2_6}
  344. Public
  345. Published
  346. Property clientOperationId : String Index 0 Read FclientOperationId Write SetclientOperationId;
  347. Property creationTimestamp : String Index 8 Read FcreationTimestamp Write SetcreationTimestamp;
  348. Property description : String Index 16 Read Fdescription Write Setdescription;
  349. Property endTime : String Index 24 Read FendTime Write SetendTime;
  350. Property error : TOperationTypeerror Index 32 Read Ferror Write Seterror;
  351. Property httpErrorMessage : String Index 40 Read FhttpErrorMessage Write SethttpErrorMessage;
  352. Property httpErrorStatusCode : integer Index 48 Read FhttpErrorStatusCode Write SethttpErrorStatusCode;
  353. Property id : String Index 56 Read Fid Write Setid;
  354. Property insertTime : String Index 64 Read FinsertTime Write SetinsertTime;
  355. Property kind : String Index 72 Read Fkind Write Setkind;
  356. Property name : String Index 80 Read Fname Write Setname;
  357. Property operationType : String Index 88 Read FoperationType Write SetoperationType;
  358. Property progress : integer Index 96 Read Fprogress Write Setprogress;
  359. Property region : String Index 104 Read Fregion Write Setregion;
  360. Property selfLink : String Index 112 Read FselfLink Write SetselfLink;
  361. Property startTime : String Index 120 Read FstartTime Write SetstartTime;
  362. Property status : String Index 128 Read Fstatus Write Setstatus;
  363. Property statusMessage : String Index 136 Read FstatusMessage Write SetstatusMessage;
  364. Property targetId : String Index 144 Read FtargetId Write SettargetId;
  365. Property targetLink : String Index 152 Read FtargetLink Write SettargetLink;
  366. Property user : String Index 160 Read Fuser Write Setuser;
  367. Property warnings : TOperationTypewarningsArray Index 168 Read Fwarnings Write Setwarnings;
  368. Property zone : String Index 176 Read Fzone Write Setzone;
  369. end;
  370. TOperationClass = Class of TOperation;
  371. { --------------------------------------------------------------------
  372. TOperationList
  373. --------------------------------------------------------------------}
  374. TOperationList = Class(TGoogleBaseObject)
  375. Private
  376. Fid : String;
  377. Fitems : TOperationListTypeitemsArray;
  378. Fkind : String;
  379. FnextPageToken : String;
  380. FselfLink : String;
  381. Protected
  382. //Property setters
  383. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  384. Procedure Setitems(AIndex : Integer; const AValue : TOperationListTypeitemsArray); virtual;
  385. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  386. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  387. Procedure SetselfLink(AIndex : Integer; const AValue : String); virtual;
  388. //2.6.4. bug workaround
  389. {$IFDEF VER2_6}
  390. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  391. {$ENDIF VER2_6}
  392. Public
  393. Published
  394. Property id : String Index 0 Read Fid Write Setid;
  395. Property items : TOperationListTypeitemsArray Index 8 Read Fitems Write Setitems;
  396. Property kind : String Index 16 Read Fkind Write Setkind;
  397. Property nextPageToken : String Index 24 Read FnextPageToken Write SetnextPageToken;
  398. Property selfLink : String Index 32 Read FselfLink Write SetselfLink;
  399. end;
  400. TOperationListClass = Class of TOperationList;
  401. { --------------------------------------------------------------------
  402. TZone
  403. --------------------------------------------------------------------}
  404. TZone = Class(TGoogleBaseObject)
  405. Private
  406. FcreationTimestamp : String;
  407. Fdeprecated : TDeprecationStatus;
  408. Fdescription : String;
  409. Fid : String;
  410. Fkind : String;
  411. Fname : String;
  412. Fregion : String;
  413. FselfLink : String;
  414. Fstatus : String;
  415. Protected
  416. //Property setters
  417. Procedure SetcreationTimestamp(AIndex : Integer; const AValue : String); virtual;
  418. Procedure Setdeprecated(AIndex : Integer; const AValue : TDeprecationStatus); virtual;
  419. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  420. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  421. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  422. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  423. Procedure Setregion(AIndex : Integer; const AValue : String); virtual;
  424. Procedure SetselfLink(AIndex : Integer; const AValue : String); virtual;
  425. Procedure Setstatus(AIndex : Integer; const AValue : String); virtual;
  426. Public
  427. Published
  428. Property creationTimestamp : String Index 0 Read FcreationTimestamp Write SetcreationTimestamp;
  429. Property deprecated : TDeprecationStatus Index 8 Read Fdeprecated Write Setdeprecated;
  430. Property description : String Index 16 Read Fdescription Write Setdescription;
  431. Property id : String Index 24 Read Fid Write Setid;
  432. Property kind : String Index 32 Read Fkind Write Setkind;
  433. Property name : String Index 40 Read Fname Write Setname;
  434. Property region : String Index 48 Read Fregion Write Setregion;
  435. Property selfLink : String Index 56 Read FselfLink Write SetselfLink;
  436. Property status : String Index 64 Read Fstatus Write Setstatus;
  437. end;
  438. TZoneClass = Class of TZone;
  439. { --------------------------------------------------------------------
  440. TZoneList
  441. --------------------------------------------------------------------}
  442. TZoneList = Class(TGoogleBaseObject)
  443. Private
  444. Fid : String;
  445. Fitems : TZoneListTypeitemsArray;
  446. Fkind : String;
  447. FnextPageToken : String;
  448. FselfLink : String;
  449. Protected
  450. //Property setters
  451. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  452. Procedure Setitems(AIndex : Integer; const AValue : TZoneListTypeitemsArray); virtual;
  453. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  454. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  455. Procedure SetselfLink(AIndex : Integer; const AValue : String); virtual;
  456. //2.6.4. bug workaround
  457. {$IFDEF VER2_6}
  458. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  459. {$ENDIF VER2_6}
  460. Public
  461. Published
  462. Property id : String Index 0 Read Fid Write Setid;
  463. Property items : TZoneListTypeitemsArray Index 8 Read Fitems Write Setitems;
  464. Property kind : String Index 16 Read Fkind Write Setkind;
  465. Property nextPageToken : String Index 24 Read FnextPageToken Write SetnextPageToken;
  466. Property selfLink : String Index 32 Read FselfLink Write SetselfLink;
  467. end;
  468. TZoneListClass = Class of TZoneList;
  469. { --------------------------------------------------------------------
  470. TAutoscalersResource
  471. --------------------------------------------------------------------}
  472. //Optional query Options for TAutoscalersResource, method List
  473. TAutoscalersListOptions = Record
  474. filter : String;
  475. maxResults : integer;
  476. pageToken : String;
  477. end;
  478. TAutoscalersResource = Class(TGoogleResource)
  479. Public
  480. Class Function ResourceName : String; override;
  481. Class Function DefaultAPI : TGoogleAPIClass; override;
  482. Function Delete(autoscaler: string; project: string; zone: string) : TOperation;
  483. Function Get(autoscaler: string; project: string; zone: string) : TAutoscaler;
  484. Function Insert(project: string; zone: string; aAutoscaler : TAutoscaler) : TOperation;
  485. Function List(project: string; zone: string; AQuery : string = '') : TAutoscalerListResponse;
  486. Function List(project: string; zone: string; AQuery : TAutoscalerslistOptions) : TAutoscalerListResponse;
  487. Function Patch(autoscaler: string; project: string; zone: string; aAutoscaler : TAutoscaler) : TOperation;
  488. Function Update(autoscaler: string; project: string; zone: string; aAutoscaler : TAutoscaler) : TOperation;
  489. end;
  490. { --------------------------------------------------------------------
  491. TZoneOperationsResource
  492. --------------------------------------------------------------------}
  493. //Optional query Options for TZoneOperationsResource, method List
  494. TZoneOperationsListOptions = Record
  495. filter : String;
  496. maxResults : integer;
  497. pageToken : String;
  498. end;
  499. TZoneOperationsResource = Class(TGoogleResource)
  500. Public
  501. Class Function ResourceName : String; override;
  502. Class Function DefaultAPI : TGoogleAPIClass; override;
  503. Procedure Delete(operation: string; project: string; zone: string);
  504. Function Get(operation: string; project: string; zone: string) : TOperation;
  505. Function List(project: string; zone: string; AQuery : string = '') : TOperationList;
  506. Function List(project: string; zone: string; AQuery : TZoneOperationslistOptions) : TOperationList;
  507. end;
  508. { --------------------------------------------------------------------
  509. TZonesResource
  510. --------------------------------------------------------------------}
  511. //Optional query Options for TZonesResource, method List
  512. TZonesListOptions = Record
  513. filter : String;
  514. maxResults : integer;
  515. pageToken : String;
  516. project : String;
  517. end;
  518. TZonesResource = Class(TGoogleResource)
  519. Public
  520. Class Function ResourceName : String; override;
  521. Class Function DefaultAPI : TGoogleAPIClass; override;
  522. Function List(AQuery : string = '') : TZoneList;
  523. Function List(AQuery : TZoneslistOptions) : TZoneList;
  524. end;
  525. { --------------------------------------------------------------------
  526. TAutoscalerAPI
  527. --------------------------------------------------------------------}
  528. TAutoscalerAPI = Class(TGoogleAPI)
  529. Private
  530. FAutoscalersInstance : TAutoscalersResource;
  531. FZoneOperationsInstance : TZoneOperationsResource;
  532. FZonesInstance : TZonesResource;
  533. Function GetAutoscalersInstance : TAutoscalersResource;virtual;
  534. Function GetZoneOperationsInstance : TZoneOperationsResource;virtual;
  535. Function GetZonesInstance : TZonesResource;virtual;
  536. Public
  537. //Override class functions with API info
  538. Class Function APIName : String; override;
  539. Class Function APIVersion : String; override;
  540. Class Function APIRevision : String; override;
  541. Class Function APIID : String; override;
  542. Class Function APITitle : String; override;
  543. Class Function APIDescription : String; override;
  544. Class Function APIOwnerDomain : String; override;
  545. Class Function APIOwnerName : String; override;
  546. Class Function APIIcon16 : String; override;
  547. Class Function APIIcon32 : String; override;
  548. Class Function APIdocumentationLink : String; override;
  549. Class Function APIrootUrl : string; override;
  550. Class Function APIbasePath : string;override;
  551. Class Function APIbaseURL : String;override;
  552. Class Function APIProtocol : string;override;
  553. Class Function APIservicePath : string;override;
  554. Class Function APIbatchPath : String;override;
  555. Class Function APIAuthScopes : TScopeInfoArray;override;
  556. Class Function APINeedsAuth : Boolean;override;
  557. Class Procedure RegisterAPIResources; override;
  558. //Add create function for resources
  559. Function CreateAutoscalersResource(AOwner : TComponent) : TAutoscalersResource;virtual;overload;
  560. Function CreateAutoscalersResource : TAutoscalersResource;virtual;overload;
  561. Function CreateZoneOperationsResource(AOwner : TComponent) : TZoneOperationsResource;virtual;overload;
  562. Function CreateZoneOperationsResource : TZoneOperationsResource;virtual;overload;
  563. Function CreateZonesResource(AOwner : TComponent) : TZonesResource;virtual;overload;
  564. Function CreateZonesResource : TZonesResource;virtual;overload;
  565. //Add default on-demand instances for resources
  566. Property AutoscalersResource : TAutoscalersResource Read GetAutoscalersInstance;
  567. Property ZoneOperationsResource : TZoneOperationsResource Read GetZoneOperationsInstance;
  568. Property ZonesResource : TZonesResource Read GetZonesInstance;
  569. end;
  570. implementation
  571. { --------------------------------------------------------------------
  572. TAutoscaler
  573. --------------------------------------------------------------------}
  574. Procedure TAutoscaler.SetautoscalingPolicy(AIndex : Integer; const AValue : TAutoscalingPolicy);
  575. begin
  576. If (FautoscalingPolicy=AValue) then exit;
  577. FautoscalingPolicy:=AValue;
  578. MarkPropertyChanged(AIndex);
  579. end;
  580. Procedure TAutoscaler.SetcreationTimestamp(AIndex : Integer; const AValue : String);
  581. begin
  582. If (FcreationTimestamp=AValue) then exit;
  583. FcreationTimestamp:=AValue;
  584. MarkPropertyChanged(AIndex);
  585. end;
  586. Procedure TAutoscaler.Setdescription(AIndex : Integer; const AValue : String);
  587. begin
  588. If (Fdescription=AValue) then exit;
  589. Fdescription:=AValue;
  590. MarkPropertyChanged(AIndex);
  591. end;
  592. Procedure TAutoscaler.Setid(AIndex : Integer; const AValue : String);
  593. begin
  594. If (Fid=AValue) then exit;
  595. Fid:=AValue;
  596. MarkPropertyChanged(AIndex);
  597. end;
  598. Procedure TAutoscaler.Setkind(AIndex : Integer; const AValue : String);
  599. begin
  600. If (Fkind=AValue) then exit;
  601. Fkind:=AValue;
  602. MarkPropertyChanged(AIndex);
  603. end;
  604. Procedure TAutoscaler.Setname(AIndex : Integer; const AValue : String);
  605. begin
  606. If (Fname=AValue) then exit;
  607. Fname:=AValue;
  608. MarkPropertyChanged(AIndex);
  609. end;
  610. Procedure TAutoscaler.SetselfLink(AIndex : Integer; const AValue : String);
  611. begin
  612. If (FselfLink=AValue) then exit;
  613. FselfLink:=AValue;
  614. MarkPropertyChanged(AIndex);
  615. end;
  616. Procedure TAutoscaler.Settarget(AIndex : Integer; const AValue : String);
  617. begin
  618. If (Ftarget=AValue) then exit;
  619. Ftarget:=AValue;
  620. MarkPropertyChanged(AIndex);
  621. end;
  622. { --------------------------------------------------------------------
  623. TAutoscalerListResponse
  624. --------------------------------------------------------------------}
  625. Procedure TAutoscalerListResponse.Setitems(AIndex : Integer; const AValue : TAutoscalerListResponseTypeitemsArray);
  626. begin
  627. If (Fitems=AValue) then exit;
  628. Fitems:=AValue;
  629. MarkPropertyChanged(AIndex);
  630. end;
  631. Procedure TAutoscalerListResponse.Setkind(AIndex : Integer; const AValue : String);
  632. begin
  633. If (Fkind=AValue) then exit;
  634. Fkind:=AValue;
  635. MarkPropertyChanged(AIndex);
  636. end;
  637. Procedure TAutoscalerListResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  638. begin
  639. If (FnextPageToken=AValue) then exit;
  640. FnextPageToken:=AValue;
  641. MarkPropertyChanged(AIndex);
  642. end;
  643. //2.6.4. bug workaround
  644. {$IFDEF VER2_6}
  645. Procedure TAutoscalerListResponse.SetArrayLength(Const AName : String; ALength : Longint);
  646. begin
  647. Case AName of
  648. 'items' : SetLength(Fitems,ALength);
  649. else
  650. Inherited SetArrayLength(AName,ALength);
  651. end;
  652. end;
  653. {$ENDIF VER2_6}
  654. { --------------------------------------------------------------------
  655. TAutoscalingPolicy
  656. --------------------------------------------------------------------}
  657. Procedure TAutoscalingPolicy.SetcoolDownPeriodSec(AIndex : Integer; const AValue : integer);
  658. begin
  659. If (FcoolDownPeriodSec=AValue) then exit;
  660. FcoolDownPeriodSec:=AValue;
  661. MarkPropertyChanged(AIndex);
  662. end;
  663. Procedure TAutoscalingPolicy.SetcpuUtilization(AIndex : Integer; const AValue : TAutoscalingPolicyCpuUtilization);
  664. begin
  665. If (FcpuUtilization=AValue) then exit;
  666. FcpuUtilization:=AValue;
  667. MarkPropertyChanged(AIndex);
  668. end;
  669. Procedure TAutoscalingPolicy.SetcustomMetricUtilizations(AIndex : Integer; const AValue : TAutoscalingPolicyTypecustomMetricUtilizationsArray);
  670. begin
  671. If (FcustomMetricUtilizations=AValue) then exit;
  672. FcustomMetricUtilizations:=AValue;
  673. MarkPropertyChanged(AIndex);
  674. end;
  675. Procedure TAutoscalingPolicy.SetloadBalancingUtilization(AIndex : Integer; const AValue : TAutoscalingPolicyLoadBalancingUtilization);
  676. begin
  677. If (FloadBalancingUtilization=AValue) then exit;
  678. FloadBalancingUtilization:=AValue;
  679. MarkPropertyChanged(AIndex);
  680. end;
  681. Procedure TAutoscalingPolicy.SetmaxNumReplicas(AIndex : Integer; const AValue : integer);
  682. begin
  683. If (FmaxNumReplicas=AValue) then exit;
  684. FmaxNumReplicas:=AValue;
  685. MarkPropertyChanged(AIndex);
  686. end;
  687. Procedure TAutoscalingPolicy.SetminNumReplicas(AIndex : Integer; const AValue : integer);
  688. begin
  689. If (FminNumReplicas=AValue) then exit;
  690. FminNumReplicas:=AValue;
  691. MarkPropertyChanged(AIndex);
  692. end;
  693. //2.6.4. bug workaround
  694. {$IFDEF VER2_6}
  695. Procedure TAutoscalingPolicy.SetArrayLength(Const AName : String; ALength : Longint);
  696. begin
  697. Case AName of
  698. 'custommetricutilizations' : SetLength(FcustomMetricUtilizations,ALength);
  699. else
  700. Inherited SetArrayLength(AName,ALength);
  701. end;
  702. end;
  703. {$ENDIF VER2_6}
  704. { --------------------------------------------------------------------
  705. TAutoscalingPolicyCpuUtilization
  706. --------------------------------------------------------------------}
  707. Procedure TAutoscalingPolicyCpuUtilization.SetutilizationTarget(AIndex : Integer; const AValue : double);
  708. begin
  709. If (FutilizationTarget=AValue) then exit;
  710. FutilizationTarget:=AValue;
  711. MarkPropertyChanged(AIndex);
  712. end;
  713. { --------------------------------------------------------------------
  714. TAutoscalingPolicyCustomMetricUtilization
  715. --------------------------------------------------------------------}
  716. Procedure TAutoscalingPolicyCustomMetricUtilization.Setmetric(AIndex : Integer; const AValue : String);
  717. begin
  718. If (Fmetric=AValue) then exit;
  719. Fmetric:=AValue;
  720. MarkPropertyChanged(AIndex);
  721. end;
  722. Procedure TAutoscalingPolicyCustomMetricUtilization.SetutilizationTarget(AIndex : Integer; const AValue : double);
  723. begin
  724. If (FutilizationTarget=AValue) then exit;
  725. FutilizationTarget:=AValue;
  726. MarkPropertyChanged(AIndex);
  727. end;
  728. Procedure TAutoscalingPolicyCustomMetricUtilization.SetutilizationTargetType(AIndex : Integer; const AValue : String);
  729. begin
  730. If (FutilizationTargetType=AValue) then exit;
  731. FutilizationTargetType:=AValue;
  732. MarkPropertyChanged(AIndex);
  733. end;
  734. { --------------------------------------------------------------------
  735. TAutoscalingPolicyLoadBalancingUtilization
  736. --------------------------------------------------------------------}
  737. Procedure TAutoscalingPolicyLoadBalancingUtilization.SetutilizationTarget(AIndex : Integer; const AValue : double);
  738. begin
  739. If (FutilizationTarget=AValue) then exit;
  740. FutilizationTarget:=AValue;
  741. MarkPropertyChanged(AIndex);
  742. end;
  743. { --------------------------------------------------------------------
  744. TDeprecationStatus
  745. --------------------------------------------------------------------}
  746. Procedure TDeprecationStatus.Setdeleted(AIndex : Integer; const AValue : String);
  747. begin
  748. If (Fdeleted=AValue) then exit;
  749. Fdeleted:=AValue;
  750. MarkPropertyChanged(AIndex);
  751. end;
  752. Procedure TDeprecationStatus.Setdeprecated(AIndex : Integer; const AValue : String);
  753. begin
  754. If (Fdeprecated=AValue) then exit;
  755. Fdeprecated:=AValue;
  756. MarkPropertyChanged(AIndex);
  757. end;
  758. Procedure TDeprecationStatus.Setobsolete(AIndex : Integer; const AValue : String);
  759. begin
  760. If (Fobsolete=AValue) then exit;
  761. Fobsolete:=AValue;
  762. MarkPropertyChanged(AIndex);
  763. end;
  764. Procedure TDeprecationStatus.Setreplacement(AIndex : Integer; const AValue : String);
  765. begin
  766. If (Freplacement=AValue) then exit;
  767. Freplacement:=AValue;
  768. MarkPropertyChanged(AIndex);
  769. end;
  770. Procedure TDeprecationStatus.Setstate(AIndex : Integer; const AValue : String);
  771. begin
  772. If (Fstate=AValue) then exit;
  773. Fstate:=AValue;
  774. MarkPropertyChanged(AIndex);
  775. end;
  776. { --------------------------------------------------------------------
  777. TOperationTypeerrorTypeerrorsItem
  778. --------------------------------------------------------------------}
  779. Procedure TOperationTypeerrorTypeerrorsItem.Setcode(AIndex : Integer; const AValue : String);
  780. begin
  781. If (Fcode=AValue) then exit;
  782. Fcode:=AValue;
  783. MarkPropertyChanged(AIndex);
  784. end;
  785. Procedure TOperationTypeerrorTypeerrorsItem.Setlocation(AIndex : Integer; const AValue : String);
  786. begin
  787. If (Flocation=AValue) then exit;
  788. Flocation:=AValue;
  789. MarkPropertyChanged(AIndex);
  790. end;
  791. Procedure TOperationTypeerrorTypeerrorsItem.Setmessage(AIndex : Integer; const AValue : String);
  792. begin
  793. If (Fmessage=AValue) then exit;
  794. Fmessage:=AValue;
  795. MarkPropertyChanged(AIndex);
  796. end;
  797. { --------------------------------------------------------------------
  798. TOperationTypeerror
  799. --------------------------------------------------------------------}
  800. Procedure TOperationTypeerror.Seterrors(AIndex : Integer; const AValue : TOperationTypeerrorTypeerrorsArray);
  801. begin
  802. If (Ferrors=AValue) then exit;
  803. Ferrors:=AValue;
  804. MarkPropertyChanged(AIndex);
  805. end;
  806. //2.6.4. bug workaround
  807. {$IFDEF VER2_6}
  808. Procedure TOperationTypeerror.SetArrayLength(Const AName : String; ALength : Longint);
  809. begin
  810. Case AName of
  811. 'errors' : SetLength(Ferrors,ALength);
  812. else
  813. Inherited SetArrayLength(AName,ALength);
  814. end;
  815. end;
  816. {$ENDIF VER2_6}
  817. { --------------------------------------------------------------------
  818. TOperationTypewarningsItemTypedataItem
  819. --------------------------------------------------------------------}
  820. Procedure TOperationTypewarningsItemTypedataItem.Setkey(AIndex : Integer; const AValue : String);
  821. begin
  822. If (Fkey=AValue) then exit;
  823. Fkey:=AValue;
  824. MarkPropertyChanged(AIndex);
  825. end;
  826. Procedure TOperationTypewarningsItemTypedataItem.Setvalue(AIndex : Integer; const AValue : String);
  827. begin
  828. If (Fvalue=AValue) then exit;
  829. Fvalue:=AValue;
  830. MarkPropertyChanged(AIndex);
  831. end;
  832. { --------------------------------------------------------------------
  833. TOperationTypewarningsItem
  834. --------------------------------------------------------------------}
  835. Procedure TOperationTypewarningsItem.Setcode(AIndex : Integer; const AValue : String);
  836. begin
  837. If (Fcode=AValue) then exit;
  838. Fcode:=AValue;
  839. MarkPropertyChanged(AIndex);
  840. end;
  841. Procedure TOperationTypewarningsItem.Setdata(AIndex : Integer; const AValue : TOperationTypewarningsItemTypedataArray);
  842. begin
  843. If (Fdata=AValue) then exit;
  844. Fdata:=AValue;
  845. MarkPropertyChanged(AIndex);
  846. end;
  847. Procedure TOperationTypewarningsItem.Setmessage(AIndex : Integer; const AValue : String);
  848. begin
  849. If (Fmessage=AValue) then exit;
  850. Fmessage:=AValue;
  851. MarkPropertyChanged(AIndex);
  852. end;
  853. //2.6.4. bug workaround
  854. {$IFDEF VER2_6}
  855. Procedure TOperationTypewarningsItem.SetArrayLength(Const AName : String; ALength : Longint);
  856. begin
  857. Case AName of
  858. 'data' : SetLength(Fdata,ALength);
  859. else
  860. Inherited SetArrayLength(AName,ALength);
  861. end;
  862. end;
  863. {$ENDIF VER2_6}
  864. { --------------------------------------------------------------------
  865. TOperation
  866. --------------------------------------------------------------------}
  867. Procedure TOperation.SetclientOperationId(AIndex : Integer; const AValue : String);
  868. begin
  869. If (FclientOperationId=AValue) then exit;
  870. FclientOperationId:=AValue;
  871. MarkPropertyChanged(AIndex);
  872. end;
  873. Procedure TOperation.SetcreationTimestamp(AIndex : Integer; const AValue : String);
  874. begin
  875. If (FcreationTimestamp=AValue) then exit;
  876. FcreationTimestamp:=AValue;
  877. MarkPropertyChanged(AIndex);
  878. end;
  879. Procedure TOperation.Setdescription(AIndex : Integer; const AValue : String);
  880. begin
  881. If (Fdescription=AValue) then exit;
  882. Fdescription:=AValue;
  883. MarkPropertyChanged(AIndex);
  884. end;
  885. Procedure TOperation.SetendTime(AIndex : Integer; const AValue : String);
  886. begin
  887. If (FendTime=AValue) then exit;
  888. FendTime:=AValue;
  889. MarkPropertyChanged(AIndex);
  890. end;
  891. Procedure TOperation.Seterror(AIndex : Integer; const AValue : TOperationTypeerror);
  892. begin
  893. If (Ferror=AValue) then exit;
  894. Ferror:=AValue;
  895. MarkPropertyChanged(AIndex);
  896. end;
  897. Procedure TOperation.SethttpErrorMessage(AIndex : Integer; const AValue : String);
  898. begin
  899. If (FhttpErrorMessage=AValue) then exit;
  900. FhttpErrorMessage:=AValue;
  901. MarkPropertyChanged(AIndex);
  902. end;
  903. Procedure TOperation.SethttpErrorStatusCode(AIndex : Integer; const AValue : integer);
  904. begin
  905. If (FhttpErrorStatusCode=AValue) then exit;
  906. FhttpErrorStatusCode:=AValue;
  907. MarkPropertyChanged(AIndex);
  908. end;
  909. Procedure TOperation.Setid(AIndex : Integer; const AValue : String);
  910. begin
  911. If (Fid=AValue) then exit;
  912. Fid:=AValue;
  913. MarkPropertyChanged(AIndex);
  914. end;
  915. Procedure TOperation.SetinsertTime(AIndex : Integer; const AValue : String);
  916. begin
  917. If (FinsertTime=AValue) then exit;
  918. FinsertTime:=AValue;
  919. MarkPropertyChanged(AIndex);
  920. end;
  921. Procedure TOperation.Setkind(AIndex : Integer; const AValue : String);
  922. begin
  923. If (Fkind=AValue) then exit;
  924. Fkind:=AValue;
  925. MarkPropertyChanged(AIndex);
  926. end;
  927. Procedure TOperation.Setname(AIndex : Integer; const AValue : String);
  928. begin
  929. If (Fname=AValue) then exit;
  930. Fname:=AValue;
  931. MarkPropertyChanged(AIndex);
  932. end;
  933. Procedure TOperation.SetoperationType(AIndex : Integer; const AValue : String);
  934. begin
  935. If (FoperationType=AValue) then exit;
  936. FoperationType:=AValue;
  937. MarkPropertyChanged(AIndex);
  938. end;
  939. Procedure TOperation.Setprogress(AIndex : Integer; const AValue : integer);
  940. begin
  941. If (Fprogress=AValue) then exit;
  942. Fprogress:=AValue;
  943. MarkPropertyChanged(AIndex);
  944. end;
  945. Procedure TOperation.Setregion(AIndex : Integer; const AValue : String);
  946. begin
  947. If (Fregion=AValue) then exit;
  948. Fregion:=AValue;
  949. MarkPropertyChanged(AIndex);
  950. end;
  951. Procedure TOperation.SetselfLink(AIndex : Integer; const AValue : String);
  952. begin
  953. If (FselfLink=AValue) then exit;
  954. FselfLink:=AValue;
  955. MarkPropertyChanged(AIndex);
  956. end;
  957. Procedure TOperation.SetstartTime(AIndex : Integer; const AValue : String);
  958. begin
  959. If (FstartTime=AValue) then exit;
  960. FstartTime:=AValue;
  961. MarkPropertyChanged(AIndex);
  962. end;
  963. Procedure TOperation.Setstatus(AIndex : Integer; const AValue : String);
  964. begin
  965. If (Fstatus=AValue) then exit;
  966. Fstatus:=AValue;
  967. MarkPropertyChanged(AIndex);
  968. end;
  969. Procedure TOperation.SetstatusMessage(AIndex : Integer; const AValue : String);
  970. begin
  971. If (FstatusMessage=AValue) then exit;
  972. FstatusMessage:=AValue;
  973. MarkPropertyChanged(AIndex);
  974. end;
  975. Procedure TOperation.SettargetId(AIndex : Integer; const AValue : String);
  976. begin
  977. If (FtargetId=AValue) then exit;
  978. FtargetId:=AValue;
  979. MarkPropertyChanged(AIndex);
  980. end;
  981. Procedure TOperation.SettargetLink(AIndex : Integer; const AValue : String);
  982. begin
  983. If (FtargetLink=AValue) then exit;
  984. FtargetLink:=AValue;
  985. MarkPropertyChanged(AIndex);
  986. end;
  987. Procedure TOperation.Setuser(AIndex : Integer; const AValue : String);
  988. begin
  989. If (Fuser=AValue) then exit;
  990. Fuser:=AValue;
  991. MarkPropertyChanged(AIndex);
  992. end;
  993. Procedure TOperation.Setwarnings(AIndex : Integer; const AValue : TOperationTypewarningsArray);
  994. begin
  995. If (Fwarnings=AValue) then exit;
  996. Fwarnings:=AValue;
  997. MarkPropertyChanged(AIndex);
  998. end;
  999. Procedure TOperation.Setzone(AIndex : Integer; const AValue : String);
  1000. begin
  1001. If (Fzone=AValue) then exit;
  1002. Fzone:=AValue;
  1003. MarkPropertyChanged(AIndex);
  1004. end;
  1005. //2.6.4. bug workaround
  1006. {$IFDEF VER2_6}
  1007. Procedure TOperation.SetArrayLength(Const AName : String; ALength : Longint);
  1008. begin
  1009. Case AName of
  1010. 'warnings' : SetLength(Fwarnings,ALength);
  1011. else
  1012. Inherited SetArrayLength(AName,ALength);
  1013. end;
  1014. end;
  1015. {$ENDIF VER2_6}
  1016. { --------------------------------------------------------------------
  1017. TOperationList
  1018. --------------------------------------------------------------------}
  1019. Procedure TOperationList.Setid(AIndex : Integer; const AValue : String);
  1020. begin
  1021. If (Fid=AValue) then exit;
  1022. Fid:=AValue;
  1023. MarkPropertyChanged(AIndex);
  1024. end;
  1025. Procedure TOperationList.Setitems(AIndex : Integer; const AValue : TOperationListTypeitemsArray);
  1026. begin
  1027. If (Fitems=AValue) then exit;
  1028. Fitems:=AValue;
  1029. MarkPropertyChanged(AIndex);
  1030. end;
  1031. Procedure TOperationList.Setkind(AIndex : Integer; const AValue : String);
  1032. begin
  1033. If (Fkind=AValue) then exit;
  1034. Fkind:=AValue;
  1035. MarkPropertyChanged(AIndex);
  1036. end;
  1037. Procedure TOperationList.SetnextPageToken(AIndex : Integer; const AValue : String);
  1038. begin
  1039. If (FnextPageToken=AValue) then exit;
  1040. FnextPageToken:=AValue;
  1041. MarkPropertyChanged(AIndex);
  1042. end;
  1043. Procedure TOperationList.SetselfLink(AIndex : Integer; const AValue : String);
  1044. begin
  1045. If (FselfLink=AValue) then exit;
  1046. FselfLink:=AValue;
  1047. MarkPropertyChanged(AIndex);
  1048. end;
  1049. //2.6.4. bug workaround
  1050. {$IFDEF VER2_6}
  1051. Procedure TOperationList.SetArrayLength(Const AName : String; ALength : Longint);
  1052. begin
  1053. Case AName of
  1054. 'items' : SetLength(Fitems,ALength);
  1055. else
  1056. Inherited SetArrayLength(AName,ALength);
  1057. end;
  1058. end;
  1059. {$ENDIF VER2_6}
  1060. { --------------------------------------------------------------------
  1061. TZone
  1062. --------------------------------------------------------------------}
  1063. Procedure TZone.SetcreationTimestamp(AIndex : Integer; const AValue : String);
  1064. begin
  1065. If (FcreationTimestamp=AValue) then exit;
  1066. FcreationTimestamp:=AValue;
  1067. MarkPropertyChanged(AIndex);
  1068. end;
  1069. Procedure TZone.Setdeprecated(AIndex : Integer; const AValue : TDeprecationStatus);
  1070. begin
  1071. If (Fdeprecated=AValue) then exit;
  1072. Fdeprecated:=AValue;
  1073. MarkPropertyChanged(AIndex);
  1074. end;
  1075. Procedure TZone.Setdescription(AIndex : Integer; const AValue : String);
  1076. begin
  1077. If (Fdescription=AValue) then exit;
  1078. Fdescription:=AValue;
  1079. MarkPropertyChanged(AIndex);
  1080. end;
  1081. Procedure TZone.Setid(AIndex : Integer; const AValue : String);
  1082. begin
  1083. If (Fid=AValue) then exit;
  1084. Fid:=AValue;
  1085. MarkPropertyChanged(AIndex);
  1086. end;
  1087. Procedure TZone.Setkind(AIndex : Integer; const AValue : String);
  1088. begin
  1089. If (Fkind=AValue) then exit;
  1090. Fkind:=AValue;
  1091. MarkPropertyChanged(AIndex);
  1092. end;
  1093. Procedure TZone.Setname(AIndex : Integer; const AValue : String);
  1094. begin
  1095. If (Fname=AValue) then exit;
  1096. Fname:=AValue;
  1097. MarkPropertyChanged(AIndex);
  1098. end;
  1099. Procedure TZone.Setregion(AIndex : Integer; const AValue : String);
  1100. begin
  1101. If (Fregion=AValue) then exit;
  1102. Fregion:=AValue;
  1103. MarkPropertyChanged(AIndex);
  1104. end;
  1105. Procedure TZone.SetselfLink(AIndex : Integer; const AValue : String);
  1106. begin
  1107. If (FselfLink=AValue) then exit;
  1108. FselfLink:=AValue;
  1109. MarkPropertyChanged(AIndex);
  1110. end;
  1111. Procedure TZone.Setstatus(AIndex : Integer; const AValue : String);
  1112. begin
  1113. If (Fstatus=AValue) then exit;
  1114. Fstatus:=AValue;
  1115. MarkPropertyChanged(AIndex);
  1116. end;
  1117. { --------------------------------------------------------------------
  1118. TZoneList
  1119. --------------------------------------------------------------------}
  1120. Procedure TZoneList.Setid(AIndex : Integer; const AValue : String);
  1121. begin
  1122. If (Fid=AValue) then exit;
  1123. Fid:=AValue;
  1124. MarkPropertyChanged(AIndex);
  1125. end;
  1126. Procedure TZoneList.Setitems(AIndex : Integer; const AValue : TZoneListTypeitemsArray);
  1127. begin
  1128. If (Fitems=AValue) then exit;
  1129. Fitems:=AValue;
  1130. MarkPropertyChanged(AIndex);
  1131. end;
  1132. Procedure TZoneList.Setkind(AIndex : Integer; const AValue : String);
  1133. begin
  1134. If (Fkind=AValue) then exit;
  1135. Fkind:=AValue;
  1136. MarkPropertyChanged(AIndex);
  1137. end;
  1138. Procedure TZoneList.SetnextPageToken(AIndex : Integer; const AValue : String);
  1139. begin
  1140. If (FnextPageToken=AValue) then exit;
  1141. FnextPageToken:=AValue;
  1142. MarkPropertyChanged(AIndex);
  1143. end;
  1144. Procedure TZoneList.SetselfLink(AIndex : Integer; const AValue : String);
  1145. begin
  1146. If (FselfLink=AValue) then exit;
  1147. FselfLink:=AValue;
  1148. MarkPropertyChanged(AIndex);
  1149. end;
  1150. //2.6.4. bug workaround
  1151. {$IFDEF VER2_6}
  1152. Procedure TZoneList.SetArrayLength(Const AName : String; ALength : Longint);
  1153. begin
  1154. Case AName of
  1155. 'items' : SetLength(Fitems,ALength);
  1156. else
  1157. Inherited SetArrayLength(AName,ALength);
  1158. end;
  1159. end;
  1160. {$ENDIF VER2_6}
  1161. { --------------------------------------------------------------------
  1162. TAutoscalersResource
  1163. --------------------------------------------------------------------}
  1164. Class Function TAutoscalersResource.ResourceName : String;
  1165. begin
  1166. Result:='autoscalers';
  1167. end;
  1168. Class Function TAutoscalersResource.DefaultAPI : TGoogleAPIClass;
  1169. begin
  1170. Result:=TautoscalerAPI;
  1171. end;
  1172. Function TAutoscalersResource.Delete(autoscaler: string; project: string; zone: string) : TOperation;
  1173. Const
  1174. _HTTPMethod = 'DELETE';
  1175. _Path = 'projects/{project}/zones/{zone}/autoscalers/{autoscaler}';
  1176. _Methodid = 'autoscaler.autoscalers.delete';
  1177. Var
  1178. _P : String;
  1179. begin
  1180. _P:=SubstitutePath(_Path,['autoscaler',autoscaler,'project',project,'zone',zone]);
  1181. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TOperation) as TOperation;
  1182. end;
  1183. Function TAutoscalersResource.Get(autoscaler: string; project: string; zone: string) : TAutoscaler;
  1184. Const
  1185. _HTTPMethod = 'GET';
  1186. _Path = 'projects/{project}/zones/{zone}/autoscalers/{autoscaler}';
  1187. _Methodid = 'autoscaler.autoscalers.get';
  1188. Var
  1189. _P : String;
  1190. begin
  1191. _P:=SubstitutePath(_Path,['autoscaler',autoscaler,'project',project,'zone',zone]);
  1192. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TAutoscaler) as TAutoscaler;
  1193. end;
  1194. Function TAutoscalersResource.Insert(project: string; zone: string; aAutoscaler : TAutoscaler) : TOperation;
  1195. Const
  1196. _HTTPMethod = 'POST';
  1197. _Path = 'projects/{project}/zones/{zone}/autoscalers';
  1198. _Methodid = 'autoscaler.autoscalers.insert';
  1199. Var
  1200. _P : String;
  1201. begin
  1202. _P:=SubstitutePath(_Path,['project',project,'zone',zone]);
  1203. Result:=ServiceCall(_HTTPMethod,_P,'',aAutoscaler,TOperation) as TOperation;
  1204. end;
  1205. Function TAutoscalersResource.List(project: string; zone: string; AQuery : string = '') : TAutoscalerListResponse;
  1206. Const
  1207. _HTTPMethod = 'GET';
  1208. _Path = 'projects/{project}/zones/{zone}/autoscalers';
  1209. _Methodid = 'autoscaler.autoscalers.list';
  1210. Var
  1211. _P : String;
  1212. begin
  1213. _P:=SubstitutePath(_Path,['project',project,'zone',zone]);
  1214. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TAutoscalerListResponse) as TAutoscalerListResponse;
  1215. end;
  1216. Function TAutoscalersResource.List(project: string; zone: string; AQuery : TAutoscalerslistOptions) : TAutoscalerListResponse;
  1217. Var
  1218. _Q : String;
  1219. begin
  1220. _Q:='';
  1221. AddToQuery(_Q,'filter',AQuery.filter);
  1222. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1223. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1224. Result:=List(project,zone,_Q);
  1225. end;
  1226. Function TAutoscalersResource.Patch(autoscaler: string; project: string; zone: string; aAutoscaler : TAutoscaler) : TOperation;
  1227. Const
  1228. _HTTPMethod = 'PATCH';
  1229. _Path = 'projects/{project}/zones/{zone}/autoscalers/{autoscaler}';
  1230. _Methodid = 'autoscaler.autoscalers.patch';
  1231. Var
  1232. _P : String;
  1233. begin
  1234. _P:=SubstitutePath(_Path,['autoscaler',autoscaler,'project',project,'zone',zone]);
  1235. Result:=ServiceCall(_HTTPMethod,_P,'',aAutoscaler,TOperation) as TOperation;
  1236. end;
  1237. Function TAutoscalersResource.Update(autoscaler: string; project: string; zone: string; aAutoscaler : TAutoscaler) : TOperation;
  1238. Const
  1239. _HTTPMethod = 'PUT';
  1240. _Path = 'projects/{project}/zones/{zone}/autoscalers/{autoscaler}';
  1241. _Methodid = 'autoscaler.autoscalers.update';
  1242. Var
  1243. _P : String;
  1244. begin
  1245. _P:=SubstitutePath(_Path,['autoscaler',autoscaler,'project',project,'zone',zone]);
  1246. Result:=ServiceCall(_HTTPMethod,_P,'',aAutoscaler,TOperation) as TOperation;
  1247. end;
  1248. { --------------------------------------------------------------------
  1249. TZoneOperationsResource
  1250. --------------------------------------------------------------------}
  1251. Class Function TZoneOperationsResource.ResourceName : String;
  1252. begin
  1253. Result:='zoneOperations';
  1254. end;
  1255. Class Function TZoneOperationsResource.DefaultAPI : TGoogleAPIClass;
  1256. begin
  1257. Result:=TautoscalerAPI;
  1258. end;
  1259. Procedure TZoneOperationsResource.Delete(operation: string; project: string; zone: string);
  1260. Const
  1261. _HTTPMethod = 'DELETE';
  1262. _Path = '{project}/zones/{zone}/operations/{operation}';
  1263. _Methodid = 'autoscaler.zoneOperations.delete';
  1264. Var
  1265. _P : String;
  1266. begin
  1267. _P:=SubstitutePath(_Path,['operation',operation,'project',project,'zone',zone]);
  1268. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  1269. end;
  1270. Function TZoneOperationsResource.Get(operation: string; project: string; zone: string) : TOperation;
  1271. Const
  1272. _HTTPMethod = 'GET';
  1273. _Path = '{project}/zones/{zone}/operations/{operation}';
  1274. _Methodid = 'autoscaler.zoneOperations.get';
  1275. Var
  1276. _P : String;
  1277. begin
  1278. _P:=SubstitutePath(_Path,['operation',operation,'project',project,'zone',zone]);
  1279. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TOperation) as TOperation;
  1280. end;
  1281. Function TZoneOperationsResource.List(project: string; zone: string; AQuery : string = '') : TOperationList;
  1282. Const
  1283. _HTTPMethod = 'GET';
  1284. _Path = '{project}/zones/{zone}/operations';
  1285. _Methodid = 'autoscaler.zoneOperations.list';
  1286. Var
  1287. _P : String;
  1288. begin
  1289. _P:=SubstitutePath(_Path,['project',project,'zone',zone]);
  1290. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TOperationList) as TOperationList;
  1291. end;
  1292. Function TZoneOperationsResource.List(project: string; zone: string; AQuery : TZoneOperationslistOptions) : TOperationList;
  1293. Var
  1294. _Q : String;
  1295. begin
  1296. _Q:='';
  1297. AddToQuery(_Q,'filter',AQuery.filter);
  1298. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1299. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1300. Result:=List(project,zone,_Q);
  1301. end;
  1302. { --------------------------------------------------------------------
  1303. TZonesResource
  1304. --------------------------------------------------------------------}
  1305. Class Function TZonesResource.ResourceName : String;
  1306. begin
  1307. Result:='zones';
  1308. end;
  1309. Class Function TZonesResource.DefaultAPI : TGoogleAPIClass;
  1310. begin
  1311. Result:=TautoscalerAPI;
  1312. end;
  1313. Function TZonesResource.List(AQuery : string = '') : TZoneList;
  1314. Const
  1315. _HTTPMethod = 'GET';
  1316. _Path = 'zones';
  1317. _Methodid = 'autoscaler.zones.list';
  1318. begin
  1319. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TZoneList) as TZoneList;
  1320. end;
  1321. Function TZonesResource.List(AQuery : TZoneslistOptions) : TZoneList;
  1322. Var
  1323. _Q : String;
  1324. begin
  1325. _Q:='';
  1326. AddToQuery(_Q,'filter',AQuery.filter);
  1327. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1328. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1329. AddToQuery(_Q,'project',AQuery.project);
  1330. Result:=List(_Q);
  1331. end;
  1332. { --------------------------------------------------------------------
  1333. TAutoscalerAPI
  1334. --------------------------------------------------------------------}
  1335. Class Function TAutoscalerAPI.APIName : String;
  1336. begin
  1337. Result:='autoscaler';
  1338. end;
  1339. Class Function TAutoscalerAPI.APIVersion : String;
  1340. begin
  1341. Result:='v1beta2';
  1342. end;
  1343. Class Function TAutoscalerAPI.APIRevision : String;
  1344. begin
  1345. Result:='20160511';
  1346. end;
  1347. Class Function TAutoscalerAPI.APIID : String;
  1348. begin
  1349. Result:='autoscaler:v1beta2';
  1350. end;
  1351. Class Function TAutoscalerAPI.APITitle : String;
  1352. begin
  1353. Result:='Google Compute Engine Autoscaler API';
  1354. end;
  1355. Class Function TAutoscalerAPI.APIDescription : String;
  1356. begin
  1357. Result:='The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.';
  1358. end;
  1359. Class Function TAutoscalerAPI.APIOwnerDomain : String;
  1360. begin
  1361. Result:='google.com';
  1362. end;
  1363. Class Function TAutoscalerAPI.APIOwnerName : String;
  1364. begin
  1365. Result:='Google';
  1366. end;
  1367. Class Function TAutoscalerAPI.APIIcon16 : String;
  1368. begin
  1369. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1370. end;
  1371. Class Function TAutoscalerAPI.APIIcon32 : String;
  1372. begin
  1373. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1374. end;
  1375. Class Function TAutoscalerAPI.APIdocumentationLink : String;
  1376. begin
  1377. Result:='http://developers.google.com/compute/docs/autoscaler';
  1378. end;
  1379. Class Function TAutoscalerAPI.APIrootUrl : string;
  1380. begin
  1381. Result:='https://www.googleapis.com/';
  1382. end;
  1383. Class Function TAutoscalerAPI.APIbasePath : string;
  1384. begin
  1385. Result:='/autoscaler/v1beta2/';
  1386. end;
  1387. Class Function TAutoscalerAPI.APIbaseURL : String;
  1388. begin
  1389. Result:='https://www.googleapis.com/autoscaler/v1beta2/';
  1390. end;
  1391. Class Function TAutoscalerAPI.APIProtocol : string;
  1392. begin
  1393. Result:='rest';
  1394. end;
  1395. Class Function TAutoscalerAPI.APIservicePath : string;
  1396. begin
  1397. Result:='autoscaler/v1beta2/';
  1398. end;
  1399. Class Function TAutoscalerAPI.APIbatchPath : String;
  1400. begin
  1401. Result:='batch';
  1402. end;
  1403. Class Function TAutoscalerAPI.APIAuthScopes : TScopeInfoArray;
  1404. begin
  1405. SetLength(Result,2);
  1406. Result[0].Name:='https://www.googleapis.com/auth/compute';
  1407. Result[0].Description:='View and manage your Google Compute Engine resources';
  1408. Result[1].Name:='https://www.googleapis.com/auth/compute.readonly';
  1409. Result[1].Description:='View your Google Compute Engine resources';
  1410. end;
  1411. Class Function TAutoscalerAPI.APINeedsAuth : Boolean;
  1412. begin
  1413. Result:=True;
  1414. end;
  1415. Class Procedure TAutoscalerAPI.RegisterAPIResources;
  1416. begin
  1417. TAutoscaler.RegisterObject;
  1418. TAutoscalerListResponse.RegisterObject;
  1419. TAutoscalingPolicy.RegisterObject;
  1420. TAutoscalingPolicyCpuUtilization.RegisterObject;
  1421. TAutoscalingPolicyCustomMetricUtilization.RegisterObject;
  1422. TAutoscalingPolicyLoadBalancingUtilization.RegisterObject;
  1423. TDeprecationStatus.RegisterObject;
  1424. TOperationTypeerrorTypeerrorsItem.RegisterObject;
  1425. TOperationTypeerror.RegisterObject;
  1426. TOperationTypewarningsItemTypedataItem.RegisterObject;
  1427. TOperationTypewarningsItem.RegisterObject;
  1428. TOperation.RegisterObject;
  1429. TOperationList.RegisterObject;
  1430. TZone.RegisterObject;
  1431. TZoneList.RegisterObject;
  1432. end;
  1433. Function TAutoscalerAPI.GetAutoscalersInstance : TAutoscalersResource;
  1434. begin
  1435. if (FAutoscalersInstance=Nil) then
  1436. FAutoscalersInstance:=CreateAutoscalersResource;
  1437. Result:=FAutoscalersInstance;
  1438. end;
  1439. Function TAutoscalerAPI.CreateAutoscalersResource : TAutoscalersResource;
  1440. begin
  1441. Result:=CreateAutoscalersResource(Self);
  1442. end;
  1443. Function TAutoscalerAPI.CreateAutoscalersResource(AOwner : TComponent) : TAutoscalersResource;
  1444. begin
  1445. Result:=TAutoscalersResource.Create(AOwner);
  1446. Result.API:=Self.API;
  1447. end;
  1448. Function TAutoscalerAPI.GetZoneOperationsInstance : TZoneOperationsResource;
  1449. begin
  1450. if (FZoneOperationsInstance=Nil) then
  1451. FZoneOperationsInstance:=CreateZoneOperationsResource;
  1452. Result:=FZoneOperationsInstance;
  1453. end;
  1454. Function TAutoscalerAPI.CreateZoneOperationsResource : TZoneOperationsResource;
  1455. begin
  1456. Result:=CreateZoneOperationsResource(Self);
  1457. end;
  1458. Function TAutoscalerAPI.CreateZoneOperationsResource(AOwner : TComponent) : TZoneOperationsResource;
  1459. begin
  1460. Result:=TZoneOperationsResource.Create(AOwner);
  1461. Result.API:=Self.API;
  1462. end;
  1463. Function TAutoscalerAPI.GetZonesInstance : TZonesResource;
  1464. begin
  1465. if (FZonesInstance=Nil) then
  1466. FZonesInstance:=CreateZonesResource;
  1467. Result:=FZonesInstance;
  1468. end;
  1469. Function TAutoscalerAPI.CreateZonesResource : TZonesResource;
  1470. begin
  1471. Result:=CreateZonesResource(Self);
  1472. end;
  1473. Function TAutoscalerAPI.CreateZonesResource(AOwner : TComponent) : TZonesResource;
  1474. begin
  1475. Result:=TZonesResource.Create(AOwner);
  1476. Result.API:=Self.API;
  1477. end;
  1478. initialization
  1479. TAutoscalerAPI.RegisterAPI;
  1480. end.