googlelogging.pp 89 KB

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