googledatastore.pp 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568
  1. unit googledatastore;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TValue = Class;
  9. TReadOptions = Class;
  10. TPropertyOrder = Class;
  11. TCommitRequest = Class;
  12. TRollbackRequest = Class;
  13. TQuery = Class;
  14. TEntityResult = Class;
  15. TGqlQueryParameter = Class;
  16. TBeginTransactionResponse = Class;
  17. TFilter = Class;
  18. TArrayValue = Class;
  19. TPartitionId = Class;
  20. TQueryResultBatch = Class;
  21. TAllocateIdsRequest = Class;
  22. TPropertyFilter = Class;
  23. TKindExpression = Class;
  24. TPathElement = Class;
  25. TRollbackResponse = Class;
  26. TPropertyReference = Class;
  27. TProjection = Class;
  28. TAllocateIdsResponse = Class;
  29. TMutationResult = Class;
  30. TLookupResponse = Class;
  31. TBeginTransactionRequest = Class;
  32. TKey = Class;
  33. TRunQueryResponse = Class;
  34. TEntity = Class;
  35. TGqlQuery = Class;
  36. TCommitResponse = Class;
  37. TMutation = Class;
  38. TRunQueryRequest = Class;
  39. TCompositeFilter = Class;
  40. TLatLng = Class;
  41. TLookupRequest = Class;
  42. TValueArray = Array of TValue;
  43. TReadOptionsArray = Array of TReadOptions;
  44. TPropertyOrderArray = Array of TPropertyOrder;
  45. TCommitRequestArray = Array of TCommitRequest;
  46. TRollbackRequestArray = Array of TRollbackRequest;
  47. TQueryArray = Array of TQuery;
  48. TEntityResultArray = Array of TEntityResult;
  49. TGqlQueryParameterArray = Array of TGqlQueryParameter;
  50. TBeginTransactionResponseArray = Array of TBeginTransactionResponse;
  51. TFilterArray = Array of TFilter;
  52. TArrayValueArray = Array of TArrayValue;
  53. TPartitionIdArray = Array of TPartitionId;
  54. TQueryResultBatchArray = Array of TQueryResultBatch;
  55. TAllocateIdsRequestArray = Array of TAllocateIdsRequest;
  56. TPropertyFilterArray = Array of TPropertyFilter;
  57. TKindExpressionArray = Array of TKindExpression;
  58. TPathElementArray = Array of TPathElement;
  59. TRollbackResponseArray = Array of TRollbackResponse;
  60. TPropertyReferenceArray = Array of TPropertyReference;
  61. TProjectionArray = Array of TProjection;
  62. TAllocateIdsResponseArray = Array of TAllocateIdsResponse;
  63. TMutationResultArray = Array of TMutationResult;
  64. TLookupResponseArray = Array of TLookupResponse;
  65. TBeginTransactionRequestArray = Array of TBeginTransactionRequest;
  66. TKeyArray = Array of TKey;
  67. TRunQueryResponseArray = Array of TRunQueryResponse;
  68. TEntityArray = Array of TEntity;
  69. TGqlQueryArray = Array of TGqlQuery;
  70. TCommitResponseArray = Array of TCommitResponse;
  71. TMutationArray = Array of TMutation;
  72. TRunQueryRequestArray = Array of TRunQueryRequest;
  73. TCompositeFilterArray = Array of TCompositeFilter;
  74. TLatLngArray = Array of TLatLng;
  75. TLookupRequestArray = Array of TLookupRequest;
  76. //Anonymous types, using auto-generated names
  77. TEntityTypeproperties = Class;
  78. TGqlQueryTypenamedBindings = Class;
  79. TCommitRequestTypemutationsArray = Array of TMutation;
  80. TQueryTypedistinctOnArray = Array of TPropertyReference;
  81. TQueryTypeprojectionArray = Array of TProjection;
  82. TQueryTypeorderArray = Array of TPropertyOrder;
  83. TQueryTypekindArray = Array of TKindExpression;
  84. TArrayValueTypevaluesArray = Array of TValue;
  85. TQueryResultBatchTypeentityResultsArray = Array of TEntityResult;
  86. TAllocateIdsRequestTypekeysArray = Array of TKey;
  87. TAllocateIdsResponseTypekeysArray = Array of TKey;
  88. TLookupResponseTypefoundArray = Array of TEntityResult;
  89. TLookupResponseTypedeferredArray = Array of TKey;
  90. TLookupResponseTypemissingArray = Array of TEntityResult;
  91. TKeyTypepathArray = Array of TPathElement;
  92. TGqlQueryTypepositionalBindingsArray = Array of TGqlQueryParameter;
  93. TCommitResponseTypemutationResultsArray = Array of TMutationResult;
  94. TCompositeFilterTypefiltersArray = Array of TFilter;
  95. TLookupRequestTypekeysArray = Array of TKey;
  96. { --------------------------------------------------------------------
  97. TValue
  98. --------------------------------------------------------------------}
  99. TValue = Class(TGoogleBaseObject)
  100. Private
  101. FstringValue : String;
  102. FarrayValue : TArrayValue;
  103. FentityValue : TEntity;
  104. Fmeaning : integer;
  105. FintegerValue : String;
  106. FdoubleValue : double;
  107. FgeoPointValue : TLatLng;
  108. FblobValue : String;
  109. FnullValue : String;
  110. FkeyValue : TKey;
  111. FbooleanValue : boolean;
  112. FexcludeFromIndexes : boolean;
  113. FtimestampValue : String;
  114. Protected
  115. //Property setters
  116. Procedure SetstringValue(AIndex : Integer; const AValue : String); virtual;
  117. Procedure SetarrayValue(AIndex : Integer; const AValue : TArrayValue); virtual;
  118. Procedure SetentityValue(AIndex : Integer; const AValue : TEntity); virtual;
  119. Procedure Setmeaning(AIndex : Integer; const AValue : integer); virtual;
  120. Procedure SetintegerValue(AIndex : Integer; const AValue : String); virtual;
  121. Procedure SetdoubleValue(AIndex : Integer; const AValue : double); virtual;
  122. Procedure SetgeoPointValue(AIndex : Integer; const AValue : TLatLng); virtual;
  123. Procedure SetblobValue(AIndex : Integer; const AValue : String); virtual;
  124. Procedure SetnullValue(AIndex : Integer; const AValue : String); virtual;
  125. Procedure SetkeyValue(AIndex : Integer; const AValue : TKey); virtual;
  126. Procedure SetbooleanValue(AIndex : Integer; const AValue : boolean); virtual;
  127. Procedure SetexcludeFromIndexes(AIndex : Integer; const AValue : boolean); virtual;
  128. Procedure SettimestampValue(AIndex : Integer; const AValue : String); virtual;
  129. Public
  130. Published
  131. Property stringValue : String Index 0 Read FstringValue Write SetstringValue;
  132. Property arrayValue : TArrayValue Index 8 Read FarrayValue Write SetarrayValue;
  133. Property entityValue : TEntity Index 16 Read FentityValue Write SetentityValue;
  134. Property meaning : integer Index 24 Read Fmeaning Write Setmeaning;
  135. Property integerValue : String Index 32 Read FintegerValue Write SetintegerValue;
  136. Property doubleValue : double Index 40 Read FdoubleValue Write SetdoubleValue;
  137. Property geoPointValue : TLatLng Index 48 Read FgeoPointValue Write SetgeoPointValue;
  138. Property blobValue : String Index 56 Read FblobValue Write SetblobValue;
  139. Property nullValue : String Index 64 Read FnullValue Write SetnullValue;
  140. Property keyValue : TKey Index 72 Read FkeyValue Write SetkeyValue;
  141. Property booleanValue : boolean Index 80 Read FbooleanValue Write SetbooleanValue;
  142. Property excludeFromIndexes : boolean Index 88 Read FexcludeFromIndexes Write SetexcludeFromIndexes;
  143. Property timestampValue : String Index 96 Read FtimestampValue Write SettimestampValue;
  144. end;
  145. TValueClass = Class of TValue;
  146. { --------------------------------------------------------------------
  147. TReadOptions
  148. --------------------------------------------------------------------}
  149. TReadOptions = Class(TGoogleBaseObject)
  150. Private
  151. Ftransaction : String;
  152. FreadConsistency : String;
  153. Protected
  154. //Property setters
  155. Procedure Settransaction(AIndex : Integer; const AValue : String); virtual;
  156. Procedure SetreadConsistency(AIndex : Integer; const AValue : String); virtual;
  157. Public
  158. Published
  159. Property transaction : String Index 0 Read Ftransaction Write Settransaction;
  160. Property readConsistency : String Index 8 Read FreadConsistency Write SetreadConsistency;
  161. end;
  162. TReadOptionsClass = Class of TReadOptions;
  163. { --------------------------------------------------------------------
  164. TPropertyOrder
  165. --------------------------------------------------------------------}
  166. TPropertyOrder = Class(TGoogleBaseObject)
  167. Private
  168. Fdirection : String;
  169. F_property : TPropertyReference;
  170. Protected
  171. Class Function ExportPropertyName(Const AName : String) : string; override;
  172. //Property setters
  173. Procedure Setdirection(AIndex : Integer; const AValue : String); virtual;
  174. Procedure Set_property(AIndex : Integer; const AValue : TPropertyReference); virtual;
  175. Public
  176. Published
  177. Property direction : String Index 0 Read Fdirection Write Setdirection;
  178. Property _property : TPropertyReference Index 8 Read F_property Write Set_property;
  179. end;
  180. TPropertyOrderClass = Class of TPropertyOrder;
  181. { --------------------------------------------------------------------
  182. TCommitRequest
  183. --------------------------------------------------------------------}
  184. TCommitRequest = Class(TGoogleBaseObject)
  185. Private
  186. Ftransaction : String;
  187. Fmutations : TCommitRequestTypemutationsArray;
  188. Fmode : String;
  189. Protected
  190. //Property setters
  191. Procedure Settransaction(AIndex : Integer; const AValue : String); virtual;
  192. Procedure Setmutations(AIndex : Integer; const AValue : TCommitRequestTypemutationsArray); virtual;
  193. Procedure Setmode(AIndex : Integer; const AValue : String); virtual;
  194. //2.6.4. bug workaround
  195. {$IFDEF VER2_6}
  196. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  197. {$ENDIF VER2_6}
  198. Public
  199. Published
  200. Property transaction : String Index 0 Read Ftransaction Write Settransaction;
  201. Property mutations : TCommitRequestTypemutationsArray Index 8 Read Fmutations Write Setmutations;
  202. Property mode : String Index 16 Read Fmode Write Setmode;
  203. end;
  204. TCommitRequestClass = Class of TCommitRequest;
  205. { --------------------------------------------------------------------
  206. TRollbackRequest
  207. --------------------------------------------------------------------}
  208. TRollbackRequest = Class(TGoogleBaseObject)
  209. Private
  210. Ftransaction : String;
  211. Protected
  212. //Property setters
  213. Procedure Settransaction(AIndex : Integer; const AValue : String); virtual;
  214. Public
  215. Published
  216. Property transaction : String Index 0 Read Ftransaction Write Settransaction;
  217. end;
  218. TRollbackRequestClass = Class of TRollbackRequest;
  219. { --------------------------------------------------------------------
  220. TQuery
  221. --------------------------------------------------------------------}
  222. TQuery = Class(TGoogleBaseObject)
  223. Private
  224. Flimit : integer;
  225. Ffilter : TFilter;
  226. FendCursor : String;
  227. FdistinctOn : TQueryTypedistinctOnArray;
  228. Foffset : integer;
  229. Fprojection : TQueryTypeprojectionArray;
  230. FstartCursor : String;
  231. Forder : TQueryTypeorderArray;
  232. Fkind : TQueryTypekindArray;
  233. Protected
  234. //Property setters
  235. Procedure Setlimit(AIndex : Integer; const AValue : integer); virtual;
  236. Procedure Setfilter(AIndex : Integer; const AValue : TFilter); virtual;
  237. Procedure SetendCursor(AIndex : Integer; const AValue : String); virtual;
  238. Procedure SetdistinctOn(AIndex : Integer; const AValue : TQueryTypedistinctOnArray); virtual;
  239. Procedure Setoffset(AIndex : Integer; const AValue : integer); virtual;
  240. Procedure Setprojection(AIndex : Integer; const AValue : TQueryTypeprojectionArray); virtual;
  241. Procedure SetstartCursor(AIndex : Integer; const AValue : String); virtual;
  242. Procedure Setorder(AIndex : Integer; const AValue : TQueryTypeorderArray); virtual;
  243. Procedure Setkind(AIndex : Integer; const AValue : TQueryTypekindArray); virtual;
  244. //2.6.4. bug workaround
  245. {$IFDEF VER2_6}
  246. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  247. {$ENDIF VER2_6}
  248. Public
  249. Published
  250. Property limit : integer Index 0 Read Flimit Write Setlimit;
  251. Property filter : TFilter Index 8 Read Ffilter Write Setfilter;
  252. Property endCursor : String Index 16 Read FendCursor Write SetendCursor;
  253. Property distinctOn : TQueryTypedistinctOnArray Index 24 Read FdistinctOn Write SetdistinctOn;
  254. Property offset : integer Index 32 Read Foffset Write Setoffset;
  255. Property projection : TQueryTypeprojectionArray Index 40 Read Fprojection Write Setprojection;
  256. Property startCursor : String Index 48 Read FstartCursor Write SetstartCursor;
  257. Property order : TQueryTypeorderArray Index 56 Read Forder Write Setorder;
  258. Property kind : TQueryTypekindArray Index 64 Read Fkind Write Setkind;
  259. end;
  260. TQueryClass = Class of TQuery;
  261. { --------------------------------------------------------------------
  262. TEntityResult
  263. --------------------------------------------------------------------}
  264. TEntityResult = Class(TGoogleBaseObject)
  265. Private
  266. Fcursor : String;
  267. Fentity : TEntity;
  268. Protected
  269. //Property setters
  270. Procedure Setcursor(AIndex : Integer; const AValue : String); virtual;
  271. Procedure Setentity(AIndex : Integer; const AValue : TEntity); virtual;
  272. Public
  273. Published
  274. Property cursor : String Index 0 Read Fcursor Write Setcursor;
  275. Property entity : TEntity Index 8 Read Fentity Write Setentity;
  276. end;
  277. TEntityResultClass = Class of TEntityResult;
  278. { --------------------------------------------------------------------
  279. TGqlQueryParameter
  280. --------------------------------------------------------------------}
  281. TGqlQueryParameter = Class(TGoogleBaseObject)
  282. Private
  283. Fcursor : String;
  284. Fvalue : TValue;
  285. Protected
  286. //Property setters
  287. Procedure Setcursor(AIndex : Integer; const AValue : String); virtual;
  288. Procedure Setvalue(AIndex : Integer; const AValue : TValue); virtual;
  289. Public
  290. Published
  291. Property cursor : String Index 0 Read Fcursor Write Setcursor;
  292. Property value : TValue Index 8 Read Fvalue Write Setvalue;
  293. end;
  294. TGqlQueryParameterClass = Class of TGqlQueryParameter;
  295. { --------------------------------------------------------------------
  296. TBeginTransactionResponse
  297. --------------------------------------------------------------------}
  298. TBeginTransactionResponse = Class(TGoogleBaseObject)
  299. Private
  300. Ftransaction : String;
  301. Protected
  302. //Property setters
  303. Procedure Settransaction(AIndex : Integer; const AValue : String); virtual;
  304. Public
  305. Published
  306. Property transaction : String Index 0 Read Ftransaction Write Settransaction;
  307. end;
  308. TBeginTransactionResponseClass = Class of TBeginTransactionResponse;
  309. { --------------------------------------------------------------------
  310. TFilter
  311. --------------------------------------------------------------------}
  312. TFilter = Class(TGoogleBaseObject)
  313. Private
  314. FpropertyFilter : TPropertyFilter;
  315. FcompositeFilter : TCompositeFilter;
  316. Protected
  317. //Property setters
  318. Procedure SetpropertyFilter(AIndex : Integer; const AValue : TPropertyFilter); virtual;
  319. Procedure SetcompositeFilter(AIndex : Integer; const AValue : TCompositeFilter); virtual;
  320. Public
  321. Published
  322. Property propertyFilter : TPropertyFilter Index 0 Read FpropertyFilter Write SetpropertyFilter;
  323. Property compositeFilter : TCompositeFilter Index 8 Read FcompositeFilter Write SetcompositeFilter;
  324. end;
  325. TFilterClass = Class of TFilter;
  326. { --------------------------------------------------------------------
  327. TArrayValue
  328. --------------------------------------------------------------------}
  329. TArrayValue = Class(TGoogleBaseObject)
  330. Private
  331. Fvalues : TArrayValueTypevaluesArray;
  332. Protected
  333. //Property setters
  334. Procedure Setvalues(AIndex : Integer; const AValue : TArrayValueTypevaluesArray); virtual;
  335. //2.6.4. bug workaround
  336. {$IFDEF VER2_6}
  337. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  338. {$ENDIF VER2_6}
  339. Public
  340. Published
  341. Property values : TArrayValueTypevaluesArray Index 0 Read Fvalues Write Setvalues;
  342. end;
  343. TArrayValueClass = Class of TArrayValue;
  344. { --------------------------------------------------------------------
  345. TPartitionId
  346. --------------------------------------------------------------------}
  347. TPartitionId = Class(TGoogleBaseObject)
  348. Private
  349. FnamespaceId : String;
  350. FprojectId : String;
  351. Protected
  352. //Property setters
  353. Procedure SetnamespaceId(AIndex : Integer; const AValue : String); virtual;
  354. Procedure SetprojectId(AIndex : Integer; const AValue : String); virtual;
  355. Public
  356. Published
  357. Property namespaceId : String Index 0 Read FnamespaceId Write SetnamespaceId;
  358. Property projectId : String Index 8 Read FprojectId Write SetprojectId;
  359. end;
  360. TPartitionIdClass = Class of TPartitionId;
  361. { --------------------------------------------------------------------
  362. TQueryResultBatch
  363. --------------------------------------------------------------------}
  364. TQueryResultBatch = Class(TGoogleBaseObject)
  365. Private
  366. FendCursor : String;
  367. FskippedCursor : String;
  368. FentityResultType : String;
  369. FmoreResults : String;
  370. FentityResults : TQueryResultBatchTypeentityResultsArray;
  371. FskippedResults : integer;
  372. Protected
  373. //Property setters
  374. Procedure SetendCursor(AIndex : Integer; const AValue : String); virtual;
  375. Procedure SetskippedCursor(AIndex : Integer; const AValue : String); virtual;
  376. Procedure SetentityResultType(AIndex : Integer; const AValue : String); virtual;
  377. Procedure SetmoreResults(AIndex : Integer; const AValue : String); virtual;
  378. Procedure SetentityResults(AIndex : Integer; const AValue : TQueryResultBatchTypeentityResultsArray); virtual;
  379. Procedure SetskippedResults(AIndex : Integer; const AValue : integer); virtual;
  380. //2.6.4. bug workaround
  381. {$IFDEF VER2_6}
  382. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  383. {$ENDIF VER2_6}
  384. Public
  385. Published
  386. Property endCursor : String Index 0 Read FendCursor Write SetendCursor;
  387. Property skippedCursor : String Index 8 Read FskippedCursor Write SetskippedCursor;
  388. Property entityResultType : String Index 16 Read FentityResultType Write SetentityResultType;
  389. Property moreResults : String Index 24 Read FmoreResults Write SetmoreResults;
  390. Property entityResults : TQueryResultBatchTypeentityResultsArray Index 32 Read FentityResults Write SetentityResults;
  391. Property skippedResults : integer Index 40 Read FskippedResults Write SetskippedResults;
  392. end;
  393. TQueryResultBatchClass = Class of TQueryResultBatch;
  394. { --------------------------------------------------------------------
  395. TAllocateIdsRequest
  396. --------------------------------------------------------------------}
  397. TAllocateIdsRequest = Class(TGoogleBaseObject)
  398. Private
  399. Fkeys : TAllocateIdsRequestTypekeysArray;
  400. Protected
  401. //Property setters
  402. Procedure Setkeys(AIndex : Integer; const AValue : TAllocateIdsRequestTypekeysArray); virtual;
  403. //2.6.4. bug workaround
  404. {$IFDEF VER2_6}
  405. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  406. {$ENDIF VER2_6}
  407. Public
  408. Published
  409. Property keys : TAllocateIdsRequestTypekeysArray Index 0 Read Fkeys Write Setkeys;
  410. end;
  411. TAllocateIdsRequestClass = Class of TAllocateIdsRequest;
  412. { --------------------------------------------------------------------
  413. TPropertyFilter
  414. --------------------------------------------------------------------}
  415. TPropertyFilter = Class(TGoogleBaseObject)
  416. Private
  417. Fvalue : TValue;
  418. Fop : String;
  419. F_property : TPropertyReference;
  420. Protected
  421. Class Function ExportPropertyName(Const AName : String) : string; override;
  422. //Property setters
  423. Procedure Setvalue(AIndex : Integer; const AValue : TValue); virtual;
  424. Procedure Setop(AIndex : Integer; const AValue : String); virtual;
  425. Procedure Set_property(AIndex : Integer; const AValue : TPropertyReference); virtual;
  426. Public
  427. Published
  428. Property value : TValue Index 0 Read Fvalue Write Setvalue;
  429. Property op : String Index 8 Read Fop Write Setop;
  430. Property _property : TPropertyReference Index 16 Read F_property Write Set_property;
  431. end;
  432. TPropertyFilterClass = Class of TPropertyFilter;
  433. { --------------------------------------------------------------------
  434. TKindExpression
  435. --------------------------------------------------------------------}
  436. TKindExpression = Class(TGoogleBaseObject)
  437. Private
  438. Fname : String;
  439. Protected
  440. //Property setters
  441. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  442. Public
  443. Published
  444. Property name : String Index 0 Read Fname Write Setname;
  445. end;
  446. TKindExpressionClass = Class of TKindExpression;
  447. { --------------------------------------------------------------------
  448. TPathElement
  449. --------------------------------------------------------------------}
  450. TPathElement = Class(TGoogleBaseObject)
  451. Private
  452. Fkind : String;
  453. Fname : String;
  454. Fid : String;
  455. Protected
  456. //Property setters
  457. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  458. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  459. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  460. Public
  461. Published
  462. Property kind : String Index 0 Read Fkind Write Setkind;
  463. Property name : String Index 8 Read Fname Write Setname;
  464. Property id : String Index 16 Read Fid Write Setid;
  465. end;
  466. TPathElementClass = Class of TPathElement;
  467. { --------------------------------------------------------------------
  468. TRollbackResponse
  469. --------------------------------------------------------------------}
  470. TRollbackResponse = Class(TGoogleBaseObject)
  471. Private
  472. Protected
  473. //Property setters
  474. Public
  475. Published
  476. end;
  477. TRollbackResponseClass = Class of TRollbackResponse;
  478. { --------------------------------------------------------------------
  479. TPropertyReference
  480. --------------------------------------------------------------------}
  481. TPropertyReference = Class(TGoogleBaseObject)
  482. Private
  483. Fname : String;
  484. Protected
  485. //Property setters
  486. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  487. Public
  488. Published
  489. Property name : String Index 0 Read Fname Write Setname;
  490. end;
  491. TPropertyReferenceClass = Class of TPropertyReference;
  492. { --------------------------------------------------------------------
  493. TProjection
  494. --------------------------------------------------------------------}
  495. TProjection = Class(TGoogleBaseObject)
  496. Private
  497. F_property : TPropertyReference;
  498. Protected
  499. Class Function ExportPropertyName(Const AName : String) : string; override;
  500. //Property setters
  501. Procedure Set_property(AIndex : Integer; const AValue : TPropertyReference); virtual;
  502. Public
  503. Published
  504. Property _property : TPropertyReference Index 0 Read F_property Write Set_property;
  505. end;
  506. TProjectionClass = Class of TProjection;
  507. { --------------------------------------------------------------------
  508. TAllocateIdsResponse
  509. --------------------------------------------------------------------}
  510. TAllocateIdsResponse = Class(TGoogleBaseObject)
  511. Private
  512. Fkeys : TAllocateIdsResponseTypekeysArray;
  513. Protected
  514. //Property setters
  515. Procedure Setkeys(AIndex : Integer; const AValue : TAllocateIdsResponseTypekeysArray); 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 keys : TAllocateIdsResponseTypekeysArray Index 0 Read Fkeys Write Setkeys;
  523. end;
  524. TAllocateIdsResponseClass = Class of TAllocateIdsResponse;
  525. { --------------------------------------------------------------------
  526. TMutationResult
  527. --------------------------------------------------------------------}
  528. TMutationResult = Class(TGoogleBaseObject)
  529. Private
  530. Fkey : TKey;
  531. Protected
  532. //Property setters
  533. Procedure Setkey(AIndex : Integer; const AValue : TKey); virtual;
  534. Public
  535. Published
  536. Property key : TKey Index 0 Read Fkey Write Setkey;
  537. end;
  538. TMutationResultClass = Class of TMutationResult;
  539. { --------------------------------------------------------------------
  540. TLookupResponse
  541. --------------------------------------------------------------------}
  542. TLookupResponse = Class(TGoogleBaseObject)
  543. Private
  544. Ffound : TLookupResponseTypefoundArray;
  545. Fdeferred : TLookupResponseTypedeferredArray;
  546. Fmissing : TLookupResponseTypemissingArray;
  547. Protected
  548. //Property setters
  549. Procedure Setfound(AIndex : Integer; const AValue : TLookupResponseTypefoundArray); virtual;
  550. Procedure Setdeferred(AIndex : Integer; const AValue : TLookupResponseTypedeferredArray); virtual;
  551. Procedure Setmissing(AIndex : Integer; const AValue : TLookupResponseTypemissingArray); virtual;
  552. //2.6.4. bug workaround
  553. {$IFDEF VER2_6}
  554. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  555. {$ENDIF VER2_6}
  556. Public
  557. Published
  558. Property found : TLookupResponseTypefoundArray Index 0 Read Ffound Write Setfound;
  559. Property deferred : TLookupResponseTypedeferredArray Index 8 Read Fdeferred Write Setdeferred;
  560. Property missing : TLookupResponseTypemissingArray Index 16 Read Fmissing Write Setmissing;
  561. end;
  562. TLookupResponseClass = Class of TLookupResponse;
  563. { --------------------------------------------------------------------
  564. TBeginTransactionRequest
  565. --------------------------------------------------------------------}
  566. TBeginTransactionRequest = Class(TGoogleBaseObject)
  567. Private
  568. Protected
  569. //Property setters
  570. Public
  571. Published
  572. end;
  573. TBeginTransactionRequestClass = Class of TBeginTransactionRequest;
  574. { --------------------------------------------------------------------
  575. TKey
  576. --------------------------------------------------------------------}
  577. TKey = Class(TGoogleBaseObject)
  578. Private
  579. FpartitionId : TPartitionId;
  580. Fpath : TKeyTypepathArray;
  581. Protected
  582. //Property setters
  583. Procedure SetpartitionId(AIndex : Integer; const AValue : TPartitionId); virtual;
  584. Procedure Setpath(AIndex : Integer; const AValue : TKeyTypepathArray); virtual;
  585. //2.6.4. bug workaround
  586. {$IFDEF VER2_6}
  587. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  588. {$ENDIF VER2_6}
  589. Public
  590. Published
  591. Property partitionId : TPartitionId Index 0 Read FpartitionId Write SetpartitionId;
  592. Property path : TKeyTypepathArray Index 8 Read Fpath Write Setpath;
  593. end;
  594. TKeyClass = Class of TKey;
  595. { --------------------------------------------------------------------
  596. TRunQueryResponse
  597. --------------------------------------------------------------------}
  598. TRunQueryResponse = Class(TGoogleBaseObject)
  599. Private
  600. Fbatch : TQueryResultBatch;
  601. Fquery : TQuery;
  602. Protected
  603. //Property setters
  604. Procedure Setbatch(AIndex : Integer; const AValue : TQueryResultBatch); virtual;
  605. Procedure Setquery(AIndex : Integer; const AValue : TQuery); virtual;
  606. Public
  607. Published
  608. Property batch : TQueryResultBatch Index 0 Read Fbatch Write Setbatch;
  609. Property query : TQuery Index 8 Read Fquery Write Setquery;
  610. end;
  611. TRunQueryResponseClass = Class of TRunQueryResponse;
  612. { --------------------------------------------------------------------
  613. TEntityTypeproperties
  614. --------------------------------------------------------------------}
  615. TEntityTypeproperties = Class(TGoogleBaseObject)
  616. Private
  617. Protected
  618. //Property setters
  619. Public
  620. Class Function AllowAdditionalProperties : Boolean; override;
  621. Published
  622. end;
  623. TEntityTypepropertiesClass = Class of TEntityTypeproperties;
  624. { --------------------------------------------------------------------
  625. TEntity
  626. --------------------------------------------------------------------}
  627. TEntity = Class(TGoogleBaseObject)
  628. Private
  629. Fproperties : TEntityTypeproperties;
  630. Fkey : TKey;
  631. Protected
  632. //Property setters
  633. Procedure Setproperties(AIndex : Integer; const AValue : TEntityTypeproperties); virtual;
  634. Procedure Setkey(AIndex : Integer; const AValue : TKey); virtual;
  635. Public
  636. Published
  637. Property properties : TEntityTypeproperties Index 0 Read Fproperties Write Setproperties;
  638. Property key : TKey Index 8 Read Fkey Write Setkey;
  639. end;
  640. TEntityClass = Class of TEntity;
  641. { --------------------------------------------------------------------
  642. TGqlQueryTypenamedBindings
  643. --------------------------------------------------------------------}
  644. TGqlQueryTypenamedBindings = Class(TGoogleBaseObject)
  645. Private
  646. Protected
  647. //Property setters
  648. Public
  649. Class Function AllowAdditionalProperties : Boolean; override;
  650. Published
  651. end;
  652. TGqlQueryTypenamedBindingsClass = Class of TGqlQueryTypenamedBindings;
  653. { --------------------------------------------------------------------
  654. TGqlQuery
  655. --------------------------------------------------------------------}
  656. TGqlQuery = Class(TGoogleBaseObject)
  657. Private
  658. FnamedBindings : TGqlQueryTypenamedBindings;
  659. FqueryString : String;
  660. FallowLiterals : boolean;
  661. FpositionalBindings : TGqlQueryTypepositionalBindingsArray;
  662. Protected
  663. //Property setters
  664. Procedure SetnamedBindings(AIndex : Integer; const AValue : TGqlQueryTypenamedBindings); virtual;
  665. Procedure SetqueryString(AIndex : Integer; const AValue : String); virtual;
  666. Procedure SetallowLiterals(AIndex : Integer; const AValue : boolean); virtual;
  667. Procedure SetpositionalBindings(AIndex : Integer; const AValue : TGqlQueryTypepositionalBindingsArray); virtual;
  668. //2.6.4. bug workaround
  669. {$IFDEF VER2_6}
  670. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  671. {$ENDIF VER2_6}
  672. Public
  673. Published
  674. Property namedBindings : TGqlQueryTypenamedBindings Index 0 Read FnamedBindings Write SetnamedBindings;
  675. Property queryString : String Index 8 Read FqueryString Write SetqueryString;
  676. Property allowLiterals : boolean Index 16 Read FallowLiterals Write SetallowLiterals;
  677. Property positionalBindings : TGqlQueryTypepositionalBindingsArray Index 24 Read FpositionalBindings Write SetpositionalBindings;
  678. end;
  679. TGqlQueryClass = Class of TGqlQuery;
  680. { --------------------------------------------------------------------
  681. TCommitResponse
  682. --------------------------------------------------------------------}
  683. TCommitResponse = Class(TGoogleBaseObject)
  684. Private
  685. FmutationResults : TCommitResponseTypemutationResultsArray;
  686. FindexUpdates : integer;
  687. Protected
  688. //Property setters
  689. Procedure SetmutationResults(AIndex : Integer; const AValue : TCommitResponseTypemutationResultsArray); virtual;
  690. Procedure SetindexUpdates(AIndex : Integer; const AValue : integer); virtual;
  691. //2.6.4. bug workaround
  692. {$IFDEF VER2_6}
  693. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  694. {$ENDIF VER2_6}
  695. Public
  696. Published
  697. Property mutationResults : TCommitResponseTypemutationResultsArray Index 0 Read FmutationResults Write SetmutationResults;
  698. Property indexUpdates : integer Index 8 Read FindexUpdates Write SetindexUpdates;
  699. end;
  700. TCommitResponseClass = Class of TCommitResponse;
  701. { --------------------------------------------------------------------
  702. TMutation
  703. --------------------------------------------------------------------}
  704. TMutation = Class(TGoogleBaseObject)
  705. Private
  706. Fupdate : TEntity;
  707. Finsert : TEntity;
  708. Fdelete : TKey;
  709. Fupsert : TEntity;
  710. Protected
  711. //Property setters
  712. Procedure Setupdate(AIndex : Integer; const AValue : TEntity); virtual;
  713. Procedure Setinsert(AIndex : Integer; const AValue : TEntity); virtual;
  714. Procedure Setdelete(AIndex : Integer; const AValue : TKey); virtual;
  715. Procedure Setupsert(AIndex : Integer; const AValue : TEntity); virtual;
  716. Public
  717. Published
  718. Property update : TEntity Index 0 Read Fupdate Write Setupdate;
  719. Property insert : TEntity Index 8 Read Finsert Write Setinsert;
  720. Property delete : TKey Index 16 Read Fdelete Write Setdelete;
  721. Property upsert : TEntity Index 24 Read Fupsert Write Setupsert;
  722. end;
  723. TMutationClass = Class of TMutation;
  724. { --------------------------------------------------------------------
  725. TRunQueryRequest
  726. --------------------------------------------------------------------}
  727. TRunQueryRequest = Class(TGoogleBaseObject)
  728. Private
  729. FpartitionId : TPartitionId;
  730. FgqlQuery : TGqlQuery;
  731. Fquery : TQuery;
  732. FreadOptions : TReadOptions;
  733. Protected
  734. //Property setters
  735. Procedure SetpartitionId(AIndex : Integer; const AValue : TPartitionId); virtual;
  736. Procedure SetgqlQuery(AIndex : Integer; const AValue : TGqlQuery); virtual;
  737. Procedure Setquery(AIndex : Integer; const AValue : TQuery); virtual;
  738. Procedure SetreadOptions(AIndex : Integer; const AValue : TReadOptions); virtual;
  739. Public
  740. Published
  741. Property partitionId : TPartitionId Index 0 Read FpartitionId Write SetpartitionId;
  742. Property gqlQuery : TGqlQuery Index 8 Read FgqlQuery Write SetgqlQuery;
  743. Property query : TQuery Index 16 Read Fquery Write Setquery;
  744. Property readOptions : TReadOptions Index 24 Read FreadOptions Write SetreadOptions;
  745. end;
  746. TRunQueryRequestClass = Class of TRunQueryRequest;
  747. { --------------------------------------------------------------------
  748. TCompositeFilter
  749. --------------------------------------------------------------------}
  750. TCompositeFilter = Class(TGoogleBaseObject)
  751. Private
  752. Fop : String;
  753. Ffilters : TCompositeFilterTypefiltersArray;
  754. Protected
  755. //Property setters
  756. Procedure Setop(AIndex : Integer; const AValue : String); virtual;
  757. Procedure Setfilters(AIndex : Integer; const AValue : TCompositeFilterTypefiltersArray); virtual;
  758. //2.6.4. bug workaround
  759. {$IFDEF VER2_6}
  760. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  761. {$ENDIF VER2_6}
  762. Public
  763. Published
  764. Property op : String Index 0 Read Fop Write Setop;
  765. Property filters : TCompositeFilterTypefiltersArray Index 8 Read Ffilters Write Setfilters;
  766. end;
  767. TCompositeFilterClass = Class of TCompositeFilter;
  768. { --------------------------------------------------------------------
  769. TLatLng
  770. --------------------------------------------------------------------}
  771. TLatLng = Class(TGoogleBaseObject)
  772. Private
  773. Flongitude : double;
  774. Flatitude : double;
  775. Protected
  776. //Property setters
  777. Procedure Setlongitude(AIndex : Integer; const AValue : double); virtual;
  778. Procedure Setlatitude(AIndex : Integer; const AValue : double); virtual;
  779. Public
  780. Published
  781. Property longitude : double Index 0 Read Flongitude Write Setlongitude;
  782. Property latitude : double Index 8 Read Flatitude Write Setlatitude;
  783. end;
  784. TLatLngClass = Class of TLatLng;
  785. { --------------------------------------------------------------------
  786. TLookupRequest
  787. --------------------------------------------------------------------}
  788. TLookupRequest = Class(TGoogleBaseObject)
  789. Private
  790. Fkeys : TLookupRequestTypekeysArray;
  791. FreadOptions : TReadOptions;
  792. Protected
  793. //Property setters
  794. Procedure Setkeys(AIndex : Integer; const AValue : TLookupRequestTypekeysArray); virtual;
  795. Procedure SetreadOptions(AIndex : Integer; const AValue : TReadOptions); virtual;
  796. //2.6.4. bug workaround
  797. {$IFDEF VER2_6}
  798. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  799. {$ENDIF VER2_6}
  800. Public
  801. Published
  802. Property keys : TLookupRequestTypekeysArray Index 0 Read Fkeys Write Setkeys;
  803. Property readOptions : TReadOptions Index 8 Read FreadOptions Write SetreadOptions;
  804. end;
  805. TLookupRequestClass = Class of TLookupRequest;
  806. { --------------------------------------------------------------------
  807. TProjectsResource
  808. --------------------------------------------------------------------}
  809. TProjectsResource = Class(TGoogleResource)
  810. Public
  811. Class Function ResourceName : String; override;
  812. Class Function DefaultAPI : TGoogleAPIClass; override;
  813. Function RunQuery(projectId: string; aRunQueryRequest : TRunQueryRequest) : TRunQueryResponse;
  814. Function BeginTransaction(projectId: string; aBeginTransactionRequest : TBeginTransactionRequest) : TBeginTransactionResponse;
  815. Function AllocateIds(projectId: string; aAllocateIdsRequest : TAllocateIdsRequest) : TAllocateIdsResponse;
  816. Function Lookup(projectId: string; aLookupRequest : TLookupRequest) : TLookupResponse;
  817. Function Commit(projectId: string; aCommitRequest : TCommitRequest) : TCommitResponse;
  818. Function Rollback(projectId: string; aRollbackRequest : TRollbackRequest) : TRollbackResponse;
  819. end;
  820. { --------------------------------------------------------------------
  821. TDatastoreAPI
  822. --------------------------------------------------------------------}
  823. TDatastoreAPI = Class(TGoogleAPI)
  824. Private
  825. FProjectsInstance : TProjectsResource;
  826. Function GetProjectsInstance : TProjectsResource;virtual;
  827. Public
  828. //Override class functions with API info
  829. Class Function APIName : String; override;
  830. Class Function APIVersion : String; override;
  831. Class Function APIRevision : String; override;
  832. Class Function APIID : String; override;
  833. Class Function APITitle : String; override;
  834. Class Function APIDescription : String; override;
  835. Class Function APIOwnerDomain : String; override;
  836. Class Function APIOwnerName : String; override;
  837. Class Function APIIcon16 : String; override;
  838. Class Function APIIcon32 : String; override;
  839. Class Function APIdocumentationLink : String; override;
  840. Class Function APIrootUrl : string; override;
  841. Class Function APIbasePath : string;override;
  842. Class Function APIbaseURL : String;override;
  843. Class Function APIProtocol : string;override;
  844. Class Function APIservicePath : string;override;
  845. Class Function APIbatchPath : String;override;
  846. Class Function APIAuthScopes : TScopeInfoArray;override;
  847. Class Function APINeedsAuth : Boolean;override;
  848. Class Procedure RegisterAPIResources; override;
  849. //Add create function for resources
  850. Function CreateProjectsResource(AOwner : TComponent) : TProjectsResource;virtual;overload;
  851. Function CreateProjectsResource : TProjectsResource;virtual;overload;
  852. //Add default on-demand instances for resources
  853. Property ProjectsResource : TProjectsResource Read GetProjectsInstance;
  854. end;
  855. implementation
  856. { --------------------------------------------------------------------
  857. TValue
  858. --------------------------------------------------------------------}
  859. Procedure TValue.SetstringValue(AIndex : Integer; const AValue : String);
  860. begin
  861. If (FstringValue=AValue) then exit;
  862. FstringValue:=AValue;
  863. MarkPropertyChanged(AIndex);
  864. end;
  865. Procedure TValue.SetarrayValue(AIndex : Integer; const AValue : TArrayValue);
  866. begin
  867. If (FarrayValue=AValue) then exit;
  868. FarrayValue:=AValue;
  869. MarkPropertyChanged(AIndex);
  870. end;
  871. Procedure TValue.SetentityValue(AIndex : Integer; const AValue : TEntity);
  872. begin
  873. If (FentityValue=AValue) then exit;
  874. FentityValue:=AValue;
  875. MarkPropertyChanged(AIndex);
  876. end;
  877. Procedure TValue.Setmeaning(AIndex : Integer; const AValue : integer);
  878. begin
  879. If (Fmeaning=AValue) then exit;
  880. Fmeaning:=AValue;
  881. MarkPropertyChanged(AIndex);
  882. end;
  883. Procedure TValue.SetintegerValue(AIndex : Integer; const AValue : String);
  884. begin
  885. If (FintegerValue=AValue) then exit;
  886. FintegerValue:=AValue;
  887. MarkPropertyChanged(AIndex);
  888. end;
  889. Procedure TValue.SetdoubleValue(AIndex : Integer; const AValue : double);
  890. begin
  891. If (FdoubleValue=AValue) then exit;
  892. FdoubleValue:=AValue;
  893. MarkPropertyChanged(AIndex);
  894. end;
  895. Procedure TValue.SetgeoPointValue(AIndex : Integer; const AValue : TLatLng);
  896. begin
  897. If (FgeoPointValue=AValue) then exit;
  898. FgeoPointValue:=AValue;
  899. MarkPropertyChanged(AIndex);
  900. end;
  901. Procedure TValue.SetblobValue(AIndex : Integer; const AValue : String);
  902. begin
  903. If (FblobValue=AValue) then exit;
  904. FblobValue:=AValue;
  905. MarkPropertyChanged(AIndex);
  906. end;
  907. Procedure TValue.SetnullValue(AIndex : Integer; const AValue : String);
  908. begin
  909. If (FnullValue=AValue) then exit;
  910. FnullValue:=AValue;
  911. MarkPropertyChanged(AIndex);
  912. end;
  913. Procedure TValue.SetkeyValue(AIndex : Integer; const AValue : TKey);
  914. begin
  915. If (FkeyValue=AValue) then exit;
  916. FkeyValue:=AValue;
  917. MarkPropertyChanged(AIndex);
  918. end;
  919. Procedure TValue.SetbooleanValue(AIndex : Integer; const AValue : boolean);
  920. begin
  921. If (FbooleanValue=AValue) then exit;
  922. FbooleanValue:=AValue;
  923. MarkPropertyChanged(AIndex);
  924. end;
  925. Procedure TValue.SetexcludeFromIndexes(AIndex : Integer; const AValue : boolean);
  926. begin
  927. If (FexcludeFromIndexes=AValue) then exit;
  928. FexcludeFromIndexes:=AValue;
  929. MarkPropertyChanged(AIndex);
  930. end;
  931. Procedure TValue.SettimestampValue(AIndex : Integer; const AValue : String);
  932. begin
  933. If (FtimestampValue=AValue) then exit;
  934. FtimestampValue:=AValue;
  935. MarkPropertyChanged(AIndex);
  936. end;
  937. { --------------------------------------------------------------------
  938. TReadOptions
  939. --------------------------------------------------------------------}
  940. Procedure TReadOptions.Settransaction(AIndex : Integer; const AValue : String);
  941. begin
  942. If (Ftransaction=AValue) then exit;
  943. Ftransaction:=AValue;
  944. MarkPropertyChanged(AIndex);
  945. end;
  946. Procedure TReadOptions.SetreadConsistency(AIndex : Integer; const AValue : String);
  947. begin
  948. If (FreadConsistency=AValue) then exit;
  949. FreadConsistency:=AValue;
  950. MarkPropertyChanged(AIndex);
  951. end;
  952. { --------------------------------------------------------------------
  953. TPropertyOrder
  954. --------------------------------------------------------------------}
  955. Procedure TPropertyOrder.Setdirection(AIndex : Integer; const AValue : String);
  956. begin
  957. If (Fdirection=AValue) then exit;
  958. Fdirection:=AValue;
  959. MarkPropertyChanged(AIndex);
  960. end;
  961. Procedure TPropertyOrder.Set_property(AIndex : Integer; const AValue : TPropertyReference);
  962. begin
  963. If (F_property=AValue) then exit;
  964. F_property:=AValue;
  965. MarkPropertyChanged(AIndex);
  966. end;
  967. Class Function TPropertyOrder.ExportPropertyName(Const AName : String) :String;
  968. begin
  969. Case AName of
  970. '_property' : Result:='property';
  971. else
  972. Result:=Inherited ExportPropertyName(AName);
  973. end;
  974. end;
  975. { --------------------------------------------------------------------
  976. TCommitRequest
  977. --------------------------------------------------------------------}
  978. Procedure TCommitRequest.Settransaction(AIndex : Integer; const AValue : String);
  979. begin
  980. If (Ftransaction=AValue) then exit;
  981. Ftransaction:=AValue;
  982. MarkPropertyChanged(AIndex);
  983. end;
  984. Procedure TCommitRequest.Setmutations(AIndex : Integer; const AValue : TCommitRequestTypemutationsArray);
  985. begin
  986. If (Fmutations=AValue) then exit;
  987. Fmutations:=AValue;
  988. MarkPropertyChanged(AIndex);
  989. end;
  990. Procedure TCommitRequest.Setmode(AIndex : Integer; const AValue : String);
  991. begin
  992. If (Fmode=AValue) then exit;
  993. Fmode:=AValue;
  994. MarkPropertyChanged(AIndex);
  995. end;
  996. //2.6.4. bug workaround
  997. {$IFDEF VER2_6}
  998. Procedure TCommitRequest.SetArrayLength(Const AName : String; ALength : Longint);
  999. begin
  1000. Case AName of
  1001. 'mutations' : SetLength(Fmutations,ALength);
  1002. else
  1003. Inherited SetArrayLength(AName,ALength);
  1004. end;
  1005. end;
  1006. {$ENDIF VER2_6}
  1007. { --------------------------------------------------------------------
  1008. TRollbackRequest
  1009. --------------------------------------------------------------------}
  1010. Procedure TRollbackRequest.Settransaction(AIndex : Integer; const AValue : String);
  1011. begin
  1012. If (Ftransaction=AValue) then exit;
  1013. Ftransaction:=AValue;
  1014. MarkPropertyChanged(AIndex);
  1015. end;
  1016. { --------------------------------------------------------------------
  1017. TQuery
  1018. --------------------------------------------------------------------}
  1019. Procedure TQuery.Setlimit(AIndex : Integer; const AValue : integer);
  1020. begin
  1021. If (Flimit=AValue) then exit;
  1022. Flimit:=AValue;
  1023. MarkPropertyChanged(AIndex);
  1024. end;
  1025. Procedure TQuery.Setfilter(AIndex : Integer; const AValue : TFilter);
  1026. begin
  1027. If (Ffilter=AValue) then exit;
  1028. Ffilter:=AValue;
  1029. MarkPropertyChanged(AIndex);
  1030. end;
  1031. Procedure TQuery.SetendCursor(AIndex : Integer; const AValue : String);
  1032. begin
  1033. If (FendCursor=AValue) then exit;
  1034. FendCursor:=AValue;
  1035. MarkPropertyChanged(AIndex);
  1036. end;
  1037. Procedure TQuery.SetdistinctOn(AIndex : Integer; const AValue : TQueryTypedistinctOnArray);
  1038. begin
  1039. If (FdistinctOn=AValue) then exit;
  1040. FdistinctOn:=AValue;
  1041. MarkPropertyChanged(AIndex);
  1042. end;
  1043. Procedure TQuery.Setoffset(AIndex : Integer; const AValue : integer);
  1044. begin
  1045. If (Foffset=AValue) then exit;
  1046. Foffset:=AValue;
  1047. MarkPropertyChanged(AIndex);
  1048. end;
  1049. Procedure TQuery.Setprojection(AIndex : Integer; const AValue : TQueryTypeprojectionArray);
  1050. begin
  1051. If (Fprojection=AValue) then exit;
  1052. Fprojection:=AValue;
  1053. MarkPropertyChanged(AIndex);
  1054. end;
  1055. Procedure TQuery.SetstartCursor(AIndex : Integer; const AValue : String);
  1056. begin
  1057. If (FstartCursor=AValue) then exit;
  1058. FstartCursor:=AValue;
  1059. MarkPropertyChanged(AIndex);
  1060. end;
  1061. Procedure TQuery.Setorder(AIndex : Integer; const AValue : TQueryTypeorderArray);
  1062. begin
  1063. If (Forder=AValue) then exit;
  1064. Forder:=AValue;
  1065. MarkPropertyChanged(AIndex);
  1066. end;
  1067. Procedure TQuery.Setkind(AIndex : Integer; const AValue : TQueryTypekindArray);
  1068. begin
  1069. If (Fkind=AValue) then exit;
  1070. Fkind:=AValue;
  1071. MarkPropertyChanged(AIndex);
  1072. end;
  1073. //2.6.4. bug workaround
  1074. {$IFDEF VER2_6}
  1075. Procedure TQuery.SetArrayLength(Const AName : String; ALength : Longint);
  1076. begin
  1077. Case AName of
  1078. 'distincton' : SetLength(FdistinctOn,ALength);
  1079. 'projection' : SetLength(Fprojection,ALength);
  1080. 'order' : SetLength(Forder,ALength);
  1081. 'kind' : SetLength(Fkind,ALength);
  1082. else
  1083. Inherited SetArrayLength(AName,ALength);
  1084. end;
  1085. end;
  1086. {$ENDIF VER2_6}
  1087. { --------------------------------------------------------------------
  1088. TEntityResult
  1089. --------------------------------------------------------------------}
  1090. Procedure TEntityResult.Setcursor(AIndex : Integer; const AValue : String);
  1091. begin
  1092. If (Fcursor=AValue) then exit;
  1093. Fcursor:=AValue;
  1094. MarkPropertyChanged(AIndex);
  1095. end;
  1096. Procedure TEntityResult.Setentity(AIndex : Integer; const AValue : TEntity);
  1097. begin
  1098. If (Fentity=AValue) then exit;
  1099. Fentity:=AValue;
  1100. MarkPropertyChanged(AIndex);
  1101. end;
  1102. { --------------------------------------------------------------------
  1103. TGqlQueryParameter
  1104. --------------------------------------------------------------------}
  1105. Procedure TGqlQueryParameter.Setcursor(AIndex : Integer; const AValue : String);
  1106. begin
  1107. If (Fcursor=AValue) then exit;
  1108. Fcursor:=AValue;
  1109. MarkPropertyChanged(AIndex);
  1110. end;
  1111. Procedure TGqlQueryParameter.Setvalue(AIndex : Integer; const AValue : TValue);
  1112. begin
  1113. If (Fvalue=AValue) then exit;
  1114. Fvalue:=AValue;
  1115. MarkPropertyChanged(AIndex);
  1116. end;
  1117. { --------------------------------------------------------------------
  1118. TBeginTransactionResponse
  1119. --------------------------------------------------------------------}
  1120. Procedure TBeginTransactionResponse.Settransaction(AIndex : Integer; const AValue : String);
  1121. begin
  1122. If (Ftransaction=AValue) then exit;
  1123. Ftransaction:=AValue;
  1124. MarkPropertyChanged(AIndex);
  1125. end;
  1126. { --------------------------------------------------------------------
  1127. TFilter
  1128. --------------------------------------------------------------------}
  1129. Procedure TFilter.SetpropertyFilter(AIndex : Integer; const AValue : TPropertyFilter);
  1130. begin
  1131. If (FpropertyFilter=AValue) then exit;
  1132. FpropertyFilter:=AValue;
  1133. MarkPropertyChanged(AIndex);
  1134. end;
  1135. Procedure TFilter.SetcompositeFilter(AIndex : Integer; const AValue : TCompositeFilter);
  1136. begin
  1137. If (FcompositeFilter=AValue) then exit;
  1138. FcompositeFilter:=AValue;
  1139. MarkPropertyChanged(AIndex);
  1140. end;
  1141. { --------------------------------------------------------------------
  1142. TArrayValue
  1143. --------------------------------------------------------------------}
  1144. Procedure TArrayValue.Setvalues(AIndex : Integer; const AValue : TArrayValueTypevaluesArray);
  1145. begin
  1146. If (Fvalues=AValue) then exit;
  1147. Fvalues:=AValue;
  1148. MarkPropertyChanged(AIndex);
  1149. end;
  1150. //2.6.4. bug workaround
  1151. {$IFDEF VER2_6}
  1152. Procedure TArrayValue.SetArrayLength(Const AName : String; ALength : Longint);
  1153. begin
  1154. Case AName of
  1155. 'values' : SetLength(Fvalues,ALength);
  1156. else
  1157. Inherited SetArrayLength(AName,ALength);
  1158. end;
  1159. end;
  1160. {$ENDIF VER2_6}
  1161. { --------------------------------------------------------------------
  1162. TPartitionId
  1163. --------------------------------------------------------------------}
  1164. Procedure TPartitionId.SetnamespaceId(AIndex : Integer; const AValue : String);
  1165. begin
  1166. If (FnamespaceId=AValue) then exit;
  1167. FnamespaceId:=AValue;
  1168. MarkPropertyChanged(AIndex);
  1169. end;
  1170. Procedure TPartitionId.SetprojectId(AIndex : Integer; const AValue : String);
  1171. begin
  1172. If (FprojectId=AValue) then exit;
  1173. FprojectId:=AValue;
  1174. MarkPropertyChanged(AIndex);
  1175. end;
  1176. { --------------------------------------------------------------------
  1177. TQueryResultBatch
  1178. --------------------------------------------------------------------}
  1179. Procedure TQueryResultBatch.SetendCursor(AIndex : Integer; const AValue : String);
  1180. begin
  1181. If (FendCursor=AValue) then exit;
  1182. FendCursor:=AValue;
  1183. MarkPropertyChanged(AIndex);
  1184. end;
  1185. Procedure TQueryResultBatch.SetskippedCursor(AIndex : Integer; const AValue : String);
  1186. begin
  1187. If (FskippedCursor=AValue) then exit;
  1188. FskippedCursor:=AValue;
  1189. MarkPropertyChanged(AIndex);
  1190. end;
  1191. Procedure TQueryResultBatch.SetentityResultType(AIndex : Integer; const AValue : String);
  1192. begin
  1193. If (FentityResultType=AValue) then exit;
  1194. FentityResultType:=AValue;
  1195. MarkPropertyChanged(AIndex);
  1196. end;
  1197. Procedure TQueryResultBatch.SetmoreResults(AIndex : Integer; const AValue : String);
  1198. begin
  1199. If (FmoreResults=AValue) then exit;
  1200. FmoreResults:=AValue;
  1201. MarkPropertyChanged(AIndex);
  1202. end;
  1203. Procedure TQueryResultBatch.SetentityResults(AIndex : Integer; const AValue : TQueryResultBatchTypeentityResultsArray);
  1204. begin
  1205. If (FentityResults=AValue) then exit;
  1206. FentityResults:=AValue;
  1207. MarkPropertyChanged(AIndex);
  1208. end;
  1209. Procedure TQueryResultBatch.SetskippedResults(AIndex : Integer; const AValue : integer);
  1210. begin
  1211. If (FskippedResults=AValue) then exit;
  1212. FskippedResults:=AValue;
  1213. MarkPropertyChanged(AIndex);
  1214. end;
  1215. //2.6.4. bug workaround
  1216. {$IFDEF VER2_6}
  1217. Procedure TQueryResultBatch.SetArrayLength(Const AName : String; ALength : Longint);
  1218. begin
  1219. Case AName of
  1220. 'entityresults' : SetLength(FentityResults,ALength);
  1221. else
  1222. Inherited SetArrayLength(AName,ALength);
  1223. end;
  1224. end;
  1225. {$ENDIF VER2_6}
  1226. { --------------------------------------------------------------------
  1227. TAllocateIdsRequest
  1228. --------------------------------------------------------------------}
  1229. Procedure TAllocateIdsRequest.Setkeys(AIndex : Integer; const AValue : TAllocateIdsRequestTypekeysArray);
  1230. begin
  1231. If (Fkeys=AValue) then exit;
  1232. Fkeys:=AValue;
  1233. MarkPropertyChanged(AIndex);
  1234. end;
  1235. //2.6.4. bug workaround
  1236. {$IFDEF VER2_6}
  1237. Procedure TAllocateIdsRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1238. begin
  1239. Case AName of
  1240. 'keys' : SetLength(Fkeys,ALength);
  1241. else
  1242. Inherited SetArrayLength(AName,ALength);
  1243. end;
  1244. end;
  1245. {$ENDIF VER2_6}
  1246. { --------------------------------------------------------------------
  1247. TPropertyFilter
  1248. --------------------------------------------------------------------}
  1249. Procedure TPropertyFilter.Setvalue(AIndex : Integer; const AValue : TValue);
  1250. begin
  1251. If (Fvalue=AValue) then exit;
  1252. Fvalue:=AValue;
  1253. MarkPropertyChanged(AIndex);
  1254. end;
  1255. Procedure TPropertyFilter.Setop(AIndex : Integer; const AValue : String);
  1256. begin
  1257. If (Fop=AValue) then exit;
  1258. Fop:=AValue;
  1259. MarkPropertyChanged(AIndex);
  1260. end;
  1261. Procedure TPropertyFilter.Set_property(AIndex : Integer; const AValue : TPropertyReference);
  1262. begin
  1263. If (F_property=AValue) then exit;
  1264. F_property:=AValue;
  1265. MarkPropertyChanged(AIndex);
  1266. end;
  1267. Class Function TPropertyFilter.ExportPropertyName(Const AName : String) :String;
  1268. begin
  1269. Case AName of
  1270. '_property' : Result:='property';
  1271. else
  1272. Result:=Inherited ExportPropertyName(AName);
  1273. end;
  1274. end;
  1275. { --------------------------------------------------------------------
  1276. TKindExpression
  1277. --------------------------------------------------------------------}
  1278. Procedure TKindExpression.Setname(AIndex : Integer; const AValue : String);
  1279. begin
  1280. If (Fname=AValue) then exit;
  1281. Fname:=AValue;
  1282. MarkPropertyChanged(AIndex);
  1283. end;
  1284. { --------------------------------------------------------------------
  1285. TPathElement
  1286. --------------------------------------------------------------------}
  1287. Procedure TPathElement.Setkind(AIndex : Integer; const AValue : String);
  1288. begin
  1289. If (Fkind=AValue) then exit;
  1290. Fkind:=AValue;
  1291. MarkPropertyChanged(AIndex);
  1292. end;
  1293. Procedure TPathElement.Setname(AIndex : Integer; const AValue : String);
  1294. begin
  1295. If (Fname=AValue) then exit;
  1296. Fname:=AValue;
  1297. MarkPropertyChanged(AIndex);
  1298. end;
  1299. Procedure TPathElement.Setid(AIndex : Integer; const AValue : String);
  1300. begin
  1301. If (Fid=AValue) then exit;
  1302. Fid:=AValue;
  1303. MarkPropertyChanged(AIndex);
  1304. end;
  1305. { --------------------------------------------------------------------
  1306. TRollbackResponse
  1307. --------------------------------------------------------------------}
  1308. { --------------------------------------------------------------------
  1309. TPropertyReference
  1310. --------------------------------------------------------------------}
  1311. Procedure TPropertyReference.Setname(AIndex : Integer; const AValue : String);
  1312. begin
  1313. If (Fname=AValue) then exit;
  1314. Fname:=AValue;
  1315. MarkPropertyChanged(AIndex);
  1316. end;
  1317. { --------------------------------------------------------------------
  1318. TProjection
  1319. --------------------------------------------------------------------}
  1320. Procedure TProjection.Set_property(AIndex : Integer; const AValue : TPropertyReference);
  1321. begin
  1322. If (F_property=AValue) then exit;
  1323. F_property:=AValue;
  1324. MarkPropertyChanged(AIndex);
  1325. end;
  1326. Class Function TProjection.ExportPropertyName(Const AName : String) :String;
  1327. begin
  1328. Case AName of
  1329. '_property' : Result:='property';
  1330. else
  1331. Result:=Inherited ExportPropertyName(AName);
  1332. end;
  1333. end;
  1334. { --------------------------------------------------------------------
  1335. TAllocateIdsResponse
  1336. --------------------------------------------------------------------}
  1337. Procedure TAllocateIdsResponse.Setkeys(AIndex : Integer; const AValue : TAllocateIdsResponseTypekeysArray);
  1338. begin
  1339. If (Fkeys=AValue) then exit;
  1340. Fkeys:=AValue;
  1341. MarkPropertyChanged(AIndex);
  1342. end;
  1343. //2.6.4. bug workaround
  1344. {$IFDEF VER2_6}
  1345. Procedure TAllocateIdsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1346. begin
  1347. Case AName of
  1348. 'keys' : SetLength(Fkeys,ALength);
  1349. else
  1350. Inherited SetArrayLength(AName,ALength);
  1351. end;
  1352. end;
  1353. {$ENDIF VER2_6}
  1354. { --------------------------------------------------------------------
  1355. TMutationResult
  1356. --------------------------------------------------------------------}
  1357. Procedure TMutationResult.Setkey(AIndex : Integer; const AValue : TKey);
  1358. begin
  1359. If (Fkey=AValue) then exit;
  1360. Fkey:=AValue;
  1361. MarkPropertyChanged(AIndex);
  1362. end;
  1363. { --------------------------------------------------------------------
  1364. TLookupResponse
  1365. --------------------------------------------------------------------}
  1366. Procedure TLookupResponse.Setfound(AIndex : Integer; const AValue : TLookupResponseTypefoundArray);
  1367. begin
  1368. If (Ffound=AValue) then exit;
  1369. Ffound:=AValue;
  1370. MarkPropertyChanged(AIndex);
  1371. end;
  1372. Procedure TLookupResponse.Setdeferred(AIndex : Integer; const AValue : TLookupResponseTypedeferredArray);
  1373. begin
  1374. If (Fdeferred=AValue) then exit;
  1375. Fdeferred:=AValue;
  1376. MarkPropertyChanged(AIndex);
  1377. end;
  1378. Procedure TLookupResponse.Setmissing(AIndex : Integer; const AValue : TLookupResponseTypemissingArray);
  1379. begin
  1380. If (Fmissing=AValue) then exit;
  1381. Fmissing:=AValue;
  1382. MarkPropertyChanged(AIndex);
  1383. end;
  1384. //2.6.4. bug workaround
  1385. {$IFDEF VER2_6}
  1386. Procedure TLookupResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1387. begin
  1388. Case AName of
  1389. 'found' : SetLength(Ffound,ALength);
  1390. 'deferred' : SetLength(Fdeferred,ALength);
  1391. 'missing' : SetLength(Fmissing,ALength);
  1392. else
  1393. Inherited SetArrayLength(AName,ALength);
  1394. end;
  1395. end;
  1396. {$ENDIF VER2_6}
  1397. { --------------------------------------------------------------------
  1398. TBeginTransactionRequest
  1399. --------------------------------------------------------------------}
  1400. { --------------------------------------------------------------------
  1401. TKey
  1402. --------------------------------------------------------------------}
  1403. Procedure TKey.SetpartitionId(AIndex : Integer; const AValue : TPartitionId);
  1404. begin
  1405. If (FpartitionId=AValue) then exit;
  1406. FpartitionId:=AValue;
  1407. MarkPropertyChanged(AIndex);
  1408. end;
  1409. Procedure TKey.Setpath(AIndex : Integer; const AValue : TKeyTypepathArray);
  1410. begin
  1411. If (Fpath=AValue) then exit;
  1412. Fpath:=AValue;
  1413. MarkPropertyChanged(AIndex);
  1414. end;
  1415. //2.6.4. bug workaround
  1416. {$IFDEF VER2_6}
  1417. Procedure TKey.SetArrayLength(Const AName : String; ALength : Longint);
  1418. begin
  1419. Case AName of
  1420. 'path' : SetLength(Fpath,ALength);
  1421. else
  1422. Inherited SetArrayLength(AName,ALength);
  1423. end;
  1424. end;
  1425. {$ENDIF VER2_6}
  1426. { --------------------------------------------------------------------
  1427. TRunQueryResponse
  1428. --------------------------------------------------------------------}
  1429. Procedure TRunQueryResponse.Setbatch(AIndex : Integer; const AValue : TQueryResultBatch);
  1430. begin
  1431. If (Fbatch=AValue) then exit;
  1432. Fbatch:=AValue;
  1433. MarkPropertyChanged(AIndex);
  1434. end;
  1435. Procedure TRunQueryResponse.Setquery(AIndex : Integer; const AValue : TQuery);
  1436. begin
  1437. If (Fquery=AValue) then exit;
  1438. Fquery:=AValue;
  1439. MarkPropertyChanged(AIndex);
  1440. end;
  1441. { --------------------------------------------------------------------
  1442. TEntityTypeproperties
  1443. --------------------------------------------------------------------}
  1444. Class Function TEntityTypeproperties.AllowAdditionalProperties : Boolean;
  1445. begin
  1446. Result:=True;
  1447. end;
  1448. { --------------------------------------------------------------------
  1449. TEntity
  1450. --------------------------------------------------------------------}
  1451. Procedure TEntity.Setproperties(AIndex : Integer; const AValue : TEntityTypeproperties);
  1452. begin
  1453. If (Fproperties=AValue) then exit;
  1454. Fproperties:=AValue;
  1455. MarkPropertyChanged(AIndex);
  1456. end;
  1457. Procedure TEntity.Setkey(AIndex : Integer; const AValue : TKey);
  1458. begin
  1459. If (Fkey=AValue) then exit;
  1460. Fkey:=AValue;
  1461. MarkPropertyChanged(AIndex);
  1462. end;
  1463. { --------------------------------------------------------------------
  1464. TGqlQueryTypenamedBindings
  1465. --------------------------------------------------------------------}
  1466. Class Function TGqlQueryTypenamedBindings.AllowAdditionalProperties : Boolean;
  1467. begin
  1468. Result:=True;
  1469. end;
  1470. { --------------------------------------------------------------------
  1471. TGqlQuery
  1472. --------------------------------------------------------------------}
  1473. Procedure TGqlQuery.SetnamedBindings(AIndex : Integer; const AValue : TGqlQueryTypenamedBindings);
  1474. begin
  1475. If (FnamedBindings=AValue) then exit;
  1476. FnamedBindings:=AValue;
  1477. MarkPropertyChanged(AIndex);
  1478. end;
  1479. Procedure TGqlQuery.SetqueryString(AIndex : Integer; const AValue : String);
  1480. begin
  1481. If (FqueryString=AValue) then exit;
  1482. FqueryString:=AValue;
  1483. MarkPropertyChanged(AIndex);
  1484. end;
  1485. Procedure TGqlQuery.SetallowLiterals(AIndex : Integer; const AValue : boolean);
  1486. begin
  1487. If (FallowLiterals=AValue) then exit;
  1488. FallowLiterals:=AValue;
  1489. MarkPropertyChanged(AIndex);
  1490. end;
  1491. Procedure TGqlQuery.SetpositionalBindings(AIndex : Integer; const AValue : TGqlQueryTypepositionalBindingsArray);
  1492. begin
  1493. If (FpositionalBindings=AValue) then exit;
  1494. FpositionalBindings:=AValue;
  1495. MarkPropertyChanged(AIndex);
  1496. end;
  1497. //2.6.4. bug workaround
  1498. {$IFDEF VER2_6}
  1499. Procedure TGqlQuery.SetArrayLength(Const AName : String; ALength : Longint);
  1500. begin
  1501. Case AName of
  1502. 'positionalbindings' : SetLength(FpositionalBindings,ALength);
  1503. else
  1504. Inherited SetArrayLength(AName,ALength);
  1505. end;
  1506. end;
  1507. {$ENDIF VER2_6}
  1508. { --------------------------------------------------------------------
  1509. TCommitResponse
  1510. --------------------------------------------------------------------}
  1511. Procedure TCommitResponse.SetmutationResults(AIndex : Integer; const AValue : TCommitResponseTypemutationResultsArray);
  1512. begin
  1513. If (FmutationResults=AValue) then exit;
  1514. FmutationResults:=AValue;
  1515. MarkPropertyChanged(AIndex);
  1516. end;
  1517. Procedure TCommitResponse.SetindexUpdates(AIndex : Integer; const AValue : integer);
  1518. begin
  1519. If (FindexUpdates=AValue) then exit;
  1520. FindexUpdates:=AValue;
  1521. MarkPropertyChanged(AIndex);
  1522. end;
  1523. //2.6.4. bug workaround
  1524. {$IFDEF VER2_6}
  1525. Procedure TCommitResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1526. begin
  1527. Case AName of
  1528. 'mutationresults' : SetLength(FmutationResults,ALength);
  1529. else
  1530. Inherited SetArrayLength(AName,ALength);
  1531. end;
  1532. end;
  1533. {$ENDIF VER2_6}
  1534. { --------------------------------------------------------------------
  1535. TMutation
  1536. --------------------------------------------------------------------}
  1537. Procedure TMutation.Setupdate(AIndex : Integer; const AValue : TEntity);
  1538. begin
  1539. If (Fupdate=AValue) then exit;
  1540. Fupdate:=AValue;
  1541. MarkPropertyChanged(AIndex);
  1542. end;
  1543. Procedure TMutation.Setinsert(AIndex : Integer; const AValue : TEntity);
  1544. begin
  1545. If (Finsert=AValue) then exit;
  1546. Finsert:=AValue;
  1547. MarkPropertyChanged(AIndex);
  1548. end;
  1549. Procedure TMutation.Setdelete(AIndex : Integer; const AValue : TKey);
  1550. begin
  1551. If (Fdelete=AValue) then exit;
  1552. Fdelete:=AValue;
  1553. MarkPropertyChanged(AIndex);
  1554. end;
  1555. Procedure TMutation.Setupsert(AIndex : Integer; const AValue : TEntity);
  1556. begin
  1557. If (Fupsert=AValue) then exit;
  1558. Fupsert:=AValue;
  1559. MarkPropertyChanged(AIndex);
  1560. end;
  1561. { --------------------------------------------------------------------
  1562. TRunQueryRequest
  1563. --------------------------------------------------------------------}
  1564. Procedure TRunQueryRequest.SetpartitionId(AIndex : Integer; const AValue : TPartitionId);
  1565. begin
  1566. If (FpartitionId=AValue) then exit;
  1567. FpartitionId:=AValue;
  1568. MarkPropertyChanged(AIndex);
  1569. end;
  1570. Procedure TRunQueryRequest.SetgqlQuery(AIndex : Integer; const AValue : TGqlQuery);
  1571. begin
  1572. If (FgqlQuery=AValue) then exit;
  1573. FgqlQuery:=AValue;
  1574. MarkPropertyChanged(AIndex);
  1575. end;
  1576. Procedure TRunQueryRequest.Setquery(AIndex : Integer; const AValue : TQuery);
  1577. begin
  1578. If (Fquery=AValue) then exit;
  1579. Fquery:=AValue;
  1580. MarkPropertyChanged(AIndex);
  1581. end;
  1582. Procedure TRunQueryRequest.SetreadOptions(AIndex : Integer; const AValue : TReadOptions);
  1583. begin
  1584. If (FreadOptions=AValue) then exit;
  1585. FreadOptions:=AValue;
  1586. MarkPropertyChanged(AIndex);
  1587. end;
  1588. { --------------------------------------------------------------------
  1589. TCompositeFilter
  1590. --------------------------------------------------------------------}
  1591. Procedure TCompositeFilter.Setop(AIndex : Integer; const AValue : String);
  1592. begin
  1593. If (Fop=AValue) then exit;
  1594. Fop:=AValue;
  1595. MarkPropertyChanged(AIndex);
  1596. end;
  1597. Procedure TCompositeFilter.Setfilters(AIndex : Integer; const AValue : TCompositeFilterTypefiltersArray);
  1598. begin
  1599. If (Ffilters=AValue) then exit;
  1600. Ffilters:=AValue;
  1601. MarkPropertyChanged(AIndex);
  1602. end;
  1603. //2.6.4. bug workaround
  1604. {$IFDEF VER2_6}
  1605. Procedure TCompositeFilter.SetArrayLength(Const AName : String; ALength : Longint);
  1606. begin
  1607. Case AName of
  1608. 'filters' : SetLength(Ffilters,ALength);
  1609. else
  1610. Inherited SetArrayLength(AName,ALength);
  1611. end;
  1612. end;
  1613. {$ENDIF VER2_6}
  1614. { --------------------------------------------------------------------
  1615. TLatLng
  1616. --------------------------------------------------------------------}
  1617. Procedure TLatLng.Setlongitude(AIndex : Integer; const AValue : double);
  1618. begin
  1619. If (Flongitude=AValue) then exit;
  1620. Flongitude:=AValue;
  1621. MarkPropertyChanged(AIndex);
  1622. end;
  1623. Procedure TLatLng.Setlatitude(AIndex : Integer; const AValue : double);
  1624. begin
  1625. If (Flatitude=AValue) then exit;
  1626. Flatitude:=AValue;
  1627. MarkPropertyChanged(AIndex);
  1628. end;
  1629. { --------------------------------------------------------------------
  1630. TLookupRequest
  1631. --------------------------------------------------------------------}
  1632. Procedure TLookupRequest.Setkeys(AIndex : Integer; const AValue : TLookupRequestTypekeysArray);
  1633. begin
  1634. If (Fkeys=AValue) then exit;
  1635. Fkeys:=AValue;
  1636. MarkPropertyChanged(AIndex);
  1637. end;
  1638. Procedure TLookupRequest.SetreadOptions(AIndex : Integer; const AValue : TReadOptions);
  1639. begin
  1640. If (FreadOptions=AValue) then exit;
  1641. FreadOptions:=AValue;
  1642. MarkPropertyChanged(AIndex);
  1643. end;
  1644. //2.6.4. bug workaround
  1645. {$IFDEF VER2_6}
  1646. Procedure TLookupRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1647. begin
  1648. Case AName of
  1649. 'keys' : SetLength(Fkeys,ALength);
  1650. else
  1651. Inherited SetArrayLength(AName,ALength);
  1652. end;
  1653. end;
  1654. {$ENDIF VER2_6}
  1655. { --------------------------------------------------------------------
  1656. TProjectsResource
  1657. --------------------------------------------------------------------}
  1658. Class Function TProjectsResource.ResourceName : String;
  1659. begin
  1660. Result:='projects';
  1661. end;
  1662. Class Function TProjectsResource.DefaultAPI : TGoogleAPIClass;
  1663. begin
  1664. Result:=TdatastoreAPI;
  1665. end;
  1666. Function TProjectsResource.RunQuery(projectId: string; aRunQueryRequest : TRunQueryRequest) : TRunQueryResponse;
  1667. Const
  1668. _HTTPMethod = 'POST';
  1669. _Path = 'v1beta3/projects/{projectId}:runQuery';
  1670. _Methodid = 'datastore.projects.runQuery';
  1671. Var
  1672. _P : String;
  1673. begin
  1674. _P:=SubstitutePath(_Path,['projectId',projectId]);
  1675. Result:=ServiceCall(_HTTPMethod,_P,'',aRunQueryRequest,TRunQueryResponse) as TRunQueryResponse;
  1676. end;
  1677. Function TProjectsResource.BeginTransaction(projectId: string; aBeginTransactionRequest : TBeginTransactionRequest) : TBeginTransactionResponse;
  1678. Const
  1679. _HTTPMethod = 'POST';
  1680. _Path = 'v1beta3/projects/{projectId}:beginTransaction';
  1681. _Methodid = 'datastore.projects.beginTransaction';
  1682. Var
  1683. _P : String;
  1684. begin
  1685. _P:=SubstitutePath(_Path,['projectId',projectId]);
  1686. Result:=ServiceCall(_HTTPMethod,_P,'',aBeginTransactionRequest,TBeginTransactionResponse) as TBeginTransactionResponse;
  1687. end;
  1688. Function TProjectsResource.AllocateIds(projectId: string; aAllocateIdsRequest : TAllocateIdsRequest) : TAllocateIdsResponse;
  1689. Const
  1690. _HTTPMethod = 'POST';
  1691. _Path = 'v1beta3/projects/{projectId}:allocateIds';
  1692. _Methodid = 'datastore.projects.allocateIds';
  1693. Var
  1694. _P : String;
  1695. begin
  1696. _P:=SubstitutePath(_Path,['projectId',projectId]);
  1697. Result:=ServiceCall(_HTTPMethod,_P,'',aAllocateIdsRequest,TAllocateIdsResponse) as TAllocateIdsResponse;
  1698. end;
  1699. Function TProjectsResource.Lookup(projectId: string; aLookupRequest : TLookupRequest) : TLookupResponse;
  1700. Const
  1701. _HTTPMethod = 'POST';
  1702. _Path = 'v1beta3/projects/{projectId}:lookup';
  1703. _Methodid = 'datastore.projects.lookup';
  1704. Var
  1705. _P : String;
  1706. begin
  1707. _P:=SubstitutePath(_Path,['projectId',projectId]);
  1708. Result:=ServiceCall(_HTTPMethod,_P,'',aLookupRequest,TLookupResponse) as TLookupResponse;
  1709. end;
  1710. Function TProjectsResource.Commit(projectId: string; aCommitRequest : TCommitRequest) : TCommitResponse;
  1711. Const
  1712. _HTTPMethod = 'POST';
  1713. _Path = 'v1beta3/projects/{projectId}:commit';
  1714. _Methodid = 'datastore.projects.commit';
  1715. Var
  1716. _P : String;
  1717. begin
  1718. _P:=SubstitutePath(_Path,['projectId',projectId]);
  1719. Result:=ServiceCall(_HTTPMethod,_P,'',aCommitRequest,TCommitResponse) as TCommitResponse;
  1720. end;
  1721. Function TProjectsResource.Rollback(projectId: string; aRollbackRequest : TRollbackRequest) : TRollbackResponse;
  1722. Const
  1723. _HTTPMethod = 'POST';
  1724. _Path = 'v1beta3/projects/{projectId}:rollback';
  1725. _Methodid = 'datastore.projects.rollback';
  1726. Var
  1727. _P : String;
  1728. begin
  1729. _P:=SubstitutePath(_Path,['projectId',projectId]);
  1730. Result:=ServiceCall(_HTTPMethod,_P,'',aRollbackRequest,TRollbackResponse) as TRollbackResponse;
  1731. end;
  1732. { --------------------------------------------------------------------
  1733. TDatastoreAPI
  1734. --------------------------------------------------------------------}
  1735. Class Function TDatastoreAPI.APIName : String;
  1736. begin
  1737. Result:='datastore';
  1738. end;
  1739. Class Function TDatastoreAPI.APIVersion : String;
  1740. begin
  1741. Result:='v1beta3';
  1742. end;
  1743. Class Function TDatastoreAPI.APIRevision : String;
  1744. begin
  1745. Result:='20160502';
  1746. end;
  1747. Class Function TDatastoreAPI.APIID : String;
  1748. begin
  1749. Result:='datastore:v1beta3';
  1750. end;
  1751. Class Function TDatastoreAPI.APITitle : String;
  1752. begin
  1753. Result:='Google Cloud Datastore API';
  1754. end;
  1755. Class Function TDatastoreAPI.APIDescription : String;
  1756. begin
  1757. Result:='Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.';
  1758. end;
  1759. Class Function TDatastoreAPI.APIOwnerDomain : String;
  1760. begin
  1761. Result:='google.com';
  1762. end;
  1763. Class Function TDatastoreAPI.APIOwnerName : String;
  1764. begin
  1765. Result:='Google';
  1766. end;
  1767. Class Function TDatastoreAPI.APIIcon16 : String;
  1768. begin
  1769. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1770. end;
  1771. Class Function TDatastoreAPI.APIIcon32 : String;
  1772. begin
  1773. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1774. end;
  1775. Class Function TDatastoreAPI.APIdocumentationLink : String;
  1776. begin
  1777. Result:='https://cloud.google.com/datastore/';
  1778. end;
  1779. Class Function TDatastoreAPI.APIrootUrl : string;
  1780. begin
  1781. Result:='https://datastore.googleapis.com/';
  1782. end;
  1783. Class Function TDatastoreAPI.APIbasePath : string;
  1784. begin
  1785. Result:='';
  1786. end;
  1787. Class Function TDatastoreAPI.APIbaseURL : String;
  1788. begin
  1789. Result:='https://datastore.googleapis.com/';
  1790. end;
  1791. Class Function TDatastoreAPI.APIProtocol : string;
  1792. begin
  1793. Result:='rest';
  1794. end;
  1795. Class Function TDatastoreAPI.APIservicePath : string;
  1796. begin
  1797. Result:='';
  1798. end;
  1799. Class Function TDatastoreAPI.APIbatchPath : String;
  1800. begin
  1801. Result:='batch';
  1802. end;
  1803. Class Function TDatastoreAPI.APIAuthScopes : TScopeInfoArray;
  1804. begin
  1805. SetLength(Result,2);
  1806. Result[0].Name:='https://www.googleapis.com/auth/cloud-platform';
  1807. Result[0].Description:='View and manage your data across Google Cloud Platform services';
  1808. Result[1].Name:='https://www.googleapis.com/auth/datastore';
  1809. Result[1].Description:='View and manage your Google Cloud Datastore data';
  1810. end;
  1811. Class Function TDatastoreAPI.APINeedsAuth : Boolean;
  1812. begin
  1813. Result:=True;
  1814. end;
  1815. Class Procedure TDatastoreAPI.RegisterAPIResources;
  1816. begin
  1817. TValue.RegisterObject;
  1818. TReadOptions.RegisterObject;
  1819. TPropertyOrder.RegisterObject;
  1820. TCommitRequest.RegisterObject;
  1821. TRollbackRequest.RegisterObject;
  1822. TQuery.RegisterObject;
  1823. TEntityResult.RegisterObject;
  1824. TGqlQueryParameter.RegisterObject;
  1825. TBeginTransactionResponse.RegisterObject;
  1826. TFilter.RegisterObject;
  1827. TArrayValue.RegisterObject;
  1828. TPartitionId.RegisterObject;
  1829. TQueryResultBatch.RegisterObject;
  1830. TAllocateIdsRequest.RegisterObject;
  1831. TPropertyFilter.RegisterObject;
  1832. TKindExpression.RegisterObject;
  1833. TPathElement.RegisterObject;
  1834. TRollbackResponse.RegisterObject;
  1835. TPropertyReference.RegisterObject;
  1836. TProjection.RegisterObject;
  1837. TAllocateIdsResponse.RegisterObject;
  1838. TMutationResult.RegisterObject;
  1839. TLookupResponse.RegisterObject;
  1840. TBeginTransactionRequest.RegisterObject;
  1841. TKey.RegisterObject;
  1842. TRunQueryResponse.RegisterObject;
  1843. TEntityTypeproperties.RegisterObject;
  1844. TEntity.RegisterObject;
  1845. TGqlQueryTypenamedBindings.RegisterObject;
  1846. TGqlQuery.RegisterObject;
  1847. TCommitResponse.RegisterObject;
  1848. TMutation.RegisterObject;
  1849. TRunQueryRequest.RegisterObject;
  1850. TCompositeFilter.RegisterObject;
  1851. TLatLng.RegisterObject;
  1852. TLookupRequest.RegisterObject;
  1853. end;
  1854. Function TDatastoreAPI.GetProjectsInstance : TProjectsResource;
  1855. begin
  1856. if (FProjectsInstance=Nil) then
  1857. FProjectsInstance:=CreateProjectsResource;
  1858. Result:=FProjectsInstance;
  1859. end;
  1860. Function TDatastoreAPI.CreateProjectsResource : TProjectsResource;
  1861. begin
  1862. Result:=CreateProjectsResource(Self);
  1863. end;
  1864. Function TDatastoreAPI.CreateProjectsResource(AOwner : TComponent) : TProjectsResource;
  1865. begin
  1866. Result:=TProjectsResource.Create(AOwner);
  1867. Result.API:=Self.API;
  1868. end;
  1869. initialization
  1870. TDatastoreAPI.RegisterAPI;
  1871. end.