gs2 1.3.147 → 1.3.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/showcase/model/PurchaseCount.d.ts +17 -0
- package/showcase/model/PurchaseCount.js +62 -0
- package/showcase/model/PurchaseCount.js.map +1 -0
- package/showcase/model/PurchaseCount.ts +60 -0
- package/showcase/model/RandomDisplayItem.d.ts +39 -0
- package/showcase/model/RandomDisplayItem.js +147 -0
- package/showcase/model/RandomDisplayItem.js.map +1 -0
- package/showcase/model/RandomDisplayItem.ts +148 -0
- package/showcase/model/RandomDisplayItemModel.d.ts +35 -0
- package/showcase/model/RandomDisplayItemModel.js +133 -0
- package/showcase/model/RandomDisplayItemModel.js.map +1 -0
- package/showcase/model/RandomDisplayItemModel.ts +134 -0
- package/showcase/model/RandomShowcase.d.ts +48 -0
- package/showcase/model/RandomShowcase.js +221 -0
- package/showcase/model/RandomShowcase.js.map +1 -0
- package/showcase/model/RandomShowcase.ts +237 -0
- package/showcase/model/RandomShowcaseMaster.d.ts +60 -0
- package/showcase/model/RandomShowcaseMaster.js +263 -0
- package/showcase/model/RandomShowcaseMaster.js.map +1 -0
- package/showcase/model/RandomShowcaseMaster.ts +279 -0
- package/showcase/model/index.d.ts +6 -1
- package/showcase/model/index.js +11 -1
- package/showcase/model/index.js.map +1 -1
- package/showcase/model/index.ts +10 -0
- package/showcase/request/CreateRandomShowcaseMasterRequest.d.ts +54 -0
- package/showcase/request/CreateRandomShowcaseMasterRequest.js +189 -0
- package/showcase/request/CreateRandomShowcaseMasterRequest.js.map +1 -0
- package/showcase/request/CreateRandomShowcaseMasterRequest.ts +196 -0
- package/showcase/request/DeleteRandomShowcaseMasterRequest.d.ts +25 -0
- package/showcase/request/DeleteRandomShowcaseMasterRequest.js +83 -0
- package/showcase/request/DeleteRandomShowcaseMasterRequest.js.map +1 -0
- package/showcase/request/DeleteRandomShowcaseMasterRequest.ts +90 -0
- package/showcase/request/DescribeRandomShowcaseMastersRequest.d.ts +29 -0
- package/showcase/request/DescribeRandomShowcaseMastersRequest.js +97 -0
- package/showcase/request/DescribeRandomShowcaseMastersRequest.js.map +1 -0
- package/showcase/request/DescribeRandomShowcaseMastersRequest.ts +104 -0
- package/showcase/request/DescribeRandomShowcaseSalesItemsByUserIdRequest.d.ts +29 -0
- package/showcase/request/DescribeRandomShowcaseSalesItemsByUserIdRequest.js +97 -0
- package/showcase/request/DescribeRandomShowcaseSalesItemsByUserIdRequest.js.map +1 -0
- package/showcase/request/DescribeRandomShowcaseSalesItemsByUserIdRequest.ts +104 -0
- package/showcase/request/DescribeRandomShowcaseSalesItemsRequest.d.ts +29 -0
- package/showcase/request/DescribeRandomShowcaseSalesItemsRequest.js +97 -0
- package/showcase/request/DescribeRandomShowcaseSalesItemsRequest.js.map +1 -0
- package/showcase/request/DescribeRandomShowcaseSalesItemsRequest.ts +104 -0
- package/showcase/request/ForceReDrawByUserIdByStampSheetRequest.d.ts +25 -0
- package/showcase/request/ForceReDrawByUserIdByStampSheetRequest.js +83 -0
- package/showcase/request/ForceReDrawByUserIdByStampSheetRequest.js.map +1 -0
- package/showcase/request/ForceReDrawByUserIdByStampSheetRequest.ts +90 -0
- package/showcase/request/ForceReDrawByUserIdRequest.d.ts +33 -0
- package/showcase/request/ForceReDrawByUserIdRequest.js +109 -0
- package/showcase/request/ForceReDrawByUserIdRequest.js.map +1 -0
- package/showcase/request/ForceReDrawByUserIdRequest.ts +119 -0
- package/showcase/request/GetRandomShowcaseMasterRequest.d.ts +25 -0
- package/showcase/request/GetRandomShowcaseMasterRequest.js +83 -0
- package/showcase/request/GetRandomShowcaseMasterRequest.js.map +1 -0
- package/showcase/request/GetRandomShowcaseMasterRequest.ts +90 -0
- package/showcase/request/GetRandomShowcaseSalesItemByUserIdRequest.d.ts +33 -0
- package/showcase/request/GetRandomShowcaseSalesItemByUserIdRequest.js +111 -0
- package/showcase/request/GetRandomShowcaseSalesItemByUserIdRequest.js.map +1 -0
- package/showcase/request/GetRandomShowcaseSalesItemByUserIdRequest.ts +118 -0
- package/showcase/request/GetRandomShowcaseSalesItemRequest.d.ts +33 -0
- package/showcase/request/GetRandomShowcaseSalesItemRequest.js +111 -0
- package/showcase/request/GetRandomShowcaseSalesItemRequest.js.map +1 -0
- package/showcase/request/GetRandomShowcaseSalesItemRequest.ts +118 -0
- package/showcase/request/IncrementPurchaseCountByStampTaskRequest.d.ts +25 -0
- package/showcase/request/IncrementPurchaseCountByStampTaskRequest.js +83 -0
- package/showcase/request/IncrementPurchaseCountByStampTaskRequest.js.map +1 -0
- package/showcase/request/IncrementPurchaseCountByStampTaskRequest.ts +90 -0
- package/showcase/request/IncrementPurchaseCountByUserIdRequest.d.ts +41 -0
- package/showcase/request/IncrementPurchaseCountByUserIdRequest.js +137 -0
- package/showcase/request/IncrementPurchaseCountByUserIdRequest.js.map +1 -0
- package/showcase/request/IncrementPurchaseCountByUserIdRequest.ts +147 -0
- package/showcase/request/RandomShowcaseBuyByUserIdRequest.d.ts +46 -0
- package/showcase/request/RandomShowcaseBuyByUserIdRequest.js +159 -0
- package/showcase/request/RandomShowcaseBuyByUserIdRequest.js.map +1 -0
- package/showcase/request/RandomShowcaseBuyByUserIdRequest.ts +169 -0
- package/showcase/request/RandomShowcaseBuyRequest.d.ts +46 -0
- package/showcase/request/RandomShowcaseBuyRequest.js +159 -0
- package/showcase/request/RandomShowcaseBuyRequest.js.map +1 -0
- package/showcase/request/RandomShowcaseBuyRequest.ts +169 -0
- package/showcase/request/UpdateRandomShowcaseMasterRequest.d.ts +54 -0
- package/showcase/request/UpdateRandomShowcaseMasterRequest.js +189 -0
- package/showcase/request/UpdateRandomShowcaseMasterRequest.js.map +1 -0
- package/showcase/request/UpdateRandomShowcaseMasterRequest.ts +196 -0
- package/showcase/request/index.d.ts +16 -1
- package/showcase/request/index.js +31 -1
- package/showcase/request/index.js.map +1 -1
- package/showcase/request/index.ts +30 -0
- package/showcase/rest.d.ts +15 -0
- package/showcase/rest.js +424 -0
- package/showcase/rest.js.map +1 -1
- package/showcase/rest.ts +484 -0
- package/showcase/result/CreateRandomShowcaseMasterResult.d.ts +14 -0
- package/showcase/result/CreateRandomShowcaseMasterResult.js +48 -0
- package/showcase/result/CreateRandomShowcaseMasterResult.js.map +1 -0
- package/showcase/result/CreateRandomShowcaseMasterResult.ts +48 -0
- package/showcase/result/DeleteRandomShowcaseMasterResult.d.ts +14 -0
- package/showcase/result/DeleteRandomShowcaseMasterResult.js +48 -0
- package/showcase/result/DeleteRandomShowcaseMasterResult.js.map +1 -0
- package/showcase/result/DeleteRandomShowcaseMasterResult.ts +48 -0
- package/showcase/result/DescribeRandomShowcaseMastersResult.d.ts +18 -0
- package/showcase/result/DescribeRandomShowcaseMastersResult.js +67 -0
- package/showcase/result/DescribeRandomShowcaseMastersResult.js.map +1 -0
- package/showcase/result/DescribeRandomShowcaseMastersResult.ts +73 -0
- package/showcase/result/DescribeRandomShowcaseSalesItemsByUserIdResult.d.ts +14 -0
- package/showcase/result/DescribeRandomShowcaseSalesItemsByUserIdResult.js +53 -0
- package/showcase/result/DescribeRandomShowcaseSalesItemsByUserIdResult.js.map +1 -0
- package/showcase/result/DescribeRandomShowcaseSalesItemsByUserIdResult.ts +56 -0
- package/showcase/result/DescribeRandomShowcaseSalesItemsResult.d.ts +14 -0
- package/showcase/result/DescribeRandomShowcaseSalesItemsResult.js +53 -0
- package/showcase/result/DescribeRandomShowcaseSalesItemsResult.js.map +1 -0
- package/showcase/result/DescribeRandomShowcaseSalesItemsResult.ts +56 -0
- package/showcase/result/ForceReDrawByUserIdByStampSheetResult.d.ts +14 -0
- package/showcase/result/ForceReDrawByUserIdByStampSheetResult.js +53 -0
- package/showcase/result/ForceReDrawByUserIdByStampSheetResult.js.map +1 -0
- package/showcase/result/ForceReDrawByUserIdByStampSheetResult.ts +56 -0
- package/showcase/result/ForceReDrawByUserIdResult.d.ts +14 -0
- package/showcase/result/ForceReDrawByUserIdResult.js +53 -0
- package/showcase/result/ForceReDrawByUserIdResult.js.map +1 -0
- package/showcase/result/ForceReDrawByUserIdResult.ts +56 -0
- package/showcase/result/GetRandomShowcaseMasterResult.d.ts +14 -0
- package/showcase/result/GetRandomShowcaseMasterResult.js +48 -0
- package/showcase/result/GetRandomShowcaseMasterResult.js.map +1 -0
- package/showcase/result/GetRandomShowcaseMasterResult.ts +48 -0
- package/showcase/result/GetRandomShowcaseSalesItemByUserIdResult.d.ts +14 -0
- package/showcase/result/GetRandomShowcaseSalesItemByUserIdResult.js +48 -0
- package/showcase/result/GetRandomShowcaseSalesItemByUserIdResult.js.map +1 -0
- package/showcase/result/GetRandomShowcaseSalesItemByUserIdResult.ts +48 -0
- package/showcase/result/GetRandomShowcaseSalesItemResult.d.ts +14 -0
- package/showcase/result/GetRandomShowcaseSalesItemResult.js +48 -0
- package/showcase/result/GetRandomShowcaseSalesItemResult.js.map +1 -0
- package/showcase/result/GetRandomShowcaseSalesItemResult.ts +48 -0
- package/showcase/result/IncrementPurchaseCountByStampTaskResult.d.ts +18 -0
- package/showcase/result/IncrementPurchaseCountByStampTaskResult.js +62 -0
- package/showcase/result/IncrementPurchaseCountByStampTaskResult.js.map +1 -0
- package/showcase/result/IncrementPurchaseCountByStampTaskResult.ts +65 -0
- package/showcase/result/IncrementPurchaseCountByUserIdResult.d.ts +14 -0
- package/showcase/result/IncrementPurchaseCountByUserIdResult.js +48 -0
- package/showcase/result/IncrementPurchaseCountByUserIdResult.js.map +1 -0
- package/showcase/result/IncrementPurchaseCountByUserIdResult.ts +48 -0
- package/showcase/result/RandomShowcaseBuyByUserIdResult.d.ts +30 -0
- package/showcase/result/RandomShowcaseBuyByUserIdResult.js +104 -0
- package/showcase/result/RandomShowcaseBuyByUserIdResult.js.map +1 -0
- package/showcase/result/RandomShowcaseBuyByUserIdResult.ts +116 -0
- package/showcase/result/RandomShowcaseBuyResult.d.ts +30 -0
- package/showcase/result/RandomShowcaseBuyResult.js +104 -0
- package/showcase/result/RandomShowcaseBuyResult.js.map +1 -0
- package/showcase/result/RandomShowcaseBuyResult.ts +116 -0
- package/showcase/result/UpdateRandomShowcaseMasterResult.d.ts +14 -0
- package/showcase/result/UpdateRandomShowcaseMasterResult.js +48 -0
- package/showcase/result/UpdateRandomShowcaseMasterResult.js.map +1 -0
- package/showcase/result/UpdateRandomShowcaseMasterResult.ts +48 -0
- package/showcase/result/index.d.ts +16 -1
- package/showcase/result/index.js +31 -1
- package/showcase/result/index.js.map +1 -1
- package/showcase/result/index.ts +30 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
3
|
+
Reserved.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
6
|
+
You may not use this file except in compliance with the License.
|
|
7
|
+
A copy of the License is located at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
12
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
13
|
+
express or implied. See the License for the specific language governing
|
|
14
|
+
permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import IModel from '../../core/interface/IModel';
|
|
18
|
+
import ConsumeAction from './ConsumeAction';
|
|
19
|
+
import AcquireAction from './AcquireAction';
|
|
20
|
+
|
|
21
|
+
export default class RandomDisplayItemModel implements IModel {
|
|
22
|
+
private name: string|null = null;
|
|
23
|
+
private metadata: string|null = null;
|
|
24
|
+
private consumeActions: ConsumeAction[]|null = null;
|
|
25
|
+
private acquireActions: AcquireAction[]|null = null;
|
|
26
|
+
private stock: number|null = null;
|
|
27
|
+
private weight: number|null = null;
|
|
28
|
+
public getName(): string|null {
|
|
29
|
+
return this.name;
|
|
30
|
+
}
|
|
31
|
+
public setName(name: string|null) {
|
|
32
|
+
this.name = name;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
public withName(name: string|null): this {
|
|
36
|
+
this.name = name;
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
public getMetadata(): string|null {
|
|
40
|
+
return this.metadata;
|
|
41
|
+
}
|
|
42
|
+
public setMetadata(metadata: string|null) {
|
|
43
|
+
this.metadata = metadata;
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
public withMetadata(metadata: string|null): this {
|
|
47
|
+
this.metadata = metadata;
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
public getConsumeActions(): ConsumeAction[]|null {
|
|
51
|
+
return this.consumeActions;
|
|
52
|
+
}
|
|
53
|
+
public setConsumeActions(consumeActions: ConsumeAction[]|null) {
|
|
54
|
+
this.consumeActions = consumeActions;
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
public withConsumeActions(consumeActions: ConsumeAction[]|null): this {
|
|
58
|
+
this.consumeActions = consumeActions;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
public getAcquireActions(): AcquireAction[]|null {
|
|
62
|
+
return this.acquireActions;
|
|
63
|
+
}
|
|
64
|
+
public setAcquireActions(acquireActions: AcquireAction[]|null) {
|
|
65
|
+
this.acquireActions = acquireActions;
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
public withAcquireActions(acquireActions: AcquireAction[]|null): this {
|
|
69
|
+
this.acquireActions = acquireActions;
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
public getStock(): number|null {
|
|
73
|
+
return this.stock;
|
|
74
|
+
}
|
|
75
|
+
public setStock(stock: number|null) {
|
|
76
|
+
this.stock = stock;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
public withStock(stock: number|null): this {
|
|
80
|
+
this.stock = stock;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
public getWeight(): number|null {
|
|
84
|
+
return this.weight;
|
|
85
|
+
}
|
|
86
|
+
public setWeight(weight: number|null) {
|
|
87
|
+
this.weight = weight;
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
public withWeight(weight: number|null): this {
|
|
91
|
+
this.weight = weight;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public static fromDict(data: {[key: string]: any}): RandomDisplayItemModel|null {
|
|
96
|
+
if (data == undefined || data == null) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
return new RandomDisplayItemModel()
|
|
100
|
+
.withName(data["name"])
|
|
101
|
+
.withMetadata(data["metadata"])
|
|
102
|
+
.withConsumeActions(data.consumeActions ?
|
|
103
|
+
data.consumeActions.map((item: {[key: string]: any}) => {
|
|
104
|
+
return ConsumeAction.fromDict(item);
|
|
105
|
+
}
|
|
106
|
+
) : [])
|
|
107
|
+
.withAcquireActions(data.acquireActions ?
|
|
108
|
+
data.acquireActions.map((item: {[key: string]: any}) => {
|
|
109
|
+
return AcquireAction.fromDict(item);
|
|
110
|
+
}
|
|
111
|
+
) : [])
|
|
112
|
+
.withStock(data["stock"])
|
|
113
|
+
.withWeight(data["weight"]);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public toDict(): {[key: string]: any} {
|
|
117
|
+
return {
|
|
118
|
+
"name": this.getName(),
|
|
119
|
+
"metadata": this.getMetadata(),
|
|
120
|
+
"consumeActions": this.getConsumeActions() ?
|
|
121
|
+
this.getConsumeActions()!.map((item: ConsumeAction) => {
|
|
122
|
+
return item.toDict();
|
|
123
|
+
}
|
|
124
|
+
) : [],
|
|
125
|
+
"acquireActions": this.getAcquireActions() ?
|
|
126
|
+
this.getAcquireActions()!.map((item: AcquireAction) => {
|
|
127
|
+
return item.toDict();
|
|
128
|
+
}
|
|
129
|
+
) : [],
|
|
130
|
+
"stock": this.getStock(),
|
|
131
|
+
"weight": this.getWeight(),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import IModel from '../../core/interface/IModel';
|
|
2
|
+
import RandomDisplayItemModel from './RandomDisplayItemModel';
|
|
3
|
+
export default class RandomShowcase implements IModel {
|
|
4
|
+
private randomShowcaseId;
|
|
5
|
+
private name;
|
|
6
|
+
private metadata;
|
|
7
|
+
private maximumNumberOfChoice;
|
|
8
|
+
private displayItems;
|
|
9
|
+
private baseTimestamp;
|
|
10
|
+
private resetIntervalHours;
|
|
11
|
+
private salesPeriodEventId;
|
|
12
|
+
static getRegion(grn: string): string | null;
|
|
13
|
+
static getOwnerId(grn: string): string | null;
|
|
14
|
+
static getNamespaceName(grn: string): string | null;
|
|
15
|
+
static getShowcaseName(grn: string): string | null;
|
|
16
|
+
static isValid(grn: string): boolean;
|
|
17
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, showcaseName: string | null): string | null;
|
|
18
|
+
getRandomShowcaseId(): string | null;
|
|
19
|
+
setRandomShowcaseId(randomShowcaseId: string | null): this;
|
|
20
|
+
withRandomShowcaseId(randomShowcaseId: string | null): this;
|
|
21
|
+
getName(): string | null;
|
|
22
|
+
setName(name: string | null): this;
|
|
23
|
+
withName(name: string | null): this;
|
|
24
|
+
getMetadata(): string | null;
|
|
25
|
+
setMetadata(metadata: string | null): this;
|
|
26
|
+
withMetadata(metadata: string | null): this;
|
|
27
|
+
getMaximumNumberOfChoice(): number | null;
|
|
28
|
+
setMaximumNumberOfChoice(maximumNumberOfChoice: number | null): this;
|
|
29
|
+
withMaximumNumberOfChoice(maximumNumberOfChoice: number | null): this;
|
|
30
|
+
getDisplayItems(): RandomDisplayItemModel[] | null;
|
|
31
|
+
setDisplayItems(displayItems: RandomDisplayItemModel[] | null): this;
|
|
32
|
+
withDisplayItems(displayItems: RandomDisplayItemModel[] | null): this;
|
|
33
|
+
getBaseTimestamp(): number | null;
|
|
34
|
+
setBaseTimestamp(baseTimestamp: number | null): this;
|
|
35
|
+
withBaseTimestamp(baseTimestamp: number | null): this;
|
|
36
|
+
getResetIntervalHours(): number | null;
|
|
37
|
+
setResetIntervalHours(resetIntervalHours: number | null): this;
|
|
38
|
+
withResetIntervalHours(resetIntervalHours: number | null): this;
|
|
39
|
+
getSalesPeriodEventId(): string | null;
|
|
40
|
+
setSalesPeriodEventId(salesPeriodEventId: string | null): this;
|
|
41
|
+
withSalesPeriodEventId(salesPeriodEventId: string | null): this;
|
|
42
|
+
static fromDict(data: {
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}): RandomShowcase | null;
|
|
45
|
+
toDict(): {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
4
|
+
Reserved.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
7
|
+
You may not use this file except in compliance with the License.
|
|
8
|
+
A copy of the License is located at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
13
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
14
|
+
express or implied. See the License for the specific language governing
|
|
15
|
+
permissions and limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var tslib_1 = require("tslib");
|
|
19
|
+
var RandomDisplayItemModel_1 = tslib_1.__importDefault(require("./RandomDisplayItemModel"));
|
|
20
|
+
var grnFormat = "grn:gs2:{region}:{ownerId}:showcase:{namespaceName}:random:showcase:{showcaseName}";
|
|
21
|
+
var RandomShowcase = /** @class */ (function () {
|
|
22
|
+
function RandomShowcase() {
|
|
23
|
+
this.randomShowcaseId = null;
|
|
24
|
+
this.name = null;
|
|
25
|
+
this.metadata = null;
|
|
26
|
+
this.maximumNumberOfChoice = null;
|
|
27
|
+
this.displayItems = null;
|
|
28
|
+
this.baseTimestamp = null;
|
|
29
|
+
this.resetIntervalHours = null;
|
|
30
|
+
this.salesPeriodEventId = null;
|
|
31
|
+
}
|
|
32
|
+
RandomShowcase.getRegion = function (grn) {
|
|
33
|
+
var match = grn.match(grnFormat
|
|
34
|
+
.replace('{region}', '(.*)')
|
|
35
|
+
.replace('{ownerId}', '.*')
|
|
36
|
+
.replace('{namespaceName}', '.*')
|
|
37
|
+
.replace('{showcaseName}', '.*'));
|
|
38
|
+
if (match) {
|
|
39
|
+
return match[1];
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
RandomShowcase.getOwnerId = function (grn) {
|
|
44
|
+
var match = grn.match(grnFormat
|
|
45
|
+
.replace('{region}', '.*')
|
|
46
|
+
.replace('{ownerId}', '(.*)')
|
|
47
|
+
.replace('{namespaceName}', '.*')
|
|
48
|
+
.replace('{showcaseName}', '.*'));
|
|
49
|
+
if (match) {
|
|
50
|
+
return match[1];
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
};
|
|
54
|
+
RandomShowcase.getNamespaceName = function (grn) {
|
|
55
|
+
var match = grn.match(grnFormat
|
|
56
|
+
.replace('{region}', '.*')
|
|
57
|
+
.replace('{ownerId}', '.*')
|
|
58
|
+
.replace('{namespaceName}', '(.*)')
|
|
59
|
+
.replace('{showcaseName}', '.*'));
|
|
60
|
+
if (match) {
|
|
61
|
+
return match[1];
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
};
|
|
65
|
+
RandomShowcase.getShowcaseName = function (grn) {
|
|
66
|
+
var match = grn.match(grnFormat
|
|
67
|
+
.replace('{region}', '.*')
|
|
68
|
+
.replace('{ownerId}', '.*')
|
|
69
|
+
.replace('{namespaceName}', '.*')
|
|
70
|
+
.replace('{showcaseName}', '(.*)'));
|
|
71
|
+
if (match) {
|
|
72
|
+
return match[1];
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
RandomShowcase.isValid = function (grn) {
|
|
77
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (this.getShowcaseName(grn) == null || this.getShowcaseName(grn) === '') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return true;
|
|
90
|
+
};
|
|
91
|
+
RandomShowcase.createGrn = function (region, ownerId, namespaceName, showcaseName) {
|
|
92
|
+
return grnFormat
|
|
93
|
+
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
94
|
+
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
95
|
+
.replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
|
|
96
|
+
.replace('{showcaseName}', showcaseName !== null && showcaseName !== void 0 ? showcaseName : '');
|
|
97
|
+
};
|
|
98
|
+
RandomShowcase.prototype.getRandomShowcaseId = function () {
|
|
99
|
+
return this.randomShowcaseId;
|
|
100
|
+
};
|
|
101
|
+
RandomShowcase.prototype.setRandomShowcaseId = function (randomShowcaseId) {
|
|
102
|
+
this.randomShowcaseId = randomShowcaseId;
|
|
103
|
+
return this;
|
|
104
|
+
};
|
|
105
|
+
RandomShowcase.prototype.withRandomShowcaseId = function (randomShowcaseId) {
|
|
106
|
+
this.randomShowcaseId = randomShowcaseId;
|
|
107
|
+
return this;
|
|
108
|
+
};
|
|
109
|
+
RandomShowcase.prototype.getName = function () {
|
|
110
|
+
return this.name;
|
|
111
|
+
};
|
|
112
|
+
RandomShowcase.prototype.setName = function (name) {
|
|
113
|
+
this.name = name;
|
|
114
|
+
return this;
|
|
115
|
+
};
|
|
116
|
+
RandomShowcase.prototype.withName = function (name) {
|
|
117
|
+
this.name = name;
|
|
118
|
+
return this;
|
|
119
|
+
};
|
|
120
|
+
RandomShowcase.prototype.getMetadata = function () {
|
|
121
|
+
return this.metadata;
|
|
122
|
+
};
|
|
123
|
+
RandomShowcase.prototype.setMetadata = function (metadata) {
|
|
124
|
+
this.metadata = metadata;
|
|
125
|
+
return this;
|
|
126
|
+
};
|
|
127
|
+
RandomShowcase.prototype.withMetadata = function (metadata) {
|
|
128
|
+
this.metadata = metadata;
|
|
129
|
+
return this;
|
|
130
|
+
};
|
|
131
|
+
RandomShowcase.prototype.getMaximumNumberOfChoice = function () {
|
|
132
|
+
return this.maximumNumberOfChoice;
|
|
133
|
+
};
|
|
134
|
+
RandomShowcase.prototype.setMaximumNumberOfChoice = function (maximumNumberOfChoice) {
|
|
135
|
+
this.maximumNumberOfChoice = maximumNumberOfChoice;
|
|
136
|
+
return this;
|
|
137
|
+
};
|
|
138
|
+
RandomShowcase.prototype.withMaximumNumberOfChoice = function (maximumNumberOfChoice) {
|
|
139
|
+
this.maximumNumberOfChoice = maximumNumberOfChoice;
|
|
140
|
+
return this;
|
|
141
|
+
};
|
|
142
|
+
RandomShowcase.prototype.getDisplayItems = function () {
|
|
143
|
+
return this.displayItems;
|
|
144
|
+
};
|
|
145
|
+
RandomShowcase.prototype.setDisplayItems = function (displayItems) {
|
|
146
|
+
this.displayItems = displayItems;
|
|
147
|
+
return this;
|
|
148
|
+
};
|
|
149
|
+
RandomShowcase.prototype.withDisplayItems = function (displayItems) {
|
|
150
|
+
this.displayItems = displayItems;
|
|
151
|
+
return this;
|
|
152
|
+
};
|
|
153
|
+
RandomShowcase.prototype.getBaseTimestamp = function () {
|
|
154
|
+
return this.baseTimestamp;
|
|
155
|
+
};
|
|
156
|
+
RandomShowcase.prototype.setBaseTimestamp = function (baseTimestamp) {
|
|
157
|
+
this.baseTimestamp = baseTimestamp;
|
|
158
|
+
return this;
|
|
159
|
+
};
|
|
160
|
+
RandomShowcase.prototype.withBaseTimestamp = function (baseTimestamp) {
|
|
161
|
+
this.baseTimestamp = baseTimestamp;
|
|
162
|
+
return this;
|
|
163
|
+
};
|
|
164
|
+
RandomShowcase.prototype.getResetIntervalHours = function () {
|
|
165
|
+
return this.resetIntervalHours;
|
|
166
|
+
};
|
|
167
|
+
RandomShowcase.prototype.setResetIntervalHours = function (resetIntervalHours) {
|
|
168
|
+
this.resetIntervalHours = resetIntervalHours;
|
|
169
|
+
return this;
|
|
170
|
+
};
|
|
171
|
+
RandomShowcase.prototype.withResetIntervalHours = function (resetIntervalHours) {
|
|
172
|
+
this.resetIntervalHours = resetIntervalHours;
|
|
173
|
+
return this;
|
|
174
|
+
};
|
|
175
|
+
RandomShowcase.prototype.getSalesPeriodEventId = function () {
|
|
176
|
+
return this.salesPeriodEventId;
|
|
177
|
+
};
|
|
178
|
+
RandomShowcase.prototype.setSalesPeriodEventId = function (salesPeriodEventId) {
|
|
179
|
+
this.salesPeriodEventId = salesPeriodEventId;
|
|
180
|
+
return this;
|
|
181
|
+
};
|
|
182
|
+
RandomShowcase.prototype.withSalesPeriodEventId = function (salesPeriodEventId) {
|
|
183
|
+
this.salesPeriodEventId = salesPeriodEventId;
|
|
184
|
+
return this;
|
|
185
|
+
};
|
|
186
|
+
RandomShowcase.fromDict = function (data) {
|
|
187
|
+
if (data == undefined || data == null) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
return new RandomShowcase()
|
|
191
|
+
.withRandomShowcaseId(data["randomShowcaseId"])
|
|
192
|
+
.withName(data["name"])
|
|
193
|
+
.withMetadata(data["metadata"])
|
|
194
|
+
.withMaximumNumberOfChoice(data["maximumNumberOfChoice"])
|
|
195
|
+
.withDisplayItems(data.displayItems ?
|
|
196
|
+
data.displayItems.map(function (item) {
|
|
197
|
+
return RandomDisplayItemModel_1.default.fromDict(item);
|
|
198
|
+
}) : [])
|
|
199
|
+
.withBaseTimestamp(data["baseTimestamp"])
|
|
200
|
+
.withResetIntervalHours(data["resetIntervalHours"])
|
|
201
|
+
.withSalesPeriodEventId(data["salesPeriodEventId"]);
|
|
202
|
+
};
|
|
203
|
+
RandomShowcase.prototype.toDict = function () {
|
|
204
|
+
return {
|
|
205
|
+
"randomShowcaseId": this.getRandomShowcaseId(),
|
|
206
|
+
"name": this.getName(),
|
|
207
|
+
"metadata": this.getMetadata(),
|
|
208
|
+
"maximumNumberOfChoice": this.getMaximumNumberOfChoice(),
|
|
209
|
+
"displayItems": this.getDisplayItems() ?
|
|
210
|
+
this.getDisplayItems().map(function (item) {
|
|
211
|
+
return item.toDict();
|
|
212
|
+
}) : [],
|
|
213
|
+
"baseTimestamp": this.getBaseTimestamp(),
|
|
214
|
+
"resetIntervalHours": this.getResetIntervalHours(),
|
|
215
|
+
"salesPeriodEventId": this.getSalesPeriodEventId(),
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
return RandomShowcase;
|
|
219
|
+
}());
|
|
220
|
+
exports.default = RandomShowcase;
|
|
221
|
+
//# sourceMappingURL=RandomShowcase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RandomShowcase.js","sourceRoot":"","sources":["RandomShowcase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,4FAA8D;AAC9D,IAAM,SAAS,GAAW,oFAAoF,CAAC;AAE/G;IAAA;QACY,qBAAgB,GAAgB,IAAI,CAAC;QACrC,SAAI,GAAgB,IAAI,CAAC;QACzB,aAAQ,GAAgB,IAAI,CAAC;QAC7B,0BAAqB,GAAgB,IAAI,CAAC;QAC1C,iBAAY,GAAkC,IAAI,CAAC;QACnD,kBAAa,GAAgB,IAAI,CAAC;QAClC,uBAAkB,GAAgB,IAAI,CAAC;QACvC,uBAAkB,GAAgB,IAAI,CAAC;IA8MnD,CAAC;IA5MiB,wBAAS,GAAvB,UAAwB,GAAW;QAC/B,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS;aAC5B,OAAO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oB,EAAE,IAAI,CAAC,qBAAqB,EAAE;YAClD,oBAAoB,EAAE,IAAI,CAAC,qBAAqB,EAAE;SACrD,CAAC;IACN,CAAC;IACL,qBAAC;AAAD,CAAC,AAtND,IAsNC"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
|
|
3
|
+
Reserved.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
6
|
+
You may not use this file except in compliance with the License.
|
|
7
|
+
A copy of the License is located at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
12
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
13
|
+
express or implied. See the License for the specific language governing
|
|
14
|
+
permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import IModel from '../../core/interface/IModel';
|
|
18
|
+
import ConsumeAction from './ConsumeAction';
|
|
19
|
+
import AcquireAction from './AcquireAction';
|
|
20
|
+
import RandomDisplayItemModel from './RandomDisplayItemModel';
|
|
21
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:showcase:{namespaceName}:random:showcase:{showcaseName}";
|
|
22
|
+
|
|
23
|
+
export default class RandomShowcase implements IModel {
|
|
24
|
+
private randomShowcaseId: string|null = null;
|
|
25
|
+
private name: string|null = null;
|
|
26
|
+
private metadata: string|null = null;
|
|
27
|
+
private maximumNumberOfChoice: number|null = null;
|
|
28
|
+
private displayItems: RandomDisplayItemModel[]|null = null;
|
|
29
|
+
private baseTimestamp: number|null = null;
|
|
30
|
+
private resetIntervalHours: number|null = null;
|
|
31
|
+
private salesPeriodEventId: string|null = null;
|
|
32
|
+
|
|
33
|
+
public static getRegion(grn: string): string|null {
|
|
34
|
+
const match = grn.match(grnFormat
|
|
35
|
+
.replace('{region}', '(.*)')
|
|
36
|
+
.replace('{ownerId}', '.*')
|
|
37
|
+
.replace('{namespaceName}', '.*')
|
|
38
|
+
.replace('{showcaseName}', '.*')
|
|
39
|
+
);
|
|
40
|
+
if (match) {
|
|
41
|
+
return match[1];
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public static getOwnerId(grn: string): string|null {
|
|
47
|
+
const match = grn.match(grnFormat
|
|
48
|
+
.replace('{region}', '.*')
|
|
49
|
+
.replace('{ownerId}', '(.*)')
|
|
50
|
+
.replace('{namespaceName}', '.*')
|
|
51
|
+
.replace('{showcaseName}', '.*')
|
|
52
|
+
);
|
|
53
|
+
if (match) {
|
|
54
|
+
return match[1];
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public static getNamespaceName(grn: string): string|null {
|
|
60
|
+
const match = grn.match(grnFormat
|
|
61
|
+
.replace('{region}', '.*')
|
|
62
|
+
.replace('{ownerId}', '.*')
|
|
63
|
+
.replace('{namespaceName}', '(.*)')
|
|
64
|
+
.replace('{showcaseName}', '.*')
|
|
65
|
+
);
|
|
66
|
+
if (match) {
|
|
67
|
+
return match[1];
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public static getShowcaseName(grn: string): string|null {
|
|
73
|
+
const match = grn.match(grnFormat
|
|
74
|
+
.replace('{region}', '.*')
|
|
75
|
+
.replace('{ownerId}', '.*')
|
|
76
|
+
.replace('{namespaceName}', '.*')
|
|
77
|
+
.replace('{showcaseName}', '(.*)')
|
|
78
|
+
);
|
|
79
|
+
if (match) {
|
|
80
|
+
return match[1];
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public static isValid(grn: string): boolean {
|
|
86
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (this.getShowcaseName(grn) == null || this.getShowcaseName(grn) === '') {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public static createGrn(
|
|
102
|
+
region: string|null,
|
|
103
|
+
ownerId: string|null,
|
|
104
|
+
namespaceName: string|null,
|
|
105
|
+
showcaseName: string|null,
|
|
106
|
+
): string|null {
|
|
107
|
+
return grnFormat
|
|
108
|
+
.replace('{region}', region ?? '')
|
|
109
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
110
|
+
.replace('{namespaceName}', namespaceName ?? '')
|
|
111
|
+
.replace('{showcaseName}', showcaseName ?? '');
|
|
112
|
+
}
|
|
113
|
+
public getRandomShowcaseId(): string|null {
|
|
114
|
+
return this.randomShowcaseId;
|
|
115
|
+
}
|
|
116
|
+
public setRandomShowcaseId(randomShowcaseId: string|null) {
|
|
117
|
+
this.randomShowcaseId = randomShowcaseId;
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
public withRandomShowcaseId(randomShowcaseId: string|null): this {
|
|
121
|
+
this.randomShowcaseId = randomShowcaseId;
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
124
|
+
public getName(): string|null {
|
|
125
|
+
return this.name;
|
|
126
|
+
}
|
|
127
|
+
public setName(name: string|null) {
|
|
128
|
+
this.name = name;
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
public withName(name: string|null): this {
|
|
132
|
+
this.name = name;
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
public getMetadata(): string|null {
|
|
136
|
+
return this.metadata;
|
|
137
|
+
}
|
|
138
|
+
public setMetadata(metadata: string|null) {
|
|
139
|
+
this.metadata = metadata;
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
public withMetadata(metadata: string|null): this {
|
|
143
|
+
this.metadata = metadata;
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
public getMaximumNumberOfChoice(): number|null {
|
|
147
|
+
return this.maximumNumberOfChoice;
|
|
148
|
+
}
|
|
149
|
+
public setMaximumNumberOfChoice(maximumNumberOfChoice: number|null) {
|
|
150
|
+
this.maximumNumberOfChoice = maximumNumberOfChoice;
|
|
151
|
+
return this;
|
|
152
|
+
}
|
|
153
|
+
public withMaximumNumberOfChoice(maximumNumberOfChoice: number|null): this {
|
|
154
|
+
this.maximumNumberOfChoice = maximumNumberOfChoice;
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
public getDisplayItems(): RandomDisplayItemModel[]|null {
|
|
158
|
+
return this.displayItems;
|
|
159
|
+
}
|
|
160
|
+
public setDisplayItems(displayItems: RandomDisplayItemModel[]|null) {
|
|
161
|
+
this.displayItems = displayItems;
|
|
162
|
+
return this;
|
|
163
|
+
}
|
|
164
|
+
public withDisplayItems(displayItems: RandomDisplayItemModel[]|null): this {
|
|
165
|
+
this.displayItems = displayItems;
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
public getBaseTimestamp(): number|null {
|
|
169
|
+
return this.baseTimestamp;
|
|
170
|
+
}
|
|
171
|
+
public setBaseTimestamp(baseTimestamp: number|null) {
|
|
172
|
+
this.baseTimestamp = baseTimestamp;
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
public withBaseTimestamp(baseTimestamp: number|null): this {
|
|
176
|
+
this.baseTimestamp = baseTimestamp;
|
|
177
|
+
return this;
|
|
178
|
+
}
|
|
179
|
+
public getResetIntervalHours(): number|null {
|
|
180
|
+
return this.resetIntervalHours;
|
|
181
|
+
}
|
|
182
|
+
public setResetIntervalHours(resetIntervalHours: number|null) {
|
|
183
|
+
this.resetIntervalHours = resetIntervalHours;
|
|
184
|
+
return this;
|
|
185
|
+
}
|
|
186
|
+
public withResetIntervalHours(resetIntervalHours: number|null): this {
|
|
187
|
+
this.resetIntervalHours = resetIntervalHours;
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
public getSalesPeriodEventId(): string|null {
|
|
191
|
+
return this.salesPeriodEventId;
|
|
192
|
+
}
|
|
193
|
+
public setSalesPeriodEventId(salesPeriodEventId: string|null) {
|
|
194
|
+
this.salesPeriodEventId = salesPeriodEventId;
|
|
195
|
+
return this;
|
|
196
|
+
}
|
|
197
|
+
public withSalesPeriodEventId(salesPeriodEventId: string|null): this {
|
|
198
|
+
this.salesPeriodEventId = salesPeriodEventId;
|
|
199
|
+
return this;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
public static fromDict(data: {[key: string]: any}): RandomShowcase|null {
|
|
203
|
+
if (data == undefined || data == null) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
return new RandomShowcase()
|
|
207
|
+
.withRandomShowcaseId(data["randomShowcaseId"])
|
|
208
|
+
.withName(data["name"])
|
|
209
|
+
.withMetadata(data["metadata"])
|
|
210
|
+
.withMaximumNumberOfChoice(data["maximumNumberOfChoice"])
|
|
211
|
+
.withDisplayItems(data.displayItems ?
|
|
212
|
+
data.displayItems.map((item: {[key: string]: any}) => {
|
|
213
|
+
return RandomDisplayItemModel.fromDict(item);
|
|
214
|
+
}
|
|
215
|
+
) : [])
|
|
216
|
+
.withBaseTimestamp(data["baseTimestamp"])
|
|
217
|
+
.withResetIntervalHours(data["resetIntervalHours"])
|
|
218
|
+
.withSalesPeriodEventId(data["salesPeriodEventId"]);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
public toDict(): {[key: string]: any} {
|
|
222
|
+
return {
|
|
223
|
+
"randomShowcaseId": this.getRandomShowcaseId(),
|
|
224
|
+
"name": this.getName(),
|
|
225
|
+
"metadata": this.getMetadata(),
|
|
226
|
+
"maximumNumberOfChoice": this.getMaximumNumberOfChoice(),
|
|
227
|
+
"displayItems": this.getDisplayItems() ?
|
|
228
|
+
this.getDisplayItems()!.map((item: RandomDisplayItemModel) => {
|
|
229
|
+
return item.toDict();
|
|
230
|
+
}
|
|
231
|
+
) : [],
|
|
232
|
+
"baseTimestamp": this.getBaseTimestamp(),
|
|
233
|
+
"resetIntervalHours": this.getResetIntervalHours(),
|
|
234
|
+
"salesPeriodEventId": this.getSalesPeriodEventId(),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
}
|