-
Notifications
You must be signed in to change notification settings - Fork 0
/
PublicQueryItems.cs
411 lines (303 loc) · 14.1 KB
/
PublicQueryItems.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
// Copyright (c) 2022 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
// This code is generated by tool. DO NOT EDIT.
using System.Net;
using System.IO;
using System.Text.Json;
using AccelByte.Sdk.Api.Platform.Model;
using AccelByte.Sdk.Core;
using AccelByte.Sdk.Core.Util;
namespace AccelByte.Sdk.Api.Platform.Operation
{
/// <summary>
/// publicQueryItems
///
/// This API is used to query items by criteria within a store. If item not exist in specific region, default region item will return.
///
/// Other detail info:
///
/// * Optional permission : resource="PREVIEW", action=1(CREATE) (user with this permission can view draft store item)
/// * Optional permission : resource="SANDBOX", action=1(CREATE) (user with this permission can view draft store item)
/// * Returns : the list of items
/// </summary>
public class PublicQueryItems : AccelByte.Sdk.Core.Operation
{
#region Builder Part
public static PublicQueryItemsBuilder Builder { get => new PublicQueryItemsBuilder(); }
public class PublicQueryItemsBuilder
: OperationBuilder<PublicQueryItemsBuilder>
{
public PublicQueryItemsAppType? AppType { get; set; }
public bool? AutoCalcEstimatedPrice { get; set; }
public string? BaseAppId { get; set; }
public string? CategoryPath { get; set; }
public string? Features { get; set; }
public bool? IncludeSubCategoryItem { get; set; }
public PublicQueryItemsItemType? ItemType { get; set; }
public string? Language { get; set; }
public int? Limit { get; set; }
public int? Offset { get; set; }
public string? Region { get; set; }
public List<PublicQueryItemsSortBy>? SortBy { get; set; }
public string? StoreId { get; set; }
public string? Tags { get; set; }
internal PublicQueryItemsBuilder() { }
public PublicQueryItemsBuilder SetAppType(PublicQueryItemsAppType _appType)
{
AppType = _appType;
return this;
}
public PublicQueryItemsBuilder SetAutoCalcEstimatedPrice(bool _autoCalcEstimatedPrice)
{
AutoCalcEstimatedPrice = _autoCalcEstimatedPrice;
return this;
}
public PublicQueryItemsBuilder SetBaseAppId(string _baseAppId)
{
BaseAppId = _baseAppId;
return this;
}
public PublicQueryItemsBuilder SetCategoryPath(string _categoryPath)
{
CategoryPath = _categoryPath;
return this;
}
public PublicQueryItemsBuilder SetFeatures(string _features)
{
Features = _features;
return this;
}
public PublicQueryItemsBuilder SetIncludeSubCategoryItem(bool _includeSubCategoryItem)
{
IncludeSubCategoryItem = _includeSubCategoryItem;
return this;
}
public PublicQueryItemsBuilder SetItemType(PublicQueryItemsItemType _itemType)
{
ItemType = _itemType;
return this;
}
public PublicQueryItemsBuilder SetLanguage(string _language)
{
Language = _language;
return this;
}
public PublicQueryItemsBuilder SetLimit(int _limit)
{
Limit = _limit;
return this;
}
public PublicQueryItemsBuilder SetOffset(int _offset)
{
Offset = _offset;
return this;
}
public PublicQueryItemsBuilder SetRegion(string _region)
{
Region = _region;
return this;
}
public PublicQueryItemsBuilder SetSortBy(List<PublicQueryItemsSortBy> _sortBy)
{
SortBy = _sortBy;
return this;
}
public PublicQueryItemsBuilder SetStoreId(string _storeId)
{
StoreId = _storeId;
return this;
}
public PublicQueryItemsBuilder SetTags(string _tags)
{
Tags = _tags;
return this;
}
public PublicQueryItems Build(
string namespace_
)
{
PublicQueryItems op = new PublicQueryItems(this,
namespace_
);
op.PreferredSecurityMethod = PreferredSecurityMethod;
op.RequestJsonOptions = RequestJsonOptions;
op.ResponseJsonOptions = ResponseJsonOptions;
op.FlightId = FlightId;
return op;
}
}
private PublicQueryItems(PublicQueryItemsBuilder builder,
string namespace_
)
{
PathParams["namespace"] = namespace_;
if (builder.AppType is not null) QueryParams["appType"] = builder.AppType.Value;
if (builder.AutoCalcEstimatedPrice != null) QueryParams["autoCalcEstimatedPrice"] = Convert.ToString(builder.AutoCalcEstimatedPrice)!;
if (builder.BaseAppId is not null) QueryParams["baseAppId"] = builder.BaseAppId;
if (builder.CategoryPath is not null) QueryParams["categoryPath"] = builder.CategoryPath;
if (builder.Features is not null) QueryParams["features"] = builder.Features;
if (builder.IncludeSubCategoryItem != null) QueryParams["includeSubCategoryItem"] = Convert.ToString(builder.IncludeSubCategoryItem)!;
if (builder.ItemType is not null) QueryParams["itemType"] = builder.ItemType.Value;
if (builder.Language is not null) QueryParams["language"] = builder.Language;
if (builder.Limit != null) QueryParams["limit"] = Convert.ToString(builder.Limit)!;
if (builder.Offset != null) QueryParams["offset"] = Convert.ToString(builder.Offset)!;
if (builder.Region is not null) QueryParams["region"] = builder.Region;
if (builder.SortBy is not null) QueryParams["sortBy"] = builder.SortBy;
if (builder.StoreId is not null) QueryParams["storeId"] = builder.StoreId;
if (builder.Tags is not null) QueryParams["tags"] = builder.Tags;
CollectionFormatMap["sortBy"] = "csv";
Securities.Add(AccelByte.Sdk.Core.Operation.SECURITY_BEARER);
}
#endregion
public PublicQueryItems(
string namespace_,
PublicQueryItemsAppType? appType,
bool? autoCalcEstimatedPrice,
string? baseAppId,
string? categoryPath,
string? features,
bool? includeSubCategoryItem,
PublicQueryItemsItemType? itemType,
string? language,
int? limit,
int? offset,
string? region,
List<PublicQueryItemsSortBy>? sortBy,
string? storeId,
string? tags
)
{
PathParams["namespace"] = namespace_;
if (appType is not null) QueryParams["appType"] = appType.Value;
if (autoCalcEstimatedPrice != null) QueryParams["autoCalcEstimatedPrice"] = Convert.ToString(autoCalcEstimatedPrice)!;
if (baseAppId is not null) QueryParams["baseAppId"] = baseAppId;
if (categoryPath is not null) QueryParams["categoryPath"] = categoryPath;
if (features is not null) QueryParams["features"] = features;
if (includeSubCategoryItem != null) QueryParams["includeSubCategoryItem"] = Convert.ToString(includeSubCategoryItem)!;
if (itemType is not null) QueryParams["itemType"] = itemType.Value;
if (language is not null) QueryParams["language"] = language;
if (limit != null) QueryParams["limit"] = Convert.ToString(limit)!;
if (offset != null) QueryParams["offset"] = Convert.ToString(offset)!;
if (region is not null) QueryParams["region"] = region;
if (sortBy is not null) QueryParams["sortBy"] = sortBy;
if (storeId is not null) QueryParams["storeId"] = storeId;
if (tags is not null) QueryParams["tags"] = tags;
CollectionFormatMap["sortBy"] = "csv";
Securities.Add(AccelByte.Sdk.Core.Operation.SECURITY_BEARER);
}
public override string Path => "/platform/public/namespaces/{namespace}/items/byCriteria";
public override HttpMethod Method => HttpMethod.Get;
public override string[] Consumes => new string[] { };
public override string[] Produces => new string[] { "application/json" };
[Obsolete("2022-04-19 - Use 'Securities' property instead.")]
public override string? Security { get; set; } = "Bearer";
public Model.ItemPagingSlicedResult? ParseResponse(HttpStatusCode code, string contentType, Stream payload)
{
if (code == (HttpStatusCode)204)
{
return null;
}
else if (code == (HttpStatusCode)201)
{
if (ResponseJsonOptions != null)
return JsonSerializer.Deserialize<Model.ItemPagingSlicedResult>(payload, ResponseJsonOptions);
else
return JsonSerializer.Deserialize<Model.ItemPagingSlicedResult>(payload);
}
else if (code == (HttpStatusCode)200)
{
return JsonSerializer.Deserialize<Model.ItemPagingSlicedResult>(payload, ResponseJsonOptions);
}
var payloadString = Helper.ConvertInputStreamToString(payload);
throw new HttpResponseException(code, payloadString);
}
}
public class PublicQueryItemsAppType : StringEnum<PublicQueryItemsAppType>
{
public static readonly PublicQueryItemsAppType DEMO
= new PublicQueryItemsAppType("DEMO");
public static readonly PublicQueryItemsAppType DLC
= new PublicQueryItemsAppType("DLC");
public static readonly PublicQueryItemsAppType GAME
= new PublicQueryItemsAppType("GAME");
public static readonly PublicQueryItemsAppType SOFTWARE
= new PublicQueryItemsAppType("SOFTWARE");
public static implicit operator PublicQueryItemsAppType(string value)
{
return NewValue(value);
}
public PublicQueryItemsAppType(string enumValue)
: base(enumValue)
{
}
}
public class PublicQueryItemsItemType : StringEnum<PublicQueryItemsItemType>
{
public static readonly PublicQueryItemsItemType APP
= new PublicQueryItemsItemType("APP");
public static readonly PublicQueryItemsItemType BUNDLE
= new PublicQueryItemsItemType("BUNDLE");
public static readonly PublicQueryItemsItemType CODE
= new PublicQueryItemsItemType("CODE");
public static readonly PublicQueryItemsItemType COINS
= new PublicQueryItemsItemType("COINS");
public static readonly PublicQueryItemsItemType EXTENSION
= new PublicQueryItemsItemType("EXTENSION");
public static readonly PublicQueryItemsItemType INGAMEITEM
= new PublicQueryItemsItemType("INGAMEITEM");
public static readonly PublicQueryItemsItemType LOOTBOX
= new PublicQueryItemsItemType("LOOTBOX");
public static readonly PublicQueryItemsItemType MEDIA
= new PublicQueryItemsItemType("MEDIA");
public static readonly PublicQueryItemsItemType OPTIONBOX
= new PublicQueryItemsItemType("OPTIONBOX");
public static readonly PublicQueryItemsItemType SEASON
= new PublicQueryItemsItemType("SEASON");
public static readonly PublicQueryItemsItemType SUBSCRIPTION
= new PublicQueryItemsItemType("SUBSCRIPTION");
public static implicit operator PublicQueryItemsItemType(string value)
{
return NewValue(value);
}
public PublicQueryItemsItemType(string enumValue)
: base(enumValue)
{
}
}
public class PublicQueryItemsSortBy : StringEnum<PublicQueryItemsSortBy>
{
public static readonly PublicQueryItemsSortBy Name
= new PublicQueryItemsSortBy("name");
public static readonly PublicQueryItemsSortBy Nameasc
= new PublicQueryItemsSortBy("name:asc");
public static readonly PublicQueryItemsSortBy Namedesc
= new PublicQueryItemsSortBy("name:desc");
public static readonly PublicQueryItemsSortBy CreatedAt
= new PublicQueryItemsSortBy("createdAt");
public static readonly PublicQueryItemsSortBy CreatedAtasc
= new PublicQueryItemsSortBy("createdAt:asc");
public static readonly PublicQueryItemsSortBy CreatedAtdesc
= new PublicQueryItemsSortBy("createdAt:desc");
public static readonly PublicQueryItemsSortBy UpdatedAt
= new PublicQueryItemsSortBy("updatedAt");
public static readonly PublicQueryItemsSortBy UpdatedAtasc
= new PublicQueryItemsSortBy("updatedAt:asc");
public static readonly PublicQueryItemsSortBy UpdatedAtdesc
= new PublicQueryItemsSortBy("updatedAt:desc");
public static readonly PublicQueryItemsSortBy DisplayOrder
= new PublicQueryItemsSortBy("displayOrder");
public static readonly PublicQueryItemsSortBy DisplayOrderasc
= new PublicQueryItemsSortBy("displayOrder:asc");
public static readonly PublicQueryItemsSortBy DisplayOrderdesc
= new PublicQueryItemsSortBy("displayOrder:desc");
public static implicit operator PublicQueryItemsSortBy(string value)
{
return NewValue(value);
}
public PublicQueryItemsSortBy(string enumValue)
: base(enumValue)
{
}
}
}