googleproximitybeacon.pp 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506
  1. unit googleproximitybeacon;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TBeacon = Class;
  9. TAdvertisedId = Class;
  10. TLatLng = Class;
  11. TIndoorLevel = Class;
  12. TEphemeralIdRegistration = Class;
  13. TEmpty = Class;
  14. TListBeaconsResponse = Class;
  15. TBeaconAttachment = Class;
  16. TListBeaconAttachmentsResponse = Class;
  17. TDeleteAttachmentsResponse = Class;
  18. TListNamespacesResponse = Class;
  19. TNamespace = Class;
  20. TEphemeralIdRegistrationParams = Class;
  21. TListDiagnosticsResponse = Class;
  22. TDiagnostics = Class;
  23. TDate = Class;
  24. TGetInfoForObservedBeaconsRequest = Class;
  25. TObservation = Class;
  26. TGetInfoForObservedBeaconsResponse = Class;
  27. TBeaconInfo = Class;
  28. TAttachmentInfo = Class;
  29. TBeaconArray = Array of TBeacon;
  30. TAdvertisedIdArray = Array of TAdvertisedId;
  31. TLatLngArray = Array of TLatLng;
  32. TIndoorLevelArray = Array of TIndoorLevel;
  33. TEphemeralIdRegistrationArray = Array of TEphemeralIdRegistration;
  34. TEmptyArray = Array of TEmpty;
  35. TListBeaconsResponseArray = Array of TListBeaconsResponse;
  36. TBeaconAttachmentArray = Array of TBeaconAttachment;
  37. TListBeaconAttachmentsResponseArray = Array of TListBeaconAttachmentsResponse;
  38. TDeleteAttachmentsResponseArray = Array of TDeleteAttachmentsResponse;
  39. TListNamespacesResponseArray = Array of TListNamespacesResponse;
  40. TNamespaceArray = Array of TNamespace;
  41. TEphemeralIdRegistrationParamsArray = Array of TEphemeralIdRegistrationParams;
  42. TListDiagnosticsResponseArray = Array of TListDiagnosticsResponse;
  43. TDiagnosticsArray = Array of TDiagnostics;
  44. TDateArray = Array of TDate;
  45. TGetInfoForObservedBeaconsRequestArray = Array of TGetInfoForObservedBeaconsRequest;
  46. TObservationArray = Array of TObservation;
  47. TGetInfoForObservedBeaconsResponseArray = Array of TGetInfoForObservedBeaconsResponse;
  48. TBeaconInfoArray = Array of TBeaconInfo;
  49. TAttachmentInfoArray = Array of TAttachmentInfo;
  50. //Anonymous types, using auto-generated names
  51. TBeaconTypeproperties = Class;
  52. TListBeaconsResponseTypebeaconsArray = Array of TBeacon;
  53. TListBeaconAttachmentsResponseTypeattachmentsArray = Array of TBeaconAttachment;
  54. TListNamespacesResponseTypenamespacesArray = Array of TNamespace;
  55. TListDiagnosticsResponseTypediagnosticsArray = Array of TDiagnostics;
  56. TGetInfoForObservedBeaconsRequestTypeobservationsArray = Array of TObservation;
  57. TGetInfoForObservedBeaconsResponseTypebeaconsArray = Array of TBeaconInfo;
  58. TBeaconInfoTypeattachmentsArray = Array of TAttachmentInfo;
  59. { --------------------------------------------------------------------
  60. TBeaconTypeproperties
  61. --------------------------------------------------------------------}
  62. TBeaconTypeproperties = Class(TGoogleBaseObject)
  63. Private
  64. Protected
  65. //Property setters
  66. Public
  67. Class Function AllowAdditionalProperties : Boolean; override;
  68. Published
  69. end;
  70. TBeaconTypepropertiesClass = Class of TBeaconTypeproperties;
  71. { --------------------------------------------------------------------
  72. TBeacon
  73. --------------------------------------------------------------------}
  74. TBeacon = Class(TGoogleBaseObject)
  75. Private
  76. FbeaconName : String;
  77. FadvertisedId : TAdvertisedId;
  78. Fstatus : String;
  79. FplaceId : String;
  80. FlatLng : TLatLng;
  81. FindoorLevel : TIndoorLevel;
  82. FexpectedStability : String;
  83. Fdescription : String;
  84. Fproperties : TBeaconTypeproperties;
  85. FephemeralIdRegistration : TEphemeralIdRegistration;
  86. FprovisioningKey : String;
  87. Protected
  88. //Property setters
  89. Procedure SetbeaconName(AIndex : Integer; const AValue : String); virtual;
  90. Procedure SetadvertisedId(AIndex : Integer; const AValue : TAdvertisedId); virtual;
  91. Procedure Setstatus(AIndex : Integer; const AValue : String); virtual;
  92. Procedure SetplaceId(AIndex : Integer; const AValue : String); virtual;
  93. Procedure SetlatLng(AIndex : Integer; const AValue : TLatLng); virtual;
  94. Procedure SetindoorLevel(AIndex : Integer; const AValue : TIndoorLevel); virtual;
  95. Procedure SetexpectedStability(AIndex : Integer; const AValue : String); virtual;
  96. Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
  97. Procedure Setproperties(AIndex : Integer; const AValue : TBeaconTypeproperties); virtual;
  98. Procedure SetephemeralIdRegistration(AIndex : Integer; const AValue : TEphemeralIdRegistration); virtual;
  99. Procedure SetprovisioningKey(AIndex : Integer; const AValue : String); virtual;
  100. Public
  101. Published
  102. Property beaconName : String Index 0 Read FbeaconName Write SetbeaconName;
  103. Property advertisedId : TAdvertisedId Index 8 Read FadvertisedId Write SetadvertisedId;
  104. Property status : String Index 16 Read Fstatus Write Setstatus;
  105. Property placeId : String Index 24 Read FplaceId Write SetplaceId;
  106. Property latLng : TLatLng Index 32 Read FlatLng Write SetlatLng;
  107. Property indoorLevel : TIndoorLevel Index 40 Read FindoorLevel Write SetindoorLevel;
  108. Property expectedStability : String Index 48 Read FexpectedStability Write SetexpectedStability;
  109. Property description : String Index 56 Read Fdescription Write Setdescription;
  110. Property properties : TBeaconTypeproperties Index 64 Read Fproperties Write Setproperties;
  111. Property ephemeralIdRegistration : TEphemeralIdRegistration Index 72 Read FephemeralIdRegistration Write SetephemeralIdRegistration;
  112. Property provisioningKey : String Index 80 Read FprovisioningKey Write SetprovisioningKey;
  113. end;
  114. TBeaconClass = Class of TBeacon;
  115. { --------------------------------------------------------------------
  116. TAdvertisedId
  117. --------------------------------------------------------------------}
  118. TAdvertisedId = Class(TGoogleBaseObject)
  119. Private
  120. F_type : String;
  121. Fid : String;
  122. Protected
  123. Class Function ExportPropertyName(Const AName : String) : string; override;
  124. //Property setters
  125. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  126. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  127. Public
  128. Published
  129. Property _type : String Index 0 Read F_type Write Set_type;
  130. Property id : String Index 8 Read Fid Write Setid;
  131. end;
  132. TAdvertisedIdClass = Class of TAdvertisedId;
  133. { --------------------------------------------------------------------
  134. TLatLng
  135. --------------------------------------------------------------------}
  136. TLatLng = Class(TGoogleBaseObject)
  137. Private
  138. Flatitude : double;
  139. Flongitude : double;
  140. Protected
  141. //Property setters
  142. Procedure Setlatitude(AIndex : Integer; const AValue : double); virtual;
  143. Procedure Setlongitude(AIndex : Integer; const AValue : double); virtual;
  144. Public
  145. Published
  146. Property latitude : double Index 0 Read Flatitude Write Setlatitude;
  147. Property longitude : double Index 8 Read Flongitude Write Setlongitude;
  148. end;
  149. TLatLngClass = Class of TLatLng;
  150. { --------------------------------------------------------------------
  151. TIndoorLevel
  152. --------------------------------------------------------------------}
  153. TIndoorLevel = Class(TGoogleBaseObject)
  154. Private
  155. Fname : String;
  156. Protected
  157. //Property setters
  158. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  159. Public
  160. Published
  161. Property name : String Index 0 Read Fname Write Setname;
  162. end;
  163. TIndoorLevelClass = Class of TIndoorLevel;
  164. { --------------------------------------------------------------------
  165. TEphemeralIdRegistration
  166. --------------------------------------------------------------------}
  167. TEphemeralIdRegistration = Class(TGoogleBaseObject)
  168. Private
  169. FbeaconEcdhPublicKey : String;
  170. FserviceEcdhPublicKey : String;
  171. FbeaconIdentityKey : String;
  172. FrotationPeriodExponent : integer;
  173. FinitialClockValue : String;
  174. FinitialEid : String;
  175. Protected
  176. //Property setters
  177. Procedure SetbeaconEcdhPublicKey(AIndex : Integer; const AValue : String); virtual;
  178. Procedure SetserviceEcdhPublicKey(AIndex : Integer; const AValue : String); virtual;
  179. Procedure SetbeaconIdentityKey(AIndex : Integer; const AValue : String); virtual;
  180. Procedure SetrotationPeriodExponent(AIndex : Integer; const AValue : integer); virtual;
  181. Procedure SetinitialClockValue(AIndex : Integer; const AValue : String); virtual;
  182. Procedure SetinitialEid(AIndex : Integer; const AValue : String); virtual;
  183. Public
  184. Published
  185. Property beaconEcdhPublicKey : String Index 0 Read FbeaconEcdhPublicKey Write SetbeaconEcdhPublicKey;
  186. Property serviceEcdhPublicKey : String Index 8 Read FserviceEcdhPublicKey Write SetserviceEcdhPublicKey;
  187. Property beaconIdentityKey : String Index 16 Read FbeaconIdentityKey Write SetbeaconIdentityKey;
  188. Property rotationPeriodExponent : integer Index 24 Read FrotationPeriodExponent Write SetrotationPeriodExponent;
  189. Property initialClockValue : String Index 32 Read FinitialClockValue Write SetinitialClockValue;
  190. Property initialEid : String Index 40 Read FinitialEid Write SetinitialEid;
  191. end;
  192. TEphemeralIdRegistrationClass = Class of TEphemeralIdRegistration;
  193. { --------------------------------------------------------------------
  194. TEmpty
  195. --------------------------------------------------------------------}
  196. TEmpty = Class(TGoogleBaseObject)
  197. Private
  198. Protected
  199. //Property setters
  200. Public
  201. Published
  202. end;
  203. TEmptyClass = Class of TEmpty;
  204. { --------------------------------------------------------------------
  205. TListBeaconsResponse
  206. --------------------------------------------------------------------}
  207. TListBeaconsResponse = Class(TGoogleBaseObject)
  208. Private
  209. Fbeacons : TListBeaconsResponseTypebeaconsArray;
  210. FnextPageToken : String;
  211. FtotalCount : String;
  212. Protected
  213. //Property setters
  214. Procedure Setbeacons(AIndex : Integer; const AValue : TListBeaconsResponseTypebeaconsArray); virtual;
  215. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  216. Procedure SettotalCount(AIndex : Integer; const AValue : String); virtual;
  217. //2.6.4. bug workaround
  218. {$IFDEF VER2_6}
  219. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  220. {$ENDIF VER2_6}
  221. Public
  222. Published
  223. Property beacons : TListBeaconsResponseTypebeaconsArray Index 0 Read Fbeacons Write Setbeacons;
  224. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  225. Property totalCount : String Index 16 Read FtotalCount Write SettotalCount;
  226. end;
  227. TListBeaconsResponseClass = Class of TListBeaconsResponse;
  228. { --------------------------------------------------------------------
  229. TBeaconAttachment
  230. --------------------------------------------------------------------}
  231. TBeaconAttachment = Class(TGoogleBaseObject)
  232. Private
  233. FattachmentName : String;
  234. FnamespacedType : String;
  235. Fdata : String;
  236. Protected
  237. //Property setters
  238. Procedure SetattachmentName(AIndex : Integer; const AValue : String); virtual;
  239. Procedure SetnamespacedType(AIndex : Integer; const AValue : String); virtual;
  240. Procedure Setdata(AIndex : Integer; const AValue : String); virtual;
  241. Public
  242. Published
  243. Property attachmentName : String Index 0 Read FattachmentName Write SetattachmentName;
  244. Property namespacedType : String Index 8 Read FnamespacedType Write SetnamespacedType;
  245. Property data : String Index 16 Read Fdata Write Setdata;
  246. end;
  247. TBeaconAttachmentClass = Class of TBeaconAttachment;
  248. { --------------------------------------------------------------------
  249. TListBeaconAttachmentsResponse
  250. --------------------------------------------------------------------}
  251. TListBeaconAttachmentsResponse = Class(TGoogleBaseObject)
  252. Private
  253. Fattachments : TListBeaconAttachmentsResponseTypeattachmentsArray;
  254. Protected
  255. //Property setters
  256. Procedure Setattachments(AIndex : Integer; const AValue : TListBeaconAttachmentsResponseTypeattachmentsArray); virtual;
  257. //2.6.4. bug workaround
  258. {$IFDEF VER2_6}
  259. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  260. {$ENDIF VER2_6}
  261. Public
  262. Published
  263. Property attachments : TListBeaconAttachmentsResponseTypeattachmentsArray Index 0 Read Fattachments Write Setattachments;
  264. end;
  265. TListBeaconAttachmentsResponseClass = Class of TListBeaconAttachmentsResponse;
  266. { --------------------------------------------------------------------
  267. TDeleteAttachmentsResponse
  268. --------------------------------------------------------------------}
  269. TDeleteAttachmentsResponse = Class(TGoogleBaseObject)
  270. Private
  271. FnumDeleted : integer;
  272. Protected
  273. //Property setters
  274. Procedure SetnumDeleted(AIndex : Integer; const AValue : integer); virtual;
  275. Public
  276. Published
  277. Property numDeleted : integer Index 0 Read FnumDeleted Write SetnumDeleted;
  278. end;
  279. TDeleteAttachmentsResponseClass = Class of TDeleteAttachmentsResponse;
  280. { --------------------------------------------------------------------
  281. TListNamespacesResponse
  282. --------------------------------------------------------------------}
  283. TListNamespacesResponse = Class(TGoogleBaseObject)
  284. Private
  285. Fnamespaces : TListNamespacesResponseTypenamespacesArray;
  286. Protected
  287. //Property setters
  288. Procedure Setnamespaces(AIndex : Integer; const AValue : TListNamespacesResponseTypenamespacesArray); virtual;
  289. //2.6.4. bug workaround
  290. {$IFDEF VER2_6}
  291. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  292. {$ENDIF VER2_6}
  293. Public
  294. Published
  295. Property namespaces : TListNamespacesResponseTypenamespacesArray Index 0 Read Fnamespaces Write Setnamespaces;
  296. end;
  297. TListNamespacesResponseClass = Class of TListNamespacesResponse;
  298. { --------------------------------------------------------------------
  299. TNamespace
  300. --------------------------------------------------------------------}
  301. TNamespace = Class(TGoogleBaseObject)
  302. Private
  303. FnamespaceName : String;
  304. FservingVisibility : String;
  305. Protected
  306. //Property setters
  307. Procedure SetnamespaceName(AIndex : Integer; const AValue : String); virtual;
  308. Procedure SetservingVisibility(AIndex : Integer; const AValue : String); virtual;
  309. Public
  310. Published
  311. Property namespaceName : String Index 0 Read FnamespaceName Write SetnamespaceName;
  312. Property servingVisibility : String Index 8 Read FservingVisibility Write SetservingVisibility;
  313. end;
  314. TNamespaceClass = Class of TNamespace;
  315. { --------------------------------------------------------------------
  316. TEphemeralIdRegistrationParams
  317. --------------------------------------------------------------------}
  318. TEphemeralIdRegistrationParams = Class(TGoogleBaseObject)
  319. Private
  320. FserviceEcdhPublicKey : String;
  321. FminRotationPeriodExponent : integer;
  322. FmaxRotationPeriodExponent : integer;
  323. Protected
  324. //Property setters
  325. Procedure SetserviceEcdhPublicKey(AIndex : Integer; const AValue : String); virtual;
  326. Procedure SetminRotationPeriodExponent(AIndex : Integer; const AValue : integer); virtual;
  327. Procedure SetmaxRotationPeriodExponent(AIndex : Integer; const AValue : integer); virtual;
  328. Public
  329. Published
  330. Property serviceEcdhPublicKey : String Index 0 Read FserviceEcdhPublicKey Write SetserviceEcdhPublicKey;
  331. Property minRotationPeriodExponent : integer Index 8 Read FminRotationPeriodExponent Write SetminRotationPeriodExponent;
  332. Property maxRotationPeriodExponent : integer Index 16 Read FmaxRotationPeriodExponent Write SetmaxRotationPeriodExponent;
  333. end;
  334. TEphemeralIdRegistrationParamsClass = Class of TEphemeralIdRegistrationParams;
  335. { --------------------------------------------------------------------
  336. TListDiagnosticsResponse
  337. --------------------------------------------------------------------}
  338. TListDiagnosticsResponse = Class(TGoogleBaseObject)
  339. Private
  340. Fdiagnostics : TListDiagnosticsResponseTypediagnosticsArray;
  341. FnextPageToken : String;
  342. Protected
  343. //Property setters
  344. Procedure Setdiagnostics(AIndex : Integer; const AValue : TListDiagnosticsResponseTypediagnosticsArray); virtual;
  345. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  346. //2.6.4. bug workaround
  347. {$IFDEF VER2_6}
  348. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  349. {$ENDIF VER2_6}
  350. Public
  351. Published
  352. Property diagnostics : TListDiagnosticsResponseTypediagnosticsArray Index 0 Read Fdiagnostics Write Setdiagnostics;
  353. Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
  354. end;
  355. TListDiagnosticsResponseClass = Class of TListDiagnosticsResponse;
  356. { --------------------------------------------------------------------
  357. TDiagnostics
  358. --------------------------------------------------------------------}
  359. TDiagnostics = Class(TGoogleBaseObject)
  360. Private
  361. FbeaconName : String;
  362. FestimatedLowBatteryDate : TDate;
  363. Falerts : TStringArray;
  364. Protected
  365. //Property setters
  366. Procedure SetbeaconName(AIndex : Integer; const AValue : String); virtual;
  367. Procedure SetestimatedLowBatteryDate(AIndex : Integer; const AValue : TDate); virtual;
  368. Procedure Setalerts(AIndex : Integer; const AValue : TStringArray); virtual;
  369. //2.6.4. bug workaround
  370. {$IFDEF VER2_6}
  371. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  372. {$ENDIF VER2_6}
  373. Public
  374. Published
  375. Property beaconName : String Index 0 Read FbeaconName Write SetbeaconName;
  376. Property estimatedLowBatteryDate : TDate Index 8 Read FestimatedLowBatteryDate Write SetestimatedLowBatteryDate;
  377. Property alerts : TStringArray Index 16 Read Falerts Write Setalerts;
  378. end;
  379. TDiagnosticsClass = Class of TDiagnostics;
  380. { --------------------------------------------------------------------
  381. TDate
  382. --------------------------------------------------------------------}
  383. TDate = Class(TGoogleBaseObject)
  384. Private
  385. Fyear : integer;
  386. Fmonth : integer;
  387. Fday : integer;
  388. Protected
  389. //Property setters
  390. Procedure Setyear(AIndex : Integer; const AValue : integer); virtual;
  391. Procedure Setmonth(AIndex : Integer; const AValue : integer); virtual;
  392. Procedure Setday(AIndex : Integer; const AValue : integer); virtual;
  393. Public
  394. Published
  395. Property year : integer Index 0 Read Fyear Write Setyear;
  396. Property month : integer Index 8 Read Fmonth Write Setmonth;
  397. Property day : integer Index 16 Read Fday Write Setday;
  398. end;
  399. TDateClass = Class of TDate;
  400. { --------------------------------------------------------------------
  401. TGetInfoForObservedBeaconsRequest
  402. --------------------------------------------------------------------}
  403. TGetInfoForObservedBeaconsRequest = Class(TGoogleBaseObject)
  404. Private
  405. Fobservations : TGetInfoForObservedBeaconsRequestTypeobservationsArray;
  406. FnamespacedTypes : TStringArray;
  407. Protected
  408. //Property setters
  409. Procedure Setobservations(AIndex : Integer; const AValue : TGetInfoForObservedBeaconsRequestTypeobservationsArray); virtual;
  410. Procedure SetnamespacedTypes(AIndex : Integer; const AValue : TStringArray); virtual;
  411. //2.6.4. bug workaround
  412. {$IFDEF VER2_6}
  413. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  414. {$ENDIF VER2_6}
  415. Public
  416. Published
  417. Property observations : TGetInfoForObservedBeaconsRequestTypeobservationsArray Index 0 Read Fobservations Write Setobservations;
  418. Property namespacedTypes : TStringArray Index 8 Read FnamespacedTypes Write SetnamespacedTypes;
  419. end;
  420. TGetInfoForObservedBeaconsRequestClass = Class of TGetInfoForObservedBeaconsRequest;
  421. { --------------------------------------------------------------------
  422. TObservation
  423. --------------------------------------------------------------------}
  424. TObservation = Class(TGoogleBaseObject)
  425. Private
  426. FadvertisedId : TAdvertisedId;
  427. Ftelemetry : String;
  428. FtimestampMs : String;
  429. Protected
  430. //Property setters
  431. Procedure SetadvertisedId(AIndex : Integer; const AValue : TAdvertisedId); virtual;
  432. Procedure Settelemetry(AIndex : Integer; const AValue : String); virtual;
  433. Procedure SettimestampMs(AIndex : Integer; const AValue : String); virtual;
  434. Public
  435. Published
  436. Property advertisedId : TAdvertisedId Index 0 Read FadvertisedId Write SetadvertisedId;
  437. Property telemetry : String Index 8 Read Ftelemetry Write Settelemetry;
  438. Property timestampMs : String Index 16 Read FtimestampMs Write SettimestampMs;
  439. end;
  440. TObservationClass = Class of TObservation;
  441. { --------------------------------------------------------------------
  442. TGetInfoForObservedBeaconsResponse
  443. --------------------------------------------------------------------}
  444. TGetInfoForObservedBeaconsResponse = Class(TGoogleBaseObject)
  445. Private
  446. Fbeacons : TGetInfoForObservedBeaconsResponseTypebeaconsArray;
  447. Protected
  448. //Property setters
  449. Procedure Setbeacons(AIndex : Integer; const AValue : TGetInfoForObservedBeaconsResponseTypebeaconsArray); virtual;
  450. //2.6.4. bug workaround
  451. {$IFDEF VER2_6}
  452. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  453. {$ENDIF VER2_6}
  454. Public
  455. Published
  456. Property beacons : TGetInfoForObservedBeaconsResponseTypebeaconsArray Index 0 Read Fbeacons Write Setbeacons;
  457. end;
  458. TGetInfoForObservedBeaconsResponseClass = Class of TGetInfoForObservedBeaconsResponse;
  459. { --------------------------------------------------------------------
  460. TBeaconInfo
  461. --------------------------------------------------------------------}
  462. TBeaconInfo = Class(TGoogleBaseObject)
  463. Private
  464. FadvertisedId : TAdvertisedId;
  465. FbeaconName : String;
  466. Fattachments : TBeaconInfoTypeattachmentsArray;
  467. Protected
  468. //Property setters
  469. Procedure SetadvertisedId(AIndex : Integer; const AValue : TAdvertisedId); virtual;
  470. Procedure SetbeaconName(AIndex : Integer; const AValue : String); virtual;
  471. Procedure Setattachments(AIndex : Integer; const AValue : TBeaconInfoTypeattachmentsArray); virtual;
  472. //2.6.4. bug workaround
  473. {$IFDEF VER2_6}
  474. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  475. {$ENDIF VER2_6}
  476. Public
  477. Published
  478. Property advertisedId : TAdvertisedId Index 0 Read FadvertisedId Write SetadvertisedId;
  479. Property beaconName : String Index 8 Read FbeaconName Write SetbeaconName;
  480. Property attachments : TBeaconInfoTypeattachmentsArray Index 16 Read Fattachments Write Setattachments;
  481. end;
  482. TBeaconInfoClass = Class of TBeaconInfo;
  483. { --------------------------------------------------------------------
  484. TAttachmentInfo
  485. --------------------------------------------------------------------}
  486. TAttachmentInfo = Class(TGoogleBaseObject)
  487. Private
  488. FnamespacedType : String;
  489. Fdata : String;
  490. Protected
  491. //Property setters
  492. Procedure SetnamespacedType(AIndex : Integer; const AValue : String); virtual;
  493. Procedure Setdata(AIndex : Integer; const AValue : String); virtual;
  494. Public
  495. Published
  496. Property namespacedType : String Index 0 Read FnamespacedType Write SetnamespacedType;
  497. Property data : String Index 8 Read Fdata Write Setdata;
  498. end;
  499. TAttachmentInfoClass = Class of TAttachmentInfo;
  500. { --------------------------------------------------------------------
  501. TBeaconsAttachmentsResource
  502. --------------------------------------------------------------------}
  503. //Optional query Options for TBeaconsAttachmentsResource, method Create
  504. TBeaconsAttachmentsCreateOptions = Record
  505. projectId : String;
  506. end;
  507. //Optional query Options for TBeaconsAttachmentsResource, method List
  508. TBeaconsAttachmentsListOptions = Record
  509. namespacedType : String;
  510. projectId : String;
  511. end;
  512. //Optional query Options for TBeaconsAttachmentsResource, method Delete
  513. TBeaconsAttachmentsDeleteOptions = Record
  514. projectId : String;
  515. end;
  516. //Optional query Options for TBeaconsAttachmentsResource, method BatchDelete
  517. TBeaconsAttachmentsBatchDeleteOptions = Record
  518. namespacedType : String;
  519. projectId : String;
  520. end;
  521. TBeaconsAttachmentsResource = Class(TGoogleResource)
  522. Public
  523. Class Function ResourceName : String; override;
  524. Class Function DefaultAPI : TGoogleAPIClass; override;
  525. Function Create(beaconName: string; aBeaconAttachment : TBeaconAttachment; AQuery : string = '') : TBeaconAttachment;overload;
  526. Function Create(beaconName: string; aBeaconAttachment : TBeaconAttachment; AQuery : TBeaconsAttachmentscreateOptions) : TBeaconAttachment;overload;
  527. Function List(beaconName: string; AQuery : string = '') : TListBeaconAttachmentsResponse;
  528. Function List(beaconName: string; AQuery : TBeaconsAttachmentslistOptions) : TListBeaconAttachmentsResponse;
  529. Function Delete(attachmentName: string; AQuery : string = '') : TEmpty;
  530. Function Delete(attachmentName: string; AQuery : TBeaconsAttachmentsdeleteOptions) : TEmpty;
  531. Function BatchDelete(beaconName: string; AQuery : string = '') : TDeleteAttachmentsResponse;
  532. Function BatchDelete(beaconName: string; AQuery : TBeaconsAttachmentsbatchDeleteOptions) : TDeleteAttachmentsResponse;
  533. end;
  534. { --------------------------------------------------------------------
  535. TBeaconsDiagnosticsResource
  536. --------------------------------------------------------------------}
  537. //Optional query Options for TBeaconsDiagnosticsResource, method List
  538. TBeaconsDiagnosticsListOptions = Record
  539. pageSize : integer;
  540. pageToken : String;
  541. alertFilter : String;
  542. projectId : String;
  543. end;
  544. TBeaconsDiagnosticsResource = Class(TGoogleResource)
  545. Public
  546. Class Function ResourceName : String; override;
  547. Class Function DefaultAPI : TGoogleAPIClass; override;
  548. Function List(beaconName: string; AQuery : string = '') : TListDiagnosticsResponse;
  549. Function List(beaconName: string; AQuery : TBeaconsDiagnosticslistOptions) : TListDiagnosticsResponse;
  550. end;
  551. { --------------------------------------------------------------------
  552. TBeaconsResource
  553. --------------------------------------------------------------------}
  554. //Optional query Options for TBeaconsResource, method Register
  555. TBeaconsRegisterOptions = Record
  556. projectId : String;
  557. end;
  558. //Optional query Options for TBeaconsResource, method Decommission
  559. TBeaconsDecommissionOptions = Record
  560. projectId : String;
  561. end;
  562. //Optional query Options for TBeaconsResource, method Get
  563. TBeaconsGetOptions = Record
  564. projectId : String;
  565. end;
  566. //Optional query Options for TBeaconsResource, method List
  567. TBeaconsListOptions = Record
  568. q : String;
  569. pageToken : String;
  570. pageSize : integer;
  571. projectId : String;
  572. end;
  573. //Optional query Options for TBeaconsResource, method Update
  574. TBeaconsUpdateOptions = Record
  575. projectId : String;
  576. end;
  577. //Optional query Options for TBeaconsResource, method Activate
  578. TBeaconsActivateOptions = Record
  579. projectId : String;
  580. end;
  581. //Optional query Options for TBeaconsResource, method Deactivate
  582. TBeaconsDeactivateOptions = Record
  583. projectId : String;
  584. end;
  585. TBeaconsResource = Class(TGoogleResource)
  586. Private
  587. FAttachmentsInstance : TBeaconsAttachmentsResource;
  588. FDiagnosticsInstance : TBeaconsDiagnosticsResource;
  589. Function GetAttachmentsInstance : TBeaconsAttachmentsResource;virtual;
  590. Function GetDiagnosticsInstance : TBeaconsDiagnosticsResource;virtual;
  591. Public
  592. Class Function ResourceName : String; override;
  593. Class Function DefaultAPI : TGoogleAPIClass; override;
  594. Function Register(aBeacon : TBeacon; AQuery : string = '') : TBeacon;
  595. Function Register(aBeacon : TBeacon; AQuery : TBeaconsregisterOptions) : TBeacon;
  596. Function Decommission(beaconName: string; AQuery : string = '') : TEmpty;
  597. Function Decommission(beaconName: string; AQuery : TBeaconsdecommissionOptions) : TEmpty;
  598. Function Get(beaconName: string; AQuery : string = '') : TBeacon;
  599. Function Get(beaconName: string; AQuery : TBeaconsgetOptions) : TBeacon;
  600. Function List(AQuery : string = '') : TListBeaconsResponse;
  601. Function List(AQuery : TBeaconslistOptions) : TListBeaconsResponse;
  602. Function Update(beaconName: string; aBeacon : TBeacon; AQuery : string = '') : TBeacon;
  603. Function Update(beaconName: string; aBeacon : TBeacon; AQuery : TBeaconsupdateOptions) : TBeacon;
  604. Function Activate(beaconName: string; AQuery : string = '') : TEmpty;
  605. Function Activate(beaconName: string; AQuery : TBeaconsactivateOptions) : TEmpty;
  606. Function Deactivate(beaconName: string; AQuery : string = '') : TEmpty;
  607. Function Deactivate(beaconName: string; AQuery : TBeaconsdeactivateOptions) : TEmpty;
  608. Function CreateAttachmentsResource(AOwner : TComponent) : TBeaconsAttachmentsResource;virtual;overload;
  609. Function CreateAttachmentsResource : TBeaconsAttachmentsResource;virtual;overload;
  610. Function CreateDiagnosticsResource(AOwner : TComponent) : TBeaconsDiagnosticsResource;virtual;overload;
  611. Function CreateDiagnosticsResource : TBeaconsDiagnosticsResource;virtual;overload;
  612. Property AttachmentsResource : TBeaconsAttachmentsResource Read GetAttachmentsInstance;
  613. Property DiagnosticsResource : TBeaconsDiagnosticsResource Read GetDiagnosticsInstance;
  614. end;
  615. { --------------------------------------------------------------------
  616. TNamespacesResource
  617. --------------------------------------------------------------------}
  618. //Optional query Options for TNamespacesResource, method List
  619. TNamespacesListOptions = Record
  620. projectId : String;
  621. end;
  622. //Optional query Options for TNamespacesResource, method Update
  623. TNamespacesUpdateOptions = Record
  624. projectId : String;
  625. end;
  626. TNamespacesResource = Class(TGoogleResource)
  627. Public
  628. Class Function ResourceName : String; override;
  629. Class Function DefaultAPI : TGoogleAPIClass; override;
  630. Function List(AQuery : string = '') : TListNamespacesResponse;
  631. Function List(AQuery : TNamespaceslistOptions) : TListNamespacesResponse;
  632. Function Update(namespaceName: string; aNamespace : TNamespace; AQuery : string = '') : TNamespace;
  633. Function Update(namespaceName: string; aNamespace : TNamespace; AQuery : TNamespacesupdateOptions) : TNamespace;
  634. end;
  635. { --------------------------------------------------------------------
  636. TV1beta1Resource
  637. --------------------------------------------------------------------}
  638. TV1beta1Resource = Class(TGoogleResource)
  639. Public
  640. Class Function ResourceName : String; override;
  641. Class Function DefaultAPI : TGoogleAPIClass; override;
  642. Function GetEidparams : TEphemeralIdRegistrationParams;
  643. end;
  644. { --------------------------------------------------------------------
  645. TBeaconinfoResource
  646. --------------------------------------------------------------------}
  647. TBeaconinfoResource = Class(TGoogleResource)
  648. Public
  649. Class Function ResourceName : String; override;
  650. Class Function DefaultAPI : TGoogleAPIClass; override;
  651. Function Getforobserved(aGetInfoForObservedBeaconsRequest : TGetInfoForObservedBeaconsRequest) : TGetInfoForObservedBeaconsResponse;
  652. end;
  653. { --------------------------------------------------------------------
  654. TProximitybeaconAPI
  655. --------------------------------------------------------------------}
  656. TProximitybeaconAPI = Class(TGoogleAPI)
  657. Private
  658. FBeaconsAttachmentsInstance : TBeaconsAttachmentsResource;
  659. FBeaconsDiagnosticsInstance : TBeaconsDiagnosticsResource;
  660. FBeaconsInstance : TBeaconsResource;
  661. FNamespacesInstance : TNamespacesResource;
  662. FV1beta1Instance : TV1beta1Resource;
  663. FBeaconinfoInstance : TBeaconinfoResource;
  664. Function GetBeaconsAttachmentsInstance : TBeaconsAttachmentsResource;virtual;
  665. Function GetBeaconsDiagnosticsInstance : TBeaconsDiagnosticsResource;virtual;
  666. Function GetBeaconsInstance : TBeaconsResource;virtual;
  667. Function GetNamespacesInstance : TNamespacesResource;virtual;
  668. Function GetV1beta1Instance : TV1beta1Resource;virtual;
  669. Function GetBeaconinfoInstance : TBeaconinfoResource;virtual;
  670. Public
  671. //Override class functions with API info
  672. Class Function APIName : String; override;
  673. Class Function APIVersion : String; override;
  674. Class Function APIRevision : String; override;
  675. Class Function APIID : String; override;
  676. Class Function APITitle : String; override;
  677. Class Function APIDescription : String; override;
  678. Class Function APIOwnerDomain : String; override;
  679. Class Function APIOwnerName : String; override;
  680. Class Function APIIcon16 : String; override;
  681. Class Function APIIcon32 : String; override;
  682. Class Function APIdocumentationLink : String; override;
  683. Class Function APIrootUrl : string; override;
  684. Class Function APIbasePath : string;override;
  685. Class Function APIbaseURL : String;override;
  686. Class Function APIProtocol : string;override;
  687. Class Function APIservicePath : string;override;
  688. Class Function APIbatchPath : String;override;
  689. Class Function APIAuthScopes : TScopeInfoArray;override;
  690. Class Function APINeedsAuth : Boolean;override;
  691. Class Procedure RegisterAPIResources; override;
  692. //Add create function for resources
  693. Function CreateBeaconsAttachmentsResource(AOwner : TComponent) : TBeaconsAttachmentsResource;virtual;overload;
  694. Function CreateBeaconsAttachmentsResource : TBeaconsAttachmentsResource;virtual;overload;
  695. Function CreateBeaconsDiagnosticsResource(AOwner : TComponent) : TBeaconsDiagnosticsResource;virtual;overload;
  696. Function CreateBeaconsDiagnosticsResource : TBeaconsDiagnosticsResource;virtual;overload;
  697. Function CreateBeaconsResource(AOwner : TComponent) : TBeaconsResource;virtual;overload;
  698. Function CreateBeaconsResource : TBeaconsResource;virtual;overload;
  699. Function CreateNamespacesResource(AOwner : TComponent) : TNamespacesResource;virtual;overload;
  700. Function CreateNamespacesResource : TNamespacesResource;virtual;overload;
  701. Function CreateV1beta1Resource(AOwner : TComponent) : TV1beta1Resource;virtual;overload;
  702. Function CreateV1beta1Resource : TV1beta1Resource;virtual;overload;
  703. Function CreateBeaconinfoResource(AOwner : TComponent) : TBeaconinfoResource;virtual;overload;
  704. Function CreateBeaconinfoResource : TBeaconinfoResource;virtual;overload;
  705. //Add default on-demand instances for resources
  706. Property BeaconsAttachmentsResource : TBeaconsAttachmentsResource Read GetBeaconsAttachmentsInstance;
  707. Property BeaconsDiagnosticsResource : TBeaconsDiagnosticsResource Read GetBeaconsDiagnosticsInstance;
  708. Property BeaconsResource : TBeaconsResource Read GetBeaconsInstance;
  709. Property NamespacesResource : TNamespacesResource Read GetNamespacesInstance;
  710. Property V1beta1Resource : TV1beta1Resource Read GetV1beta1Instance;
  711. Property BeaconinfoResource : TBeaconinfoResource Read GetBeaconinfoInstance;
  712. end;
  713. implementation
  714. { --------------------------------------------------------------------
  715. TBeaconTypeproperties
  716. --------------------------------------------------------------------}
  717. Class Function TBeaconTypeproperties.AllowAdditionalProperties : Boolean;
  718. begin
  719. Result:=True;
  720. end;
  721. { --------------------------------------------------------------------
  722. TBeacon
  723. --------------------------------------------------------------------}
  724. Procedure TBeacon.SetbeaconName(AIndex : Integer; const AValue : String);
  725. begin
  726. If (FbeaconName=AValue) then exit;
  727. FbeaconName:=AValue;
  728. MarkPropertyChanged(AIndex);
  729. end;
  730. Procedure TBeacon.SetadvertisedId(AIndex : Integer; const AValue : TAdvertisedId);
  731. begin
  732. If (FadvertisedId=AValue) then exit;
  733. FadvertisedId:=AValue;
  734. MarkPropertyChanged(AIndex);
  735. end;
  736. Procedure TBeacon.Setstatus(AIndex : Integer; const AValue : String);
  737. begin
  738. If (Fstatus=AValue) then exit;
  739. Fstatus:=AValue;
  740. MarkPropertyChanged(AIndex);
  741. end;
  742. Procedure TBeacon.SetplaceId(AIndex : Integer; const AValue : String);
  743. begin
  744. If (FplaceId=AValue) then exit;
  745. FplaceId:=AValue;
  746. MarkPropertyChanged(AIndex);
  747. end;
  748. Procedure TBeacon.SetlatLng(AIndex : Integer; const AValue : TLatLng);
  749. begin
  750. If (FlatLng=AValue) then exit;
  751. FlatLng:=AValue;
  752. MarkPropertyChanged(AIndex);
  753. end;
  754. Procedure TBeacon.SetindoorLevel(AIndex : Integer; const AValue : TIndoorLevel);
  755. begin
  756. If (FindoorLevel=AValue) then exit;
  757. FindoorLevel:=AValue;
  758. MarkPropertyChanged(AIndex);
  759. end;
  760. Procedure TBeacon.SetexpectedStability(AIndex : Integer; const AValue : String);
  761. begin
  762. If (FexpectedStability=AValue) then exit;
  763. FexpectedStability:=AValue;
  764. MarkPropertyChanged(AIndex);
  765. end;
  766. Procedure TBeacon.Setdescription(AIndex : Integer; const AValue : String);
  767. begin
  768. If (Fdescription=AValue) then exit;
  769. Fdescription:=AValue;
  770. MarkPropertyChanged(AIndex);
  771. end;
  772. Procedure TBeacon.Setproperties(AIndex : Integer; const AValue : TBeaconTypeproperties);
  773. begin
  774. If (Fproperties=AValue) then exit;
  775. Fproperties:=AValue;
  776. MarkPropertyChanged(AIndex);
  777. end;
  778. Procedure TBeacon.SetephemeralIdRegistration(AIndex : Integer; const AValue : TEphemeralIdRegistration);
  779. begin
  780. If (FephemeralIdRegistration=AValue) then exit;
  781. FephemeralIdRegistration:=AValue;
  782. MarkPropertyChanged(AIndex);
  783. end;
  784. Procedure TBeacon.SetprovisioningKey(AIndex : Integer; const AValue : String);
  785. begin
  786. If (FprovisioningKey=AValue) then exit;
  787. FprovisioningKey:=AValue;
  788. MarkPropertyChanged(AIndex);
  789. end;
  790. { --------------------------------------------------------------------
  791. TAdvertisedId
  792. --------------------------------------------------------------------}
  793. Procedure TAdvertisedId.Set_type(AIndex : Integer; const AValue : String);
  794. begin
  795. If (F_type=AValue) then exit;
  796. F_type:=AValue;
  797. MarkPropertyChanged(AIndex);
  798. end;
  799. Procedure TAdvertisedId.Setid(AIndex : Integer; const AValue : String);
  800. begin
  801. If (Fid=AValue) then exit;
  802. Fid:=AValue;
  803. MarkPropertyChanged(AIndex);
  804. end;
  805. Class Function TAdvertisedId.ExportPropertyName(Const AName : String) :String;
  806. begin
  807. Case AName of
  808. '_type' : Result:='type';
  809. else
  810. Result:=Inherited ExportPropertyName(AName);
  811. end;
  812. end;
  813. { --------------------------------------------------------------------
  814. TLatLng
  815. --------------------------------------------------------------------}
  816. Procedure TLatLng.Setlatitude(AIndex : Integer; const AValue : double);
  817. begin
  818. If (Flatitude=AValue) then exit;
  819. Flatitude:=AValue;
  820. MarkPropertyChanged(AIndex);
  821. end;
  822. Procedure TLatLng.Setlongitude(AIndex : Integer; const AValue : double);
  823. begin
  824. If (Flongitude=AValue) then exit;
  825. Flongitude:=AValue;
  826. MarkPropertyChanged(AIndex);
  827. end;
  828. { --------------------------------------------------------------------
  829. TIndoorLevel
  830. --------------------------------------------------------------------}
  831. Procedure TIndoorLevel.Setname(AIndex : Integer; const AValue : String);
  832. begin
  833. If (Fname=AValue) then exit;
  834. Fname:=AValue;
  835. MarkPropertyChanged(AIndex);
  836. end;
  837. { --------------------------------------------------------------------
  838. TEphemeralIdRegistration
  839. --------------------------------------------------------------------}
  840. Procedure TEphemeralIdRegistration.SetbeaconEcdhPublicKey(AIndex : Integer; const AValue : String);
  841. begin
  842. If (FbeaconEcdhPublicKey=AValue) then exit;
  843. FbeaconEcdhPublicKey:=AValue;
  844. MarkPropertyChanged(AIndex);
  845. end;
  846. Procedure TEphemeralIdRegistration.SetserviceEcdhPublicKey(AIndex : Integer; const AValue : String);
  847. begin
  848. If (FserviceEcdhPublicKey=AValue) then exit;
  849. FserviceEcdhPublicKey:=AValue;
  850. MarkPropertyChanged(AIndex);
  851. end;
  852. Procedure TEphemeralIdRegistration.SetbeaconIdentityKey(AIndex : Integer; const AValue : String);
  853. begin
  854. If (FbeaconIdentityKey=AValue) then exit;
  855. FbeaconIdentityKey:=AValue;
  856. MarkPropertyChanged(AIndex);
  857. end;
  858. Procedure TEphemeralIdRegistration.SetrotationPeriodExponent(AIndex : Integer; const AValue : integer);
  859. begin
  860. If (FrotationPeriodExponent=AValue) then exit;
  861. FrotationPeriodExponent:=AValue;
  862. MarkPropertyChanged(AIndex);
  863. end;
  864. Procedure TEphemeralIdRegistration.SetinitialClockValue(AIndex : Integer; const AValue : String);
  865. begin
  866. If (FinitialClockValue=AValue) then exit;
  867. FinitialClockValue:=AValue;
  868. MarkPropertyChanged(AIndex);
  869. end;
  870. Procedure TEphemeralIdRegistration.SetinitialEid(AIndex : Integer; const AValue : String);
  871. begin
  872. If (FinitialEid=AValue) then exit;
  873. FinitialEid:=AValue;
  874. MarkPropertyChanged(AIndex);
  875. end;
  876. { --------------------------------------------------------------------
  877. TEmpty
  878. --------------------------------------------------------------------}
  879. { --------------------------------------------------------------------
  880. TListBeaconsResponse
  881. --------------------------------------------------------------------}
  882. Procedure TListBeaconsResponse.Setbeacons(AIndex : Integer; const AValue : TListBeaconsResponseTypebeaconsArray);
  883. begin
  884. If (Fbeacons=AValue) then exit;
  885. Fbeacons:=AValue;
  886. MarkPropertyChanged(AIndex);
  887. end;
  888. Procedure TListBeaconsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  889. begin
  890. If (FnextPageToken=AValue) then exit;
  891. FnextPageToken:=AValue;
  892. MarkPropertyChanged(AIndex);
  893. end;
  894. Procedure TListBeaconsResponse.SettotalCount(AIndex : Integer; const AValue : String);
  895. begin
  896. If (FtotalCount=AValue) then exit;
  897. FtotalCount:=AValue;
  898. MarkPropertyChanged(AIndex);
  899. end;
  900. //2.6.4. bug workaround
  901. {$IFDEF VER2_6}
  902. Procedure TListBeaconsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  903. begin
  904. Case AName of
  905. 'beacons' : SetLength(Fbeacons,ALength);
  906. else
  907. Inherited SetArrayLength(AName,ALength);
  908. end;
  909. end;
  910. {$ENDIF VER2_6}
  911. { --------------------------------------------------------------------
  912. TBeaconAttachment
  913. --------------------------------------------------------------------}
  914. Procedure TBeaconAttachment.SetattachmentName(AIndex : Integer; const AValue : String);
  915. begin
  916. If (FattachmentName=AValue) then exit;
  917. FattachmentName:=AValue;
  918. MarkPropertyChanged(AIndex);
  919. end;
  920. Procedure TBeaconAttachment.SetnamespacedType(AIndex : Integer; const AValue : String);
  921. begin
  922. If (FnamespacedType=AValue) then exit;
  923. FnamespacedType:=AValue;
  924. MarkPropertyChanged(AIndex);
  925. end;
  926. Procedure TBeaconAttachment.Setdata(AIndex : Integer; const AValue : String);
  927. begin
  928. If (Fdata=AValue) then exit;
  929. Fdata:=AValue;
  930. MarkPropertyChanged(AIndex);
  931. end;
  932. { --------------------------------------------------------------------
  933. TListBeaconAttachmentsResponse
  934. --------------------------------------------------------------------}
  935. Procedure TListBeaconAttachmentsResponse.Setattachments(AIndex : Integer; const AValue : TListBeaconAttachmentsResponseTypeattachmentsArray);
  936. begin
  937. If (Fattachments=AValue) then exit;
  938. Fattachments:=AValue;
  939. MarkPropertyChanged(AIndex);
  940. end;
  941. //2.6.4. bug workaround
  942. {$IFDEF VER2_6}
  943. Procedure TListBeaconAttachmentsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  944. begin
  945. Case AName of
  946. 'attachments' : SetLength(Fattachments,ALength);
  947. else
  948. Inherited SetArrayLength(AName,ALength);
  949. end;
  950. end;
  951. {$ENDIF VER2_6}
  952. { --------------------------------------------------------------------
  953. TDeleteAttachmentsResponse
  954. --------------------------------------------------------------------}
  955. Procedure TDeleteAttachmentsResponse.SetnumDeleted(AIndex : Integer; const AValue : integer);
  956. begin
  957. If (FnumDeleted=AValue) then exit;
  958. FnumDeleted:=AValue;
  959. MarkPropertyChanged(AIndex);
  960. end;
  961. { --------------------------------------------------------------------
  962. TListNamespacesResponse
  963. --------------------------------------------------------------------}
  964. Procedure TListNamespacesResponse.Setnamespaces(AIndex : Integer; const AValue : TListNamespacesResponseTypenamespacesArray);
  965. begin
  966. If (Fnamespaces=AValue) then exit;
  967. Fnamespaces:=AValue;
  968. MarkPropertyChanged(AIndex);
  969. end;
  970. //2.6.4. bug workaround
  971. {$IFDEF VER2_6}
  972. Procedure TListNamespacesResponse.SetArrayLength(Const AName : String; ALength : Longint);
  973. begin
  974. Case AName of
  975. 'namespaces' : SetLength(Fnamespaces,ALength);
  976. else
  977. Inherited SetArrayLength(AName,ALength);
  978. end;
  979. end;
  980. {$ENDIF VER2_6}
  981. { --------------------------------------------------------------------
  982. TNamespace
  983. --------------------------------------------------------------------}
  984. Procedure TNamespace.SetnamespaceName(AIndex : Integer; const AValue : String);
  985. begin
  986. If (FnamespaceName=AValue) then exit;
  987. FnamespaceName:=AValue;
  988. MarkPropertyChanged(AIndex);
  989. end;
  990. Procedure TNamespace.SetservingVisibility(AIndex : Integer; const AValue : String);
  991. begin
  992. If (FservingVisibility=AValue) then exit;
  993. FservingVisibility:=AValue;
  994. MarkPropertyChanged(AIndex);
  995. end;
  996. { --------------------------------------------------------------------
  997. TEphemeralIdRegistrationParams
  998. --------------------------------------------------------------------}
  999. Procedure TEphemeralIdRegistrationParams.SetserviceEcdhPublicKey(AIndex : Integer; const AValue : String);
  1000. begin
  1001. If (FserviceEcdhPublicKey=AValue) then exit;
  1002. FserviceEcdhPublicKey:=AValue;
  1003. MarkPropertyChanged(AIndex);
  1004. end;
  1005. Procedure TEphemeralIdRegistrationParams.SetminRotationPeriodExponent(AIndex : Integer; const AValue : integer);
  1006. begin
  1007. If (FminRotationPeriodExponent=AValue) then exit;
  1008. FminRotationPeriodExponent:=AValue;
  1009. MarkPropertyChanged(AIndex);
  1010. end;
  1011. Procedure TEphemeralIdRegistrationParams.SetmaxRotationPeriodExponent(AIndex : Integer; const AValue : integer);
  1012. begin
  1013. If (FmaxRotationPeriodExponent=AValue) then exit;
  1014. FmaxRotationPeriodExponent:=AValue;
  1015. MarkPropertyChanged(AIndex);
  1016. end;
  1017. { --------------------------------------------------------------------
  1018. TListDiagnosticsResponse
  1019. --------------------------------------------------------------------}
  1020. Procedure TListDiagnosticsResponse.Setdiagnostics(AIndex : Integer; const AValue : TListDiagnosticsResponseTypediagnosticsArray);
  1021. begin
  1022. If (Fdiagnostics=AValue) then exit;
  1023. Fdiagnostics:=AValue;
  1024. MarkPropertyChanged(AIndex);
  1025. end;
  1026. Procedure TListDiagnosticsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
  1027. begin
  1028. If (FnextPageToken=AValue) then exit;
  1029. FnextPageToken:=AValue;
  1030. MarkPropertyChanged(AIndex);
  1031. end;
  1032. //2.6.4. bug workaround
  1033. {$IFDEF VER2_6}
  1034. Procedure TListDiagnosticsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1035. begin
  1036. Case AName of
  1037. 'diagnostics' : SetLength(Fdiagnostics,ALength);
  1038. else
  1039. Inherited SetArrayLength(AName,ALength);
  1040. end;
  1041. end;
  1042. {$ENDIF VER2_6}
  1043. { --------------------------------------------------------------------
  1044. TDiagnostics
  1045. --------------------------------------------------------------------}
  1046. Procedure TDiagnostics.SetbeaconName(AIndex : Integer; const AValue : String);
  1047. begin
  1048. If (FbeaconName=AValue) then exit;
  1049. FbeaconName:=AValue;
  1050. MarkPropertyChanged(AIndex);
  1051. end;
  1052. Procedure TDiagnostics.SetestimatedLowBatteryDate(AIndex : Integer; const AValue : TDate);
  1053. begin
  1054. If (FestimatedLowBatteryDate=AValue) then exit;
  1055. FestimatedLowBatteryDate:=AValue;
  1056. MarkPropertyChanged(AIndex);
  1057. end;
  1058. Procedure TDiagnostics.Setalerts(AIndex : Integer; const AValue : TStringArray);
  1059. begin
  1060. If (Falerts=AValue) then exit;
  1061. Falerts:=AValue;
  1062. MarkPropertyChanged(AIndex);
  1063. end;
  1064. //2.6.4. bug workaround
  1065. {$IFDEF VER2_6}
  1066. Procedure TDiagnostics.SetArrayLength(Const AName : String; ALength : Longint);
  1067. begin
  1068. Case AName of
  1069. 'alerts' : SetLength(Falerts,ALength);
  1070. else
  1071. Inherited SetArrayLength(AName,ALength);
  1072. end;
  1073. end;
  1074. {$ENDIF VER2_6}
  1075. { --------------------------------------------------------------------
  1076. TDate
  1077. --------------------------------------------------------------------}
  1078. Procedure TDate.Setyear(AIndex : Integer; const AValue : integer);
  1079. begin
  1080. If (Fyear=AValue) then exit;
  1081. Fyear:=AValue;
  1082. MarkPropertyChanged(AIndex);
  1083. end;
  1084. Procedure TDate.Setmonth(AIndex : Integer; const AValue : integer);
  1085. begin
  1086. If (Fmonth=AValue) then exit;
  1087. Fmonth:=AValue;
  1088. MarkPropertyChanged(AIndex);
  1089. end;
  1090. Procedure TDate.Setday(AIndex : Integer; const AValue : integer);
  1091. begin
  1092. If (Fday=AValue) then exit;
  1093. Fday:=AValue;
  1094. MarkPropertyChanged(AIndex);
  1095. end;
  1096. { --------------------------------------------------------------------
  1097. TGetInfoForObservedBeaconsRequest
  1098. --------------------------------------------------------------------}
  1099. Procedure TGetInfoForObservedBeaconsRequest.Setobservations(AIndex : Integer; const AValue : TGetInfoForObservedBeaconsRequestTypeobservationsArray);
  1100. begin
  1101. If (Fobservations=AValue) then exit;
  1102. Fobservations:=AValue;
  1103. MarkPropertyChanged(AIndex);
  1104. end;
  1105. Procedure TGetInfoForObservedBeaconsRequest.SetnamespacedTypes(AIndex : Integer; const AValue : TStringArray);
  1106. begin
  1107. If (FnamespacedTypes=AValue) then exit;
  1108. FnamespacedTypes:=AValue;
  1109. MarkPropertyChanged(AIndex);
  1110. end;
  1111. //2.6.4. bug workaround
  1112. {$IFDEF VER2_6}
  1113. Procedure TGetInfoForObservedBeaconsRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1114. begin
  1115. Case AName of
  1116. 'observations' : SetLength(Fobservations,ALength);
  1117. 'namespacedtypes' : SetLength(FnamespacedTypes,ALength);
  1118. else
  1119. Inherited SetArrayLength(AName,ALength);
  1120. end;
  1121. end;
  1122. {$ENDIF VER2_6}
  1123. { --------------------------------------------------------------------
  1124. TObservation
  1125. --------------------------------------------------------------------}
  1126. Procedure TObservation.SetadvertisedId(AIndex : Integer; const AValue : TAdvertisedId);
  1127. begin
  1128. If (FadvertisedId=AValue) then exit;
  1129. FadvertisedId:=AValue;
  1130. MarkPropertyChanged(AIndex);
  1131. end;
  1132. Procedure TObservation.Settelemetry(AIndex : Integer; const AValue : String);
  1133. begin
  1134. If (Ftelemetry=AValue) then exit;
  1135. Ftelemetry:=AValue;
  1136. MarkPropertyChanged(AIndex);
  1137. end;
  1138. Procedure TObservation.SettimestampMs(AIndex : Integer; const AValue : String);
  1139. begin
  1140. If (FtimestampMs=AValue) then exit;
  1141. FtimestampMs:=AValue;
  1142. MarkPropertyChanged(AIndex);
  1143. end;
  1144. { --------------------------------------------------------------------
  1145. TGetInfoForObservedBeaconsResponse
  1146. --------------------------------------------------------------------}
  1147. Procedure TGetInfoForObservedBeaconsResponse.Setbeacons(AIndex : Integer; const AValue : TGetInfoForObservedBeaconsResponseTypebeaconsArray);
  1148. begin
  1149. If (Fbeacons=AValue) then exit;
  1150. Fbeacons:=AValue;
  1151. MarkPropertyChanged(AIndex);
  1152. end;
  1153. //2.6.4. bug workaround
  1154. {$IFDEF VER2_6}
  1155. Procedure TGetInfoForObservedBeaconsResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1156. begin
  1157. Case AName of
  1158. 'beacons' : SetLength(Fbeacons,ALength);
  1159. else
  1160. Inherited SetArrayLength(AName,ALength);
  1161. end;
  1162. end;
  1163. {$ENDIF VER2_6}
  1164. { --------------------------------------------------------------------
  1165. TBeaconInfo
  1166. --------------------------------------------------------------------}
  1167. Procedure TBeaconInfo.SetadvertisedId(AIndex : Integer; const AValue : TAdvertisedId);
  1168. begin
  1169. If (FadvertisedId=AValue) then exit;
  1170. FadvertisedId:=AValue;
  1171. MarkPropertyChanged(AIndex);
  1172. end;
  1173. Procedure TBeaconInfo.SetbeaconName(AIndex : Integer; const AValue : String);
  1174. begin
  1175. If (FbeaconName=AValue) then exit;
  1176. FbeaconName:=AValue;
  1177. MarkPropertyChanged(AIndex);
  1178. end;
  1179. Procedure TBeaconInfo.Setattachments(AIndex : Integer; const AValue : TBeaconInfoTypeattachmentsArray);
  1180. begin
  1181. If (Fattachments=AValue) then exit;
  1182. Fattachments:=AValue;
  1183. MarkPropertyChanged(AIndex);
  1184. end;
  1185. //2.6.4. bug workaround
  1186. {$IFDEF VER2_6}
  1187. Procedure TBeaconInfo.SetArrayLength(Const AName : String; ALength : Longint);
  1188. begin
  1189. Case AName of
  1190. 'attachments' : SetLength(Fattachments,ALength);
  1191. else
  1192. Inherited SetArrayLength(AName,ALength);
  1193. end;
  1194. end;
  1195. {$ENDIF VER2_6}
  1196. { --------------------------------------------------------------------
  1197. TAttachmentInfo
  1198. --------------------------------------------------------------------}
  1199. Procedure TAttachmentInfo.SetnamespacedType(AIndex : Integer; const AValue : String);
  1200. begin
  1201. If (FnamespacedType=AValue) then exit;
  1202. FnamespacedType:=AValue;
  1203. MarkPropertyChanged(AIndex);
  1204. end;
  1205. Procedure TAttachmentInfo.Setdata(AIndex : Integer; const AValue : String);
  1206. begin
  1207. If (Fdata=AValue) then exit;
  1208. Fdata:=AValue;
  1209. MarkPropertyChanged(AIndex);
  1210. end;
  1211. { --------------------------------------------------------------------
  1212. TBeaconsAttachmentsResource
  1213. --------------------------------------------------------------------}
  1214. Class Function TBeaconsAttachmentsResource.ResourceName : String;
  1215. begin
  1216. Result:='attachments';
  1217. end;
  1218. Class Function TBeaconsAttachmentsResource.DefaultAPI : TGoogleAPIClass;
  1219. begin
  1220. Result:=TproximitybeaconAPI;
  1221. end;
  1222. Function TBeaconsAttachmentsResource.Create(beaconName: string; aBeaconAttachment : TBeaconAttachment; AQuery : string = '') : TBeaconAttachment;
  1223. Const
  1224. _HTTPMethod = 'POST';
  1225. _Path = 'v1beta1/{+beaconName}/attachments';
  1226. _Methodid = 'proximitybeacon.beacons.attachments.create';
  1227. Var
  1228. _P : String;
  1229. begin
  1230. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1231. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aBeaconAttachment,TBeaconAttachment) as TBeaconAttachment;
  1232. end;
  1233. Function TBeaconsAttachmentsResource.Create(beaconName: string; aBeaconAttachment : TBeaconAttachment; AQuery : TBeaconsAttachmentscreateOptions) : TBeaconAttachment;
  1234. Var
  1235. _Q : String;
  1236. begin
  1237. _Q:='';
  1238. AddToQuery(_Q,'projectId',AQuery.projectId);
  1239. Result:=Create(beaconName,aBeaconAttachment,_Q);
  1240. end;
  1241. Function TBeaconsAttachmentsResource.List(beaconName: string; AQuery : string = '') : TListBeaconAttachmentsResponse;
  1242. Const
  1243. _HTTPMethod = 'GET';
  1244. _Path = 'v1beta1/{+beaconName}/attachments';
  1245. _Methodid = 'proximitybeacon.beacons.attachments.list';
  1246. Var
  1247. _P : String;
  1248. begin
  1249. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1250. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListBeaconAttachmentsResponse) as TListBeaconAttachmentsResponse;
  1251. end;
  1252. Function TBeaconsAttachmentsResource.List(beaconName: string; AQuery : TBeaconsAttachmentslistOptions) : TListBeaconAttachmentsResponse;
  1253. Var
  1254. _Q : String;
  1255. begin
  1256. _Q:='';
  1257. AddToQuery(_Q,'namespacedType',AQuery.namespacedType);
  1258. AddToQuery(_Q,'projectId',AQuery.projectId);
  1259. Result:=List(beaconName,_Q);
  1260. end;
  1261. Function TBeaconsAttachmentsResource.Delete(attachmentName: string; AQuery : string = '') : TEmpty;
  1262. Const
  1263. _HTTPMethod = 'DELETE';
  1264. _Path = 'v1beta1/{+attachmentName}';
  1265. _Methodid = 'proximitybeacon.beacons.attachments.delete';
  1266. Var
  1267. _P : String;
  1268. begin
  1269. _P:=SubstitutePath(_Path,['attachmentName',attachmentName]);
  1270. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TEmpty) as TEmpty;
  1271. end;
  1272. Function TBeaconsAttachmentsResource.Delete(attachmentName: string; AQuery : TBeaconsAttachmentsdeleteOptions) : TEmpty;
  1273. Var
  1274. _Q : String;
  1275. begin
  1276. _Q:='';
  1277. AddToQuery(_Q,'projectId',AQuery.projectId);
  1278. Result:=Delete(attachmentName,_Q);
  1279. end;
  1280. Function TBeaconsAttachmentsResource.BatchDelete(beaconName: string; AQuery : string = '') : TDeleteAttachmentsResponse;
  1281. Const
  1282. _HTTPMethod = 'POST';
  1283. _Path = 'v1beta1/{+beaconName}/attachments:batchDelete';
  1284. _Methodid = 'proximitybeacon.beacons.attachments.batchDelete';
  1285. Var
  1286. _P : String;
  1287. begin
  1288. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1289. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TDeleteAttachmentsResponse) as TDeleteAttachmentsResponse;
  1290. end;
  1291. Function TBeaconsAttachmentsResource.BatchDelete(beaconName: string; AQuery : TBeaconsAttachmentsbatchDeleteOptions) : TDeleteAttachmentsResponse;
  1292. Var
  1293. _Q : String;
  1294. begin
  1295. _Q:='';
  1296. AddToQuery(_Q,'namespacedType',AQuery.namespacedType);
  1297. AddToQuery(_Q,'projectId',AQuery.projectId);
  1298. Result:=BatchDelete(beaconName,_Q);
  1299. end;
  1300. { --------------------------------------------------------------------
  1301. TBeaconsDiagnosticsResource
  1302. --------------------------------------------------------------------}
  1303. Class Function TBeaconsDiagnosticsResource.ResourceName : String;
  1304. begin
  1305. Result:='diagnostics';
  1306. end;
  1307. Class Function TBeaconsDiagnosticsResource.DefaultAPI : TGoogleAPIClass;
  1308. begin
  1309. Result:=TproximitybeaconAPI;
  1310. end;
  1311. Function TBeaconsDiagnosticsResource.List(beaconName: string; AQuery : string = '') : TListDiagnosticsResponse;
  1312. Const
  1313. _HTTPMethod = 'GET';
  1314. _Path = 'v1beta1/{+beaconName}/diagnostics';
  1315. _Methodid = 'proximitybeacon.beacons.diagnostics.list';
  1316. Var
  1317. _P : String;
  1318. begin
  1319. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1320. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListDiagnosticsResponse) as TListDiagnosticsResponse;
  1321. end;
  1322. Function TBeaconsDiagnosticsResource.List(beaconName: string; AQuery : TBeaconsDiagnosticslistOptions) : TListDiagnosticsResponse;
  1323. Var
  1324. _Q : String;
  1325. begin
  1326. _Q:='';
  1327. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  1328. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1329. AddToQuery(_Q,'alertFilter',AQuery.alertFilter);
  1330. AddToQuery(_Q,'projectId',AQuery.projectId);
  1331. Result:=List(beaconName,_Q);
  1332. end;
  1333. { --------------------------------------------------------------------
  1334. TBeaconsResource
  1335. --------------------------------------------------------------------}
  1336. Class Function TBeaconsResource.ResourceName : String;
  1337. begin
  1338. Result:='beacons';
  1339. end;
  1340. Class Function TBeaconsResource.DefaultAPI : TGoogleAPIClass;
  1341. begin
  1342. Result:=TproximitybeaconAPI;
  1343. end;
  1344. Function TBeaconsResource.Register(aBeacon : TBeacon; AQuery : string = '') : TBeacon;
  1345. Const
  1346. _HTTPMethod = 'POST';
  1347. _Path = 'v1beta1/beacons:register';
  1348. _Methodid = 'proximitybeacon.beacons.register';
  1349. begin
  1350. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,aBeacon,TBeacon) as TBeacon;
  1351. end;
  1352. Function TBeaconsResource.Register(aBeacon : TBeacon; AQuery : TBeaconsregisterOptions) : TBeacon;
  1353. Var
  1354. _Q : String;
  1355. begin
  1356. _Q:='';
  1357. AddToQuery(_Q,'projectId',AQuery.projectId);
  1358. Result:=Register(aBeacon,_Q);
  1359. end;
  1360. Function TBeaconsResource.Decommission(beaconName: string; AQuery : string = '') : TEmpty;
  1361. Const
  1362. _HTTPMethod = 'POST';
  1363. _Path = 'v1beta1/{+beaconName}:decommission';
  1364. _Methodid = 'proximitybeacon.beacons.decommission';
  1365. Var
  1366. _P : String;
  1367. begin
  1368. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1369. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TEmpty) as TEmpty;
  1370. end;
  1371. Function TBeaconsResource.Decommission(beaconName: string; AQuery : TBeaconsdecommissionOptions) : TEmpty;
  1372. Var
  1373. _Q : String;
  1374. begin
  1375. _Q:='';
  1376. AddToQuery(_Q,'projectId',AQuery.projectId);
  1377. Result:=Decommission(beaconName,_Q);
  1378. end;
  1379. Function TBeaconsResource.Get(beaconName: string; AQuery : string = '') : TBeacon;
  1380. Const
  1381. _HTTPMethod = 'GET';
  1382. _Path = 'v1beta1/{+beaconName}';
  1383. _Methodid = 'proximitybeacon.beacons.get';
  1384. Var
  1385. _P : String;
  1386. begin
  1387. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1388. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TBeacon) as TBeacon;
  1389. end;
  1390. Function TBeaconsResource.Get(beaconName: string; AQuery : TBeaconsgetOptions) : TBeacon;
  1391. Var
  1392. _Q : String;
  1393. begin
  1394. _Q:='';
  1395. AddToQuery(_Q,'projectId',AQuery.projectId);
  1396. Result:=Get(beaconName,_Q);
  1397. end;
  1398. Function TBeaconsResource.List(AQuery : string = '') : TListBeaconsResponse;
  1399. Const
  1400. _HTTPMethod = 'GET';
  1401. _Path = 'v1beta1/beacons';
  1402. _Methodid = 'proximitybeacon.beacons.list';
  1403. begin
  1404. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TListBeaconsResponse) as TListBeaconsResponse;
  1405. end;
  1406. Function TBeaconsResource.List(AQuery : TBeaconslistOptions) : TListBeaconsResponse;
  1407. Var
  1408. _Q : String;
  1409. begin
  1410. _Q:='';
  1411. AddToQuery(_Q,'q',AQuery.q);
  1412. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1413. AddToQuery(_Q,'pageSize',AQuery.pageSize);
  1414. AddToQuery(_Q,'projectId',AQuery.projectId);
  1415. Result:=List(_Q);
  1416. end;
  1417. Function TBeaconsResource.Update(beaconName: string; aBeacon : TBeacon; AQuery : string = '') : TBeacon;
  1418. Const
  1419. _HTTPMethod = 'PUT';
  1420. _Path = 'v1beta1/{+beaconName}';
  1421. _Methodid = 'proximitybeacon.beacons.update';
  1422. Var
  1423. _P : String;
  1424. begin
  1425. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1426. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aBeacon,TBeacon) as TBeacon;
  1427. end;
  1428. Function TBeaconsResource.Update(beaconName: string; aBeacon : TBeacon; AQuery : TBeaconsupdateOptions) : TBeacon;
  1429. Var
  1430. _Q : String;
  1431. begin
  1432. _Q:='';
  1433. AddToQuery(_Q,'projectId',AQuery.projectId);
  1434. Result:=Update(beaconName,aBeacon,_Q);
  1435. end;
  1436. Function TBeaconsResource.Activate(beaconName: string; AQuery : string = '') : TEmpty;
  1437. Const
  1438. _HTTPMethod = 'POST';
  1439. _Path = 'v1beta1/{+beaconName}:activate';
  1440. _Methodid = 'proximitybeacon.beacons.activate';
  1441. Var
  1442. _P : String;
  1443. begin
  1444. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1445. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TEmpty) as TEmpty;
  1446. end;
  1447. Function TBeaconsResource.Activate(beaconName: string; AQuery : TBeaconsactivateOptions) : TEmpty;
  1448. Var
  1449. _Q : String;
  1450. begin
  1451. _Q:='';
  1452. AddToQuery(_Q,'projectId',AQuery.projectId);
  1453. Result:=Activate(beaconName,_Q);
  1454. end;
  1455. Function TBeaconsResource.Deactivate(beaconName: string; AQuery : string = '') : TEmpty;
  1456. Const
  1457. _HTTPMethod = 'POST';
  1458. _Path = 'v1beta1/{+beaconName}:deactivate';
  1459. _Methodid = 'proximitybeacon.beacons.deactivate';
  1460. Var
  1461. _P : String;
  1462. begin
  1463. _P:=SubstitutePath(_Path,['beaconName',beaconName]);
  1464. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TEmpty) as TEmpty;
  1465. end;
  1466. Function TBeaconsResource.Deactivate(beaconName: string; AQuery : TBeaconsdeactivateOptions) : TEmpty;
  1467. Var
  1468. _Q : String;
  1469. begin
  1470. _Q:='';
  1471. AddToQuery(_Q,'projectId',AQuery.projectId);
  1472. Result:=Deactivate(beaconName,_Q);
  1473. end;
  1474. Function TBeaconsResource.GetAttachmentsInstance : TBeaconsAttachmentsResource;
  1475. begin
  1476. if (FAttachmentsInstance=Nil) then
  1477. FAttachmentsInstance:=CreateAttachmentsResource;
  1478. Result:=FAttachmentsInstance;
  1479. end;
  1480. Function TBeaconsResource.CreateAttachmentsResource : TBeaconsAttachmentsResource;
  1481. begin
  1482. Result:=CreateAttachmentsResource(Self);
  1483. end;
  1484. Function TBeaconsResource.CreateAttachmentsResource(AOwner : TComponent) : TBeaconsAttachmentsResource;
  1485. begin
  1486. Result:=TBeaconsAttachmentsResource.Create(AOwner);
  1487. Result.API:=Self.API;
  1488. end;
  1489. Function TBeaconsResource.GetDiagnosticsInstance : TBeaconsDiagnosticsResource;
  1490. begin
  1491. if (FDiagnosticsInstance=Nil) then
  1492. FDiagnosticsInstance:=CreateDiagnosticsResource;
  1493. Result:=FDiagnosticsInstance;
  1494. end;
  1495. Function TBeaconsResource.CreateDiagnosticsResource : TBeaconsDiagnosticsResource;
  1496. begin
  1497. Result:=CreateDiagnosticsResource(Self);
  1498. end;
  1499. Function TBeaconsResource.CreateDiagnosticsResource(AOwner : TComponent) : TBeaconsDiagnosticsResource;
  1500. begin
  1501. Result:=TBeaconsDiagnosticsResource.Create(AOwner);
  1502. Result.API:=Self.API;
  1503. end;
  1504. { --------------------------------------------------------------------
  1505. TNamespacesResource
  1506. --------------------------------------------------------------------}
  1507. Class Function TNamespacesResource.ResourceName : String;
  1508. begin
  1509. Result:='namespaces';
  1510. end;
  1511. Class Function TNamespacesResource.DefaultAPI : TGoogleAPIClass;
  1512. begin
  1513. Result:=TproximitybeaconAPI;
  1514. end;
  1515. Function TNamespacesResource.List(AQuery : string = '') : TListNamespacesResponse;
  1516. Const
  1517. _HTTPMethod = 'GET';
  1518. _Path = 'v1beta1/namespaces';
  1519. _Methodid = 'proximitybeacon.namespaces.list';
  1520. begin
  1521. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TListNamespacesResponse) as TListNamespacesResponse;
  1522. end;
  1523. Function TNamespacesResource.List(AQuery : TNamespaceslistOptions) : TListNamespacesResponse;
  1524. Var
  1525. _Q : String;
  1526. begin
  1527. _Q:='';
  1528. AddToQuery(_Q,'projectId',AQuery.projectId);
  1529. Result:=List(_Q);
  1530. end;
  1531. Function TNamespacesResource.Update(namespaceName: string; aNamespace : TNamespace; AQuery : string = '') : TNamespace;
  1532. Const
  1533. _HTTPMethod = 'PUT';
  1534. _Path = 'v1beta1/{+namespaceName}';
  1535. _Methodid = 'proximitybeacon.namespaces.update';
  1536. Var
  1537. _P : String;
  1538. begin
  1539. _P:=SubstitutePath(_Path,['namespaceName',namespaceName]);
  1540. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aNamespace,TNamespace) as TNamespace;
  1541. end;
  1542. Function TNamespacesResource.Update(namespaceName: string; aNamespace : TNamespace; AQuery : TNamespacesupdateOptions) : TNamespace;
  1543. Var
  1544. _Q : String;
  1545. begin
  1546. _Q:='';
  1547. AddToQuery(_Q,'projectId',AQuery.projectId);
  1548. Result:=Update(namespaceName,aNamespace,_Q);
  1549. end;
  1550. { --------------------------------------------------------------------
  1551. TV1beta1Resource
  1552. --------------------------------------------------------------------}
  1553. Class Function TV1beta1Resource.ResourceName : String;
  1554. begin
  1555. Result:='v1beta1';
  1556. end;
  1557. Class Function TV1beta1Resource.DefaultAPI : TGoogleAPIClass;
  1558. begin
  1559. Result:=TproximitybeaconAPI;
  1560. end;
  1561. Function TV1beta1Resource.GetEidparams : TEphemeralIdRegistrationParams;
  1562. Const
  1563. _HTTPMethod = 'GET';
  1564. _Path = 'v1beta1/eidparams';
  1565. _Methodid = 'proximitybeacon.getEidparams';
  1566. begin
  1567. Result:=ServiceCall(_HTTPMethod,_Path,'',Nil,TEphemeralIdRegistrationParams) as TEphemeralIdRegistrationParams;
  1568. end;
  1569. { --------------------------------------------------------------------
  1570. TBeaconinfoResource
  1571. --------------------------------------------------------------------}
  1572. Class Function TBeaconinfoResource.ResourceName : String;
  1573. begin
  1574. Result:='beaconinfo';
  1575. end;
  1576. Class Function TBeaconinfoResource.DefaultAPI : TGoogleAPIClass;
  1577. begin
  1578. Result:=TproximitybeaconAPI;
  1579. end;
  1580. Function TBeaconinfoResource.Getforobserved(aGetInfoForObservedBeaconsRequest : TGetInfoForObservedBeaconsRequest) : TGetInfoForObservedBeaconsResponse;
  1581. Const
  1582. _HTTPMethod = 'POST';
  1583. _Path = 'v1beta1/beaconinfo:getforobserved';
  1584. _Methodid = 'proximitybeacon.beaconinfo.getforobserved';
  1585. begin
  1586. Result:=ServiceCall(_HTTPMethod,_Path,'',aGetInfoForObservedBeaconsRequest,TGetInfoForObservedBeaconsResponse) as TGetInfoForObservedBeaconsResponse;
  1587. end;
  1588. { --------------------------------------------------------------------
  1589. TProximitybeaconAPI
  1590. --------------------------------------------------------------------}
  1591. Class Function TProximitybeaconAPI.APIName : String;
  1592. begin
  1593. Result:='proximitybeacon';
  1594. end;
  1595. Class Function TProximitybeaconAPI.APIVersion : String;
  1596. begin
  1597. Result:='v1beta1';
  1598. end;
  1599. Class Function TProximitybeaconAPI.APIRevision : String;
  1600. begin
  1601. Result:='20160429';
  1602. end;
  1603. Class Function TProximitybeaconAPI.APIID : String;
  1604. begin
  1605. Result:='proximitybeacon:v1beta1';
  1606. end;
  1607. Class Function TProximitybeaconAPI.APITitle : String;
  1608. begin
  1609. Result:='Google Proximity Beacon API';
  1610. end;
  1611. Class Function TProximitybeaconAPI.APIDescription : String;
  1612. begin
  1613. Result:='Registers, manages, indexes, and searches beacons.';
  1614. end;
  1615. Class Function TProximitybeaconAPI.APIOwnerDomain : String;
  1616. begin
  1617. Result:='google.com';
  1618. end;
  1619. Class Function TProximitybeaconAPI.APIOwnerName : String;
  1620. begin
  1621. Result:='Google';
  1622. end;
  1623. Class Function TProximitybeaconAPI.APIIcon16 : String;
  1624. begin
  1625. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1626. end;
  1627. Class Function TProximitybeaconAPI.APIIcon32 : String;
  1628. begin
  1629. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1630. end;
  1631. Class Function TProximitybeaconAPI.APIdocumentationLink : String;
  1632. begin
  1633. Result:='https://developers.google.com/beacons/proximity/';
  1634. end;
  1635. Class Function TProximitybeaconAPI.APIrootUrl : string;
  1636. begin
  1637. Result:='https://proximitybeacon.googleapis.com/';
  1638. end;
  1639. Class Function TProximitybeaconAPI.APIbasePath : string;
  1640. begin
  1641. Result:='';
  1642. end;
  1643. Class Function TProximitybeaconAPI.APIbaseURL : String;
  1644. begin
  1645. Result:='https://proximitybeacon.googleapis.com/';
  1646. end;
  1647. Class Function TProximitybeaconAPI.APIProtocol : string;
  1648. begin
  1649. Result:='rest';
  1650. end;
  1651. Class Function TProximitybeaconAPI.APIservicePath : string;
  1652. begin
  1653. Result:='';
  1654. end;
  1655. Class Function TProximitybeaconAPI.APIbatchPath : String;
  1656. begin
  1657. Result:='batch';
  1658. end;
  1659. Class Function TProximitybeaconAPI.APIAuthScopes : TScopeInfoArray;
  1660. begin
  1661. SetLength(Result,1);
  1662. Result[0].Name:='https://www.googleapis.com/auth/userlocation.beacon.registry';
  1663. Result[0].Description:='View and modify your beacons';
  1664. end;
  1665. Class Function TProximitybeaconAPI.APINeedsAuth : Boolean;
  1666. begin
  1667. Result:=True;
  1668. end;
  1669. Class Procedure TProximitybeaconAPI.RegisterAPIResources;
  1670. begin
  1671. TBeaconTypeproperties.RegisterObject;
  1672. TBeacon.RegisterObject;
  1673. TAdvertisedId.RegisterObject;
  1674. TLatLng.RegisterObject;
  1675. TIndoorLevel.RegisterObject;
  1676. TEphemeralIdRegistration.RegisterObject;
  1677. TEmpty.RegisterObject;
  1678. TListBeaconsResponse.RegisterObject;
  1679. TBeaconAttachment.RegisterObject;
  1680. TListBeaconAttachmentsResponse.RegisterObject;
  1681. TDeleteAttachmentsResponse.RegisterObject;
  1682. TListNamespacesResponse.RegisterObject;
  1683. TNamespace.RegisterObject;
  1684. TEphemeralIdRegistrationParams.RegisterObject;
  1685. TListDiagnosticsResponse.RegisterObject;
  1686. TDiagnostics.RegisterObject;
  1687. TDate.RegisterObject;
  1688. TGetInfoForObservedBeaconsRequest.RegisterObject;
  1689. TObservation.RegisterObject;
  1690. TGetInfoForObservedBeaconsResponse.RegisterObject;
  1691. TBeaconInfo.RegisterObject;
  1692. TAttachmentInfo.RegisterObject;
  1693. end;
  1694. Function TProximitybeaconAPI.GetBeaconsAttachmentsInstance : TBeaconsAttachmentsResource;
  1695. begin
  1696. if (FBeaconsAttachmentsInstance=Nil) then
  1697. FBeaconsAttachmentsInstance:=CreateBeaconsAttachmentsResource;
  1698. Result:=FBeaconsAttachmentsInstance;
  1699. end;
  1700. Function TProximitybeaconAPI.CreateBeaconsAttachmentsResource : TBeaconsAttachmentsResource;
  1701. begin
  1702. Result:=CreateBeaconsAttachmentsResource(Self);
  1703. end;
  1704. Function TProximitybeaconAPI.CreateBeaconsAttachmentsResource(AOwner : TComponent) : TBeaconsAttachmentsResource;
  1705. begin
  1706. Result:=TBeaconsAttachmentsResource.Create(AOwner);
  1707. Result.API:=Self.API;
  1708. end;
  1709. Function TProximitybeaconAPI.GetBeaconsDiagnosticsInstance : TBeaconsDiagnosticsResource;
  1710. begin
  1711. if (FBeaconsDiagnosticsInstance=Nil) then
  1712. FBeaconsDiagnosticsInstance:=CreateBeaconsDiagnosticsResource;
  1713. Result:=FBeaconsDiagnosticsInstance;
  1714. end;
  1715. Function TProximitybeaconAPI.CreateBeaconsDiagnosticsResource : TBeaconsDiagnosticsResource;
  1716. begin
  1717. Result:=CreateBeaconsDiagnosticsResource(Self);
  1718. end;
  1719. Function TProximitybeaconAPI.CreateBeaconsDiagnosticsResource(AOwner : TComponent) : TBeaconsDiagnosticsResource;
  1720. begin
  1721. Result:=TBeaconsDiagnosticsResource.Create(AOwner);
  1722. Result.API:=Self.API;
  1723. end;
  1724. Function TProximitybeaconAPI.GetBeaconsInstance : TBeaconsResource;
  1725. begin
  1726. if (FBeaconsInstance=Nil) then
  1727. FBeaconsInstance:=CreateBeaconsResource;
  1728. Result:=FBeaconsInstance;
  1729. end;
  1730. Function TProximitybeaconAPI.CreateBeaconsResource : TBeaconsResource;
  1731. begin
  1732. Result:=CreateBeaconsResource(Self);
  1733. end;
  1734. Function TProximitybeaconAPI.CreateBeaconsResource(AOwner : TComponent) : TBeaconsResource;
  1735. begin
  1736. Result:=TBeaconsResource.Create(AOwner);
  1737. Result.API:=Self.API;
  1738. end;
  1739. Function TProximitybeaconAPI.GetNamespacesInstance : TNamespacesResource;
  1740. begin
  1741. if (FNamespacesInstance=Nil) then
  1742. FNamespacesInstance:=CreateNamespacesResource;
  1743. Result:=FNamespacesInstance;
  1744. end;
  1745. Function TProximitybeaconAPI.CreateNamespacesResource : TNamespacesResource;
  1746. begin
  1747. Result:=CreateNamespacesResource(Self);
  1748. end;
  1749. Function TProximitybeaconAPI.CreateNamespacesResource(AOwner : TComponent) : TNamespacesResource;
  1750. begin
  1751. Result:=TNamespacesResource.Create(AOwner);
  1752. Result.API:=Self.API;
  1753. end;
  1754. Function TProximitybeaconAPI.GetV1beta1Instance : TV1beta1Resource;
  1755. begin
  1756. if (FV1beta1Instance=Nil) then
  1757. FV1beta1Instance:=CreateV1beta1Resource;
  1758. Result:=FV1beta1Instance;
  1759. end;
  1760. Function TProximitybeaconAPI.CreateV1beta1Resource : TV1beta1Resource;
  1761. begin
  1762. Result:=CreateV1beta1Resource(Self);
  1763. end;
  1764. Function TProximitybeaconAPI.CreateV1beta1Resource(AOwner : TComponent) : TV1beta1Resource;
  1765. begin
  1766. Result:=TV1beta1Resource.Create(AOwner);
  1767. Result.API:=Self.API;
  1768. end;
  1769. Function TProximitybeaconAPI.GetBeaconinfoInstance : TBeaconinfoResource;
  1770. begin
  1771. if (FBeaconinfoInstance=Nil) then
  1772. FBeaconinfoInstance:=CreateBeaconinfoResource;
  1773. Result:=FBeaconinfoInstance;
  1774. end;
  1775. Function TProximitybeaconAPI.CreateBeaconinfoResource : TBeaconinfoResource;
  1776. begin
  1777. Result:=CreateBeaconinfoResource(Self);
  1778. end;
  1779. Function TProximitybeaconAPI.CreateBeaconinfoResource(AOwner : TComponent) : TBeaconinfoResource;
  1780. begin
  1781. Result:=TBeaconinfoResource.Create(AOwner);
  1782. Result.API:=Self.API;
  1783. end;
  1784. initialization
  1785. TProximitybeaconAPI.RegisterAPI;
  1786. end.