gs2 1.3.146 → 1.3.148

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.
Files changed (145) hide show
  1. package/loginReward/request/DescribeBonusModelsRequest.d.ts +0 -4
  2. package/loginReward/request/DescribeBonusModelsRequest.js +1 -15
  3. package/loginReward/request/DescribeBonusModelsRequest.js.map +1 -1
  4. package/loginReward/request/DescribeBonusModelsRequest.ts +1 -15
  5. package/loginReward/request/GetBonusModelRequest.d.ts +0 -4
  6. package/loginReward/request/GetBonusModelRequest.js +1 -15
  7. package/loginReward/request/GetBonusModelRequest.js.map +1 -1
  8. package/loginReward/request/GetBonusModelRequest.ts +1 -15
  9. package/loginReward/request/index.d.ts +1 -3
  10. package/loginReward/request/index.js +1 -5
  11. package/loginReward/request/index.js.map +1 -1
  12. package/loginReward/request/index.ts +0 -4
  13. package/loginReward/rest.d.ts +0 -2
  14. package/loginReward/rest.js +26 -69
  15. package/loginReward/rest.js.map +1 -1
  16. package/loginReward/rest.ts +22 -73
  17. package/loginReward/result/index.d.ts +1 -3
  18. package/loginReward/result/index.js +1 -5
  19. package/loginReward/result/index.js.map +1 -1
  20. package/loginReward/result/index.ts +0 -4
  21. package/package.json +1 -1
  22. package/showcase/model/PurchaseCount.d.ts +17 -0
  23. package/showcase/model/PurchaseCount.js +62 -0
  24. package/showcase/model/PurchaseCount.js.map +1 -0
  25. package/showcase/model/PurchaseCount.ts +60 -0
  26. package/showcase/model/RandomDisplayItem.d.ts +35 -0
  27. package/showcase/model/RandomDisplayItem.js +133 -0
  28. package/showcase/model/RandomDisplayItem.js.map +1 -0
  29. package/showcase/model/RandomDisplayItem.ts +134 -0
  30. package/showcase/model/RandomDisplayItemModel.d.ts +35 -0
  31. package/showcase/model/RandomDisplayItemModel.js +133 -0
  32. package/showcase/model/RandomDisplayItemModel.js.map +1 -0
  33. package/showcase/model/RandomDisplayItemModel.ts +134 -0
  34. package/showcase/model/RandomShowcase.d.ts +48 -0
  35. package/showcase/model/RandomShowcase.js +221 -0
  36. package/showcase/model/RandomShowcase.js.map +1 -0
  37. package/showcase/model/RandomShowcase.ts +237 -0
  38. package/showcase/model/RandomShowcaseMaster.d.ts +60 -0
  39. package/showcase/model/RandomShowcaseMaster.js +263 -0
  40. package/showcase/model/RandomShowcaseMaster.js.map +1 -0
  41. package/showcase/model/RandomShowcaseMaster.ts +279 -0
  42. package/showcase/model/index.d.ts +6 -1
  43. package/showcase/model/index.js +11 -1
  44. package/showcase/model/index.js.map +1 -1
  45. package/showcase/model/index.ts +10 -0
  46. package/showcase/request/CreateRandomShowcaseMasterRequest.d.ts +54 -0
  47. package/showcase/request/CreateRandomShowcaseMasterRequest.js +189 -0
  48. package/showcase/request/CreateRandomShowcaseMasterRequest.js.map +1 -0
  49. package/showcase/request/CreateRandomShowcaseMasterRequest.ts +196 -0
  50. package/showcase/request/DeleteRandomShowcaseMasterRequest.d.ts +25 -0
  51. package/showcase/request/DeleteRandomShowcaseMasterRequest.js +83 -0
  52. package/showcase/request/DeleteRandomShowcaseMasterRequest.js.map +1 -0
  53. package/showcase/request/DeleteRandomShowcaseMasterRequest.ts +90 -0
  54. package/showcase/request/DescribeRandomShowcaseMastersRequest.d.ts +29 -0
  55. package/showcase/request/DescribeRandomShowcaseMastersRequest.js +97 -0
  56. package/showcase/request/DescribeRandomShowcaseMastersRequest.js.map +1 -0
  57. package/showcase/request/DescribeRandomShowcaseMastersRequest.ts +104 -0
  58. package/showcase/request/DescribeRandomShowcaseSalesItemsByUserIdRequest.d.ts +29 -0
  59. package/showcase/request/DescribeRandomShowcaseSalesItemsByUserIdRequest.js +97 -0
  60. package/showcase/request/DescribeRandomShowcaseSalesItemsByUserIdRequest.js.map +1 -0
  61. package/showcase/request/DescribeRandomShowcaseSalesItemsByUserIdRequest.ts +104 -0
  62. package/showcase/request/DescribeRandomShowcaseSalesItemsRequest.d.ts +29 -0
  63. package/showcase/request/DescribeRandomShowcaseSalesItemsRequest.js +97 -0
  64. package/showcase/request/DescribeRandomShowcaseSalesItemsRequest.js.map +1 -0
  65. package/showcase/request/DescribeRandomShowcaseSalesItemsRequest.ts +104 -0
  66. package/showcase/request/GetRandomShowcaseMasterRequest.d.ts +25 -0
  67. package/showcase/request/GetRandomShowcaseMasterRequest.js +83 -0
  68. package/showcase/request/GetRandomShowcaseMasterRequest.js.map +1 -0
  69. package/showcase/request/GetRandomShowcaseMasterRequest.ts +90 -0
  70. package/showcase/request/IncrementPurchaseCountByStampTaskRequest.d.ts +25 -0
  71. package/showcase/request/IncrementPurchaseCountByStampTaskRequest.js +83 -0
  72. package/showcase/request/IncrementPurchaseCountByStampTaskRequest.js.map +1 -0
  73. package/showcase/request/IncrementPurchaseCountByStampTaskRequest.ts +90 -0
  74. package/showcase/request/IncrementPurchaseCountByUserIdRequest.d.ts +41 -0
  75. package/showcase/request/IncrementPurchaseCountByUserIdRequest.js +137 -0
  76. package/showcase/request/IncrementPurchaseCountByUserIdRequest.js.map +1 -0
  77. package/showcase/request/IncrementPurchaseCountByUserIdRequest.ts +147 -0
  78. package/showcase/request/RandomShowcaseBuyByUserIdRequest.d.ts +46 -0
  79. package/showcase/request/RandomShowcaseBuyByUserIdRequest.js +159 -0
  80. package/showcase/request/RandomShowcaseBuyByUserIdRequest.js.map +1 -0
  81. package/showcase/request/RandomShowcaseBuyByUserIdRequest.ts +169 -0
  82. package/showcase/request/RandomShowcaseBuyRequest.d.ts +46 -0
  83. package/showcase/request/RandomShowcaseBuyRequest.js +159 -0
  84. package/showcase/request/RandomShowcaseBuyRequest.js.map +1 -0
  85. package/showcase/request/RandomShowcaseBuyRequest.ts +169 -0
  86. package/showcase/request/UpdateRandomShowcaseMasterRequest.d.ts +54 -0
  87. package/showcase/request/UpdateRandomShowcaseMasterRequest.js +189 -0
  88. package/showcase/request/UpdateRandomShowcaseMasterRequest.js.map +1 -0
  89. package/showcase/request/UpdateRandomShowcaseMasterRequest.ts +196 -0
  90. package/showcase/request/index.d.ts +12 -1
  91. package/showcase/request/index.js +23 -1
  92. package/showcase/request/index.js.map +1 -1
  93. package/showcase/request/index.ts +22 -0
  94. package/showcase/rest.d.ts +11 -0
  95. package/showcase/rest.js +318 -0
  96. package/showcase/rest.js.map +1 -1
  97. package/showcase/rest.ts +362 -0
  98. package/showcase/result/CreateRandomShowcaseMasterResult.d.ts +14 -0
  99. package/showcase/result/CreateRandomShowcaseMasterResult.js +48 -0
  100. package/showcase/result/CreateRandomShowcaseMasterResult.js.map +1 -0
  101. package/showcase/result/CreateRandomShowcaseMasterResult.ts +48 -0
  102. package/showcase/result/DeleteRandomShowcaseMasterResult.d.ts +14 -0
  103. package/showcase/result/DeleteRandomShowcaseMasterResult.js +48 -0
  104. package/showcase/result/DeleteRandomShowcaseMasterResult.js.map +1 -0
  105. package/showcase/result/DeleteRandomShowcaseMasterResult.ts +48 -0
  106. package/showcase/result/DescribeRandomShowcaseMastersResult.d.ts +18 -0
  107. package/showcase/result/DescribeRandomShowcaseMastersResult.js +67 -0
  108. package/showcase/result/DescribeRandomShowcaseMastersResult.js.map +1 -0
  109. package/showcase/result/DescribeRandomShowcaseMastersResult.ts +73 -0
  110. package/showcase/result/DescribeRandomShowcaseSalesItemsByUserIdResult.d.ts +14 -0
  111. package/showcase/result/DescribeRandomShowcaseSalesItemsByUserIdResult.js +53 -0
  112. package/showcase/result/DescribeRandomShowcaseSalesItemsByUserIdResult.js.map +1 -0
  113. package/showcase/result/DescribeRandomShowcaseSalesItemsByUserIdResult.ts +56 -0
  114. package/showcase/result/DescribeRandomShowcaseSalesItemsResult.d.ts +14 -0
  115. package/showcase/result/DescribeRandomShowcaseSalesItemsResult.js +53 -0
  116. package/showcase/result/DescribeRandomShowcaseSalesItemsResult.js.map +1 -0
  117. package/showcase/result/DescribeRandomShowcaseSalesItemsResult.ts +56 -0
  118. package/showcase/result/GetRandomShowcaseMasterResult.d.ts +14 -0
  119. package/showcase/result/GetRandomShowcaseMasterResult.js +48 -0
  120. package/showcase/result/GetRandomShowcaseMasterResult.js.map +1 -0
  121. package/showcase/result/GetRandomShowcaseMasterResult.ts +48 -0
  122. package/showcase/result/IncrementPurchaseCountByStampTaskResult.d.ts +18 -0
  123. package/showcase/result/IncrementPurchaseCountByStampTaskResult.js +62 -0
  124. package/showcase/result/IncrementPurchaseCountByStampTaskResult.js.map +1 -0
  125. package/showcase/result/IncrementPurchaseCountByStampTaskResult.ts +65 -0
  126. package/showcase/result/IncrementPurchaseCountByUserIdResult.d.ts +14 -0
  127. package/showcase/result/IncrementPurchaseCountByUserIdResult.js +48 -0
  128. package/showcase/result/IncrementPurchaseCountByUserIdResult.js.map +1 -0
  129. package/showcase/result/IncrementPurchaseCountByUserIdResult.ts +48 -0
  130. package/showcase/result/RandomShowcaseBuyByUserIdResult.d.ts +30 -0
  131. package/showcase/result/RandomShowcaseBuyByUserIdResult.js +104 -0
  132. package/showcase/result/RandomShowcaseBuyByUserIdResult.js.map +1 -0
  133. package/showcase/result/RandomShowcaseBuyByUserIdResult.ts +116 -0
  134. package/showcase/result/RandomShowcaseBuyResult.d.ts +30 -0
  135. package/showcase/result/RandomShowcaseBuyResult.js +104 -0
  136. package/showcase/result/RandomShowcaseBuyResult.js.map +1 -0
  137. package/showcase/result/RandomShowcaseBuyResult.ts +116 -0
  138. package/showcase/result/UpdateRandomShowcaseMasterResult.d.ts +14 -0
  139. package/showcase/result/UpdateRandomShowcaseMasterResult.js +48 -0
  140. package/showcase/result/UpdateRandomShowcaseMasterResult.js.map +1 -0
  141. package/showcase/result/UpdateRandomShowcaseMasterResult.ts +48 -0
  142. package/showcase/result/index.d.ts +12 -1
  143. package/showcase/result/index.js +23 -1
  144. package/showcase/result/index.js.map +1 -1
  145. package/showcase/result/index.ts +22 -0
