gs2 1.3.199 → 1.3.201

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 (141) hide show
  1. package/enhance/model/UnleashRateEntryModel.d.ts +17 -0
  2. package/enhance/model/UnleashRateEntryModel.js +62 -0
  3. package/enhance/model/UnleashRateEntryModel.js.map +1 -0
  4. package/enhance/model/UnleashRateEntryModel.ts +60 -0
  5. package/enhance/model/UnleashRateModel.d.ts +44 -0
  6. package/enhance/model/UnleashRateModel.js +207 -0
  7. package/enhance/model/UnleashRateModel.js.map +1 -0
  8. package/enhance/model/UnleashRateModel.ts +221 -0
  9. package/enhance/model/UnleashRateModelMaster.d.ts +56 -0
  10. package/enhance/model/UnleashRateModelMaster.js +249 -0
  11. package/enhance/model/UnleashRateModelMaster.js.map +1 -0
  12. package/enhance/model/UnleashRateModelMaster.ts +263 -0
  13. package/enhance/model/index.d.ts +4 -1
  14. package/enhance/model/index.js +7 -1
  15. package/enhance/model/index.js.map +1 -1
  16. package/enhance/model/index.ts +6 -0
  17. package/enhance/request/CreateUnleashRateModelMasterRequest.d.ts +46 -0
  18. package/enhance/request/CreateUnleashRateModelMasterRequest.js +161 -0
  19. package/enhance/request/CreateUnleashRateModelMasterRequest.js.map +1 -0
  20. package/enhance/request/CreateUnleashRateModelMasterRequest.ts +168 -0
  21. package/enhance/request/DeleteUnleashRateModelMasterRequest.d.ts +25 -0
  22. package/enhance/request/DeleteUnleashRateModelMasterRequest.js +83 -0
  23. package/enhance/request/DeleteUnleashRateModelMasterRequest.js.map +1 -0
  24. package/enhance/request/DeleteUnleashRateModelMasterRequest.ts +90 -0
  25. package/enhance/request/DescribeUnleashRateModelMastersRequest.d.ts +29 -0
  26. package/enhance/request/DescribeUnleashRateModelMastersRequest.js +97 -0
  27. package/enhance/request/DescribeUnleashRateModelMastersRequest.js.map +1 -0
  28. package/enhance/request/DescribeUnleashRateModelMastersRequest.ts +104 -0
  29. package/enhance/request/DescribeUnleashRateModelsRequest.d.ts +21 -0
  30. package/enhance/request/DescribeUnleashRateModelsRequest.js +69 -0
  31. package/enhance/request/DescribeUnleashRateModelsRequest.js.map +1 -0
  32. package/enhance/request/DescribeUnleashRateModelsRequest.ts +76 -0
  33. package/enhance/request/GetUnleashRateModelMasterRequest.d.ts +25 -0
  34. package/enhance/request/GetUnleashRateModelMasterRequest.js +83 -0
  35. package/enhance/request/GetUnleashRateModelMasterRequest.js.map +1 -0
  36. package/enhance/request/GetUnleashRateModelMasterRequest.ts +90 -0
  37. package/enhance/request/GetUnleashRateModelRequest.d.ts +25 -0
  38. package/enhance/request/GetUnleashRateModelRequest.js +83 -0
  39. package/enhance/request/GetUnleashRateModelRequest.js.map +1 -0
  40. package/enhance/request/GetUnleashRateModelRequest.ts +90 -0
  41. package/enhance/request/UnleashByStampSheetRequest.d.ts +25 -0
  42. package/enhance/request/UnleashByStampSheetRequest.js +83 -0
  43. package/enhance/request/UnleashByStampSheetRequest.js.map +1 -0
  44. package/enhance/request/UnleashByStampSheetRequest.ts +90 -0
  45. package/enhance/request/UnleashByUserIdRequest.d.ts +46 -0
  46. package/enhance/request/UnleashByUserIdRequest.js +165 -0
  47. package/enhance/request/UnleashByUserIdRequest.js.map +1 -0
  48. package/enhance/request/UnleashByUserIdRequest.ts +177 -0
  49. package/enhance/request/UnleashRequest.d.ts +46 -0
  50. package/enhance/request/UnleashRequest.js +165 -0
  51. package/enhance/request/UnleashRequest.js.map +1 -0
  52. package/enhance/request/UnleashRequest.ts +177 -0
  53. package/enhance/request/UpdateUnleashRateModelMasterRequest.d.ts +46 -0
  54. package/enhance/request/UpdateUnleashRateModelMasterRequest.js +161 -0
  55. package/enhance/request/UpdateUnleashRateModelMasterRequest.js.map +1 -0
  56. package/enhance/request/UpdateUnleashRateModelMasterRequest.ts +168 -0
  57. package/enhance/request/index.d.ts +11 -1
  58. package/enhance/request/index.js +21 -1
  59. package/enhance/request/index.js.map +1 -1
  60. package/enhance/request/index.ts +20 -0
  61. package/enhance/rest.d.ts +10 -0
  62. package/enhance/rest.js +276 -0
  63. package/enhance/rest.js.map +1 -1
  64. package/enhance/rest.ts +316 -0
  65. package/enhance/result/CreateUnleashRateModelMasterResult.d.ts +14 -0
  66. package/enhance/result/CreateUnleashRateModelMasterResult.js +48 -0
  67. package/enhance/result/CreateUnleashRateModelMasterResult.js.map +1 -0
  68. package/enhance/result/CreateUnleashRateModelMasterResult.ts +48 -0
  69. package/enhance/result/DeleteUnleashRateModelMasterResult.d.ts +14 -0
  70. package/enhance/result/DeleteUnleashRateModelMasterResult.js +48 -0
  71. package/enhance/result/DeleteUnleashRateModelMasterResult.js.map +1 -0
  72. package/enhance/result/DeleteUnleashRateModelMasterResult.ts +48 -0
  73. package/enhance/result/DescribeUnleashRateModelMastersResult.d.ts +18 -0
  74. package/enhance/result/DescribeUnleashRateModelMastersResult.js +67 -0
  75. package/enhance/result/DescribeUnleashRateModelMastersResult.js.map +1 -0
  76. package/enhance/result/DescribeUnleashRateModelMastersResult.ts +73 -0
  77. package/enhance/result/DescribeUnleashRateModelsResult.d.ts +14 -0
  78. package/enhance/result/DescribeUnleashRateModelsResult.js +53 -0
  79. package/enhance/result/DescribeUnleashRateModelsResult.js.map +1 -0
  80. package/enhance/result/DescribeUnleashRateModelsResult.ts +56 -0
  81. package/enhance/result/GetUnleashRateModelMasterResult.d.ts +14 -0
  82. package/enhance/result/GetUnleashRateModelMasterResult.js +48 -0
  83. package/enhance/result/GetUnleashRateModelMasterResult.js.map +1 -0
  84. package/enhance/result/GetUnleashRateModelMasterResult.ts +48 -0
  85. package/enhance/result/GetUnleashRateModelResult.d.ts +14 -0
  86. package/enhance/result/GetUnleashRateModelResult.js +48 -0
  87. package/enhance/result/GetUnleashRateModelResult.js.map +1 -0
  88. package/enhance/result/GetUnleashRateModelResult.ts +48 -0
  89. package/enhance/result/UnleashByStampSheetResult.d.ts +30 -0
  90. package/enhance/result/UnleashByStampSheetResult.js +104 -0
  91. package/enhance/result/UnleashByStampSheetResult.js.map +1 -0
  92. package/enhance/result/UnleashByStampSheetResult.ts +116 -0
  93. package/enhance/result/UnleashByUserIdResult.d.ts +30 -0
  94. package/enhance/result/UnleashByUserIdResult.js +104 -0
  95. package/enhance/result/UnleashByUserIdResult.js.map +1 -0
  96. package/enhance/result/UnleashByUserIdResult.ts +116 -0
  97. package/enhance/result/UnleashResult.d.ts +30 -0
  98. package/enhance/result/UnleashResult.js +104 -0
  99. package/enhance/result/UnleashResult.js.map +1 -0
  100. package/enhance/result/UnleashResult.ts +116 -0
  101. package/enhance/result/UpdateUnleashRateModelMasterResult.d.ts +14 -0
  102. package/enhance/result/UpdateUnleashRateModelMasterResult.js +48 -0
  103. package/enhance/result/UpdateUnleashRateModelMasterResult.js.map +1 -0
  104. package/enhance/result/UpdateUnleashRateModelMasterResult.ts +48 -0
  105. package/enhance/result/index.d.ts +11 -1
  106. package/enhance/result/index.js +21 -1
  107. package/enhance/result/index.js.map +1 -1
  108. package/enhance/result/index.ts +20 -0
  109. package/grade/result/AddGradeByStampSheetResult.d.ts +8 -0
  110. package/grade/result/AddGradeByStampSheetResult.js +30 -2
  111. package/grade/result/AddGradeByStampSheetResult.js.map +1 -1
  112. package/grade/result/AddGradeByStampSheetResult.ts +35 -1
  113. package/grade/result/AddGradeByUserIdResult.d.ts +8 -0
  114. package/grade/result/AddGradeByUserIdResult.js +30 -2
  115. package/grade/result/AddGradeByUserIdResult.js.map +1 -1
  116. package/grade/result/AddGradeByUserIdResult.ts +35 -1
  117. package/grade/result/ApplyRankCapByStampSheetResult.d.ts +8 -0
  118. package/grade/result/ApplyRankCapByStampSheetResult.js +30 -2
  119. package/grade/result/ApplyRankCapByStampSheetResult.js.map +1 -1
  120. package/grade/result/ApplyRankCapByStampSheetResult.ts +35 -1
  121. package/grade/result/ApplyRankCapByUserIdResult.d.ts +8 -0
  122. package/grade/result/ApplyRankCapByUserIdResult.js +30 -2
  123. package/grade/result/ApplyRankCapByUserIdResult.js.map +1 -1
  124. package/grade/result/ApplyRankCapByUserIdResult.ts +35 -1
  125. package/grade/result/ApplyRankCapResult.d.ts +8 -0
  126. package/grade/result/ApplyRankCapResult.js +30 -2
  127. package/grade/result/ApplyRankCapResult.js.map +1 -1
  128. package/grade/result/ApplyRankCapResult.ts +35 -1
  129. package/grade/result/SetGradeByUserIdResult.d.ts +8 -0
  130. package/grade/result/SetGradeByUserIdResult.js +30 -2
  131. package/grade/result/SetGradeByUserIdResult.js.map +1 -1
  132. package/grade/result/SetGradeByUserIdResult.ts +35 -1
  133. package/grade/result/SubGradeByStampTaskResult.d.ts +8 -0
  134. package/grade/result/SubGradeByStampTaskResult.js +30 -2
  135. package/grade/result/SubGradeByStampTaskResult.js.map +1 -1
  136. package/grade/result/SubGradeByStampTaskResult.ts +35 -1
  137. package/grade/result/SubGradeByUserIdResult.d.ts +8 -0
  138. package/grade/result/SubGradeByUserIdResult.js +30 -2
  139. package/grade/result/SubGradeByUserIdResult.js.map +1 -1
  140. package/grade/result/SubGradeByUserIdResult.ts +35 -1
  141. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ import IModel from '../../core/interface/IModel';
