googlelogging.pp 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201
  1. {$IFNDEF FPC_DOTTEDUNITS}
  2. unit googlelogging;
  3. {$ENDIF FPC_DOTTEDUNITS}
  4. {$MODE objfpc}
  5. {$H+}
  6. interface
  7. {$IFDEF FPC_DOTTEDUNITS}
  8. uses System.SysUtils, System.Classes, GoogleApi.Service, FpWeb.Rest.Base, GoogleApi.Base;
  9. {$ELSE FPC_DOTTEDUNITS}
  10. uses sysutils, classes, googleservice, restbase, googlebase;
  11. {$ENDIF FPC_DOTTEDUNITS}
  12. type
  13. //Top-level schema types
  14. TEmpty = Class;
  15. TWriteLogEntriesRequest = Class;
  16. TMonitoredResource = Class;
  17. TLogEntry = Class;
  18. THttpRequest = Class;
  19. TLogEntryOperation = Class;
  20. TWriteLogEntriesResponse = Class;
  21. TListLogEntriesRequest = Class;
  22. TListLogEntriesResponse = Class;
  23. TStatus = Class;
  24. TListMonitoredResourceDescriptorsResponse = Class;
  25. TMonitoredResourceDescriptor = Class;
  26. TLabelDescriptor = Class;
  27. TListSinksResponse = Class;
  28. TLogSink = Class;
  29. TListLogMetricsResponse = Class;
  30. TLogMetric = Class;
  31. TRequestLog = Class;
  32. TLogLine = Class;
  33. TSourceLocation = Class;
  34. TSourceReference = Class;
  35. TEmptyArray = Array of TEmpty;
  36. TWriteLogEntriesRequestArray = Array of TWriteLogEntriesRequest;
  37. TMonitoredResourceArray = Array of TMonitoredResource;
  38. TLogEntryArray = Array of TLogEntry;
  39. THttpRequestArray = Array of THttpRequest;
  40. TLogEntryOperationArray = Array of TLogEntryOperation;
  41. TWriteLogEntriesResponseArray = Array of TWriteLogEntriesResponse;
  42. TListLogEntriesRequestArray = Array of TListLogEntriesRequest;
  43. TListLogEntriesResponseArray = Array of TListLogEntriesResponse;
  44. TStatusArray = Array of TStatus;
  45. TListMonitoredResourceDescriptorsResponseArray = Array of TListMonitoredResourceDescriptorsResponse;
  46. TMonitoredResourceDescriptorArray = Array of TMonitoredResourceDescriptor;
  47. TLabelDescriptorArray = Array of TLabelDescriptor;
  48. TListSinksResponseArray = Array of TListSinksResponse;
  49. TLogSinkArray = Array of TLogSink;
  50. TListLogMetricsResponseArray = Array of TListLogMetricsResponse;
  51. TLogMetricArray = Array of TLogMetric;
  52. TRequestLogArray = Array of TRequestLog;
  53. TLogLineArray = Array of TLogLine;
  54. TSourceLocationArray = Array of TSourceLocation;
  55. TSourceReferenceArray = Array of TSourceReference;
  56. //Anonymous types, using auto-generated names
  57. TWriteLogEntriesRequestTypelabels = Class;
  58. TMonitoredResourceTypelabels = Class;
  59. TLogEntryTypeprotoPayload = Class;
  60. TLogEntryTypejsonPayload = Class;
  61. TLogEntryTypelabels = Class;
  62. TListLogEntriesResponseTypeprojectIdErrors = Class;
  63. TStatusTypedetailsItem = Class;
  64. TWriteLogEntriesRequestTypeentriesArray = Array of TLogEntry;
  65. TListLogEntriesResponseTypeentriesArray = Array of TLogEntry;
  66. TStatusTypedetailsArray = Array of TStatusTypedetailsItem;
  67. TListMonitoredResourceDescriptorsResponseTyperesourceDescriptorsArray = Array of TMonitoredResourceDescriptor;
  68. TMonitoredResourceDescriptorTypelabelsArray = Array of TLabelDescriptor;
  69. TListSinksResponseTypesinksArray = Array of TLogSink;
  70. TListLogMetricsResponseTypemetricsArray = Array of TLogMetric;
  71. TRequestLogTypelineArray = Array of TLogLine;
  72. TRequestLogTypesourceReferenceArray = Array of TSourceReference;
  73. { --------------------------------------------------------------------
  74. TEmpty
  75. --------------------------------------------------------------------}
  76. TEmpty = Class(TGoogleBaseObject)
  77. Private
  78. Protected
  79. //Property setters
  80. Public
  81. Published
  82. end;
  83. TEmptyClass = Class of TEmpty;
  84. { --------------------------------------------------------------------
  85. TWriteLogEntriesRequestTypelabels
  86. --------------------------------------------------------------------}
  87. TWriteLogEntriesRequestTypelabels = Class(TGoogleBaseObject)
  88. Private
  89. Protected
  90. //Property setters
  91. Public
  92. Class Function AllowAdditionalProperties : Boolean; override;
  93. Published
  94. end;
  95. TWriteLogEntriesRequestTypelabelsClass = Class of TWriteLogEntriesRequestTypelabels;
  96. { --------------------------------------------------------------------
  97. TWriteLogEntriesRequest
  98. --------------------------------------------------------------------}
  99. TWriteLogEntriesRequest = Class(TGoogleBaseObject)
  100. Private
  101. FlogName : String;
  102. Fresource : TMonitoredResource;
  103. Flabels : TWriteLogEntriesRequestTypelabels;
  104. Fentries : TWriteLogEntriesRequestTypeentriesArray;
  105. FpartialSuccess : boolean;
  106. Protected
  107. //Property setters
  108. Procedure SetlogName(AIndex : Integer; const AValue : String); virtual;
  109. Procedure Setresource(AIndex : Integer; const AValue : TMonitoredResource); virtual;
  110. Procedure Setlabels(AIndex : Integer; const AValue : TWriteLogEntriesRequestTypelabels); virtual;
  111. Procedure Setentries(AIndex : Integer; const AValue : TWriteLogEntriesRequestTypeentriesArray); virtual;
  112. Procedure SetpartialSuccess(AIndex : Integer; const AValue : boolean); virtual;
  113. //2.6.4. bug workaround
  114. {$IFDEF VER2_6}
  115. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  116. {$ENDIF VER2_6}
  117. Public
  118. Published
  119. Property logName : String Index 0 Read FlogName Write SetlogName;
  120. Property resource : TMonitoredResource Index 8 Read Fresource Write Setresource;
  121. Property labels : TWriteLogEntriesRequestTypelabels Index 16 Read Flabels Write Setlabels;
  122. Property entries : TWriteLogEntriesRequestTypeentriesArray Index 24 Read Fentries Write Setentries;
  123. Property partialSuccess : boolean Index 32 Read FpartialSuccess Write SetpartialSuccess;
  124. end;
  125. TWriteLogEntriesRequestClass = Class of TWriteLogEntriesRequest;
  126. { --------------------------------------------------------------------
  127. TMonitoredResourceTypelabels
  128. --------------------------------------------------------------------}
  129. TMonitoredResourceTypelabels = Class(TGoogleBaseObject)
  130. Private
  131. Protected
  132. //Property setters
  133. Public
  134. Class Function AllowAdditionalProperties : Boolean; override;
  135. Published
  136. end;
  137. TMonitoredResourceTypelabelsClass = Class of TMonitoredResourceTypelabels;
  138. { --------------------------------------------------------------------
  139. TMonitoredResource
  140. --------------------------------------------------------------------}
  141. TMonitoredResource = Class(TGoogleBaseObject)
  142. Private
  143. F_type : String;
  144. Flabels : TMonitoredResourceTypelabels;
  145. Protected
  146. Class Function ExportPropertyName(Const AName : String) : string; override;
  147. //Property setters
  148. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  149. Procedure Setlabels(AIndex : Integer; const AValue : TMonitoredResourceTypelabels); virtual;
  150. Public
  151. Published
  152. Property _type : String Index 0 Read F_type Write Set_type;
  153. Property labels : TMonitoredResourceTypelabels Index 8 Read Flabels Write Setlabels;
  154. end;
  155. TMonitoredResourceClass = Class of TMonitoredResource;
  156. { --------------------------------------------------------------------
  157. TLogEntryTypeprotoPayload
  158. --------------------------------------------------------------------}
  159. TLogEntryTypeprotoPayload = Class(TGoogleBaseObject)
  160. Private
  161. Protected
  162. //Property setters
  163. Public
  164. Class Function AllowAdditionalProperties : Boolean; override;
  165. Published
  166. end;
  167. TLogEntryTypeprotoPayloadClass = Class of TLogEntryTypeprotoPayload;
  168. { --------------------------------------------------------------------
  169. TLogEntryTypejsonPayload
  170. --------------------------------------------------------------------}
  171. TLogEntryTypejsonPayload = Class(TGoogleBaseObject)
  172. Private
  173. Protected
  174. //Property setters
  175. Public
  176. Class Function AllowAdditionalProperties : Boolean; override;
  177. Published
  178. end;
  179. TLogEntryTypejsonPayloadClass = Class of TLogEntryTypejsonPayload;
  180. { --------------------------------------------------------------------
  181. TLogEntryTypelabels
  182. --------------------------------------------------------------------}
  183. TLogEntryTypelabels = Class(TGoogleBaseObject)
  184. Private
  185. Protected
  186. //Property setters
  187. Public
  188. Class Function AllowAdditionalProperties : Boolean; override;
  189. Published
  190. end;
  191. TLogEntryTypelabelsClass = Class of TLogEntryTypelabels;
  192. { --------------------------------------------------------------------
  193. TLogEntry
  194. --------------------------------------------------------------------}
  195. TLogEntry = Class(TGoogleBaseObject)
  196. Private
  197. FlogName : String;
  198. Fresource : TMonitoredResource;
  199. FprotoPayload : TLogEntryTypeprotoPayload;
  200. FtextPayload : String;
  201. FjsonPayload : TLogEntryTypejsonPayload;
  202. Ftimestamp : String;
  203. Fseverity : String;
  204. FinsertId : String;
  205. FhttpRequest : THttpRequest;
  206. Flabels : TLogEntryTypelabels;
  207. Foperation : TLogEntryOperation;
  208. Protected
  209. //Property setters
  210. Procedure SetlogName(AIndex : Integer; const AValue : String); virtual;
  211. Procedure Setresource(AIndex : Integer; const AValue : TMonitoredResource); virtual;
  212. Procedure SetprotoPayload(AIndex : Integer; const AValue : TLogEntryTypeprotoPayload); virtual;
  213. Procedure SettextPayload(AIndex : Integer; const AValue : String); virtual;
  214. Procedure SetjsonPayload(AIndex : Integer; const AValue : TLogEntryTypejsonPayload); virtual;
  215. Procedure Settimestamp(AIndex : Integer; const AValue : String); virtual;
  216. Procedure Setseverity(AIndex : Integer; const AValue : String); virtual;
  217. Procedure SetinsertId(AIndex : Integer; const AValue : String); virtual;
  218. Procedure SethttpRequest(AIndex : Integer; const AValue : THttpRequest); virtual;
  219. Procedure Setlabels(AIndex : Integer; const AValue : TLogEntryTypelabels); virtual;
  220. Procedure Setoperation(AIndex : Integer; const AValue : TLogEntryOperation); virtual;
  221. Public
  222. Published
  223. Property logName : String Index 0 Read FlogName Write SetlogName;
  224. Property resource : TMonitoredResource Index 8 Read Fresource Write Setresource;
  225. Property protoPayload : TLogEntryTypeprotoPayload Index 16 Read FprotoPayload Write SetprotoPayload;
  226. Property textPayload : String Index 24 Read FtextPayload Write SettextPayload;
  227. Property jsonPayload : TLogEntryTypejsonPayload Index 32 Read FjsonPayload Write SetjsonPayload;
  228. Property timestamp : String Index 40 Read Ftimestamp Write Settimestamp;
  229. Property severity : String Index 48 Read Fseverity Write Setseverity;
  230. Property insertId : String Index 56 Read FinsertId Write SetinsertId;
  231. Property httpRequest : THttpRequest Index 64 Read FhttpRequest Write SethttpRequest;
  232. Property labels : TLogEntryTypelabels Index 72 Read Flabels Write Setlabels;
  233. Property operation : TLogEntryOperation Index 80 Read Foperation Write Setoperation;
  234. end;
  235. TLogEntryClass = Class of TLogEntry;
  236. { --------------------------------------------------------------------
  237. THttpRequest
  238. --------------------------------------------------------------------}
  239. THttpRequest = Class(TGoogleBaseObject)
  240. Private
  241. FrequestMethod : String;
  242. FrequestUrl : String;
  243. FrequestSize : String;
  244. Fstatus : integer;
  245. FresponseSize : String;
  246. FuserAgent : String;
  247. FremoteIp : String;
  248. Freferer : String;
  249. FcacheLookup : boolean;
  250. FcacheHit : boolean;
  251. FcacheValidatedWithOriginServer : boolean;
  252. FcacheFillBytes : String;
  253. Protected
  254. //Property setters
  255. Procedure SetrequestMethod(AIndex : Integer; const AValue : String); virtual;
  256. Procedure SetrequestUrl(AIndex : Integer; const AValue : String); virtual;
  257. Procedure SetrequestSize(AIndex : Integer; const AValue : String); virtual;
  258. Procedure Setstatus(AIndex : Integer; const AValue : integer); virtual;
  259. Procedure SetresponseSize(AIndex : Integer; const AValue : String); virtual;
  260. Procedure SetuserAgent(AIndex : Integer; const AValue : String); virtual;
  261. Procedure SetremoteIp(AIndex : Integer; const AValue : String); virtual;
  262. Procedure Setreferer(AIndex : Integer; const AValue : String); virtual;
  263. Procedure SetcacheLookup(AIndex : Integer; const AValue : boolean); virtual;
  264. Procedure SetcacheHit(AIndex : Integer; const AValue : boolean); virtual;
  265. Procedure SetcacheValidatedWithOriginServer(AIndex : Integer; const AValue : boolean); virtual;
  266. Procedure SetcacheFillBytes(AIndex : Integer; const AValue : String); virtual;
  267. Public
  268. Published
  269. Property requestMethod : String Index 0 Read FrequestMethod Write SetrequestMethod;
  270. Property requestUrl : String Index 8 Read FrequestUrl Write SetrequestUrl;
  271. Property requestSize : String Index 16 Read FrequestSize Write SetrequestSize;
  272. Property status : integer Index 24 Read Fstatus Write Setstatus;
  273. Property responseSize : String Index 32 Read FresponseSize Write SetresponseSize;
  274. Property userAgent : String Index 40 Read FuserAgent Write SetuserAgent;
  275. Property remoteIp : String Index 48 Read FremoteIp Write SetremoteIp;
  276. Property referer : String Index 56 Read Freferer Write Setreferer;
  277. Property cacheLookup : boolean Index 64 Read FcacheLookup Write SetcacheLookup;
  278. Property cacheHit : boolean Index 72 Read FcacheHit Write SetcacheHit;
  279. Property cacheValidatedWithOriginServer : boolean Index 80 Read FcacheValidatedWithOriginServer Write SetcacheValidatedWithOriginServer;
  280. Property cacheFillBytes : String Index 88 Read FcacheFillBytes Write SetcacheFillBytes;
  281. end;
  282. THttpRequestClass = Class of THttpRequest;
  283. { --------------------------------------------------------------------
  284. TLogEntryOperation
  285. --------------------------------------------------------------------}
  286. TLogEntryOperation = Class(TGoogleBaseObject)
  287. Private
  288. Fid : String;
  289. Fproducer : String;
  290. Ffirst : boolean;
  291. Flast : boolean;
  292. Protected
  293. //Property setters
  294. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  295. Procedure Setproducer(AIndex : Integer; const AValue : String); virtual;
  296. Procedure Setfirst(AIndex : Integer; const AValue : boolean); virtual;
  297. Procedure Setlast(AIndex : Integer; const AValue : boolean); virtual;
  298. Public
  299. Published
  300. Property id : String Index 0 Read Fid Write Setid;
  301. Property producer : String Index 8 Read Fproducer Write Setproducer;
  302. Property first : boolean Index 16 Read Ffirst Write Setfirst;
  303. Property last : boolean Index 24 Read Flast Write Setlast;
  304. end;
  305. TLogEntryOperationClass = Class of TLogEntryOperation;
  306. { --------------------------------------------------------------------
  307. TWriteLogEntriesResponse
  308. --------------------------------------------------------------------}
  309. TWriteLogEntriesResponse = Class(TGoogleBaseObject)
  310. Private
  311. Protected
  312. //Property setters
  313. Public
  314. Published
  315. end;
  316. TWriteLogEntriesResponseClass = Class of TWriteLogEntriesResponse;
  317. { --------------------------------------------------------------------
  318. TListLogEntriesRequest
  319. --------------------------------------------------------------------}
  320. TListLogEntriesRequest = Class(TGoogleBaseObject)
  321. Private
  322. FprojectIds : TStringArray;
  323. Ffilter : String;
  324. ForderBy : String;
  325. FpageSize : integer;
  326. FpageToken : String;
  327. FpartialSuccess : boolean;
  328. Protected
  329. //Property setters
  330. Procedure SetprojectIds(AIndex : Integer; const AValue : TStringArray); virtual;
  331. Procedure Setfilter(AIndex : Integer; const AValue : String); virtual;
  332. Procedure SetorderBy(AIndex : Integer; const AValue : String); virtual;
  333. Procedure SetpageSize(AIndex : Integer; const AValue : integer); virtual;
  334. Procedure SetpageToken(AIndex : Integer; const AValue : String); virtual;
  335. Procedure SetpartialSuccess(AIndex : Integer; const AValue : boolean); virtual;
  336. //2.6.4. bug workaround
  337. {$IFDEF VER2_6}
  338. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  339. {$ENDIF VER2_6}
  340. Public
  341. Published
  342. Property projectIds : TStringArray Index 0 Read FprojectIds Write SetprojectIds;
  343. Property filter : String Index 8 Read Ffilter Write Setfilter;
  344. Property orderBy : String Index 16 Read ForderBy Write SetorderBy;
  345. Property pageSize : integer Index 24 Read FpageSize Write SetpageSize;
  346. Property pageToken : String Index 32 Read FpageToken Write SetpageToken;
  347. Property partialSuccess : boolean Index 40 Read FpartialSuccess Write SetpartialSuccess;
  348. end;
  349. TListLogEntriesRequestClass = Class of TListLogEntriesRequest;
  350. { --------------------------------------------------------------------
  351. TListLogEntriesResponseTypeprojectIdErrors
  352. --------------------------------------------------------------------}
  353. TListLogEntriesResponseTypeprojectIdErrors = Class(TGoogleBaseObject)
  354. Private
  355. Protected
  356. //Property setters
  357. Public
  358. Class Function AllowAdditionalProperties : Boolean; override;
  359. Published
  360. end;
  361. TListLogEntriesResponseTypeprojectIdErrorsClass = Class of TListLogEntriesResponseTypeprojectIdErrors;
  362. { --------------------------------------------------------------------
  363. TListLogEntriesResponse
  364. --------------------------------------------------------------------}
  365. TListLogEntriesResponse = Class(TGoogleBaseObject)
  366. Private
  367. Fentries : TListLogEntriesResponseTypeentriesArray;
  368. FnextPageToken : String;
  369. FprojectIdErrors : TListLogEntriesResponseTypeprojectIdErrors;
  370. Protected
  371. //Property setters
  372. Procedure Setentries(AIndex : Integer; const AValue : TListLogEntriesResponseTypeentriesArray); virtual;
  373. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  374. Procedure SetprojectIdErrors(AIndex : Integer; const AValue : TListLogEntriesResponseTypeprojectIdErrors); virtual;
  375. //2.6.4. bug workaround
  376. {$IFDEF VER2_6}
  377. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  378. {$ENDIF VER2_6}
  379. Public
  380. Published
  381. Property entries : TListLogEntriesResponseTypeentriesArray Index 0 Read Fentries Write Setentries;
  382. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  383. Property projectIdErrors : TListLogEntriesResponseTypeprojectIdErrors Index 16 Read FprojectIdErrors Write SetprojectIdErrors;
  384. end;
  385. TListLogEntriesResponseClass = Class of TListLogEntriesResponse;
  386. { --------------------------------------------------------------------
  387. TStatusTypedetailsItem
  388. --------------------------------------------------------------------}
  389. TStatusTypedetailsItem = Class(TGoogleBaseObject)
  390. Private
  391. Protected
  392. //Property setters
  393. Public
  394. Class Function AllowAdditionalProperties : Boolean; override;
  395. Published
  396. end;
  397. TStatusTypedetailsItemClass = Class of TStatusTypedetailsItem;
  398. { --------------------------------------------------------------------
  399. TStatus
  400. --------------------------------------------------------------------}
  401. TStatus = Class(TGoogleBaseObject)
  402. Private
  403. Fcode : integer;
  404. Fmessage : String;
  405. Fdetails : TStatusTypedetailsArray;
  406. Protected
  407. //Property setters
  408. Procedure Setcode(AIndex : Integer; const AValue : integer); virtual;
  409. Procedure Setmessage(AIndex : Integer; const AValue : String); virtual;
  410. Procedure Setdetails(AIndex : Integer; const AValue : TStatusTypedetailsArray); virtual;
  411. //2.6.4. bug workaround
  412. {$IFDEF VER2_6}
  413. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  414. {$ENDIF VER2_6}
  415. Public
  416. Published
  417. Property code : integer Index 0 Read Fcode Write Setcode;
  418. Property message : String Index 8 Read Fmessage Write Setmessage;
  419. Property details : TStatusTypedetailsArray Index 16 Read Fdetails Write Setdetails;
  420. end;
  421. TStatusClass = Class of TStatus;
  422. { --------------------------------------------------------------------
  423. TListMonitoredResourceDescriptorsResponse
  424. --------------------------------------------------------------------}
  425. TListMonitoredResourceDescriptorsResponse = Class(TGoogleBaseObject)
  426. Private
  427. FresourceDescriptors : TListMonitoredResourceDescriptorsResponseTyperesourceDescriptorsArray;
  428. FnextPageToken : String;
  429. Protected
  430. //Property setters
  431. Procedure SetresourceDescriptors(AIndex : Integer; const AValue : TListMonitoredResourceDescriptorsResponseTyperesourceDescriptorsArray); virtual;
  432. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  433. //2.6.4. bug workaround
  434. {$IFDEF VER2_6}
  435. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  436. {$ENDIF VER2_6}
  437. Public
  438. Published
  439. Property resourceDescriptors : TListMonitoredResourceDescriptorsResponseTyperesourceDescriptorsArray Index 0 Read FresourceDescriptors Write SetresourceDescriptors;
  440. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  441. end;
  442. TListMonitoredResourceDescriptorsResponseClass = Class of TListMonitoredResourceDescriptorsResponse;
  443. { --------------------------------------------------------------------
  444. TMonitoredResourceDescriptor
  445. --------------------------------------------------------------------}
  446. TMonitoredResourceDescriptor = Class(TGoogleBaseObject)
  447. Private
  448. Fname : String;
  449. F_type : String;
  450. FdisplayName : String;
  451. Fdescription : String;
  452. Flabels : TMonitoredResourceDescriptorTypelabelsArray;
  453. Protected
  454. Class Function ExportPropertyName(Const AName : String) : string; override;
  455. //Property setters
  456. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  457. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  458. Procedure SetdisplayName(AIndex : Integer; const AValue : String); virtual;
  459. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  460. Procedure Setlabels(AIndex : Integer; const AValue : TMonitoredResourceDescriptorTypelabelsArray); virtual;
  461. //2.6.4. bug workaround
  462. {$IFDEF VER2_6}
  463. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  464. {$ENDIF VER2_6}
  465. Public
  466. Published
  467. Property name : String Index 0 Read Fname Write Setname;
  468. Property _type : String Index 8 Read F_type Write Set_type;
  469. Property displayName : String Index 16 Read FdisplayName Write SetdisplayName;
  470. Property description : String Index 24 Read Fdescription Write Setdescription;
  471. Property labels : TMonitoredResourceDescriptorTypelabelsArray Index 32 Read Flabels Write Setlabels;
  472. end;
  473. TMonitoredResourceDescriptorClass = Class of TMonitoredResourceDescriptor;
  474. { --------------------------------------------------------------------
  475. TLabelDescriptor
  476. --------------------------------------------------------------------}
  477. TLabelDescriptor = Class(TGoogleBaseObject)
  478. Private
  479. Fkey : String;
  480. FvalueType : String;
  481. Fdescription : String;
  482. Protected
  483. //Property setters
  484. Procedure Setkey(AIndex : Integer; const AValue : String); virtual;
  485. Procedure SetvalueType(AIndex : Integer; const AValue : String); virtual;
  486. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  487. Public
  488. Published
  489. Property key : String Index 0 Read Fkey Write Setkey;
  490. Property valueType : String Index 8 Read FvalueType Write SetvalueType;
  491. Property description : String Index 16 Read Fdescription Write Setdescription;
  492. end;
  493. TLabelDescriptorClass = Class of TLabelDescriptor;
  494. { --------------------------------------------------------------------
  495. TListSinksResponse
  496. --------------------------------------------------------------------}
  497. TListSinksResponse = Class(TGoogleBaseObject)
  498. Private
  499. Fsinks : TListSinksResponseTypesinksArray;
  500. FnextPageToken : String;
  501. Protected
  502. //Property setters
  503. Procedure Setsinks(AIndex : Integer; const AValue : TListSinksResponseTypesinksArray); virtual;
  504. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  505. //2.6.4. bug workaround
  506. {$IFDEF VER2_6}
  507. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  508. {$ENDIF VER2_6}
  509. Public
  510. Published
  511. Property sinks : TListSinksResponseTypesinksArray Index 0 Read Fsinks Write Setsinks;
  512. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  513. end;
  514. TListSinksResponseClass = Class of TListSinksResponse;
  515. { --------------------------------------------------------------------
  516. TLogSink
  517. --------------------------------------------------------------------}
  518. TLogSink = Class(TGoogleBaseObject)
  519. Private
  520. Fname : String;
  521. Fdestination : String;
  522. Ffilter : String;
  523. FoutputVersionFormat : String;
  524. Protected
  525. //Property setters
  526. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  527. Procedure Setdestination(AIndex : Integer; const AValue : String); virtual;
  528. Procedure Setfilter(AIndex : Integer; const AValue : String); virtual;
  529. Procedure SetoutputVersionFormat(AIndex : Integer; const AValue : String); virtual;
  530. Public
  531. Published
  532. Property name : String Index 0 Read Fname Write Setname;
  533. Property destination : String Index 8 Read Fdestination Write Setdestination;
  534. Property filter : String Index 16 Read Ffilter Write Setfilter;
  535. Property outputVersionFormat : String Index 24 Read FoutputVersionFormat Write SetoutputVersionFormat;
  536. end;
  537. TLogSinkClass = Class of TLogSink;
  538. { --------------------------------------------------------------------
  539. TListLogMetricsResponse
  540. --------------------------------------------------------------------}
  541. TListLogMetricsResponse = Class(TGoogleBaseObject)
  542. Private
  543. Fmetrics : TListLogMetricsResponseTypemetricsArray;
  544. FnextPageToken : String;
  545. Protected
  546. //Property setters
  547. Procedure Setmetrics(AIndex : Integer; const AValue : TListLogMetricsResponseTypemetricsArray); virtual;
  548. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  549. //2.6.4. bug workaround
  550. {$IFDEF VER2_6}
  551. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  552. {$ENDIF VER2_6}
  553. Public
  554. Published
  555. Property metrics : TListLogMetricsResponseTypemetricsArray Index 0 Read Fmetrics Write Setmetrics;
  556. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  557. end;
  558. TListLogMetricsResponseClass = Class of TListLogMetricsResponse;
  559. { --------------------------------------------------------------------
  560. TLogMetric
  561. --------------------------------------------------------------------}
  562. TLogMetric = Class(TGoogleBaseObject)
  563. Private
  564. Fname : String;
  565. Fdescription : String;
  566. Ffilter : String;
  567. Protected
  568. //Property setters
  569. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  570. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  571. Procedure Setfilter(AIndex : Integer; const AValue : String); virtual;
  572. Public
  573. Published
  574. Property name : String Index 0 Read Fname Write Setname;
  575. Property description : String Index 8 Read Fdescription Write Setdescription;
  576. Property filter : String Index 16 Read Ffilter Write Setfilter;
  577. end;
  578. TLogMetricClass = Class of TLogMetric;
  579. { --------------------------------------------------------------------
  580. TRequestLog
  581. --------------------------------------------------------------------}
  582. TRequestLog = Class(TGoogleBaseObject)
  583. Private
  584. FappId : String;
  585. FmoduleId : String;
  586. FversionId : String;
  587. FrequestId : String;
  588. Fip : String;
  589. FstartTime : String;
  590. FendTime : String;
  591. Flatency : String;
  592. FmegaCycles : String;
  593. Fmethod : String;
  594. Fresource : String;
  595. FhttpVersion : String;
  596. Fstatus : integer;
  597. FresponseSize : String;
  598. Freferrer : String;
  599. FuserAgent : String;
  600. Fnickname : String;
  601. FurlMapEntry : String;
  602. Fhost : String;
  603. Fcost : double;
  604. FtaskQueueName : String;
  605. FtaskName : String;
  606. FwasLoadingRequest : boolean;
  607. FpendingTime : String;
  608. FinstanceIndex : integer;
  609. Ffinished : boolean;
  610. Ffirst : boolean;
  611. FinstanceId : String;
  612. Fline : TRequestLogTypelineArray;
  613. FappEngineRelease : String;
  614. FtraceId : String;
  615. FsourceReference : TRequestLogTypesourceReferenceArray;
  616. Protected
  617. //Property setters
  618. Procedure SetappId(AIndex : Integer; const AValue : String); virtual;
  619. Procedure SetmoduleId(AIndex : Integer; const AValue : String); virtual;
  620. Procedure SetversionId(AIndex : Integer; const AValue : String); virtual;
  621. Procedure SetrequestId(AIndex : Integer; const AValue : String); virtual;
  622. Procedure Setip(AIndex : Integer; const AValue : String); virtual;
  623. Procedure SetstartTime(AIndex : Integer; const AValue : String); virtual;
  624. Procedure SetendTime(AIndex : Integer; const AValue : String); virtual;
  625. Procedure Setlatency(AIndex : Integer; const AValue : String); virtual;
  626. Procedure SetmegaCycles(AIndex : Integer; const AValue : String); virtual;
  627. Procedure Setmethod(AIndex : Integer; const AValue : String); virtual;
  628. Procedure Setresource(AIndex : Integer; const AValue : String); virtual;
  629. Procedure SethttpVersion(AIndex : Integer; const AValue : String); virtual;
  630. Procedure Setstatus(AIndex : Integer; const AValue : integer); virtual;
  631. Procedure SetresponseSize(AIndex : Integer; const AValue : String); virtual;
  632. Procedure Setreferrer(AIndex : Integer; const AValue : String); virtual;
  633. Procedure SetuserAgent(AIndex : Integer; const AValue : String); virtual;
  634. Procedure Setnickname(AIndex : Integer; const AValue : String); virtual;
  635. Procedure SeturlMapEntry(AIndex : Integer; const AValue : String); virtual;
  636. Procedure Sethost(AIndex : Integer; const AValue : String); virtual;
  637. Procedure Setcost(AIndex : Integer; const AValue : double); virtual;
  638. Procedure SettaskQueueName(AIndex : Integer; const AValue : String); virtual;
  639. Procedure SettaskName(AIndex : Integer; const AValue : String); virtual;
  640. Procedure SetwasLoadingRequest(AIndex : Integer; const AValue : boolean); virtual;
  641. Procedure SetpendingTime(AIndex : Integer; const AValue : String); virtual;
  642. Procedure SetinstanceIndex(AIndex : Integer; const AValue : integer); virtual;
  643. Procedure Setfinished(AIndex : Integer; const AValue : boolean); virtual;
  644. Procedure Setfirst(AIndex : Integer; const AValue : boolean); virtual;
  645. Procedure SetinstanceId(AIndex : Integer; const AValue : String); virtual;
  646. Procedure Setline(AIndex : Integer; const AValue : TRequestLogTypelineArray); virtual;
  647. Procedure SetappEngineRelease(AIndex : Integer; const AValue : String); virtual;
  648. Procedure SettraceId(AIndex : Integer; const AValue : String); virtual;
  649. Procedure SetsourceReference(AIndex : Integer; const AValue : TRequestLogTypesourceReferenceArray); virtual;
  650. //2.6.4. bug workaround
  651. {$IFDEF VER2_6}
  652. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  653. {$ENDIF VER2_6}
  654. Public
  655. Published
  656. Property appId : String Index 0 Read FappId Write SetappId;
  657. Property moduleId : String Index 8 Read FmoduleId Write SetmoduleId;
  658. Property versionId : String Index 16 Read FversionId Write SetversionId;
  659. Property requestId : String Index 24 Read FrequestId Write SetrequestId;
  660. Property ip : String Index 32 Read Fip Write Setip;
  661. Property startTime : String Index 40 Read FstartTime Write SetstartTime;
  662. Property endTime : String Index 48 Read FendTime Write SetendTime;
  663. Property latency : String Index 56 Read Flatency Write Setlatency;
  664. Property megaCycles : String Index 64 Read FmegaCycles Write SetmegaCycles;
  665. Property method : String Index 72 Read Fmethod Write Setmethod;
  666. Property resource : String Index 80 Read Fresource Write Setresource;
  667. Property httpVersion : String Index 88 Read FhttpVersion Write SethttpVersion;
  668. Property status : integer Index 96 Read Fstatus Write Setstatus;
  669. Property responseSize : String Index 104 Read FresponseSize Write SetresponseSize;
  670. Property referrer : String Index 112 Read Freferrer Write Setreferrer;
  671. Property userAgent : String Index 120 Read FuserAgent Write SetuserAgent;
  672. Property nickname : String Index 128 Read Fnickname Write Setnickname;
  673. Property urlMapEntry : String Index 136 Read FurlMapEntry Write SeturlMapEntry;
  674. Property host : String Index 144 Read Fhost Write Sethost;
  675. Property cost : double Index 152 Read Fcost Write Setcost;
  676. Property taskQueueName : String Index 160 Read FtaskQueueName Write SettaskQueueName;
  677. Property taskName : String Index 168 Read FtaskName Write SettaskName;
  678. Property wasLoadingRequest : boolean Index 176 Read FwasLoadingRequest Write SetwasLoadingRequest;
  679. Property pendingTime : String Index 184 Read FpendingTime Write SetpendingTime;
  680. Property instanceIndex : integer Index 192 Read FinstanceIndex Write SetinstanceIndex;
  681. Property finished : boolean Index 200 Read Ffinished Write Setfinished;
  682. Property first : boolean Index 208 Read Ffirst Write Setfirst;
  683. Property instanceId : String Index 216 Read FinstanceId Write SetinstanceId;
  684. Property line : TRequestLogTypelineArray Index 224 Read Fline Write Setline;
  685. Property appEngineRelease : String Index 232 Read FappEngineRelease Write SetappEngineRelease;
  686. Property traceId : String Index 240 Read FtraceId Write SettraceId;
  687. Property sourceReference : TRequestLogTypesourceReferenceArray Index 248 Read FsourceReference Write SetsourceReference;
  688. end;
  689. TRequestLogClass = Class of TRequestLog;
  690. { --------------------------------------------------------------------
  691. TLogLine
  692. --------------------------------------------------------------------}
  693. TLogLine = Class(TGoogleBaseObject)
  694. Private
  695. Ftime : String;
  696. Fseverity : String;
  697. FlogMessage : String;
  698. FsourceLocation : TSourceLocation;
  699. Protected
  700. //Property setters
  701. Procedure Settime(AIndex : Integer; const AValue : String); virtual;
  702. Procedure Setseverity(AIndex : Integer; const AValue : String); virtual;
  703. Procedure SetlogMessage(AIndex : Integer; const AValue : String); virtual;
  704. Procedure SetsourceLocation(AIndex : Integer; const AValue : TSourceLocation); virtual;
  705. Public
  706. Published
  707. Property time : String Index 0 Read Ftime Write Settime;
  708. Property severity : String Index 8 Read Fseverity Write Setseverity;
  709. Property logMessage : String Index 16 Read FlogMessage Write SetlogMessage;
  710. Property sourceLocation : TSourceLocation Index 24 Read FsourceLocation Write SetsourceLocation;
  711. end;
  712. TLogLineClass = Class of TLogLine;
  713. { --------------------------------------------------------------------
  714. TSourceLocation
  715. --------------------------------------------------------------------}
  716. TSourceLocation = Class(TGoogleBaseObject)
  717. Private
  718. F_file : String;
  719. Fline : String;
  720. FfunctionName : String;
  721. Protected
  722. Class Function ExportPropertyName(Const AName : String) : string; override;
  723. //Property setters
  724. Procedure Set_file(AIndex : Integer; const AValue : String); virtual;
  725. Procedure Setline(AIndex : Integer; const AValue : String); virtual;
  726. Procedure SetfunctionName(AIndex : Integer; const AValue : String); virtual;
  727. Public
  728. Published
  729. Property _file : String Index 0 Read F_file Write Set_file;
  730. Property line : String Index 8 Read Fline Write Setline;
  731. Property functionName : String Index 16 Read FfunctionName Write SetfunctionName;
  732. end;
  733. TSourceLocationClass = Class of TSourceLocation;
  734. { --------------------------------------------------------------------
  735. TSourceReference
  736. --------------------------------------------------------------------}
  737. TSourceReference = Class(TGoogleBaseObject)
  738. Private
  739. Frepository : String;
  740. FrevisionId : String;
  741. Protected
  742. //Property setters
  743. Procedure Setrepository(AIndex : Integer; const AValue : String); virtual;
  744. Procedure SetrevisionId(AIndex : Integer; const AValue : String); virtual;
  745. Public
  746. Published
  747. Property repository : String Index 0 Read Frepository Write Setrepository;
  748. Property revisionId : String Index 8 Read FrevisionId Write SetrevisionId;
  749. end;
  750. TSourceReferenceClass = Class of TSourceReference;
  751. { --------------------------------------------------------------------
  752. TProjectsLogsResource
  753. --------------------------------------------------------------------}
  754. TProjectsLogsResource = Class(TGoogleResource)
  755. Public
  756. Class Function ResourceName : String; override;
  757. Class Function DefaultAPI : TGoogleAPIClass; override;
  758. Function Delete(logName: string) : TEmpty;
  759. end;
  760. { --------------------------------------------------------------------
  761. TProjectsSinksResource
  762. --------------------------------------------------------------------}
  763. //Optional query Options for TProjectsSinksResource, method List
  764. TProjectsSinksListOptions = Record
  765. pageToken : String;
  766. pageSize : integer;
  767. end;
  768. TProjectsSinksResource = Class(TGoogleResource)
  769. Public
  770. Class Function ResourceName : String; override;
  771. Class Function DefaultAPI : TGoogleAPIClass; override;
  772. Function List(projectName: string; AQuery : string = '') : TListSinksResponse;
  773. Function List(projectName: string; AQuery : TProjectsSinkslistOptions) : TListSinksResponse;
  774. Function Get(sinkName: string) : TLogSink;
  775. Function Create(projectName: string; aLogSink : TLogSink) : TLogSink;overload;
  776. Function Update(sinkName: string; aLogSink : TLogSink) : TLogSink;
  777. Function Delete(sinkName: string) : TEmpty;
  778. end;
  779. { --------------------------------------------------------------------
  780. TProjectsMetricsResource
  781. --------------------------------------------------------------------}
  782. //Optional query Options for TProjectsMetricsResource, method List
  783. TProjectsMetricsListOptions = Record
  784. pageToken : String;
  785. pageSize : integer;
  786. end;
  787. TProjectsMetricsResource = Class(TGoogleResource)
  788. Public
  789. Class Function ResourceName : String; override;
  790. Class Function DefaultAPI : TGoogleAPIClass; override;
  791. Function List(projectName: string; AQuery : string = '') : TListLogMetricsResponse;
  792. Function List(projectName: string; AQuery : TProjectsMetricslistOptions) : TListLogMetricsResponse;
  793. Function Get(metricName: string) : TLogMetric;
  794. Function Create(projectName: string; aLogMetric : TLogMetric) : TLogMetric;overload;
  795. Function Update(metricName: string; aLogMetric : TLogMetric) : TLogMetric;
  796. Function Delete(metricName: string) : TEmpty;
  797. end;
  798. { --------------------------------------------------------------------
  799. TProjectsResource
  800. --------------------------------------------------------------------}
  801. TProjectsResource = Class(TGoogleResource)
  802. Private
  803. FLogsInstance : TProjectsLogsResource;
  804. FSinksInstance : TProjectsSinksResource;
  805. FMetricsInstance : TProjectsMetricsResource;
  806. Function GetLogsInstance : TProjectsLogsResource;virtual;
  807. Function GetSinksInstance : TProjectsSinksResource;virtual;
  808. Function GetMetricsInstance : TProjectsMetricsResource;virtual;
  809. Public
  810. Class Function ResourceName : String; override;
  811. Class Function DefaultAPI : TGoogleAPIClass; override;
  812. Function CreateLogsResource(AOwner : TComponent) : TProjectsLogsResource;virtual;overload;
  813. Function CreateLogsResource : TProjectsLogsResource;virtual;overload;
  814. Function CreateSinksResource(AOwner : TComponent) : TProjectsSinksResource;virtual;overload;
  815. Function CreateSinksResource : TProjectsSinksResource;virtual;overload;
  816. Function CreateMetricsResource(AOwner : TComponent) : TProjectsMetricsResource;virtual;overload;
  817. Function CreateMetricsResource : TProjectsMetricsResource;virtual;overload;
  818. Property LogsResource : TProjectsLogsResource Read GetLogsInstance;
  819. Property SinksResource : TProjectsSinksResource Read GetSinksInstance;
  820. Property MetricsResource : TProjectsMetricsResource Read GetMetricsInstance;
  821. end;
  822. { --------------------------------------------------------------------
  823. TEntriesResource
  824. --------------------------------------------------------------------}
  825. TEntriesResource = Class(TGoogleResource)
  826. Public
  827. Class Function ResourceName : String; override;
  828. Class Function DefaultAPI : TGoogleAPIClass; override;
  829. Function Write(aWriteLogEntriesRequest : TWriteLogEntriesRequest) : TWriteLogEntriesResponse;
  830. Function List(aListLogEntriesRequest : TListLogEntriesRequest) : TListLogEntriesResponse;
  831. end;
  832. { --------------------------------------------------------------------
  833. TMonitoredResourceDescriptorsResource
  834. --------------------------------------------------------------------}
  835. //Optional query Options for TMonitoredResourceDescriptorsResource, method List
  836. TMonitoredResourceDescriptorsListOptions = Record
  837. pageSize : integer;
  838. pageToken : String;
  839. end;
  840. TMonitoredResourceDescriptorsResource = Class(TGoogleResource)
  841. Public
  842. Class Function ResourceName : String; override;
  843. Class Function DefaultAPI : TGoogleAPIClass; override;
  844. Function List(AQuery : string = '') : TListMonitoredResourceDescriptorsResponse;
  845. Function List(AQuery : TMonitoredResourceDescriptorslistOptions) : TListMonitoredResourceDescriptorsResponse;
  846. end;
  847. { --------------------------------------------------------------------
  848. TLoggingAPI
  849. --------------------------------------------------------------------}
  850. TLoggingAPI = Class(TGoogleAPI)
  851. Private
  852. FProjectsLogsInstance : TProjectsLogsResource;
  853. FProjectsSinksInstance : TProjectsSinksResource;
  854. FProjectsMetricsInstance : TProjectsMetricsResource;
  855. FProjectsInstance : TProjectsResource;
  856. FEntriesInstance : TEntriesResource;
  857. FMonitoredResourceDescriptorsInstance : TMonitoredResourceDescriptorsResource;
  858. Function GetProjectsLogsInstance : TProjectsLogsResource;virtual;
  859. Function GetProjectsSinksInstance : TProjectsSinksResource;virtual;
  860. Function GetProjectsMetricsInstance : TProjectsMetricsResource;virtual;
  861. Function GetProjectsInstance : TProjectsResource;virtual;
  862. Function GetEntriesInstance : TEntriesResource;virtual;
  863. Function GetMonitoredResourceDescriptorsInstance : TMonitoredResourceDescriptorsResource;virtual;
  864. Public
  865. //Override class functions with API info
  866. Class Function APIName : String; override;
  867. Class Function APIVersion : String; override;
  868. Class Function APIRevision : String; override;
  869. Class Function APIID : String; override;
  870. Class Function APITitle : String; override;
  871. Class Function APIDescription : String; override;
  872. Class Function APIOwnerDomain : String; override;
  873. Class Function APIOwnerName : String; override;
  874. Class Function APIIcon16 : String; override;
  875. Class Function APIIcon32 : String; override;
  876. Class Function APIdocumentationLink : String; override;
  877. Class Function APIrootUrl : string; override;
  878. Class Function APIbasePath : string;override;
  879. Class Function APIbaseURL : String;override;
  880. Class Function APIProtocol : string;override;
  881. Class Function APIservicePath : string;override;
  882. Class Function APIbatchPath : String;override;
  883. Class Function APIAuthScopes : TScopeInfoArray;override;
  884. Class Function APINeedsAuth : Boolean;override;
  885. Class Procedure RegisterAPIResources; override;
  886. //Add create function for resources
  887. Function CreateProjectsLogsResource(AOwner : TComponent) : TProjectsLogsResource;virtual;overload;
  888. Function CreateProjectsLogsResource : TProjectsLogsResource;virtual;overload;
  889. Function CreateProjectsSinksResource(AOwner : TComponent) : TProjectsSinksResource;virtual;overload;
  890. Function CreateProjectsSinksResource : TProjectsSinksResource;virtual;overload;
  891. Function CreateProjectsMetricsResource(AOwner : TComponent) : TProjectsMetricsResource;virtual;overload;
  892. Function CreateProjectsMetricsResource : TProjectsMetricsResource;virtual;overload;
  893. Function CreateProjectsResource(AOwner : TComponent) : TProjectsResource;virtual;overload;
  894. Function CreateProjectsResource : TProjectsResource;virtual;overload;
  895. Function CreateEntriesResource(AOwner : TComponent) : TEntriesResource;virtual;overload;
  896. Function CreateEntriesResource : TEntriesResource;virtual;overload;
  897. Function CreateMonitoredResourceDescriptorsResource(AOwner : TComponent) : TMonitoredResourceDescriptorsResource;virtual;overload;
  898. Function CreateMonitoredResourceDescriptorsResource : TMonitoredResourceDescriptorsResource;virtual;overload;
  899. //Add default on-demand instances for resources
  900. Property ProjectsLogsResource : TProjectsLogsResource Read GetProjectsLogsInstance;
  901. Property ProjectsSinksResource : TProjectsSinksResource Read GetProjectsSinksInstance;
  902. Property ProjectsMetricsResource : TProjectsMetricsResource Read GetProjectsMetricsInstance;
  903. Property ProjectsResource : TProjectsResource Read GetProjectsInstance;
  904. Property EntriesResource : TEntriesResource Read GetEntriesInstance;
  905. Property MonitoredResourceDescriptorsResource : TMonitoredResourceDescriptorsResource Read GetMonitoredResourceDescriptorsInstance;
  906. end;
  907. implementation
  908. { --------------------------------------------------------------------
  909. TEmpty
  910. --------------------------------------------------------------------}
  911. { --------------------------------------------------------------------
  912. TWriteLogEntriesRequestTypelabels
  913. --------------------------------------------------------------------}
  914. Class Function TWriteLogEntriesRequestTypelabels.AllowAdditionalProperties : Boolean;
  915. begin
  916. Result:=True;
  917. end;
  918. { --------------------------------------------------------------------
  919. TWriteLogEntriesRequest
  920. --------------------------------------------------------------------}
  921. Procedure TWriteLogEntriesRequest.SetlogName(AIndex : Integer; const AValue : String);
  922. begin
  923. If (FlogName=AValue) then exit;
  924. FlogName:=AValue;
  925. MarkPropertyChanged(AIndex);
  926. end;
  927. Procedure TWriteLogEntriesRequest.Setresource(AIndex : Integer; const AValue : TMonitoredResource);
  928. begin
  929. If (Fresource=AValue) then exit;
  930. Fresource:=AValue;
  931. MarkPropertyChanged(AIndex);
  932. end;
  933. Procedure TWriteLogEntriesRequest.Setlabels(AIndex : Integer; const AValue : TWriteLogEntriesRequestTypelabels);
  934. begin
  935. If (Flabels=AValue) then exit;
  936. Flabels:=AValue;
  937. MarkPropertyChanged(AIndex);
  938. end;
  939. Procedure TWriteLogEntriesRequest.Setentries(AIndex : Integer; const AValue : TWriteLogEntriesRequestTypeentriesArray);
  940. begin
  941. If (Fentries=AValue) then exit;
  942. Fentries:=AValue;
  943. MarkPropertyChanged(AIndex);
  944. end;
  945. Procedure TWriteLogEntriesRequest.SetpartialSuccess(AIndex : Integer; const AValue : boolean);
  946. begin
  947. If (FpartialSuccess=AValue) then exit;
  948. FpartialSuccess:=AValue;
  949. MarkPropertyChanged(AIndex);
  950. end;
  951. //2.6.4. bug workaround
  952. {$IFDEF VER2_6}
  953. Procedure TWriteLogEntriesRequest.SetArrayLength(Const AName : String; ALength : Longint);
  954. begin
  955. Case AName of
  956. 'entries' : SetLength(Fentries,ALength);
  957. else
  958. Inherited SetArrayLength(AName,ALength);
  959. end;
  960. end;
  961. {$ENDIF VER2_6}
  962. { --------------------------------------------------------------------
  963. TMonitoredResourceTypelabels
  964. --------------------------------------------------------------------}
  965. Class Function TMonitoredResourceTypelabels.AllowAdditionalProperties : Boolean;
  966. begin
  967. Result:=True;
  968. end;
  969. { --------------------------------------------------------------------
  970. TMonitoredResource
  971. --------------------------------------------------------------------}
  972. Procedure TMonitoredResource.Set_type(AIndex : Integer; const AValue : String);
  973. begin
  974. If (F_type=AValue) then exit;
  975. F_type:=AValue;
  976. MarkPropertyChanged(AIndex);
  977. end;
  978. Procedure TMonitoredResource.Setlabels(AIndex : Integer; const AValue : TMonitoredResourceTypelabels);
  979. begin
  980. If (Flabels=AValue) then exit;
  981. Flabels:=AValue;
  982. MarkPropertyChanged(AIndex);
  983. end;
  984. Class Function TMonitoredResource.ExportPropertyName(Const AName : String) :String;
  985. begin
  986. Case AName of
  987. '_type' : Result:='type';
  988. else
  989. Result:=Inherited ExportPropertyName(AName);
  990. end;
  991. end;
  992. { --------------------------------------------------------------------
  993. TLogEntryTypeprotoPayload
  994. --------------------------------------------------------------------}
  995. Class Function TLogEntryTypeprotoPayload.AllowAdditionalProperties : Boolean;
  996. begin
  997. Result:=True;
  998. end;
  999. { --------------------------------------------------------------------
  1000. TLogEntryTypejsonPayload
  1001. --------------------------------------------------------------------}
  1002. Class Function TLogEntryTypejsonPayload.AllowAdditionalProperties : Boolean;
  1003. begin
  1004. Result:=True;
  1005. end;
  1006. { --------------------------------------------------------------------
  1007. TLogEntryTypelabels
  1008. --------------------------------------------------------------------}
  1009. Class Function TLogEntryTypelabels.AllowAdditionalProperties : Boolean;
  1010. begin
  1011. Result:=True;
  1012. end;
  1013. { --------------------------------------------------------------------
  1014. TLogEntry
  1015. --------------------------------------------------------------------}
  1016. Procedure TLogEntry.SetlogName(AIndex : Integer; const AValue : String);
  1017. begin
  1018. If (FlogName=AValue) then exit;
  1019. FlogName:=AValue;
  1020. MarkPropertyChanged(AIndex);
  1021. end;
  1022. Procedure TLogEntry.Setresource(AIndex : Integer; const AValue : TMonitoredResource);
  1023. begin
  1024. If (Fresource=AValue) then exit;
  1025. Fresource:=AValue;
  1026. MarkPropertyChanged(AIndex);
  1027. end;
  1028. Procedure TLogEntry.SetprotoPayload(AIndex : Integer; const AValue : TLogEntryTypeprotoPayload);
  1029. begin
  1030. If (FprotoPayload=AValue) then exit;
  1031. FprotoPayload:=AValue;
  1032. MarkPropertyChanged(AIndex);
  1033. end;
  1034. Procedure TLogEntry.SettextPayload(AIndex : Integer; const AValue : String);
  1035. begin
  1036. If (FtextPayload=AValue) then exit;
  1037. FtextPayload:=AValue;
  1038. MarkPropertyChanged(AIndex);
  1039. end;
  1040. Procedure TLogEntry.SetjsonPayload(AIndex : Integer; const AValue : TLogEntryTypejsonPayload);
  1041. begin
  1042. If (FjsonPayload=AValue) then exit;
  1043. FjsonPayload:=AValue;
  1044. MarkPropertyChanged(AIndex);
  1045. end;
  1046. Procedure TLogEntry.Settimestamp(AIndex : Integer; const AValue : String);
  1047. begin
  1048. If (Ftimestamp=AValue) then exit;
  1049. Ftimestamp:=AValue;
  1050. MarkPropertyChanged(AIndex);
  1051. end;
  1052. Procedure TLogEntry.Setseverity(AIndex : Integer; const AValue : String);
  1053. begin
  1054. If (Fseverity=AValue) then exit;
  1055. Fseverity:=AValue;
  1056. MarkPropertyChanged(AIndex);
  1057. end;
  1058. Procedure TLogEntry.SetinsertId(AIndex : Integer; const AValue : String);
  1059. begin
  1060. If (FinsertId=AValue) then exit;
  1061. FinsertId:=AValue;
  1062. MarkPropertyChanged(AIndex);
  1063. end;
  1064. Procedure TLogEntry.SethttpRequest(AIndex : Integer; const AValue : THttpRequest);
  1065. begin
  1066. If (FhttpRequest=AValue) then exit;
  1067. FhttpRequest:=AValue;
  1068. MarkPropertyChanged(AIndex);
  1069. end;
  1070. Procedure TLogEntry.Setlabels(AIndex : Integer; const AValue : TLogEntryTypelabels);
  1071. begin
  1072. If (Flabels=AValue) then exit;
  1073. Flabels:=AValue;
  1074. MarkPropertyChanged(AIndex);
  1075. end;
  1076. Procedure TLogEntry.Setoperation(AIndex : Integer; const AValue : TLogEntryOperation);
  1077. begin
  1078. If (Foperation=AValue) then exit;
  1079. Foperation:=AValue;
  1080. MarkPropertyChanged(AIndex);
  1081. end;
  1082. { --------------------------------------------------------------------
  1083. THttpRequest
  1084. --------------------------------------------------------------------}
  1085. Procedure THttpRequest.SetrequestMethod(AIndex : Integer; const AValue : String);
  1086. begin
  1087. If (FrequestMethod=AValue) then exit;
  1088. FrequestMethod:=AValue;
  1089. MarkPropertyChanged(AIndex);
  1090. end;
  1091. Procedure THttpRequest.SetrequestUrl(AIndex : Integer; const AValue : String);
  1092. begin
  1093. If (FrequestUrl=AValue) then exit;
  1094. FrequestUrl:=AValue;
  1095. MarkPropertyChanged(AIndex);
  1096. end;
  1097. Procedure THttpRequest.SetrequestSize(AIndex : Integer; const AValue : String);
  1098. begin
  1099. If (FrequestSize=AValue) then exit;
  1100. FrequestSize:=AValue;
  1101. MarkPropertyChanged(AIndex);
  1102. end;
  1103. Procedure THttpRequest.Setstatus(AIndex : Integer; const AValue : integer);
  1104. begin
  1105. If (Fstatus=AValue) then exit;
  1106. Fstatus:=AValue;
  1107. MarkPropertyChanged(AIndex);
  1108. end;
  1109. Procedure THttpRequest.SetresponseSize(AIndex : Integer; const AValue : String);
  1110. begin
  1111. If (FresponseSize=AValue) then exit;
  1112. FresponseSize:=AValue;
  1113. MarkPropertyChanged(AIndex);
  1114. end;
  1115. Procedure THttpRequest.SetuserAgent(AIndex : Integer; const AValue : String);
  1116. begin
  1117. If (FuserAgent=AValue) then exit;
  1118. FuserAgent:=AValue;
  1119. MarkPropertyChanged(AIndex);
  1120. end;
  1121. Procedure THttpRequest.SetremoteIp(AIndex : Integer; const AValue : String);
  1122. begin
  1123. If (FremoteIp=AValue) then exit;
  1124. FremoteIp:=AValue;
  1125. MarkPropertyChanged(AIndex);
  1126. end;
  1127. Procedure THttpRequest.Setreferer(AIndex : Integer; const AValue : String);
  1128. begin
  1129. If (Freferer=AValue) then exit;
  1130. Freferer:=AValue;
  1131. MarkPropertyChanged(AIndex);
  1132. end;
  1133. Procedure THttpRequest.SetcacheLookup(AIndex : Integer; const AValue : boolean);
  1134. begin
  1135. If (FcacheLookup=AValue) then exit;
  1136. FcacheLookup:=AValue;
  1137. MarkPropertyChanged(AIndex);
  1138. end;
  1139. Procedure THttpRequest.SetcacheHit(AIndex : Integer; const AValue : boolean);
  1140. begin
  1141. If (FcacheHit=AValue) then exit;
  1142. FcacheHit:=AValue;
  1143. MarkPropertyChanged(AIndex);
  1144. end;
  1145. Procedure THttpRequest.SetcacheValidatedWithOriginServer(AIndex : Integer; const AValue : boolean);
  1146. begin
  1147. If (FcacheValidatedWithOriginServer=AValue) then exit;
  1148. FcacheValidatedWithOriginServer:=AValue;
  1149. MarkPropertyChanged(AIndex);
  1150. end;
  1151. Procedure THttpRequest.SetcacheFillBytes(AIndex : Integer; const AValue : String);
  1152. begin
  1153. If (FcacheFillBytes=AValue) then exit;
  1154. FcacheFillBytes:=AValue;
  1155. MarkPropertyChanged(AIndex);
  1156. end;
  1157. { --------------------------------------------------------------------
  1158. TLogEntryOperation
  1159. --------------------------------------------------------------------}
  1160. Procedure TLogEntryOperation.Setid(AIndex : Integer; const AValue : String);
  1161. begin
  1162. If (Fid=AValue) then exit;
  1163. Fid:=AValue;
  1164. MarkPropertyChanged(AIndex);
  1165. end;
  1166. Procedure TLogEntryOperation.Setproducer(AIndex : Integer; const AValue : String);
  1167. begin
  1168. If (Fproducer=AValue) then exit;
  1169. Fproducer:=AValue;
  1170. MarkPropertyChanged(AIndex);
  1171. end;
  1172. Procedure TLogEntryOperation.Setfirst(AIndex : Integer; const AValue : boolean);
  1173. begin
  1174. If (Ffirst=AValue) then exit;
  1175. Ffirst:=AValue;
  1176. MarkPropertyChanged(AIndex);
  1177. end;
  1178. Procedure TLogEntryOperation.Setlast(AIndex : Integer; const AValue : boolean);
  1179. begin
  1180. If (Flast=AValue) then exit;
  1181. Flast:=AValue;
  1182. MarkPropertyChanged(AIndex);
  1183. end;
  1184. { --------------------------------------------------------------------
  1185. TWriteLogEntriesResponse
  1186. --------------------------------------------------------------------}
  1187. { --------------------------------------------------------------------
  1188. TListLogEntriesRequest
  1189. --------------------------------------------------------------------}
  1190. Procedure TListLogEntriesRequest.SetprojectIds(AIndex : Integer; const AValue : TStringArray);
  1191. begin
  1192. If (FprojectIds=AValue) then exit;
  1193. FprojectIds:=AValue;
  1194. MarkPropertyChanged(AIndex);
  1195. end;
  1196. Procedure TListLogEntriesRequest.Setfilter(AIndex : Integer; const AValue : String);
  1197. begin
  1198. If (Ffilter=AValue) then exit;
  1199. Ffilter:=AValue;
  1200. MarkPropertyChanged(AIndex);
  1201. end;
  1202. Procedure TListLogEntriesRequest.SetorderBy(AIndex : Integer; const AValue : String);
  1203. begin
  1204. If (ForderBy=AValue) then exit;
  1205. ForderBy:=AValue;
  1206. MarkPropertyChanged(AIndex);
  1207. end;
  1208. Procedure TListLogEntriesRequest.SetpageSize(AIndex : Integer; const AValue : integer);
  1209. begin
  1210. If (FpageSize=AValue) then exit;
  1211. FpageSize:=AValue;
  1212. MarkPropertyChanged(AIndex);
  1213. end;
  1214. Procedure TListLogEntriesRequest.SetpageToken(AIndex : Integer; const AValue : String);
  1215. begin
  1216. If (FpageToken=AValue) then exit;
  1217. FpageToken:=AValue;
  1218. MarkPropertyChanged(AIndex);
  1219. end;
  1220. Procedure TListLogEntriesRequest.SetpartialSuccess(AIndex : Integer; const AValue : boolean);
  1221. begin
  1222. If (FpartialSuccess=AValue) then exit;
  1223. FpartialSuccess:=AValue;
  1224. MarkPropertyChanged(AIndex);
  1225. end;
  1226. //2.6.4. bug workaround
  1227. {$IFDEF VER2_6}
  1228. Procedure TListLogEntriesRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1229. begin
  1230. Case AName of
  1231. 'projectids' : SetLength(FprojectIds,ALength);
  1232. else
  1233. Inherited SetArrayLength(AName,ALength);
  1234. end;
  1235. end;
  1236. {$ENDIF VER2_6}
  1237. { --------------------------------------------------------------------
  1238. TListLogEntriesResponseTypeprojectIdErrors
  1239. --------------------------------------------------------------------}
  1240. Class Function TListLogEntriesResponseTypeprojectIdErrors.AllowAdditionalProperties : Boolean;
  1241. begin
  1242. Result:=True;
  1243. end;
  1244. { --------------------------------------------------------------------
  1245. TListLogEntriesResponse
  1246. --------------------------------------------------------------------}
  1247. Procedure TListLogEntriesResponse.Setentries(AIndex : Integer; const AValue : TListLogEntriesResponseTypeentriesArray);
  1248. begin
  1249. If (Fentries=AValue) then exit;
  1250. Fentries:=AValue;
  1251. MarkPropertyChanged(AIndex);
  1252. end;
  1253. Procedure TListLogEntriesResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  1254. begin
  1255. If (FnextPageToken=AValue) then exit;
  1256. FnextPageToken:=AValue;
  1257. MarkPropertyChanged(AIndex);
  1258. end;
  1259. Procedure TListLogEntriesResponse.SetprojectIdErrors(AIndex : Integer; const AValue : TListLogEntriesResponseTypeprojectIdErrors);
  1260. begin
  1261. If (FprojectIdErrors=AValue) then exit;
  1262. FprojectIdErrors:=AValue;
  1263. MarkPropertyChanged(AIndex);
  1264. end;
  1265. //2.6.4. bug workaround
  1266. {$IFDEF VER2_6}
  1267. Procedure TListLogEntriesResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1268. begin
  1269. Case AName of
  1270. 'entries' : SetLength(Fentries,ALength);
  1271. else
  1272. Inherited SetArrayLength(AName,ALength);
  1273. end;
  1274. end;
  1275. {$ENDIF VER2_6}
  1276. { --------------------------------------------------------------------
  1277. TStatusTypedetailsItem
  1278. --------------------------------------------------------------------}
  1279. Class Function TStatusTypedetailsItem.AllowAdditionalProperties : Boolean;
  1280. begin
  1281. Result:=True;
  1282. end;
  1283. { --------------------------------------------------------------------
  1284. TStatus
  1285. --------------------------------------------------------------------}
  1286. Procedure TStatus.Setcode(AIndex : Integer; const AValue : integer);
  1287. begin
  1288. If (Fcode=AValue) then exit;
  1289. Fcode:=AValue;
  1290. MarkPropertyChanged(AIndex);
  1291. end;
  1292. Procedure TStatus.Setmessage(AIndex : Integer; const AValue : String);
  1293. begin
  1294. If (Fmessage=AValue) then exit;
  1295. Fmessage:=AValue;
  1296. MarkPropertyChanged(AIndex);
  1297. end;
  1298. Procedure TStatus.Setdetails(AIndex : Integer; const AValue : TStatusTypedetailsArray);
  1299. begin
  1300. If (Fdetails=AValue) then exit;
  1301. Fdetails:=AValue;
  1302. MarkPropertyChanged(AIndex);
  1303. end;
  1304. //2.6.4. bug workaround
  1305. {$IFDEF VER2_6}
  1306. Procedure TStatus.SetArrayLength(Const AName : String; ALength : Longint);
  1307. begin
  1308. Case AName of
  1309. 'details' : SetLength(Fdetails,ALength);
  1310. else
  1311. Inherited SetArrayLength(AName,ALength);
  1312. end;
  1313. end;
  1314. {$ENDIF VER2_6}
  1315. { --------------------------------------------------------------------
  1316. TListMonitoredResourceDescriptorsResponse
  1317. --------------------------------------------------------------------}
  1318. Procedure TListMonitoredResourceDescriptorsResponse.SetresourceDescriptors(AIndex : Integer; const AValue : TListMonitoredResourceDescriptorsResponseTyperesourceDescriptorsArray);
  1319. begin
  1320. If (FresourceDescriptors=AValue) then exit;
  1321. FresourceDescriptors:=AValue;
  1322. MarkPropertyChanged(AIndex);
  1323. end;
  1324. Procedure TListMonitoredResourceDescriptorsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  1325. begin
  1326. If (FnextPageToken=AValue) then exit;
  1327. FnextPageToken:=AValue;
  1328. MarkPropertyChanged(AIndex);
  1329. end;
  1330. //2.6.4. bug workaround
  1331. {$IFDEF VER2_6}
  1332. Procedure TListMonitoredResourceDescriptorsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1333. begin
  1334. Case AName of
  1335. 'resourcedescriptors' : SetLength(FresourceDescriptors,ALength);
  1336. else
  1337. Inherited SetArrayLength(AName,ALength);
  1338. end;
  1339. end;
  1340. {$ENDIF VER2_6}
  1341. { --------------------------------------------------------------------
  1342. TMonitoredResourceDescriptor
  1343. --------------------------------------------------------------------}
  1344. Procedure TMonitoredResourceDescriptor.Setname(AIndex : Integer; const AValue : String);
  1345. begin
  1346. If (Fname=AValue) then exit;
  1347. Fname:=AValue;
  1348. MarkPropertyChanged(AIndex);
  1349. end;
  1350. Procedure TMonitoredResourceDescriptor.Set_type(AIndex : Integer; const AValue : String);
  1351. begin
  1352. If (F_type=AValue) then exit;
  1353. F_type:=AValue;
  1354. MarkPropertyChanged(AIndex);
  1355. end;
  1356. Procedure TMonitoredResourceDescriptor.SetdisplayName(AIndex : Integer; const AValue : String);
  1357. begin
  1358. If (FdisplayName=AValue) then exit;
  1359. FdisplayName:=AValue;
  1360. MarkPropertyChanged(AIndex);
  1361. end;
  1362. Procedure TMonitoredResourceDescriptor.Setdescription(AIndex : Integer; const AValue : String);
  1363. begin
  1364. If (Fdescription=AValue) then exit;
  1365. Fdescription:=AValue;
  1366. MarkPropertyChanged(AIndex);
  1367. end;
  1368. Procedure TMonitoredResourceDescriptor.Setlabels(AIndex : Integer; const AValue : TMonitoredResourceDescriptorTypelabelsArray);
  1369. begin
  1370. If (Flabels=AValue) then exit;
  1371. Flabels:=AValue;
  1372. MarkPropertyChanged(AIndex);
  1373. end;
  1374. Class Function TMonitoredResourceDescriptor.ExportPropertyName(Const AName : String) :String;
  1375. begin
  1376. Case AName of
  1377. '_type' : Result:='type';
  1378. else
  1379. Result:=Inherited ExportPropertyName(AName);
  1380. end;
  1381. end;
  1382. //2.6.4. bug workaround
  1383. {$IFDEF VER2_6}
  1384. Procedure TMonitoredResourceDescriptor.SetArrayLength(Const AName : String; ALength : Longint);
  1385. begin
  1386. Case AName of
  1387. 'labels' : SetLength(Flabels,ALength);
  1388. else
  1389. Inherited SetArrayLength(AName,ALength);
  1390. end;
  1391. end;
  1392. {$ENDIF VER2_6}
  1393. { --------------------------------------------------------------------
  1394. TLabelDescriptor
  1395. --------------------------------------------------------------------}
  1396. Procedure TLabelDescriptor.Setkey(AIndex : Integer; const AValue : String);
  1397. begin
  1398. If (Fkey=AValue) then exit;
  1399. Fkey:=AValue;
  1400. MarkPropertyChanged(AIndex);
  1401. end;
  1402. Procedure TLabelDescriptor.SetvalueType(AIndex : Integer; const AValue : String);
  1403. begin
  1404. If (FvalueType=AValue) then exit;
  1405. FvalueType:=AValue;
  1406. MarkPropertyChanged(AIndex);
  1407. end;
  1408. Procedure TLabelDescriptor.Setdescription(AIndex : Integer; const AValue : String);
  1409. begin
  1410. If (Fdescription=AValue) then exit;
  1411. Fdescription:=AValue;
  1412. MarkPropertyChanged(AIndex);
  1413. end;
  1414. { --------------------------------------------------------------------
  1415. TListSinksResponse
  1416. --------------------------------------------------------------------}
  1417. Procedure TListSinksResponse.Setsinks(AIndex : Integer; const AValue : TListSinksResponseTypesinksArray);
  1418. begin
  1419. If (Fsinks=AValue) then exit;
  1420. Fsinks:=AValue;
  1421. MarkPropertyChanged(AIndex);
  1422. end;
  1423. Procedure TListSinksResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  1424. begin
  1425. If (FnextPageToken=AValue) then exit;
  1426. FnextPageToken:=AValue;
  1427. MarkPropertyChanged(AIndex);
  1428. end;
  1429. //2.6.4. bug workaround
  1430. {$IFDEF VER2_6}
  1431. Procedure TListSinksResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1432. begin
  1433. Case AName of
  1434. 'sinks' : SetLength(Fsinks,ALength);
  1435. else
  1436. Inherited SetArrayLength(AName,ALength);
  1437. end;
  1438. end;
  1439. {$ENDIF VER2_6}
  1440. { --------------------------------------------------------------------
  1441. TLogSink
  1442. --------------------------------------------------------------------}
  1443. Procedure TLogSink.Setname(AIndex : Integer; const AValue : String);
  1444. begin
  1445. If (Fname=AValue) then exit;
  1446. Fname:=AValue;
  1447. MarkPropertyChanged(AIndex);
  1448. end;
  1449. Procedure TLogSink.Setdestination(AIndex : Integer; const AValue : String);
  1450. begin
  1451. If (Fdestination=AValue) then exit;
  1452. Fdestination:=AValue;
  1453. MarkPropertyChanged(AIndex);
  1454. end;
  1455. Procedure TLogSink.Setfilter(AIndex : Integer; const AValue : String);
  1456. begin
  1457. If (Ffilter=AValue) then exit;
  1458. Ffilter:=AValue;
  1459. MarkPropertyChanged(AIndex);
  1460. end;
  1461. Procedure TLogSink.SetoutputVersionFormat(AIndex : Integer; const AValue : String);
  1462. begin
  1463. If (FoutputVersionFormat=AValue) then exit;
  1464. FoutputVersionFormat:=AValue;
  1465. MarkPropertyChanged(AIndex);
  1466. end;
  1467. { --------------------------------------------------------------------
  1468. TListLogMetricsResponse
  1469. --------------------------------------------------------------------}
  1470. Procedure TListLogMetricsResponse.Setmetrics(AIndex : Integer; const AValue : TListLogMetricsResponseTypemetricsArray);
  1471. begin
  1472. If (Fmetrics=AValue) then exit;
  1473. Fmetrics:=AValue;
  1474. MarkPropertyChanged(AIndex);
  1475. end;
  1476. Procedure TListLogMetricsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  1477. begin
  1478. If (FnextPageToken=AValue) then exit;
  1479. FnextPageToken:=AValue;
  1480. MarkPropertyChanged(AIndex);
  1481. end;
  1482. //2.6.4. bug workaround
  1483. {$IFDEF VER2_6}
  1484. Procedure TListLogMetricsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1485. begin
  1486. Case AName of
  1487. 'metrics' : SetLength(Fmetrics,ALength);
  1488. else
  1489. Inherited SetArrayLength(AName,ALength);
  1490. end;
  1491. end;
  1492. {$ENDIF VER2_6}
  1493. { --------------------------------------------------------------------
  1494. TLogMetric
  1495. --------------------------------------------------------------------}
  1496. Procedure TLogMetric.Setname(AIndex : Integer; const AValue : String);
  1497. begin
  1498. If (Fname=AValue) then exit;
  1499. Fname:=AValue;
  1500. MarkPropertyChanged(AIndex);
  1501. end;
  1502. Procedure TLogMetric.Setdescription(AIndex : Integer; const AValue : String);
  1503. begin
  1504. If (Fdescription=AValue) then exit;
  1505. Fdescription:=AValue;
  1506. MarkPropertyChanged(AIndex);
  1507. end;
  1508. Procedure TLogMetric.Setfilter(AIndex : Integer; const AValue : String);
  1509. begin
  1510. If (Ffilter=AValue) then exit;
  1511. Ffilter:=AValue;
  1512. MarkPropertyChanged(AIndex);
  1513. end;
  1514. { --------------------------------------------------------------------
  1515. TRequestLog
  1516. --------------------------------------------------------------------}
  1517. Procedure TRequestLog.SetappId(AIndex : Integer; const AValue : String);
  1518. begin
  1519. If (FappId=AValue) then exit;
  1520. FappId:=AValue;
  1521. MarkPropertyChanged(AIndex);
  1522. end;
  1523. Procedure TRequestLog.SetmoduleId(AIndex : Integer; const AValue : String);
  1524. begin
  1525. If (FmoduleId=AValue) then exit;
  1526. FmoduleId:=AValue;
  1527. MarkPropertyChanged(AIndex);
  1528. end;
  1529. Procedure TRequestLog.SetversionId(AIndex : Integer; const AValue : String);
  1530. begin
  1531. If (FversionId=AValue) then exit;
  1532. FversionId:=AValue;
  1533. MarkPropertyChanged(AIndex);
  1534. end;
  1535. Procedure TRequestLog.SetrequestId(AIndex : Integer; const AValue : String);
  1536. begin
  1537. If (FrequestId=AValue) then exit;
  1538. FrequestId:=AValue;
  1539. MarkPropertyChanged(AIndex);
  1540. end;
  1541. Procedure TRequestLog.Setip(AIndex : Integer; const AValue : String);
  1542. begin
  1543. If (Fip=AValue) then exit;
  1544. Fip:=AValue;
  1545. MarkPropertyChanged(AIndex);
  1546. end;
  1547. Procedure TRequestLog.SetstartTime(AIndex : Integer; const AValue : String);
  1548. begin
  1549. If (FstartTime=AValue) then exit;
  1550. FstartTime:=AValue;
  1551. MarkPropertyChanged(AIndex);
  1552. end;
  1553. Procedure TRequestLog.SetendTime(AIndex : Integer; const AValue : String);
  1554. begin
  1555. If (FendTime=AValue) then exit;
  1556. FendTime:=AValue;
  1557. MarkPropertyChanged(AIndex);
  1558. end;
  1559. Procedure TRequestLog.Setlatency(AIndex : Integer; const AValue : String);
  1560. begin
  1561. If (Flatency=AValue) then exit;
  1562. Flatency:=AValue;
  1563. MarkPropertyChanged(AIndex);
  1564. end;
  1565. Procedure TRequestLog.SetmegaCycles(AIndex : Integer; const AValue : String);
  1566. begin
  1567. If (FmegaCycles=AValue) then exit;
  1568. FmegaCycles:=AValue;
  1569. MarkPropertyChanged(AIndex);
  1570. end;
  1571. Procedure TRequestLog.Setmethod(AIndex : Integer; const AValue : String);
  1572. begin
  1573. If (Fmethod=AValue) then exit;
  1574. Fmethod:=AValue;
  1575. MarkPropertyChanged(AIndex);
  1576. end;
  1577. Procedure TRequestLog.Setresource(AIndex : Integer; const AValue : String);
  1578. begin
  1579. If (Fresource=AValue) then exit;
  1580. Fresource:=AValue;
  1581. MarkPropertyChanged(AIndex);
  1582. end;
  1583. Procedure TRequestLog.SethttpVersion(AIndex : Integer; const AValue : String);
  1584. begin
  1585. If (FhttpVersion=AValue) then exit;
  1586. FhttpVersion:=AValue;
  1587. MarkPropertyChanged(AIndex);
  1588. end;
  1589. Procedure TRequestLog.Setstatus(AIndex : Integer; const AValue : integer);
  1590. begin
  1591. If (Fstatus=AValue) then exit;
  1592. Fstatus:=AValue;
  1593. MarkPropertyChanged(AIndex);
  1594. end;
  1595. Procedure TRequestLog.SetresponseSize(AIndex : Integer; const AValue : String);
  1596. begin
  1597. If (FresponseSize=AValue) then exit;
  1598. FresponseSize:=AValue;
  1599. MarkPropertyChanged(AIndex);
  1600. end;
  1601. Procedure TRequestLog.Setreferrer(AIndex : Integer; const AValue : String);
  1602. begin
  1603. If (Freferrer=AValue) then exit;
  1604. Freferrer:=AValue;
  1605. MarkPropertyChanged(AIndex);
  1606. end;
  1607. Procedure TRequestLog.SetuserAgent(AIndex : Integer; const AValue : String);
  1608. begin
  1609. If (FuserAgent=AValue) then exit;
  1610. FuserAgent:=AValue;
  1611. MarkPropertyChanged(AIndex);
  1612. end;
  1613. Procedure TRequestLog.Setnickname(AIndex : Integer; const AValue : String);
  1614. begin
  1615. If (Fnickname=AValue) then exit;
  1616. Fnickname:=AValue;
  1617. MarkPropertyChanged(AIndex);
  1618. end;
  1619. Procedure TRequestLog.SeturlMapEntry(AIndex : Integer; const AValue : String);
  1620. begin
  1621. If (FurlMapEntry=AValue) then exit;
  1622. FurlMapEntry:=AValue;
  1623. MarkPropertyChanged(AIndex);
  1624. end;
  1625. Procedure TRequestLog.Sethost(AIndex : Integer; const AValue : String);
  1626. begin
  1627. If (Fhost=AValue) then exit;
  1628. Fhost:=AValue;
  1629. MarkPropertyChanged(AIndex);
  1630. end;
  1631. Procedure TRequestLog.Setcost(AIndex : Integer; const AValue : double);
  1632. begin
  1633. If (Fcost=AValue) then exit;
  1634. Fcost:=AValue;
  1635. MarkPropertyChanged(AIndex);
  1636. end;
  1637. Procedure TRequestLog.SettaskQueueName(AIndex : Integer; const AValue : String);
  1638. begin
  1639. If (FtaskQueueName=AValue) then exit;
  1640. FtaskQueueName:=AValue;
  1641. MarkPropertyChanged(AIndex);
  1642. end;
  1643. Procedure TRequestLog.SettaskName(AIndex : Integer; const AValue : String);
  1644. begin
  1645. If (FtaskName=AValue) then exit;
  1646. FtaskName:=AValue;
  1647. MarkPropertyChanged(AIndex);
  1648. end;
  1649. Procedure TRequestLog.SetwasLoadingRequest(AIndex : Integer; const AValue : boolean);
  1650. begin
  1651. If (FwasLoadingRequest=AValue) then exit;
  1652. FwasLoadingRequest:=AValue;
  1653. MarkPropertyChanged(AIndex);
  1654. end;
  1655. Procedure TRequestLog.SetpendingTime(AIndex : Integer; const AValue : String);
  1656. begin
  1657. If (FpendingTime=AValue) then exit;
  1658. FpendingTime:=AValue;
  1659. MarkPropertyChanged(AIndex);
  1660. end;
  1661. Procedure TRequestLog.SetinstanceIndex(AIndex : Integer; const AValue : integer);
  1662. begin
  1663. If (FinstanceIndex=AValue) then exit;
  1664. FinstanceIndex:=AValue;
  1665. MarkPropertyChanged(AIndex);
  1666. end;
  1667. Procedure TRequestLog.Setfinished(AIndex : Integer; const AValue : boolean);
  1668. begin
  1669. If (Ffinished=AValue) then exit;
  1670. Ffinished:=AValue;
  1671. MarkPropertyChanged(AIndex);
  1672. end;
  1673. Procedure TRequestLog.Setfirst(AIndex : Integer; const AValue : boolean);
  1674. begin
  1675. If (Ffirst=AValue) then exit;
  1676. Ffirst:=AValue;
  1677. MarkPropertyChanged(AIndex);
  1678. end;
  1679. Procedure TRequestLog.SetinstanceId(AIndex : Integer; const AValue : String);
  1680. begin
  1681. If (FinstanceId=AValue) then exit;
  1682. FinstanceId:=AValue;
  1683. MarkPropertyChanged(AIndex);
  1684. end;
  1685. Procedure TRequestLog.Setline(AIndex : Integer; const AValue : TRequestLogTypelineArray);
  1686. begin
  1687. If (Fline=AValue) then exit;
  1688. Fline:=AValue;
  1689. MarkPropertyChanged(AIndex);
  1690. end;
  1691. Procedure TRequestLog.SetappEngineRelease(AIndex : Integer; const AValue : String);
  1692. begin
  1693. If (FappEngineRelease=AValue) then exit;
  1694. FappEngineRelease:=AValue;
  1695. MarkPropertyChanged(AIndex);
  1696. end;
  1697. Procedure TRequestLog.SettraceId(AIndex : Integer; const AValue : String);
  1698. begin
  1699. If (FtraceId=AValue) then exit;
  1700. FtraceId:=AValue;
  1701. MarkPropertyChanged(AIndex);
  1702. end;
  1703. Procedure TRequestLog.SetsourceReference(AIndex : Integer; const AValue : TRequestLogTypesourceReferenceArray);
  1704. begin
  1705. If (FsourceReference=AValue) then exit;
  1706. FsourceReference:=AValue;
  1707. MarkPropertyChanged(AIndex);
  1708. end;
  1709. //2.6.4. bug workaround
  1710. {$IFDEF VER2_6}
  1711. Procedure TRequestLog.SetArrayLength(Const AName : String; ALength : Longint);
  1712. begin
  1713. Case AName of
  1714. 'line' : SetLength(Fline,ALength);
  1715. 'sourcereference' : SetLength(FsourceReference,ALength);
  1716. else
  1717. Inherited SetArrayLength(AName,ALength);
  1718. end;
  1719. end;
  1720. {$ENDIF VER2_6}
  1721. { --------------------------------------------------------------------
  1722. TLogLine
  1723. --------------------------------------------------------------------}
  1724. Procedure TLogLine.Settime(AIndex : Integer; const AValue : String);
  1725. begin
  1726. If (Ftime=AValue) then exit;
  1727. Ftime:=AValue;
  1728. MarkPropertyChanged(AIndex);
  1729. end;
  1730. Procedure TLogLine.Setseverity(AIndex : Integer; const AValue : String);
  1731. begin
  1732. If (Fseverity=AValue) then exit;
  1733. Fseverity:=AValue;
  1734. MarkPropertyChanged(AIndex);
  1735. end;
  1736. Procedure TLogLine.SetlogMessage(AIndex : Integer; const AValue : String);
  1737. begin
  1738. If (FlogMessage=AValue) then exit;
  1739. FlogMessage:=AValue;
  1740. MarkPropertyChanged(AIndex);
  1741. end;
  1742. Procedure TLogLine.SetsourceLocation(AIndex : Integer; const AValue : TSourceLocation);
  1743. begin
  1744. If (FsourceLocation=AValue) then exit;
  1745. FsourceLocation:=AValue;
  1746. MarkPropertyChanged(AIndex);
  1747. end;
  1748. { --------------------------------------------------------------------
  1749. TSourceLocation
  1750. --------------------------------------------------------------------}
  1751. Procedure TSourceLocation.Set_file(AIndex : Integer; const AValue : String);
  1752. begin
  1753. If (F_file=AValue) then exit;
  1754. F_file:=AValue;
  1755. MarkPropertyChanged(AIndex);
  1756. end;
  1757. Procedure TSourceLocation.Setline(AIndex : Integer; const AValue : String);
  1758. begin
  1759. If (Fline=AValue) then exit;
  1760. Fline:=AValue;
  1761. MarkPropertyChanged(AIndex);
  1762. end;
  1763. Procedure TSourceLocation.SetfunctionName(AIndex : Integer; const AValue : String);
  1764. begin
  1765. If (FfunctionName=AValue) then exit;
  1766. FfunctionName:=AValue;
  1767. MarkPropertyChanged(AIndex);
  1768. end;
  1769. Class Function TSourceLocation.ExportPropertyName(Const AName : String) :String;
  1770. begin
  1771. Case AName of
  1772. '_file' : Result:='file';
  1773. else
  1774. Result:=Inherited ExportPropertyName(AName);
  1775. end;
  1776. end;
  1777. { --------------------------------------------------------------------
  1778. TSourceReference
  1779. --------------------------------------------------------------------}
  1780. Procedure TSourceReference.Setrepository(AIndex : Integer; const AValue : String);
  1781. begin
  1782. If (Frepository=AValue) then exit;
  1783. Frepository:=AValue;
  1784. MarkPropertyChanged(AIndex);
  1785. end;
  1786. Procedure TSourceReference.SetrevisionId(AIndex : Integer; const AValue : String);
  1787. begin
  1788. If (FrevisionId=AValue) then exit;
  1789. FrevisionId:=AValue;
  1790. MarkPropertyChanged(AIndex);
  1791. end;
  1792. { --------------------------------------------------------------------
  1793. TProjectsLogsResource
  1794. --------------------------------------------------------------------}
  1795. Class Function TProjectsLogsResource.ResourceName : String;
  1796. begin
  1797. Result:='logs';
  1798. end;
  1799. Class Function TProjectsLogsResource.DefaultAPI : TGoogleAPIClass;
  1800. begin
  1801. Result:=TloggingAPI;
  1802. end;
  1803. Function TProjectsLogsResource.Delete(logName: string) : TEmpty;
  1804. Const
  1805. _HTTPMethod = 'DELETE';
  1806. _Path = 'v2beta1/{+logName}';
  1807. _Methodid = 'logging.projects.logs.delete';
  1808. Var
  1809. _P : String;
  1810. begin
  1811. _P:=SubstitutePath(_Path,['logName',logName]);
  1812. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TEmpty) as TEmpty;
  1813. end;
  1814. { --------------------------------------------------------------------
  1815. TProjectsSinksResource
  1816. --------------------------------------------------------------------}
  1817. Class Function TProjectsSinksResource.ResourceName : String;
  1818. begin
  1819. Result:='sinks';
  1820. end;
  1821. Class Function TProjectsSinksResource.DefaultAPI : TGoogleAPIClass;
  1822. begin
  1823. Result:=TloggingAPI;
  1824. end;
  1825. Function TProjectsSinksResource.List(projectName: string; AQuery : string = '') : TListSinksResponse;
  1826. Const
  1827. _HTTPMethod = 'GET';
  1828. _Path = 'v2beta1/{+projectName}/sinks';
  1829. _Methodid = 'logging.projects.sinks.list';
  1830. Var
  1831. _P : String;
  1832. begin
  1833. _P:=SubstitutePath(_Path,['projectName',projectName]);
  1834. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListSinksResponse) as TListSinksResponse;
  1835. end;
  1836. Function TProjectsSinksResource.List(projectName: string; AQuery : TProjectsSinkslistOptions) : TListSinksResponse;
  1837. Var
  1838. _Q : String;
  1839. begin
  1840. _Q:='';
  1841. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1842. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  1843. Result:=List(projectName,_Q);
  1844. end;
  1845. Function TProjectsSinksResource.Get(sinkName: string) : TLogSink;
  1846. Const
  1847. _HTTPMethod = 'GET';
  1848. _Path = 'v2beta1/{+sinkName}';
  1849. _Methodid = 'logging.projects.sinks.get';
  1850. Var
  1851. _P : String;
  1852. begin
  1853. _P:=SubstitutePath(_Path,['sinkName',sinkName]);
  1854. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TLogSink) as TLogSink;
  1855. end;
  1856. Function TProjectsSinksResource.Create(projectName: string; aLogSink : TLogSink) : TLogSink;
  1857. Const
  1858. _HTTPMethod = 'POST';
  1859. _Path = 'v2beta1/{+projectName}/sinks';
  1860. _Methodid = 'logging.projects.sinks.create';
  1861. Var
  1862. _P : String;
  1863. begin
  1864. _P:=SubstitutePath(_Path,['projectName',projectName]);
  1865. Result:=ServiceCall(_HTTPMethod,_P,'',aLogSink,TLogSink) as TLogSink;
  1866. end;
  1867. Function TProjectsSinksResource.Update(sinkName: string; aLogSink : TLogSink) : TLogSink;
  1868. Const
  1869. _HTTPMethod = 'PUT';
  1870. _Path = 'v2beta1/{+sinkName}';
  1871. _Methodid = 'logging.projects.sinks.update';
  1872. Var
  1873. _P : String;
  1874. begin
  1875. _P:=SubstitutePath(_Path,['sinkName',sinkName]);
  1876. Result:=ServiceCall(_HTTPMethod,_P,'',aLogSink,TLogSink) as TLogSink;
  1877. end;
  1878. Function TProjectsSinksResource.Delete(sinkName: string) : TEmpty;
  1879. Const
  1880. _HTTPMethod = 'DELETE';
  1881. _Path = 'v2beta1/{+sinkName}';
  1882. _Methodid = 'logging.projects.sinks.delete';
  1883. Var
  1884. _P : String;
  1885. begin
  1886. _P:=SubstitutePath(_Path,['sinkName',sinkName]);
  1887. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TEmpty) as TEmpty;
  1888. end;
  1889. { --------------------------------------------------------------------
  1890. TProjectsMetricsResource
  1891. --------------------------------------------------------------------}
  1892. Class Function TProjectsMetricsResource.ResourceName : String;
  1893. begin
  1894. Result:='metrics';
  1895. end;
  1896. Class Function TProjectsMetricsResource.DefaultAPI : TGoogleAPIClass;
  1897. begin
  1898. Result:=TloggingAPI;
  1899. end;
  1900. Function TProjectsMetricsResource.List(projectName: string; AQuery : string = '') : TListLogMetricsResponse;
  1901. Const
  1902. _HTTPMethod = 'GET';
  1903. _Path = 'v2beta1/{+projectName}/metrics';
  1904. _Methodid = 'logging.projects.metrics.list';
  1905. Var
  1906. _P : String;
  1907. begin
  1908. _P:=SubstitutePath(_Path,['projectName',projectName]);
  1909. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListLogMetricsResponse) as TListLogMetricsResponse;
  1910. end;
  1911. Function TProjectsMetricsResource.List(projectName: string; AQuery : TProjectsMetricslistOptions) : TListLogMetricsResponse;
  1912. Var
  1913. _Q : String;
  1914. begin
  1915. _Q:='';
  1916. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1917. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  1918. Result:=List(projectName,_Q);
  1919. end;
  1920. Function TProjectsMetricsResource.Get(metricName: string) : TLogMetric;
  1921. Const
  1922. _HTTPMethod = 'GET';
  1923. _Path = 'v2beta1/{+metricName}';
  1924. _Methodid = 'logging.projects.metrics.get';
  1925. Var
  1926. _P : String;
  1927. begin
  1928. _P:=SubstitutePath(_Path,['metricName',metricName]);
  1929. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TLogMetric) as TLogMetric;
  1930. end;
  1931. Function TProjectsMetricsResource.Create(projectName: string; aLogMetric : TLogMetric) : TLogMetric;
  1932. Const
  1933. _HTTPMethod = 'POST';
  1934. _Path = 'v2beta1/{+projectName}/metrics';
  1935. _Methodid = 'logging.projects.metrics.create';
  1936. Var
  1937. _P : String;
  1938. begin
  1939. _P:=SubstitutePath(_Path,['projectName',projectName]);
  1940. Result:=ServiceCall(_HTTPMethod,_P,'',aLogMetric,TLogMetric) as TLogMetric;
  1941. end;
  1942. Function TProjectsMetricsResource.Update(metricName: string; aLogMetric : TLogMetric) : TLogMetric;
  1943. Const
  1944. _HTTPMethod = 'PUT';
  1945. _Path = 'v2beta1/{+metricName}';
  1946. _Methodid = 'logging.projects.metrics.update';
  1947. Var
  1948. _P : String;
  1949. begin
  1950. _P:=SubstitutePath(_Path,['metricName',metricName]);
  1951. Result:=ServiceCall(_HTTPMethod,_P,'',aLogMetric,TLogMetric) as TLogMetric;
  1952. end;
  1953. Function TProjectsMetricsResource.Delete(metricName: string) : TEmpty;
  1954. Const
  1955. _HTTPMethod = 'DELETE';
  1956. _Path = 'v2beta1/{+metricName}';
  1957. _Methodid = 'logging.projects.metrics.delete';
  1958. Var
  1959. _P : String;
  1960. begin
  1961. _P:=SubstitutePath(_Path,['metricName',metricName]);
  1962. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TEmpty) as TEmpty;
  1963. end;
  1964. { --------------------------------------------------------------------
  1965. TProjectsResource
  1966. --------------------------------------------------------------------}
  1967. Class Function TProjectsResource.ResourceName : String;
  1968. begin
  1969. Result:='projects';
  1970. end;
  1971. Class Function TProjectsResource.DefaultAPI : TGoogleAPIClass;
  1972. begin
  1973. Result:=TloggingAPI;
  1974. end;
  1975. Function TProjectsResource.GetLogsInstance : TProjectsLogsResource;
  1976. begin
  1977. if (FLogsInstance=Nil) then
  1978. FLogsInstance:=CreateLogsResource;
  1979. Result:=FLogsInstance;
  1980. end;
  1981. Function TProjectsResource.CreateLogsResource : TProjectsLogsResource;
  1982. begin
  1983. Result:=CreateLogsResource(Self);
  1984. end;
  1985. Function TProjectsResource.CreateLogsResource(AOwner : TComponent) : TProjectsLogsResource;
  1986. begin
  1987. Result:=TProjectsLogsResource.Create(AOwner);
  1988. Result.API:=Self.API;
  1989. end;
  1990. Function TProjectsResource.GetSinksInstance : TProjectsSinksResource;
  1991. begin
  1992. if (FSinksInstance=Nil) then
  1993. FSinksInstance:=CreateSinksResource;
  1994. Result:=FSinksInstance;
  1995. end;
  1996. Function TProjectsResource.CreateSinksResource : TProjectsSinksResource;
  1997. begin
  1998. Result:=CreateSinksResource(Self);
  1999. end;
  2000. Function TProjectsResource.CreateSinksResource(AOwner : TComponent) : TProjectsSinksResource;
  2001. begin
  2002. Result:=TProjectsSinksResource.Create(AOwner);
  2003. Result.API:=Self.API;
  2004. end;
  2005. Function TProjectsResource.GetMetricsInstance : TProjectsMetricsResource;
  2006. begin
  2007. if (FMetricsInstance=Nil) then
  2008. FMetricsInstance:=CreateMetricsResource;
  2009. Result:=FMetricsInstance;
  2010. end;
  2011. Function TProjectsResource.CreateMetricsResource : TProjectsMetricsResource;
  2012. begin
  2013. Result:=CreateMetricsResource(Self);
  2014. end;
  2015. Function TProjectsResource.CreateMetricsResource(AOwner : TComponent) : TProjectsMetricsResource;
  2016. begin
  2017. Result:=TProjectsMetricsResource.Create(AOwner);
  2018. Result.API:=Self.API;
  2019. end;
  2020. { --------------------------------------------------------------------
  2021. TEntriesResource
  2022. --------------------------------------------------------------------}
  2023. Class Function TEntriesResource.ResourceName : String;
  2024. begin
  2025. Result:='entries';
  2026. end;
  2027. Class Function TEntriesResource.DefaultAPI : TGoogleAPIClass;
  2028. begin
  2029. Result:=TloggingAPI;
  2030. end;
  2031. Function TEntriesResource.Write(aWriteLogEntriesRequest : TWriteLogEntriesRequest) : TWriteLogEntriesResponse;
  2032. Const
  2033. _HTTPMethod = 'POST';
  2034. _Path = 'v2beta1/entries:write';
  2035. _Methodid = 'logging.entries.write';
  2036. begin
  2037. Result:=ServiceCall(_HTTPMethod,_Path,'',aWriteLogEntriesRequest,TWriteLogEntriesResponse) as TWriteLogEntriesResponse;
  2038. end;
  2039. Function TEntriesResource.List(aListLogEntriesRequest : TListLogEntriesRequest) : TListLogEntriesResponse;
  2040. Const
  2041. _HTTPMethod = 'POST';
  2042. _Path = 'v2beta1/entries:list';
  2043. _Methodid = 'logging.entries.list';
  2044. begin
  2045. Result:=ServiceCall(_HTTPMethod,_Path,'',aListLogEntriesRequest,TListLogEntriesResponse) as TListLogEntriesResponse;
  2046. end;
  2047. { --------------------------------------------------------------------
  2048. TMonitoredResourceDescriptorsResource
  2049. --------------------------------------------------------------------}
  2050. Class Function TMonitoredResourceDescriptorsResource.ResourceName : String;
  2051. begin
  2052. Result:='monitoredResourceDescriptors';
  2053. end;
  2054. Class Function TMonitoredResourceDescriptorsResource.DefaultAPI : TGoogleAPIClass;
  2055. begin
  2056. Result:=TloggingAPI;
  2057. end;
  2058. Function TMonitoredResourceDescriptorsResource.List(AQuery : string = '') : TListMonitoredResourceDescriptorsResponse;
  2059. Const
  2060. _HTTPMethod = 'GET';
  2061. _Path = 'v2beta1/monitoredResourceDescriptors';
  2062. _Methodid = 'logging.monitoredResourceDescriptors.list';
  2063. begin
  2064. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TListMonitoredResourceDescriptorsResponse) as TListMonitoredResourceDescriptorsResponse;
  2065. end;
  2066. Function TMonitoredResourceDescriptorsResource.List(AQuery : TMonitoredResourceDescriptorslistOptions) : TListMonitoredResourceDescriptorsResponse;
  2067. Var
  2068. _Q : String;
  2069. begin
  2070. _Q:='';
  2071. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  2072. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  2073. Result:=List(_Q);
  2074. end;
  2075. { --------------------------------------------------------------------
  2076. TLoggingAPI
  2077. --------------------------------------------------------------------}
  2078. Class Function TLoggingAPI.APIName : String;
  2079. begin
  2080. Result:='logging';
  2081. end;
  2082. Class Function TLoggingAPI.APIVersion : String;
  2083. begin
  2084. Result:='v2beta1';
  2085. end;
  2086. Class Function TLoggingAPI.APIRevision : String;
  2087. begin
  2088. Result:='20160322';
  2089. end;
  2090. Class Function TLoggingAPI.APIID : String;
  2091. begin
  2092. Result:='logging:v2beta1';
  2093. end;
  2094. Class Function TLoggingAPI.APITitle : String;
  2095. begin
  2096. Result:='Google Cloud Logging API';
  2097. end;
  2098. Class Function TLoggingAPI.APIDescription : String;
  2099. begin
  2100. Result:='Writes log entries and manages your logs, log sinks, and logs-based metrics.';
  2101. end;
  2102. Class Function TLoggingAPI.APIOwnerDomain : String;
  2103. begin
  2104. Result:='google.com';
  2105. end;
  2106. Class Function TLoggingAPI.APIOwnerName : String;
  2107. begin
  2108. Result:='Google';
  2109. end;
  2110. Class Function TLoggingAPI.APIIcon16 : String;
  2111. begin
  2112. Result:='http://www.google.com/images/icons/product/search-16.gif';
  2113. end;
  2114. Class Function TLoggingAPI.APIIcon32 : String;
  2115. begin
  2116. Result:='http://www.google.com/images/icons/product/search-32.gif';
  2117. end;
  2118. Class Function TLoggingAPI.APIdocumentationLink : String;
  2119. begin
  2120. Result:='https://cloud.google.com/logging/docs/';
  2121. end;
  2122. Class Function TLoggingAPI.APIrootUrl : string;
  2123. begin
  2124. Result:='https://logging.googleapis.com/';
  2125. end;
  2126. Class Function TLoggingAPI.APIbasePath : string;
  2127. begin
  2128. Result:='';
  2129. end;
  2130. Class Function TLoggingAPI.APIbaseURL : String;
  2131. begin
  2132. Result:='https://logging.googleapis.com/';
  2133. end;
  2134. Class Function TLoggingAPI.APIProtocol : string;
  2135. begin
  2136. Result:='rest';
  2137. end;
  2138. Class Function TLoggingAPI.APIservicePath : string;
  2139. begin
  2140. Result:='';
  2141. end;
  2142. Class Function TLoggingAPI.APIbatchPath : String;
  2143. begin
  2144. Result:='batch';
  2145. end;
  2146. Class Function TLoggingAPI.APIAuthScopes : TScopeInfoArray;
  2147. begin
  2148. SetLength(Result,5);
  2149. Result[0].Name:='https://www.googleapis.com/auth/cloud-platform';
  2150. Result[0].Description:='View and manage your data across Google Cloud Platform services';
  2151. Result[1].Name:='https://www.googleapis.com/auth/cloud-platform.read-only';
  2152. Result[1].Description:='View your data across Google Cloud Platform services';
  2153. Result[2].Name:='https://www.googleapis.com/auth/logging.admin';
  2154. Result[2].Description:='Administrate log data for your projects';
  2155. Result[3].Name:='https://www.googleapis.com/auth/logging.read';
  2156. Result[3].Description:='View log data for your projects';
  2157. Result[4].Name:='https://www.googleapis.com/auth/logging.write';
  2158. Result[4].Description:='Submit log data for your projects';
  2159. end;
  2160. Class Function TLoggingAPI.APINeedsAuth : Boolean;
  2161. begin
  2162. Result:=True;
  2163. end;
  2164. Class Procedure TLoggingAPI.RegisterAPIResources;
  2165. begin
  2166. TEmpty.RegisterObject;
  2167. TWriteLogEntriesRequestTypelabels.RegisterObject;
  2168. TWriteLogEntriesRequest.RegisterObject;
  2169. TMonitoredResourceTypelabels.RegisterObject;
  2170. TMonitoredResource.RegisterObject;
  2171. TLogEntryTypeprotoPayload.RegisterObject;
  2172. TLogEntryTypejsonPayload.RegisterObject;
  2173. TLogEntryTypelabels.RegisterObject;
  2174. TLogEntry.RegisterObject;
  2175. THttpRequest.RegisterObject;
  2176. TLogEntryOperation.RegisterObject;
  2177. TWriteLogEntriesResponse.RegisterObject;
  2178. TListLogEntriesRequest.RegisterObject;
  2179. TListLogEntriesResponseTypeprojectIdErrors.RegisterObject;
  2180. TListLogEntriesResponse.RegisterObject;
  2181. TStatusTypedetailsItem.RegisterObject;
  2182. TStatus.RegisterObject;
  2183. TListMonitoredResourceDescriptorsResponse.RegisterObject;
  2184. TMonitoredResourceDescriptor.RegisterObject;
  2185. TLabelDescriptor.RegisterObject;
  2186. TListSinksResponse.RegisterObject;
  2187. TLogSink.RegisterObject;
  2188. TListLogMetricsResponse.RegisterObject;
  2189. TLogMetric.RegisterObject;
  2190. TRequestLog.RegisterObject;
  2191. TLogLine.RegisterObject;
  2192. TSourceLocation.RegisterObject;
  2193. TSourceReference.RegisterObject;
  2194. end;
  2195. Function TLoggingAPI.GetProjectsLogsInstance : TProjectsLogsResource;
  2196. begin
  2197. if (FProjectsLogsInstance=Nil) then
  2198. FProjectsLogsInstance:=CreateProjectsLogsResource;
  2199. Result:=FProjectsLogsInstance;
  2200. end;
  2201. Function TLoggingAPI.CreateProjectsLogsResource : TProjectsLogsResource;
  2202. begin
  2203. Result:=CreateProjectsLogsResource(Self);
  2204. end;
  2205. Function TLoggingAPI.CreateProjectsLogsResource(AOwner : TComponent) : TProjectsLogsResource;
  2206. begin
  2207. Result:=TProjectsLogsResource.Create(AOwner);
  2208. Result.API:=Self.API;
  2209. end;
  2210. Function TLoggingAPI.GetProjectsSinksInstance : TProjectsSinksResource;
  2211. begin
  2212. if (FProjectsSinksInstance=Nil) then
  2213. FProjectsSinksInstance:=CreateProjectsSinksResource;
  2214. Result:=FProjectsSinksInstance;
  2215. end;
  2216. Function TLoggingAPI.CreateProjectsSinksResource : TProjectsSinksResource;
  2217. begin
  2218. Result:=CreateProjectsSinksResource(Self);
  2219. end;
  2220. Function TLoggingAPI.CreateProjectsSinksResource(AOwner : TComponent) : TProjectsSinksResource;
  2221. begin
  2222. Result:=TProjectsSinksResource.Create(AOwner);
  2223. Result.API:=Self.API;
  2224. end;
  2225. Function TLoggingAPI.GetProjectsMetricsInstance : TProjectsMetricsResource;
  2226. begin
  2227. if (FProjectsMetricsInstance=Nil) then
  2228. FProjectsMetricsInstance:=CreateProjectsMetricsResource;
  2229. Result:=FProjectsMetricsInstance;
  2230. end;
  2231. Function TLoggingAPI.CreateProjectsMetricsResource : TProjectsMetricsResource;
  2232. begin
  2233. Result:=CreateProjectsMetricsResource(Self);
  2234. end;
  2235. Function TLoggingAPI.CreateProjectsMetricsResource(AOwner : TComponent) : TProjectsMetricsResource;
  2236. begin
  2237. Result:=TProjectsMetricsResource.Create(AOwner);
  2238. Result.API:=Self.API;
  2239. end;
  2240. Function TLoggingAPI.GetProjectsInstance : TProjectsResource;
  2241. begin
  2242. if (FProjectsInstance=Nil) then
  2243. FProjectsInstance:=CreateProjectsResource;
  2244. Result:=FProjectsInstance;
  2245. end;
  2246. Function TLoggingAPI.CreateProjectsResource : TProjectsResource;
  2247. begin
  2248. Result:=CreateProjectsResource(Self);
  2249. end;
  2250. Function TLoggingAPI.CreateProjectsResource(AOwner : TComponent) : TProjectsResource;
  2251. begin
  2252. Result:=TProjectsResource.Create(AOwner);
  2253. Result.API:=Self.API;
  2254. end;
  2255. Function TLoggingAPI.GetEntriesInstance : TEntriesResource;
  2256. begin
  2257. if (FEntriesInstance=Nil) then
  2258. FEntriesInstance:=CreateEntriesResource;
  2259. Result:=FEntriesInstance;
  2260. end;
  2261. Function TLoggingAPI.CreateEntriesResource : TEntriesResource;
  2262. begin
  2263. Result:=CreateEntriesResource(Self);
  2264. end;
  2265. Function TLoggingAPI.CreateEntriesResource(AOwner : TComponent) : TEntriesResource;
  2266. begin
  2267. Result:=TEntriesResource.Create(AOwner);
  2268. Result.API:=Self.API;
  2269. end;
  2270. Function TLoggingAPI.GetMonitoredResourceDescriptorsInstance : TMonitoredResourceDescriptorsResource;
  2271. begin
  2272. if (FMonitoredResourceDescriptorsInstance=Nil) then
  2273. FMonitoredResourceDescriptorsInstance:=CreateMonitoredResourceDescriptorsResource;
  2274. Result:=FMonitoredResourceDescriptorsInstance;
  2275. end;
  2276. Function TLoggingAPI.CreateMonitoredResourceDescriptorsResource : TMonitoredResourceDescriptorsResource;
  2277. begin
  2278. Result:=CreateMonitoredResourceDescriptorsResource(Self);
  2279. end;
  2280. Function TLoggingAPI.CreateMonitoredResourceDescriptorsResource(AOwner : TComponent) : TMonitoredResourceDescriptorsResource;
  2281. begin
  2282. Result:=TMonitoredResourceDescriptorsResource.Create(AOwner);
  2283. Result.API:=Self.API;
  2284. end;
  2285. initialization
  2286. TLoggingAPI.RegisterAPI;
  2287. end.