REST.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. /*===============================================================================
  2. Copyright (C) 2022 Immersal - Part of Hexagon. All Rights Reserved.
  3. This file is part of the Immersal SDK.
  4. The Immersal SDK cannot be copied, distributed, or made available to
  5. third-parties for commercial purposes without written permission of Immersal Ltd.
  6. Contact sdk@immersal.com for licensing requests.
  7. ===============================================================================*/
  8. using System;
  9. using UnityEngine;
  10. namespace Immersal.REST
  11. {
  12. public struct SDKJobState
  13. {
  14. public const string Done = "done";
  15. public const string Sparse = "sparse";
  16. public const string Processing = "processing";
  17. public const string Failed = "failed";
  18. public const string Pending = "pending";
  19. }
  20. public enum SDKJobType { Map, Stitch, Alignment };
  21. [Serializable]
  22. public struct SDKJob
  23. {
  24. public int id;
  25. public int type;
  26. public string version;
  27. public int creator;
  28. public int size;
  29. public string status;
  30. public int privacy;
  31. public string name;
  32. public double latitude;
  33. public double longitude;
  34. public double altitude;
  35. public string created;
  36. public string modified;
  37. public string sha256_al;
  38. public string sha256_sparse;
  39. public string sha256_dense;
  40. public string sha256_tex;
  41. }
  42. [Serializable]
  43. public struct SDKMapId
  44. {
  45. public int id;
  46. }
  47. [Serializable]
  48. public struct SDKLoginRequest
  49. {
  50. public static string endpoint = "login";
  51. public string login;
  52. public string password;
  53. }
  54. [Serializable]
  55. public struct SDKLoginResult
  56. {
  57. public string error;
  58. public int userId;
  59. public string token;
  60. }
  61. [Serializable]
  62. public struct SDKClearRequest
  63. {
  64. public static string endpoint = "clear";
  65. public string token;
  66. public bool anchor;
  67. }
  68. [Serializable]
  69. public struct SDKClearResult
  70. {
  71. public string error;
  72. }
  73. [Serializable]
  74. public struct SDKConstructRequest
  75. {
  76. public static string endpoint = "construct";
  77. public string token;
  78. public string name;
  79. public int featureCount;
  80. public int featureType;
  81. public bool preservePoses;
  82. public int windowSize;
  83. }
  84. [Serializable]
  85. public struct SDKConstructResult
  86. {
  87. public string error;
  88. public int id;
  89. public int size;
  90. }
  91. [Serializable]
  92. public struct SDKStatusRequest
  93. {
  94. public static string endpoint = "status";
  95. public string token;
  96. }
  97. [Serializable]
  98. public struct SDKStatusResult
  99. {
  100. public string error;
  101. public int imageCount;
  102. public int imageMax;
  103. public bool eulaAccepted;
  104. }
  105. [Serializable]
  106. public struct SDKJobsRequest
  107. {
  108. public static string endpoint = "list";
  109. public string token;
  110. }
  111. [Serializable]
  112. public struct SDKGeoJobsRequest
  113. {
  114. public static string endpoint = "geolist";
  115. public string token;
  116. public double latitude;
  117. public double longitude;
  118. public double radius;
  119. }
  120. [Serializable]
  121. public struct SDKJobsResult
  122. {
  123. public string error;
  124. public int count;
  125. public SDKJob[] jobs;
  126. }
  127. [Serializable]
  128. public struct SDKImageRequest
  129. {
  130. public static string endpoint = "capture";
  131. public string token;
  132. public int run;
  133. public int index;
  134. public bool anchor;
  135. public double px;
  136. public double py;
  137. public double pz;
  138. public double r00;
  139. public double r01;
  140. public double r02;
  141. public double r10;
  142. public double r11;
  143. public double r12;
  144. public double r20;
  145. public double r21;
  146. public double r22;
  147. public double fx;
  148. public double fy;
  149. public double ox;
  150. public double oy;
  151. public double latitude;
  152. public double longitude;
  153. public double altitude;
  154. }
  155. [Serializable]
  156. public struct SDKImageResult
  157. {
  158. public string error;
  159. public string path;
  160. }
  161. [Serializable]
  162. public struct SDKGeoLocalizeRequest
  163. {
  164. public static string endpoint = "geolocalize";
  165. public string token;
  166. public double fx;
  167. public double fy;
  168. public double ox;
  169. public double oy;
  170. public int param1;
  171. public int param2;
  172. public double param3;
  173. public double param4;
  174. public double latitude;
  175. public double longitude;
  176. public double radius;
  177. }
  178. [Serializable]
  179. public struct SDKLocalizeRequest
  180. {
  181. public static string endpoint = "localize";
  182. public string token;
  183. public double fx;
  184. public double fy;
  185. public double ox;
  186. public double oy;
  187. public int param1;
  188. public int param2;
  189. public double param3;
  190. public double param4;
  191. public SDKMapId[] mapIds;
  192. }
  193. [Serializable]
  194. public struct SDKGeoPoseRequest
  195. {
  196. public static string endpoint = "geopose";
  197. public string token;
  198. public double fx;
  199. public double fy;
  200. public double ox;
  201. public double oy;
  202. public int param1;
  203. public int param2;
  204. public double param3;
  205. public double param4;
  206. public SDKMapId[] mapIds;
  207. }
  208. [Serializable]
  209. public struct SDKLocalizeResult
  210. {
  211. public string error;
  212. public bool success;
  213. public int map;
  214. public float px;
  215. public float py;
  216. public float pz;
  217. public float r00;
  218. public float r01;
  219. public float r02;
  220. public float r10;
  221. public float r11;
  222. public float r12;
  223. public float r20;
  224. public float r21;
  225. public float r22;
  226. public float time;
  227. }
  228. [Serializable]
  229. public struct SDKGeoPoseResult
  230. {
  231. public string error;
  232. public bool success;
  233. public int map;
  234. public double latitude;
  235. public double longitude;
  236. public double ellipsoidHeight;
  237. public float[] quaternion;
  238. }
  239. [Serializable]
  240. public struct SDKEcefRequest
  241. {
  242. public static string endpoint = "ecef";
  243. public string token;
  244. public int id;
  245. }
  246. [Serializable]
  247. public struct SDKEcefResult
  248. {
  249. public string error;
  250. public double[] ecef;
  251. }
  252. [Serializable]
  253. public struct SDKSetMapAccessTokenRequest
  254. {
  255. public static string endpoint = "setmaptoken";
  256. public string token;
  257. public int id;
  258. }
  259. [Serializable]
  260. public struct SDKClearMapAccessTokenRequest
  261. {
  262. public static string endpoint = "clearmaptoken";
  263. public string token;
  264. public int id;
  265. }
  266. [Serializable]
  267. public struct SDKMapAccessTokenResult
  268. {
  269. public string error;
  270. public int mapId;
  271. public string accessToken;
  272. }
  273. [Serializable]
  274. public struct SDKMapBinaryRequest
  275. {
  276. public static string endpoint = "map";
  277. public string token;
  278. public int id;
  279. }
  280. [Serializable]
  281. public struct SDKMapRequest
  282. {
  283. public static string endpoint = "mapb64";
  284. public string token;
  285. public int id;
  286. }
  287. [Serializable]
  288. public struct SDKMapResult
  289. {
  290. public string error;
  291. public string sha256_al;
  292. public string b64;
  293. public byte[] mapData;
  294. public SDKMapMetadataGetResult metadata;
  295. }
  296. [Serializable]
  297. public struct SDKDeleteMapRequest
  298. {
  299. public static string endpoint = "delete";
  300. public string token;
  301. public int id;
  302. }
  303. [Serializable]
  304. public struct SDKDeleteMapResult
  305. {
  306. public string error;
  307. }
  308. [Serializable]
  309. public struct SDKRestoreMapImagesRequest
  310. {
  311. public static string endpoint = "restore";
  312. public string token;
  313. public int id;
  314. public bool clear;
  315. }
  316. [Serializable]
  317. public struct SDKRestoreMapImagesResult
  318. {
  319. public string error;
  320. }
  321. [Serializable]
  322. public struct SDKMapPrivacyRequest
  323. {
  324. public static string endpoint = "privacy";
  325. public string token;
  326. public int id;
  327. public int privacy;
  328. }
  329. [Serializable]
  330. public struct SDKMapPrivacyResult
  331. {
  332. public string error;
  333. }
  334. [Serializable]
  335. public struct SDKMapDownloadRequest
  336. {
  337. public static string endpoint = "mapb64";
  338. public string token;
  339. public int id;
  340. }
  341. [Serializable]
  342. public struct SDKMapDownloadResult
  343. {
  344. public string error;
  345. public string sha256_al;
  346. public string b64;
  347. }
  348. [Serializable]
  349. public struct SDKMapMetadataGetRequest
  350. {
  351. public static string endpoint = "metadataget";
  352. public string token;
  353. public int id;
  354. }
  355. [Serializable]
  356. public struct SDKMapMetadataGetResult
  357. {
  358. public string error;
  359. public int id;
  360. public int type;
  361. public string created;
  362. public string version;
  363. public int user;
  364. public int creator;
  365. public string name;
  366. public int size;
  367. public string status;
  368. public int privacy;
  369. public double latitude;
  370. public double longitude;
  371. public double altitude;
  372. public double tx;
  373. public double ty;
  374. public double tz;
  375. public double qw;
  376. public double qx;
  377. public double qy;
  378. public double qz;
  379. public double scale;
  380. public string sha256_al;
  381. public string sha256_sparse;
  382. public string sha256_dense;
  383. public string sha256_tex;
  384. }
  385. [Serializable]
  386. public struct SDKMapAlignmentSetRequest
  387. {
  388. public static string endpoint = "metadataset";
  389. public string token;
  390. public int id;
  391. public double tx;
  392. public double ty;
  393. public double tz;
  394. public double qw;
  395. public double qx;
  396. public double qy;
  397. public double qz;
  398. public double scale;
  399. }
  400. [Serializable]
  401. public struct SDKMapAlignmentSetResult
  402. {
  403. public string error;
  404. }
  405. [Serializable]
  406. public struct SDKMapAlignmentResetRequest
  407. {
  408. public static string endpoint = "reset";
  409. public string token;
  410. public int id;
  411. }
  412. [Serializable]
  413. public struct SDKMapAlignmentResetResult
  414. {
  415. public string error;
  416. }
  417. }