googlecloudmonitoring.pp 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939
  1. unit googlecloudmonitoring;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TDeleteMetricDescriptorResponse = Class;
  9. TListMetricDescriptorsRequest = Class;
  10. TListMetricDescriptorsResponse = Class;
  11. TListTimeseriesDescriptorsRequest = Class;
  12. TListTimeseriesDescriptorsResponse = Class;
  13. TListTimeseriesRequest = Class;
  14. TListTimeseriesResponse = Class;
  15. TMetricDescriptor = Class;
  16. TMetricDescriptorLabelDescriptor = Class;
  17. TMetricDescriptorTypeDescriptor = Class;
  18. TPoint = Class;
  19. TPointDistribution = Class;
  20. TPointDistributionBucket = Class;
  21. TPointDistributionOverflowBucket = Class;
  22. TPointDistributionUnderflowBucket = Class;
  23. TTimeseries = Class;
  24. TTimeseriesDescriptor = Class;
  25. TTimeseriesDescriptorLabel = Class;
  26. TTimeseriesPoint = Class;
  27. TWriteTimeseriesRequest = Class;
  28. TWriteTimeseriesResponse = Class;
  29. TDeleteMetricDescriptorResponseArray = Array of TDeleteMetricDescriptorResponse;
  30. TListMetricDescriptorsRequestArray = Array of TListMetricDescriptorsRequest;
  31. TListMetricDescriptorsResponseArray = Array of TListMetricDescriptorsResponse;
  32. TListTimeseriesDescriptorsRequestArray = Array of TListTimeseriesDescriptorsRequest;
  33. TListTimeseriesDescriptorsResponseArray = Array of TListTimeseriesDescriptorsResponse;
  34. TListTimeseriesRequestArray = Array of TListTimeseriesRequest;
  35. TListTimeseriesResponseArray = Array of TListTimeseriesResponse;
  36. TMetricDescriptorArray = Array of TMetricDescriptor;
  37. TMetricDescriptorLabelDescriptorArray = Array of TMetricDescriptorLabelDescriptor;
  38. TMetricDescriptorTypeDescriptorArray = Array of TMetricDescriptorTypeDescriptor;
  39. TPointArray = Array of TPoint;
  40. TPointDistributionArray = Array of TPointDistribution;
  41. TPointDistributionBucketArray = Array of TPointDistributionBucket;
  42. TPointDistributionOverflowBucketArray = Array of TPointDistributionOverflowBucket;
  43. TPointDistributionUnderflowBucketArray = Array of TPointDistributionUnderflowBucket;
  44. TTimeseriesArray = Array of TTimeseries;
  45. TTimeseriesDescriptorArray = Array of TTimeseriesDescriptor;
  46. TTimeseriesDescriptorLabelArray = Array of TTimeseriesDescriptorLabel;
  47. TTimeseriesPointArray = Array of TTimeseriesPoint;
  48. TWriteTimeseriesRequestArray = Array of TWriteTimeseriesRequest;
  49. TWriteTimeseriesResponseArray = Array of TWriteTimeseriesResponse;
  50. //Anonymous types, using auto-generated names
  51. TTimeseriesDescriptorTypelabels = Class;
  52. TWriteTimeseriesRequestTypecommonLabels = Class;
  53. TListMetricDescriptorsResponseTypemetricsArray = Array of TMetricDescriptor;
  54. TListTimeseriesDescriptorsResponseTypetimeseriesArray = Array of TTimeseriesDescriptor;
  55. TListTimeseriesResponseTypetimeseriesArray = Array of TTimeseries;
  56. TMetricDescriptorTypelabelsArray = Array of TMetricDescriptorLabelDescriptor;
  57. TPointDistributionTypebucketsArray = Array of TPointDistributionBucket;
  58. TTimeseriesTypepointsArray = Array of TPoint;
  59. TWriteTimeseriesRequestTypetimeseriesArray = Array of TTimeseriesPoint;
  60. { --------------------------------------------------------------------
  61. TDeleteMetricDescriptorResponse
  62. --------------------------------------------------------------------}
  63. TDeleteMetricDescriptorResponse = Class(TGoogleBaseObject)
  64. Private
  65. Fkind : String;
  66. Protected
  67. //Property setters
  68. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  69. Public
  70. Published
  71. Property kind : String Index 0 Read Fkind Write Setkind;
  72. end;
  73. TDeleteMetricDescriptorResponseClass = Class of TDeleteMetricDescriptorResponse;
  74. { --------------------------------------------------------------------
  75. TListMetricDescriptorsRequest
  76. --------------------------------------------------------------------}
  77. TListMetricDescriptorsRequest = Class(TGoogleBaseObject)
  78. Private
  79. Fkind : String;
  80. Protected
  81. //Property setters
  82. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  83. Public
  84. Published
  85. Property kind : String Index 0 Read Fkind Write Setkind;
  86. end;
  87. TListMetricDescriptorsRequestClass = Class of TListMetricDescriptorsRequest;
  88. { --------------------------------------------------------------------
  89. TListMetricDescriptorsResponse
  90. --------------------------------------------------------------------}
  91. TListMetricDescriptorsResponse = Class(TGoogleBaseObject)
  92. Private
  93. Fkind : String;
  94. Fmetrics : TListMetricDescriptorsResponseTypemetricsArray;
  95. FnextPageToken : String;
  96. Protected
  97. //Property setters
  98. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  99. Procedure Setmetrics(AIndex : Integer; const AValue : TListMetricDescriptorsResponseTypemetricsArray); virtual;
  100. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  101. //2.6.4. bug workaround
  102. {$IFDEF VER2_6}
  103. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  104. {$ENDIF VER2_6}
  105. Public
  106. Published
  107. Property kind : String Index 0 Read Fkind Write Setkind;
  108. Property metrics : TListMetricDescriptorsResponseTypemetricsArray Index 8 Read Fmetrics Write Setmetrics;
  109. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  110. end;
  111. TListMetricDescriptorsResponseClass = Class of TListMetricDescriptorsResponse;
  112. { --------------------------------------------------------------------
  113. TListTimeseriesDescriptorsRequest
  114. --------------------------------------------------------------------}
  115. TListTimeseriesDescriptorsRequest = Class(TGoogleBaseObject)
  116. Private
  117. Fkind : String;
  118. Protected
  119. //Property setters
  120. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  121. Public
  122. Published
  123. Property kind : String Index 0 Read Fkind Write Setkind;
  124. end;
  125. TListTimeseriesDescriptorsRequestClass = Class of TListTimeseriesDescriptorsRequest;
  126. { --------------------------------------------------------------------
  127. TListTimeseriesDescriptorsResponse
  128. --------------------------------------------------------------------}
  129. TListTimeseriesDescriptorsResponse = Class(TGoogleBaseObject)
  130. Private
  131. Fkind : String;
  132. FnextPageToken : String;
  133. Foldest : TDatetime;
  134. Ftimeseries : TListTimeseriesDescriptorsResponseTypetimeseriesArray;
  135. Fyoungest : TDatetime;
  136. Protected
  137. //Property setters
  138. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  139. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  140. Procedure Setoldest(AIndex : Integer; const AValue : TDatetime); virtual;
  141. Procedure Settimeseries(AIndex : Integer; const AValue : TListTimeseriesDescriptorsResponseTypetimeseriesArray); virtual;
  142. Procedure Setyoungest(AIndex : Integer; const AValue : TDatetime); virtual;
  143. //2.6.4. bug workaround
  144. {$IFDEF VER2_6}
  145. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  146. {$ENDIF VER2_6}
  147. Public
  148. Published
  149. Property kind : String Index 0 Read Fkind Write Setkind;
  150. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  151. Property oldest : TDatetime Index 16 Read Foldest Write Setoldest;
  152. Property timeseries : TListTimeseriesDescriptorsResponseTypetimeseriesArray Index 24 Read Ftimeseries Write Settimeseries;
  153. Property youngest : TDatetime Index 32 Read Fyoungest Write Setyoungest;
  154. end;
  155. TListTimeseriesDescriptorsResponseClass = Class of TListTimeseriesDescriptorsResponse;
  156. { --------------------------------------------------------------------
  157. TListTimeseriesRequest
  158. --------------------------------------------------------------------}
  159. TListTimeseriesRequest = Class(TGoogleBaseObject)
  160. Private
  161. Fkind : String;
  162. Protected
  163. //Property setters
  164. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  165. Public
  166. Published
  167. Property kind : String Index 0 Read Fkind Write Setkind;
  168. end;
  169. TListTimeseriesRequestClass = Class of TListTimeseriesRequest;
  170. { --------------------------------------------------------------------
  171. TListTimeseriesResponse
  172. --------------------------------------------------------------------}
  173. TListTimeseriesResponse = Class(TGoogleBaseObject)
  174. Private
  175. Fkind : String;
  176. FnextPageToken : String;
  177. Foldest : TDatetime;
  178. Ftimeseries : TListTimeseriesResponseTypetimeseriesArray;
  179. Fyoungest : TDatetime;
  180. Protected
  181. //Property setters
  182. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  183. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  184. Procedure Setoldest(AIndex : Integer; const AValue : TDatetime); virtual;
  185. Procedure Settimeseries(AIndex : Integer; const AValue : TListTimeseriesResponseTypetimeseriesArray); virtual;
  186. Procedure Setyoungest(AIndex : Integer; const AValue : TDatetime); virtual;
  187. //2.6.4. bug workaround
  188. {$IFDEF VER2_6}
  189. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  190. {$ENDIF VER2_6}
  191. Public
  192. Published
  193. Property kind : String Index 0 Read Fkind Write Setkind;
  194. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  195. Property oldest : TDatetime Index 16 Read Foldest Write Setoldest;
  196. Property timeseries : TListTimeseriesResponseTypetimeseriesArray Index 24 Read Ftimeseries Write Settimeseries;
  197. Property youngest : TDatetime Index 32 Read Fyoungest Write Setyoungest;
  198. end;
  199. TListTimeseriesResponseClass = Class of TListTimeseriesResponse;
  200. { --------------------------------------------------------------------
  201. TMetricDescriptor
  202. --------------------------------------------------------------------}
  203. TMetricDescriptor = Class(TGoogleBaseObject)
  204. Private
  205. Fdescription : String;
  206. Flabels : TMetricDescriptorTypelabelsArray;
  207. Fname : String;
  208. Fproject : String;
  209. FtypeDescriptor : TMetricDescriptorTypeDescriptor;
  210. Protected
  211. //Property setters
  212. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  213. Procedure Setlabels(AIndex : Integer; const AValue : TMetricDescriptorTypelabelsArray); virtual;
  214. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  215. Procedure Setproject(AIndex : Integer; const AValue : String); virtual;
  216. Procedure SettypeDescriptor(AIndex : Integer; const AValue : TMetricDescriptorTypeDescriptor); virtual;
  217. //2.6.4. bug workaround
  218. {$IFDEF VER2_6}
  219. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  220. {$ENDIF VER2_6}
  221. Public
  222. Published
  223. Property description : String Index 0 Read Fdescription Write Setdescription;
  224. Property labels : TMetricDescriptorTypelabelsArray Index 8 Read Flabels Write Setlabels;
  225. Property name : String Index 16 Read Fname Write Setname;
  226. Property project : String Index 24 Read Fproject Write Setproject;
  227. Property typeDescriptor : TMetricDescriptorTypeDescriptor Index 32 Read FtypeDescriptor Write SettypeDescriptor;
  228. end;
  229. TMetricDescriptorClass = Class of TMetricDescriptor;
  230. { --------------------------------------------------------------------
  231. TMetricDescriptorLabelDescriptor
  232. --------------------------------------------------------------------}
  233. TMetricDescriptorLabelDescriptor = Class(TGoogleBaseObject)
  234. Private
  235. Fdescription : String;
  236. Fkey : String;
  237. Protected
  238. //Property setters
  239. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  240. Procedure Setkey(AIndex : Integer; const AValue : String); virtual;
  241. Public
  242. Published
  243. Property description : String Index 0 Read Fdescription Write Setdescription;
  244. Property key : String Index 8 Read Fkey Write Setkey;
  245. end;
  246. TMetricDescriptorLabelDescriptorClass = Class of TMetricDescriptorLabelDescriptor;
  247. { --------------------------------------------------------------------
  248. TMetricDescriptorTypeDescriptor
  249. --------------------------------------------------------------------}
  250. TMetricDescriptorTypeDescriptor = Class(TGoogleBaseObject)
  251. Private
  252. FmetricType : String;
  253. FvalueType : String;
  254. Protected
  255. //Property setters
  256. Procedure SetmetricType(AIndex : Integer; const AValue : String); virtual;
  257. Procedure SetvalueType(AIndex : Integer; const AValue : String); virtual;
  258. Public
  259. Published
  260. Property metricType : String Index 0 Read FmetricType Write SetmetricType;
  261. Property valueType : String Index 8 Read FvalueType Write SetvalueType;
  262. end;
  263. TMetricDescriptorTypeDescriptorClass = Class of TMetricDescriptorTypeDescriptor;
  264. { --------------------------------------------------------------------
  265. TPoint
  266. --------------------------------------------------------------------}
  267. TPoint = Class(TGoogleBaseObject)
  268. Private
  269. FboolValue : boolean;
  270. FdistributionValue : TPointDistribution;
  271. FdoubleValue : double;
  272. F_end : TDatetime;
  273. Fint64Value : String;
  274. Fstart : TDatetime;
  275. FstringValue : String;
  276. Protected
  277. Class Function ExportPropertyName(Const AName : String) : string; override;
  278. //Property setters
  279. Procedure SetboolValue(AIndex : Integer; const AValue : boolean); virtual;
  280. Procedure SetdistributionValue(AIndex : Integer; const AValue : TPointDistribution); virtual;
  281. Procedure SetdoubleValue(AIndex : Integer; const AValue : double); virtual;
  282. Procedure Set_end(AIndex : Integer; const AValue : TDatetime); virtual;
  283. Procedure Setint64Value(AIndex : Integer; const AValue : String); virtual;
  284. Procedure Setstart(AIndex : Integer; const AValue : TDatetime); virtual;
  285. Procedure SetstringValue(AIndex : Integer; const AValue : String); virtual;
  286. Public
  287. Published
  288. Property boolValue : boolean Index 0 Read FboolValue Write SetboolValue;
  289. Property distributionValue : TPointDistribution Index 8 Read FdistributionValue Write SetdistributionValue;
  290. Property doubleValue : double Index 16 Read FdoubleValue Write SetdoubleValue;
  291. Property _end : TDatetime Index 24 Read F_end Write Set_end;
  292. Property int64Value : String Index 32 Read Fint64Value Write Setint64Value;
  293. Property start : TDatetime Index 40 Read Fstart Write Setstart;
  294. Property stringValue : String Index 48 Read FstringValue Write SetstringValue;
  295. end;
  296. TPointClass = Class of TPoint;
  297. { --------------------------------------------------------------------
  298. TPointDistribution
  299. --------------------------------------------------------------------}
  300. TPointDistribution = Class(TGoogleBaseObject)
  301. Private
  302. Fbuckets : TPointDistributionTypebucketsArray;
  303. FoverflowBucket : TPointDistributionOverflowBucket;
  304. FunderflowBucket : TPointDistributionUnderflowBucket;
  305. Protected
  306. //Property setters
  307. Procedure Setbuckets(AIndex : Integer; const AValue : TPointDistributionTypebucketsArray); virtual;
  308. Procedure SetoverflowBucket(AIndex : Integer; const AValue : TPointDistributionOverflowBucket); virtual;
  309. Procedure SetunderflowBucket(AIndex : Integer; const AValue : TPointDistributionUnderflowBucket); virtual;
  310. //2.6.4. bug workaround
  311. {$IFDEF VER2_6}
  312. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  313. {$ENDIF VER2_6}
  314. Public
  315. Published
  316. Property buckets : TPointDistributionTypebucketsArray Index 0 Read Fbuckets Write Setbuckets;
  317. Property overflowBucket : TPointDistributionOverflowBucket Index 8 Read FoverflowBucket Write SetoverflowBucket;
  318. Property underflowBucket : TPointDistributionUnderflowBucket Index 16 Read FunderflowBucket Write SetunderflowBucket;
  319. end;
  320. TPointDistributionClass = Class of TPointDistribution;
  321. { --------------------------------------------------------------------
  322. TPointDistributionBucket
  323. --------------------------------------------------------------------}
  324. TPointDistributionBucket = Class(TGoogleBaseObject)
  325. Private
  326. Fcount : String;
  327. FlowerBound : double;
  328. FupperBound : double;
  329. Protected
  330. //Property setters
  331. Procedure Setcount(AIndex : Integer; const AValue : String); virtual;
  332. Procedure SetlowerBound(AIndex : Integer; const AValue : double); virtual;
  333. Procedure SetupperBound(AIndex : Integer; const AValue : double); virtual;
  334. Public
  335. Published
  336. Property count : String Index 0 Read Fcount Write Setcount;
  337. Property lowerBound : double Index 8 Read FlowerBound Write SetlowerBound;
  338. Property upperBound : double Index 16 Read FupperBound Write SetupperBound;
  339. end;
  340. TPointDistributionBucketClass = Class of TPointDistributionBucket;
  341. { --------------------------------------------------------------------
  342. TPointDistributionOverflowBucket
  343. --------------------------------------------------------------------}
  344. TPointDistributionOverflowBucket = Class(TGoogleBaseObject)
  345. Private
  346. Fcount : String;
  347. FlowerBound : double;
  348. Protected
  349. //Property setters
  350. Procedure Setcount(AIndex : Integer; const AValue : String); virtual;
  351. Procedure SetlowerBound(AIndex : Integer; const AValue : double); virtual;
  352. Public
  353. Published
  354. Property count : String Index 0 Read Fcount Write Setcount;
  355. Property lowerBound : double Index 8 Read FlowerBound Write SetlowerBound;
  356. end;
  357. TPointDistributionOverflowBucketClass = Class of TPointDistributionOverflowBucket;
  358. { --------------------------------------------------------------------
  359. TPointDistributionUnderflowBucket
  360. --------------------------------------------------------------------}
  361. TPointDistributionUnderflowBucket = Class(TGoogleBaseObject)
  362. Private
  363. Fcount : String;
  364. FupperBound : double;
  365. Protected
  366. //Property setters
  367. Procedure Setcount(AIndex : Integer; const AValue : String); virtual;
  368. Procedure SetupperBound(AIndex : Integer; const AValue : double); virtual;
  369. Public
  370. Published
  371. Property count : String Index 0 Read Fcount Write Setcount;
  372. Property upperBound : double Index 8 Read FupperBound Write SetupperBound;
  373. end;
  374. TPointDistributionUnderflowBucketClass = Class of TPointDistributionUnderflowBucket;
  375. { --------------------------------------------------------------------
  376. TTimeseries
  377. --------------------------------------------------------------------}
  378. TTimeseries = Class(TGoogleBaseObject)
  379. Private
  380. Fpoints : TTimeseriesTypepointsArray;
  381. FtimeseriesDesc : TTimeseriesDescriptor;
  382. Protected
  383. //Property setters
  384. Procedure Setpoints(AIndex : Integer; const AValue : TTimeseriesTypepointsArray); virtual;
  385. Procedure SettimeseriesDesc(AIndex : Integer; const AValue : TTimeseriesDescriptor); virtual;
  386. //2.6.4. bug workaround
  387. {$IFDEF VER2_6}
  388. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  389. {$ENDIF VER2_6}
  390. Public
  391. Published
  392. Property points : TTimeseriesTypepointsArray Index 0 Read Fpoints Write Setpoints;
  393. Property timeseriesDesc : TTimeseriesDescriptor Index 8 Read FtimeseriesDesc Write SettimeseriesDesc;
  394. end;
  395. TTimeseriesClass = Class of TTimeseries;
  396. { --------------------------------------------------------------------
  397. TTimeseriesDescriptorTypelabels
  398. --------------------------------------------------------------------}
  399. TTimeseriesDescriptorTypelabels = Class(TGoogleBaseObject)
  400. Private
  401. Protected
  402. //Property setters
  403. Public
  404. Class Function AllowAdditionalProperties : Boolean; override;
  405. Published
  406. end;
  407. TTimeseriesDescriptorTypelabelsClass = Class of TTimeseriesDescriptorTypelabels;
  408. { --------------------------------------------------------------------
  409. TTimeseriesDescriptor
  410. --------------------------------------------------------------------}
  411. TTimeseriesDescriptor = Class(TGoogleBaseObject)
  412. Private
  413. Flabels : TTimeseriesDescriptorTypelabels;
  414. Fmetric : String;
  415. Fproject : String;
  416. Protected
  417. //Property setters
  418. Procedure Setlabels(AIndex : Integer; const AValue : TTimeseriesDescriptorTypelabels); virtual;
  419. Procedure Setmetric(AIndex : Integer; const AValue : String); virtual;
  420. Procedure Setproject(AIndex : Integer; const AValue : String); virtual;
  421. Public
  422. Published
  423. Property labels : TTimeseriesDescriptorTypelabels Index 0 Read Flabels Write Setlabels;
  424. Property metric : String Index 8 Read Fmetric Write Setmetric;
  425. Property project : String Index 16 Read Fproject Write Setproject;
  426. end;
  427. TTimeseriesDescriptorClass = Class of TTimeseriesDescriptor;
  428. { --------------------------------------------------------------------
  429. TTimeseriesDescriptorLabel
  430. --------------------------------------------------------------------}
  431. TTimeseriesDescriptorLabel = Class(TGoogleBaseObject)
  432. Private
  433. Fkey : String;
  434. Fvalue : String;
  435. Protected
  436. //Property setters
  437. Procedure Setkey(AIndex : Integer; const AValue : String); virtual;
  438. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  439. Public
  440. Published
  441. Property key : String Index 0 Read Fkey Write Setkey;
  442. Property value : String Index 8 Read Fvalue Write Setvalue;
  443. end;
  444. TTimeseriesDescriptorLabelClass = Class of TTimeseriesDescriptorLabel;
  445. { --------------------------------------------------------------------
  446. TTimeseriesPoint
  447. --------------------------------------------------------------------}
  448. TTimeseriesPoint = Class(TGoogleBaseObject)
  449. Private
  450. Fpoint : TPoint;
  451. FtimeseriesDesc : TTimeseriesDescriptor;
  452. Protected
  453. //Property setters
  454. Procedure Setpoint(AIndex : Integer; const AValue : TPoint); virtual;
  455. Procedure SettimeseriesDesc(AIndex : Integer; const AValue : TTimeseriesDescriptor); virtual;
  456. Public
  457. Published
  458. Property point : TPoint Index 0 Read Fpoint Write Setpoint;
  459. Property timeseriesDesc : TTimeseriesDescriptor Index 8 Read FtimeseriesDesc Write SettimeseriesDesc;
  460. end;
  461. TTimeseriesPointClass = Class of TTimeseriesPoint;
  462. { --------------------------------------------------------------------
  463. TWriteTimeseriesRequestTypecommonLabels
  464. --------------------------------------------------------------------}
  465. TWriteTimeseriesRequestTypecommonLabels = Class(TGoogleBaseObject)
  466. Private
  467. Protected
  468. //Property setters
  469. Public
  470. Class Function AllowAdditionalProperties : Boolean; override;
  471. Published
  472. end;
  473. TWriteTimeseriesRequestTypecommonLabelsClass = Class of TWriteTimeseriesRequestTypecommonLabels;
  474. { --------------------------------------------------------------------
  475. TWriteTimeseriesRequest
  476. --------------------------------------------------------------------}
  477. TWriteTimeseriesRequest = Class(TGoogleBaseObject)
  478. Private
  479. FcommonLabels : TWriteTimeseriesRequestTypecommonLabels;
  480. Ftimeseries : TWriteTimeseriesRequestTypetimeseriesArray;
  481. Protected
  482. //Property setters
  483. Procedure SetcommonLabels(AIndex : Integer; const AValue : TWriteTimeseriesRequestTypecommonLabels); virtual;
  484. Procedure Settimeseries(AIndex : Integer; const AValue : TWriteTimeseriesRequestTypetimeseriesArray); virtual;
  485. //2.6.4. bug workaround
  486. {$IFDEF VER2_6}
  487. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  488. {$ENDIF VER2_6}
  489. Public
  490. Published
  491. Property commonLabels : TWriteTimeseriesRequestTypecommonLabels Index 0 Read FcommonLabels Write SetcommonLabels;
  492. Property timeseries : TWriteTimeseriesRequestTypetimeseriesArray Index 8 Read Ftimeseries Write Settimeseries;
  493. end;
  494. TWriteTimeseriesRequestClass = Class of TWriteTimeseriesRequest;
  495. { --------------------------------------------------------------------
  496. TWriteTimeseriesResponse
  497. --------------------------------------------------------------------}
  498. TWriteTimeseriesResponse = Class(TGoogleBaseObject)
  499. Private
  500. Fkind : String;
  501. Protected
  502. //Property setters
  503. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  504. Public
  505. Published
  506. Property kind : String Index 0 Read Fkind Write Setkind;
  507. end;
  508. TWriteTimeseriesResponseClass = Class of TWriteTimeseriesResponse;
  509. { --------------------------------------------------------------------
  510. TMetricDescriptorsResource
  511. --------------------------------------------------------------------}
  512. //Optional query Options for TMetricDescriptorsResource, method List
  513. TMetricDescriptorsListOptions = Record
  514. count : integer;
  515. pageToken : String;
  516. query : String;
  517. end;
  518. TMetricDescriptorsResource = Class(TGoogleResource)
  519. Public
  520. Class Function ResourceName : String; override;
  521. Class Function DefaultAPI : TGoogleAPIClass; override;
  522. Function Create(project: string; aMetricDescriptor : TMetricDescriptor) : TMetricDescriptor;overload;
  523. Function Delete(metric: string; project: string) : TDeleteMetricDescriptorResponse;
  524. Function List(project: string; aListMetricDescriptorsRequest : TListMetricDescriptorsRequest; AQuery : string = '') : TListMetricDescriptorsResponse;
  525. Function List(project: string; aListMetricDescriptorsRequest : TListMetricDescriptorsRequest; AQuery : TMetricDescriptorslistOptions) : TListMetricDescriptorsResponse;
  526. end;
  527. { --------------------------------------------------------------------
  528. TTimeseriesResource
  529. --------------------------------------------------------------------}
  530. //Optional query Options for TTimeseriesResource, method List
  531. TTimeseriesListOptions = Record
  532. aggregator : String;
  533. count : integer;
  534. labels : String;
  535. oldest : String;
  536. pageToken : String;
  537. timespan : String;
  538. window : String;
  539. youngest : String;
  540. end;
  541. TTimeseriesResource = Class(TGoogleResource)
  542. Public
  543. Class Function ResourceName : String; override;
  544. Class Function DefaultAPI : TGoogleAPIClass; override;
  545. Function List(metric: string; project: string; aListTimeseriesRequest : TListTimeseriesRequest; AQuery : string = '') : TListTimeseriesResponse;
  546. Function List(metric: string; project: string; aListTimeseriesRequest : TListTimeseriesRequest; AQuery : TTimeserieslistOptions) : TListTimeseriesResponse;
  547. Function Write(project: string; aWriteTimeseriesRequest : TWriteTimeseriesRequest) : TWriteTimeseriesResponse;
  548. end;
  549. { --------------------------------------------------------------------
  550. TTimeseriesDescriptorsResource
  551. --------------------------------------------------------------------}
  552. //Optional query Options for TTimeseriesDescriptorsResource, method List
  553. TTimeseriesDescriptorsListOptions = Record
  554. aggregator : String;
  555. count : integer;
  556. labels : String;
  557. oldest : String;
  558. pageToken : String;
  559. timespan : String;
  560. window : String;
  561. youngest : String;
  562. end;
  563. TTimeseriesDescriptorsResource = Class(TGoogleResource)
  564. Public
  565. Class Function ResourceName : String; override;
  566. Class Function DefaultAPI : TGoogleAPIClass; override;
  567. Function List(metric: string; project: string; aListTimeseriesDescriptorsRequest : TListTimeseriesDescriptorsRequest; AQuery : string = '') : TListTimeseriesDescriptorsResponse;
  568. Function List(metric: string; project: string; aListTimeseriesDescriptorsRequest : TListTimeseriesDescriptorsRequest; AQuery : TTimeseriesDescriptorslistOptions) : TListTimeseriesDescriptorsResponse;
  569. end;
  570. { --------------------------------------------------------------------
  571. TCloudmonitoringAPI
  572. --------------------------------------------------------------------}
  573. TCloudmonitoringAPI = Class(TGoogleAPI)
  574. Private
  575. FMetricDescriptorsInstance : TMetricDescriptorsResource;
  576. FTimeseriesInstance : TTimeseriesResource;
  577. FTimeseriesDescriptorsInstance : TTimeseriesDescriptorsResource;
  578. Function GetMetricDescriptorsInstance : TMetricDescriptorsResource;virtual;
  579. Function GetTimeseriesInstance : TTimeseriesResource;virtual;
  580. Function GetTimeseriesDescriptorsInstance : TTimeseriesDescriptorsResource;virtual;
  581. Public
  582. //Override class functions with API info
  583. Class Function APIName : String; override;
  584. Class Function APIVersion : String; override;
  585. Class Function APIRevision : String; override;
  586. Class Function APIID : String; override;
  587. Class Function APITitle : String; override;
  588. Class Function APIDescription : String; override;
  589. Class Function APIOwnerDomain : String; override;
  590. Class Function APIOwnerName : String; override;
  591. Class Function APIIcon16 : String; override;
  592. Class Function APIIcon32 : String; override;
  593. Class Function APIdocumentationLink : String; override;
  594. Class Function APIrootUrl : string; override;
  595. Class Function APIbasePath : string;override;
  596. Class Function APIbaseURL : String;override;
  597. Class Function APIProtocol : string;override;
  598. Class Function APIservicePath : string;override;
  599. Class Function APIbatchPath : String;override;
  600. Class Function APIAuthScopes : TScopeInfoArray;override;
  601. Class Function APINeedsAuth : Boolean;override;
  602. Class Procedure RegisterAPIResources; override;
  603. //Add create function for resources
  604. Function CreateMetricDescriptorsResource(AOwner : TComponent) : TMetricDescriptorsResource;virtual;overload;
  605. Function CreateMetricDescriptorsResource : TMetricDescriptorsResource;virtual;overload;
  606. Function CreateTimeseriesResource(AOwner : TComponent) : TTimeseriesResource;virtual;overload;
  607. Function CreateTimeseriesResource : TTimeseriesResource;virtual;overload;
  608. Function CreateTimeseriesDescriptorsResource(AOwner : TComponent) : TTimeseriesDescriptorsResource;virtual;overload;
  609. Function CreateTimeseriesDescriptorsResource : TTimeseriesDescriptorsResource;virtual;overload;
  610. //Add default on-demand instances for resources
  611. Property MetricDescriptorsResource : TMetricDescriptorsResource Read GetMetricDescriptorsInstance;
  612. Property TimeseriesResource : TTimeseriesResource Read GetTimeseriesInstance;
  613. Property TimeseriesDescriptorsResource : TTimeseriesDescriptorsResource Read GetTimeseriesDescriptorsInstance;
  614. end;
  615. implementation
  616. { --------------------------------------------------------------------
  617. TDeleteMetricDescriptorResponse
  618. --------------------------------------------------------------------}
  619. Procedure TDeleteMetricDescriptorResponse.Setkind(AIndex : Integer; const AValue : String);
  620. begin
  621. If (Fkind=AValue) then exit;
  622. Fkind:=AValue;
  623. MarkPropertyChanged(AIndex);
  624. end;
  625. { --------------------------------------------------------------------
  626. TListMetricDescriptorsRequest
  627. --------------------------------------------------------------------}
  628. Procedure TListMetricDescriptorsRequest.Setkind(AIndex : Integer; const AValue : String);
  629. begin
  630. If (Fkind=AValue) then exit;
  631. Fkind:=AValue;
  632. MarkPropertyChanged(AIndex);
  633. end;
  634. { --------------------------------------------------------------------
  635. TListMetricDescriptorsResponse
  636. --------------------------------------------------------------------}
  637. Procedure TListMetricDescriptorsResponse.Setkind(AIndex : Integer; const AValue : String);
  638. begin
  639. If (Fkind=AValue) then exit;
  640. Fkind:=AValue;
  641. MarkPropertyChanged(AIndex);
  642. end;
  643. Procedure TListMetricDescriptorsResponse.Setmetrics(AIndex : Integer; const AValue : TListMetricDescriptorsResponseTypemetricsArray);
  644. begin
  645. If (Fmetrics=AValue) then exit;
  646. Fmetrics:=AValue;
  647. MarkPropertyChanged(AIndex);
  648. end;
  649. Procedure TListMetricDescriptorsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  650. begin
  651. If (FnextPageToken=AValue) then exit;
  652. FnextPageToken:=AValue;
  653. MarkPropertyChanged(AIndex);
  654. end;
  655. //2.6.4. bug workaround
  656. {$IFDEF VER2_6}
  657. Procedure TListMetricDescriptorsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  658. begin
  659. Case AName of
  660. 'metrics' : SetLength(Fmetrics,ALength);
  661. else
  662. Inherited SetArrayLength(AName,ALength);
  663. end;
  664. end;
  665. {$ENDIF VER2_6}
  666. { --------------------------------------------------------------------
  667. TListTimeseriesDescriptorsRequest
  668. --------------------------------------------------------------------}
  669. Procedure TListTimeseriesDescriptorsRequest.Setkind(AIndex : Integer; const AValue : String);
  670. begin
  671. If (Fkind=AValue) then exit;
  672. Fkind:=AValue;
  673. MarkPropertyChanged(AIndex);
  674. end;
  675. { --------------------------------------------------------------------
  676. TListTimeseriesDescriptorsResponse
  677. --------------------------------------------------------------------}
  678. Procedure TListTimeseriesDescriptorsResponse.Setkind(AIndex : Integer; const AValue : String);
  679. begin
  680. If (Fkind=AValue) then exit;
  681. Fkind:=AValue;
  682. MarkPropertyChanged(AIndex);
  683. end;
  684. Procedure TListTimeseriesDescriptorsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  685. begin
  686. If (FnextPageToken=AValue) then exit;
  687. FnextPageToken:=AValue;
  688. MarkPropertyChanged(AIndex);
  689. end;
  690. Procedure TListTimeseriesDescriptorsResponse.Setoldest(AIndex : Integer; const AValue : TDatetime);
  691. begin
  692. If (Foldest=AValue) then exit;
  693. Foldest:=AValue;
  694. MarkPropertyChanged(AIndex);
  695. end;
  696. Procedure TListTimeseriesDescriptorsResponse.Settimeseries(AIndex : Integer; const AValue : TListTimeseriesDescriptorsResponseTypetimeseriesArray);
  697. begin
  698. If (Ftimeseries=AValue) then exit;
  699. Ftimeseries:=AValue;
  700. MarkPropertyChanged(AIndex);
  701. end;
  702. Procedure TListTimeseriesDescriptorsResponse.Setyoungest(AIndex : Integer; const AValue : TDatetime);
  703. begin
  704. If (Fyoungest=AValue) then exit;
  705. Fyoungest:=AValue;
  706. MarkPropertyChanged(AIndex);
  707. end;
  708. //2.6.4. bug workaround
  709. {$IFDEF VER2_6}
  710. Procedure TListTimeseriesDescriptorsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  711. begin
  712. Case AName of
  713. 'timeseries' : SetLength(Ftimeseries,ALength);
  714. else
  715. Inherited SetArrayLength(AName,ALength);
  716. end;
  717. end;
  718. {$ENDIF VER2_6}
  719. { --------------------------------------------------------------------
  720. TListTimeseriesRequest
  721. --------------------------------------------------------------------}
  722. Procedure TListTimeseriesRequest.Setkind(AIndex : Integer; const AValue : String);
  723. begin
  724. If (Fkind=AValue) then exit;
  725. Fkind:=AValue;
  726. MarkPropertyChanged(AIndex);
  727. end;
  728. { --------------------------------------------------------------------
  729. TListTimeseriesResponse
  730. --------------------------------------------------------------------}
  731. Procedure TListTimeseriesResponse.Setkind(AIndex : Integer; const AValue : String);
  732. begin
  733. If (Fkind=AValue) then exit;
  734. Fkind:=AValue;
  735. MarkPropertyChanged(AIndex);
  736. end;
  737. Procedure TListTimeseriesResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  738. begin
  739. If (FnextPageToken=AValue) then exit;
  740. FnextPageToken:=AValue;
  741. MarkPropertyChanged(AIndex);
  742. end;
  743. Procedure TListTimeseriesResponse.Setoldest(AIndex : Integer; const AValue : TDatetime);
  744. begin
  745. If (Foldest=AValue) then exit;
  746. Foldest:=AValue;
  747. MarkPropertyChanged(AIndex);
  748. end;
  749. Procedure TListTimeseriesResponse.Settimeseries(AIndex : Integer; const AValue : TListTimeseriesResponseTypetimeseriesArray);
  750. begin
  751. If (Ftimeseries=AValue) then exit;
  752. Ftimeseries:=AValue;
  753. MarkPropertyChanged(AIndex);
  754. end;
  755. Procedure TListTimeseriesResponse.Setyoungest(AIndex : Integer; const AValue : TDatetime);
  756. begin
  757. If (Fyoungest=AValue) then exit;
  758. Fyoungest:=AValue;
  759. MarkPropertyChanged(AIndex);
  760. end;
  761. //2.6.4. bug workaround
  762. {$IFDEF VER2_6}
  763. Procedure TListTimeseriesResponse.SetArrayLength(Const AName : String; ALength : Longint);
  764. begin
  765. Case AName of
  766. 'timeseries' : SetLength(Ftimeseries,ALength);
  767. else
  768. Inherited SetArrayLength(AName,ALength);
  769. end;
  770. end;
  771. {$ENDIF VER2_6}
  772. { --------------------------------------------------------------------
  773. TMetricDescriptor
  774. --------------------------------------------------------------------}
  775. Procedure TMetricDescriptor.Setdescription(AIndex : Integer; const AValue : String);
  776. begin
  777. If (Fdescription=AValue) then exit;
  778. Fdescription:=AValue;
  779. MarkPropertyChanged(AIndex);
  780. end;
  781. Procedure TMetricDescriptor.Setlabels(AIndex : Integer; const AValue : TMetricDescriptorTypelabelsArray);
  782. begin
  783. If (Flabels=AValue) then exit;
  784. Flabels:=AValue;
  785. MarkPropertyChanged(AIndex);
  786. end;
  787. Procedure TMetricDescriptor.Setname(AIndex : Integer; const AValue : String);
  788. begin
  789. If (Fname=AValue) then exit;
  790. Fname:=AValue;
  791. MarkPropertyChanged(AIndex);
  792. end;
  793. Procedure TMetricDescriptor.Setproject(AIndex : Integer; const AValue : String);
  794. begin
  795. If (Fproject=AValue) then exit;
  796. Fproject:=AValue;
  797. MarkPropertyChanged(AIndex);
  798. end;
  799. Procedure TMetricDescriptor.SettypeDescriptor(AIndex : Integer; const AValue : TMetricDescriptorTypeDescriptor);
  800. begin
  801. If (FtypeDescriptor=AValue) then exit;
  802. FtypeDescriptor:=AValue;
  803. MarkPropertyChanged(AIndex);
  804. end;
  805. //2.6.4. bug workaround
  806. {$IFDEF VER2_6}
  807. Procedure TMetricDescriptor.SetArrayLength(Const AName : String; ALength : Longint);
  808. begin
  809. Case AName of
  810. 'labels' : SetLength(Flabels,ALength);
  811. else
  812. Inherited SetArrayLength(AName,ALength);
  813. end;
  814. end;
  815. {$ENDIF VER2_6}
  816. { --------------------------------------------------------------------
  817. TMetricDescriptorLabelDescriptor
  818. --------------------------------------------------------------------}
  819. Procedure TMetricDescriptorLabelDescriptor.Setdescription(AIndex : Integer; const AValue : String);
  820. begin
  821. If (Fdescription=AValue) then exit;
  822. Fdescription:=AValue;
  823. MarkPropertyChanged(AIndex);
  824. end;
  825. Procedure TMetricDescriptorLabelDescriptor.Setkey(AIndex : Integer; const AValue : String);
  826. begin
  827. If (Fkey=AValue) then exit;
  828. Fkey:=AValue;
  829. MarkPropertyChanged(AIndex);
  830. end;
  831. { --------------------------------------------------------------------
  832. TMetricDescriptorTypeDescriptor
  833. --------------------------------------------------------------------}
  834. Procedure TMetricDescriptorTypeDescriptor.SetmetricType(AIndex : Integer; const AValue : String);
  835. begin
  836. If (FmetricType=AValue) then exit;
  837. FmetricType:=AValue;
  838. MarkPropertyChanged(AIndex);
  839. end;
  840. Procedure TMetricDescriptorTypeDescriptor.SetvalueType(AIndex : Integer; const AValue : String);
  841. begin
  842. If (FvalueType=AValue) then exit;
  843. FvalueType:=AValue;
  844. MarkPropertyChanged(AIndex);
  845. end;
  846. { --------------------------------------------------------------------
  847. TPoint
  848. --------------------------------------------------------------------}
  849. Procedure TPoint.SetboolValue(AIndex : Integer; const AValue : boolean);
  850. begin
  851. If (FboolValue=AValue) then exit;
  852. FboolValue:=AValue;
  853. MarkPropertyChanged(AIndex);
  854. end;
  855. Procedure TPoint.SetdistributionValue(AIndex : Integer; const AValue : TPointDistribution);
  856. begin
  857. If (FdistributionValue=AValue) then exit;
  858. FdistributionValue:=AValue;
  859. MarkPropertyChanged(AIndex);
  860. end;
  861. Procedure TPoint.SetdoubleValue(AIndex : Integer; const AValue : double);
  862. begin
  863. If (FdoubleValue=AValue) then exit;
  864. FdoubleValue:=AValue;
  865. MarkPropertyChanged(AIndex);
  866. end;
  867. Procedure TPoint.Set_end(AIndex : Integer; const AValue : TDatetime);
  868. begin
  869. If (F_end=AValue) then exit;
  870. F_end:=AValue;
  871. MarkPropertyChanged(AIndex);
  872. end;
  873. Procedure TPoint.Setint64Value(AIndex : Integer; const AValue : String);
  874. begin
  875. If (Fint64Value=AValue) then exit;
  876. Fint64Value:=AValue;
  877. MarkPropertyChanged(AIndex);
  878. end;
  879. Procedure TPoint.Setstart(AIndex : Integer; const AValue : TDatetime);
  880. begin
  881. If (Fstart=AValue) then exit;
  882. Fstart:=AValue;
  883. MarkPropertyChanged(AIndex);
  884. end;
  885. Procedure TPoint.SetstringValue(AIndex : Integer; const AValue : String);
  886. begin
  887. If (FstringValue=AValue) then exit;
  888. FstringValue:=AValue;
  889. MarkPropertyChanged(AIndex);
  890. end;
  891. Class Function TPoint.ExportPropertyName(Const AName : String) :String;
  892. begin
  893. Case AName of
  894. '_end' : Result:='end';
  895. else
  896. Result:=Inherited ExportPropertyName(AName);
  897. end;
  898. end;
  899. { --------------------------------------------------------------------
  900. TPointDistribution
  901. --------------------------------------------------------------------}
  902. Procedure TPointDistribution.Setbuckets(AIndex : Integer; const AValue : TPointDistributionTypebucketsArray);
  903. begin
  904. If (Fbuckets=AValue) then exit;
  905. Fbuckets:=AValue;
  906. MarkPropertyChanged(AIndex);
  907. end;
  908. Procedure TPointDistribution.SetoverflowBucket(AIndex : Integer; const AValue : TPointDistributionOverflowBucket);
  909. begin
  910. If (FoverflowBucket=AValue) then exit;
  911. FoverflowBucket:=AValue;
  912. MarkPropertyChanged(AIndex);
  913. end;
  914. Procedure TPointDistribution.SetunderflowBucket(AIndex : Integer; const AValue : TPointDistributionUnderflowBucket);
  915. begin
  916. If (FunderflowBucket=AValue) then exit;
  917. FunderflowBucket:=AValue;
  918. MarkPropertyChanged(AIndex);
  919. end;
  920. //2.6.4. bug workaround
  921. {$IFDEF VER2_6}
  922. Procedure TPointDistribution.SetArrayLength(Const AName : String; ALength : Longint);
  923. begin
  924. Case AName of
  925. 'buckets' : SetLength(Fbuckets,ALength);
  926. else
  927. Inherited SetArrayLength(AName,ALength);
  928. end;
  929. end;
  930. {$ENDIF VER2_6}
  931. { --------------------------------------------------------------------
  932. TPointDistributionBucket
  933. --------------------------------------------------------------------}
  934. Procedure TPointDistributionBucket.Setcount(AIndex : Integer; const AValue : String);
  935. begin
  936. If (Fcount=AValue) then exit;
  937. Fcount:=AValue;
  938. MarkPropertyChanged(AIndex);
  939. end;
  940. Procedure TPointDistributionBucket.SetlowerBound(AIndex : Integer; const AValue : double);
  941. begin
  942. If (FlowerBound=AValue) then exit;
  943. FlowerBound:=AValue;
  944. MarkPropertyChanged(AIndex);
  945. end;
  946. Procedure TPointDistributionBucket.SetupperBound(AIndex : Integer; const AValue : double);
  947. begin
  948. If (FupperBound=AValue) then exit;
  949. FupperBound:=AValue;
  950. MarkPropertyChanged(AIndex);
  951. end;
  952. { --------------------------------------------------------------------
  953. TPointDistributionOverflowBucket
  954. --------------------------------------------------------------------}
  955. Procedure TPointDistributionOverflowBucket.Setcount(AIndex : Integer; const AValue : String);
  956. begin
  957. If (Fcount=AValue) then exit;
  958. Fcount:=AValue;
  959. MarkPropertyChanged(AIndex);
  960. end;
  961. Procedure TPointDistributionOverflowBucket.SetlowerBound(AIndex : Integer; const AValue : double);
  962. begin
  963. If (FlowerBound=AValue) then exit;
  964. FlowerBound:=AValue;
  965. MarkPropertyChanged(AIndex);
  966. end;
  967. { --------------------------------------------------------------------
  968. TPointDistributionUnderflowBucket
  969. --------------------------------------------------------------------}
  970. Procedure TPointDistributionUnderflowBucket.Setcount(AIndex : Integer; const AValue : String);
  971. begin
  972. If (Fcount=AValue) then exit;
  973. Fcount:=AValue;
  974. MarkPropertyChanged(AIndex);
  975. end;
  976. Procedure TPointDistributionUnderflowBucket.SetupperBound(AIndex : Integer; const AValue : double);
  977. begin
  978. If (FupperBound=AValue) then exit;
  979. FupperBound:=AValue;
  980. MarkPropertyChanged(AIndex);
  981. end;
  982. { --------------------------------------------------------------------
  983. TTimeseries
  984. --------------------------------------------------------------------}
  985. Procedure TTimeseries.Setpoints(AIndex : Integer; const AValue : TTimeseriesTypepointsArray);
  986. begin
  987. If (Fpoints=AValue) then exit;
  988. Fpoints:=AValue;
  989. MarkPropertyChanged(AIndex);
  990. end;
  991. Procedure TTimeseries.SettimeseriesDesc(AIndex : Integer; const AValue : TTimeseriesDescriptor);
  992. begin
  993. If (FtimeseriesDesc=AValue) then exit;
  994. FtimeseriesDesc:=AValue;
  995. MarkPropertyChanged(AIndex);
  996. end;
  997. //2.6.4. bug workaround
  998. {$IFDEF VER2_6}
  999. Procedure TTimeseries.SetArrayLength(Const AName : String; ALength : Longint);
  1000. begin
  1001. Case AName of
  1002. 'points' : SetLength(Fpoints,ALength);
  1003. else
  1004. Inherited SetArrayLength(AName,ALength);
  1005. end;
  1006. end;
  1007. {$ENDIF VER2_6}
  1008. { --------------------------------------------------------------------
  1009. TTimeseriesDescriptorTypelabels
  1010. --------------------------------------------------------------------}
  1011. Class Function TTimeseriesDescriptorTypelabels.AllowAdditionalProperties : Boolean;
  1012. begin
  1013. Result:=True;
  1014. end;
  1015. { --------------------------------------------------------------------
  1016. TTimeseriesDescriptor
  1017. --------------------------------------------------------------------}
  1018. Procedure TTimeseriesDescriptor.Setlabels(AIndex : Integer; const AValue : TTimeseriesDescriptorTypelabels);
  1019. begin
  1020. If (Flabels=AValue) then exit;
  1021. Flabels:=AValue;
  1022. MarkPropertyChanged(AIndex);
  1023. end;
  1024. Procedure TTimeseriesDescriptor.Setmetric(AIndex : Integer; const AValue : String);
  1025. begin
  1026. If (Fmetric=AValue) then exit;
  1027. Fmetric:=AValue;
  1028. MarkPropertyChanged(AIndex);
  1029. end;
  1030. Procedure TTimeseriesDescriptor.Setproject(AIndex : Integer; const AValue : String);
  1031. begin
  1032. If (Fproject=AValue) then exit;
  1033. Fproject:=AValue;
  1034. MarkPropertyChanged(AIndex);
  1035. end;
  1036. { --------------------------------------------------------------------
  1037. TTimeseriesDescriptorLabel
  1038. --------------------------------------------------------------------}
  1039. Procedure TTimeseriesDescriptorLabel.Setkey(AIndex : Integer; const AValue : String);
  1040. begin
  1041. If (Fkey=AValue) then exit;
  1042. Fkey:=AValue;
  1043. MarkPropertyChanged(AIndex);
  1044. end;
  1045. Procedure TTimeseriesDescriptorLabel.Setvalue(AIndex : Integer; const AValue : String);
  1046. begin
  1047. If (Fvalue=AValue) then exit;
  1048. Fvalue:=AValue;
  1049. MarkPropertyChanged(AIndex);
  1050. end;
  1051. { --------------------------------------------------------------------
  1052. TTimeseriesPoint
  1053. --------------------------------------------------------------------}
  1054. Procedure TTimeseriesPoint.Setpoint(AIndex : Integer; const AValue : TPoint);
  1055. begin
  1056. If (Fpoint=AValue) then exit;
  1057. Fpoint:=AValue;
  1058. MarkPropertyChanged(AIndex);
  1059. end;
  1060. Procedure TTimeseriesPoint.SettimeseriesDesc(AIndex : Integer; const AValue : TTimeseriesDescriptor);
  1061. begin
  1062. If (FtimeseriesDesc=AValue) then exit;
  1063. FtimeseriesDesc:=AValue;
  1064. MarkPropertyChanged(AIndex);
  1065. end;
  1066. { --------------------------------------------------------------------
  1067. TWriteTimeseriesRequestTypecommonLabels
  1068. --------------------------------------------------------------------}
  1069. Class Function TWriteTimeseriesRequestTypecommonLabels.AllowAdditionalProperties : Boolean;
  1070. begin
  1071. Result:=True;
  1072. end;
  1073. { --------------------------------------------------------------------
  1074. TWriteTimeseriesRequest
  1075. --------------------------------------------------------------------}
  1076. Procedure TWriteTimeseriesRequest.SetcommonLabels(AIndex : Integer; const AValue : TWriteTimeseriesRequestTypecommonLabels);
  1077. begin
  1078. If (FcommonLabels=AValue) then exit;
  1079. FcommonLabels:=AValue;
  1080. MarkPropertyChanged(AIndex);
  1081. end;
  1082. Procedure TWriteTimeseriesRequest.Settimeseries(AIndex : Integer; const AValue : TWriteTimeseriesRequestTypetimeseriesArray);
  1083. begin
  1084. If (Ftimeseries=AValue) then exit;
  1085. Ftimeseries:=AValue;
  1086. MarkPropertyChanged(AIndex);
  1087. end;
  1088. //2.6.4. bug workaround
  1089. {$IFDEF VER2_6}
  1090. Procedure TWriteTimeseriesRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1091. begin
  1092. Case AName of
  1093. 'timeseries' : SetLength(Ftimeseries,ALength);
  1094. else
  1095. Inherited SetArrayLength(AName,ALength);
  1096. end;
  1097. end;
  1098. {$ENDIF VER2_6}
  1099. { --------------------------------------------------------------------
  1100. TWriteTimeseriesResponse
  1101. --------------------------------------------------------------------}
  1102. Procedure TWriteTimeseriesResponse.Setkind(AIndex : Integer; const AValue : String);
  1103. begin
  1104. If (Fkind=AValue) then exit;
  1105. Fkind:=AValue;
  1106. MarkPropertyChanged(AIndex);
  1107. end;
  1108. { --------------------------------------------------------------------
  1109. TMetricDescriptorsResource
  1110. --------------------------------------------------------------------}
  1111. Class Function TMetricDescriptorsResource.ResourceName : String;
  1112. begin
  1113. Result:='metricDescriptors';
  1114. end;
  1115. Class Function TMetricDescriptorsResource.DefaultAPI : TGoogleAPIClass;
  1116. begin
  1117. Result:=TcloudmonitoringAPI;
  1118. end;
  1119. Function TMetricDescriptorsResource.Create(project: string; aMetricDescriptor : TMetricDescriptor) : TMetricDescriptor;
  1120. Const
  1121. _HTTPMethod = 'POST';
  1122. _Path = '{project}/metricDescriptors';
  1123. _Methodid = 'cloudmonitoring.metricDescriptors.create';
  1124. Var
  1125. _P : String;
  1126. begin
  1127. _P:=SubstitutePath(_Path,['project',project]);
  1128. Result:=ServiceCall(_HTTPMethod,_P,'',aMetricDescriptor,TMetricDescriptor) as TMetricDescriptor;
  1129. end;
  1130. Function TMetricDescriptorsResource.Delete(metric: string; project: string) : TDeleteMetricDescriptorResponse;
  1131. Const
  1132. _HTTPMethod = 'DELETE';
  1133. _Path = '{project}/metricDescriptors/{metric}';
  1134. _Methodid = 'cloudmonitoring.metricDescriptors.delete';
  1135. Var
  1136. _P : String;
  1137. begin
  1138. _P:=SubstitutePath(_Path,['metric',metric,'project',project]);
  1139. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TDeleteMetricDescriptorResponse) as TDeleteMetricDescriptorResponse;
  1140. end;
  1141. Function TMetricDescriptorsResource.List(project: string; aListMetricDescriptorsRequest : TListMetricDescriptorsRequest; AQuery : string = '') : TListMetricDescriptorsResponse;
  1142. Const
  1143. _HTTPMethod = 'GET';
  1144. _Path = '{project}/metricDescriptors';
  1145. _Methodid = 'cloudmonitoring.metricDescriptors.list';
  1146. Var
  1147. _P : String;
  1148. begin
  1149. _P:=SubstitutePath(_Path,['project',project]);
  1150. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aListMetricDescriptorsRequest,TListMetricDescriptorsResponse) as TListMetricDescriptorsResponse;
  1151. end;
  1152. Function TMetricDescriptorsResource.List(project: string; aListMetricDescriptorsRequest : TListMetricDescriptorsRequest; AQuery : TMetricDescriptorslistOptions) : TListMetricDescriptorsResponse;
  1153. Var
  1154. _Q : String;
  1155. begin
  1156. _Q:='';
  1157. AddToQuery(_Q,'count',AQuery.count);
  1158. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1159. AddToQuery(_Q,'query',AQuery.query);
  1160. Result:=List(project,aListMetricDescriptorsRequest,_Q);
  1161. end;
  1162. { --------------------------------------------------------------------
  1163. TTimeseriesResource
  1164. --------------------------------------------------------------------}
  1165. Class Function TTimeseriesResource.ResourceName : String;
  1166. begin
  1167. Result:='timeseries';
  1168. end;
  1169. Class Function TTimeseriesResource.DefaultAPI : TGoogleAPIClass;
  1170. begin
  1171. Result:=TcloudmonitoringAPI;
  1172. end;
  1173. Function TTimeseriesResource.List(metric: string; project: string; aListTimeseriesRequest : TListTimeseriesRequest; AQuery : string = '') : TListTimeseriesResponse;
  1174. Const
  1175. _HTTPMethod = 'GET';
  1176. _Path = '{project}/timeseries/{metric}';
  1177. _Methodid = 'cloudmonitoring.timeseries.list';
  1178. Var
  1179. _P : String;
  1180. begin
  1181. _P:=SubstitutePath(_Path,['metric',metric,'project',project]);
  1182. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aListTimeseriesRequest,TListTimeseriesResponse) as TListTimeseriesResponse;
  1183. end;
  1184. Function TTimeseriesResource.List(metric: string; project: string; aListTimeseriesRequest : TListTimeseriesRequest; AQuery : TTimeserieslistOptions) : TListTimeseriesResponse;
  1185. Var
  1186. _Q : String;
  1187. begin
  1188. _Q:='';
  1189. AddToQuery(_Q,'aggregator',AQuery.aggregator);
  1190. AddToQuery(_Q,'count',AQuery.count);
  1191. AddToQuery(_Q,'labels',AQuery.labels);
  1192. AddToQuery(_Q,'oldest',AQuery.oldest);
  1193. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1194. AddToQuery(_Q,'timespan',AQuery.timespan);
  1195. AddToQuery(_Q,'window',AQuery.window);
  1196. AddToQuery(_Q,'youngest',AQuery.youngest);
  1197. Result:=List(metric,project,aListTimeseriesRequest,_Q);
  1198. end;
  1199. Function TTimeseriesResource.Write(project: string; aWriteTimeseriesRequest : TWriteTimeseriesRequest) : TWriteTimeseriesResponse;
  1200. Const
  1201. _HTTPMethod = 'POST';
  1202. _Path = '{project}/timeseries:write';
  1203. _Methodid = 'cloudmonitoring.timeseries.write';
  1204. Var
  1205. _P : String;
  1206. begin
  1207. _P:=SubstitutePath(_Path,['project',project]);
  1208. Result:=ServiceCall(_HTTPMethod,_P,'',aWriteTimeseriesRequest,TWriteTimeseriesResponse) as TWriteTimeseriesResponse;
  1209. end;
  1210. { --------------------------------------------------------------------
  1211. TTimeseriesDescriptorsResource
  1212. --------------------------------------------------------------------}
  1213. Class Function TTimeseriesDescriptorsResource.ResourceName : String;
  1214. begin
  1215. Result:='timeseriesDescriptors';
  1216. end;
  1217. Class Function TTimeseriesDescriptorsResource.DefaultAPI : TGoogleAPIClass;
  1218. begin
  1219. Result:=TcloudmonitoringAPI;
  1220. end;
  1221. Function TTimeseriesDescriptorsResource.List(metric: string; project: string; aListTimeseriesDescriptorsRequest : TListTimeseriesDescriptorsRequest; AQuery : string = '') : TListTimeseriesDescriptorsResponse;
  1222. Const
  1223. _HTTPMethod = 'GET';
  1224. _Path = '{project}/timeseriesDescriptors/{metric}';
  1225. _Methodid = 'cloudmonitoring.timeseriesDescriptors.list';
  1226. Var
  1227. _P : String;
  1228. begin
  1229. _P:=SubstitutePath(_Path,['metric',metric,'project',project]);
  1230. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aListTimeseriesDescriptorsRequest,TListTimeseriesDescriptorsResponse) as TListTimeseriesDescriptorsResponse;
  1231. end;
  1232. Function TTimeseriesDescriptorsResource.List(metric: string; project: string; aListTimeseriesDescriptorsRequest : TListTimeseriesDescriptorsRequest; AQuery : TTimeseriesDescriptorslistOptions) : TListTimeseriesDescriptorsResponse;
  1233. Var
  1234. _Q : String;
  1235. begin
  1236. _Q:='';
  1237. AddToQuery(_Q,'aggregator',AQuery.aggregator);
  1238. AddToQuery(_Q,'count',AQuery.count);
  1239. AddToQuery(_Q,'labels',AQuery.labels);
  1240. AddToQuery(_Q,'oldest',AQuery.oldest);
  1241. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1242. AddToQuery(_Q,'timespan',AQuery.timespan);
  1243. AddToQuery(_Q,'window',AQuery.window);
  1244. AddToQuery(_Q,'youngest',AQuery.youngest);
  1245. Result:=List(metric,project,aListTimeseriesDescriptorsRequest,_Q);
  1246. end;
  1247. { --------------------------------------------------------------------
  1248. TCloudmonitoringAPI
  1249. --------------------------------------------------------------------}
  1250. Class Function TCloudmonitoringAPI.APIName : String;
  1251. begin
  1252. Result:='cloudmonitoring';
  1253. end;
  1254. Class Function TCloudmonitoringAPI.APIVersion : String;
  1255. begin
  1256. Result:='v2beta2';
  1257. end;
  1258. Class Function TCloudmonitoringAPI.APIRevision : String;
  1259. begin
  1260. Result:='20160415';
  1261. end;
  1262. Class Function TCloudmonitoringAPI.APIID : String;
  1263. begin
  1264. Result:='cloudmonitoring:v2beta2';
  1265. end;
  1266. Class Function TCloudmonitoringAPI.APITitle : String;
  1267. begin
  1268. Result:='Cloud Monitoring API';
  1269. end;
  1270. Class Function TCloudmonitoringAPI.APIDescription : String;
  1271. begin
  1272. Result:='Accesses Google Cloud Monitoring data.';
  1273. end;
  1274. Class Function TCloudmonitoringAPI.APIOwnerDomain : String;
  1275. begin
  1276. Result:='google.com';
  1277. end;
  1278. Class Function TCloudmonitoringAPI.APIOwnerName : String;
  1279. begin
  1280. Result:='Google';
  1281. end;
  1282. Class Function TCloudmonitoringAPI.APIIcon16 : String;
  1283. begin
  1284. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1285. end;
  1286. Class Function TCloudmonitoringAPI.APIIcon32 : String;
  1287. begin
  1288. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1289. end;
  1290. Class Function TCloudmonitoringAPI.APIdocumentationLink : String;
  1291. begin
  1292. Result:='https://cloud.google.com/monitoring/v2beta2/';
  1293. end;
  1294. Class Function TCloudmonitoringAPI.APIrootUrl : string;
  1295. begin
  1296. Result:='https://www.googleapis.com/';
  1297. end;
  1298. Class Function TCloudmonitoringAPI.APIbasePath : string;
  1299. begin
  1300. Result:='/cloudmonitoring/v2beta2/projects/';
  1301. end;
  1302. Class Function TCloudmonitoringAPI.APIbaseURL : String;
  1303. begin
  1304. Result:='https://www.googleapis.com/cloudmonitoring/v2beta2/projects/';
  1305. end;
  1306. Class Function TCloudmonitoringAPI.APIProtocol : string;
  1307. begin
  1308. Result:='rest';
  1309. end;
  1310. Class Function TCloudmonitoringAPI.APIservicePath : string;
  1311. begin
  1312. Result:='cloudmonitoring/v2beta2/projects/';
  1313. end;
  1314. Class Function TCloudmonitoringAPI.APIbatchPath : String;
  1315. begin
  1316. Result:='batch';
  1317. end;
  1318. Class Function TCloudmonitoringAPI.APIAuthScopes : TScopeInfoArray;
  1319. begin
  1320. SetLength(Result,2);
  1321. Result[0].Name:='https://www.googleapis.com/auth/cloud-platform';
  1322. Result[0].Description:='View and manage your data across Google Cloud Platform services';
  1323. Result[1].Name:='https://www.googleapis.com/auth/monitoring';
  1324. Result[1].Description:='View and write monitoring data for all of your Google and third-party Cloud and API projects';
  1325. end;
  1326. Class Function TCloudmonitoringAPI.APINeedsAuth : Boolean;
  1327. begin
  1328. Result:=True;
  1329. end;
  1330. Class Procedure TCloudmonitoringAPI.RegisterAPIResources;
  1331. begin
  1332. TDeleteMetricDescriptorResponse.RegisterObject;
  1333. TListMetricDescriptorsRequest.RegisterObject;
  1334. TListMetricDescriptorsResponse.RegisterObject;
  1335. TListTimeseriesDescriptorsRequest.RegisterObject;
  1336. TListTimeseriesDescriptorsResponse.RegisterObject;
  1337. TListTimeseriesRequest.RegisterObject;
  1338. TListTimeseriesResponse.RegisterObject;
  1339. TMetricDescriptor.RegisterObject;
  1340. TMetricDescriptorLabelDescriptor.RegisterObject;
  1341. TMetricDescriptorTypeDescriptor.RegisterObject;
  1342. TPoint.RegisterObject;
  1343. TPointDistribution.RegisterObject;
  1344. TPointDistributionBucket.RegisterObject;
  1345. TPointDistributionOverflowBucket.RegisterObject;
  1346. TPointDistributionUnderflowBucket.RegisterObject;
  1347. TTimeseries.RegisterObject;
  1348. TTimeseriesDescriptorTypelabels.RegisterObject;
  1349. TTimeseriesDescriptor.RegisterObject;
  1350. TTimeseriesDescriptorLabel.RegisterObject;
  1351. TTimeseriesPoint.RegisterObject;
  1352. TWriteTimeseriesRequestTypecommonLabels.RegisterObject;
  1353. TWriteTimeseriesRequest.RegisterObject;
  1354. TWriteTimeseriesResponse.RegisterObject;
  1355. end;
  1356. Function TCloudmonitoringAPI.GetMetricDescriptorsInstance : TMetricDescriptorsResource;
  1357. begin
  1358. if (FMetricDescriptorsInstance=Nil) then
  1359. FMetricDescriptorsInstance:=CreateMetricDescriptorsResource;
  1360. Result:=FMetricDescriptorsInstance;
  1361. end;
  1362. Function TCloudmonitoringAPI.CreateMetricDescriptorsResource : TMetricDescriptorsResource;
  1363. begin
  1364. Result:=CreateMetricDescriptorsResource(Self);
  1365. end;
  1366. Function TCloudmonitoringAPI.CreateMetricDescriptorsResource(AOwner : TComponent) : TMetricDescriptorsResource;
  1367. begin
  1368. Result:=TMetricDescriptorsResource.Create(AOwner);
  1369. Result.API:=Self.API;
  1370. end;
  1371. Function TCloudmonitoringAPI.GetTimeseriesInstance : TTimeseriesResource;
  1372. begin
  1373. if (FTimeseriesInstance=Nil) then
  1374. FTimeseriesInstance:=CreateTimeseriesResource;
  1375. Result:=FTimeseriesInstance;
  1376. end;
  1377. Function TCloudmonitoringAPI.CreateTimeseriesResource : TTimeseriesResource;
  1378. begin
  1379. Result:=CreateTimeseriesResource(Self);
  1380. end;
  1381. Function TCloudmonitoringAPI.CreateTimeseriesResource(AOwner : TComponent) : TTimeseriesResource;
  1382. begin
  1383. Result:=TTimeseriesResource.Create(AOwner);
  1384. Result.API:=Self.API;
  1385. end;
  1386. Function TCloudmonitoringAPI.GetTimeseriesDescriptorsInstance : TTimeseriesDescriptorsResource;
  1387. begin
  1388. if (FTimeseriesDescriptorsInstance=Nil) then
  1389. FTimeseriesDescriptorsInstance:=CreateTimeseriesDescriptorsResource;
  1390. Result:=FTimeseriesDescriptorsInstance;
  1391. end;
  1392. Function TCloudmonitoringAPI.CreateTimeseriesDescriptorsResource : TTimeseriesDescriptorsResource;
  1393. begin
  1394. Result:=CreateTimeseriesDescriptorsResource(Self);
  1395. end;
  1396. Function TCloudmonitoringAPI.CreateTimeseriesDescriptorsResource(AOwner : TComponent) : TTimeseriesDescriptorsResource;
  1397. begin
  1398. Result:=TTimeseriesDescriptorsResource.Create(AOwner);
  1399. Result.API:=Self.API;
  1400. end;
  1401. initialization
  1402. TCloudmonitoringAPI.RegisterAPI;
  1403. end.