googlegamesconfiguration.pp 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614
  1. unit googlegamesConfiguration;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TAchievementConfiguration = Class;
  9. TAchievementConfigurationDetail = Class;
  10. TAchievementConfigurationListResponse = Class;
  11. TGamesNumberAffixConfiguration = Class;
  12. TGamesNumberFormatConfiguration = Class;
  13. TImageConfiguration = Class;
  14. TLeaderboardConfiguration = Class;
  15. TLeaderboardConfigurationDetail = Class;
  16. TLeaderboardConfigurationListResponse = Class;
  17. TLocalizedString = Class;
  18. TLocalizedStringBundle = Class;
  19. TAchievementConfigurationArray = Array of TAchievementConfiguration;
  20. TAchievementConfigurationDetailArray = Array of TAchievementConfigurationDetail;
  21. TAchievementConfigurationListResponseArray = Array of TAchievementConfigurationListResponse;
  22. TGamesNumberAffixConfigurationArray = Array of TGamesNumberAffixConfiguration;
  23. TGamesNumberFormatConfigurationArray = Array of TGamesNumberFormatConfiguration;
  24. TImageConfigurationArray = Array of TImageConfiguration;
  25. TLeaderboardConfigurationArray = Array of TLeaderboardConfiguration;
  26. TLeaderboardConfigurationDetailArray = Array of TLeaderboardConfigurationDetail;
  27. TLeaderboardConfigurationListResponseArray = Array of TLeaderboardConfigurationListResponse;
  28. TLocalizedStringArray = Array of TLocalizedString;
  29. TLocalizedStringBundleArray = Array of TLocalizedStringBundle;
  30. //Anonymous types, using auto-generated names
  31. TAchievementConfigurationListResponseTypeitemsArray = Array of TAchievementConfiguration;
  32. TLeaderboardConfigurationListResponseTypeitemsArray = Array of TLeaderboardConfiguration;
  33. TLocalizedStringBundleTypetranslationsArray = Array of TLocalizedString;
  34. { --------------------------------------------------------------------
  35. TAchievementConfiguration
  36. --------------------------------------------------------------------}
  37. TAchievementConfiguration = Class(TGoogleBaseObject)
  38. Private
  39. FachievementType : String;
  40. Fdraft : TAchievementConfigurationDetail;
  41. Fid : String;
  42. FinitialState : String;
  43. Fkind : String;
  44. F_published : TAchievementConfigurationDetail;
  45. FstepsToUnlock : integer;
  46. Ftoken : String;
  47. Protected
  48. Class Function ExportPropertyName(Const AName : String) : string; override;
  49. //Property setters
  50. Procedure SetachievementType(AIndex : Integer; const AValue : String); virtual;
  51. Procedure Setdraft(AIndex : Integer; const AValue : TAchievementConfigurationDetail); virtual;
  52. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  53. Procedure SetinitialState(AIndex : Integer; const AValue : String); virtual;
  54. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  55. Procedure Set_published(AIndex : Integer; const AValue : TAchievementConfigurationDetail); virtual;
  56. Procedure SetstepsToUnlock(AIndex : Integer; const AValue : integer); virtual;
  57. Procedure Settoken(AIndex : Integer; const AValue : String); virtual;
  58. Public
  59. Published
  60. Property achievementType : String Index 0 Read FachievementType Write SetachievementType;
  61. Property draft : TAchievementConfigurationDetail Index 8 Read Fdraft Write Setdraft;
  62. Property id : String Index 16 Read Fid Write Setid;
  63. Property initialState : String Index 24 Read FinitialState Write SetinitialState;
  64. Property kind : String Index 32 Read Fkind Write Setkind;
  65. Property _published : TAchievementConfigurationDetail Index 40 Read F_published Write Set_published;
  66. Property stepsToUnlock : integer Index 48 Read FstepsToUnlock Write SetstepsToUnlock;
  67. Property token : String Index 56 Read Ftoken Write Settoken;
  68. end;
  69. TAchievementConfigurationClass = Class of TAchievementConfiguration;
  70. { --------------------------------------------------------------------
  71. TAchievementConfigurationDetail
  72. --------------------------------------------------------------------}
  73. TAchievementConfigurationDetail = Class(TGoogleBaseObject)
  74. Private
  75. Fdescription : TLocalizedStringBundle;
  76. FiconUrl : String;
  77. Fkind : String;
  78. Fname : TLocalizedStringBundle;
  79. FpointValue : integer;
  80. FsortRank : integer;
  81. Protected
  82. //Property setters
  83. Procedure Setdescription(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  84. Procedure SeticonUrl(AIndex : Integer; const AValue : String); virtual;
  85. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  86. Procedure Setname(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  87. Procedure SetpointValue(AIndex : Integer; const AValue : integer); virtual;
  88. Procedure SetsortRank(AIndex : Integer; const AValue : integer); virtual;
  89. Public
  90. Published
  91. Property description : TLocalizedStringBundle Index 0 Read Fdescription Write Setdescription;
  92. Property iconUrl : String Index 8 Read FiconUrl Write SeticonUrl;
  93. Property kind : String Index 16 Read Fkind Write Setkind;
  94. Property name : TLocalizedStringBundle Index 24 Read Fname Write Setname;
  95. Property pointValue : integer Index 32 Read FpointValue Write SetpointValue;
  96. Property sortRank : integer Index 40 Read FsortRank Write SetsortRank;
  97. end;
  98. TAchievementConfigurationDetailClass = Class of TAchievementConfigurationDetail;
  99. { --------------------------------------------------------------------
  100. TAchievementConfigurationListResponse
  101. --------------------------------------------------------------------}
  102. TAchievementConfigurationListResponse = Class(TGoogleBaseObject)
  103. Private
  104. Fitems : TAchievementConfigurationListResponseTypeitemsArray;
  105. Fkind : String;
  106. FnextPageToken : String;
  107. Protected
  108. //Property setters
  109. Procedure Setitems(AIndex : Integer; const AValue : TAchievementConfigurationListResponseTypeitemsArray); virtual;
  110. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  111. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  112. //2.6.4. bug workaround
  113. {$IFDEF VER2_6}
  114. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  115. {$ENDIF VER2_6}
  116. Public
  117. Published
  118. Property items : TAchievementConfigurationListResponseTypeitemsArray Index 0 Read Fitems Write Setitems;
  119. Property kind : String Index 8 Read Fkind Write Setkind;
  120. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  121. end;
  122. TAchievementConfigurationListResponseClass = Class of TAchievementConfigurationListResponse;
  123. { --------------------------------------------------------------------
  124. TGamesNumberAffixConfiguration
  125. --------------------------------------------------------------------}
  126. TGamesNumberAffixConfiguration = Class(TGoogleBaseObject)
  127. Private
  128. Ffew : TLocalizedStringBundle;
  129. Fmany : TLocalizedStringBundle;
  130. Fone : TLocalizedStringBundle;
  131. Fother : TLocalizedStringBundle;
  132. Ftwo : TLocalizedStringBundle;
  133. Fzero : TLocalizedStringBundle;
  134. Protected
  135. //Property setters
  136. Procedure Setfew(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  137. Procedure Setmany(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  138. Procedure Setone(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  139. Procedure Setother(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  140. Procedure Settwo(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  141. Procedure Setzero(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  142. Public
  143. Published
  144. Property few : TLocalizedStringBundle Index 0 Read Ffew Write Setfew;
  145. Property many : TLocalizedStringBundle Index 8 Read Fmany Write Setmany;
  146. Property one : TLocalizedStringBundle Index 16 Read Fone Write Setone;
  147. Property other : TLocalizedStringBundle Index 24 Read Fother Write Setother;
  148. Property two : TLocalizedStringBundle Index 32 Read Ftwo Write Settwo;
  149. Property zero : TLocalizedStringBundle Index 40 Read Fzero Write Setzero;
  150. end;
  151. TGamesNumberAffixConfigurationClass = Class of TGamesNumberAffixConfiguration;
  152. { --------------------------------------------------------------------
  153. TGamesNumberFormatConfiguration
  154. --------------------------------------------------------------------}
  155. TGamesNumberFormatConfiguration = Class(TGoogleBaseObject)
  156. Private
  157. FcurrencyCode : String;
  158. FnumDecimalPlaces : integer;
  159. FnumberFormatType : String;
  160. Fsuffix : TGamesNumberAffixConfiguration;
  161. Protected
  162. //Property setters
  163. Procedure SetcurrencyCode(AIndex : Integer; const AValue : String); virtual;
  164. Procedure SetnumDecimalPlaces(AIndex : Integer; const AValue : integer); virtual;
  165. Procedure SetnumberFormatType(AIndex : Integer; const AValue : String); virtual;
  166. Procedure Setsuffix(AIndex : Integer; const AValue : TGamesNumberAffixConfiguration); virtual;
  167. Public
  168. Published
  169. Property currencyCode : String Index 0 Read FcurrencyCode Write SetcurrencyCode;
  170. Property numDecimalPlaces : integer Index 8 Read FnumDecimalPlaces Write SetnumDecimalPlaces;
  171. Property numberFormatType : String Index 16 Read FnumberFormatType Write SetnumberFormatType;
  172. Property suffix : TGamesNumberAffixConfiguration Index 24 Read Fsuffix Write Setsuffix;
  173. end;
  174. TGamesNumberFormatConfigurationClass = Class of TGamesNumberFormatConfiguration;
  175. { --------------------------------------------------------------------
  176. TImageConfiguration
  177. --------------------------------------------------------------------}
  178. TImageConfiguration = Class(TGoogleBaseObject)
  179. Private
  180. FimageType : String;
  181. Fkind : String;
  182. FresourceId : String;
  183. Furl : String;
  184. Protected
  185. //Property setters
  186. Procedure SetimageType(AIndex : Integer; const AValue : String); virtual;
  187. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  188. Procedure SetresourceId(AIndex : Integer; const AValue : String); virtual;
  189. Procedure Seturl(AIndex : Integer; const AValue : String); virtual;
  190. Public
  191. Published
  192. Property imageType : String Index 0 Read FimageType Write SetimageType;
  193. Property kind : String Index 8 Read Fkind Write Setkind;
  194. Property resourceId : String Index 16 Read FresourceId Write SetresourceId;
  195. Property url : String Index 24 Read Furl Write Seturl;
  196. end;
  197. TImageConfigurationClass = Class of TImageConfiguration;
  198. { --------------------------------------------------------------------
  199. TLeaderboardConfiguration
  200. --------------------------------------------------------------------}
  201. TLeaderboardConfiguration = Class(TGoogleBaseObject)
  202. Private
  203. Fdraft : TLeaderboardConfigurationDetail;
  204. Fid : String;
  205. Fkind : String;
  206. F_published : TLeaderboardConfigurationDetail;
  207. FscoreMax : String;
  208. FscoreMin : String;
  209. FscoreOrder : String;
  210. Ftoken : String;
  211. Protected
  212. Class Function ExportPropertyName(Const AName : String) : string; override;
  213. //Property setters
  214. Procedure Setdraft(AIndex : Integer; const AValue : TLeaderboardConfigurationDetail); virtual;
  215. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  216. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  217. Procedure Set_published(AIndex : Integer; const AValue : TLeaderboardConfigurationDetail); virtual;
  218. Procedure SetscoreMax(AIndex : Integer; const AValue : String); virtual;
  219. Procedure SetscoreMin(AIndex : Integer; const AValue : String); virtual;
  220. Procedure SetscoreOrder(AIndex : Integer; const AValue : String); virtual;
  221. Procedure Settoken(AIndex : Integer; const AValue : String); virtual;
  222. Public
  223. Published
  224. Property draft : TLeaderboardConfigurationDetail Index 0 Read Fdraft Write Setdraft;
  225. Property id : String Index 8 Read Fid Write Setid;
  226. Property kind : String Index 16 Read Fkind Write Setkind;
  227. Property _published : TLeaderboardConfigurationDetail Index 24 Read F_published Write Set_published;
  228. Property scoreMax : String Index 32 Read FscoreMax Write SetscoreMax;
  229. Property scoreMin : String Index 40 Read FscoreMin Write SetscoreMin;
  230. Property scoreOrder : String Index 48 Read FscoreOrder Write SetscoreOrder;
  231. Property token : String Index 56 Read Ftoken Write Settoken;
  232. end;
  233. TLeaderboardConfigurationClass = Class of TLeaderboardConfiguration;
  234. { --------------------------------------------------------------------
  235. TLeaderboardConfigurationDetail
  236. --------------------------------------------------------------------}
  237. TLeaderboardConfigurationDetail = Class(TGoogleBaseObject)
  238. Private
  239. FiconUrl : String;
  240. Fkind : String;
  241. Fname : TLocalizedStringBundle;
  242. FscoreFormat : TGamesNumberFormatConfiguration;
  243. FsortRank : integer;
  244. Protected
  245. //Property setters
  246. Procedure SeticonUrl(AIndex : Integer; const AValue : String); virtual;
  247. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  248. Procedure Setname(AIndex : Integer; const AValue : TLocalizedStringBundle); virtual;
  249. Procedure SetscoreFormat(AIndex : Integer; const AValue : TGamesNumberFormatConfiguration); virtual;
  250. Procedure SetsortRank(AIndex : Integer; const AValue : integer); virtual;
  251. Public
  252. Published
  253. Property iconUrl : String Index 0 Read FiconUrl Write SeticonUrl;
  254. Property kind : String Index 8 Read Fkind Write Setkind;
  255. Property name : TLocalizedStringBundle Index 16 Read Fname Write Setname;
  256. Property scoreFormat : TGamesNumberFormatConfiguration Index 24 Read FscoreFormat Write SetscoreFormat;
  257. Property sortRank : integer Index 32 Read FsortRank Write SetsortRank;
  258. end;
  259. TLeaderboardConfigurationDetailClass = Class of TLeaderboardConfigurationDetail;
  260. { --------------------------------------------------------------------
  261. TLeaderboardConfigurationListResponse
  262. --------------------------------------------------------------------}
  263. TLeaderboardConfigurationListResponse = Class(TGoogleBaseObject)
  264. Private
  265. Fitems : TLeaderboardConfigurationListResponseTypeitemsArray;
  266. Fkind : String;
  267. FnextPageToken : String;
  268. Protected
  269. //Property setters
  270. Procedure Setitems(AIndex : Integer; const AValue : TLeaderboardConfigurationListResponseTypeitemsArray); virtual;
  271. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  272. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  273. //2.6.4. bug workaround
  274. {$IFDEF VER2_6}
  275. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  276. {$ENDIF VER2_6}
  277. Public
  278. Published
  279. Property items : TLeaderboardConfigurationListResponseTypeitemsArray Index 0 Read Fitems Write Setitems;
  280. Property kind : String Index 8 Read Fkind Write Setkind;
  281. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  282. end;
  283. TLeaderboardConfigurationListResponseClass = Class of TLeaderboardConfigurationListResponse;
  284. { --------------------------------------------------------------------
  285. TLocalizedString
  286. --------------------------------------------------------------------}
  287. TLocalizedString = Class(TGoogleBaseObject)
  288. Private
  289. Fkind : String;
  290. Flocale : String;
  291. Fvalue : String;
  292. Protected
  293. //Property setters
  294. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  295. Procedure Setlocale(AIndex : Integer; const AValue : String); virtual;
  296. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  297. Public
  298. Published
  299. Property kind : String Index 0 Read Fkind Write Setkind;
  300. Property locale : String Index 8 Read Flocale Write Setlocale;
  301. Property value : String Index 16 Read Fvalue Write Setvalue;
  302. end;
  303. TLocalizedStringClass = Class of TLocalizedString;
  304. { --------------------------------------------------------------------
  305. TLocalizedStringBundle
  306. --------------------------------------------------------------------}
  307. TLocalizedStringBundle = Class(TGoogleBaseObject)
  308. Private
  309. Fkind : String;
  310. Ftranslations : TLocalizedStringBundleTypetranslationsArray;
  311. Protected
  312. //Property setters
  313. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  314. Procedure Settranslations(AIndex : Integer; const AValue : TLocalizedStringBundleTypetranslationsArray); virtual;
  315. //2.6.4. bug workaround
  316. {$IFDEF VER2_6}
  317. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  318. {$ENDIF VER2_6}
  319. Public
  320. Published
  321. Property kind : String Index 0 Read Fkind Write Setkind;
  322. Property translations : TLocalizedStringBundleTypetranslationsArray Index 8 Read Ftranslations Write Settranslations;
  323. end;
  324. TLocalizedStringBundleClass = Class of TLocalizedStringBundle;
  325. { --------------------------------------------------------------------
  326. TAchievementConfigurationsResource
  327. --------------------------------------------------------------------}
  328. //Optional query Options for TAchievementConfigurationsResource, method List
  329. TAchievementConfigurationsListOptions = Record
  330. maxResults : integer;
  331. pageToken : String;
  332. end;
  333. TAchievementConfigurationsResource = Class(TGoogleResource)
  334. Public
  335. Class Function ResourceName : String; override;
  336. Class Function DefaultAPI : TGoogleAPIClass; override;
  337. Procedure Delete(achievementId: string);
  338. Function Get(achievementId: string) : TAchievementConfiguration;
  339. Function Insert(applicationId: string; aAchievementConfiguration : TAchievementConfiguration) : TAchievementConfiguration;
  340. Function List(applicationId: string; AQuery : string = '') : TAchievementConfigurationListResponse;
  341. Function List(applicationId: string; AQuery : TAchievementConfigurationslistOptions) : TAchievementConfigurationListResponse;
  342. Function Patch(achievementId: string; aAchievementConfiguration : TAchievementConfiguration) : TAchievementConfiguration;
  343. Function Update(achievementId: string; aAchievementConfiguration : TAchievementConfiguration) : TAchievementConfiguration;
  344. end;
  345. { --------------------------------------------------------------------
  346. TImageConfigurationsResource
  347. --------------------------------------------------------------------}
  348. TImageConfigurationsResource = Class(TGoogleResource)
  349. Public
  350. Class Function ResourceName : String; override;
  351. Class Function DefaultAPI : TGoogleAPIClass; override;
  352. Function Upload(imageType: string; resourceId: string) : TImageConfiguration;
  353. end;
  354. { --------------------------------------------------------------------
  355. TLeaderboardConfigurationsResource
  356. --------------------------------------------------------------------}
  357. //Optional query Options for TLeaderboardConfigurationsResource, method List
  358. TLeaderboardConfigurationsListOptions = Record
  359. maxResults : integer;
  360. pageToken : String;
  361. end;
  362. TLeaderboardConfigurationsResource = Class(TGoogleResource)
  363. Public
  364. Class Function ResourceName : String; override;
  365. Class Function DefaultAPI : TGoogleAPIClass; override;
  366. Procedure Delete(leaderboardId: string);
  367. Function Get(leaderboardId: string) : TLeaderboardConfiguration;
  368. Function Insert(applicationId: string; aLeaderboardConfiguration : TLeaderboardConfiguration) : TLeaderboardConfiguration;
  369. Function List(applicationId: string; AQuery : string = '') : TLeaderboardConfigurationListResponse;
  370. Function List(applicationId: string; AQuery : TLeaderboardConfigurationslistOptions) : TLeaderboardConfigurationListResponse;
  371. Function Patch(leaderboardId: string; aLeaderboardConfiguration : TLeaderboardConfiguration) : TLeaderboardConfiguration;
  372. Function Update(leaderboardId: string; aLeaderboardConfiguration : TLeaderboardConfiguration) : TLeaderboardConfiguration;
  373. end;
  374. { --------------------------------------------------------------------
  375. TGamesConfigurationAPI
  376. --------------------------------------------------------------------}
  377. TGamesConfigurationAPI = Class(TGoogleAPI)
  378. Private
  379. FAchievementConfigurationsInstance : TAchievementConfigurationsResource;
  380. FImageConfigurationsInstance : TImageConfigurationsResource;
  381. FLeaderboardConfigurationsInstance : TLeaderboardConfigurationsResource;
  382. Function GetAchievementConfigurationsInstance : TAchievementConfigurationsResource;virtual;
  383. Function GetImageConfigurationsInstance : TImageConfigurationsResource;virtual;
  384. Function GetLeaderboardConfigurationsInstance : TLeaderboardConfigurationsResource;virtual;
  385. Public
  386. //Override class functions with API info
  387. Class Function APIName : String; override;
  388. Class Function APIVersion : String; override;
  389. Class Function APIRevision : String; override;
  390. Class Function APIID : String; override;
  391. Class Function APITitle : String; override;
  392. Class Function APIDescription : String; override;
  393. Class Function APIOwnerDomain : String; override;
  394. Class Function APIOwnerName : String; override;
  395. Class Function APIIcon16 : String; override;
  396. Class Function APIIcon32 : String; override;
  397. Class Function APIdocumentationLink : String; override;
  398. Class Function APIrootUrl : string; override;
  399. Class Function APIbasePath : string;override;
  400. Class Function APIbaseURL : String;override;
  401. Class Function APIProtocol : string;override;
  402. Class Function APIservicePath : string;override;
  403. Class Function APIbatchPath : String;override;
  404. Class Function APIAuthScopes : TScopeInfoArray;override;
  405. Class Function APINeedsAuth : Boolean;override;
  406. Class Procedure RegisterAPIResources; override;
  407. //Add create function for resources
  408. Function CreateAchievementConfigurationsResource(AOwner : TComponent) : TAchievementConfigurationsResource;virtual;overload;
  409. Function CreateAchievementConfigurationsResource : TAchievementConfigurationsResource;virtual;overload;
  410. Function CreateImageConfigurationsResource(AOwner : TComponent) : TImageConfigurationsResource;virtual;overload;
  411. Function CreateImageConfigurationsResource : TImageConfigurationsResource;virtual;overload;
  412. Function CreateLeaderboardConfigurationsResource(AOwner : TComponent) : TLeaderboardConfigurationsResource;virtual;overload;
  413. Function CreateLeaderboardConfigurationsResource : TLeaderboardConfigurationsResource;virtual;overload;
  414. //Add default on-demand instances for resources
  415. Property AchievementConfigurationsResource : TAchievementConfigurationsResource Read GetAchievementConfigurationsInstance;
  416. Property ImageConfigurationsResource : TImageConfigurationsResource Read GetImageConfigurationsInstance;
  417. Property LeaderboardConfigurationsResource : TLeaderboardConfigurationsResource Read GetLeaderboardConfigurationsInstance;
  418. end;
  419. implementation
  420. { --------------------------------------------------------------------
  421. TAchievementConfiguration
  422. --------------------------------------------------------------------}
  423. Procedure TAchievementConfiguration.SetachievementType(AIndex : Integer; const AValue : String);
  424. begin
  425. If (FachievementType=AValue) then exit;
  426. FachievementType:=AValue;
  427. MarkPropertyChanged(AIndex);
  428. end;
  429. Procedure TAchievementConfiguration.Setdraft(AIndex : Integer; const AValue : TAchievementConfigurationDetail);
  430. begin
  431. If (Fdraft=AValue) then exit;
  432. Fdraft:=AValue;
  433. MarkPropertyChanged(AIndex);
  434. end;
  435. Procedure TAchievementConfiguration.Setid(AIndex : Integer; const AValue : String);
  436. begin
  437. If (Fid=AValue) then exit;
  438. Fid:=AValue;
  439. MarkPropertyChanged(AIndex);
  440. end;
  441. Procedure TAchievementConfiguration.SetinitialState(AIndex : Integer; const AValue : String);
  442. begin
  443. If (FinitialState=AValue) then exit;
  444. FinitialState:=AValue;
  445. MarkPropertyChanged(AIndex);
  446. end;
  447. Procedure TAchievementConfiguration.Setkind(AIndex : Integer; const AValue : String);
  448. begin
  449. If (Fkind=AValue) then exit;
  450. Fkind:=AValue;
  451. MarkPropertyChanged(AIndex);
  452. end;
  453. Procedure TAchievementConfiguration.Set_published(AIndex : Integer; const AValue : TAchievementConfigurationDetail);
  454. begin
  455. If (F_published=AValue) then exit;
  456. F_published:=AValue;
  457. MarkPropertyChanged(AIndex);
  458. end;
  459. Procedure TAchievementConfiguration.SetstepsToUnlock(AIndex : Integer; const AValue : integer);
  460. begin
  461. If (FstepsToUnlock=AValue) then exit;
  462. FstepsToUnlock:=AValue;
  463. MarkPropertyChanged(AIndex);
  464. end;
  465. Procedure TAchievementConfiguration.Settoken(AIndex : Integer; const AValue : String);
  466. begin
  467. If (Ftoken=AValue) then exit;
  468. Ftoken:=AValue;
  469. MarkPropertyChanged(AIndex);
  470. end;
  471. Class Function TAchievementConfiguration.ExportPropertyName(Const AName : String) :String;
  472. begin
  473. Case AName of
  474. '_published' : Result:='published';
  475. else
  476. Result:=Inherited ExportPropertyName(AName);
  477. end;
  478. end;
  479. { --------------------------------------------------------------------
  480. TAchievementConfigurationDetail
  481. --------------------------------------------------------------------}
  482. Procedure TAchievementConfigurationDetail.Setdescription(AIndex : Integer; const AValue : TLocalizedStringBundle);
  483. begin
  484. If (Fdescription=AValue) then exit;
  485. Fdescription:=AValue;
  486. MarkPropertyChanged(AIndex);
  487. end;
  488. Procedure TAchievementConfigurationDetail.SeticonUrl(AIndex : Integer; const AValue : String);
  489. begin
  490. If (FiconUrl=AValue) then exit;
  491. FiconUrl:=AValue;
  492. MarkPropertyChanged(AIndex);
  493. end;
  494. Procedure TAchievementConfigurationDetail.Setkind(AIndex : Integer; const AValue : String);
  495. begin
  496. If (Fkind=AValue) then exit;
  497. Fkind:=AValue;
  498. MarkPropertyChanged(AIndex);
  499. end;
  500. Procedure TAchievementConfigurationDetail.Setname(AIndex : Integer; const AValue : TLocalizedStringBundle);
  501. begin
  502. If (Fname=AValue) then exit;
  503. Fname:=AValue;
  504. MarkPropertyChanged(AIndex);
  505. end;
  506. Procedure TAchievementConfigurationDetail.SetpointValue(AIndex : Integer; const AValue : integer);
  507. begin
  508. If (FpointValue=AValue) then exit;
  509. FpointValue:=AValue;
  510. MarkPropertyChanged(AIndex);
  511. end;
  512. Procedure TAchievementConfigurationDetail.SetsortRank(AIndex : Integer; const AValue : integer);
  513. begin
  514. If (FsortRank=AValue) then exit;
  515. FsortRank:=AValue;
  516. MarkPropertyChanged(AIndex);
  517. end;
  518. { --------------------------------------------------------------------
  519. TAchievementConfigurationListResponse
  520. --------------------------------------------------------------------}
  521. Procedure TAchievementConfigurationListResponse.Setitems(AIndex : Integer; const AValue : TAchievementConfigurationListResponseTypeitemsArray);
  522. begin
  523. If (Fitems=AValue) then exit;
  524. Fitems:=AValue;
  525. MarkPropertyChanged(AIndex);
  526. end;
  527. Procedure TAchievementConfigurationListResponse.Setkind(AIndex : Integer; const AValue : String);
  528. begin
  529. If (Fkind=AValue) then exit;
  530. Fkind:=AValue;
  531. MarkPropertyChanged(AIndex);
  532. end;
  533. Procedure TAchievementConfigurationListResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  534. begin
  535. If (FnextPageToken=AValue) then exit;
  536. FnextPageToken:=AValue;
  537. MarkPropertyChanged(AIndex);
  538. end;
  539. //2.6.4. bug workaround
  540. {$IFDEF VER2_6}
  541. Procedure TAchievementConfigurationListResponse.SetArrayLength(Const AName : String; ALength : Longint);
  542. begin
  543. Case AName of
  544. 'items' : SetLength(Fitems,ALength);
  545. else
  546. Inherited SetArrayLength(AName,ALength);
  547. end;
  548. end;
  549. {$ENDIF VER2_6}
  550. { --------------------------------------------------------------------
  551. TGamesNumberAffixConfiguration
  552. --------------------------------------------------------------------}
  553. Procedure TGamesNumberAffixConfiguration.Setfew(AIndex : Integer; const AValue : TLocalizedStringBundle);
  554. begin
  555. If (Ffew=AValue) then exit;
  556. Ffew:=AValue;
  557. MarkPropertyChanged(AIndex);
  558. end;
  559. Procedure TGamesNumberAffixConfiguration.Setmany(AIndex : Integer; const AValue : TLocalizedStringBundle);
  560. begin
  561. If (Fmany=AValue) then exit;
  562. Fmany:=AValue;
  563. MarkPropertyChanged(AIndex);
  564. end;
  565. Procedure TGamesNumberAffixConfiguration.Setone(AIndex : Integer; const AValue : TLocalizedStringBundle);
  566. begin
  567. If (Fone=AValue) then exit;
  568. Fone:=AValue;
  569. MarkPropertyChanged(AIndex);
  570. end;
  571. Procedure TGamesNumberAffixConfiguration.Setother(AIndex : Integer; const AValue : TLocalizedStringBundle);
  572. begin
  573. If (Fother=AValue) then exit;
  574. Fother:=AValue;
  575. MarkPropertyChanged(AIndex);
  576. end;
  577. Procedure TGamesNumberAffixConfiguration.Settwo(AIndex : Integer; const AValue : TLocalizedStringBundle);
  578. begin
  579. If (Ftwo=AValue) then exit;
  580. Ftwo:=AValue;
  581. MarkPropertyChanged(AIndex);
  582. end;
  583. Procedure TGamesNumberAffixConfiguration.Setzero(AIndex : Integer; const AValue : TLocalizedStringBundle);
  584. begin
  585. If (Fzero=AValue) then exit;
  586. Fzero:=AValue;
  587. MarkPropertyChanged(AIndex);
  588. end;
  589. { --------------------------------------------------------------------
  590. TGamesNumberFormatConfiguration
  591. --------------------------------------------------------------------}
  592. Procedure TGamesNumberFormatConfiguration.SetcurrencyCode(AIndex : Integer; const AValue : String);
  593. begin
  594. If (FcurrencyCode=AValue) then exit;
  595. FcurrencyCode:=AValue;
  596. MarkPropertyChanged(AIndex);
  597. end;
  598. Procedure TGamesNumberFormatConfiguration.SetnumDecimalPlaces(AIndex : Integer; const AValue : integer);
  599. begin
  600. If (FnumDecimalPlaces=AValue) then exit;
  601. FnumDecimalPlaces:=AValue;
  602. MarkPropertyChanged(AIndex);
  603. end;
  604. Procedure TGamesNumberFormatConfiguration.SetnumberFormatType(AIndex : Integer; const AValue : String);
  605. begin
  606. If (FnumberFormatType=AValue) then exit;
  607. FnumberFormatType:=AValue;
  608. MarkPropertyChanged(AIndex);
  609. end;
  610. Procedure TGamesNumberFormatConfiguration.Setsuffix(AIndex : Integer; const AValue : TGamesNumberAffixConfiguration);
  611. begin
  612. If (Fsuffix=AValue) then exit;
  613. Fsuffix:=AValue;
  614. MarkPropertyChanged(AIndex);
  615. end;
  616. { --------------------------------------------------------------------
  617. TImageConfiguration
  618. --------------------------------------------------------------------}
  619. Procedure TImageConfiguration.SetimageType(AIndex : Integer; const AValue : String);
  620. begin
  621. If (FimageType=AValue) then exit;
  622. FimageType:=AValue;
  623. MarkPropertyChanged(AIndex);
  624. end;
  625. Procedure TImageConfiguration.Setkind(AIndex : Integer; const AValue : String);
  626. begin
  627. If (Fkind=AValue) then exit;
  628. Fkind:=AValue;
  629. MarkPropertyChanged(AIndex);
  630. end;
  631. Procedure TImageConfiguration.SetresourceId(AIndex : Integer; const AValue : String);
  632. begin
  633. If (FresourceId=AValue) then exit;
  634. FresourceId:=AValue;
  635. MarkPropertyChanged(AIndex);
  636. end;
  637. Procedure TImageConfiguration.Seturl(AIndex : Integer; const AValue : String);
  638. begin
  639. If (Furl=AValue) then exit;
  640. Furl:=AValue;
  641. MarkPropertyChanged(AIndex);
  642. end;
  643. { --------------------------------------------------------------------
  644. TLeaderboardConfiguration
  645. --------------------------------------------------------------------}
  646. Procedure TLeaderboardConfiguration.Setdraft(AIndex : Integer; const AValue : TLeaderboardConfigurationDetail);
  647. begin
  648. If (Fdraft=AValue) then exit;
  649. Fdraft:=AValue;
  650. MarkPropertyChanged(AIndex);
  651. end;
  652. Procedure TLeaderboardConfiguration.Setid(AIndex : Integer; const AValue : String);
  653. begin
  654. If (Fid=AValue) then exit;
  655. Fid:=AValue;
  656. MarkPropertyChanged(AIndex);
  657. end;
  658. Procedure TLeaderboardConfiguration.Setkind(AIndex : Integer; const AValue : String);
  659. begin
  660. If (Fkind=AValue) then exit;
  661. Fkind:=AValue;
  662. MarkPropertyChanged(AIndex);
  663. end;
  664. Procedure TLeaderboardConfiguration.Set_published(AIndex : Integer; const AValue : TLeaderboardConfigurationDetail);
  665. begin
  666. If (F_published=AValue) then exit;
  667. F_published:=AValue;
  668. MarkPropertyChanged(AIndex);
  669. end;
  670. Procedure TLeaderboardConfiguration.SetscoreMax(AIndex : Integer; const AValue : String);
  671. begin
  672. If (FscoreMax=AValue) then exit;
  673. FscoreMax:=AValue;
  674. MarkPropertyChanged(AIndex);
  675. end;
  676. Procedure TLeaderboardConfiguration.SetscoreMin(AIndex : Integer; const AValue : String);
  677. begin
  678. If (FscoreMin=AValue) then exit;
  679. FscoreMin:=AValue;
  680. MarkPropertyChanged(AIndex);
  681. end;
  682. Procedure TLeaderboardConfiguration.SetscoreOrder(AIndex : Integer; const AValue : String);
  683. begin
  684. If (FscoreOrder=AValue) then exit;
  685. FscoreOrder:=AValue;
  686. MarkPropertyChanged(AIndex);
  687. end;
  688. Procedure TLeaderboardConfiguration.Settoken(AIndex : Integer; const AValue : String);
  689. begin
  690. If (Ftoken=AValue) then exit;
  691. Ftoken:=AValue;
  692. MarkPropertyChanged(AIndex);
  693. end;
  694. Class Function TLeaderboardConfiguration.ExportPropertyName(Const AName : String) :String;
  695. begin
  696. Case AName of
  697. '_published' : Result:='published';
  698. else
  699. Result:=Inherited ExportPropertyName(AName);
  700. end;
  701. end;
  702. { --------------------------------------------------------------------
  703. TLeaderboardConfigurationDetail
  704. --------------------------------------------------------------------}
  705. Procedure TLeaderboardConfigurationDetail.SeticonUrl(AIndex : Integer; const AValue : String);
  706. begin
  707. If (FiconUrl=AValue) then exit;
  708. FiconUrl:=AValue;
  709. MarkPropertyChanged(AIndex);
  710. end;
  711. Procedure TLeaderboardConfigurationDetail.Setkind(AIndex : Integer; const AValue : String);
  712. begin
  713. If (Fkind=AValue) then exit;
  714. Fkind:=AValue;
  715. MarkPropertyChanged(AIndex);
  716. end;
  717. Procedure TLeaderboardConfigurationDetail.Setname(AIndex : Integer; const AValue : TLocalizedStringBundle);
  718. begin
  719. If (Fname=AValue) then exit;
  720. Fname:=AValue;
  721. MarkPropertyChanged(AIndex);
  722. end;
  723. Procedure TLeaderboardConfigurationDetail.SetscoreFormat(AIndex : Integer; const AValue : TGamesNumberFormatConfiguration);
  724. begin
  725. If (FscoreFormat=AValue) then exit;
  726. FscoreFormat:=AValue;
  727. MarkPropertyChanged(AIndex);
  728. end;
  729. Procedure TLeaderboardConfigurationDetail.SetsortRank(AIndex : Integer; const AValue : integer);
  730. begin
  731. If (FsortRank=AValue) then exit;
  732. FsortRank:=AValue;
  733. MarkPropertyChanged(AIndex);
  734. end;
  735. { --------------------------------------------------------------------
  736. TLeaderboardConfigurationListResponse
  737. --------------------------------------------------------------------}
  738. Procedure TLeaderboardConfigurationListResponse.Setitems(AIndex : Integer; const AValue : TLeaderboardConfigurationListResponseTypeitemsArray);
  739. begin
  740. If (Fitems=AValue) then exit;
  741. Fitems:=AValue;
  742. MarkPropertyChanged(AIndex);
  743. end;
  744. Procedure TLeaderboardConfigurationListResponse.Setkind(AIndex : Integer; const AValue : String);
  745. begin
  746. If (Fkind=AValue) then exit;
  747. Fkind:=AValue;
  748. MarkPropertyChanged(AIndex);
  749. end;
  750. Procedure TLeaderboardConfigurationListResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  751. begin
  752. If (FnextPageToken=AValue) then exit;
  753. FnextPageToken:=AValue;
  754. MarkPropertyChanged(AIndex);
  755. end;
  756. //2.6.4. bug workaround
  757. {$IFDEF VER2_6}
  758. Procedure TLeaderboardConfigurationListResponse.SetArrayLength(Const AName : String; ALength : Longint);
  759. begin
  760. Case AName of
  761. 'items' : SetLength(Fitems,ALength);
  762. else
  763. Inherited SetArrayLength(AName,ALength);
  764. end;
  765. end;
  766. {$ENDIF VER2_6}
  767. { --------------------------------------------------------------------
  768. TLocalizedString
  769. --------------------------------------------------------------------}
  770. Procedure TLocalizedString.Setkind(AIndex : Integer; const AValue : String);
  771. begin
  772. If (Fkind=AValue) then exit;
  773. Fkind:=AValue;
  774. MarkPropertyChanged(AIndex);
  775. end;
  776. Procedure TLocalizedString.Setlocale(AIndex : Integer; const AValue : String);
  777. begin
  778. If (Flocale=AValue) then exit;
  779. Flocale:=AValue;
  780. MarkPropertyChanged(AIndex);
  781. end;
  782. Procedure TLocalizedString.Setvalue(AIndex : Integer; const AValue : String);
  783. begin
  784. If (Fvalue=AValue) then exit;
  785. Fvalue:=AValue;
  786. MarkPropertyChanged(AIndex);
  787. end;
  788. { --------------------------------------------------------------------
  789. TLocalizedStringBundle
  790. --------------------------------------------------------------------}
  791. Procedure TLocalizedStringBundle.Setkind(AIndex : Integer; const AValue : String);
  792. begin
  793. If (Fkind=AValue) then exit;
  794. Fkind:=AValue;
  795. MarkPropertyChanged(AIndex);
  796. end;
  797. Procedure TLocalizedStringBundle.Settranslations(AIndex : Integer; const AValue : TLocalizedStringBundleTypetranslationsArray);
  798. begin
  799. If (Ftranslations=AValue) then exit;
  800. Ftranslations:=AValue;
  801. MarkPropertyChanged(AIndex);
  802. end;
  803. //2.6.4. bug workaround
  804. {$IFDEF VER2_6}
  805. Procedure TLocalizedStringBundle.SetArrayLength(Const AName : String; ALength : Longint);
  806. begin
  807. Case AName of
  808. 'translations' : SetLength(Ftranslations,ALength);
  809. else
  810. Inherited SetArrayLength(AName,ALength);
  811. end;
  812. end;
  813. {$ENDIF VER2_6}
  814. { --------------------------------------------------------------------
  815. TAchievementConfigurationsResource
  816. --------------------------------------------------------------------}
  817. Class Function TAchievementConfigurationsResource.ResourceName : String;
  818. begin
  819. Result:='achievementConfigurations';
  820. end;
  821. Class Function TAchievementConfigurationsResource.DefaultAPI : TGoogleAPIClass;
  822. begin
  823. Result:=TgamesConfigurationAPI;
  824. end;
  825. Procedure TAchievementConfigurationsResource.Delete(achievementId: string);
  826. Const
  827. _HTTPMethod = 'DELETE';
  828. _Path = 'achievements/{achievementId}';
  829. _Methodid = 'gamesConfiguration.achievementConfigurations.delete';
  830. Var
  831. _P : String;
  832. begin
  833. _P:=SubstitutePath(_Path,['achievementId',achievementId]);
  834. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  835. end;
  836. Function TAchievementConfigurationsResource.Get(achievementId: string) : TAchievementConfiguration;
  837. Const
  838. _HTTPMethod = 'GET';
  839. _Path = 'achievements/{achievementId}';
  840. _Methodid = 'gamesConfiguration.achievementConfigurations.get';
  841. Var
  842. _P : String;
  843. begin
  844. _P:=SubstitutePath(_Path,['achievementId',achievementId]);
  845. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TAchievementConfiguration) as TAchievementConfiguration;
  846. end;
  847. Function TAchievementConfigurationsResource.Insert(applicationId: string; aAchievementConfiguration : TAchievementConfiguration) : TAchievementConfiguration;
  848. Const
  849. _HTTPMethod = 'POST';
  850. _Path = 'applications/{applicationId}/achievements';
  851. _Methodid = 'gamesConfiguration.achievementConfigurations.insert';
  852. Var
  853. _P : String;
  854. begin
  855. _P:=SubstitutePath(_Path,['applicationId',applicationId]);
  856. Result:=ServiceCall(_HTTPMethod,_P,'',aAchievementConfiguration,TAchievementConfiguration) as TAchievementConfiguration;
  857. end;
  858. Function TAchievementConfigurationsResource.List(applicationId: string; AQuery : string = '') : TAchievementConfigurationListResponse;
  859. Const
  860. _HTTPMethod = 'GET';
  861. _Path = 'applications/{applicationId}/achievements';
  862. _Methodid = 'gamesConfiguration.achievementConfigurations.list';
  863. Var
  864. _P : String;
  865. begin
  866. _P:=SubstitutePath(_Path,['applicationId',applicationId]);
  867. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TAchievementConfigurationListResponse) as TAchievementConfigurationListResponse;
  868. end;
  869. Function TAchievementConfigurationsResource.List(applicationId: string; AQuery : TAchievementConfigurationslistOptions) : TAchievementConfigurationListResponse;
  870. Var
  871. _Q : String;
  872. begin
  873. _Q:='';
  874. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  875. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  876. Result:=List(applicationId,_Q);
  877. end;
  878. Function TAchievementConfigurationsResource.Patch(achievementId: string; aAchievementConfiguration : TAchievementConfiguration) : TAchievementConfiguration;
  879. Const
  880. _HTTPMethod = 'PATCH';
  881. _Path = 'achievements/{achievementId}';
  882. _Methodid = 'gamesConfiguration.achievementConfigurations.patch';
  883. Var
  884. _P : String;
  885. begin
  886. _P:=SubstitutePath(_Path,['achievementId',achievementId]);
  887. Result:=ServiceCall(_HTTPMethod,_P,'',aAchievementConfiguration,TAchievementConfiguration) as TAchievementConfiguration;
  888. end;
  889. Function TAchievementConfigurationsResource.Update(achievementId: string; aAchievementConfiguration : TAchievementConfiguration) : TAchievementConfiguration;
  890. Const
  891. _HTTPMethod = 'PUT';
  892. _Path = 'achievements/{achievementId}';
  893. _Methodid = 'gamesConfiguration.achievementConfigurations.update';
  894. Var
  895. _P : String;
  896. begin
  897. _P:=SubstitutePath(_Path,['achievementId',achievementId]);
  898. Result:=ServiceCall(_HTTPMethod,_P,'',aAchievementConfiguration,TAchievementConfiguration) as TAchievementConfiguration;
  899. end;
  900. { --------------------------------------------------------------------
  901. TImageConfigurationsResource
  902. --------------------------------------------------------------------}
  903. Class Function TImageConfigurationsResource.ResourceName : String;
  904. begin
  905. Result:='imageConfigurations';
  906. end;
  907. Class Function TImageConfigurationsResource.DefaultAPI : TGoogleAPIClass;
  908. begin
  909. Result:=TgamesConfigurationAPI;
  910. end;
  911. Function TImageConfigurationsResource.Upload(imageType: string; resourceId: string) : TImageConfiguration;
  912. Const
  913. _HTTPMethod = 'POST';
  914. _Path = 'images/{resourceId}/imageType/{imageType}';
  915. _Methodid = 'gamesConfiguration.imageConfigurations.upload';
  916. Var
  917. _P : String;
  918. begin
  919. _P:=SubstitutePath(_Path,['imageType',imageType,'resourceId',resourceId]);
  920. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TImageConfiguration) as TImageConfiguration;
  921. end;
  922. { --------------------------------------------------------------------
  923. TLeaderboardConfigurationsResource
  924. --------------------------------------------------------------------}
  925. Class Function TLeaderboardConfigurationsResource.ResourceName : String;
  926. begin
  927. Result:='leaderboardConfigurations';
  928. end;
  929. Class Function TLeaderboardConfigurationsResource.DefaultAPI : TGoogleAPIClass;
  930. begin
  931. Result:=TgamesConfigurationAPI;
  932. end;
  933. Procedure TLeaderboardConfigurationsResource.Delete(leaderboardId: string);
  934. Const
  935. _HTTPMethod = 'DELETE';
  936. _Path = 'leaderboards/{leaderboardId}';
  937. _Methodid = 'gamesConfiguration.leaderboardConfigurations.delete';
  938. Var
  939. _P : String;
  940. begin
  941. _P:=SubstitutePath(_Path,['leaderboardId',leaderboardId]);
  942. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  943. end;
  944. Function TLeaderboardConfigurationsResource.Get(leaderboardId: string) : TLeaderboardConfiguration;
  945. Const
  946. _HTTPMethod = 'GET';
  947. _Path = 'leaderboards/{leaderboardId}';
  948. _Methodid = 'gamesConfiguration.leaderboardConfigurations.get';
  949. Var
  950. _P : String;
  951. begin
  952. _P:=SubstitutePath(_Path,['leaderboardId',leaderboardId]);
  953. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TLeaderboardConfiguration) as TLeaderboardConfiguration;
  954. end;
  955. Function TLeaderboardConfigurationsResource.Insert(applicationId: string; aLeaderboardConfiguration : TLeaderboardConfiguration) : TLeaderboardConfiguration;
  956. Const
  957. _HTTPMethod = 'POST';
  958. _Path = 'applications/{applicationId}/leaderboards';
  959. _Methodid = 'gamesConfiguration.leaderboardConfigurations.insert';
  960. Var
  961. _P : String;
  962. begin
  963. _P:=SubstitutePath(_Path,['applicationId',applicationId]);
  964. Result:=ServiceCall(_HTTPMethod,_P,'',aLeaderboardConfiguration,TLeaderboardConfiguration) as TLeaderboardConfiguration;
  965. end;
  966. Function TLeaderboardConfigurationsResource.List(applicationId: string; AQuery : string = '') : TLeaderboardConfigurationListResponse;
  967. Const
  968. _HTTPMethod = 'GET';
  969. _Path = 'applications/{applicationId}/leaderboards';
  970. _Methodid = 'gamesConfiguration.leaderboardConfigurations.list';
  971. Var
  972. _P : String;
  973. begin
  974. _P:=SubstitutePath(_Path,['applicationId',applicationId]);
  975. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TLeaderboardConfigurationListResponse) as TLeaderboardConfigurationListResponse;
  976. end;
  977. Function TLeaderboardConfigurationsResource.List(applicationId: string; AQuery : TLeaderboardConfigurationslistOptions) : TLeaderboardConfigurationListResponse;
  978. Var
  979. _Q : String;
  980. begin
  981. _Q:='';
  982. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  983. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  984. Result:=List(applicationId,_Q);
  985. end;
  986. Function TLeaderboardConfigurationsResource.Patch(leaderboardId: string; aLeaderboardConfiguration : TLeaderboardConfiguration) : TLeaderboardConfiguration;
  987. Const
  988. _HTTPMethod = 'PATCH';
  989. _Path = 'leaderboards/{leaderboardId}';
  990. _Methodid = 'gamesConfiguration.leaderboardConfigurations.patch';
  991. Var
  992. _P : String;
  993. begin
  994. _P:=SubstitutePath(_Path,['leaderboardId',leaderboardId]);
  995. Result:=ServiceCall(_HTTPMethod,_P,'',aLeaderboardConfiguration,TLeaderboardConfiguration) as TLeaderboardConfiguration;
  996. end;
  997. Function TLeaderboardConfigurationsResource.Update(leaderboardId: string; aLeaderboardConfiguration : TLeaderboardConfiguration) : TLeaderboardConfiguration;
  998. Const
  999. _HTTPMethod = 'PUT';
  1000. _Path = 'leaderboards/{leaderboardId}';
  1001. _Methodid = 'gamesConfiguration.leaderboardConfigurations.update';
  1002. Var
  1003. _P : String;
  1004. begin
  1005. _P:=SubstitutePath(_Path,['leaderboardId',leaderboardId]);
  1006. Result:=ServiceCall(_HTTPMethod,_P,'',aLeaderboardConfiguration,TLeaderboardConfiguration) as TLeaderboardConfiguration;
  1007. end;
  1008. { --------------------------------------------------------------------
  1009. TGamesConfigurationAPI
  1010. --------------------------------------------------------------------}
  1011. Class Function TGamesConfigurationAPI.APIName : String;
  1012. begin
  1013. Result:='gamesConfiguration';
  1014. end;
  1015. Class Function TGamesConfigurationAPI.APIVersion : String;
  1016. begin
  1017. Result:='v1configuration';
  1018. end;
  1019. Class Function TGamesConfigurationAPI.APIRevision : String;
  1020. begin
  1021. Result:='20160519';
  1022. end;
  1023. Class Function TGamesConfigurationAPI.APIID : String;
  1024. begin
  1025. Result:='gamesConfiguration:v1configuration';
  1026. end;
  1027. Class Function TGamesConfigurationAPI.APITitle : String;
  1028. begin
  1029. Result:='Google Play Game Services Publishing API';
  1030. end;
  1031. Class Function TGamesConfigurationAPI.APIDescription : String;
  1032. begin
  1033. Result:='The Publishing API for Google Play Game Services.';
  1034. end;
  1035. Class Function TGamesConfigurationAPI.APIOwnerDomain : String;
  1036. begin
  1037. Result:='google.com';
  1038. end;
  1039. Class Function TGamesConfigurationAPI.APIOwnerName : String;
  1040. begin
  1041. Result:='Google';
  1042. end;
  1043. Class Function TGamesConfigurationAPI.APIIcon16 : String;
  1044. begin
  1045. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1046. end;
  1047. Class Function TGamesConfigurationAPI.APIIcon32 : String;
  1048. begin
  1049. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1050. end;
  1051. Class Function TGamesConfigurationAPI.APIdocumentationLink : String;
  1052. begin
  1053. Result:='https://developers.google.com/games/services';
  1054. end;
  1055. Class Function TGamesConfigurationAPI.APIrootUrl : string;
  1056. begin
  1057. Result:='https://www.googleapis.com/';
  1058. end;
  1059. Class Function TGamesConfigurationAPI.APIbasePath : string;
  1060. begin
  1061. Result:='/games/v1configuration/';
  1062. end;
  1063. Class Function TGamesConfigurationAPI.APIbaseURL : String;
  1064. begin
  1065. Result:='https://www.googleapis.com/games/v1configuration/';
  1066. end;
  1067. Class Function TGamesConfigurationAPI.APIProtocol : string;
  1068. begin
  1069. Result:='rest';
  1070. end;
  1071. Class Function TGamesConfigurationAPI.APIservicePath : string;
  1072. begin
  1073. Result:='games/v1configuration/';
  1074. end;
  1075. Class Function TGamesConfigurationAPI.APIbatchPath : String;
  1076. begin
  1077. Result:='batch';
  1078. end;
  1079. Class Function TGamesConfigurationAPI.APIAuthScopes : TScopeInfoArray;
  1080. begin
  1081. SetLength(Result,1);
  1082. Result[0].Name:='https://www.googleapis.com/auth/androidpublisher';
  1083. Result[0].Description:='View and manage your Google Play Developer account';
  1084. end;
  1085. Class Function TGamesConfigurationAPI.APINeedsAuth : Boolean;
  1086. begin
  1087. Result:=True;
  1088. end;
  1089. Class Procedure TGamesConfigurationAPI.RegisterAPIResources;
  1090. begin
  1091. TAchievementConfiguration.RegisterObject;
  1092. TAchievementConfigurationDetail.RegisterObject;
  1093. TAchievementConfigurationListResponse.RegisterObject;
  1094. TGamesNumberAffixConfiguration.RegisterObject;
  1095. TGamesNumberFormatConfiguration.RegisterObject;
  1096. TImageConfiguration.RegisterObject;
  1097. TLeaderboardConfiguration.RegisterObject;
  1098. TLeaderboardConfigurationDetail.RegisterObject;
  1099. TLeaderboardConfigurationListResponse.RegisterObject;
  1100. TLocalizedString.RegisterObject;
  1101. TLocalizedStringBundle.RegisterObject;
  1102. end;
  1103. Function TGamesConfigurationAPI.GetAchievementConfigurationsInstance : TAchievementConfigurationsResource;
  1104. begin
  1105. if (FAchievementConfigurationsInstance=Nil) then
  1106. FAchievementConfigurationsInstance:=CreateAchievementConfigurationsResource;
  1107. Result:=FAchievementConfigurationsInstance;
  1108. end;
  1109. Function TGamesConfigurationAPI.CreateAchievementConfigurationsResource : TAchievementConfigurationsResource;
  1110. begin
  1111. Result:=CreateAchievementConfigurationsResource(Self);
  1112. end;
  1113. Function TGamesConfigurationAPI.CreateAchievementConfigurationsResource(AOwner : TComponent) : TAchievementConfigurationsResource;
  1114. begin
  1115. Result:=TAchievementConfigurationsResource.Create(AOwner);
  1116. Result.API:=Self.API;
  1117. end;
  1118. Function TGamesConfigurationAPI.GetImageConfigurationsInstance : TImageConfigurationsResource;
  1119. begin
  1120. if (FImageConfigurationsInstance=Nil) then
  1121. FImageConfigurationsInstance:=CreateImageConfigurationsResource;
  1122. Result:=FImageConfigurationsInstance;
  1123. end;
  1124. Function TGamesConfigurationAPI.CreateImageConfigurationsResource : TImageConfigurationsResource;
  1125. begin
  1126. Result:=CreateImageConfigurationsResource(Self);
  1127. end;
  1128. Function TGamesConfigurationAPI.CreateImageConfigurationsResource(AOwner : TComponent) : TImageConfigurationsResource;
  1129. begin
  1130. Result:=TImageConfigurationsResource.Create(AOwner);
  1131. Result.API:=Self.API;
  1132. end;
  1133. Function TGamesConfigurationAPI.GetLeaderboardConfigurationsInstance : TLeaderboardConfigurationsResource;
  1134. begin
  1135. if (FLeaderboardConfigurationsInstance=Nil) then
  1136. FLeaderboardConfigurationsInstance:=CreateLeaderboardConfigurationsResource;
  1137. Result:=FLeaderboardConfigurationsInstance;
  1138. end;
  1139. Function TGamesConfigurationAPI.CreateLeaderboardConfigurationsResource : TLeaderboardConfigurationsResource;
  1140. begin
  1141. Result:=CreateLeaderboardConfigurationsResource(Self);
  1142. end;
  1143. Function TGamesConfigurationAPI.CreateLeaderboardConfigurationsResource(AOwner : TComponent) : TLeaderboardConfigurationsResource;
  1144. begin
  1145. Result:=TLeaderboardConfigurationsResource.Create(AOwner);
  1146. Result.API:=Self.API;
  1147. end;
  1148. initialization
  1149. TGamesConfigurationAPI.RegisterAPI;
  1150. end.