googlefusiontables.pp 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636
  1. unit googlefusiontables;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TBucket = Class;
  9. TColumn = Class;
  10. TColumnList = Class;
  11. TGeometry = Class;
  12. TImport = Class;
  13. TLine = Class;
  14. TLineStyle = Class;
  15. TPoint = Class;
  16. TPointStyle = Class;
  17. TPolygon = Class;
  18. TPolygonStyle = Class;
  19. TSqlresponse = Class;
  20. TStyleFunction = Class;
  21. TStyleSetting = Class;
  22. TStyleSettingList = Class;
  23. TTable = Class;
  24. TTableList = Class;
  25. TTask = Class;
  26. TTaskList = Class;
  27. TTemplate = Class;
  28. TTemplateList = Class;
  29. TBucketArray = Array of TBucket;
  30. TColumnArray = Array of TColumn;
  31. TColumnListArray = Array of TColumnList;
  32. TGeometryArray = Array of TGeometry;
  33. TImportArray = Array of TImport;
  34. TLineArray = Array of TLine;
  35. TLineStyleArray = Array of TLineStyle;
  36. TPointArray = Array of TPoint;
  37. TPointStyleArray = Array of TPointStyle;
  38. TPolygonArray = Array of TPolygon;
  39. TPolygonStyleArray = Array of TPolygonStyle;
  40. TSqlresponseArray = Array of TSqlresponse;
  41. TStyleFunctionArray = Array of TStyleFunction;
  42. TStyleSettingArray = Array of TStyleSetting;
  43. TStyleSettingListArray = Array of TStyleSettingList;
  44. TTableArray = Array of TTable;
  45. TTableListArray = Array of TTableList;
  46. TTaskArray = Array of TTask;
  47. TTaskListArray = Array of TTaskList;
  48. TTemplateArray = Array of TTemplate;
  49. TTemplateListArray = Array of TTemplateList;
  50. //Anonymous types, using auto-generated names
  51. TColumnTypebaseColumn = Class;
  52. TStyleFunctionTypegradientTypecolorsItem = Class;
  53. TStyleFunctionTypegradient = Class;
  54. TColumnListTypeitemsArray = Array of TColumn;
  55. TLineTypecoordinatesArray = Array of TdoubleArray;
  56. TPolygonTypecoordinatesItemArray = Array of TdoubleArray;
  57. TPolygonTypecoordinatesArray = Array of TPolygonTypecoordinatesItemArray;
  58. TSqlresponseTyperowsArray = Array of TTJSONSchemaArray;
  59. TStyleFunctionTypebucketsArray = Array of TBucket;
  60. TStyleFunctionTypegradientTypecolorsArray = Array of TStyleFunctionTypegradientTypecolorsItem;
  61. TStyleSettingListTypeitemsArray = Array of TStyleSetting;
  62. TTableTypecolumnsArray = Array of TColumn;
  63. TTableListTypeitemsArray = Array of TTable;
  64. TTaskListTypeitemsArray = Array of TTask;
  65. TTemplateListTypeitemsArray = Array of TTemplate;
  66. { --------------------------------------------------------------------
  67. TBucket
  68. --------------------------------------------------------------------}
  69. TBucket = Class(TGoogleBaseObject)
  70. Private
  71. Fcolor : String;
  72. Ficon : String;
  73. Fmax : double;
  74. Fmin : double;
  75. Fopacity : double;
  76. Fweight : integer;
  77. Protected
  78. //Property setters
  79. Procedure Setcolor(AIndex : Integer; const AValue : String); virtual;
  80. Procedure Seticon(AIndex : Integer; const AValue : String); virtual;
  81. Procedure Setmax(AIndex : Integer; const AValue : double); virtual;
  82. Procedure Setmin(AIndex : Integer; const AValue : double); virtual;
  83. Procedure Setopacity(AIndex : Integer; const AValue : double); virtual;
  84. Procedure Setweight(AIndex : Integer; const AValue : integer); virtual;
  85. Public
  86. Published
  87. Property color : String Index 0 Read Fcolor Write Setcolor;
  88. Property icon : String Index 8 Read Ficon Write Seticon;
  89. Property max : double Index 16 Read Fmax Write Setmax;
  90. Property min : double Index 24 Read Fmin Write Setmin;
  91. Property opacity : double Index 32 Read Fopacity Write Setopacity;
  92. Property weight : integer Index 40 Read Fweight Write Setweight;
  93. end;
  94. TBucketClass = Class of TBucket;
  95. { --------------------------------------------------------------------
  96. TColumnTypebaseColumn
  97. --------------------------------------------------------------------}
  98. TColumnTypebaseColumn = Class(TGoogleBaseObject)
  99. Private
  100. FcolumnId : integer;
  101. FtableIndex : integer;
  102. Protected
  103. //Property setters
  104. Procedure SetcolumnId(AIndex : Integer; const AValue : integer); virtual;
  105. Procedure SettableIndex(AIndex : Integer; const AValue : integer); virtual;
  106. Public
  107. Published
  108. Property columnId : integer Index 0 Read FcolumnId Write SetcolumnId;
  109. Property tableIndex : integer Index 8 Read FtableIndex Write SettableIndex;
  110. end;
  111. TColumnTypebaseColumnClass = Class of TColumnTypebaseColumn;
  112. { --------------------------------------------------------------------
  113. TColumn
  114. --------------------------------------------------------------------}
  115. TColumn = Class(TGoogleBaseObject)
  116. Private
  117. FbaseColumn : TColumnTypebaseColumn;
  118. FcolumnId : integer;
  119. FcolumnJsonSchema : String;
  120. FcolumnPropertiesJson : String;
  121. Fdescription : String;
  122. FformatPattern : String;
  123. FgraphPredicate : String;
  124. Fkind : String;
  125. Fname : String;
  126. F_type : String;
  127. FvalidValues : TStringArray;
  128. FvalidateData : boolean;
  129. Protected
  130. Class Function ExportPropertyName(Const AName : String) : string; override;
  131. //Property setters
  132. Procedure SetbaseColumn(AIndex : Integer; const AValue : TColumnTypebaseColumn); virtual;
  133. Procedure SetcolumnId(AIndex : Integer; const AValue : integer); virtual;
  134. Procedure SetcolumnJsonSchema(AIndex : Integer; const AValue : String); virtual;
  135. Procedure SetcolumnPropertiesJson(AIndex : Integer; const AValue : String); virtual;
  136. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  137. Procedure SetformatPattern(AIndex : Integer; const AValue : String); virtual;
  138. Procedure SetgraphPredicate(AIndex : Integer; const AValue : String); virtual;
  139. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  140. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  141. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  142. Procedure SetvalidValues(AIndex : Integer; const AValue : TStringArray); virtual;
  143. Procedure SetvalidateData(AIndex : Integer; const AValue : boolean); virtual;
  144. //2.6.4. bug workaround
  145. {$IFDEF VER2_6}
  146. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  147. {$ENDIF VER2_6}
  148. Public
  149. Published
  150. Property baseColumn : TColumnTypebaseColumn Index 0 Read FbaseColumn Write SetbaseColumn;
  151. Property columnId : integer Index 8 Read FcolumnId Write SetcolumnId;
  152. Property columnJsonSchema : String Index 16 Read FcolumnJsonSchema Write SetcolumnJsonSchema;
  153. Property columnPropertiesJson : String Index 24 Read FcolumnPropertiesJson Write SetcolumnPropertiesJson;
  154. Property description : String Index 32 Read Fdescription Write Setdescription;
  155. Property formatPattern : String Index 40 Read FformatPattern Write SetformatPattern;
  156. Property graphPredicate : String Index 48 Read FgraphPredicate Write SetgraphPredicate;
  157. Property kind : String Index 56 Read Fkind Write Setkind;
  158. Property name : String Index 64 Read Fname Write Setname;
  159. Property _type : String Index 72 Read F_type Write Set_type;
  160. Property validValues : TStringArray Index 80 Read FvalidValues Write SetvalidValues;
  161. Property validateData : boolean Index 88 Read FvalidateData Write SetvalidateData;
  162. end;
  163. TColumnClass = Class of TColumn;
  164. { --------------------------------------------------------------------
  165. TColumnList
  166. --------------------------------------------------------------------}
  167. TColumnList = Class(TGoogleBaseObject)
  168. Private
  169. Fitems : TColumnListTypeitemsArray;
  170. Fkind : String;
  171. FnextPageToken : String;
  172. FtotalItems : integer;
  173. Protected
  174. //Property setters
  175. Procedure Setitems(AIndex : Integer; const AValue : TColumnListTypeitemsArray); virtual;
  176. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  177. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  178. Procedure SettotalItems(AIndex : Integer; const AValue : integer); virtual;
  179. //2.6.4. bug workaround
  180. {$IFDEF VER2_6}
  181. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  182. {$ENDIF VER2_6}
  183. Public
  184. Published
  185. Property items : TColumnListTypeitemsArray Index 0 Read Fitems Write Setitems;
  186. Property kind : String Index 8 Read Fkind Write Setkind;
  187. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  188. Property totalItems : integer Index 24 Read FtotalItems Write SettotalItems;
  189. end;
  190. TColumnListClass = Class of TColumnList;
  191. { --------------------------------------------------------------------
  192. TGeometry
  193. --------------------------------------------------------------------}
  194. TGeometry = Class(TGoogleBaseObject)
  195. Private
  196. Fgeometries : TTJSONSchemaArray;
  197. Fgeometry : TJSONSchema;
  198. F_type : String;
  199. Protected
  200. Class Function ExportPropertyName(Const AName : String) : string; override;
  201. //Property setters
  202. Procedure Setgeometries(AIndex : Integer; const AValue : TTJSONSchemaArray); virtual;
  203. Procedure Setgeometry(AIndex : Integer; const AValue : TJSONSchema); virtual;
  204. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  205. //2.6.4. bug workaround
  206. {$IFDEF VER2_6}
  207. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  208. {$ENDIF VER2_6}
  209. Public
  210. Published
  211. Property geometries : TTJSONSchemaArray Index 0 Read Fgeometries Write Setgeometries;
  212. Property geometry : TJSONSchema Index 8 Read Fgeometry Write Setgeometry;
  213. Property _type : String Index 16 Read F_type Write Set_type;
  214. end;
  215. TGeometryClass = Class of TGeometry;
  216. { --------------------------------------------------------------------
  217. TImport
  218. --------------------------------------------------------------------}
  219. TImport = Class(TGoogleBaseObject)
  220. Private
  221. Fkind : String;
  222. FnumRowsReceived : String;
  223. Protected
  224. //Property setters
  225. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  226. Procedure SetnumRowsReceived(AIndex : Integer; const AValue : String); virtual;
  227. Public
  228. Published
  229. Property kind : String Index 0 Read Fkind Write Setkind;
  230. Property numRowsReceived : String Index 8 Read FnumRowsReceived Write SetnumRowsReceived;
  231. end;
  232. TImportClass = Class of TImport;
  233. { --------------------------------------------------------------------
  234. TLine
  235. --------------------------------------------------------------------}
  236. TLine = Class(TGoogleBaseObject)
  237. Private
  238. Fcoordinates : TLineTypecoordinatesArray;
  239. F_type : String;
  240. Protected
  241. Class Function ExportPropertyName(Const AName : String) : string; override;
  242. //Property setters
  243. Procedure Setcoordinates(AIndex : Integer; const AValue : TLineTypecoordinatesArray); virtual;
  244. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  245. //2.6.4. bug workaround
  246. {$IFDEF VER2_6}
  247. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  248. {$ENDIF VER2_6}
  249. Public
  250. Published
  251. Property coordinates : TLineTypecoordinatesArray Index 0 Read Fcoordinates Write Setcoordinates;
  252. Property _type : String Index 8 Read F_type Write Set_type;
  253. end;
  254. TLineClass = Class of TLine;
  255. { --------------------------------------------------------------------
  256. TLineStyle
  257. --------------------------------------------------------------------}
  258. TLineStyle = Class(TGoogleBaseObject)
  259. Private
  260. FstrokeColor : String;
  261. FstrokeColorStyler : TStyleFunction;
  262. FstrokeOpacity : double;
  263. FstrokeWeight : integer;
  264. FstrokeWeightStyler : TStyleFunction;
  265. Protected
  266. //Property setters
  267. Procedure SetstrokeColor(AIndex : Integer; const AValue : String); virtual;
  268. Procedure SetstrokeColorStyler(AIndex : Integer; const AValue : TStyleFunction); virtual;
  269. Procedure SetstrokeOpacity(AIndex : Integer; const AValue : double); virtual;
  270. Procedure SetstrokeWeight(AIndex : Integer; const AValue : integer); virtual;
  271. Procedure SetstrokeWeightStyler(AIndex : Integer; const AValue : TStyleFunction); virtual;
  272. Public
  273. Published
  274. Property strokeColor : String Index 0 Read FstrokeColor Write SetstrokeColor;
  275. Property strokeColorStyler : TStyleFunction Index 8 Read FstrokeColorStyler Write SetstrokeColorStyler;
  276. Property strokeOpacity : double Index 16 Read FstrokeOpacity Write SetstrokeOpacity;
  277. Property strokeWeight : integer Index 24 Read FstrokeWeight Write SetstrokeWeight;
  278. Property strokeWeightStyler : TStyleFunction Index 32 Read FstrokeWeightStyler Write SetstrokeWeightStyler;
  279. end;
  280. TLineStyleClass = Class of TLineStyle;
  281. { --------------------------------------------------------------------
  282. TPoint
  283. --------------------------------------------------------------------}
  284. TPoint = Class(TGoogleBaseObject)
  285. Private
  286. Fcoordinates : TdoubleArray;
  287. F_type : String;
  288. Protected
  289. Class Function ExportPropertyName(Const AName : String) : string; override;
  290. //Property setters
  291. Procedure Setcoordinates(AIndex : Integer; const AValue : TdoubleArray); virtual;
  292. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  293. //2.6.4. bug workaround
  294. {$IFDEF VER2_6}
  295. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  296. {$ENDIF VER2_6}
  297. Public
  298. Published
  299. Property coordinates : TdoubleArray Index 0 Read Fcoordinates Write Setcoordinates;
  300. Property _type : String Index 8 Read F_type Write Set_type;
  301. end;
  302. TPointClass = Class of TPoint;
  303. { --------------------------------------------------------------------
  304. TPointStyle
  305. --------------------------------------------------------------------}
  306. TPointStyle = Class(TGoogleBaseObject)
  307. Private
  308. FiconName : String;
  309. FiconStyler : TStyleFunction;
  310. Protected
  311. //Property setters
  312. Procedure SeticonName(AIndex : Integer; const AValue : String); virtual;
  313. Procedure SeticonStyler(AIndex : Integer; const AValue : TStyleFunction); virtual;
  314. Public
  315. Published
  316. Property iconName : String Index 0 Read FiconName Write SeticonName;
  317. Property iconStyler : TStyleFunction Index 8 Read FiconStyler Write SeticonStyler;
  318. end;
  319. TPointStyleClass = Class of TPointStyle;
  320. { --------------------------------------------------------------------
  321. TPolygon
  322. --------------------------------------------------------------------}
  323. TPolygon = Class(TGoogleBaseObject)
  324. Private
  325. Fcoordinates : TPolygonTypecoordinatesArray;
  326. F_type : String;
  327. Protected
  328. Class Function ExportPropertyName(Const AName : String) : string; override;
  329. //Property setters
  330. Procedure Setcoordinates(AIndex : Integer; const AValue : TPolygonTypecoordinatesArray); virtual;
  331. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  332. //2.6.4. bug workaround
  333. {$IFDEF VER2_6}
  334. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  335. {$ENDIF VER2_6}
  336. Public
  337. Published
  338. Property coordinates : TPolygonTypecoordinatesArray Index 0 Read Fcoordinates Write Setcoordinates;
  339. Property _type : String Index 8 Read F_type Write Set_type;
  340. end;
  341. TPolygonClass = Class of TPolygon;
  342. { --------------------------------------------------------------------
  343. TPolygonStyle
  344. --------------------------------------------------------------------}
  345. TPolygonStyle = Class(TGoogleBaseObject)
  346. Private
  347. FfillColor : String;
  348. FfillColorStyler : TStyleFunction;
  349. FfillOpacity : double;
  350. FstrokeColor : String;
  351. FstrokeColorStyler : TStyleFunction;
  352. FstrokeOpacity : double;
  353. FstrokeWeight : integer;
  354. FstrokeWeightStyler : TStyleFunction;
  355. Protected
  356. //Property setters
  357. Procedure SetfillColor(AIndex : Integer; const AValue : String); virtual;
  358. Procedure SetfillColorStyler(AIndex : Integer; const AValue : TStyleFunction); virtual;
  359. Procedure SetfillOpacity(AIndex : Integer; const AValue : double); virtual;
  360. Procedure SetstrokeColor(AIndex : Integer; const AValue : String); virtual;
  361. Procedure SetstrokeColorStyler(AIndex : Integer; const AValue : TStyleFunction); virtual;
  362. Procedure SetstrokeOpacity(AIndex : Integer; const AValue : double); virtual;
  363. Procedure SetstrokeWeight(AIndex : Integer; const AValue : integer); virtual;
  364. Procedure SetstrokeWeightStyler(AIndex : Integer; const AValue : TStyleFunction); virtual;
  365. Public
  366. Published
  367. Property fillColor : String Index 0 Read FfillColor Write SetfillColor;
  368. Property fillColorStyler : TStyleFunction Index 8 Read FfillColorStyler Write SetfillColorStyler;
  369. Property fillOpacity : double Index 16 Read FfillOpacity Write SetfillOpacity;
  370. Property strokeColor : String Index 24 Read FstrokeColor Write SetstrokeColor;
  371. Property strokeColorStyler : TStyleFunction Index 32 Read FstrokeColorStyler Write SetstrokeColorStyler;
  372. Property strokeOpacity : double Index 40 Read FstrokeOpacity Write SetstrokeOpacity;
  373. Property strokeWeight : integer Index 48 Read FstrokeWeight Write SetstrokeWeight;
  374. Property strokeWeightStyler : TStyleFunction Index 56 Read FstrokeWeightStyler Write SetstrokeWeightStyler;
  375. end;
  376. TPolygonStyleClass = Class of TPolygonStyle;
  377. { --------------------------------------------------------------------
  378. TSqlresponse
  379. --------------------------------------------------------------------}
  380. TSqlresponse = Class(TGoogleBaseObject)
  381. Private
  382. Fcolumns : TStringArray;
  383. Fkind : String;
  384. Frows : TSqlresponseTyperowsArray;
  385. Protected
  386. //Property setters
  387. Procedure Setcolumns(AIndex : Integer; const AValue : TStringArray); virtual;
  388. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  389. Procedure Setrows(AIndex : Integer; const AValue : TSqlresponseTyperowsArray); virtual;
  390. //2.6.4. bug workaround
  391. {$IFDEF VER2_6}
  392. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  393. {$ENDIF VER2_6}
  394. Public
  395. Published
  396. Property columns : TStringArray Index 0 Read Fcolumns Write Setcolumns;
  397. Property kind : String Index 8 Read Fkind Write Setkind;
  398. Property rows : TSqlresponseTyperowsArray Index 16 Read Frows Write Setrows;
  399. end;
  400. TSqlresponseClass = Class of TSqlresponse;
  401. { --------------------------------------------------------------------
  402. TStyleFunctionTypegradientTypecolorsItem
  403. --------------------------------------------------------------------}
  404. TStyleFunctionTypegradientTypecolorsItem = Class(TGoogleBaseObject)
  405. Private
  406. Fcolor : String;
  407. Fopacity : double;
  408. Protected
  409. //Property setters
  410. Procedure Setcolor(AIndex : Integer; const AValue : String); virtual;
  411. Procedure Setopacity(AIndex : Integer; const AValue : double); virtual;
  412. Public
  413. Published
  414. Property color : String Index 0 Read Fcolor Write Setcolor;
  415. Property opacity : double Index 8 Read Fopacity Write Setopacity;
  416. end;
  417. TStyleFunctionTypegradientTypecolorsItemClass = Class of TStyleFunctionTypegradientTypecolorsItem;
  418. { --------------------------------------------------------------------
  419. TStyleFunctionTypegradient
  420. --------------------------------------------------------------------}
  421. TStyleFunctionTypegradient = Class(TGoogleBaseObject)
  422. Private
  423. Fcolors : TStyleFunctionTypegradientTypecolorsArray;
  424. Fmax : double;
  425. Fmin : double;
  426. Protected
  427. //Property setters
  428. Procedure Setcolors(AIndex : Integer; const AValue : TStyleFunctionTypegradientTypecolorsArray); virtual;
  429. Procedure Setmax(AIndex : Integer; const AValue : double); virtual;
  430. Procedure Setmin(AIndex : Integer; const AValue : double); virtual;
  431. //2.6.4. bug workaround
  432. {$IFDEF VER2_6}
  433. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  434. {$ENDIF VER2_6}
  435. Public
  436. Published
  437. Property colors : TStyleFunctionTypegradientTypecolorsArray Index 0 Read Fcolors Write Setcolors;
  438. Property max : double Index 8 Read Fmax Write Setmax;
  439. Property min : double Index 16 Read Fmin Write Setmin;
  440. end;
  441. TStyleFunctionTypegradientClass = Class of TStyleFunctionTypegradient;
  442. { --------------------------------------------------------------------
  443. TStyleFunction
  444. --------------------------------------------------------------------}
  445. TStyleFunction = Class(TGoogleBaseObject)
  446. Private
  447. Fbuckets : TStyleFunctionTypebucketsArray;
  448. FcolumnName : String;
  449. Fgradient : TStyleFunctionTypegradient;
  450. Fkind : String;
  451. Protected
  452. //Property setters
  453. Procedure Setbuckets(AIndex : Integer; const AValue : TStyleFunctionTypebucketsArray); virtual;
  454. Procedure SetcolumnName(AIndex : Integer; const AValue : String); virtual;
  455. Procedure Setgradient(AIndex : Integer; const AValue : TStyleFunctionTypegradient); virtual;
  456. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  457. //2.6.4. bug workaround
  458. {$IFDEF VER2_6}
  459. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  460. {$ENDIF VER2_6}
  461. Public
  462. Published
  463. Property buckets : TStyleFunctionTypebucketsArray Index 0 Read Fbuckets Write Setbuckets;
  464. Property columnName : String Index 8 Read FcolumnName Write SetcolumnName;
  465. Property gradient : TStyleFunctionTypegradient Index 16 Read Fgradient Write Setgradient;
  466. Property kind : String Index 24 Read Fkind Write Setkind;
  467. end;
  468. TStyleFunctionClass = Class of TStyleFunction;
  469. { --------------------------------------------------------------------
  470. TStyleSetting
  471. --------------------------------------------------------------------}
  472. TStyleSetting = Class(TGoogleBaseObject)
  473. Private
  474. Fkind : String;
  475. FmarkerOptions : TPointStyle;
  476. Fname : String;
  477. FpolygonOptions : TPolygonStyle;
  478. FpolylineOptions : TLineStyle;
  479. FstyleId : integer;
  480. FtableId : String;
  481. Protected
  482. //Property setters
  483. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  484. Procedure SetmarkerOptions(AIndex : Integer; const AValue : TPointStyle); virtual;
  485. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  486. Procedure SetpolygonOptions(AIndex : Integer; const AValue : TPolygonStyle); virtual;
  487. Procedure SetpolylineOptions(AIndex : Integer; const AValue : TLineStyle); virtual;
  488. Procedure SetstyleId(AIndex : Integer; const AValue : integer); virtual;
  489. Procedure SettableId(AIndex : Integer; const AValue : String); virtual;
  490. Public
  491. Published
  492. Property kind : String Index 0 Read Fkind Write Setkind;
  493. Property markerOptions : TPointStyle Index 8 Read FmarkerOptions Write SetmarkerOptions;
  494. Property name : String Index 16 Read Fname Write Setname;
  495. Property polygonOptions : TPolygonStyle Index 24 Read FpolygonOptions Write SetpolygonOptions;
  496. Property polylineOptions : TLineStyle Index 32 Read FpolylineOptions Write SetpolylineOptions;
  497. Property styleId : integer Index 40 Read FstyleId Write SetstyleId;
  498. Property tableId : String Index 48 Read FtableId Write SettableId;
  499. end;
  500. TStyleSettingClass = Class of TStyleSetting;
  501. { --------------------------------------------------------------------
  502. TStyleSettingList
  503. --------------------------------------------------------------------}
  504. TStyleSettingList = Class(TGoogleBaseObject)
  505. Private
  506. Fitems : TStyleSettingListTypeitemsArray;
  507. Fkind : String;
  508. FnextPageToken : String;
  509. FtotalItems : integer;
  510. Protected
  511. //Property setters
  512. Procedure Setitems(AIndex : Integer; const AValue : TStyleSettingListTypeitemsArray); virtual;
  513. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  514. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  515. Procedure SettotalItems(AIndex : Integer; const AValue : integer); virtual;
  516. //2.6.4. bug workaround
  517. {$IFDEF VER2_6}
  518. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  519. {$ENDIF VER2_6}
  520. Public
  521. Published
  522. Property items : TStyleSettingListTypeitemsArray Index 0 Read Fitems Write Setitems;
  523. Property kind : String Index 8 Read Fkind Write Setkind;
  524. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  525. Property totalItems : integer Index 24 Read FtotalItems Write SettotalItems;
  526. end;
  527. TStyleSettingListClass = Class of TStyleSettingList;
  528. { --------------------------------------------------------------------
  529. TTable
  530. --------------------------------------------------------------------}
  531. TTable = Class(TGoogleBaseObject)
  532. Private
  533. Fattribution : String;
  534. FattributionLink : String;
  535. FbaseTableIds : TStringArray;
  536. FcolumnPropertiesJsonSchema : String;
  537. Fcolumns : TTableTypecolumnsArray;
  538. Fdescription : String;
  539. FisExportable : boolean;
  540. Fkind : String;
  541. Fname : String;
  542. Fsql : String;
  543. FtableId : String;
  544. FtablePropertiesJson : String;
  545. FtablePropertiesJsonSchema : String;
  546. Protected
  547. //Property setters
  548. Procedure Setattribution(AIndex : Integer; const AValue : String); virtual;
  549. Procedure SetattributionLink(AIndex : Integer; const AValue : String); virtual;
  550. Procedure SetbaseTableIds(AIndex : Integer; const AValue : TStringArray); virtual;
  551. Procedure SetcolumnPropertiesJsonSchema(AIndex : Integer; const AValue : String); virtual;
  552. Procedure Setcolumns(AIndex : Integer; const AValue : TTableTypecolumnsArray); virtual;
  553. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  554. Procedure SetisExportable(AIndex : Integer; const AValue : boolean); virtual;
  555. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  556. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  557. Procedure Setsql(AIndex : Integer; const AValue : String); virtual;
  558. Procedure SettableId(AIndex : Integer; const AValue : String); virtual;
  559. Procedure SettablePropertiesJson(AIndex : Integer; const AValue : String); virtual;
  560. Procedure SettablePropertiesJsonSchema(AIndex : Integer; const AValue : String); virtual;
  561. //2.6.4. bug workaround
  562. {$IFDEF VER2_6}
  563. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  564. {$ENDIF VER2_6}
  565. Public
  566. Published
  567. Property attribution : String Index 0 Read Fattribution Write Setattribution;
  568. Property attributionLink : String Index 8 Read FattributionLink Write SetattributionLink;
  569. Property baseTableIds : TStringArray Index 16 Read FbaseTableIds Write SetbaseTableIds;
  570. Property columnPropertiesJsonSchema : String Index 24 Read FcolumnPropertiesJsonSchema Write SetcolumnPropertiesJsonSchema;
  571. Property columns : TTableTypecolumnsArray Index 32 Read Fcolumns Write Setcolumns;
  572. Property description : String Index 40 Read Fdescription Write Setdescription;
  573. Property isExportable : boolean Index 48 Read FisExportable Write SetisExportable;
  574. Property kind : String Index 56 Read Fkind Write Setkind;
  575. Property name : String Index 64 Read Fname Write Setname;
  576. Property sql : String Index 72 Read Fsql Write Setsql;
  577. Property tableId : String Index 80 Read FtableId Write SettableId;
  578. Property tablePropertiesJson : String Index 88 Read FtablePropertiesJson Write SettablePropertiesJson;
  579. Property tablePropertiesJsonSchema : String Index 96 Read FtablePropertiesJsonSchema Write SettablePropertiesJsonSchema;
  580. end;
  581. TTableClass = Class of TTable;
  582. { --------------------------------------------------------------------
  583. TTableList
  584. --------------------------------------------------------------------}
  585. TTableList = Class(TGoogleBaseObject)
  586. Private
  587. Fitems : TTableListTypeitemsArray;
  588. Fkind : String;
  589. FnextPageToken : String;
  590. Protected
  591. //Property setters
  592. Procedure Setitems(AIndex : Integer; const AValue : TTableListTypeitemsArray); virtual;
  593. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  594. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  595. //2.6.4. bug workaround
  596. {$IFDEF VER2_6}
  597. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  598. {$ENDIF VER2_6}
  599. Public
  600. Published
  601. Property items : TTableListTypeitemsArray Index 0 Read Fitems Write Setitems;
  602. Property kind : String Index 8 Read Fkind Write Setkind;
  603. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  604. end;
  605. TTableListClass = Class of TTableList;
  606. { --------------------------------------------------------------------
  607. TTask
  608. --------------------------------------------------------------------}
  609. TTask = Class(TGoogleBaseObject)
  610. Private
  611. Fkind : String;
  612. Fprogress : String;
  613. Fstarted : boolean;
  614. FtaskId : String;
  615. F_type : String;
  616. Protected
  617. Class Function ExportPropertyName(Const AName : String) : string; override;
  618. //Property setters
  619. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  620. Procedure Setprogress(AIndex : Integer; const AValue : String); virtual;
  621. Procedure Setstarted(AIndex : Integer; const AValue : boolean); virtual;
  622. Procedure SettaskId(AIndex : Integer; const AValue : String); virtual;
  623. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  624. Public
  625. Published
  626. Property kind : String Index 0 Read Fkind Write Setkind;
  627. Property progress : String Index 8 Read Fprogress Write Setprogress;
  628. Property started : boolean Index 16 Read Fstarted Write Setstarted;
  629. Property taskId : String Index 24 Read FtaskId Write SettaskId;
  630. Property _type : String Index 32 Read F_type Write Set_type;
  631. end;
  632. TTaskClass = Class of TTask;
  633. { --------------------------------------------------------------------
  634. TTaskList
  635. --------------------------------------------------------------------}
  636. TTaskList = Class(TGoogleBaseObject)
  637. Private
  638. Fitems : TTaskListTypeitemsArray;
  639. Fkind : String;
  640. FnextPageToken : String;
  641. FtotalItems : integer;
  642. Protected
  643. //Property setters
  644. Procedure Setitems(AIndex : Integer; const AValue : TTaskListTypeitemsArray); virtual;
  645. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  646. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  647. Procedure SettotalItems(AIndex : Integer; const AValue : integer); virtual;
  648. //2.6.4. bug workaround
  649. {$IFDEF VER2_6}
  650. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  651. {$ENDIF VER2_6}
  652. Public
  653. Published
  654. Property items : TTaskListTypeitemsArray Index 0 Read Fitems Write Setitems;
  655. Property kind : String Index 8 Read Fkind Write Setkind;
  656. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  657. Property totalItems : integer Index 24 Read FtotalItems Write SettotalItems;
  658. end;
  659. TTaskListClass = Class of TTaskList;
  660. { --------------------------------------------------------------------
  661. TTemplate
  662. --------------------------------------------------------------------}
  663. TTemplate = Class(TGoogleBaseObject)
  664. Private
  665. FautomaticColumnNames : TStringArray;
  666. Fbody : String;
  667. Fkind : String;
  668. Fname : String;
  669. FtableId : String;
  670. FtemplateId : integer;
  671. Protected
  672. //Property setters
  673. Procedure SetautomaticColumnNames(AIndex : Integer; const AValue : TStringArray); virtual;
  674. Procedure Setbody(AIndex : Integer; const AValue : String); virtual;
  675. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  676. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  677. Procedure SettableId(AIndex : Integer; const AValue : String); virtual;
  678. Procedure SettemplateId(AIndex : Integer; const AValue : integer); virtual;
  679. //2.6.4. bug workaround
  680. {$IFDEF VER2_6}
  681. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  682. {$ENDIF VER2_6}
  683. Public
  684. Published
  685. Property automaticColumnNames : TStringArray Index 0 Read FautomaticColumnNames Write SetautomaticColumnNames;
  686. Property body : String Index 8 Read Fbody Write Setbody;
  687. Property kind : String Index 16 Read Fkind Write Setkind;
  688. Property name : String Index 24 Read Fname Write Setname;
  689. Property tableId : String Index 32 Read FtableId Write SettableId;
  690. Property templateId : integer Index 40 Read FtemplateId Write SettemplateId;
  691. end;
  692. TTemplateClass = Class of TTemplate;
  693. { --------------------------------------------------------------------
  694. TTemplateList
  695. --------------------------------------------------------------------}
  696. TTemplateList = Class(TGoogleBaseObject)
  697. Private
  698. Fitems : TTemplateListTypeitemsArray;
  699. Fkind : String;
  700. FnextPageToken : String;
  701. FtotalItems : integer;
  702. Protected
  703. //Property setters
  704. Procedure Setitems(AIndex : Integer; const AValue : TTemplateListTypeitemsArray); virtual;
  705. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  706. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  707. Procedure SettotalItems(AIndex : Integer; const AValue : integer); virtual;
  708. //2.6.4. bug workaround
  709. {$IFDEF VER2_6}
  710. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  711. {$ENDIF VER2_6}
  712. Public
  713. Published
  714. Property items : TTemplateListTypeitemsArray Index 0 Read Fitems Write Setitems;
  715. Property kind : String Index 8 Read Fkind Write Setkind;
  716. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  717. Property totalItems : integer Index 24 Read FtotalItems Write SettotalItems;
  718. end;
  719. TTemplateListClass = Class of TTemplateList;
  720. { --------------------------------------------------------------------
  721. TColumnResource
  722. --------------------------------------------------------------------}
  723. //Optional query Options for TColumnResource, method List
  724. TColumnListOptions = Record
  725. maxResults : integer;
  726. pageToken : String;
  727. end;
  728. TColumnResource = Class(TGoogleResource)
  729. Public
  730. Class Function ResourceName : String; override;
  731. Class Function DefaultAPI : TGoogleAPIClass; override;
  732. Procedure Delete(columnId: string; tableId: string);
  733. Function Get(columnId: string; tableId: string) : TColumn;
  734. Function Insert(tableId: string; aColumn : TColumn) : TColumn;
  735. Function List(tableId: string; AQuery : string = '') : TColumnList;
  736. Function List(tableId: string; AQuery : TColumnlistOptions) : TColumnList;
  737. Function Patch(columnId: string; tableId: string; aColumn : TColumn) : TColumn;
  738. Function Update(columnId: string; tableId: string; aColumn : TColumn) : TColumn;
  739. end;
  740. { --------------------------------------------------------------------
  741. TQueryResource
  742. --------------------------------------------------------------------}
  743. //Optional query Options for TQueryResource, method Sql
  744. TQuerySqlOptions = Record
  745. hdrs : boolean;
  746. sql : String;
  747. typed : boolean;
  748. end;
  749. //Optional query Options for TQueryResource, method SqlGet
  750. TQuerySqlGetOptions = Record
  751. hdrs : boolean;
  752. sql : String;
  753. typed : boolean;
  754. end;
  755. TQueryResource = Class(TGoogleResource)
  756. Public
  757. Class Function ResourceName : String; override;
  758. Class Function DefaultAPI : TGoogleAPIClass; override;
  759. Function Sql(AQuery : string = '') : TSqlresponse;
  760. Function Sql(AQuery : TQuerysqlOptions) : TSqlresponse;
  761. Function SqlGet(AQuery : string = '') : TSqlresponse;
  762. Function SqlGet(AQuery : TQuerysqlGetOptions) : TSqlresponse;
  763. end;
  764. { --------------------------------------------------------------------
  765. TStyleResource
  766. --------------------------------------------------------------------}
  767. //Optional query Options for TStyleResource, method List
  768. TStyleListOptions = Record
  769. maxResults : integer;
  770. pageToken : String;
  771. end;
  772. TStyleResource = Class(TGoogleResource)
  773. Public
  774. Class Function ResourceName : String; override;
  775. Class Function DefaultAPI : TGoogleAPIClass; override;
  776. Procedure Delete(styleId: integer; tableId: string);
  777. Function Get(styleId: integer; tableId: string) : TStyleSetting;
  778. Function Insert(tableId: string; aStyleSetting : TStyleSetting) : TStyleSetting;
  779. Function List(tableId: string; AQuery : string = '') : TStyleSettingList;
  780. Function List(tableId: string; AQuery : TStylelistOptions) : TStyleSettingList;
  781. Function Patch(styleId: integer; tableId: string; aStyleSetting : TStyleSetting) : TStyleSetting;
  782. Function Update(styleId: integer; tableId: string; aStyleSetting : TStyleSetting) : TStyleSetting;
  783. end;
  784. { --------------------------------------------------------------------
  785. TTableResource
  786. --------------------------------------------------------------------}
  787. //Optional query Options for TTableResource, method Copy
  788. TTableCopyOptions = Record
  789. copyPresentation : boolean;
  790. end;
  791. //Optional query Options for TTableResource, method ImportRows
  792. TTableImportRowsOptions = Record
  793. delimiter : String;
  794. encoding : String;
  795. endLine : integer;
  796. isStrict : boolean;
  797. startLine : integer;
  798. end;
  799. //Optional query Options for TTableResource, method ImportTable
  800. TTableImportTableOptions = Record
  801. delimiter : String;
  802. encoding : String;
  803. _name : String;
  804. end;
  805. //Optional query Options for TTableResource, method List
  806. TTableListOptions = Record
  807. maxResults : integer;
  808. pageToken : String;
  809. end;
  810. //Optional query Options for TTableResource, method Patch
  811. TTablePatchOptions = Record
  812. replaceViewDefinition : boolean;
  813. end;
  814. //Optional query Options for TTableResource, method ReplaceRows
  815. TTableReplaceRowsOptions = Record
  816. delimiter : String;
  817. encoding : String;
  818. endLine : integer;
  819. isStrict : boolean;
  820. startLine : integer;
  821. end;
  822. //Optional query Options for TTableResource, method Update
  823. TTableUpdateOptions = Record
  824. replaceViewDefinition : boolean;
  825. end;
  826. TTableResource = Class(TGoogleResource)
  827. Public
  828. Class Function ResourceName : String; override;
  829. Class Function DefaultAPI : TGoogleAPIClass; override;
  830. Function Copy(tableId: string; AQuery : string = '') : TTable;
  831. Function Copy(tableId: string; AQuery : TTablecopyOptions) : TTable;
  832. Procedure Delete(tableId: string);
  833. Function Get(tableId: string) : TTable;
  834. Function ImportRows(tableId: string; AQuery : string = '') : TImport;
  835. Function ImportRows(tableId: string; AQuery : TTableimportRowsOptions) : TImport;
  836. Function ImportTable(AQuery : string = '') : TTable;
  837. Function ImportTable(AQuery : TTableimportTableOptions) : TTable;
  838. Function Insert(aTable : TTable) : TTable;
  839. Function List(AQuery : string = '') : TTableList;
  840. Function List(AQuery : TTablelistOptions) : TTableList;
  841. Function Patch(tableId: string; aTable : TTable; AQuery : string = '') : TTable;
  842. Function Patch(tableId: string; aTable : TTable; AQuery : TTablepatchOptions) : TTable;
  843. Function ReplaceRows(tableId: string; AQuery : string = '') : TTask;
  844. Function ReplaceRows(tableId: string; AQuery : TTablereplaceRowsOptions) : TTask;
  845. Function Update(tableId: string; aTable : TTable; AQuery : string = '') : TTable;
  846. Function Update(tableId: string; aTable : TTable; AQuery : TTableupdateOptions) : TTable;
  847. end;
  848. { --------------------------------------------------------------------
  849. TTaskResource
  850. --------------------------------------------------------------------}
  851. //Optional query Options for TTaskResource, method List
  852. TTaskListOptions = Record
  853. maxResults : integer;
  854. pageToken : String;
  855. startIndex : integer;
  856. end;
  857. TTaskResource = Class(TGoogleResource)
  858. Public
  859. Class Function ResourceName : String; override;
  860. Class Function DefaultAPI : TGoogleAPIClass; override;
  861. Procedure Delete(tableId: string; taskId: string);
  862. Function Get(tableId: string; taskId: string) : TTask;
  863. Function List(tableId: string; AQuery : string = '') : TTaskList;
  864. Function List(tableId: string; AQuery : TTasklistOptions) : TTaskList;
  865. end;
  866. { --------------------------------------------------------------------
  867. TTemplateResource
  868. --------------------------------------------------------------------}
  869. //Optional query Options for TTemplateResource, method List
  870. TTemplateListOptions = Record
  871. maxResults : integer;
  872. pageToken : String;
  873. end;
  874. TTemplateResource = Class(TGoogleResource)
  875. Public
  876. Class Function ResourceName : String; override;
  877. Class Function DefaultAPI : TGoogleAPIClass; override;
  878. Procedure Delete(tableId: string; templateId: integer);
  879. Function Get(tableId: string; templateId: integer) : TTemplate;
  880. Function Insert(tableId: string; aTemplate : TTemplate) : TTemplate;
  881. Function List(tableId: string; AQuery : string = '') : TTemplateList;
  882. Function List(tableId: string; AQuery : TTemplatelistOptions) : TTemplateList;
  883. Function Patch(tableId: string; templateId: integer; aTemplate : TTemplate) : TTemplate;
  884. Function Update(tableId: string; templateId: integer; aTemplate : TTemplate) : TTemplate;
  885. end;
  886. { --------------------------------------------------------------------
  887. TFusiontablesAPI
  888. --------------------------------------------------------------------}
  889. TFusiontablesAPI = Class(TGoogleAPI)
  890. Private
  891. FColumnInstance : TColumnResource;
  892. FQueryInstance : TQueryResource;
  893. FStyleInstance : TStyleResource;
  894. FTableInstance : TTableResource;
  895. FTaskInstance : TTaskResource;
  896. FTemplateInstance : TTemplateResource;
  897. Function GetColumnInstance : TColumnResource;virtual;
  898. Function GetQueryInstance : TQueryResource;virtual;
  899. Function GetStyleInstance : TStyleResource;virtual;
  900. Function GetTableInstance : TTableResource;virtual;
  901. Function GetTaskInstance : TTaskResource;virtual;
  902. Function GetTemplateInstance : TTemplateResource;virtual;
  903. Public
  904. //Override class functions with API info
  905. Class Function APIName : String; override;
  906. Class Function APIVersion : String; override;
  907. Class Function APIRevision : String; override;
  908. Class Function APIID : String; override;
  909. Class Function APITitle : String; override;
  910. Class Function APIDescription : String; override;
  911. Class Function APIOwnerDomain : String; override;
  912. Class Function APIOwnerName : String; override;
  913. Class Function APIIcon16 : String; override;
  914. Class Function APIIcon32 : String; override;
  915. Class Function APIdocumentationLink : String; override;
  916. Class Function APIrootUrl : string; override;
  917. Class Function APIbasePath : string;override;
  918. Class Function APIbaseURL : String;override;
  919. Class Function APIProtocol : string;override;
  920. Class Function APIservicePath : string;override;
  921. Class Function APIbatchPath : String;override;
  922. Class Function APIAuthScopes : TScopeInfoArray;override;
  923. Class Function APINeedsAuth : Boolean;override;
  924. Class Procedure RegisterAPIResources; override;
  925. //Add create function for resources
  926. Function CreateColumnResource(AOwner : TComponent) : TColumnResource;virtual;overload;
  927. Function CreateColumnResource : TColumnResource;virtual;overload;
  928. Function CreateQueryResource(AOwner : TComponent) : TQueryResource;virtual;overload;
  929. Function CreateQueryResource : TQueryResource;virtual;overload;
  930. Function CreateStyleResource(AOwner : TComponent) : TStyleResource;virtual;overload;
  931. Function CreateStyleResource : TStyleResource;virtual;overload;
  932. Function CreateTableResource(AOwner : TComponent) : TTableResource;virtual;overload;
  933. Function CreateTableResource : TTableResource;virtual;overload;
  934. Function CreateTaskResource(AOwner : TComponent) : TTaskResource;virtual;overload;
  935. Function CreateTaskResource : TTaskResource;virtual;overload;
  936. Function CreateTemplateResource(AOwner : TComponent) : TTemplateResource;virtual;overload;
  937. Function CreateTemplateResource : TTemplateResource;virtual;overload;
  938. //Add default on-demand instances for resources
  939. Property ColumnResource : TColumnResource Read GetColumnInstance;
  940. Property QueryResource : TQueryResource Read GetQueryInstance;
  941. Property StyleResource : TStyleResource Read GetStyleInstance;
  942. Property TableResource : TTableResource Read GetTableInstance;
  943. Property TaskResource : TTaskResource Read GetTaskInstance;
  944. Property TemplateResource : TTemplateResource Read GetTemplateInstance;
  945. end;
  946. implementation
  947. { --------------------------------------------------------------------
  948. TBucket
  949. --------------------------------------------------------------------}
  950. Procedure TBucket.Setcolor(AIndex : Integer; const AValue : String);
  951. begin
  952. If (Fcolor=AValue) then exit;
  953. Fcolor:=AValue;
  954. MarkPropertyChanged(AIndex);
  955. end;
  956. Procedure TBucket.Seticon(AIndex : Integer; const AValue : String);
  957. begin
  958. If (Ficon=AValue) then exit;
  959. Ficon:=AValue;
  960. MarkPropertyChanged(AIndex);
  961. end;
  962. Procedure TBucket.Setmax(AIndex : Integer; const AValue : double);
  963. begin
  964. If (Fmax=AValue) then exit;
  965. Fmax:=AValue;
  966. MarkPropertyChanged(AIndex);
  967. end;
  968. Procedure TBucket.Setmin(AIndex : Integer; const AValue : double);
  969. begin
  970. If (Fmin=AValue) then exit;
  971. Fmin:=AValue;
  972. MarkPropertyChanged(AIndex);
  973. end;
  974. Procedure TBucket.Setopacity(AIndex : Integer; const AValue : double);
  975. begin
  976. If (Fopacity=AValue) then exit;
  977. Fopacity:=AValue;
  978. MarkPropertyChanged(AIndex);
  979. end;
  980. Procedure TBucket.Setweight(AIndex : Integer; const AValue : integer);
  981. begin
  982. If (Fweight=AValue) then exit;
  983. Fweight:=AValue;
  984. MarkPropertyChanged(AIndex);
  985. end;
  986. { --------------------------------------------------------------------
  987. TColumnTypebaseColumn
  988. --------------------------------------------------------------------}
  989. Procedure TColumnTypebaseColumn.SetcolumnId(AIndex : Integer; const AValue : integer);
  990. begin
  991. If (FcolumnId=AValue) then exit;
  992. FcolumnId:=AValue;
  993. MarkPropertyChanged(AIndex);
  994. end;
  995. Procedure TColumnTypebaseColumn.SettableIndex(AIndex : Integer; const AValue : integer);
  996. begin
  997. If (FtableIndex=AValue) then exit;
  998. FtableIndex:=AValue;
  999. MarkPropertyChanged(AIndex);
  1000. end;
  1001. { --------------------------------------------------------------------
  1002. TColumn
  1003. --------------------------------------------------------------------}
  1004. Procedure TColumn.SetbaseColumn(AIndex : Integer; const AValue : TColumnTypebaseColumn);
  1005. begin
  1006. If (FbaseColumn=AValue) then exit;
  1007. FbaseColumn:=AValue;
  1008. MarkPropertyChanged(AIndex);
  1009. end;
  1010. Procedure TColumn.SetcolumnId(AIndex : Integer; const AValue : integer);
  1011. begin
  1012. If (FcolumnId=AValue) then exit;
  1013. FcolumnId:=AValue;
  1014. MarkPropertyChanged(AIndex);
  1015. end;
  1016. Procedure TColumn.SetcolumnJsonSchema(AIndex : Integer; const AValue : String);
  1017. begin
  1018. If (FcolumnJsonSchema=AValue) then exit;
  1019. FcolumnJsonSchema:=AValue;
  1020. MarkPropertyChanged(AIndex);
  1021. end;
  1022. Procedure TColumn.SetcolumnPropertiesJson(AIndex : Integer; const AValue : String);
  1023. begin
  1024. If (FcolumnPropertiesJson=AValue) then exit;
  1025. FcolumnPropertiesJson:=AValue;
  1026. MarkPropertyChanged(AIndex);
  1027. end;
  1028. Procedure TColumn.Setdescription(AIndex : Integer; const AValue : String);
  1029. begin
  1030. If (Fdescription=AValue) then exit;
  1031. Fdescription:=AValue;
  1032. MarkPropertyChanged(AIndex);
  1033. end;
  1034. Procedure TColumn.SetformatPattern(AIndex : Integer; const AValue : String);
  1035. begin
  1036. If (FformatPattern=AValue) then exit;
  1037. FformatPattern:=AValue;
  1038. MarkPropertyChanged(AIndex);
  1039. end;
  1040. Procedure TColumn.SetgraphPredicate(AIndex : Integer; const AValue : String);
  1041. begin
  1042. If (FgraphPredicate=AValue) then exit;
  1043. FgraphPredicate:=AValue;
  1044. MarkPropertyChanged(AIndex);
  1045. end;
  1046. Procedure TColumn.Setkind(AIndex : Integer; const AValue : String);
  1047. begin
  1048. If (Fkind=AValue) then exit;
  1049. Fkind:=AValue;
  1050. MarkPropertyChanged(AIndex);
  1051. end;
  1052. Procedure TColumn.Setname(AIndex : Integer; const AValue : String);
  1053. begin
  1054. If (Fname=AValue) then exit;
  1055. Fname:=AValue;
  1056. MarkPropertyChanged(AIndex);
  1057. end;
  1058. Procedure TColumn.Set_type(AIndex : Integer; const AValue : String);
  1059. begin
  1060. If (F_type=AValue) then exit;
  1061. F_type:=AValue;
  1062. MarkPropertyChanged(AIndex);
  1063. end;
  1064. Procedure TColumn.SetvalidValues(AIndex : Integer; const AValue : TStringArray);
  1065. begin
  1066. If (FvalidValues=AValue) then exit;
  1067. FvalidValues:=AValue;
  1068. MarkPropertyChanged(AIndex);
  1069. end;
  1070. Procedure TColumn.SetvalidateData(AIndex : Integer; const AValue : boolean);
  1071. begin
  1072. If (FvalidateData=AValue) then exit;
  1073. FvalidateData:=AValue;
  1074. MarkPropertyChanged(AIndex);
  1075. end;
  1076. Class Function TColumn.ExportPropertyName(Const AName : String) :String;
  1077. begin
  1078. Case AName of
  1079. '_type' : Result:='type';
  1080. else
  1081. Result:=Inherited ExportPropertyName(AName);
  1082. end;
  1083. end;
  1084. //2.6.4. bug workaround
  1085. {$IFDEF VER2_6}
  1086. Procedure TColumn.SetArrayLength(Const AName : String; ALength : Longint);
  1087. begin
  1088. Case AName of
  1089. 'validvalues' : SetLength(FvalidValues,ALength);
  1090. else
  1091. Inherited SetArrayLength(AName,ALength);
  1092. end;
  1093. end;
  1094. {$ENDIF VER2_6}
  1095. { --------------------------------------------------------------------
  1096. TColumnList
  1097. --------------------------------------------------------------------}
  1098. Procedure TColumnList.Setitems(AIndex : Integer; const AValue : TColumnListTypeitemsArray);
  1099. begin
  1100. If (Fitems=AValue) then exit;
  1101. Fitems:=AValue;
  1102. MarkPropertyChanged(AIndex);
  1103. end;
  1104. Procedure TColumnList.Setkind(AIndex : Integer; const AValue : String);
  1105. begin
  1106. If (Fkind=AValue) then exit;
  1107. Fkind:=AValue;
  1108. MarkPropertyChanged(AIndex);
  1109. end;
  1110. Procedure TColumnList.SetnextPageToken(AIndex : Integer; const AValue : String);
  1111. begin
  1112. If (FnextPageToken=AValue) then exit;
  1113. FnextPageToken:=AValue;
  1114. MarkPropertyChanged(AIndex);
  1115. end;
  1116. Procedure TColumnList.SettotalItems(AIndex : Integer; const AValue : integer);
  1117. begin
  1118. If (FtotalItems=AValue) then exit;
  1119. FtotalItems:=AValue;
  1120. MarkPropertyChanged(AIndex);
  1121. end;
  1122. //2.6.4. bug workaround
  1123. {$IFDEF VER2_6}
  1124. Procedure TColumnList.SetArrayLength(Const AName : String; ALength : Longint);
  1125. begin
  1126. Case AName of
  1127. 'items' : SetLength(Fitems,ALength);
  1128. else
  1129. Inherited SetArrayLength(AName,ALength);
  1130. end;
  1131. end;
  1132. {$ENDIF VER2_6}
  1133. { --------------------------------------------------------------------
  1134. TGeometry
  1135. --------------------------------------------------------------------}
  1136. Procedure TGeometry.Setgeometries(AIndex : Integer; const AValue : TTJSONSchemaArray);
  1137. begin
  1138. If (Fgeometries=AValue) then exit;
  1139. Fgeometries:=AValue;
  1140. MarkPropertyChanged(AIndex);
  1141. end;
  1142. Procedure TGeometry.Setgeometry(AIndex : Integer; const AValue : TJSONSchema);
  1143. begin
  1144. If (Fgeometry=AValue) then exit;
  1145. Fgeometry:=AValue;
  1146. MarkPropertyChanged(AIndex);
  1147. end;
  1148. Procedure TGeometry.Set_type(AIndex : Integer; const AValue : String);
  1149. begin
  1150. If (F_type=AValue) then exit;
  1151. F_type:=AValue;
  1152. MarkPropertyChanged(AIndex);
  1153. end;
  1154. Class Function TGeometry.ExportPropertyName(Const AName : String) :String;
  1155. begin
  1156. Case AName of
  1157. '_type' : Result:='type';
  1158. else
  1159. Result:=Inherited ExportPropertyName(AName);
  1160. end;
  1161. end;
  1162. //2.6.4. bug workaround
  1163. {$IFDEF VER2_6}
  1164. Procedure TGeometry.SetArrayLength(Const AName : String; ALength : Longint);
  1165. begin
  1166. Case AName of
  1167. 'geometries' : SetLength(Fgeometries,ALength);
  1168. else
  1169. Inherited SetArrayLength(AName,ALength);
  1170. end;
  1171. end;
  1172. {$ENDIF VER2_6}
  1173. { --------------------------------------------------------------------
  1174. TImport
  1175. --------------------------------------------------------------------}
  1176. Procedure TImport.Setkind(AIndex : Integer; const AValue : String);
  1177. begin
  1178. If (Fkind=AValue) then exit;
  1179. Fkind:=AValue;
  1180. MarkPropertyChanged(AIndex);
  1181. end;
  1182. Procedure TImport.SetnumRowsReceived(AIndex : Integer; const AValue : String);
  1183. begin
  1184. If (FnumRowsReceived=AValue) then exit;
  1185. FnumRowsReceived:=AValue;
  1186. MarkPropertyChanged(AIndex);
  1187. end;
  1188. { --------------------------------------------------------------------
  1189. TLine
  1190. --------------------------------------------------------------------}
  1191. Procedure TLine.Setcoordinates(AIndex : Integer; const AValue : TLineTypecoordinatesArray);
  1192. begin
  1193. If (Fcoordinates=AValue) then exit;
  1194. Fcoordinates:=AValue;
  1195. MarkPropertyChanged(AIndex);
  1196. end;
  1197. Procedure TLine.Set_type(AIndex : Integer; const AValue : String);
  1198. begin
  1199. If (F_type=AValue) then exit;
  1200. F_type:=AValue;
  1201. MarkPropertyChanged(AIndex);
  1202. end;
  1203. Class Function TLine.ExportPropertyName(Const AName : String) :String;
  1204. begin
  1205. Case AName of
  1206. '_type' : Result:='type';
  1207. else
  1208. Result:=Inherited ExportPropertyName(AName);
  1209. end;
  1210. end;
  1211. //2.6.4. bug workaround
  1212. {$IFDEF VER2_6}
  1213. Procedure TLine.SetArrayLength(Const AName : String; ALength : Longint);
  1214. begin
  1215. Case AName of
  1216. 'coordinates' : SetLength(Fcoordinates,ALength);
  1217. else
  1218. Inherited SetArrayLength(AName,ALength);
  1219. end;
  1220. end;
  1221. {$ENDIF VER2_6}
  1222. { --------------------------------------------------------------------
  1223. TLineStyle
  1224. --------------------------------------------------------------------}
  1225. Procedure TLineStyle.SetstrokeColor(AIndex : Integer; const AValue : String);
  1226. begin
  1227. If (FstrokeColor=AValue) then exit;
  1228. FstrokeColor:=AValue;
  1229. MarkPropertyChanged(AIndex);
  1230. end;
  1231. Procedure TLineStyle.SetstrokeColorStyler(AIndex : Integer; const AValue : TStyleFunction);
  1232. begin
  1233. If (FstrokeColorStyler=AValue) then exit;
  1234. FstrokeColorStyler:=AValue;
  1235. MarkPropertyChanged(AIndex);
  1236. end;
  1237. Procedure TLineStyle.SetstrokeOpacity(AIndex : Integer; const AValue : double);
  1238. begin
  1239. If (FstrokeOpacity=AValue) then exit;
  1240. FstrokeOpacity:=AValue;
  1241. MarkPropertyChanged(AIndex);
  1242. end;
  1243. Procedure TLineStyle.SetstrokeWeight(AIndex : Integer; const AValue : integer);
  1244. begin
  1245. If (FstrokeWeight=AValue) then exit;
  1246. FstrokeWeight:=AValue;
  1247. MarkPropertyChanged(AIndex);
  1248. end;
  1249. Procedure TLineStyle.SetstrokeWeightStyler(AIndex : Integer; const AValue : TStyleFunction);
  1250. begin
  1251. If (FstrokeWeightStyler=AValue) then exit;
  1252. FstrokeWeightStyler:=AValue;
  1253. MarkPropertyChanged(AIndex);
  1254. end;
  1255. { --------------------------------------------------------------------
  1256. TPoint
  1257. --------------------------------------------------------------------}
  1258. Procedure TPoint.Setcoordinates(AIndex : Integer; const AValue : TdoubleArray);
  1259. begin
  1260. If (Fcoordinates=AValue) then exit;
  1261. Fcoordinates:=AValue;
  1262. MarkPropertyChanged(AIndex);
  1263. end;
  1264. Procedure TPoint.Set_type(AIndex : Integer; const AValue : String);
  1265. begin
  1266. If (F_type=AValue) then exit;
  1267. F_type:=AValue;
  1268. MarkPropertyChanged(AIndex);
  1269. end;
  1270. Class Function TPoint.ExportPropertyName(Const AName : String) :String;
  1271. begin
  1272. Case AName of
  1273. '_type' : Result:='type';
  1274. else
  1275. Result:=Inherited ExportPropertyName(AName);
  1276. end;
  1277. end;
  1278. //2.6.4. bug workaround
  1279. {$IFDEF VER2_6}
  1280. Procedure TPoint.SetArrayLength(Const AName : String; ALength : Longint);
  1281. begin
  1282. Case AName of
  1283. 'coordinates' : SetLength(Fcoordinates,ALength);
  1284. else
  1285. Inherited SetArrayLength(AName,ALength);
  1286. end;
  1287. end;
  1288. {$ENDIF VER2_6}
  1289. { --------------------------------------------------------------------
  1290. TPointStyle
  1291. --------------------------------------------------------------------}
  1292. Procedure TPointStyle.SeticonName(AIndex : Integer; const AValue : String);
  1293. begin
  1294. If (FiconName=AValue) then exit;
  1295. FiconName:=AValue;
  1296. MarkPropertyChanged(AIndex);
  1297. end;
  1298. Procedure TPointStyle.SeticonStyler(AIndex : Integer; const AValue : TStyleFunction);
  1299. begin
  1300. If (FiconStyler=AValue) then exit;
  1301. FiconStyler:=AValue;
  1302. MarkPropertyChanged(AIndex);
  1303. end;
  1304. { --------------------------------------------------------------------
  1305. TPolygon
  1306. --------------------------------------------------------------------}
  1307. Procedure TPolygon.Setcoordinates(AIndex : Integer; const AValue : TPolygonTypecoordinatesArray);
  1308. begin
  1309. If (Fcoordinates=AValue) then exit;
  1310. Fcoordinates:=AValue;
  1311. MarkPropertyChanged(AIndex);
  1312. end;
  1313. Procedure TPolygon.Set_type(AIndex : Integer; const AValue : String);
  1314. begin
  1315. If (F_type=AValue) then exit;
  1316. F_type:=AValue;
  1317. MarkPropertyChanged(AIndex);
  1318. end;
  1319. Class Function TPolygon.ExportPropertyName(Const AName : String) :String;
  1320. begin
  1321. Case AName of
  1322. '_type' : Result:='type';
  1323. else
  1324. Result:=Inherited ExportPropertyName(AName);
  1325. end;
  1326. end;
  1327. //2.6.4. bug workaround
  1328. {$IFDEF VER2_6}
  1329. Procedure TPolygon.SetArrayLength(Const AName : String; ALength : Longint);
  1330. begin
  1331. Case AName of
  1332. 'coordinates' : SetLength(Fcoordinates,ALength);
  1333. else
  1334. Inherited SetArrayLength(AName,ALength);
  1335. end;
  1336. end;
  1337. {$ENDIF VER2_6}
  1338. { --------------------------------------------------------------------
  1339. TPolygonStyle
  1340. --------------------------------------------------------------------}
  1341. Procedure TPolygonStyle.SetfillColor(AIndex : Integer; const AValue : String);
  1342. begin
  1343. If (FfillColor=AValue) then exit;
  1344. FfillColor:=AValue;
  1345. MarkPropertyChanged(AIndex);
  1346. end;
  1347. Procedure TPolygonStyle.SetfillColorStyler(AIndex : Integer; const AValue : TStyleFunction);
  1348. begin
  1349. If (FfillColorStyler=AValue) then exit;
  1350. FfillColorStyler:=AValue;
  1351. MarkPropertyChanged(AIndex);
  1352. end;
  1353. Procedure TPolygonStyle.SetfillOpacity(AIndex : Integer; const AValue : double);
  1354. begin
  1355. If (FfillOpacity=AValue) then exit;
  1356. FfillOpacity:=AValue;
  1357. MarkPropertyChanged(AIndex);
  1358. end;
  1359. Procedure TPolygonStyle.SetstrokeColor(AIndex : Integer; const AValue : String);
  1360. begin
  1361. If (FstrokeColor=AValue) then exit;
  1362. FstrokeColor:=AValue;
  1363. MarkPropertyChanged(AIndex);
  1364. end;
  1365. Procedure TPolygonStyle.SetstrokeColorStyler(AIndex : Integer; const AValue : TStyleFunction);
  1366. begin
  1367. If (FstrokeColorStyler=AValue) then exit;
  1368. FstrokeColorStyler:=AValue;
  1369. MarkPropertyChanged(AIndex);
  1370. end;
  1371. Procedure TPolygonStyle.SetstrokeOpacity(AIndex : Integer; const AValue : double);
  1372. begin
  1373. If (FstrokeOpacity=AValue) then exit;
  1374. FstrokeOpacity:=AValue;
  1375. MarkPropertyChanged(AIndex);
  1376. end;
  1377. Procedure TPolygonStyle.SetstrokeWeight(AIndex : Integer; const AValue : integer);
  1378. begin
  1379. If (FstrokeWeight=AValue) then exit;
  1380. FstrokeWeight:=AValue;
  1381. MarkPropertyChanged(AIndex);
  1382. end;
  1383. Procedure TPolygonStyle.SetstrokeWeightStyler(AIndex : Integer; const AValue : TStyleFunction);
  1384. begin
  1385. If (FstrokeWeightStyler=AValue) then exit;
  1386. FstrokeWeightStyler:=AValue;
  1387. MarkPropertyChanged(AIndex);
  1388. end;
  1389. { --------------------------------------------------------------------
  1390. TSqlresponse
  1391. --------------------------------------------------------------------}
  1392. Procedure TSqlresponse.Setcolumns(AIndex : Integer; const AValue : TStringArray);
  1393. begin
  1394. If (Fcolumns=AValue) then exit;
  1395. Fcolumns:=AValue;
  1396. MarkPropertyChanged(AIndex);
  1397. end;
  1398. Procedure TSqlresponse.Setkind(AIndex : Integer; const AValue : String);
  1399. begin
  1400. If (Fkind=AValue) then exit;
  1401. Fkind:=AValue;
  1402. MarkPropertyChanged(AIndex);
  1403. end;
  1404. Procedure TSqlresponse.Setrows(AIndex : Integer; const AValue : TSqlresponseTyperowsArray);
  1405. begin
  1406. If (Frows=AValue) then exit;
  1407. Frows:=AValue;
  1408. MarkPropertyChanged(AIndex);
  1409. end;
  1410. //2.6.4. bug workaround
  1411. {$IFDEF VER2_6}
  1412. Procedure TSqlresponse.SetArrayLength(Const AName : String; ALength : Longint);
  1413. begin
  1414. Case AName of
  1415. 'columns' : SetLength(Fcolumns,ALength);
  1416. 'rows' : SetLength(Frows,ALength);
  1417. else
  1418. Inherited SetArrayLength(AName,ALength);
  1419. end;
  1420. end;
  1421. {$ENDIF VER2_6}
  1422. { --------------------------------------------------------------------
  1423. TStyleFunctionTypegradientTypecolorsItem
  1424. --------------------------------------------------------------------}
  1425. Procedure TStyleFunctionTypegradientTypecolorsItem.Setcolor(AIndex : Integer; const AValue : String);
  1426. begin
  1427. If (Fcolor=AValue) then exit;
  1428. Fcolor:=AValue;
  1429. MarkPropertyChanged(AIndex);
  1430. end;
  1431. Procedure TStyleFunctionTypegradientTypecolorsItem.Setopacity(AIndex : Integer; const AValue : double);
  1432. begin
  1433. If (Fopacity=AValue) then exit;
  1434. Fopacity:=AValue;
  1435. MarkPropertyChanged(AIndex);
  1436. end;
  1437. { --------------------------------------------------------------------
  1438. TStyleFunctionTypegradient
  1439. --------------------------------------------------------------------}
  1440. Procedure TStyleFunctionTypegradient.Setcolors(AIndex : Integer; const AValue : TStyleFunctionTypegradientTypecolorsArray);
  1441. begin
  1442. If (Fcolors=AValue) then exit;
  1443. Fcolors:=AValue;
  1444. MarkPropertyChanged(AIndex);
  1445. end;
  1446. Procedure TStyleFunctionTypegradient.Setmax(AIndex : Integer; const AValue : double);
  1447. begin
  1448. If (Fmax=AValue) then exit;
  1449. Fmax:=AValue;
  1450. MarkPropertyChanged(AIndex);
  1451. end;
  1452. Procedure TStyleFunctionTypegradient.Setmin(AIndex : Integer; const AValue : double);
  1453. begin
  1454. If (Fmin=AValue) then exit;
  1455. Fmin:=AValue;
  1456. MarkPropertyChanged(AIndex);
  1457. end;
  1458. //2.6.4. bug workaround
  1459. {$IFDEF VER2_6}
  1460. Procedure TStyleFunctionTypegradient.SetArrayLength(Const AName : String; ALength : Longint);
  1461. begin
  1462. Case AName of
  1463. 'colors' : SetLength(Fcolors,ALength);
  1464. else
  1465. Inherited SetArrayLength(AName,ALength);
  1466. end;
  1467. end;
  1468. {$ENDIF VER2_6}
  1469. { --------------------------------------------------------------------
  1470. TStyleFunction
  1471. --------------------------------------------------------------------}
  1472. Procedure TStyleFunction.Setbuckets(AIndex : Integer; const AValue : TStyleFunctionTypebucketsArray);
  1473. begin
  1474. If (Fbuckets=AValue) then exit;
  1475. Fbuckets:=AValue;
  1476. MarkPropertyChanged(AIndex);
  1477. end;
  1478. Procedure TStyleFunction.SetcolumnName(AIndex : Integer; const AValue : String);
  1479. begin
  1480. If (FcolumnName=AValue) then exit;
  1481. FcolumnName:=AValue;
  1482. MarkPropertyChanged(AIndex);
  1483. end;
  1484. Procedure TStyleFunction.Setgradient(AIndex : Integer; const AValue : TStyleFunctionTypegradient);
  1485. begin
  1486. If (Fgradient=AValue) then exit;
  1487. Fgradient:=AValue;
  1488. MarkPropertyChanged(AIndex);
  1489. end;
  1490. Procedure TStyleFunction.Setkind(AIndex : Integer; const AValue : String);
  1491. begin
  1492. If (Fkind=AValue) then exit;
  1493. Fkind:=AValue;
  1494. MarkPropertyChanged(AIndex);
  1495. end;
  1496. //2.6.4. bug workaround
  1497. {$IFDEF VER2_6}
  1498. Procedure TStyleFunction.SetArrayLength(Const AName : String; ALength : Longint);
  1499. begin
  1500. Case AName of
  1501. 'buckets' : SetLength(Fbuckets,ALength);
  1502. else
  1503. Inherited SetArrayLength(AName,ALength);
  1504. end;
  1505. end;
  1506. {$ENDIF VER2_6}
  1507. { --------------------------------------------------------------------
  1508. TStyleSetting
  1509. --------------------------------------------------------------------}
  1510. Procedure TStyleSetting.Setkind(AIndex : Integer; const AValue : String);
  1511. begin
  1512. If (Fkind=AValue) then exit;
  1513. Fkind:=AValue;
  1514. MarkPropertyChanged(AIndex);
  1515. end;
  1516. Procedure TStyleSetting.SetmarkerOptions(AIndex : Integer; const AValue : TPointStyle);
  1517. begin
  1518. If (FmarkerOptions=AValue) then exit;
  1519. FmarkerOptions:=AValue;
  1520. MarkPropertyChanged(AIndex);
  1521. end;
  1522. Procedure TStyleSetting.Setname(AIndex : Integer; const AValue : String);
  1523. begin
  1524. If (Fname=AValue) then exit;
  1525. Fname:=AValue;
  1526. MarkPropertyChanged(AIndex);
  1527. end;
  1528. Procedure TStyleSetting.SetpolygonOptions(AIndex : Integer; const AValue : TPolygonStyle);
  1529. begin
  1530. If (FpolygonOptions=AValue) then exit;
  1531. FpolygonOptions:=AValue;
  1532. MarkPropertyChanged(AIndex);
  1533. end;
  1534. Procedure TStyleSetting.SetpolylineOptions(AIndex : Integer; const AValue : TLineStyle);
  1535. begin
  1536. If (FpolylineOptions=AValue) then exit;
  1537. FpolylineOptions:=AValue;
  1538. MarkPropertyChanged(AIndex);
  1539. end;
  1540. Procedure TStyleSetting.SetstyleId(AIndex : Integer; const AValue : integer);
  1541. begin
  1542. If (FstyleId=AValue) then exit;
  1543. FstyleId:=AValue;
  1544. MarkPropertyChanged(AIndex);
  1545. end;
  1546. Procedure TStyleSetting.SettableId(AIndex : Integer; const AValue : String);
  1547. begin
  1548. If (FtableId=AValue) then exit;
  1549. FtableId:=AValue;
  1550. MarkPropertyChanged(AIndex);
  1551. end;
  1552. { --------------------------------------------------------------------
  1553. TStyleSettingList
  1554. --------------------------------------------------------------------}
  1555. Procedure TStyleSettingList.Setitems(AIndex : Integer; const AValue : TStyleSettingListTypeitemsArray);
  1556. begin
  1557. If (Fitems=AValue) then exit;
  1558. Fitems:=AValue;
  1559. MarkPropertyChanged(AIndex);
  1560. end;
  1561. Procedure TStyleSettingList.Setkind(AIndex : Integer; const AValue : String);
  1562. begin
  1563. If (Fkind=AValue) then exit;
  1564. Fkind:=AValue;
  1565. MarkPropertyChanged(AIndex);
  1566. end;
  1567. Procedure TStyleSettingList.SetnextPageToken(AIndex : Integer; const AValue : String);
  1568. begin
  1569. If (FnextPageToken=AValue) then exit;
  1570. FnextPageToken:=AValue;
  1571. MarkPropertyChanged(AIndex);
  1572. end;
  1573. Procedure TStyleSettingList.SettotalItems(AIndex : Integer; const AValue : integer);
  1574. begin
  1575. If (FtotalItems=AValue) then exit;
  1576. FtotalItems:=AValue;
  1577. MarkPropertyChanged(AIndex);
  1578. end;
  1579. //2.6.4. bug workaround
  1580. {$IFDEF VER2_6}
  1581. Procedure TStyleSettingList.SetArrayLength(Const AName : String; ALength : Longint);
  1582. begin
  1583. Case AName of
  1584. 'items' : SetLength(Fitems,ALength);
  1585. else
  1586. Inherited SetArrayLength(AName,ALength);
  1587. end;
  1588. end;
  1589. {$ENDIF VER2_6}
  1590. { --------------------------------------------------------------------
  1591. TTable
  1592. --------------------------------------------------------------------}
  1593. Procedure TTable.Setattribution(AIndex : Integer; const AValue : String);
  1594. begin
  1595. If (Fattribution=AValue) then exit;
  1596. Fattribution:=AValue;
  1597. MarkPropertyChanged(AIndex);
  1598. end;
  1599. Procedure TTable.SetattributionLink(AIndex : Integer; const AValue : String);
  1600. begin
  1601. If (FattributionLink=AValue) then exit;
  1602. FattributionLink:=AValue;
  1603. MarkPropertyChanged(AIndex);
  1604. end;
  1605. Procedure TTable.SetbaseTableIds(AIndex : Integer; const AValue : TStringArray);
  1606. begin
  1607. If (FbaseTableIds=AValue) then exit;
  1608. FbaseTableIds:=AValue;
  1609. MarkPropertyChanged(AIndex);
  1610. end;
  1611. Procedure TTable.SetcolumnPropertiesJsonSchema(AIndex : Integer; const AValue : String);
  1612. begin
  1613. If (FcolumnPropertiesJsonSchema=AValue) then exit;
  1614. FcolumnPropertiesJsonSchema:=AValue;
  1615. MarkPropertyChanged(AIndex);
  1616. end;
  1617. Procedure TTable.Setcolumns(AIndex : Integer; const AValue : TTableTypecolumnsArray);
  1618. begin
  1619. If (Fcolumns=AValue) then exit;
  1620. Fcolumns:=AValue;
  1621. MarkPropertyChanged(AIndex);
  1622. end;
  1623. Procedure TTable.Setdescription(AIndex : Integer; const AValue : String);
  1624. begin
  1625. If (Fdescription=AValue) then exit;
  1626. Fdescription:=AValue;
  1627. MarkPropertyChanged(AIndex);
  1628. end;
  1629. Procedure TTable.SetisExportable(AIndex : Integer; const AValue : boolean);
  1630. begin
  1631. If (FisExportable=AValue) then exit;
  1632. FisExportable:=AValue;
  1633. MarkPropertyChanged(AIndex);
  1634. end;
  1635. Procedure TTable.Setkind(AIndex : Integer; const AValue : String);
  1636. begin
  1637. If (Fkind=AValue) then exit;
  1638. Fkind:=AValue;
  1639. MarkPropertyChanged(AIndex);
  1640. end;
  1641. Procedure TTable.Setname(AIndex : Integer; const AValue : String);
  1642. begin
  1643. If (Fname=AValue) then exit;
  1644. Fname:=AValue;
  1645. MarkPropertyChanged(AIndex);
  1646. end;
  1647. Procedure TTable.Setsql(AIndex : Integer; const AValue : String);
  1648. begin
  1649. If (Fsql=AValue) then exit;
  1650. Fsql:=AValue;
  1651. MarkPropertyChanged(AIndex);
  1652. end;
  1653. Procedure TTable.SettableId(AIndex : Integer; const AValue : String);
  1654. begin
  1655. If (FtableId=AValue) then exit;
  1656. FtableId:=AValue;
  1657. MarkPropertyChanged(AIndex);
  1658. end;
  1659. Procedure TTable.SettablePropertiesJson(AIndex : Integer; const AValue : String);
  1660. begin
  1661. If (FtablePropertiesJson=AValue) then exit;
  1662. FtablePropertiesJson:=AValue;
  1663. MarkPropertyChanged(AIndex);
  1664. end;
  1665. Procedure TTable.SettablePropertiesJsonSchema(AIndex : Integer; const AValue : String);
  1666. begin
  1667. If (FtablePropertiesJsonSchema=AValue) then exit;
  1668. FtablePropertiesJsonSchema:=AValue;
  1669. MarkPropertyChanged(AIndex);
  1670. end;
  1671. //2.6.4. bug workaround
  1672. {$IFDEF VER2_6}
  1673. Procedure TTable.SetArrayLength(Const AName : String; ALength : Longint);
  1674. begin
  1675. Case AName of
  1676. 'basetableids' : SetLength(FbaseTableIds,ALength);
  1677. 'columns' : SetLength(Fcolumns,ALength);
  1678. else
  1679. Inherited SetArrayLength(AName,ALength);
  1680. end;
  1681. end;
  1682. {$ENDIF VER2_6}
  1683. { --------------------------------------------------------------------
  1684. TTableList
  1685. --------------------------------------------------------------------}
  1686. Procedure TTableList.Setitems(AIndex : Integer; const AValue : TTableListTypeitemsArray);
  1687. begin
  1688. If (Fitems=AValue) then exit;
  1689. Fitems:=AValue;
  1690. MarkPropertyChanged(AIndex);
  1691. end;
  1692. Procedure TTableList.Setkind(AIndex : Integer; const AValue : String);
  1693. begin
  1694. If (Fkind=AValue) then exit;
  1695. Fkind:=AValue;
  1696. MarkPropertyChanged(AIndex);
  1697. end;
  1698. Procedure TTableList.SetnextPageToken(AIndex : Integer; const AValue : String);
  1699. begin
  1700. If (FnextPageToken=AValue) then exit;
  1701. FnextPageToken:=AValue;
  1702. MarkPropertyChanged(AIndex);
  1703. end;
  1704. //2.6.4. bug workaround
  1705. {$IFDEF VER2_6}
  1706. Procedure TTableList.SetArrayLength(Const AName : String; ALength : Longint);
  1707. begin
  1708. Case AName of
  1709. 'items' : SetLength(Fitems,ALength);
  1710. else
  1711. Inherited SetArrayLength(AName,ALength);
  1712. end;
  1713. end;
  1714. {$ENDIF VER2_6}
  1715. { --------------------------------------------------------------------
  1716. TTask
  1717. --------------------------------------------------------------------}
  1718. Procedure TTask.Setkind(AIndex : Integer; const AValue : String);
  1719. begin
  1720. If (Fkind=AValue) then exit;
  1721. Fkind:=AValue;
  1722. MarkPropertyChanged(AIndex);
  1723. end;
  1724. Procedure TTask.Setprogress(AIndex : Integer; const AValue : String);
  1725. begin
  1726. If (Fprogress=AValue) then exit;
  1727. Fprogress:=AValue;
  1728. MarkPropertyChanged(AIndex);
  1729. end;
  1730. Procedure TTask.Setstarted(AIndex : Integer; const AValue : boolean);
  1731. begin
  1732. If (Fstarted=AValue) then exit;
  1733. Fstarted:=AValue;
  1734. MarkPropertyChanged(AIndex);
  1735. end;
  1736. Procedure TTask.SettaskId(AIndex : Integer; const AValue : String);
  1737. begin
  1738. If (FtaskId=AValue) then exit;
  1739. FtaskId:=AValue;
  1740. MarkPropertyChanged(AIndex);
  1741. end;
  1742. Procedure TTask.Set_type(AIndex : Integer; const AValue : String);
  1743. begin
  1744. If (F_type=AValue) then exit;
  1745. F_type:=AValue;
  1746. MarkPropertyChanged(AIndex);
  1747. end;
  1748. Class Function TTask.ExportPropertyName(Const AName : String) :String;
  1749. begin
  1750. Case AName of
  1751. '_type' : Result:='type';
  1752. else
  1753. Result:=Inherited ExportPropertyName(AName);
  1754. end;
  1755. end;
  1756. { --------------------------------------------------------------------
  1757. TTaskList
  1758. --------------------------------------------------------------------}
  1759. Procedure TTaskList.Setitems(AIndex : Integer; const AValue : TTaskListTypeitemsArray);
  1760. begin
  1761. If (Fitems=AValue) then exit;
  1762. Fitems:=AValue;
  1763. MarkPropertyChanged(AIndex);
  1764. end;
  1765. Procedure TTaskList.Setkind(AIndex : Integer; const AValue : String);
  1766. begin
  1767. If (Fkind=AValue) then exit;
  1768. Fkind:=AValue;
  1769. MarkPropertyChanged(AIndex);
  1770. end;
  1771. Procedure TTaskList.SetnextPageToken(AIndex : Integer; const AValue : String);
  1772. begin
  1773. If (FnextPageToken=AValue) then exit;
  1774. FnextPageToken:=AValue;
  1775. MarkPropertyChanged(AIndex);
  1776. end;
  1777. Procedure TTaskList.SettotalItems(AIndex : Integer; const AValue : integer);
  1778. begin
  1779. If (FtotalItems=AValue) then exit;
  1780. FtotalItems:=AValue;
  1781. MarkPropertyChanged(AIndex);
  1782. end;
  1783. //2.6.4. bug workaround
  1784. {$IFDEF VER2_6}
  1785. Procedure TTaskList.SetArrayLength(Const AName : String; ALength : Longint);
  1786. begin
  1787. Case AName of
  1788. 'items' : SetLength(Fitems,ALength);
  1789. else
  1790. Inherited SetArrayLength(AName,ALength);
  1791. end;
  1792. end;
  1793. {$ENDIF VER2_6}
  1794. { --------------------------------------------------------------------
  1795. TTemplate
  1796. --------------------------------------------------------------------}
  1797. Procedure TTemplate.SetautomaticColumnNames(AIndex : Integer; const AValue : TStringArray);
  1798. begin
  1799. If (FautomaticColumnNames=AValue) then exit;
  1800. FautomaticColumnNames:=AValue;
  1801. MarkPropertyChanged(AIndex);
  1802. end;
  1803. Procedure TTemplate.Setbody(AIndex : Integer; const AValue : String);
  1804. begin
  1805. If (Fbody=AValue) then exit;
  1806. Fbody:=AValue;
  1807. MarkPropertyChanged(AIndex);
  1808. end;
  1809. Procedure TTemplate.Setkind(AIndex : Integer; const AValue : String);
  1810. begin
  1811. If (Fkind=AValue) then exit;
  1812. Fkind:=AValue;
  1813. MarkPropertyChanged(AIndex);
  1814. end;
  1815. Procedure TTemplate.Setname(AIndex : Integer; const AValue : String);
  1816. begin
  1817. If (Fname=AValue) then exit;
  1818. Fname:=AValue;
  1819. MarkPropertyChanged(AIndex);
  1820. end;
  1821. Procedure TTemplate.SettableId(AIndex : Integer; const AValue : String);
  1822. begin
  1823. If (FtableId=AValue) then exit;
  1824. FtableId:=AValue;
  1825. MarkPropertyChanged(AIndex);
  1826. end;
  1827. Procedure TTemplate.SettemplateId(AIndex : Integer; const AValue : integer);
  1828. begin
  1829. If (FtemplateId=AValue) then exit;
  1830. FtemplateId:=AValue;
  1831. MarkPropertyChanged(AIndex);
  1832. end;
  1833. //2.6.4. bug workaround
  1834. {$IFDEF VER2_6}
  1835. Procedure TTemplate.SetArrayLength(Const AName : String; ALength : Longint);
  1836. begin
  1837. Case AName of
  1838. 'automaticcolumnnames' : SetLength(FautomaticColumnNames,ALength);
  1839. else
  1840. Inherited SetArrayLength(AName,ALength);
  1841. end;
  1842. end;
  1843. {$ENDIF VER2_6}
  1844. { --------------------------------------------------------------------
  1845. TTemplateList
  1846. --------------------------------------------------------------------}
  1847. Procedure TTemplateList.Setitems(AIndex : Integer; const AValue : TTemplateListTypeitemsArray);
  1848. begin
  1849. If (Fitems=AValue) then exit;
  1850. Fitems:=AValue;
  1851. MarkPropertyChanged(AIndex);
  1852. end;
  1853. Procedure TTemplateList.Setkind(AIndex : Integer; const AValue : String);
  1854. begin
  1855. If (Fkind=AValue) then exit;
  1856. Fkind:=AValue;
  1857. MarkPropertyChanged(AIndex);
  1858. end;
  1859. Procedure TTemplateList.SetnextPageToken(AIndex : Integer; const AValue : String);
  1860. begin
  1861. If (FnextPageToken=AValue) then exit;
  1862. FnextPageToken:=AValue;
  1863. MarkPropertyChanged(AIndex);
  1864. end;
  1865. Procedure TTemplateList.SettotalItems(AIndex : Integer; const AValue : integer);
  1866. begin
  1867. If (FtotalItems=AValue) then exit;
  1868. FtotalItems:=AValue;
  1869. MarkPropertyChanged(AIndex);
  1870. end;
  1871. //2.6.4. bug workaround
  1872. {$IFDEF VER2_6}
  1873. Procedure TTemplateList.SetArrayLength(Const AName : String; ALength : Longint);
  1874. begin
  1875. Case AName of
  1876. 'items' : SetLength(Fitems,ALength);
  1877. else
  1878. Inherited SetArrayLength(AName,ALength);
  1879. end;
  1880. end;
  1881. {$ENDIF VER2_6}
  1882. { --------------------------------------------------------------------
  1883. TColumnResource
  1884. --------------------------------------------------------------------}
  1885. Class Function TColumnResource.ResourceName : String;
  1886. begin
  1887. Result:='column';
  1888. end;
  1889. Class Function TColumnResource.DefaultAPI : TGoogleAPIClass;
  1890. begin
  1891. Result:=TfusiontablesAPI;
  1892. end;
  1893. Procedure TColumnResource.Delete(columnId: string; tableId: string);
  1894. Const
  1895. _HTTPMethod = 'DELETE';
  1896. _Path = 'tables/{tableId}/columns/{columnId}';
  1897. _Methodid = 'fusiontables.column.delete';
  1898. Var
  1899. _P : String;
  1900. begin
  1901. _P:=SubstitutePath(_Path,['columnId',columnId,'tableId',tableId]);
  1902. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  1903. end;
  1904. Function TColumnResource.Get(columnId: string; tableId: string) : TColumn;
  1905. Const
  1906. _HTTPMethod = 'GET';
  1907. _Path = 'tables/{tableId}/columns/{columnId}';
  1908. _Methodid = 'fusiontables.column.get';
  1909. Var
  1910. _P : String;
  1911. begin
  1912. _P:=SubstitutePath(_Path,['columnId',columnId,'tableId',tableId]);
  1913. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TColumn) as TColumn;
  1914. end;
  1915. Function TColumnResource.Insert(tableId: string; aColumn : TColumn) : TColumn;
  1916. Const
  1917. _HTTPMethod = 'POST';
  1918. _Path = 'tables/{tableId}/columns';
  1919. _Methodid = 'fusiontables.column.insert';
  1920. Var
  1921. _P : String;
  1922. begin
  1923. _P:=SubstitutePath(_Path,['tableId',tableId]);
  1924. Result:=ServiceCall(_HTTPMethod,_P,'',aColumn,TColumn) as TColumn;
  1925. end;
  1926. Function TColumnResource.List(tableId: string; AQuery : string = '') : TColumnList;
  1927. Const
  1928. _HTTPMethod = 'GET';
  1929. _Path = 'tables/{tableId}/columns';
  1930. _Methodid = 'fusiontables.column.list';
  1931. Var
  1932. _P : String;
  1933. begin
  1934. _P:=SubstitutePath(_Path,['tableId',tableId]);
  1935. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TColumnList) as TColumnList;
  1936. end;
  1937. Function TColumnResource.List(tableId: string; AQuery : TColumnlistOptions) : TColumnList;
  1938. Var
  1939. _Q : String;
  1940. begin
  1941. _Q:='';
  1942. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1943. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1944. Result:=List(tableId,_Q);
  1945. end;
  1946. Function TColumnResource.Patch(columnId: string; tableId: string; aColumn : TColumn) : TColumn;
  1947. Const
  1948. _HTTPMethod = 'PATCH';
  1949. _Path = 'tables/{tableId}/columns/{columnId}';
  1950. _Methodid = 'fusiontables.column.patch';
  1951. Var
  1952. _P : String;
  1953. begin
  1954. _P:=SubstitutePath(_Path,['columnId',columnId,'tableId',tableId]);
  1955. Result:=ServiceCall(_HTTPMethod,_P,'',aColumn,TColumn) as TColumn;
  1956. end;
  1957. Function TColumnResource.Update(columnId: string; tableId: string; aColumn : TColumn) : TColumn;
  1958. Const
  1959. _HTTPMethod = 'PUT';
  1960. _Path = 'tables/{tableId}/columns/{columnId}';
  1961. _Methodid = 'fusiontables.column.update';
  1962. Var
  1963. _P : String;
  1964. begin
  1965. _P:=SubstitutePath(_Path,['columnId',columnId,'tableId',tableId]);
  1966. Result:=ServiceCall(_HTTPMethod,_P,'',aColumn,TColumn) as TColumn;
  1967. end;
  1968. { --------------------------------------------------------------------
  1969. TQueryResource
  1970. --------------------------------------------------------------------}
  1971. Class Function TQueryResource.ResourceName : String;
  1972. begin
  1973. Result:='query';
  1974. end;
  1975. Class Function TQueryResource.DefaultAPI : TGoogleAPIClass;
  1976. begin
  1977. Result:=TfusiontablesAPI;
  1978. end;
  1979. Function TQueryResource.Sql(AQuery : string = '') : TSqlresponse;
  1980. Const
  1981. _HTTPMethod = 'POST';
  1982. _Path = 'query';
  1983. _Methodid = 'fusiontables.query.sql';
  1984. begin
  1985. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TSqlresponse) as TSqlresponse;
  1986. end;
  1987. Function TQueryResource.Sql(AQuery : TQuerysqlOptions) : TSqlresponse;
  1988. Var
  1989. _Q : String;
  1990. begin
  1991. _Q:='';
  1992. AddToQuery(_Q,'hdrs',AQuery.hdrs);
  1993. AddToQuery(_Q,'sql',AQuery.sql);
  1994. AddToQuery(_Q,'typed',AQuery.typed);
  1995. Result:=Sql(_Q);
  1996. end;
  1997. Function TQueryResource.SqlGet(AQuery : string = '') : TSqlresponse;
  1998. Const
  1999. _HTTPMethod = 'GET';
  2000. _Path = 'query';
  2001. _Methodid = 'fusiontables.query.sqlGet';
  2002. begin
  2003. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TSqlresponse) as TSqlresponse;
  2004. end;
  2005. Function TQueryResource.SqlGet(AQuery : TQuerysqlGetOptions) : TSqlresponse;
  2006. Var
  2007. _Q : String;
  2008. begin
  2009. _Q:='';
  2010. AddToQuery(_Q,'hdrs',AQuery.hdrs);
  2011. AddToQuery(_Q,'sql',AQuery.sql);
  2012. AddToQuery(_Q,'typed',AQuery.typed);
  2013. Result:=SqlGet(_Q);
  2014. end;
  2015. { --------------------------------------------------------------------
  2016. TStyleResource
  2017. --------------------------------------------------------------------}
  2018. Class Function TStyleResource.ResourceName : String;
  2019. begin
  2020. Result:='style';
  2021. end;
  2022. Class Function TStyleResource.DefaultAPI : TGoogleAPIClass;
  2023. begin
  2024. Result:=TfusiontablesAPI;
  2025. end;
  2026. Procedure TStyleResource.Delete(styleId: integer; tableId: string);
  2027. Const
  2028. _HTTPMethod = 'DELETE';
  2029. _Path = 'tables/{tableId}/styles/{styleId}';
  2030. _Methodid = 'fusiontables.style.delete';
  2031. Var
  2032. _P : String;
  2033. begin
  2034. _P:=SubstitutePath(_Path,['styleId',styleId,'tableId',tableId]);
  2035. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  2036. end;
  2037. Function TStyleResource.Get(styleId: integer; tableId: string) : TStyleSetting;
  2038. Const
  2039. _HTTPMethod = 'GET';
  2040. _Path = 'tables/{tableId}/styles/{styleId}';
  2041. _Methodid = 'fusiontables.style.get';
  2042. Var
  2043. _P : String;
  2044. begin
  2045. _P:=SubstitutePath(_Path,['styleId',styleId,'tableId',tableId]);
  2046. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TStyleSetting) as TStyleSetting;
  2047. end;
  2048. Function TStyleResource.Insert(tableId: string; aStyleSetting : TStyleSetting) : TStyleSetting;
  2049. Const
  2050. _HTTPMethod = 'POST';
  2051. _Path = 'tables/{tableId}/styles';
  2052. _Methodid = 'fusiontables.style.insert';
  2053. Var
  2054. _P : String;
  2055. begin
  2056. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2057. Result:=ServiceCall(_HTTPMethod,_P,'',aStyleSetting,TStyleSetting) as TStyleSetting;
  2058. end;
  2059. Function TStyleResource.List(tableId: string; AQuery : string = '') : TStyleSettingList;
  2060. Const
  2061. _HTTPMethod = 'GET';
  2062. _Path = 'tables/{tableId}/styles';
  2063. _Methodid = 'fusiontables.style.list';
  2064. Var
  2065. _P : String;
  2066. begin
  2067. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2068. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TStyleSettingList) as TStyleSettingList;
  2069. end;
  2070. Function TStyleResource.List(tableId: string; AQuery : TStylelistOptions) : TStyleSettingList;
  2071. Var
  2072. _Q : String;
  2073. begin
  2074. _Q:='';
  2075. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  2076. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  2077. Result:=List(tableId,_Q);
  2078. end;
  2079. Function TStyleResource.Patch(styleId: integer; tableId: string; aStyleSetting : TStyleSetting) : TStyleSetting;
  2080. Const
  2081. _HTTPMethod = 'PATCH';
  2082. _Path = 'tables/{tableId}/styles/{styleId}';
  2083. _Methodid = 'fusiontables.style.patch';
  2084. Var
  2085. _P : String;
  2086. begin
  2087. _P:=SubstitutePath(_Path,['styleId',styleId,'tableId',tableId]);
  2088. Result:=ServiceCall(_HTTPMethod,_P,'',aStyleSetting,TStyleSetting) as TStyleSetting;
  2089. end;
  2090. Function TStyleResource.Update(styleId: integer; tableId: string; aStyleSetting : TStyleSetting) : TStyleSetting;
  2091. Const
  2092. _HTTPMethod = 'PUT';
  2093. _Path = 'tables/{tableId}/styles/{styleId}';
  2094. _Methodid = 'fusiontables.style.update';
  2095. Var
  2096. _P : String;
  2097. begin
  2098. _P:=SubstitutePath(_Path,['styleId',styleId,'tableId',tableId]);
  2099. Result:=ServiceCall(_HTTPMethod,_P,'',aStyleSetting,TStyleSetting) as TStyleSetting;
  2100. end;
  2101. { --------------------------------------------------------------------
  2102. TTableResource
  2103. --------------------------------------------------------------------}
  2104. Class Function TTableResource.ResourceName : String;
  2105. begin
  2106. Result:='table';
  2107. end;
  2108. Class Function TTableResource.DefaultAPI : TGoogleAPIClass;
  2109. begin
  2110. Result:=TfusiontablesAPI;
  2111. end;
  2112. Function TTableResource.Copy(tableId: string; AQuery : string = '') : TTable;
  2113. Const
  2114. _HTTPMethod = 'POST';
  2115. _Path = 'tables/{tableId}/copy';
  2116. _Methodid = 'fusiontables.table.copy';
  2117. Var
  2118. _P : String;
  2119. begin
  2120. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2121. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TTable) as TTable;
  2122. end;
  2123. Function TTableResource.Copy(tableId: string; AQuery : TTablecopyOptions) : TTable;
  2124. Var
  2125. _Q : String;
  2126. begin
  2127. _Q:='';
  2128. AddToQuery(_Q,'copyPresentation',AQuery.copyPresentation);
  2129. Result:=Copy(tableId,_Q);
  2130. end;
  2131. Procedure TTableResource.Delete(tableId: string);
  2132. Const
  2133. _HTTPMethod = 'DELETE';
  2134. _Path = 'tables/{tableId}';
  2135. _Methodid = 'fusiontables.table.delete';
  2136. Var
  2137. _P : String;
  2138. begin
  2139. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2140. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  2141. end;
  2142. Function TTableResource.Get(tableId: string) : TTable;
  2143. Const
  2144. _HTTPMethod = 'GET';
  2145. _Path = 'tables/{tableId}';
  2146. _Methodid = 'fusiontables.table.get';
  2147. Var
  2148. _P : String;
  2149. begin
  2150. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2151. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TTable) as TTable;
  2152. end;
  2153. Function TTableResource.ImportRows(tableId: string; AQuery : string = '') : TImport;
  2154. Const
  2155. _HTTPMethod = 'POST';
  2156. _Path = 'tables/{tableId}/import';
  2157. _Methodid = 'fusiontables.table.importRows';
  2158. Var
  2159. _P : String;
  2160. begin
  2161. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2162. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TImport) as TImport;
  2163. end;
  2164. Function TTableResource.ImportRows(tableId: string; AQuery : TTableimportRowsOptions) : TImport;
  2165. Var
  2166. _Q : String;
  2167. begin
  2168. _Q:='';
  2169. AddToQuery(_Q,'delimiter',AQuery.delimiter);
  2170. AddToQuery(_Q,'encoding',AQuery.encoding);
  2171. AddToQuery(_Q,'endLine',AQuery.endLine);
  2172. AddToQuery(_Q,'isStrict',AQuery.isStrict);
  2173. AddToQuery(_Q,'startLine',AQuery.startLine);
  2174. Result:=ImportRows(tableId,_Q);
  2175. end;
  2176. Function TTableResource.ImportTable(AQuery : string = '') : TTable;
  2177. Const
  2178. _HTTPMethod = 'POST';
  2179. _Path = 'tables/import';
  2180. _Methodid = 'fusiontables.table.importTable';
  2181. begin
  2182. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TTable) as TTable;
  2183. end;
  2184. Function TTableResource.ImportTable(AQuery : TTableimportTableOptions) : TTable;
  2185. Var
  2186. _Q : String;
  2187. begin
  2188. _Q:='';
  2189. AddToQuery(_Q,'delimiter',AQuery.delimiter);
  2190. AddToQuery(_Q,'encoding',AQuery.encoding);
  2191. AddToQuery(_Q,'name',AQuery._name);
  2192. Result:=ImportTable(_Q);
  2193. end;
  2194. Function TTableResource.Insert(aTable : TTable) : TTable;
  2195. Const
  2196. _HTTPMethod = 'POST';
  2197. _Path = 'tables';
  2198. _Methodid = 'fusiontables.table.insert';
  2199. begin
  2200. Result:=ServiceCall(_HTTPMethod,_Path,'',aTable,TTable) as TTable;
  2201. end;
  2202. Function TTableResource.List(AQuery : string = '') : TTableList;
  2203. Const
  2204. _HTTPMethod = 'GET';
  2205. _Path = 'tables';
  2206. _Methodid = 'fusiontables.table.list';
  2207. begin
  2208. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TTableList) as TTableList;
  2209. end;
  2210. Function TTableResource.List(AQuery : TTablelistOptions) : TTableList;
  2211. Var
  2212. _Q : String;
  2213. begin
  2214. _Q:='';
  2215. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  2216. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  2217. Result:=List(_Q);
  2218. end;
  2219. Function TTableResource.Patch(tableId: string; aTable : TTable; AQuery : string = '') : TTable;
  2220. Const
  2221. _HTTPMethod = 'PATCH';
  2222. _Path = 'tables/{tableId}';
  2223. _Methodid = 'fusiontables.table.patch';
  2224. Var
  2225. _P : String;
  2226. begin
  2227. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2228. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aTable,TTable) as TTable;
  2229. end;
  2230. Function TTableResource.Patch(tableId: string; aTable : TTable; AQuery : TTablepatchOptions) : TTable;
  2231. Var
  2232. _Q : String;
  2233. begin
  2234. _Q:='';
  2235. AddToQuery(_Q,'replaceViewDefinition',AQuery.replaceViewDefinition);
  2236. Result:=Patch(tableId,aTable,_Q);
  2237. end;
  2238. Function TTableResource.ReplaceRows(tableId: string; AQuery : string = '') : TTask;
  2239. Const
  2240. _HTTPMethod = 'POST';
  2241. _Path = 'tables/{tableId}/replace';
  2242. _Methodid = 'fusiontables.table.replaceRows';
  2243. Var
  2244. _P : String;
  2245. begin
  2246. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2247. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TTask) as TTask;
  2248. end;
  2249. Function TTableResource.ReplaceRows(tableId: string; AQuery : TTablereplaceRowsOptions) : TTask;
  2250. Var
  2251. _Q : String;
  2252. begin
  2253. _Q:='';
  2254. AddToQuery(_Q,'delimiter',AQuery.delimiter);
  2255. AddToQuery(_Q,'encoding',AQuery.encoding);
  2256. AddToQuery(_Q,'endLine',AQuery.endLine);
  2257. AddToQuery(_Q,'isStrict',AQuery.isStrict);
  2258. AddToQuery(_Q,'startLine',AQuery.startLine);
  2259. Result:=ReplaceRows(tableId,_Q);
  2260. end;
  2261. Function TTableResource.Update(tableId: string; aTable : TTable; AQuery : string = '') : TTable;
  2262. Const
  2263. _HTTPMethod = 'PUT';
  2264. _Path = 'tables/{tableId}';
  2265. _Methodid = 'fusiontables.table.update';
  2266. Var
  2267. _P : String;
  2268. begin
  2269. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2270. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aTable,TTable) as TTable;
  2271. end;
  2272. Function TTableResource.Update(tableId: string; aTable : TTable; AQuery : TTableupdateOptions) : TTable;
  2273. Var
  2274. _Q : String;
  2275. begin
  2276. _Q:='';
  2277. AddToQuery(_Q,'replaceViewDefinition',AQuery.replaceViewDefinition);
  2278. Result:=Update(tableId,aTable,_Q);
  2279. end;
  2280. { --------------------------------------------------------------------
  2281. TTaskResource
  2282. --------------------------------------------------------------------}
  2283. Class Function TTaskResource.ResourceName : String;
  2284. begin
  2285. Result:='task';
  2286. end;
  2287. Class Function TTaskResource.DefaultAPI : TGoogleAPIClass;
  2288. begin
  2289. Result:=TfusiontablesAPI;
  2290. end;
  2291. Procedure TTaskResource.Delete(tableId: string; taskId: string);
  2292. Const
  2293. _HTTPMethod = 'DELETE';
  2294. _Path = 'tables/{tableId}/tasks/{taskId}';
  2295. _Methodid = 'fusiontables.task.delete';
  2296. Var
  2297. _P : String;
  2298. begin
  2299. _P:=SubstitutePath(_Path,['tableId',tableId,'taskId',taskId]);
  2300. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  2301. end;
  2302. Function TTaskResource.Get(tableId: string; taskId: string) : TTask;
  2303. Const
  2304. _HTTPMethod = 'GET';
  2305. _Path = 'tables/{tableId}/tasks/{taskId}';
  2306. _Methodid = 'fusiontables.task.get';
  2307. Var
  2308. _P : String;
  2309. begin
  2310. _P:=SubstitutePath(_Path,['tableId',tableId,'taskId',taskId]);
  2311. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TTask) as TTask;
  2312. end;
  2313. Function TTaskResource.List(tableId: string; AQuery : string = '') : TTaskList;
  2314. Const
  2315. _HTTPMethod = 'GET';
  2316. _Path = 'tables/{tableId}/tasks';
  2317. _Methodid = 'fusiontables.task.list';
  2318. Var
  2319. _P : String;
  2320. begin
  2321. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2322. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TTaskList) as TTaskList;
  2323. end;
  2324. Function TTaskResource.List(tableId: string; AQuery : TTasklistOptions) : TTaskList;
  2325. Var
  2326. _Q : String;
  2327. begin
  2328. _Q:='';
  2329. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  2330. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  2331. AddToQuery(_Q,'startIndex',AQuery.startIndex);
  2332. Result:=List(tableId,_Q);
  2333. end;
  2334. { --------------------------------------------------------------------
  2335. TTemplateResource
  2336. --------------------------------------------------------------------}
  2337. Class Function TTemplateResource.ResourceName : String;
  2338. begin
  2339. Result:='template';
  2340. end;
  2341. Class Function TTemplateResource.DefaultAPI : TGoogleAPIClass;
  2342. begin
  2343. Result:=TfusiontablesAPI;
  2344. end;
  2345. Procedure TTemplateResource.Delete(tableId: string; templateId: integer);
  2346. Const
  2347. _HTTPMethod = 'DELETE';
  2348. _Path = 'tables/{tableId}/templates/{templateId}';
  2349. _Methodid = 'fusiontables.template.delete';
  2350. Var
  2351. _P : String;
  2352. begin
  2353. _P:=SubstitutePath(_Path,['tableId',tableId,'templateId',templateId]);
  2354. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  2355. end;
  2356. Function TTemplateResource.Get(tableId: string; templateId: integer) : TTemplate;
  2357. Const
  2358. _HTTPMethod = 'GET';
  2359. _Path = 'tables/{tableId}/templates/{templateId}';
  2360. _Methodid = 'fusiontables.template.get';
  2361. Var
  2362. _P : String;
  2363. begin
  2364. _P:=SubstitutePath(_Path,['tableId',tableId,'templateId',templateId]);
  2365. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TTemplate) as TTemplate;
  2366. end;
  2367. Function TTemplateResource.Insert(tableId: string; aTemplate : TTemplate) : TTemplate;
  2368. Const
  2369. _HTTPMethod = 'POST';
  2370. _Path = 'tables/{tableId}/templates';
  2371. _Methodid = 'fusiontables.template.insert';
  2372. Var
  2373. _P : String;
  2374. begin
  2375. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2376. Result:=ServiceCall(_HTTPMethod,_P,'',aTemplate,TTemplate) as TTemplate;
  2377. end;
  2378. Function TTemplateResource.List(tableId: string; AQuery : string = '') : TTemplateList;
  2379. Const
  2380. _HTTPMethod = 'GET';
  2381. _Path = 'tables/{tableId}/templates';
  2382. _Methodid = 'fusiontables.template.list';
  2383. Var
  2384. _P : String;
  2385. begin
  2386. _P:=SubstitutePath(_Path,['tableId',tableId]);
  2387. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TTemplateList) as TTemplateList;
  2388. end;
  2389. Function TTemplateResource.List(tableId: string; AQuery : TTemplatelistOptions) : TTemplateList;
  2390. Var
  2391. _Q : String;
  2392. begin
  2393. _Q:='';
  2394. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  2395. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  2396. Result:=List(tableId,_Q);
  2397. end;
  2398. Function TTemplateResource.Patch(tableId: string; templateId: integer; aTemplate : TTemplate) : TTemplate;
  2399. Const
  2400. _HTTPMethod = 'PATCH';
  2401. _Path = 'tables/{tableId}/templates/{templateId}';
  2402. _Methodid = 'fusiontables.template.patch';
  2403. Var
  2404. _P : String;
  2405. begin
  2406. _P:=SubstitutePath(_Path,['tableId',tableId,'templateId',templateId]);
  2407. Result:=ServiceCall(_HTTPMethod,_P,'',aTemplate,TTemplate) as TTemplate;
  2408. end;
  2409. Function TTemplateResource.Update(tableId: string; templateId: integer; aTemplate : TTemplate) : TTemplate;
  2410. Const
  2411. _HTTPMethod = 'PUT';
  2412. _Path = 'tables/{tableId}/templates/{templateId}';
  2413. _Methodid = 'fusiontables.template.update';
  2414. Var
  2415. _P : String;
  2416. begin
  2417. _P:=SubstitutePath(_Path,['tableId',tableId,'templateId',templateId]);
  2418. Result:=ServiceCall(_HTTPMethod,_P,'',aTemplate,TTemplate) as TTemplate;
  2419. end;
  2420. { --------------------------------------------------------------------
  2421. TFusiontablesAPI
  2422. --------------------------------------------------------------------}
  2423. Class Function TFusiontablesAPI.APIName : String;
  2424. begin
  2425. Result:='fusiontables';
  2426. end;
  2427. Class Function TFusiontablesAPI.APIVersion : String;
  2428. begin
  2429. Result:='v2';
  2430. end;
  2431. Class Function TFusiontablesAPI.APIRevision : String;
  2432. begin
  2433. Result:='20160317';
  2434. end;
  2435. Class Function TFusiontablesAPI.APIID : String;
  2436. begin
  2437. Result:='fusiontables:v2';
  2438. end;
  2439. Class Function TFusiontablesAPI.APITitle : String;
  2440. begin
  2441. Result:='Fusion Tables API';
  2442. end;
  2443. Class Function TFusiontablesAPI.APIDescription : String;
  2444. begin
  2445. Result:='API for working with Fusion Tables data.';
  2446. end;
  2447. Class Function TFusiontablesAPI.APIOwnerDomain : String;
  2448. begin
  2449. Result:='google.com';
  2450. end;
  2451. Class Function TFusiontablesAPI.APIOwnerName : String;
  2452. begin
  2453. Result:='Google';
  2454. end;
  2455. Class Function TFusiontablesAPI.APIIcon16 : String;
  2456. begin
  2457. Result:='http://www.google.com/images/icons/product/search-16.gif';
  2458. end;
  2459. Class Function TFusiontablesAPI.APIIcon32 : String;
  2460. begin
  2461. Result:='http://www.google.com/images/icons/product/search-32.gif';
  2462. end;
  2463. Class Function TFusiontablesAPI.APIdocumentationLink : String;
  2464. begin
  2465. Result:='https://developers.google.com/fusiontables';
  2466. end;
  2467. Class Function TFusiontablesAPI.APIrootUrl : string;
  2468. begin
  2469. Result:='https://www.googleapis.com/';
  2470. end;
  2471. Class Function TFusiontablesAPI.APIbasePath : string;
  2472. begin
  2473. Result:='/fusiontables/v2/';
  2474. end;
  2475. Class Function TFusiontablesAPI.APIbaseURL : String;
  2476. begin
  2477. Result:='https://www.googleapis.com/fusiontables/v2/';
  2478. end;
  2479. Class Function TFusiontablesAPI.APIProtocol : string;
  2480. begin
  2481. Result:='rest';
  2482. end;
  2483. Class Function TFusiontablesAPI.APIservicePath : string;
  2484. begin
  2485. Result:='fusiontables/v2/';
  2486. end;
  2487. Class Function TFusiontablesAPI.APIbatchPath : String;
  2488. begin
  2489. Result:='batch';
  2490. end;
  2491. Class Function TFusiontablesAPI.APIAuthScopes : TScopeInfoArray;
  2492. begin
  2493. SetLength(Result,2);
  2494. Result[0].Name:='https://www.googleapis.com/auth/fusiontables';
  2495. Result[0].Description:='Manage your Fusion Tables';
  2496. Result[1].Name:='https://www.googleapis.com/auth/fusiontables.readonly';
  2497. Result[1].Description:='View your Fusion Tables';
  2498. end;
  2499. Class Function TFusiontablesAPI.APINeedsAuth : Boolean;
  2500. begin
  2501. Result:=True;
  2502. end;
  2503. Class Procedure TFusiontablesAPI.RegisterAPIResources;
  2504. begin
  2505. TBucket.RegisterObject;
  2506. TColumnTypebaseColumn.RegisterObject;
  2507. TColumn.RegisterObject;
  2508. TColumnList.RegisterObject;
  2509. TGeometry.RegisterObject;
  2510. TImport.RegisterObject;
  2511. TLine.RegisterObject;
  2512. TLineStyle.RegisterObject;
  2513. TPoint.RegisterObject;
  2514. TPointStyle.RegisterObject;
  2515. TPolygon.RegisterObject;
  2516. TPolygonStyle.RegisterObject;
  2517. TSqlresponse.RegisterObject;
  2518. TStyleFunctionTypegradientTypecolorsItem.RegisterObject;
  2519. TStyleFunctionTypegradient.RegisterObject;
  2520. TStyleFunction.RegisterObject;
  2521. TStyleSetting.RegisterObject;
  2522. TStyleSettingList.RegisterObject;
  2523. TTable.RegisterObject;
  2524. TTableList.RegisterObject;
  2525. TTask.RegisterObject;
  2526. TTaskList.RegisterObject;
  2527. TTemplate.RegisterObject;
  2528. TTemplateList.RegisterObject;
  2529. end;
  2530. Function TFusiontablesAPI.GetColumnInstance : TColumnResource;
  2531. begin
  2532. if (FColumnInstance=Nil) then
  2533. FColumnInstance:=CreateColumnResource;
  2534. Result:=FColumnInstance;
  2535. end;
  2536. Function TFusiontablesAPI.CreateColumnResource : TColumnResource;
  2537. begin
  2538. Result:=CreateColumnResource(Self);
  2539. end;
  2540. Function TFusiontablesAPI.CreateColumnResource(AOwner : TComponent) : TColumnResource;
  2541. begin
  2542. Result:=TColumnResource.Create(AOwner);
  2543. Result.API:=Self.API;
  2544. end;
  2545. Function TFusiontablesAPI.GetQueryInstance : TQueryResource;
  2546. begin
  2547. if (FQueryInstance=Nil) then
  2548. FQueryInstance:=CreateQueryResource;
  2549. Result:=FQueryInstance;
  2550. end;
  2551. Function TFusiontablesAPI.CreateQueryResource : TQueryResource;
  2552. begin
  2553. Result:=CreateQueryResource(Self);
  2554. end;
  2555. Function TFusiontablesAPI.CreateQueryResource(AOwner : TComponent) : TQueryResource;
  2556. begin
  2557. Result:=TQueryResource.Create(AOwner);
  2558. Result.API:=Self.API;
  2559. end;
  2560. Function TFusiontablesAPI.GetStyleInstance : TStyleResource;
  2561. begin
  2562. if (FStyleInstance=Nil) then
  2563. FStyleInstance:=CreateStyleResource;
  2564. Result:=FStyleInstance;
  2565. end;
  2566. Function TFusiontablesAPI.CreateStyleResource : TStyleResource;
  2567. begin
  2568. Result:=CreateStyleResource(Self);
  2569. end;
  2570. Function TFusiontablesAPI.CreateStyleResource(AOwner : TComponent) : TStyleResource;
  2571. begin
  2572. Result:=TStyleResource.Create(AOwner);
  2573. Result.API:=Self.API;
  2574. end;
  2575. Function TFusiontablesAPI.GetTableInstance : TTableResource;
  2576. begin
  2577. if (FTableInstance=Nil) then
  2578. FTableInstance:=CreateTableResource;
  2579. Result:=FTableInstance;
  2580. end;
  2581. Function TFusiontablesAPI.CreateTableResource : TTableResource;
  2582. begin
  2583. Result:=CreateTableResource(Self);
  2584. end;
  2585. Function TFusiontablesAPI.CreateTableResource(AOwner : TComponent) : TTableResource;
  2586. begin
  2587. Result:=TTableResource.Create(AOwner);
  2588. Result.API:=Self.API;
  2589. end;
  2590. Function TFusiontablesAPI.GetTaskInstance : TTaskResource;
  2591. begin
  2592. if (FTaskInstance=Nil) then
  2593. FTaskInstance:=CreateTaskResource;
  2594. Result:=FTaskInstance;
  2595. end;
  2596. Function TFusiontablesAPI.CreateTaskResource : TTaskResource;
  2597. begin
  2598. Result:=CreateTaskResource(Self);
  2599. end;
  2600. Function TFusiontablesAPI.CreateTaskResource(AOwner : TComponent) : TTaskResource;
  2601. begin
  2602. Result:=TTaskResource.Create(AOwner);
  2603. Result.API:=Self.API;
  2604. end;
  2605. Function TFusiontablesAPI.GetTemplateInstance : TTemplateResource;
  2606. begin
  2607. if (FTemplateInstance=Nil) then
  2608. FTemplateInstance:=CreateTemplateResource;
  2609. Result:=FTemplateInstance;
  2610. end;
  2611. Function TFusiontablesAPI.CreateTemplateResource : TTemplateResource;
  2612. begin
  2613. Result:=CreateTemplateResource(Self);
  2614. end;
  2615. Function TFusiontablesAPI.CreateTemplateResource(AOwner : TComponent) : TTemplateResource;
  2616. begin
  2617. Result:=TTemplateResource.Create(AOwner);
  2618. Result.API:=Self.API;
  2619. end;
  2620. initialization
  2621. TFusiontablesAPI.RegisterAPI;
  2622. end.