2
+ export default class UnleashRateEntryModel implements IModel {
3
+ private gradeValue;
4
+ private needCount;
5
+ getGradeValue(): number | null;
6
+ setGradeValue(gradeValue: number | null): this;
7
+ withGradeValue(gradeValue: number | null): this;
8
+ getNeedCount(): number | null;
9
+ setNeedCount(needCount: number | null): this;
10
+ withNeedCount(needCount: number | null): this;
11
+ static fromDict(data: {
12
+ [key: string]: any;
13
+ }): UnleashRateEntryModel | null;
14
+ toDict(): {
15
+ [key: string]: any;
16
+ };
17
+ }
@@ -0,0 +1,62 @@
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 UnleashRateEntryModel = /** @class */ (function () {
19
+ function UnleashRateEntryModel() {
20
+ this.gradeValue = null;
21
+ this.needCount = null;
22
+ }
23
+ UnleashRateEntryModel.prototype.getGradeValue = function () {
24
+ return this.gradeValue;
25
+ };
26
+ UnleashRateEntryModel.prototype.setGradeValue = function (gradeValue) {
27
+ this.gradeValue = gradeValue;
28
+ return this;
29
+ };
30
+ UnleashRateEntryModel.prototype.withGradeValue = function (gradeValue) {
31
+ this.gradeValue = gradeValue;
32
+ return this;
33
+ };
34
+ UnleashRateEntryModel.prototype.getNeedCount = function () {
35
+ return this.needCount;
36
+ };
37
+ UnleashRateEntryModel.prototype.setNeedCount = function (needCount) {
38
+ this.needCount = needCount;
39
+ return this;
40
+ };
41
+ UnleashRateEntryModel.prototype.withNeedCount = function (needCount) {
42
+ this.needCount = needCount;
43
+ return this;
44
+ };
45
+ UnleashRateEntryModel.fromDict = function (data) {
46
+ if (data == undefined || data == null) {
47
+ return null;
48
+ }
49
+ return new UnleashRateEntryModel()
50
+ .withGradeValue(data["gradeValue"])
51
+ .withNeedCount(data["needCount"]);
52
+ };
53
+ UnleashRateEntryModel.prototype.toDict = function () {
54
+ return {
55
+ "gradeValue": this.getGradeValue(),
56
+ "needCount": this.getNeedCount(),
57
+ };
58
+ };
59
+ return UnleashRateEntryModel;
60
+ }());
61
+ exports.default = UnleashRateEntryModel;
62
+ //# sourceMappingURL=UnleashRateEntryModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnleashRateEntryModel.js","sourceRoot":"","sources":["UnleashRateEntryModel.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAIH;IAAA;QACY,eAAU,GAAgB,IAAI,CAAC;QAC/B,cAAS,GAAgB,IAAI,CAAC;IAuC1C,CAAC;IAtCU,6CAAa,GAApB;QACI,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IACM,6CAAa,GAApB,UAAqB,UAAuB;QACxC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,8CAAc,GAArB,UAAsB,UAAuB;QACzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,4CAAY,GAAnB;QACI,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IACM,4CAAY,GAAnB,UAAoB,SAAsB;QACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC;IACM,6CAAa,GAApB,UAAqB,SAAsB;QACvC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,8BAAQ,GAAtB,UAAuB,IAA0B;QAC7C,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,IAAI,EAAE;YACnC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,IAAI,qBAAqB,EAAE;aAC7B,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aAClC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC;IAEM,sCAAM,GAAb;QACI,OAAO;YACH,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE;YAClC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;SACnC,CAAC;IACN,CAAC;IACL,4BAAC;AAAD,CAAC,AAzCD,IAyCC"}
@@ -0,0 +1,60 @@
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
+
19
+ export default class UnleashRateEntryModel implements IModel {
20
+ private gradeValue: number|null = null;
21
+ private needCount: number|null = null;
22
+ public getGradeValue(): number|null {
23
+ return this.gradeValue;
24
+ }
25
+ public setGradeValue(gradeValue: number|null) {
26
+ this.gradeValue = gradeValue;
27
+ return this;
28
+ }
29
+ public withGradeValue(gradeValue: number|null): this {
30
+ this.gradeValue = gradeValue;
31
+ return this;
32
+ }
33
+ public getNeedCount(): number|null {
34
+ return this.needCount;
35
+ }
36
+ public setNeedCount(needCount: number|null) {
37
+ this.needCount = needCount;
38
+ return this;
39
+ }
40
+ public withNeedCount(needCount: number|null): this {
41
+ this.needCount = needCount;
42
+ return this;
43
+ }
44
+
45
+ public static fromDict(data: {[key: string]: any}): UnleashRateEntryModel|null {
46
+ if (data == undefined || data == null) {
47
+ return null;
48
+ }
49
+ return new UnleashRateEntryModel()
50
+ .withGradeValue(data["gradeValue"])
51
+ .withNeedCount(data["needCount"]);
52
+ }
53
+
54
+ public toDict(): {[key: string]: any} {
55
+ return {
56
+ "gradeValue": this.getGradeValue(),
57
+ "needCount": this.getNeedCount(),
58
+ };
59
+ }
60
+ }
@@ -0,0 +1,44 @@
1
+ import IModel from '../../core/interface/IModel';
2
+ import UnleashRateEntryModel from './UnleashRateEntryModel';
3
+ export default class UnleashRateModel implements IModel {
4
+ private unleashRateModelId;
5
+ private name;
6
+ private description;
7
+ private metadata;
8
+ private targetInventoryModelId;
9
+ private gradeModelId;
10
+ private gradeEntries;
11
+ static getRegion(grn: string): string | null;
12
+ static getOwnerId(grn: string): string | null;
13
+ static getNamespaceName(grn: string): string | null;
14
+ static getRateName(grn: string): string | null;
15
+ static isValid(grn: string): boolean;
16
+ static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, rateName: string | null): string | null;
17
+ getUnleashRateModelId(): string | null;
18
+ setUnleashRateModelId(unleashRateModelId: string | null): this;
19
+ withUnleashRateModelId(unleashRateModelId: string | null): this;
20
+ getName(): string | null;
21
+ setName(name: string | null): this;
22
+ withName(name: string | null): this;
23
+ getDescription(): string | null;
24
+ setDescription(description: string | null): this;
25
+ withDescription(description: string | null): this;
26
+ getMetadata(): string | null;
27
+ setMetadata(metadata: string | null): this;
28
+ withMetadata(metadata: string | null): this;
29
+ getTargetInventoryModelId(): string | null;
30
+ setTargetInventoryModelId(targetInventoryModelId: string | null): this;
31
+ withTargetInventoryModelId(targetInventoryModelId: string | null): this;
32
+ getGradeModelId(): string | null;
33
+ setGradeModelId(gradeModelId: string | null): this;
34
+ withGradeModelId(gradeModelId: string | null): this;
35
+ getGradeEntries(): UnleashRateEntryModel[] | null;
36
+ setGradeEntries(gradeEntries: UnleashRateEntryModel[] | null): this;
37
+ withGradeEntries(gradeEntries: UnleashRateEntryModel[] | null): this;
38
+ static fromDict(data: {
39
+ [key: string]: any;
40
+ }): UnleashRateModel | null;
41
+ toDict(): {
42
+ [key: string]: any;
43
+ };
44
+ }
@@ -0,0 +1,207 @@
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 UnleashRateEntryModel_1 = tslib_1.__importDefault(require("./UnleashRateEntryModel"));
20
+ var grnFormat = "grn:gs2:{region}:{ownerId}:enhance:{namespaceName}:unleashRateModel:{rateName}";
21
+ var UnleashRateModel = /** @class */ (function () {
22
+ function UnleashRateModel() {
23
+ this.unleashRateModelId = null;
24
+ this.name = null;
25
+ this.description = null;
26
+ this.metadata = null;
27
+ this.targetInventoryModelId = null;
28
+ this.gradeModelId = null;
29
+ this.gradeEntries = null;
30
+ }
31
+ UnleashRateModel.getRegion = function (grn) {
32
+ var match = grn.match(grnFormat
33
+ .replace('{region}', '(.*)')
34
+ .replace('{ownerId}', '.*')
35
+ .replace('{namespaceName}', '.*')
36
+ .replace('{rateName}', '.*'));
37
+ if (match) {
38
+ return match[1];
39
+ }
40
+ return null;
41
+ };
42
+ UnleashRateModel.getOwnerId = function (grn) {
43
+ var match = grn.match(grnFormat
44
+ .replace('{region}', '.*')
45
+ .replace('{ownerId}', '(.*)')
46
+ .replace('{namespaceName}', '.*')
47
+ .replace('{rateName}', '.*'));
48
+ if (match) {
49
+ return match[1];
50
+ }
51
+ return null;
52
+ };
53
+ UnleashRateModel.getNamespaceName = function (grn) {
54
+ var match = grn.match(grnFormat
55
+ .replace('{region}', '.*')
56
+ .replace('{ownerId}', '.*')
57
+ .replace('{namespaceName}', '(.*)')
58
+ .replace('{rateName}', '.*'));
59
+ if (match) {
60
+ return match[1];
61
+ }
62
+ return null;
63
+ };
64
+ UnleashRateModel.getRateName = function (grn) {
65
+ var match = grn.match(grnFormat
66
+ .replace('{region}', '.*')
67
+ .replace('{ownerId}', '.*')
68
+ .replace('{namespaceName}', '.*')
69
+ .replace('{rateName}', '(.*)'));
70
+ if (match) {
71
+ return match[1];
72
+ }
73
+ return null;
74
+ };
75
+ UnleashRateModel.isValid = function (grn) {
76
+ if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
77
+ return false;
78
+ }
79
+ if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
80
+ return false;
81
+ }
82
+ if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
83
+ return false;
84
+ }
85
+ if (this.getRateName(grn) == null || this.getRateName(grn) === '') {
86
+ return false;
87
+ }
88
+ return true;
89
+ };
90
+ UnleashRateModel.createGrn = function (region, ownerId, namespaceName, rateName) {
91
+ return grnFormat
92
+ .replace('{region}', region !== null && region !== void 0 ? region : '')
93
+ .replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
94
+ .replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
95
+ .replace('{rateName}', rateName !== null && rateName !== void 0 ? rateName : '');
96
+ };
97
+ UnleashRateModel.prototype.getUnleashRateModelId = function () {
98
+ return this.unleashRateModelId;
99
+ };
100
+ UnleashRateModel.prototype.setUnleashRateModelId = function (unleashRateModelId) {
101
+ this.unleashRateModelId = unleashRateModelId;
102
+ return this;
103
+ };
104
+ UnleashRateModel.prototype.withUnleashRateModelId = function (unleashRateModelId) {
105
+ this.unleashRateModelId = unleashRateModelId;
106
+ return this;
107
+ };
108
+ UnleashRateModel.prototype.getName = function () {
109
+ return this.name;
110
+ };
111
+ UnleashRateModel.prototype.setName = function (name) {
112
+ this.name = name;
113
+ return this;
114
+ };
115
+ UnleashRateModel.prototype.withName = function (name) {
116
+ this.name = name;
117
+ return this;
118
+ };
119
+ UnleashRateModel.prototype.getDescription = function () {
120
+ return this.description;
121
+ };
122
+ UnleashRateModel.prototype.setDescription = function (description) {
123
+ this.description = description;
124
+ return this;
125
+ };
126
+ UnleashRateModel.prototype.withDescription = function (description) {
127
+ this.description = description;
128
+ return this;
129
+ };
130
+ UnleashRateModel.prototype.getMetadata = function () {
131
+ return this.metadata;
132
+ };
133
+ UnleashRateModel.prototype.setMetadata = function (metadata) {
134
+ this.metadata = metadata;
135
+ return this;
136
+ };
137
+ UnleashRateModel.prototype.withMetadata = function (metadata) {
138
+ this.metadata = metadata;
139
+ return this;
140
+ };
141
+ UnleashRateModel.prototype.getTargetInventoryModelId = function () {
142
+ return this.targetInventoryModelId;
143
+ };
144
+ UnleashRateModel.prototype.setTargetInventoryModelId = function (targetInventoryModelId) {
145
+ this.targetInventoryModelId = targetInventoryModelId;
146
+ return this;
147
+ };
148
+ UnleashRateModel.prototype.withTargetInventoryModelId = function (targetInventoryModelId) {
149
+ this.targetInventoryModelId = targetInventoryModelId;
150
+ return this;
151
+ };
152
+ UnleashRateModel.prototype.getGradeModelId = function () {
153
+ return this.gradeModelId;
154
+ };
155
+ UnleashRateModel.prototype.setGradeModelId = function (gradeModelId) {
156
+ this.gradeModelId = gradeModelId;
157
+ return this;
158
+ };
159
+ UnleashRateModel.prototype.withGradeModelId = function (gradeModelId) {
160
+ this.gradeModelId = gradeModelId;
161
+ return this;
162
+ };
163
+ UnleashRateModel.prototype.getGradeEntries = function () {
164
+ return this.gradeEntries;
165
+ };
166
+ UnleashRateModel.prototype.setGradeEntries = function (gradeEntries) {
167
+ this.gradeEntries = gradeEntries;
168
+ return this;
169
+ };
170
+ UnleashRateModel.prototype.withGradeEntries = function (gradeEntries) {
171
+ this.gradeEntries = gradeEntries;
172
+ return this;
173
+ };
174
+ UnleashRateModel.fromDict = function (data) {
175
+ if (data == undefined || data == null) {
176
+ return null;
177
+ }
178
+ return new UnleashRateModel()
179
+ .withUnleashRateModelId(data["unleashRateModelId"])
180
+ .withName(data["name"])
181
+ .withDescription(data["description"])
182
+ .withMetadata(data["metadata"])
183
+ .withTargetInventoryModelId(data["targetInventoryModelId"])
184
+ .withGradeModelId(data["gradeModelId"])
185
+ .withGradeEntries(data.gradeEntries ?
186
+ data.gradeEntries.map(function (item) {
187
+ return UnleashRateEntryModel_1.default.fromDict(item);
188
+ }) : []);
189
+ };
190
+ UnleashRateModel.prototype.toDict = function () {
191
+ return {
192
+ "unleashRateModelId": this.getUnleashRateModelId(),
193
+ "name": this.getName(),
194
+ "description": this.getDescription(),
195
+ "metadata": this.getMetadata(),
196
+ "targetInventoryModelId": this.getTargetInventoryModelId(),
197
+ "gradeModelId": this.getGradeModelId(),
198
+ "gradeEntries": this.getGradeEntries() ?
199
+ this.getGradeEntries().map(function (item) {
200
+ return item.toDict();
201
+ }) : [],
202
+ };
203
+ };
204
+ return UnleashRateModel;
205
+ }());
206
+ exports.default = UnleashRateModel;
207
+ //# sourceMappingURL=UnleashRateModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnleashRateModel.js","sourceRoot":"","sources":["UnleashRateModel.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,0FAA4D;AAC5D,IAAM,SAAS,GAAW,gFAAgF,CAAC;AAE3G;IAAA;QACY,uBAAkB,GAAgB,IAAI,CAAC;QACvC,SAAI,GAAgB,IAAI,CAAC;QACzB,gBAAW,GAAgB,IAAI,CAAC;QAChC,aAAQ,GAAgB,IAAI,CAAC;QAC7B,2BAAsB,GAAgB,IAAI,CAAC;QAC3C,iBAAY,GAAgB,IAAI,CAAC;QACjC,iBAAY,GAAiC,IAAI,CAAC;IAiM9D,CAAC;IA/LiB,0BAAS,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,CAAC,CAC/B,CAAC;QACF,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;SACnB;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,2BAAU,GAAxB,UAAyB,GAAW;QAChC,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS;aAC5B,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC;aACzB,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;aAC5B,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC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aAAa,EAAE,IAAI,CAAC,cAAc,EAAE;YACpC,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE;YAC9B,wBAAwB,EAAE,IAAI,CAAC,yBAAyB,EAAE;YAC1D,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE;YACtC,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;gBACpC,IAAI,CAAC,eAAe,EAAG,CAAC,GAAG,CAAC,UAAC,IAA2B;oBACpD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzB,CAAC,CACJ,CAAC,CAAC,CAAC,EAAE;SACT,CAAC;IACN,CAAC;IACL,uBAAC;AAAD,CAAC,AAxMD,IAwMC"}
@@ -0,0 +1,221 @@
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 UnleashRateEntryModel from './UnleashRateEntryModel';
19
+ const grnFormat: string = "grn:gs2:{region}:{ownerId}:enhance:{namespaceName}:unleashRateModel:{rateName}";
20
+
21
+ export default class UnleashRateModel implements IModel {
22
+ private unleashRateModelId: string|null = null;
23
+ private name: string|null = null;
24
+ private description: string|null = null;
25
+ private metadata: string|null = null;
26
+ private targetInventoryModelId: string|null = null;
27
+ private gradeModelId: string|null = null;
28
+ private gradeEntries: UnleashRateEntryModel[]|null = null;
29
+
30
+ public static getRegion(grn: string): string|null {
31
+ const match = grn.match(grnFormat
32
+ .replace('{region}', '(.*)')
33
+ .replace('{ownerId}', '.*')
34
+ .replace('{namespaceName}', '.*')
35
+ .replace('{rateName}', '.*')
36
+ );
37
+ if (match) {
38
+ return match[1];
39
+ }
40
+ return null;
41
+ }
42
+
43
+ public static getOwnerId(grn: string): string|null {
44
+ const match = grn.match(grnFormat
45
+ .replace('{region}', '.*')
46
+ .replace('{ownerId}', '(.*)')
47
+ .replace('{namespaceName}', '.*')
48
+ .replace('{rateName}', '.*')
49
+ );
50
+ if (match) {
51
+ return match[1];
52
+ }
53
+ return null;
54
+ }
55
+
56
+ public static getNamespaceName(grn: string): string|null {
57
+ const match = grn.match(grnFormat
58
+ .replace('{region}', '.*')
59
+ .replace('{ownerId}', '.*')
60
+ .replace('{namespaceName}', '(.*)')
61
+ .replace('{rateName}', '.*')
62
+ );
63
+ if (match) {
64
+ return match[1];
65
+ }
66
+ return null;
67
+ }
68
+
69
+ public static getRateName(grn: string): string|null {
70
+ const match = grn.match(grnFormat
71
+ .replace('{region}', '.*')
72
+ .replace('{ownerId}', '.*')
73
+ .replace('{namespaceName}', '.*')
74
+ .replace('{rateName}', '(.*)')
75
+ );
76
+ if (match) {
77
+ return match[1];
78
+ }
79
+ return null;
80
+ }
81
+
82
+ public static isValid(grn: string): boolean {
83
+ if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
84
+ return false;
85
+ }
86
+ if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
87
+ return false;
88
+ }
89
+ if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
90
+ return false;
91
+ }
92
+ if (this.getRateName(grn) == null || this.getRateName(grn) === '') {
93
+ return false;
94
+ }
95
+ return true;
96
+ }
97
+
98
+ public static createGrn(
99
+ region: string|null,
100
+ ownerId: string|null,
101
+ namespaceName: string|null,
102
+ rateName: string|null,
103
+ ): string|null {
104
+ return grnFormat
105
+ .replace('{region}', region ?? '')
106
+ .replace('{ownerId}', ownerId ?? '')
107
+ .replace('{namespaceName}', namespaceName ?? '')
108
+ .replace('{rateName}', rateName ?? '');
109
+ }
110
+ public getUnleashRateModelId(): string|null {
111
+ return this.unleashRateModelId;
112
+ }
113
+ public setUnleashRateModelId(unleashRateModelId: string|null) {
114
+ this.unleashRateModelId = unleashRateModelId;
115
+ return this;
116
+ }
117
+ public withUnleashRateModelId(unleashRateModelId: string|null): this {
118
+ this.unleashRateModelId = unleashRateModelId;
119
+ return this;
120
+ }
121
+ public getName(): string|null {
122
+ return this.name;
123
+ }
124
+ public setName(name: string|null) {
125
+ this.name = name;
126
+ return this;
127
+ }
128
+ public withName(name: string|null): this {
129
+ this.name = name;
130
+ return this;
131
+ }
132
+ public getDescription(): string|null {
133
+ return this.description;
134
+ }
135
+ public setDescription(description: string|null) {
136
+ this.description = description;
137
+ return this;
138
+ }
139
+ public withDescription(description: string|null): this {
140
+ this.description = description;
141
+ return this;
142
+ }
143
+ public getMetadata(): string|null {
144
+ return this.metadata;
145
+ }
146
+ public setMetadata(metadata: string|null) {
147
+ this.metadata = metadata;
148
+ return this;
149
+ }
150
+ public withMetadata(metadata: string|null): this {
151
+ this.metadata = metadata;
152
+ return this;
153
+ }
154
+ public getTargetInventoryModelId(): string|null {
155
+ return this.targetInventoryModelId;
156
+ }
157
+ public setTargetInventoryModelId(targetInventoryModelId: string|null) {
158
+ this.targetInventoryModelId = targetInventoryModelId;
159
+ return this;
160
+ }
161
+ public withTargetInventoryModelId(targetInventoryModelId: string|null): this {
162
+ this.targetInventoryModelId = targetInventoryModelId;
163
+ return this;
164
+ }
165
+ public getGradeModelId(): string|null {
166
+ return this.gradeModelId;
167
+ }
168
+ public setGradeModelId(gradeModelId: string|null) {
169
+ this.gradeModelId = gradeModelId;
170
+ return this;
171
+ }
172
+ public withGradeModelId(gradeModelId: string|null): this {
173
+ this.gradeModelId = gradeModelId;
174
+ return this;
175
+ }
176
+ public getGradeEntries(): UnleashRateEntryModel[]|null {
177
+ return this.gradeEntries;
178
+ }
179
+ public setGradeEntries(gradeEntries: UnleashRateEntryModel[]|null) {
180
+ this.gradeEntries = gradeEntries;
181
+ return this;
182
+ }
183
+ public withGradeEntries(gradeEntries: UnleashRateEntryModel[]|null): this {
184
+ this.gradeEntries = gradeEntries;
185
+ return this;
186
+ }
187
+
188
+ public static fromDict(data: {[key: string]: any}): UnleashRateModel|null {
189
+ if (data == undefined || data == null) {
190
+ return null;
191
+ }
192
+ return new UnleashRateModel()
193
+ .withUnleashRateModelId(data["unleashRateModelId"])
194
+ .withName(data["name"])
195
+ .withDescription(data["description"])
196
+ .withMetadata(data["metadata"])
197
+ .withTargetInventoryModelId(data["targetInventoryModelId"])
198
+ .withGradeModelId(data["gradeModelId"])
199
+ .withGradeEntries(data.gradeEntries ?
200
+ data.gradeEntries.map((item: {[key: string]: any}) => {
201
+ return UnleashRateEntryModel.fromDict(item);
202
+ }
203
+ ) : []);
204
+ }
205
+
206
+ public toDict(): {[key: string]: any} {
207
+ return {
208
+ "unleashRateModelId": this.getUnleashRateModelId(),
209
+ "name": this.getName(),
210
+ "description": this.getDescription(),
211
+ "metadata": this.getMetadata(),
212
+ "targetInventoryModelId": this.getTargetInventoryModelId(),
213
+ "gradeModelId": this.getGradeModelId(),
214
+ "gradeEntries": this.getGradeEntries() ?
215
+ this.getGradeEntries()!.map((item: UnleashRateEntryModel) => {
216
+ return item.toDict();
217
+ }
218
+ ) : [],
219
+ };
220
+ }
221
+ }
@@ -0,0 +1,56 @@
1
+ import IModel from '../../core/interface/IModel';
2
+ import UnleashRateEntryModel from './UnleashRateEntryModel';
3
+ export default class UnleashRateModelMaster implements IModel {
4
+ private unleashRateModelId;
5
+ private name;
6
+ private description;
7
+ private metadata;
8
+ private targetInventoryModelId;
9
+ private gradeModelId;
10
+ private gradeEntries;
11
+ private createdAt;
12
+ private updatedAt;
13
+ private revision;
14
+ static getRegion(grn: string): string | null;
15
+ static getOwnerId(grn: string): string | null;
16
+ static getNamespaceName(grn: string): string | null;
17
+ static getRateName(grn: string): string | null;
18
+ static isValid(grn: string): boolean;
19
+ static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, rateName: string | null): string | null;
20
+ getUnleashRateModelId(): string | null;
21
+ setUnleashRateModelId(unleashRateModelId: string | null): this;
22
+ withUnleashRateModelId(unleashRateModelId: string | null): this;
23
+ getName(): string | null;
24
+ setName(name: string | null): this;
25
+ withName(name: string | null): this;
26
+ getDescription(): string | null;
27
+ setDescription(description: string | null): this;
28
+ withDescription(description: string | null): this;
29
+ getMetadata(): string | null;
30
+ setMetadata(metadata: string | null): this;
31
+ withMetadata(metadata: string | null): this;
32
+ getTargetInventoryModelId(): string | null;
33
+ setTargetInventoryModelId(targetInventoryModelId: string | null): this;
34
+ withTargetInventoryModelId(targetInventoryModelId: string | null): this;
35
+ getGradeModelId(): string | null;
36
+ setGradeModelId(gradeModelId: string | null): this;
37
+ withGradeModelId(gradeModelId: string | null): this;
38
+ getGradeEntries(): UnleashRateEntryModel[] | null;
39
+ setGradeEntries(gradeEntries: UnleashRateEntryModel[] | null): this;
40
+ withGradeEntries(gradeEntries: UnleashRateEntryModel[] | null): this;
41
+ getCreatedAt(): number | null;
42
+ setCreatedAt(createdAt: number | null): this;
43
+ withCreatedAt(createdAt: number | null): this;
44
+ getUpdatedAt(): number | null;
45
+ setUpdatedAt(updatedAt: number | null): this;
46
+ withUpdatedAt(updatedAt: number | null): this;
47
+ getRevision(): number | null;
48
+ setRevision(revision: number | null): this;
49
+ withRevision(revision: number | null): this;
50
+ static fromDict(data: {
51
+ [key: string]: any;
52
+ }): UnleashRateModelMaster | null;
53
+ toDict(): {
54
+ [key: string]: any;
55
+ };
56
+ }