gs2 1.4.55 → 1.4.57
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/money2/model/AppleAppStoreSetting.d.ts +4 -4
- package/money2/model/AppleAppStoreSetting.js +9 -9
- package/money2/model/AppleAppStoreSetting.js.map +1 -1
- package/money2/model/AppleAppStoreSetting.ts +9 -9
- package/money2/model/AppleAppStoreSubscriptionContent.d.ts +13 -0
- package/money2/model/AppleAppStoreSubscriptionContent.js +48 -0
- package/money2/model/AppleAppStoreSubscriptionContent.js.map +1 -0
- package/money2/model/AppleAppStoreSubscriptionContent.ts +48 -0
- package/money2/model/GooglePlaySubscriptionContent.d.ts +13 -0
- package/money2/model/GooglePlaySubscriptionContent.js +48 -0
- package/money2/model/GooglePlaySubscriptionContent.js.map +1 -0
- package/money2/model/GooglePlaySubscriptionContent.ts +48 -0
- package/money2/model/StoreSubscriptionContentModel.d.ts +44 -0
- package/money2/model/StoreSubscriptionContentModel.js +202 -0
- package/money2/model/StoreSubscriptionContentModel.js.map +1 -0
- package/money2/model/StoreSubscriptionContentModel.ts +216 -0
- package/money2/model/StoreSubscriptionContentModelMaster.d.ts +60 -0
- package/money2/model/StoreSubscriptionContentModelMaster.js +258 -0
- package/money2/model/StoreSubscriptionContentModelMaster.js.map +1 -0
- package/money2/model/StoreSubscriptionContentModelMaster.ts +272 -0
- package/money2/model/SubscribeTransaction.d.ts +6 -5
- package/money2/model/SubscribeTransaction.js +36 -16
- package/money2/model/SubscribeTransaction.js.map +1 -1
- package/money2/model/SubscribeTransaction.ts +38 -15
- package/money2/model/SubscriptionStatus.d.ts +32 -0
- package/money2/model/SubscriptionStatus.js +119 -0
- package/money2/model/SubscriptionStatus.js.map +1 -0
- package/money2/model/SubscriptionStatus.ts +123 -0
- package/money2/model/index.d.ts +6 -1
- package/money2/model/index.js +11 -1
- package/money2/model/index.js.map +1 -1
- package/money2/model/index.ts +10 -0
- package/money2/request/CreateStoreSubscriptionContentModelMasterRequest.d.ts +50 -0
- package/money2/request/CreateStoreSubscriptionContentModelMasterRequest.js +170 -0
- package/money2/request/CreateStoreSubscriptionContentModelMasterRequest.js.map +1 -0
- package/money2/request/CreateStoreSubscriptionContentModelMasterRequest.ts +174 -0
- package/money2/request/DeleteStoreSubscriptionContentModelMasterRequest.d.ts +25 -0
- package/money2/request/DeleteStoreSubscriptionContentModelMasterRequest.js +83 -0
- package/money2/request/DeleteStoreSubscriptionContentModelMasterRequest.js.map +1 -0
- package/money2/request/DeleteStoreSubscriptionContentModelMasterRequest.ts +90 -0
- package/money2/request/DescribeStoreSubscriptionContentModelMastersRequest.d.ts +29 -0
- package/money2/request/DescribeStoreSubscriptionContentModelMastersRequest.js +97 -0
- package/money2/request/DescribeStoreSubscriptionContentModelMastersRequest.js.map +1 -0
- package/money2/request/DescribeStoreSubscriptionContentModelMastersRequest.ts +104 -0
- package/money2/request/DescribeStoreSubscriptionContentModelsRequest.d.ts +21 -0
- package/money2/request/DescribeStoreSubscriptionContentModelsRequest.js +69 -0
- package/money2/request/DescribeStoreSubscriptionContentModelsRequest.js.map +1 -0
- package/money2/request/DescribeStoreSubscriptionContentModelsRequest.ts +76 -0
- package/money2/request/DescribeSubscriptionStatusesByUserIdRequest.d.ts +29 -0
- package/money2/request/DescribeSubscriptionStatusesByUserIdRequest.js +97 -0
- package/money2/request/DescribeSubscriptionStatusesByUserIdRequest.js.map +1 -0
- package/money2/request/DescribeSubscriptionStatusesByUserIdRequest.ts +104 -0
- package/money2/request/DescribeSubscriptionStatusesRequest.d.ts +25 -0
- package/money2/request/DescribeSubscriptionStatusesRequest.js +83 -0
- package/money2/request/DescribeSubscriptionStatusesRequest.js.map +1 -0
- package/money2/request/DescribeSubscriptionStatusesRequest.ts +90 -0
- package/money2/request/GetStoreSubscriptionContentModelMasterRequest.d.ts +25 -0
- package/money2/request/GetStoreSubscriptionContentModelMasterRequest.js +83 -0
- package/money2/request/GetStoreSubscriptionContentModelMasterRequest.js.map +1 -0
- package/money2/request/GetStoreSubscriptionContentModelMasterRequest.ts +90 -0
- package/money2/request/GetStoreSubscriptionContentModelRequest.d.ts +25 -0
- package/money2/request/GetStoreSubscriptionContentModelRequest.js +83 -0
- package/money2/request/GetStoreSubscriptionContentModelRequest.js.map +1 -0
- package/money2/request/GetStoreSubscriptionContentModelRequest.ts +90 -0
- package/money2/request/GetSubscriptionStatusByUserIdRequest.d.ts +33 -0
- package/money2/request/GetSubscriptionStatusByUserIdRequest.js +111 -0
- package/money2/request/GetSubscriptionStatusByUserIdRequest.js.map +1 -0
- package/money2/request/GetSubscriptionStatusByUserIdRequest.ts +118 -0
- package/money2/request/GetSubscriptionStatusRequest.d.ts +29 -0
- package/money2/request/GetSubscriptionStatusRequest.js +97 -0
- package/money2/request/GetSubscriptionStatusRequest.js.map +1 -0
- package/money2/request/GetSubscriptionStatusRequest.ts +104 -0
- package/money2/request/UpdateStoreSubscriptionContentModelMasterRequest.d.ts +50 -0
- package/money2/request/UpdateStoreSubscriptionContentModelMasterRequest.js +170 -0
- package/money2/request/UpdateStoreSubscriptionContentModelMasterRequest.js.map +1 -0
- package/money2/request/UpdateStoreSubscriptionContentModelMasterRequest.ts +174 -0
- package/money2/request/index.d.ts +12 -1
- package/money2/request/index.js +24 -1
- package/money2/request/index.js.map +1 -1
- package/money2/request/index.ts +22 -0
- package/money2/rest.d.ts +11 -0
- package/money2/rest.js +285 -0
- package/money2/rest.js.map +1 -1
- package/money2/rest.ts +329 -0
- package/money2/result/CreateStoreSubscriptionContentModelMasterResult.d.ts +14 -0
- package/money2/result/CreateStoreSubscriptionContentModelMasterResult.js +48 -0
- package/money2/result/CreateStoreSubscriptionContentModelMasterResult.js.map +1 -0
- package/money2/result/CreateStoreSubscriptionContentModelMasterResult.ts +47 -0
- package/money2/result/DeleteStoreSubscriptionContentModelMasterResult.d.ts +14 -0
- package/money2/result/DeleteStoreSubscriptionContentModelMasterResult.js +48 -0
- package/money2/result/DeleteStoreSubscriptionContentModelMasterResult.js.map +1 -0
- package/money2/result/DeleteStoreSubscriptionContentModelMasterResult.ts +47 -0
- package/money2/result/DescribeStoreSubscriptionContentModelMastersResult.d.ts +18 -0
- package/money2/result/DescribeStoreSubscriptionContentModelMastersResult.js +67 -0
- package/money2/result/DescribeStoreSubscriptionContentModelMastersResult.js.map +1 -0
- package/money2/result/DescribeStoreSubscriptionContentModelMastersResult.ts +72 -0
- package/money2/result/DescribeStoreSubscriptionContentModelsResult.d.ts +14 -0
- package/money2/result/DescribeStoreSubscriptionContentModelsResult.js +53 -0
- package/money2/result/DescribeStoreSubscriptionContentModelsResult.js.map +1 -0
- package/money2/result/DescribeStoreSubscriptionContentModelsResult.ts +55 -0
- package/money2/result/DescribeSubscriptionStatusesByUserIdResult.d.ts +14 -0
- package/money2/result/DescribeSubscriptionStatusesByUserIdResult.js +53 -0
- package/money2/result/DescribeSubscriptionStatusesByUserIdResult.js.map +1 -0
- package/money2/result/DescribeSubscriptionStatusesByUserIdResult.ts +55 -0
- package/money2/result/DescribeSubscriptionStatusesResult.d.ts +14 -0
- package/money2/result/DescribeSubscriptionStatusesResult.js +53 -0
- package/money2/result/DescribeSubscriptionStatusesResult.js.map +1 -0
- package/money2/result/DescribeSubscriptionStatusesResult.ts +55 -0
- package/money2/result/GetStoreSubscriptionContentModelMasterResult.d.ts +14 -0
- package/money2/result/GetStoreSubscriptionContentModelMasterResult.js +48 -0
- package/money2/result/GetStoreSubscriptionContentModelMasterResult.js.map +1 -0
- package/money2/result/GetStoreSubscriptionContentModelMasterResult.ts +47 -0
- package/money2/result/GetStoreSubscriptionContentModelResult.d.ts +14 -0
- package/money2/result/GetStoreSubscriptionContentModelResult.js +48 -0
- package/money2/result/GetStoreSubscriptionContentModelResult.js.map +1 -0
- package/money2/result/GetStoreSubscriptionContentModelResult.ts +47 -0
- package/money2/result/GetSubscriptionStatusByUserIdResult.d.ts +14 -0
- package/money2/result/GetSubscriptionStatusByUserIdResult.js +48 -0
- package/money2/result/GetSubscriptionStatusByUserIdResult.js.map +1 -0
- package/money2/result/GetSubscriptionStatusByUserIdResult.ts +47 -0
- package/money2/result/GetSubscriptionStatusResult.d.ts +14 -0
- package/money2/result/GetSubscriptionStatusResult.js +48 -0
- package/money2/result/GetSubscriptionStatusResult.js.map +1 -0
- package/money2/result/GetSubscriptionStatusResult.ts +47 -0
- package/money2/result/UpdateStoreSubscriptionContentModelMasterResult.d.ts +14 -0
- package/money2/result/UpdateStoreSubscriptionContentModelMasterResult.js +48 -0
- package/money2/result/UpdateStoreSubscriptionContentModelMasterResult.js.map +1 -0
- package/money2/result/UpdateStoreSubscriptionContentModelMasterResult.ts +47 -0
- package/money2/result/index.d.ts +12 -1
- package/money2/result/index.js +24 -1
- package/money2/result/index.js.map +1 -1
- package/money2/result/index.ts +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,272 @@
|
|
|
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
|
+
import * as Gs2Money2 from '../../money2/model'
|
|
20
|
+
import AppleAppStoreSubscriptionContent from './AppleAppStoreSubscriptionContent';
|
|
21
|
+
import GooglePlaySubscriptionContent from './GooglePlaySubscriptionContent';
|
|
22
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:money2:{namespaceName}:master:subscription:content:{contentName}";
|
|
23
|
+
|
|
24
|
+
export default class StoreSubscriptionContentModelMaster implements IModel {
|
|
25
|
+
private storeSubscriptionContentModelId: string|null = null;
|
|
26
|
+
private name: string|null = null;
|
|
27
|
+
private description: string|null = null;
|
|
28
|
+
private metadata: string|null = null;
|
|
29
|
+
private scheduleNamespaceId: string|null = null;
|
|
30
|
+
private triggerName: string|null = null;
|
|
31
|
+
private appleAppStore: Gs2Money2.AppleAppStoreSubscriptionContent|null = null;
|
|
32
|
+
private googlePlay: Gs2Money2.GooglePlaySubscriptionContent|null = null;
|
|
33
|
+
private createdAt: number|null = null;
|
|
34
|
+
private updatedAt: number|null = null;
|
|
35
|
+
private revision: number|null = null;
|
|
36
|
+
|
|
37
|
+
public static getRegion(grn: string): string|null {
|
|
38
|
+
const match = grn.match(grnFormat
|
|
39
|
+
.replace('{region}', '(.*)')
|
|
40
|
+
.replace('{ownerId}', '.*')
|
|
41
|
+
.replace('{namespaceName}', '.*')
|
|
42
|
+
.replace('{contentName}', '.*')
|
|
43
|
+
);
|
|
44
|
+
if (match) {
|
|
45
|
+
return match[1];
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public static getOwnerId(grn: string): string|null {
|
|
51
|
+
const match = grn.match(grnFormat
|
|
52
|
+
.replace('{region}', '.*')
|
|
53
|
+
.replace('{ownerId}', '(.*)')
|
|
54
|
+
.replace('{namespaceName}', '.*')
|
|
55
|
+
.replace('{contentName}', '.*')
|
|
56
|
+
);
|
|
57
|
+
if (match) {
|
|
58
|
+
return match[1];
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public static getNamespaceName(grn: string): string|null {
|
|
64
|
+
const match = grn.match(grnFormat
|
|
65
|
+
.replace('{region}', '.*')
|
|
66
|
+
.replace('{ownerId}', '.*')
|
|
67
|
+
.replace('{namespaceName}', '(.*)')
|
|
68
|
+
.replace('{contentName}', '.*')
|
|
69
|
+
);
|
|
70
|
+
if (match) {
|
|
71
|
+
return match[1];
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public static getContentName(grn: string): string|null {
|
|
77
|
+
const match = grn.match(grnFormat
|
|
78
|
+
.replace('{region}', '.*')
|
|
79
|
+
.replace('{ownerId}', '.*')
|
|
80
|
+
.replace('{namespaceName}', '.*')
|
|
81
|
+
.replace('{contentName}', '(.*)')
|
|
82
|
+
);
|
|
83
|
+
if (match) {
|
|
84
|
+
return match[1];
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public static isValid(grn: string): boolean {
|
|
90
|
+
if (this.getRegion(grn) == null || this.getRegion(grn) === '') {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (this.getOwnerId(grn) == null || this.getOwnerId(grn) === '') {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (this.getContentName(grn) == null || this.getContentName(grn) === '') {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public static createGrn(
|
|
106
|
+
region: string|null,
|
|
107
|
+
ownerId: string|null,
|
|
108
|
+
namespaceName: string|null,
|
|
109
|
+
contentName: string|null,
|
|
110
|
+
): string|null {
|
|
111
|
+
return grnFormat
|
|
112
|
+
.replace('{region}', region ?? '')
|
|
113
|
+
.replace('{ownerId}', ownerId ?? '')
|
|
114
|
+
.replace('{namespaceName}', namespaceName ?? '')
|
|
115
|
+
.replace('{contentName}', contentName ?? '');
|
|
116
|
+
}
|
|
117
|
+
public getStoreSubscriptionContentModelId(): string|null {
|
|
118
|
+
return this.storeSubscriptionContentModelId;
|
|
119
|
+
}
|
|
120
|
+
public setStoreSubscriptionContentModelId(storeSubscriptionContentModelId: string|null) {
|
|
121
|
+
this.storeSubscriptionContentModelId = storeSubscriptionContentModelId;
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
124
|
+
public withStoreSubscriptionContentModelId(storeSubscriptionContentModelId: string|null): this {
|
|
125
|
+
this.storeSubscriptionContentModelId = storeSubscriptionContentModelId;
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
public getName(): string|null {
|
|
129
|
+
return this.name;
|
|
130
|
+
}
|
|
131
|
+
public setName(name: string|null) {
|
|
132
|
+
this.name = name;
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
public withName(name: string|null): this {
|
|
136
|
+
this.name = name;
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
public getDescription(): string|null {
|
|
140
|
+
return this.description;
|
|
141
|
+
}
|
|
142
|
+
public setDescription(description: string|null) {
|
|
143
|
+
this.description = description;
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
public withDescription(description: string|null): this {
|
|
147
|
+
this.description = description;
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
public getMetadata(): string|null {
|
|
151
|
+
return this.metadata;
|
|
152
|
+
}
|
|
153
|
+
public setMetadata(metadata: string|null) {
|
|
154
|
+
this.metadata = metadata;
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
public withMetadata(metadata: string|null): this {
|
|
158
|
+
this.metadata = metadata;
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
public getScheduleNamespaceId(): string|null {
|
|
162
|
+
return this.scheduleNamespaceId;
|
|
163
|
+
}
|
|
164
|
+
public setScheduleNamespaceId(scheduleNamespaceId: string|null) {
|
|
165
|
+
this.scheduleNamespaceId = scheduleNamespaceId;
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
public withScheduleNamespaceId(scheduleNamespaceId: string|null): this {
|
|
169
|
+
this.scheduleNamespaceId = scheduleNamespaceId;
|
|
170
|
+
return this;
|
|
171
|
+
}
|
|
172
|
+
public getTriggerName(): string|null {
|
|
173
|
+
return this.triggerName;
|
|
174
|
+
}
|
|
175
|
+
public setTriggerName(triggerName: string|null) {
|
|
176
|
+
this.triggerName = triggerName;
|
|
177
|
+
return this;
|
|
178
|
+
}
|
|
179
|
+
public withTriggerName(triggerName: string|null): this {
|
|
180
|
+
this.triggerName = triggerName;
|
|
181
|
+
return this;
|
|
182
|
+
}
|
|
183
|
+
public getAppleAppStore(): Gs2Money2.AppleAppStoreSubscriptionContent|null {
|
|
184
|
+
return this.appleAppStore;
|
|
185
|
+
}
|
|
186
|
+
public setAppleAppStore(appleAppStore: Gs2Money2.AppleAppStoreSubscriptionContent|null) {
|
|
187
|
+
this.appleAppStore = appleAppStore;
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
public withAppleAppStore(appleAppStore: Gs2Money2.AppleAppStoreSubscriptionContent|null): this {
|
|
191
|
+
this.appleAppStore = appleAppStore;
|
|
192
|
+
return this;
|
|
193
|
+
}
|
|
194
|
+
public getGooglePlay(): Gs2Money2.GooglePlaySubscriptionContent|null {
|
|
195
|
+
return this.googlePlay;
|
|
196
|
+
}
|
|
197
|
+
public setGooglePlay(googlePlay: Gs2Money2.GooglePlaySubscriptionContent|null) {
|
|
198
|
+
this.googlePlay = googlePlay;
|
|
199
|
+
return this;
|
|
200
|
+
}
|
|
201
|
+
public withGooglePlay(googlePlay: Gs2Money2.GooglePlaySubscriptionContent|null): this {
|
|
202
|
+
this.googlePlay = googlePlay;
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
public getCreatedAt(): number|null {
|
|
206
|
+
return this.createdAt;
|
|
207
|
+
}
|
|
208
|
+
public setCreatedAt(createdAt: number|null) {
|
|
209
|
+
this.createdAt = createdAt;
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
public withCreatedAt(createdAt: number|null): this {
|
|
213
|
+
this.createdAt = createdAt;
|
|
214
|
+
return this;
|
|
215
|
+
}
|
|
216
|
+
public getUpdatedAt(): number|null {
|
|
217
|
+
return this.updatedAt;
|
|
218
|
+
}
|
|
219
|
+
public setUpdatedAt(updatedAt: number|null) {
|
|
220
|
+
this.updatedAt = updatedAt;
|
|
221
|
+
return this;
|
|
222
|
+
}
|
|
223
|
+
public withUpdatedAt(updatedAt: number|null): this {
|
|
224
|
+
this.updatedAt = updatedAt;
|
|
225
|
+
return this;
|
|
226
|
+
}
|
|
227
|
+
public getRevision(): number|null {
|
|
228
|
+
return this.revision;
|
|
229
|
+
}
|
|
230
|
+
public setRevision(revision: number|null) {
|
|
231
|
+
this.revision = revision;
|
|
232
|
+
return this;
|
|
233
|
+
}
|
|
234
|
+
public withRevision(revision: number|null): this {
|
|
235
|
+
this.revision = revision;
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
public static fromDict(data: {[key: string]: any}): StoreSubscriptionContentModelMaster|null {
|
|
240
|
+
if (data == undefined || data == null) {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
return new StoreSubscriptionContentModelMaster()
|
|
244
|
+
.withStoreSubscriptionContentModelId(data["storeSubscriptionContentModelId"])
|
|
245
|
+
.withName(data["name"])
|
|
246
|
+
.withDescription(data["description"])
|
|
247
|
+
.withMetadata(data["metadata"])
|
|
248
|
+
.withScheduleNamespaceId(data["scheduleNamespaceId"])
|
|
249
|
+
.withTriggerName(data["triggerName"])
|
|
250
|
+
.withAppleAppStore(Gs2Money2.AppleAppStoreSubscriptionContent.fromDict(data["appleAppStore"]))
|
|
251
|
+
.withGooglePlay(Gs2Money2.GooglePlaySubscriptionContent.fromDict(data["googlePlay"]))
|
|
252
|
+
.withCreatedAt(data["createdAt"])
|
|
253
|
+
.withUpdatedAt(data["updatedAt"])
|
|
254
|
+
.withRevision(data["revision"]);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public toDict(): {[key: string]: any} {
|
|
258
|
+
return {
|
|
259
|
+
"storeSubscriptionContentModelId": this.getStoreSubscriptionContentModelId(),
|
|
260
|
+
"name": this.getName(),
|
|
261
|
+
"description": this.getDescription(),
|
|
262
|
+
"metadata": this.getMetadata(),
|
|
263
|
+
"scheduleNamespaceId": this.getScheduleNamespaceId(),
|
|
264
|
+
"triggerName": this.getTriggerName(),
|
|
265
|
+
"appleAppStore": this.getAppleAppStore()?.toDict(),
|
|
266
|
+
"googlePlay": this.getGooglePlay()?.toDict(),
|
|
267
|
+
"createdAt": this.getCreatedAt(),
|
|
268
|
+
"updatedAt": this.getUpdatedAt(),
|
|
269
|
+
"revision": this.getRevision(),
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import IModel from '../../core/interface/IModel';
|
|
2
2
|
export default class SubscribeTransaction implements IModel {
|
|
3
3
|
private subscribeTransactionId;
|
|
4
|
+
private contentName;
|
|
4
5
|
private transactionId;
|
|
5
6
|
private store;
|
|
6
7
|
private userId;
|
|
7
|
-
private status;
|
|
8
8
|
private statusDetail;
|
|
9
9
|
private expiresAt;
|
|
10
10
|
private createdAt;
|
|
@@ -13,12 +13,16 @@ export default class SubscribeTransaction implements IModel {
|
|
|
13
13
|
static getRegion(grn: string): string | null;
|
|
14
14
|
static getOwnerId(grn: string): string | null;
|
|
15
15
|
static getNamespaceName(grn: string): string | null;
|
|
16
|
+
static getContentName(grn: string): string | null;
|
|
16
17
|
static getTransactionId(grn: string): string | null;
|
|
17
18
|
static isValid(grn: string): boolean;
|
|
18
|
-
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, transactionId: string | null): string | null;
|
|
19
|
+
static createGrn(region: string | null, ownerId: string | null, namespaceName: string | null, contentName: string | null, transactionId: string | null): string | null;
|
|
19
20
|
getSubscribeTransactionId(): string | null;
|
|
20
21
|
setSubscribeTransactionId(subscribeTransactionId: string | null): this;
|
|
21
22
|
withSubscribeTransactionId(subscribeTransactionId: string | null): this;
|
|
23
|
+
getContentName(): string | null;
|
|
24
|
+
setContentName(contentName: string | null): this;
|
|
25
|
+
withContentName(contentName: string | null): this;
|
|
22
26
|
getTransactionId(): string | null;
|
|
23
27
|
setTransactionId(transactionId: string | null): this;
|
|
24
28
|
withTransactionId(transactionId: string | null): this;
|
|
@@ -28,9 +32,6 @@ export default class SubscribeTransaction implements IModel {
|
|
|
28
32
|
getUserId(): string | null;
|
|
29
33
|
setUserId(userId: string | null): this;
|
|
30
34
|
withUserId(userId: string | null): this;
|
|
31
|
-
getStatus(): string | null;
|
|
32
|
-
setStatus(status: string | null): this;
|
|
33
|
-
withStatus(status: string | null): this;
|
|
34
35
|
getStatusDetail(): string | null;
|
|
35
36
|
setStatusDetail(statusDetail: string | null): this;
|
|
36
37
|
withStatusDetail(statusDetail: string | null): this;
|
|
@@ -15,14 +15,14 @@ express or implied. See the License for the specific language governing
|
|
|
15
15
|
permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var grnFormat = "grn:gs2:{region}:{ownerId}:money2:{namespaceName}:subscriptionTransaction:{transactionId}";
|
|
18
|
+
var grnFormat = "grn:gs2:{region}:{ownerId}:money2:{namespaceName}:subscriptionTransaction:{contentName}:{transactionId}";
|
|
19
19
|
var SubscribeTransaction = /** @class */ (function () {
|
|
20
20
|
function SubscribeTransaction() {
|
|
21
21
|
this.subscribeTransactionId = null;
|
|
22
|
+
this.contentName = null;
|
|
22
23
|
this.transactionId = null;
|
|
23
24
|
this.store = null;
|
|
24
25
|
this.userId = null;
|
|
25
|
-
this.status = null;
|
|
26
26
|
this.statusDetail = null;
|
|
27
27
|
this.expiresAt = null;
|
|
28
28
|
this.createdAt = null;
|
|
@@ -34,6 +34,7 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
34
34
|
.replace('{region}', '(.*)')
|
|
35
35
|
.replace('{ownerId}', '.*')
|
|
36
36
|
.replace('{namespaceName}', '.*')
|
|
37
|
+
.replace('{contentName}', '.*')
|
|
37
38
|
.replace('{transactionId}', '.*'));
|
|
38
39
|
if (match) {
|
|
39
40
|
return match[1];
|
|
@@ -45,6 +46,7 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
45
46
|
.replace('{region}', '.*')
|
|
46
47
|
.replace('{ownerId}', '(.*)')
|
|
47
48
|
.replace('{namespaceName}', '.*')
|
|
49
|
+
.replace('{contentName}', '.*')
|
|
48
50
|
.replace('{transactionId}', '.*'));
|
|
49
51
|
if (match) {
|
|
50
52
|
return match[1];
|
|
@@ -56,6 +58,19 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
56
58
|
.replace('{region}', '.*')
|
|
57
59
|
.replace('{ownerId}', '.*')
|
|
58
60
|
.replace('{namespaceName}', '(.*)')
|
|
61
|
+
.replace('{contentName}', '.*')
|
|
62
|
+
.replace('{transactionId}', '.*'));
|
|
63
|
+
if (match) {
|
|
64
|
+
return match[1];
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
};
|
|
68
|
+
SubscribeTransaction.getContentName = function (grn) {
|
|
69
|
+
var match = grn.match(grnFormat
|
|
70
|
+
.replace('{region}', '.*')
|
|
71
|
+
.replace('{ownerId}', '.*')
|
|
72
|
+
.replace('{namespaceName}', '.*')
|
|
73
|
+
.replace('{contentName}', '(.*)')
|
|
59
74
|
.replace('{transactionId}', '.*'));
|
|
60
75
|
if (match) {
|
|
61
76
|
return match[1];
|
|
@@ -67,6 +82,7 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
67
82
|
.replace('{region}', '.*')
|
|
68
83
|
.replace('{ownerId}', '.*')
|
|
69
84
|
.replace('{namespaceName}', '.*')
|
|
85
|
+
.replace('{contentName}', '.*')
|
|
70
86
|
.replace('{transactionId}', '(.*)'));
|
|
71
87
|
if (match) {
|
|
72
88
|
return match[1];
|
|
@@ -83,16 +99,20 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
83
99
|
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
84
100
|
return false;
|
|
85
101
|
}
|
|
102
|
+
if (this.getContentName(grn) == null || this.getContentName(grn) === '') {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
86
105
|
if (this.getTransactionId(grn) == null || this.getTransactionId(grn) === '') {
|
|
87
106
|
return false;
|
|
88
107
|
}
|
|
89
108
|
return true;
|
|
90
109
|
};
|
|
91
|
-
SubscribeTransaction.createGrn = function (region, ownerId, namespaceName, transactionId) {
|
|
110
|
+
SubscribeTransaction.createGrn = function (region, ownerId, namespaceName, contentName, transactionId) {
|
|
92
111
|
return grnFormat
|
|
93
112
|
.replace('{region}', region !== null && region !== void 0 ? region : '')
|
|
94
113
|
.replace('{ownerId}', ownerId !== null && ownerId !== void 0 ? ownerId : '')
|
|
95
114
|
.replace('{namespaceName}', namespaceName !== null && namespaceName !== void 0 ? namespaceName : '')
|
|
115
|
+
.replace('{contentName}', contentName !== null && contentName !== void 0 ? contentName : '')
|
|
96
116
|
.replace('{transactionId}', transactionId !== null && transactionId !== void 0 ? transactionId : '');
|
|
97
117
|
};
|
|
98
118
|
SubscribeTransaction.prototype.getSubscribeTransactionId = function () {
|
|
@@ -106,6 +126,17 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
106
126
|
this.subscribeTransactionId = subscribeTransactionId;
|
|
107
127
|
return this;
|
|
108
128
|
};
|
|
129
|
+
SubscribeTransaction.prototype.getContentName = function () {
|
|
130
|
+
return this.contentName;
|
|
131
|
+
};
|
|
132
|
+
SubscribeTransaction.prototype.setContentName = function (contentName) {
|
|
133
|
+
this.contentName = contentName;
|
|
134
|
+
return this;
|
|
135
|
+
};
|
|
136
|
+
SubscribeTransaction.prototype.withContentName = function (contentName) {
|
|
137
|
+
this.contentName = contentName;
|
|
138
|
+
return this;
|
|
139
|
+
};
|
|
109
140
|
SubscribeTransaction.prototype.getTransactionId = function () {
|
|
110
141
|
return this.transactionId;
|
|
111
142
|
};
|
|
@@ -139,17 +170,6 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
139
170
|
this.userId = userId;
|
|
140
171
|
return this;
|
|
141
172
|
};
|
|
142
|
-
SubscribeTransaction.prototype.getStatus = function () {
|
|
143
|
-
return this.status;
|
|
144
|
-
};
|
|
145
|
-
SubscribeTransaction.prototype.setStatus = function (status) {
|
|
146
|
-
this.status = status;
|
|
147
|
-
return this;
|
|
148
|
-
};
|
|
149
|
-
SubscribeTransaction.prototype.withStatus = function (status) {
|
|
150
|
-
this.status = status;
|
|
151
|
-
return this;
|
|
152
|
-
};
|
|
153
173
|
SubscribeTransaction.prototype.getStatusDetail = function () {
|
|
154
174
|
return this.statusDetail;
|
|
155
175
|
};
|
|
@@ -211,10 +231,10 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
211
231
|
}
|
|
212
232
|
return new SubscribeTransaction()
|
|
213
233
|
.withSubscribeTransactionId(data["subscribeTransactionId"])
|
|
234
|
+
.withContentName(data["contentName"])
|
|
214
235
|
.withTransactionId(data["transactionId"])
|
|
215
236
|
.withStore(data["store"])
|
|
216
237
|
.withUserId(data["userId"])
|
|
217
|
-
.withStatus(data["status"])
|
|
218
238
|
.withStatusDetail(data["statusDetail"])
|
|
219
239
|
.withExpiresAt(data["expiresAt"])
|
|
220
240
|
.withCreatedAt(data["createdAt"])
|
|
@@ -224,10 +244,10 @@ var SubscribeTransaction = /** @class */ (function () {
|
|
|
224
244
|
SubscribeTransaction.prototype.toDict = function () {
|
|
225
245
|
return {
|
|
226
246
|
"subscribeTransactionId": this.getSubscribeTransactionId(),
|
|
247
|
+
"contentName": this.getContentName(),
|
|
227
248
|
"transactionId": this.getTransactionId(),
|
|
228
249
|
"store": this.getStore(),
|
|
229
250
|
"userId": this.getUserId(),
|
|
230
|
-
"status": this.getStatus(),
|
|
231
251
|
"statusDetail": this.getStatusDetail(),
|
|
232
252
|
"expiresAt": this.getExpiresAt(),
|
|
233
253
|
"createdAt": this.getCreatedAt(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscribeTransaction.js","sourceRoot":"","sources":["SubscribeTransaction.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAKH,IAAM,SAAS,GAAW,
|
|
1
|
+
{"version":3,"file":"SubscribeTransaction.js","sourceRoot":"","sources":["SubscribeTransaction.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAKH,IAAM,SAAS,GAAW,yGAAyG,CAAC;AAEpI;IAAA;QACY,2BAAsB,GAAgB,IAAI,CAAC;QAC3C,gBAAW,GAAgB,IAAI,CAAC;QAChC,kBAAa,GAAgB,IAAI,CAAC;QAClC,UAAK,GAAgB,IAAI,CAAC;QAC1B,WAAM,GAAgB,IAAI,CAAC;QAC3B,iBAAY,GAAgB,IAAI,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAC9B,cAAS,GAAgB,IAAI,CAAC;QAC9B,cAAS,GAAgB,IAAI,CAAC;QAC9B,aAAQ,GAAgB,IAAI,CAAC;IAuPzC,CAAC;IArPiB,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,eAAe,EAAE,IAAI,CAAC;aAC9B,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACpC,CAAC;QACF,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;SACnB;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEa,+BAAU,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,C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AAC;aACxB,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC1B,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aACtC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAChC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAChC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAChC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACxC,CAAC;IAEM,qCAAM,GAAb;QACI,OAAO;YACH,wBAAwB,EAAE,IAAI,CAAC,yBAAyB,EAAE;YAC1D,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE;YACpC,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACxC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE;YACxB,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE;YAC1B,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE;YACtC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;YAChC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;YAChC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE;YAChC,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE;SACjC,CAAC;IACN,CAAC;IACL,2BAAC;AAAD,CAAC,AAjQD,IAiQC"}
|
|
@@ -17,14 +17,14 @@ permissions and limitations under the License.
|
|
|
17
17
|
import IModel from '../../core/interface/IModel';
|
|
18
18
|
|
|
19
19
|
import * as Gs2Money2 from '../../money2/model'
|
|
20
|
-
const grnFormat: string = "grn:gs2:{region}:{ownerId}:money2:{namespaceName}:subscriptionTransaction:{transactionId}";
|
|
20
|
+
const grnFormat: string = "grn:gs2:{region}:{ownerId}:money2:{namespaceName}:subscriptionTransaction:{contentName}:{transactionId}";
|
|
21
21
|
|
|
22
22
|
export default class SubscribeTransaction implements IModel {
|
|
23
23
|
private subscribeTransactionId: string|null = null;
|
|
24
|
+
private contentName: string|null = null;
|
|
24
25
|
private transactionId: string|null = null;
|
|
25
26
|
private store: string|null = null;
|
|
26
27
|
private userId: string|null = null;
|
|
27
|
-
private status: string|null = null;
|
|
28
28
|
private statusDetail: string|null = null;
|
|
29
29
|
private expiresAt: number|null = null;
|
|
30
30
|
private createdAt: number|null = null;
|
|
@@ -36,6 +36,7 @@ export default class SubscribeTransaction implements IModel {
|
|
|
36
36
|
.replace('{region}', '(.*)')
|
|
37
37
|
.replace('{ownerId}', '.*')
|
|
38
38
|
.replace('{namespaceName}', '.*')
|
|
39
|
+
.replace('{contentName}', '.*')
|
|
39
40
|
.replace('{transactionId}', '.*')
|
|
40
41
|
);
|
|
41
42
|
if (match) {
|
|
@@ -49,6 +50,7 @@ export default class SubscribeTransaction implements IModel {
|
|
|
49
50
|
.replace('{region}', '.*')
|
|
50
51
|
.replace('{ownerId}', '(.*)')
|
|
51
52
|
.replace('{namespaceName}', '.*')
|
|
53
|
+
.replace('{contentName}', '.*')
|
|
52
54
|
.replace('{transactionId}', '.*')
|
|
53
55
|
);
|
|
54
56
|
if (match) {
|
|
@@ -62,6 +64,21 @@ export default class SubscribeTransaction implements IModel {
|
|
|
62
64
|
.replace('{region}', '.*')
|
|
63
65
|
.replace('{ownerId}', '.*')
|
|
64
66
|
.replace('{namespaceName}', '(.*)')
|
|
67
|
+
.replace('{contentName}', '.*')
|
|
68
|
+
.replace('{transactionId}', '.*')
|
|
69
|
+
);
|
|
70
|
+
if (match) {
|
|
71
|
+
return match[1];
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public static getContentName(grn: string): string|null {
|
|
77
|
+
const match = grn.match(grnFormat
|
|
78
|
+
.replace('{region}', '.*')
|
|
79
|
+
.replace('{ownerId}', '.*')
|
|
80
|
+
.replace('{namespaceName}', '.*')
|
|
81
|
+
.replace('{contentName}', '(.*)')
|
|
65
82
|
.replace('{transactionId}', '.*')
|
|
66
83
|
);
|
|
67
84
|
if (match) {
|
|
@@ -75,6 +92,7 @@ export default class SubscribeTransaction implements IModel {
|
|
|
75
92
|
.replace('{region}', '.*')
|
|
76
93
|
.replace('{ownerId}', '.*')
|
|
77
94
|
.replace('{namespaceName}', '.*')
|
|
95
|
+
.replace('{contentName}', '.*')
|
|
78
96
|
.replace('{transactionId}', '(.*)')
|
|
79
97
|
);
|
|
80
98
|
if (match) {
|
|
@@ -93,6 +111,9 @@ export default class SubscribeTransaction implements IModel {
|
|
|
93
111
|
if (this.getNamespaceName(grn) == null || this.getNamespaceName(grn) === '') {
|
|
94
112
|
return false;
|
|
95
113
|
}
|
|
114
|
+
if (this.getContentName(grn) == null || this.getContentName(grn) === '') {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
96
117
|
if (this.getTransactionId(grn) == null || this.getTransactionId(grn) === '') {
|
|
97
118
|
return false;
|
|
98
119
|
}
|
|
@@ -103,12 +124,14 @@ export default class SubscribeTransaction implements IModel {
|
|
|
103
124
|
region: string|null,
|
|
104
125
|
ownerId: string|null,
|
|
105
126
|
namespaceName: string|null,
|
|
127
|
+
contentName: string|null,
|
|
106
128
|
transactionId: string|null,
|
|
107
129
|
): string|null {
|
|
108
130
|
return grnFormat
|
|
109
131
|
.replace('{region}', region ?? '')
|
|
110
132
|
.replace('{ownerId}', ownerId ?? '')
|
|
111
133
|
.replace('{namespaceName}', namespaceName ?? '')
|
|
134
|
+
.replace('{contentName}', contentName ?? '')
|
|
112
135
|
.replace('{transactionId}', transactionId ?? '');
|
|
113
136
|
}
|
|
114
137
|
public getSubscribeTransactionId(): string|null {
|
|
@@ -122,6 +145,17 @@ export default class SubscribeTransaction implements IModel {
|
|
|
122
145
|
this.subscribeTransactionId = subscribeTransactionId;
|
|
123
146
|
return this;
|
|
124
147
|
}
|
|
148
|
+
public getContentName(): string|null {
|
|
149
|
+
return this.contentName;
|
|
150
|
+
}
|
|
151
|
+
public setContentName(contentName: string|null) {
|
|
152
|
+
this.contentName = contentName;
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
public withContentName(contentName: string|null): this {
|
|
156
|
+
this.contentName = contentName;
|
|
157
|
+
return this;
|
|
158
|
+
}
|
|
125
159
|
public getTransactionId(): string|null {
|
|
126
160
|
return this.transactionId;
|
|
127
161
|
}
|
|
@@ -155,17 +189,6 @@ export default class SubscribeTransaction implements IModel {
|
|
|
155
189
|
this.userId = userId;
|
|
156
190
|
return this;
|
|
157
191
|
}
|
|
158
|
-
public getStatus(): string|null {
|
|
159
|
-
return this.status;
|
|
160
|
-
}
|
|
161
|
-
public setStatus(status: string|null) {
|
|
162
|
-
this.status = status;
|
|
163
|
-
return this;
|
|
164
|
-
}
|
|
165
|
-
public withStatus(status: string|null): this {
|
|
166
|
-
this.status = status;
|
|
167
|
-
return this;
|
|
168
|
-
}
|
|
169
192
|
public getStatusDetail(): string|null {
|
|
170
193
|
return this.statusDetail;
|
|
171
194
|
}
|
|
@@ -228,10 +251,10 @@ export default class SubscribeTransaction implements IModel {
|
|
|
228
251
|
}
|
|
229
252
|
return new SubscribeTransaction()
|
|
230
253
|
.withSubscribeTransactionId(data["subscribeTransactionId"])
|
|
254
|
+
.withContentName(data["contentName"])
|
|
231
255
|
.withTransactionId(data["transactionId"])
|
|
232
256
|
.withStore(data["store"])
|
|
233
257
|
.withUserId(data["userId"])
|
|
234
|
-
.withStatus(data["status"])
|
|
235
258
|
.withStatusDetail(data["statusDetail"])
|
|
236
259
|
.withExpiresAt(data["expiresAt"])
|
|
237
260
|
.withCreatedAt(data["createdAt"])
|
|
@@ -242,10 +265,10 @@ export default class SubscribeTransaction implements IModel {
|
|
|
242
265
|
public toDict(): {[key: string]: any} {
|
|
243
266
|
return {
|
|
244
267
|
"subscribeTransactionId": this.getSubscribeTransactionId(),
|
|
268
|
+
"contentName": this.getContentName(),
|
|
245
269
|
"transactionId": this.getTransactionId(),
|
|
246
270
|
"store": this.getStore(),
|
|
247
271
|
"userId": this.getUserId(),
|
|
248
|
-
"status": this.getStatus(),
|
|
249
272
|
"statusDetail": this.getStatusDetail(),
|
|
250
273
|
"expiresAt": this.getExpiresAt(),
|
|
251
274
|
"createdAt": this.getCreatedAt(),
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import IModel from '../../core/interface/IModel';
|
|
2
|
+
import * as Gs2Money2 from '../../money2/model';
|
|
3
|
+
export default class SubscriptionStatus implements IModel {
|
|
4
|
+
private userId;
|
|
5
|
+
private contentName;
|
|
6
|
+
private status;
|
|
7
|
+
private expiresAt;
|
|
8
|
+
private detail;
|
|
9
|
+
static isValid(grn: string): boolean;
|
|
10
|
+
static createGrn(): string | null;
|
|
11
|
+
getUserId(): string | null;
|
|
12
|
+
setUserId(userId: string | null): this;
|
|
13
|
+
withUserId(userId: string | null): this;
|
|
14
|
+
getContentName(): string | null;
|
|
15
|
+
setContentName(contentName: string | null): this;
|
|
16
|
+
withContentName(contentName: string | null): this;
|
|
17
|
+
getStatus(): string | null;
|
|
18
|
+
setStatus(status: string | null): this;
|
|
19
|
+
withStatus(status: string | null): this;
|
|
20
|
+
getExpiresAt(): number | null;
|
|
21
|
+
setExpiresAt(expiresAt: number | null): this;
|
|
22
|
+
withExpiresAt(expiresAt: number | null): this;
|
|
23
|
+
getDetail(): Gs2Money2.SubscribeTransaction[] | null;
|
|
24
|
+
setDetail(detail: Gs2Money2.SubscribeTransaction[] | null): this;
|
|
25
|
+
withDetail(detail: Gs2Money2.SubscribeTransaction[] | null): this;
|
|
26
|
+
static fromDict(data: {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}): SubscriptionStatus | null;
|
|
29
|
+
toDict(): {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
};
|
|
32
|
+
}
|