gs2 1.3.141 → 1.3.142
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/exchange/model/IncrementalRateModel.d.ts +57 -0
- package/exchange/model/IncrementalRateModel.js +251 -0
- package/exchange/model/IncrementalRateModel.js.map +1 -0
- package/exchange/model/IncrementalRateModel.ts +264 -0
- package/exchange/model/IncrementalRateModelMaster.d.ts +69 -0
- package/exchange/model/IncrementalRateModelMaster.js +293 -0
- package/exchange/model/IncrementalRateModelMaster.js.map +1 -0
- package/exchange/model/IncrementalRateModelMaster.ts +306 -0
- package/exchange/model/index.d.ts +3 -1
- package/exchange/model/index.js +5 -1
- package/exchange/model/index.js.map +1 -1
- package/exchange/model/index.ts +4 -0
- package/exchange/request/CreateIncrementalRateModelMasterRequest.d.ts +62 -0
- package/exchange/request/CreateIncrementalRateModelMasterRequest.js +218 -0
- package/exchange/request/CreateIncrementalRateModelMasterRequest.js.map +1 -0
- package/exchange/request/CreateIncrementalRateModelMasterRequest.ts +224 -0
- package/exchange/request/DeleteIncrementalRateModelMasterRequest.d.ts +25 -0
- package/exchange/request/DeleteIncrementalRateModelMasterRequest.js +83 -0
- package/exchange/request/DeleteIncrementalRateModelMasterRequest.js.map +1 -0
- package/exchange/request/DeleteIncrementalRateModelMasterRequest.ts +90 -0
- package/exchange/request/DescribeIncrementalRateModelMastersRequest.d.ts +29 -0
- package/exchange/request/DescribeIncrementalRateModelMastersRequest.js +97 -0
- package/exchange/request/DescribeIncrementalRateModelMastersRequest.js.map +1 -0
- package/exchange/request/DescribeIncrementalRateModelMastersRequest.ts +104 -0
- package/exchange/request/DescribeIncrementalRateModelsRequest.d.ts +21 -0
- package/exchange/request/DescribeIncrementalRateModelsRequest.js +69 -0
- package/exchange/request/DescribeIncrementalRateModelsRequest.js.map +1 -0
- package/exchange/request/DescribeIncrementalRateModelsRequest.ts +76 -0
- package/exchange/request/GetIncrementalRateModelMasterRequest.d.ts +25 -0
- package/exchange/request/GetIncrementalRateModelMasterRequest.js +83 -0
- package/exchange/request/GetIncrementalRateModelMasterRequest.js.map +1 -0
- package/exchange/request/GetIncrementalRateModelMasterRequest.ts +90 -0
- package/exchange/request/GetIncrementalRateModelRequest.d.ts +25 -0
- package/exchange/request/GetIncrementalRateModelRequest.js +83 -0
- package/exchange/request/GetIncrementalRateModelRequest.js.map +1 -0
- package/exchange/request/GetIncrementalRateModelRequest.ts +90 -0
- package/exchange/request/IncrementalExchangeByStampSheetRequest.d.ts +25 -0
- package/exchange/request/IncrementalExchangeByStampSheetRequest.js +83 -0
- package/exchange/request/IncrementalExchangeByStampSheetRequest.js.map +1 -0
- package/exchange/request/IncrementalExchangeByStampSheetRequest.ts +90 -0
- package/exchange/request/IncrementalExchangeByUserIdRequest.d.ts +42 -0
- package/exchange/request/IncrementalExchangeByUserIdRequest.js +145 -0
- package/exchange/request/IncrementalExchangeByUserIdRequest.js.map +1 -0
- package/exchange/request/IncrementalExchangeByUserIdRequest.ts +155 -0
- package/exchange/request/IncrementalExchangeRequest.d.ts +42 -0
- package/exchange/request/IncrementalExchangeRequest.js +145 -0
- package/exchange/request/IncrementalExchangeRequest.js.map +1 -0
- package/exchange/request/IncrementalExchangeRequest.ts +155 -0
- package/exchange/request/UnlockIncrementalExchangeByStampSheetRequest.d.ts +25 -0
- package/exchange/request/UnlockIncrementalExchangeByStampSheetRequest.js +83 -0
- package/exchange/request/UnlockIncrementalExchangeByStampSheetRequest.js.map +1 -0
- package/exchange/request/UnlockIncrementalExchangeByStampSheetRequest.ts +90 -0
- package/exchange/request/UnlockIncrementalExchangeByUserIdRequest.d.ts +37 -0
- package/exchange/request/UnlockIncrementalExchangeByUserIdRequest.js +123 -0
- package/exchange/request/UnlockIncrementalExchangeByUserIdRequest.js.map +1 -0
- package/exchange/request/UnlockIncrementalExchangeByUserIdRequest.ts +133 -0
- package/exchange/request/UpdateIncrementalRateModelMasterRequest.d.ts +62 -0
- package/exchange/request/UpdateIncrementalRateModelMasterRequest.js +218 -0
- package/exchange/request/UpdateIncrementalRateModelMasterRequest.js.map +1 -0
- package/exchange/request/UpdateIncrementalRateModelMasterRequest.ts +224 -0
- package/exchange/request/index.d.ts +13 -1
- package/exchange/request/index.js +25 -1
- package/exchange/request/index.js.map +1 -1
- package/exchange/request/index.ts +24 -0
- package/exchange/rest.d.ts +12 -0
- package/exchange/rest.js +341 -0
- package/exchange/rest.js.map +1 -1
- package/exchange/rest.ts +389 -0
- package/exchange/result/CreateIncrementalRateModelMasterResult.d.ts +14 -0
- package/exchange/result/CreateIncrementalRateModelMasterResult.js +48 -0
- package/exchange/result/CreateIncrementalRateModelMasterResult.js.map +1 -0
- package/exchange/result/CreateIncrementalRateModelMasterResult.ts +48 -0
- package/exchange/result/DeleteIncrementalRateModelMasterResult.d.ts +14 -0
- package/exchange/result/DeleteIncrementalRateModelMasterResult.js +48 -0
- package/exchange/result/DeleteIncrementalRateModelMasterResult.js.map +1 -0
- package/exchange/result/DeleteIncrementalRateModelMasterResult.ts +48 -0
- package/exchange/result/DescribeIncrementalRateModelMastersResult.d.ts +18 -0
- package/exchange/result/DescribeIncrementalRateModelMastersResult.js +67 -0
- package/exchange/result/DescribeIncrementalRateModelMastersResult.js.map +1 -0
- package/exchange/result/DescribeIncrementalRateModelMastersResult.ts +73 -0
- package/exchange/result/DescribeIncrementalRateModelsResult.d.ts +14 -0
- package/exchange/result/DescribeIncrementalRateModelsResult.js +53 -0
- package/exchange/result/DescribeIncrementalRateModelsResult.js.map +1 -0
- package/exchange/result/DescribeIncrementalRateModelsResult.ts +56 -0
- package/exchange/result/GetIncrementalRateModelMasterResult.d.ts +14 -0
- package/exchange/result/GetIncrementalRateModelMasterResult.js +48 -0
- package/exchange/result/GetIncrementalRateModelMasterResult.js.map +1 -0
- package/exchange/result/GetIncrementalRateModelMasterResult.ts +48 -0
- package/exchange/result/GetIncrementalRateModelResult.d.ts +14 -0
- package/exchange/result/GetIncrementalRateModelResult.js +48 -0
- package/exchange/result/GetIncrementalRateModelResult.js.map +1 -0
- package/exchange/result/GetIncrementalRateModelResult.ts +48 -0
- package/exchange/result/IncrementalExchangeByStampSheetResult.d.ts +30 -0
- package/exchange/result/IncrementalExchangeByStampSheetResult.js +104 -0
- package/exchange/result/IncrementalExchangeByStampSheetResult.js.map +1 -0
- package/exchange/result/IncrementalExchangeByStampSheetResult.ts +116 -0
- package/exchange/result/IncrementalExchangeByUserIdResult.d.ts +30 -0
- package/exchange/result/IncrementalExchangeByUserIdResult.js +104 -0
- package/exchange/result/IncrementalExchangeByUserIdResult.js.map +1 -0
- package/exchange/result/IncrementalExchangeByUserIdResult.ts +116 -0
- package/exchange/result/IncrementalExchangeResult.d.ts +30 -0
- package/exchange/result/IncrementalExchangeResult.js +104 -0
- package/exchange/result/IncrementalExchangeResult.js.map +1 -0
- package/exchange/result/IncrementalExchangeResult.ts +116 -0
- package/exchange/result/UnlockIncrementalExchangeByStampSheetResult.d.ts +14 -0
- package/exchange/result/UnlockIncrementalExchangeByStampSheetResult.js +48 -0
- package/exchange/result/UnlockIncrementalExchangeByStampSheetResult.js.map +1 -0
- package/exchange/result/UnlockIncrementalExchangeByStampSheetResult.ts +48 -0
- package/exchange/result/UnlockIncrementalExchangeByUserIdResult.d.ts +14 -0
- package/exchange/result/UnlockIncrementalExchangeByUserIdResult.js +48 -0
- package/exchange/result/UnlockIncrementalExchangeByUserIdResult.js.map +1 -0
- package/exchange/result/UnlockIncrementalExchangeByUserIdResult.ts +48 -0
- package/exchange/result/UpdateIncrementalRateModelMasterResult.d.ts +14 -0
- package/exchange/result/UpdateIncrementalRateModelMasterResult.js +48 -0
- package/exchange/result/UpdateIncrementalRateModelMasterResult.js.map +1 -0
- package/exchange/result/UpdateIncrementalRateModelMasterResult.ts +48 -0
- package/exchange/result/index.d.ts +13 -1
- package/exchange/result/index.js +25 -1
- package/exchange/result/index.js.map +1 -1
- package/exchange/result/index.ts +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import IModel from '../../core/interface/IModel';
|
|
2
|
+
import ConsumeAction from './ConsumeAction';
|
|
3
|
+
import AcquireAction from './AcquireAction';
|
|
4
|
+
export default class IncrementalRateModel implements IModel {
|
|
5
|
+
private incrementalRateModelId;
|
|
6
|
+
private name;
|
|
7
|
+
private metadata;
|
|
8
|
+
private consumeAction;
|
|
9
|
+
private calculateType;
|
|
10
|
+
private baseValue;
|
|
11
|
+
private coefficientValue;
|
|
12
|
+
private calculateScriptId;
|
|
13
|
+
private exchangeCountId;
|
|
14
|
+
private acquireActions;
|
|
15
|
+
static getRegion(grn: string): string | null;
|
|
16
|
+
static getOwnerId(grn: string): string | null;
|
|
17
|
+
static getNamespaceName(grn: string): string | null;
|
|
18
|
+
static getRateName(grn: string): string | null;
|
|
19
|
+
static isValid(grn: string): boolean;
|
|
20
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, rateName: string | null): string | null;
|
|
21
|
+
getIncrementalRateModelId(): string | null;
|
|
22
|
+
setIncrementalRateModelId(incrementalRateModelId: string | null): this;
|
|
23
|
+
withIncrementalRateModelId(incrementalRateModelId: string | null): this;
|
|
24
|
+
getName(): string | null;
|
|
25
|
+
setName(name: string | null): this;
|
|
26
|
+
withName(name: string | null): this;
|
|
27
|
+
getMetadata(): string | null;
|
|
28
|
+
setMetadata(metadata: string | null): this;
|
|
29
|
+
withMetadata(metadata: string | null): this;
|
|
30
|
+
getConsumeAction(): ConsumeAction | null;
|
|
31
|
+
setConsumeAction(consumeAction: ConsumeAction | null): this;
|
|
32
|
+
withConsumeAction(consumeAction: ConsumeAction | null): this;
|
|
33
|
+
getCalculateType(): string | null;
|
|
34
|
+
setCalculateType(calculateType: string | null): this;
|
|
35
|
+
withCalculateType(calculateType: string | null): this;
|
|
36
|
+
getBaseValue(): number | null;
|
|
37
|
+
setBaseValue(baseValue: number | null): this;
|
|
38
|
+
withBaseValue(baseValue: number | null): this;
|
|
39
|
+
getCoefficientValue(): number | null;
|
|
40
|
+
setCoefficientValue(coefficientValue: number | null): this;
|
|
41
|
+
withCoefficientValue(coefficientValue: number | null): this;
|
|
42
|
+
getCalculateScriptId(): string | null;
|
|
43
|
+
setCalculateScriptId(calculateScriptId: string | null): this;
|
|
44
|
+
withCalculateScriptId(calculateScriptId: string | null): this;
|
|
45
|
+
getExchangeCountId(): string | null;
|
|
46
|
+
setExchangeCountId(exchangeCountId: string | null): this;
|
|
47
|
+
withExchangeCountId(exchangeCountId: string | null): this;
|
|
48
|
+
getAcquireActions(): AcquireAction[] | null;
|
|
49
|
+
setAcquireActions(acquireActions: AcquireAction[] | null): this;
|
|
50
|
+
withAcquireActions(acquireActions: AcquireAction[] | null): this;
|
|
51
|
+
static fromDict(data: {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}): IncrementalRateModel | null;
|
|
54
|
+
toDict(): {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
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 ConsumeAction_1 = tslib_1.__importDefault(require("./ConsumeAction"));
|
|
20
|
+
var AcquireAction_1 = tslib_1.__importDefault(require("./AcquireAction"));
|
|
21
|
+
var grnFormat = "grn:gs2:{region}:{ownerId}:exchange:{namespaceName}:incremental:model:{rateName}";
|
|
22
|
+
var IncrementalRateModel = /** @class */ (function () {
|
|
23
|
+
function IncrementalRateModel() {
|
|
24
|
+
this.incrementalRateModelId = null;
|
|
25
|
+
this.name = null;
|
|
26
|
+
this.metadata = null;
|
|
27
|
+
this.consumeAction = null;
|
|
28
|
+
this.calculateType = null;
|
|
29
|
+
this.baseValue = null;
|
|
30
|
+
this.coefficientValue = null;
|
|
31
|
+
this.calculateScriptId = null;
|
|
32
|
+
this.exchangeCountId = null;
|
|
33
|
+
this.acquireActions = null;
|
|
34
|
+
}
|
|
35
|
+
IncrementalRateModel.getRegion = function (grn) {
|
|
36
|
+
var match = grn.match(grnFormat
|
|
37
|
+
.replace('{region}', '(.*)')
|
|
38
|
+
.replace('{ownerId}', '.*')
|
|
39
|
+
.replace('{namespaceName}', '.*')
|
|
40
|
+
.replace('{rateName}', '.*'));
|
|
41
|
+
if (match) {
|
|
42
|
+
return match[1];
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
46
|
+
IncrementalRateModel.getOwnerId = function (grn) {
|
|
47
|
+
var match = grn.match(grnFormat
|
|
48
|
+
.replace('{region}', '.*')
|
|
49
|
+
.replace('{ownerId}', '(.*)')
|
|
50
|
+
.replace('{namespaceName}', '.*')
|
|
51
|
+
.replace('{rateName}', '.*'));
|
|
52
|
+
if (match) {
|
|
53
|
+
return match[1];
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
};
|
|
57
|
+
IncrementalRateModel.getNamespaceName = function (grn) {
|
|
58
|
+
var match = grn.match(grnFormat
|
|
59
|
+
.replace('{region}', '.*')
|
|
60
|
+
.replace('{ownerId}', '.*')
|
|
61
|
+
.replace('{namespaceName}', '(.*)')
|
|
62
|
+
.replace('{rateName}', '.*'));
|
|
63
|
+
if (match) {
|
|
64
|
+
return match[1];
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
};
|
|
68
|
+
IncrementalRateModel.getRateName = function (grn) {
|
|
69
|
+
var match = grn.match(grnFormat
|
|
70
|
+
.replace('{region}', '.*')
|
|
71
|
+
.replace('{ownerId}', '.*')
|
|
72
|
+
.replace('{namespaceName}', '.*')
|
|
73
|
+
.replace('{rateName}', '(.*)'));
|
|
74
|
+
if (match) {
|
|
75
|
+
return match[1];
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
};
|
|
79
|
+
IncrementalRateModel.isValid = function (grn) {
|
|
80
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (this.getRateName(grn) == null || this.getRateName(grn) === '') {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
93
|
+
};
|
|
94
|
+
IncrementalRateModel.createGrn = function (region, ownerId, namespaceName, rateName) {
|
|
95
|
+
return grnFormat
|
|
96
|
+
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
97
|
+
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
98
|
+
.replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
|
|
99
|
+
.replace('{rateName}', rateName !== null && rateName !== void 0 ? rateName : '');
|
|
100
|
+
};
|
|
101
|
+
IncrementalRateModel.prototype.getIncrementalRateModelId = function () {
|
|
102
|
+
return this.incrementalRateModelId;
|
|
103
|
+
};
|
|
104
|
+
IncrementalRateModel.prototype.setIncrementalRateModelId = function (incrementalRateModelId) {
|
|
105
|
+
this.incrementalRateModelId = incrementalRateModelId;
|
|
106
|
+
return this;
|
|
107
|
+
};
|
|
108
|
+
IncrementalRateModel.prototype.withIncrementalRateModelId = function (incrementalRateModelId) {
|
|
109
|
+
this.incrementalRateModelId = incrementalRateModelId;
|
|
110
|
+
return this;
|
|
111
|
+
};
|
|
112
|
+
IncrementalRateModel.prototype.getName = function () {
|
|
113
|
+
return this.name;
|
|
114
|
+
};
|
|
115
|
+
IncrementalRateModel.prototype.setName = function (name) {
|
|
116
|
+
this.name = name;
|
|
117
|
+
return this;
|
|
118
|
+
};
|
|
119
|
+
IncrementalRateModel.prototype.withName = function (name) {
|
|
120
|
+
this.name = name;
|
|
121
|
+
return this;
|
|
122
|
+
};
|
|
123
|
+
IncrementalRateModel.prototype.getMetadata = function () {
|
|
124
|
+
return this.metadata;
|
|
125
|
+
};
|
|
126
|
+
IncrementalRateModel.prototype.setMetadata = function (metadata) {
|
|
127
|
+
this.metadata = metadata;
|
|
128
|
+
return this;
|
|
129
|
+
};
|
|
130
|
+
IncrementalRateModel.prototype.withMetadata = function (metadata) {
|
|
131
|
+
this.metadata = metadata;
|
|
132
|
+
return this;
|
|
133
|
+
};
|
|
134
|
+
IncrementalRateModel.prototype.getConsumeAction = function () {
|
|
135
|
+
return this.consumeAction;
|
|
136
|
+
};
|
|
137
|
+
IncrementalRateModel.prototype.setConsumeAction = function (consumeAction) {
|
|
138
|
+
this.consumeAction = consumeAction;
|
|
139
|
+
return this;
|
|
140
|
+
};
|
|
141
|
+
IncrementalRateModel.prototype.withConsumeAction = function (consumeAction) {
|
|
142
|
+
this.consumeAction = consumeAction;
|
|
143
|
+
return this;
|
|
144
|
+
};
|
|
145
|
+
IncrementalRateModel.prototype.getCalculateType = function () {
|
|
146
|
+
return this.calculateType;
|
|
147
|
+
};
|
|
148
|
+
IncrementalRateModel.prototype.setCalculateType = function (calculateType) {
|
|
149
|
+
this.calculateType = calculateType;
|
|
150
|
+
return this;
|
|
151
|
+
};
|
|
152
|
+
IncrementalRateModel.prototype.withCalculateType = function (calculateType) {
|
|
153
|
+
this.calculateType = calculateType;
|
|
154
|
+
return this;
|
|
155
|
+
};
|
|
156
|
+
IncrementalRateModel.prototype.getBaseValue = function () {
|
|
157
|
+
return this.baseValue;
|
|
158
|
+
};
|
|
159
|
+
IncrementalRateModel.prototype.setBaseValue = function (baseValue) {
|
|
160
|
+
this.baseValue = baseValue;
|
|
161
|
+
return this;
|
|
162
|
+
};
|
|
163
|
+
IncrementalRateModel.prototype.withBaseValue = function (baseValue) {
|
|
164
|
+
this.baseValue = baseValue;
|
|
165
|
+
return this;
|
|
166
|
+
};
|
|
167
|
+
IncrementalRateModel.prototype.getCoefficientValue = function () {
|
|
168
|
+
return this.coefficientValue;
|
|
169
|
+
};
|
|
170
|
+
IncrementalRateModel.prototype.setCoefficientValue = function (coefficientValue) {
|
|
171
|
+
this.coefficientValue = coefficientValue;
|
|
172
|
+
return this;
|
|
173
|
+
};
|
|
174
|
+
IncrementalRateModel.prototype.withCoefficientValue = function (coefficientValue) {
|
|
175
|
+
this.coefficientValue = coefficientValue;
|
|
176
|
+
return this;
|
|
177
|
+
};
|
|
178
|
+
IncrementalRateModel.prototype.getCalculateScriptId = function () {
|
|
179
|
+
return this.calculateScriptId;
|
|
180
|
+
};
|
|
181
|
+
IncrementalRateModel.prototype.setCalculateScriptId = function (calculateScriptId) {
|
|
182
|
+
this.calculateScriptId = calculateScriptId;
|
|
183
|
+
return this;
|
|
184
|
+
};
|
|
185
|
+
IncrementalRateModel.prototype.withCalculateScriptId = function (calculateScriptId) {
|
|
186
|
+
this.calculateScriptId = calculateScriptId;
|
|
187
|
+
return this;
|
|
188
|
+
};
|
|
189
|
+
IncrementalRateModel.prototype.getExchangeCountId = function () {
|
|
190
|
+
return this.exchangeCountId;
|
|
191
|
+
};
|
|
192
|
+
IncrementalRateModel.prototype.setExchangeCountId = function (exchangeCountId) {
|
|
193
|
+
this.exchangeCountId = exchangeCountId;
|
|
194
|
+
return this;
|
|
195
|
+
};
|
|
196
|
+
IncrementalRateModel.prototype.withExchangeCountId = function (exchangeCountId) {
|
|
197
|
+
this.exchangeCountId = exchangeCountId;
|
|
198
|
+
return this;
|
|
199
|
+
};
|
|
200
|
+
IncrementalRateModel.prototype.getAcquireActions = function () {
|
|
201
|
+
return this.acquireActions;
|
|
202
|
+
};
|
|
203
|
+
IncrementalRateModel.prototype.setAcquireActions = function (acquireActions) {
|
|
204
|
+
this.acquireActions = acquireActions;
|
|
205
|
+
return this;
|
|
206
|
+
};
|
|
207
|
+
IncrementalRateModel.prototype.withAcquireActions = function (acquireActions) {
|
|
208
|
+
this.acquireActions = acquireActions;
|
|
209
|
+
return this;
|
|
210
|
+
};
|
|
211
|
+
IncrementalRateModel.fromDict = function (data) {
|
|
212
|
+
if (data == undefined || data == null) {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
return new IncrementalRateModel()
|
|
216
|
+
.withIncrementalRateModelId(data["incrementalRateModelId"])
|
|
217
|
+
.withName(data["name"])
|
|
218
|
+
.withMetadata(data["metadata"])
|
|
219
|
+
.withConsumeAction(ConsumeAction_1.default.fromDict(data["consumeAction"]))
|
|
220
|
+
.withCalculateType(data["calculateType"])
|
|
221
|
+
.withBaseValue(data["baseValue"])
|
|
222
|
+
.withCoefficientValue(data["coefficientValue"])
|
|
223
|
+
.withCalculateScriptId(data["calculateScriptId"])
|
|
224
|
+
.withExchangeCountId(data["exchangeCountId"])
|
|
225
|
+
.withAcquireActions(data.acquireActions ?
|
|
226
|
+
data.acquireActions.map(function (item) {
|
|
227
|
+
return AcquireAction_1.default.fromDict(item);
|
|
228
|
+
}) : []);
|
|
229
|
+
};
|
|
230
|
+
IncrementalRateModel.prototype.toDict = function () {
|
|
231
|
+
var _a;
|
|
232
|
+
return {
|
|
233
|
+
"incrementalRateModelId": this.getIncrementalRateModelId(),
|
|
234
|
+
"name": this.getName(),
|
|
235
|
+
"metadata": this.getMetadata(),
|
|
236
|
+
"consumeAction": (_a = this.getConsumeAction()) === null || _a === void 0 ? void 0 : _a.toDict(),
|
|
237
|
+
"calculateType": this.getCalculateType(),
|
|
238
|
+
"baseValue": this.getBaseValue(),
|
|
239
|
+
"coefficientValue": this.getCoefficientValue(),
|
|
240
|
+
"calculateScriptId": this.getCalculateScriptId(),
|
|
241
|
+
"exchangeCountId": this.getExchangeCountId(),
|
|
242
|
+
"acquireActions": this.getAcquireActions() ?
|
|
243
|
+
this.getAcquireActions().map(function (item) {
|
|
244
|
+
return item.toDict();
|
|
245
|
+
}) : [],
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
return IncrementalRateModel;
|
|
249
|
+
}());
|
|
250
|
+
exports.default = IncrementalRateModel;
|
|
251
|
+
//# sourceMappingURL=IncrementalRateModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IncrementalRateModel.js","sourceRoot":"","sources":["IncrementalRateModel.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,0EAA4C;AAC5C,0EAA4C;AAC5C,IAAM,SAAS,GAAW,kFAAkF,CAAC;AAE7G;IAAA;QACY,2BAAsB,GAAgB,IAAI,CAAC;QAC3C,SAAI,GAAgB,IAAI,CAAC;QACzB,aAAQ,GAAgB,IAAI,CAAC;QAC7B,kBAAa,GAAuB,IAAI,CAAC;QACzC,kBAAa,GAAgB,IAAI,CAAC;QAClC,cAAS,GAAgB,IAAI,CAAC;QAC9B,qBAAgB,GAAgB,IAAI,CAAC;QACrC,sBAAiB,GAAgB,IAAI,CAAC;QACtC,oBAAe,GAAgB,IAAI,CAAC;QACpC,mBAAc,GAAyB,IAAI,CAAC;IAwOxD,CAAC;IAtOiB,8BAAS,GAAvB,UAAwB,GAAW;QAC/B,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS;aAC5B,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC;aAC3B,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC;aAC1B,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;aAChC,OAAO,CAAC,YAAY,EAAE,IAAI,CA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,CAAC;YACxC,CAAC,CACJ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;IAEM,qCAAM,GAAb;;QACI,OAAO;YACH,wBAAwB,EAAE,IAAI,CAAC,yBAAyB,EAAE;YAC1D,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE;YACtB,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE;YAC9B,eAAe,EAAE,MAAA,IAAI,CAAC,gBAAgB,EAAE,0CAAE,MAAM,EAAE;YAClD,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACxC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;YAChC,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,EAAE;YAC9C,mBAAmB,EAAE,IAAI,CAAC,oBAAoB,EAAE;YAChD,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE;YAC5C,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;gBACxC,IAAI,CAAC,iBAAiB,EAAG,CAAC,GAAG,CAAC,UAAC,IAAmB;oBAC9C,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzB,CAAC,CACJ,CAAC,CAAC,CAAC,EAAE;SACT,CAAC;IACN,CAAC;IACL,2BAAC;AAAD,CAAC,AAlPD,IAkPC"}
|
|
@@ -0,0 +1,264 @@
|
|
|
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
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:exchange:{namespaceName}:incremental:model:{rateName}";
|
|
21
|
+
|
|
22
|
+
export default class IncrementalRateModel implements IModel {
|
|
23
|
+
private incrementalRateModelId: string|null = null;
|
|
24
|
+
private name: string|null = null;
|
|
25
|
+
private metadata: string|null = null;
|
|
26
|
+
private consumeAction: ConsumeAction|null = null;
|
|
27
|
+
private calculateType: string|null = null;
|
|
28
|
+
private baseValue: number|null = null;
|
|
29
|
+
private coefficientValue: number|null = null;
|
|
30
|
+
private calculateScriptId: string|null = null;
|
|
31
|
+
private exchangeCountId: string|null = null;
|
|
32
|
+
private acquireActions: AcquireAction[]|null = null;
|
|
33
|
+
|
|
34
|
+
public static getRegion(grn: string): string|null {
|
|
35
|
+
const match = grn.match(grnFormat
|
|
36
|
+
.replace('{region}', '(.*)')
|
|
37
|
+
.replace('{ownerId}', '.*')
|
|
38
|
+
.replace('{namespaceName}', '.*')
|
|
39
|
+
.replace('{rateName}', '.*')
|
|
40
|
+
);
|
|
41
|
+
if (match) {
|
|
42
|
+
return match[1];
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static getOwnerId(grn: string): string|null {
|
|
48
|
+
const match = grn.match(grnFormat
|
|
49
|
+
.replace('{region}', '.*')
|
|
50
|
+
.replace('{ownerId}', '(.*)')
|
|
51
|
+
.replace('{namespaceName}', '.*')
|
|
52
|
+
.replace('{rateName}', '.*')
|
|
53
|
+
);
|
|
54
|
+
if (match) {
|
|
55
|
+
return match[1];
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public static getNamespaceName(grn: string): string|null {
|
|
61
|
+
const match = grn.match(grnFormat
|
|
62
|
+
.replace('{region}', '.*')
|
|
63
|
+
.replace('{ownerId}', '.*')
|
|
64
|
+
.replace('{namespaceName}', '(.*)')
|
|
65
|
+
.replace('{rateName}', '.*')
|
|
66
|
+
);
|
|
67
|
+
if (match) {
|
|
68
|
+
return match[1];
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public static getRateName(grn: string): string|null {
|
|
74
|
+
const match = grn.match(grnFormat
|
|
75
|
+
.replace('{region}', '.*')
|
|
76
|
+
.replace('{ownerId}', '.*')
|
|
77
|
+
.replace('{namespaceName}', '.*')
|
|
78
|
+
.replace('{rateName}', '(.*)')
|
|
79
|
+
);
|
|
80
|
+
if (match) {
|
|
81
|
+
return match[1];
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public static isValid(grn: string): boolean {
|
|
87
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (this.getRateName(grn) == null || this.getRateName(grn) === '') {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public static createGrn(
|
|
103
|
+
region: string|null,
|
|
104
|
+
ownerId: string|null,
|
|
105
|
+
namespaceName: string|null,
|
|
106
|
+
rateName: string|null,
|
|
107
|
+
): string|null {
|
|
108
|
+
return grnFormat
|
|
109
|
+
.replace('{region}', region ?? '')
|
|
110
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
111
|
+
.replace('{namespaceName}', namespaceName ?? '')
|
|
112
|
+
.replace('{rateName}', rateName ?? '');
|
|
113
|
+
}
|
|
114
|
+
public getIncrementalRateModelId(): string|null {
|
|
115
|
+
return this.incrementalRateModelId;
|
|
116
|
+
}
|
|
117
|
+
public setIncrementalRateModelId(incrementalRateModelId: string|null) {
|
|
118
|
+
this.incrementalRateModelId = incrementalRateModelId;
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
public withIncrementalRateModelId(incrementalRateModelId: string|null): this {
|
|
122
|
+
this.incrementalRateModelId = incrementalRateModelId;
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
public getName(): string|null {
|
|
126
|
+
return this.name;
|
|
127
|
+
}
|
|
128
|
+
public setName(name: string|null) {
|
|
129
|
+
this.name = name;
|
|
130
|
+
return this;
|
|
131
|
+
}
|
|
132
|
+
public withName(name: string|null): this {
|
|
133
|
+
this.name = name;
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
public getMetadata(): string|null {
|
|
137
|
+
return this.metadata;
|
|
138
|
+
}
|
|
139
|
+
public setMetadata(metadata: string|null) {
|
|
140
|
+
this.metadata = metadata;
|
|
141
|
+
return this;
|
|
142
|
+
}
|
|
143
|
+
public withMetadata(metadata: string|null): this {
|
|
144
|
+
this.metadata = metadata;
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
public getConsumeAction(): ConsumeAction|null {
|
|
148
|
+
return this.consumeAction;
|
|
149
|
+
}
|
|
150
|
+
public setConsumeAction(consumeAction: ConsumeAction|null) {
|
|
151
|
+
this.consumeAction = consumeAction;
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
public withConsumeAction(consumeAction: ConsumeAction|null): this {
|
|
155
|
+
this.consumeAction = consumeAction;
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
public getCalculateType(): string|null {
|
|
159
|
+
return this.calculateType;
|
|
160
|
+
}
|
|
161
|
+
public setCalculateType(calculateType: string|null) {
|
|
162
|
+
this.calculateType = calculateType;
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
public withCalculateType(calculateType: string|null): this {
|
|
166
|
+
this.calculateType = calculateType;
|
|
167
|
+
return this;
|
|
168
|
+
}
|
|
169
|
+
public getBaseValue(): number|null {
|
|
170
|
+
return this.baseValue;
|
|
171
|
+
}
|
|
172
|
+
public setBaseValue(baseValue: number|null) {
|
|
173
|
+
this.baseValue = baseValue;
|
|
174
|
+
return this;
|
|
175
|
+
}
|
|
176
|
+
public withBaseValue(baseValue: number|null): this {
|
|
177
|
+
this.baseValue = baseValue;
|
|
178
|
+
return this;
|
|
179
|
+
}
|
|
180
|
+
public getCoefficientValue(): number|null {
|
|
181
|
+
return this.coefficientValue;
|
|
182
|
+
}
|
|
183
|
+
public setCoefficientValue(coefficientValue: number|null) {
|
|
184
|
+
this.coefficientValue = coefficientValue;
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
public withCoefficientValue(coefficientValue: number|null): this {
|
|
188
|
+
this.coefficientValue = coefficientValue;
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
public getCalculateScriptId(): string|null {
|
|
192
|
+
return this.calculateScriptId;
|
|
193
|
+
}
|
|
194
|
+
public setCalculateScriptId(calculateScriptId: string|null) {
|
|
195
|
+
this.calculateScriptId = calculateScriptId;
|
|
196
|
+
return this;
|
|
197
|
+
}
|
|
198
|
+
public withCalculateScriptId(calculateScriptId: string|null): this {
|
|
199
|
+
this.calculateScriptId = calculateScriptId;
|
|
200
|
+
return this;
|
|
201
|
+
}
|
|
202
|
+
public getExchangeCountId(): string|null {
|
|
203
|
+
return this.exchangeCountId;
|
|
204
|
+
}
|
|
205
|
+
public setExchangeCountId(exchangeCountId: string|null) {
|
|
206
|
+
this.exchangeCountId = exchangeCountId;
|
|
207
|
+
return this;
|
|
208
|
+
}
|
|
209
|
+
public withExchangeCountId(exchangeCountId: string|null): this {
|
|
210
|
+
this.exchangeCountId = exchangeCountId;
|
|
211
|
+
return this;
|
|
212
|
+
}
|
|
213
|
+
public getAcquireActions(): AcquireAction[]|null {
|
|
214
|
+
return this.acquireActions;
|
|
215
|
+
}
|
|
216
|
+
public setAcquireActions(acquireActions: AcquireAction[]|null) {
|
|
217
|
+
this.acquireActions = acquireActions;
|
|
218
|
+
return this;
|
|
219
|
+
}
|
|
220
|
+
public withAcquireActions(acquireActions: AcquireAction[]|null): this {
|
|
221
|
+
this.acquireActions = acquireActions;
|
|
222
|
+
return this;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
public static fromDict(data: {[key: string]: any}): IncrementalRateModel|null {
|
|
226
|
+
if (data == undefined || data == null) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
return new IncrementalRateModel()
|
|
230
|
+
.withIncrementalRateModelId(data["incrementalRateModelId"])
|
|
231
|
+
.withName(data["name"])
|
|
232
|
+
.withMetadata(data["metadata"])
|
|
233
|
+
.withConsumeAction(ConsumeAction.fromDict(data["consumeAction"]))
|
|
234
|
+
.withCalculateType(data["calculateType"])
|
|
235
|
+
.withBaseValue(data["baseValue"])
|
|
236
|
+
.withCoefficientValue(data["coefficientValue"])
|
|
237
|
+
.withCalculateScriptId(data["calculateScriptId"])
|
|
238
|
+
.withExchangeCountId(data["exchangeCountId"])
|
|
239
|
+
.withAcquireActions(data.acquireActions ?
|
|
240
|
+
data.acquireActions.map((item: {[key: string]: any}) => {
|
|
241
|
+
return AcquireAction.fromDict(item);
|
|
242
|
+
}
|
|
243
|
+
) : []);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
public toDict(): {[key: string]: any} {
|
|
247
|
+
return {
|
|
248
|
+
"incrementalRateModelId": this.getIncrementalRateModelId(),
|
|
249
|
+
"name": this.getName(),
|
|
250
|
+
"metadata": this.getMetadata(),
|
|
251
|
+
"consumeAction": this.getConsumeAction()?.toDict(),
|
|
252
|
+
"calculateType": this.getCalculateType(),
|
|
253
|
+
"baseValue": this.getBaseValue(),
|
|
254
|
+
"coefficientValue": this.getCoefficientValue(),
|
|
255
|
+
"calculateScriptId": this.getCalculateScriptId(),
|
|
256
|
+
"exchangeCountId": this.getExchangeCountId(),
|
|
257
|
+
"acquireActions": this.getAcquireActions() ?
|
|
258
|
+
this.getAcquireActions()!.map((item: AcquireAction) => {
|
|
259
|
+
return item.toDict();
|
|
260
|
+
}
|
|
261
|
+
) : [],
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import IModel from '../../core/interface/IModel';
|
|
2
|
+
import ConsumeAction from './ConsumeAction';
|
|
3
|
+
import AcquireAction from './AcquireAction';
|
|
4
|
+
export default class IncrementalRateModelMaster implements IModel {
|
|
5
|
+
private incrementalRateModelId;
|
|
6
|
+
private name;
|
|
7
|
+
private description;
|
|
8
|
+
private metadata;
|
|
9
|
+
private consumeAction;
|
|
10
|
+
private calculateType;
|
|
11
|
+
private baseValue;
|
|
12
|
+
private coefficientValue;
|
|
13
|
+
private calculateScriptId;
|
|
14
|
+
private exchangeCountId;
|
|
15
|
+
private acquireActions;
|
|
16
|
+
private createdAt;
|
|
17
|
+
private updatedAt;
|
|
18
|
+
static getRegion(grn: string): string | null;
|
|
19
|
+
static getOwnerId(grn: string): string | null;
|
|
20
|
+
static getNamespaceName(grn: string): string | null;
|
|
21
|
+
static getRateName(grn: string): string | null;
|
|
22
|
+
static isValid(grn: string): boolean;
|
|
23
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, rateName: string | null): string | null;
|
|
24
|
+
getIncrementalRateModelId(): string | null;
|
|
25
|
+
setIncrementalRateModelId(incrementalRateModelId: string | null): this;
|
|
26
|
+
withIncrementalRateModelId(incrementalRateModelId: string | null): this;
|
|
27
|
+
getName(): string | null;
|
|
28
|
+
setName(name: string | null): this;
|
|
29
|
+
withName(name: string | null): this;
|
|
30
|
+
getDescription(): string | null;
|
|
31
|
+
setDescription(description: string | null): this;
|
|
32
|
+
withDescription(description: string | null): this;
|
|
33
|
+
getMetadata(): string | null;
|
|
34
|
+
setMetadata(metadata: string | null): this;
|
|
35
|
+
withMetadata(metadata: string | null): this;
|
|
36
|
+
getConsumeAction(): ConsumeAction | null;
|
|
37
|
+
setConsumeAction(consumeAction: ConsumeAction | null): this;
|
|
38
|
+
withConsumeAction(consumeAction: ConsumeAction | null): this;
|
|
39
|
+
getCalculateType(): string | null;
|
|
40
|
+
setCalculateType(calculateType: string | null): this;
|
|
41
|
+
withCalculateType(calculateType: string | null): this;
|
|
42
|
+
getBaseValue(): number | null;
|
|
43
|
+
setBaseValue(baseValue: number | null): this;
|
|
44
|
+
withBaseValue(baseValue: number | null): this;
|
|
45
|
+
getCoefficientValue(): number | null;
|
|
46
|
+
setCoefficientValue(coefficientValue: number | null): this;
|
|
47
|
+
withCoefficientValue(coefficientValue: number | null): this;
|
|
48
|
+
getCalculateScriptId(): string | null;
|
|
49
|
+
setCalculateScriptId(calculateScriptId: string | null): this;
|
|
50
|
+
withCalculateScriptId(calculateScriptId: string | null): this;
|
|
51
|
+
getExchangeCountId(): string | null;
|
|
52
|
+
setExchangeCountId(exchangeCountId: string | null): this;
|
|
53
|
+
withExchangeCountId(exchangeCountId: string | null): this;
|
|
54
|
+
getAcquireActions(): AcquireAction[] | null;
|
|
55
|
+
setAcquireActions(acquireActions: AcquireAction[] | null): this;
|
|
56
|
+
withAcquireActions(acquireActions: AcquireAction[] | null): this;
|
|
57
|
+
getCreatedAt(): number | null;
|
|
58
|
+
setCreatedAt(createdAt: number | null): this;
|
|
59
|
+
withCreatedAt(createdAt: number | null): this;
|
|
60
|
+
getUpdatedAt(): number | null;
|
|
61
|
+
setUpdatedAt(updatedAt: number | null): this;
|
|
62
|
+
withUpdatedAt(updatedAt: number | null): this;
|
|
63
|
+
static fromDict(data: {
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
}): IncrementalRateModelMaster | null;
|
|
66
|
+
toDict(): {
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
};
|
|
69
|
+
}
|