@@ -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,aA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AAE;YAC9B,uBAAuB,EAAE,IAAI,CAAC,wBAAwB,EAAE;YACxD,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;gBACpC,IAAI,CAAC,eAAe,EAAG,CAAC,GAAG,CAAC,UAAC,IAA4B;oBACrD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzB,CAAC,CACJ,CAAC,CAAC,CAAC,EAAE;YACN,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACxC,oBAAoB,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
+ }
@@ -0,0 +1,60 @@
1
+ import IModel from '../../core/interface/IModel';
2
+ import RandomDisplayItemModel from './RandomDisplayItemModel';
3
+ export default class RandomShowcaseMaster implements IModel {
4
+ private showcaseId;
5
+ private name;
6
+ private description;
7
+ private metadata;
8
+ private maximumNumberOfChoice;
9
+ private displayItems;
10
+ private baseTimestamp;
11
+ private resetIntervalHours;
12
+ private salesPeriodEventId;
13
+ private createdAt;
14
+ private updatedAt;
15
+ static getRegion(grn: string): string | null;
16
+ static getOwnerId(grn: string): string | null;
17
+ static getNamespaceName(grn: string): string | null;
18
+ static getShowcaseName(grn: string): string | null;
19
+ static isValid(grn: string): boolean;
20
+ static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, showcaseName: string | null): string | null;
21
+ getShowcaseId(): string | null;
22
+ setShowcaseId(showcaseId: string | null): this;
23
+ withShowcaseId(showcaseId: string | null): this;
24
+ getName(): string | null;
25
+ setName(name: string | null): this;
26
+ withName(name: string | null): this;
27
+ getDescription(): string | null;
28
+ setDescription(description: string | null): this;
29
+ withDescription(description: string | null): this;
30
+ getMetadata(): string | null;
31
+ setMetadata(metadata: string | null): this;
32
+ withMetadata(metadata: string | null): this;
33
+ getMaximumNumberOfChoice(): number | null;
34
+ setMaximumNumberOfChoice(maximumNumberOfChoice: number | null): this;
35
+ withMaximumNumberOfChoice(maximumNumberOfChoice: number | null): this;
36
+ getDisplayItems(): RandomDisplayItemModel[] | null;
37
+ setDisplayItems(displayItems: RandomDisplayItemModel[] | null): this;
38
+ withDisplayItems(displayItems: RandomDisplayItemModel[] | null): this;
39
+ getBaseTimestamp(): number | null;
40
+ setBaseTimestamp(baseTimestamp: number | null): this;
41
+ withBaseTimestamp(baseTimestamp: number | null): this;
42
+ getResetIntervalHours(): number | null;
43
+ setResetIntervalHours(resetIntervalHours: number | null): this;
44
+ withResetIntervalHours(resetIntervalHours: number | null): this;
45
+ getSalesPeriodEventId(): string | null;
46
+ setSalesPeriodEventId(salesPeriodEventId: string | null): this;
47
+ withSalesPeriodEventId(salesPeriodEventId: string | null): this;
48
+ getCreatedAt(): number | null;
49
+ setCreatedAt(createdAt: number | null): this;
50
+ withCreatedAt(createdAt: number | null): this;
51
+ getUpdatedAt(): number | null;
52
+ setUpdatedAt(updatedAt: number | null): this;
53
+ withUpdatedAt(updatedAt: number | null): this;
54
+ static fromDict(data: {
55
+ [key: string]: any;
56
+ }): RandomShowcaseMaster | null;
57
+ toDict(): {
58
+ [key: string]: any;
59
+ };
60
+ }