Skip to content

Commit 1ac313b

Browse files
Erik Bylundkirre-bylund
authored andcommitted
Document fields for entitlement history
1 parent a7b0441 commit 1ac313b

File tree

3 files changed

+97
-63
lines changed

3 files changed

+97
-63
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5560,9 +5560,9 @@ public static void ListEntitlements(int count, string after, Action<LootLockerEn
55605560
if(count > 0 || !string.IsNullOrEmpty(after))
55615561
endpoint += endpoint.Contains("?") ? "&" : "?";
55625562
if (count > 0)
5563-
endpoint += $"count={count}&";
5563+
endpoint += $"per_page={count}&";
55645564
if (!string.IsNullOrEmpty(after))
5565-
endpoint += $"after={after}&";
5565+
endpoint += $"cursor={after}&";
55665566

55675567
LootLockerServerRequest.CallAPI(endpoint, LootLockerEndPoints.listEntitlementHistory.httpMethod, onComplete: (serverResponse) => { LootLockerResponse.Deserialize(onComplete, serverResponse); });
55685568
}

Runtime/Game/Requests/CatalogRequests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public class LootLockerAssetDetails
205205
/// </summary>
206206
public int legacy_id { get; set; }
207207
/// <summary>
208-
/// The unique identyfing id of this asset.
208+
/// The unique identifying id of this asset
209209
/// </summary>
210210
public string id { get; set; }
211211
/// <summary>
Lines changed: 94 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
1-
namespace LootLocker.Requests
1+
using LootLocker.LootLockerEnums;
2+
3+
namespace LootLocker.LootLockerEnums
4+
{
5+
/// <summary>
6+
/// An enum with the supported stores that can generate entitlements
7+
/// </summary>
8+
public enum LootLockerEntitlementHistoryListingStore
9+
{
10+
None = 0,
11+
Apple_app_store = 1,
12+
Google_play_store = 2,
13+
Steam_store = 3,
14+
Playstation_network = 4,
15+
Nintendo_eshop = 5,
16+
Lootlocker = 6
17+
};
18+
19+
/// <summary>
20+
/// Status of the entitlement
21+
/// </summary>
22+
public enum LootLockerEntitlementHistoryListingStatus
23+
{
24+
None = 0,
25+
Active = 1,
26+
Pending = 2,
27+
Expired = 3,
28+
Canceled = 4,
29+
Refunded = 5
30+
};
31+
32+
/// <summary>
33+
/// Status of the entitlement
34+
/// </summary>
35+
public enum LootLockerEntitlementHistoryListingType
36+
{
37+
Undefined = 0,
38+
One_time_purchase = 1,
39+
Leaderboard_reward = 2,
40+
Subscription = 3
41+
};
42+
}
43+
44+
namespace LootLocker.Requests
245
{
346
//==================================================
447
// Data Definitions
@@ -10,34 +53,34 @@ public class LootLockerEntitlementHistoryItem
1053
{
1154

1255
/// <summary>
13-
/// TODO: Document
56+
/// When this item was created
1457
/// </summary>
15-
public string created_at { get; set; }
58+
public string Created_at { get; set; }
1659

1760
/// <summary>
18-
/// TODO: Document
61+
/// What kind of reward this item is
1962
/// </summary>
20-
public string reward_kind { get; set; }
63+
public string Reward_kind { get; set; }
2164

2265
/// <summary>
23-
/// TODO: Document
66+
/// The unique identifier of this specific item
2467
/// </summary>
25-
public string id { get; set; }
68+
public string Id { get; set; }
2669

2770
/// <summary>
28-
/// TODO: Document
71+
/// The id of the reward this item is in
2972
/// </summary>
30-
public string reward_id { get; set; }
73+
public string Reward_id { get; set; }
3174

3275
/// <summary>
33-
/// TODO: Document
76+
/// The id of the catalog item that this item is in
3477
/// </summary>
35-
public string catalog_id { get; set; }
78+
public string Catalog_id { get; set; }
3679

3780
/// <summary>
38-
/// TODO: Document
81+
/// Whether this item is purchasable
3982
/// </summary>
40-
public bool purchasable { get; set; }
83+
public bool Purchasable { get; set; }
4184
}
4285

4386
/// <summary>
@@ -46,14 +89,14 @@ public class LootLockerEntitlementHistoryMetadata
4689
{
4790

4891
/// <summary>
49-
/// TODO: Document
92+
/// The key of this pair, describes what the value is
5093
/// </summary>
51-
public string key { get; set; }
94+
public string Key { get; set; }
5295

5396
/// <summary>
54-
/// TODO: Document
97+
/// The value of this pair, contains the information of the metadata
5598
/// </summary>
56-
public string value { get; set; }
99+
public string Value { get; set; }
57100
}
58101

59102
/// <summary>
@@ -62,24 +105,19 @@ public class LootLockerEntitlementHistoryReward
62105
{
63106

64107
/// <summary>
65-
/// TODO: Document
66-
/// </summary>
67-
public string created_at { get; set; }
68-
69-
/// <summary>
70-
/// TODO: Document
108+
/// When this reward was created
71109
/// </summary>
72-
public string entitlement_id { get; set; }
110+
public string Created_at { get; set; }
73111

74112
/// <summary>
75-
/// TODO: Document
113+
/// The id of this entitlement
76114
/// </summary>
77-
public string id { get; set; }
115+
public string Entitlement_id { get; set; }
78116

79117
/// <summary>
80-
/// TODO: Document
118+
/// The unique identifier of this reward
81119
/// </summary>
82-
public string reward_id { get; set; }
120+
public string Id { get; set; }
83121
}
84122

85123
//==================================================
@@ -92,14 +130,14 @@ public class LootLockerEntitlementHistoryResponse : LootLockerResponse
92130
{
93131

94132
/// <summary>
95-
/// TODO: Document
133+
/// List of entitlement history entries
96134
/// </summary>
97-
public LootLockerEntitlementListing[] listings { get; set; }
98-
135+
public LootLockerEntitlementListing[] Listings { get; set; }
136+
99137
/// <summary>
100-
/// TODO: Document
138+
/// Pagination data to use for subsequent requests
101139
/// </summary>
102-
public LootLockerPaginationResponse<string> pagination { get; set; }
140+
public LootLockerPaginationResponse<string> Pagination { get; set; }
103141
}
104142

105143
/// <summary>
@@ -108,48 +146,44 @@ public class LootLockerEntitlementListing
108146
{
109147

110148
/// <summary>
111-
/// TODO: Document
112-
/// </summary>
113-
public string created_at { get; set; }
114-
115-
/// <summary>
116-
/// TODO: Document
149+
/// When this entitlement listing was created
117150
/// </summary>
118-
public string id { get; set; }
151+
public string Created_at { get; set; }
119152

120153
/// <summary>
121-
/// TODO: Document
154+
/// The unique identifier of this entitlement listing
122155
/// </summary>
123-
public LootLockerEntitlementHistoryItem[] items { get; set; }
124-
156+
public string Id { get; set; }
157+
125158
/// <summary>
126-
/// TODO: Document
159+
/// List of items in this entitlement (items are related to the catalog)
127160
/// </summary>
128-
public LootLockerEntitlementHistoryMetadata[] metadata { get; set; }
129-
161+
public LootLockerEntitlementHistoryItem[] Items { get; set; }
162+
130163
/// <summary>
131-
/// TODO: Document
164+
/// List of rewards in this entitlement (these are rewards from systems such as leaderboards, progressions, etc.)
132165
/// </summary>
133-
public string player_id { get; set; }
134-
166+
public LootLockerEntitlementHistoryReward[] Rewards { get; set; }
167+
135168
/// <summary>
136-
/// TODO: Document
169+
/// Metadata related to this entitlement listing
170+
/// This array consists of key value pairs and contains various pieces of information about the entitlement, such as information from third party stores etc.
137171
/// </summary>
138-
public LootLockerEntitlementHistoryReward[] rewards { get; set; }
139-
172+
public LootLockerEntitlementHistoryMetadata[] Metadata { get; set; }
173+
140174
/// <summary>
141-
/// TODO: Document
175+
/// The status of this entitlement listing
142176
/// </summary>
143-
public string status { get; set; }
144-
177+
public LootLockerEntitlementHistoryListingStatus Status { get; set; } = LootLockerEntitlementHistoryListingStatus.None;
178+
145179
/// <summary>
146-
/// TODO: Document
180+
/// Which store (if any) that this entitlement listing relates to
147181
/// </summary>
148-
public string store { get; set; }
149-
182+
public LootLockerEntitlementHistoryListingStore Store { get; set; } = LootLockerEntitlementHistoryListingStore.None;
183+
150184
/// <summary>
151-
/// TODO: Document
185+
/// Which type this entitlement listing is
152186
/// </summary>
153-
public string type { get; set; }
187+
public LootLockerEntitlementHistoryListingType Type { get; set; } = LootLockerEntitlementHistoryListingType.Undefined;
154188
}
155189
}

0 commit comments

Comments
 (0)