Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

358 rindas
7.8 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. namespace UnityEngine.UDP.Editor
  4. {
  5. public class UnityClientInfo
  6. {
  7. public string ClientId { get; set; }
  8. public string ClientKey { get; set; }
  9. public string ClientRSAPublicKey { get; set; }
  10. public string ClientSecret { get; set; }
  11. }
  12. public class RolePermission
  13. {
  14. public bool owner { get; set; }
  15. public bool manager { get; set; }
  16. public bool user { get; set; }
  17. public RolePermission()
  18. {
  19. owner = false;
  20. manager = false;
  21. user = false;
  22. }
  23. }
  24. public class TestAccount
  25. {
  26. public string email;
  27. public string password;
  28. public string playerId;
  29. public bool isUpdate;
  30. public TestAccount()
  31. {
  32. this.isUpdate = false;
  33. this.email = "";
  34. this.password = "";
  35. this.playerId = "";
  36. }
  37. }
  38. [Serializable]
  39. public class UnityClient
  40. {
  41. public string client_id;
  42. public string client_secret;
  43. public string client_name;
  44. public List<string> scopes;
  45. public UnityChannel channel;
  46. public string rev;
  47. public string owner;
  48. public string ownerType;
  49. public UnityClient()
  50. {
  51. this.scopes = new List<string>();
  52. }
  53. }
  54. [Serializable]
  55. public class UnityChannel
  56. {
  57. public string projectGuid;
  58. public ThirdPartySetting[] thirdPartySettings;
  59. public string callbackUrl;
  60. public string bundleIdentifier = "UDP";
  61. }
  62. [Serializable]
  63. public class ThirdPartySetting
  64. {
  65. public String appId;
  66. public String appType;
  67. public String appKey;
  68. public String appSecret;
  69. public ExtraProperties extraProperties;
  70. }
  71. [Serializable]
  72. public class ExtraProperties
  73. {
  74. public String pubKey;
  75. public String performIapCallbacks;
  76. }
  77. [Serializable]
  78. public class UnityClientResponseWrapper : GeneralResponse
  79. {
  80. public UnityClientResponse[] array;
  81. }
  82. [Serializable]
  83. public class UnityClientResponse : GeneralResponse
  84. {
  85. public string client_id;
  86. public string client_secret;
  87. public UnityChannelResponse channel;
  88. public string rev;
  89. }
  90. [Serializable]
  91. public class UnityChannelResponse
  92. {
  93. public string projectGuid;
  94. public ThirdPartySetting[] thirdPartySettings;
  95. public string callbackUrl;
  96. public string publicRSAKey;
  97. public string channelSecret;
  98. }
  99. [Serializable]
  100. public class TokenRequest
  101. {
  102. public string code;
  103. public string client_id;
  104. public string client_secret;
  105. public string grant_type;
  106. public string redirect_uri;
  107. public string refresh_token;
  108. }
  109. [Serializable]
  110. public class TokenInfo : GeneralResponse
  111. {
  112. public string access_token;
  113. public string refresh_token;
  114. }
  115. [Serializable]
  116. public class UserIdResponse : GeneralResponse
  117. {
  118. public string sub;
  119. }
  120. [Serializable]
  121. public class OrgIdResponse : GeneralResponse
  122. {
  123. public string org_foreign_key;
  124. }
  125. [Serializable]
  126. public class OrgRoleResponse : GeneralResponse
  127. {
  128. public List<string> roles;
  129. }
  130. [Serializable]
  131. public class GeneralResponse
  132. {
  133. public string message;
  134. }
  135. [Serializable]
  136. public class IapItemSearchResponse : GeneralResponse
  137. {
  138. public int total;
  139. public List<IapItem> results;
  140. }
  141. [Serializable]
  142. public class IapItem
  143. {
  144. public string id;
  145. public string slug;
  146. public string name;
  147. public string masterItemSlug;
  148. public bool consumable = true;
  149. public string type = "IAP";
  150. public string status = "STAGE";
  151. public string ownerId;
  152. public string ownerType = "ORGANIZATION";
  153. public PriceSets priceSets;
  154. //public Locales locales;
  155. public Properties properties;
  156. // public string refresh_token;
  157. public int CheckValidation()
  158. {
  159. if (slug == null)
  160. {
  161. return -1;
  162. }
  163. if (name == null)
  164. {
  165. return -2;
  166. }
  167. if (masterItemSlug == null)
  168. {
  169. return -3;
  170. }
  171. if (priceSets == null || priceSets.PurchaseFee == null || priceSets.PurchaseFee.priceMap == null || priceSets.PurchaseFee.priceMap.DEFAULT.Count.Equals(0))
  172. {
  173. return -4;
  174. }
  175. if (properties == null || string.IsNullOrEmpty(properties.description))
  176. {
  177. return -6;
  178. }
  179. return 0;
  180. }
  181. }
  182. [Serializable]
  183. public class PriceSets
  184. {
  185. public PurchaseFee PurchaseFee;
  186. }
  187. [Serializable]
  188. public class PurchaseFee
  189. {
  190. public string priceType;
  191. public PriceMap priceMap;
  192. }
  193. [Serializable]
  194. public class PriceMap
  195. {
  196. public List<PriceDetail> DEFAULT;
  197. }
  198. [Serializable]
  199. public class PriceDetail
  200. {
  201. public string price;
  202. public string currency;
  203. }
  204. [Serializable]
  205. public class Locales
  206. {
  207. public Locale thisShouldBeENHyphenUS;
  208. public Locale thisShouldBeZHHyphenCN;
  209. }
  210. [Serializable]
  211. public class Locale
  212. {
  213. public string name;
  214. public string shortDescription;
  215. public string longDescription;
  216. }
  217. [Serializable]
  218. public class Player
  219. {
  220. public string email;
  221. public string password;
  222. public string clientId;
  223. }
  224. [Serializable]
  225. public class PlayerChangePasswordRequest
  226. {
  227. public string password;
  228. public string playerId;
  229. }
  230. [Serializable]
  231. public class PlayerResponse : GeneralResponse
  232. {
  233. public string nickName;
  234. public string id;
  235. }
  236. [Serializable]
  237. public class PlayerResponseWrapper : GeneralResponse
  238. {
  239. public int total;
  240. public PlayerResponse[] results;
  241. }
  242. [Serializable]
  243. public class AppItem
  244. {
  245. public string id;
  246. public string type;
  247. public string slug;
  248. public string name;
  249. public string status;
  250. public string ownerId;
  251. public string ownerType;
  252. public string clientId;
  253. public string packageName;
  254. public string revision;
  255. }
  256. [Serializable]
  257. public class Properties
  258. {
  259. public string description;
  260. }
  261. [Serializable]
  262. public class AppItemResponse : GeneralResponse
  263. {
  264. public string slug;
  265. public string name;
  266. public string id;
  267. public string status;
  268. public string type;
  269. public string ownerId;
  270. public string ownerType;
  271. public string clientId;
  272. public string packageName;
  273. public string revision;
  274. }
  275. [Serializable]
  276. public class AppItemResponseWrapper : GeneralResponse
  277. {
  278. public int total;
  279. public AppItemResponse[] results;
  280. }
  281. [Serializable]
  282. public class AppItemPublishResponse : GeneralResponse
  283. {
  284. public string revision;
  285. }
  286. [Serializable]
  287. public class PlayerVerifiedResponse : GeneralResponse
  288. {
  289. }
  290. [Serializable]
  291. public class PlayerDeleteResponse : GeneralResponse
  292. {
  293. }
  294. [Serializable]
  295. public class IapItemDeleteResponse : GeneralResponse
  296. {
  297. }
  298. [Serializable]
  299. public class ErrorResponse : GeneralResponse
  300. {
  301. public string code;
  302. public ErrorDetail[] details;
  303. }
  304. [Serializable]
  305. public class ErrorDetail
  306. {
  307. public string field;
  308. public string reason;
  309. }
  310. [Serializable]
  311. public class PlayerChangePasswordResponse : GeneralResponse
  312. {
  313. }
  314. }