@guardian/bridget 4.0.0 → 5.0.0
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/Discussion.d.ts +112 -0
- package/Discussion.js +747 -50
- package/DiscussionBadge.d.ts +17 -0
- package/DiscussionBadge.js +112 -0
- package/DiscussionUserProfile.d.ts +45 -0
- package/DiscussionUserProfile.js +362 -0
- package/GetUserProfileResponse.d.ts +28 -0
- package/GetUserProfileResponse.js +170 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as thrift from "@creditkarma/thrift-server-core";
|
|
2
|
+
export interface IDiscussionBadge {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface IDiscussionBadgeArgs {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const DiscussionBadgeCodec: thrift.IStructCodec<IDiscussionBadgeArgs, IDiscussionBadge>;
|
|
9
|
+
export declare class DiscussionBadge extends thrift.StructLike implements IDiscussionBadge {
|
|
10
|
+
name: string;
|
|
11
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
12
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
13
|
+
constructor(args: IDiscussionBadgeArgs);
|
|
14
|
+
static read(input: thrift.TProtocol): DiscussionBadge;
|
|
15
|
+
static write(args: IDiscussionBadgeArgs, output: thrift.TProtocol): void;
|
|
16
|
+
write(output: thrift.TProtocol): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.DiscussionBadge = exports.DiscussionBadgeCodec = void 0;
|
|
27
|
+
/* tslint:disable */
|
|
28
|
+
/* eslint-disable */
|
|
29
|
+
/*
|
|
30
|
+
* Autogenerated by @creditkarma/thrift-typescript v3.7.6
|
|
31
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
32
|
+
*/
|
|
33
|
+
const thrift = __importStar(require("@creditkarma/thrift-server-core"));
|
|
34
|
+
exports.DiscussionBadgeCodec = {
|
|
35
|
+
encode(args, output) {
|
|
36
|
+
const obj = {
|
|
37
|
+
name: args.name
|
|
38
|
+
};
|
|
39
|
+
output.writeStructBegin("DiscussionBadge");
|
|
40
|
+
if (obj.name != null) {
|
|
41
|
+
output.writeFieldBegin("name", thrift.TType.STRING, 1);
|
|
42
|
+
output.writeString(obj.name);
|
|
43
|
+
output.writeFieldEnd();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[name] is unset!");
|
|
47
|
+
}
|
|
48
|
+
output.writeFieldStop();
|
|
49
|
+
output.writeStructEnd();
|
|
50
|
+
return;
|
|
51
|
+
},
|
|
52
|
+
decode(input) {
|
|
53
|
+
let _args = {};
|
|
54
|
+
input.readStructBegin();
|
|
55
|
+
while (true) {
|
|
56
|
+
const ret = input.readFieldBegin();
|
|
57
|
+
const fieldType = ret.fieldType;
|
|
58
|
+
const fieldId = ret.fieldId;
|
|
59
|
+
if (fieldType === thrift.TType.STOP) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
switch (fieldId) {
|
|
63
|
+
case 1:
|
|
64
|
+
if (fieldType === thrift.TType.STRING) {
|
|
65
|
+
const value_1 = input.readString();
|
|
66
|
+
_args.name = value_1;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
input.skip(fieldType);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
default: {
|
|
73
|
+
input.skip(fieldType);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
input.readFieldEnd();
|
|
77
|
+
}
|
|
78
|
+
input.readStructEnd();
|
|
79
|
+
if (_args.name !== undefined) {
|
|
80
|
+
return {
|
|
81
|
+
name: _args.name
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read DiscussionBadge from input");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
class DiscussionBadge extends thrift.StructLike {
|
|
90
|
+
constructor(args) {
|
|
91
|
+
super();
|
|
92
|
+
this._annotations = {};
|
|
93
|
+
this._fieldAnnotations = {};
|
|
94
|
+
if (args.name != null) {
|
|
95
|
+
const value_2 = args.name;
|
|
96
|
+
this.name = value_2;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[name] is unset!");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
static read(input) {
|
|
103
|
+
return new DiscussionBadge(exports.DiscussionBadgeCodec.decode(input));
|
|
104
|
+
}
|
|
105
|
+
static write(args, output) {
|
|
106
|
+
return exports.DiscussionBadgeCodec.encode(args, output);
|
|
107
|
+
}
|
|
108
|
+
write(output) {
|
|
109
|
+
return exports.DiscussionBadgeCodec.encode(this, output);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.DiscussionBadge = DiscussionBadge;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as thrift from "@creditkarma/thrift-server-core";
|
|
2
|
+
import * as DiscussionBadge from "./DiscussionBadge";
|
|
3
|
+
export interface IDiscussionUserProfile {
|
|
4
|
+
userId: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
webUrl: string;
|
|
7
|
+
apiUrl: string;
|
|
8
|
+
avatar: string;
|
|
9
|
+
secureAvatarUrl: string;
|
|
10
|
+
badge: Array<DiscussionBadge.IDiscussionBadge>;
|
|
11
|
+
canPostComment: boolean;
|
|
12
|
+
isPremoderated: boolean;
|
|
13
|
+
hasCommented: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface IDiscussionUserProfileArgs {
|
|
16
|
+
userId: string;
|
|
17
|
+
displayName: string;
|
|
18
|
+
webUrl: string;
|
|
19
|
+
apiUrl: string;
|
|
20
|
+
avatar: string;
|
|
21
|
+
secureAvatarUrl: string;
|
|
22
|
+
badge: Array<DiscussionBadge.IDiscussionBadgeArgs>;
|
|
23
|
+
canPostComment: boolean;
|
|
24
|
+
isPremoderated: boolean;
|
|
25
|
+
hasCommented: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const DiscussionUserProfileCodec: thrift.IStructCodec<IDiscussionUserProfileArgs, IDiscussionUserProfile>;
|
|
28
|
+
export declare class DiscussionUserProfile extends thrift.StructLike implements IDiscussionUserProfile {
|
|
29
|
+
userId: string;
|
|
30
|
+
displayName: string;
|
|
31
|
+
webUrl: string;
|
|
32
|
+
apiUrl: string;
|
|
33
|
+
avatar: string;
|
|
34
|
+
secureAvatarUrl: string;
|
|
35
|
+
badge: Array<DiscussionBadge.IDiscussionBadge>;
|
|
36
|
+
canPostComment: boolean;
|
|
37
|
+
isPremoderated: boolean;
|
|
38
|
+
hasCommented: boolean;
|
|
39
|
+
readonly _annotations: thrift.IThriftAnnotations;
|
|
40
|
+
readonly _fieldAnnotations: thrift.IFieldAnnotations;
|
|
41
|
+
constructor(args: IDiscussionUserProfileArgs);
|
|
42
|
+
static read(input: thrift.TProtocol): DiscussionUserProfile;
|
|
43
|
+
static write(args: IDiscussionUserProfileArgs, output: thrift.TProtocol): void;
|
|
44
|
+
write(output: thrift.TProtocol): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.DiscussionUserProfile = exports.DiscussionUserProfileCodec = void 0;
|
|
27
|
+
/* tslint:disable */
|
|
28
|
+
/* eslint-disable */
|
|
29
|
+
/*
|
|
30
|
+
* Autogenerated by @creditkarma/thrift-typescript v3.7.6
|
|
31
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
32
|
+
*/
|
|
33
|
+
const thrift = __importStar(require("@creditkarma/thrift-server-core"));
|
|
34
|
+
const DiscussionBadge = __importStar(require("./DiscussionBadge"));
|
|
35
|
+
exports.DiscussionUserProfileCodec = {
|
|
36
|
+
encode(args, output) {
|
|
37
|
+
const obj = {
|
|
38
|
+
userId: args.userId,
|
|
39
|
+
displayName: args.displayName,
|
|
40
|
+
webUrl: args.webUrl,
|
|
41
|
+
apiUrl: args.apiUrl,
|
|
42
|
+
avatar: args.avatar,
|
|
43
|
+
secureAvatarUrl: args.secureAvatarUrl,
|
|
44
|
+
badge: args.badge,
|
|
45
|
+
canPostComment: args.canPostComment,
|
|
46
|
+
isPremoderated: args.isPremoderated,
|
|
47
|
+
hasCommented: args.hasCommented
|
|
48
|
+
};
|
|
49
|
+
output.writeStructBegin("DiscussionUserProfile");
|
|
50
|
+
if (obj.userId != null) {
|
|
51
|
+
output.writeFieldBegin("userId", thrift.TType.STRING, 1);
|
|
52
|
+
output.writeString(obj.userId);
|
|
53
|
+
output.writeFieldEnd();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[userId] is unset!");
|
|
57
|
+
}
|
|
58
|
+
if (obj.displayName != null) {
|
|
59
|
+
output.writeFieldBegin("displayName", thrift.TType.STRING, 2);
|
|
60
|
+
output.writeString(obj.displayName);
|
|
61
|
+
output.writeFieldEnd();
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[displayName] is unset!");
|
|
65
|
+
}
|
|
66
|
+
if (obj.webUrl != null) {
|
|
67
|
+
output.writeFieldBegin("webUrl", thrift.TType.STRING, 3);
|
|
68
|
+
output.writeString(obj.webUrl);
|
|
69
|
+
output.writeFieldEnd();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[webUrl] is unset!");
|
|
73
|
+
}
|
|
74
|
+
if (obj.apiUrl != null) {
|
|
75
|
+
output.writeFieldBegin("apiUrl", thrift.TType.STRING, 4);
|
|
76
|
+
output.writeString(obj.apiUrl);
|
|
77
|
+
output.writeFieldEnd();
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[apiUrl] is unset!");
|
|
81
|
+
}
|
|
82
|
+
if (obj.avatar != null) {
|
|
83
|
+
output.writeFieldBegin("avatar", thrift.TType.STRING, 5);
|
|
84
|
+
output.writeString(obj.avatar);
|
|
85
|
+
output.writeFieldEnd();
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[avatar] is unset!");
|
|
89
|
+
}
|
|
90
|
+
if (obj.secureAvatarUrl != null) {
|
|
91
|
+
output.writeFieldBegin("secureAvatarUrl", thrift.TType.STRING, 6);
|
|
92
|
+
output.writeString(obj.secureAvatarUrl);
|
|
93
|
+
output.writeFieldEnd();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[secureAvatarUrl] is unset!");
|
|
97
|
+
}
|
|
98
|
+
if (obj.badge != null) {
|
|
99
|
+
output.writeFieldBegin("badge", thrift.TType.LIST, 7);
|
|
100
|
+
output.writeListBegin(thrift.TType.STRUCT, obj.badge.length);
|
|
101
|
+
obj.badge.forEach((value_1) => {
|
|
102
|
+
DiscussionBadge.DiscussionBadgeCodec.encode(value_1, output);
|
|
103
|
+
});
|
|
104
|
+
output.writeListEnd();
|
|
105
|
+
output.writeFieldEnd();
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[badge] is unset!");
|
|
109
|
+
}
|
|
110
|
+
if (obj.canPostComment != null) {
|
|
111
|
+
output.writeFieldBegin("canPostComment", thrift.TType.BOOL, 8);
|
|
112
|
+
output.writeBool(obj.canPostComment);
|
|
113
|
+
output.writeFieldEnd();
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[canPostComment] is unset!");
|
|
117
|
+
}
|
|
118
|
+
if (obj.isPremoderated != null) {
|
|
119
|
+
output.writeFieldBegin("isPremoderated", thrift.TType.BOOL, 9);
|
|
120
|
+
output.writeBool(obj.isPremoderated);
|
|
121
|
+
output.writeFieldEnd();
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[isPremoderated] is unset!");
|
|
125
|
+
}
|
|
126
|
+
if (obj.hasCommented != null) {
|
|
127
|
+
output.writeFieldBegin("hasCommented", thrift.TType.BOOL, 10);
|
|
128
|
+
output.writeBool(obj.hasCommented);
|
|
129
|
+
output.writeFieldEnd();
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[hasCommented] is unset!");
|
|
133
|
+
}
|
|
134
|
+
output.writeFieldStop();
|
|
135
|
+
output.writeStructEnd();
|
|
136
|
+
return;
|
|
137
|
+
},
|
|
138
|
+
decode(input) {
|
|
139
|
+
let _args = {};
|
|
140
|
+
input.readStructBegin();
|
|
141
|
+
while (true) {
|
|
142
|
+
const ret = input.readFieldBegin();
|
|
143
|
+
const fieldType = ret.fieldType;
|
|
144
|
+
const fieldId = ret.fieldId;
|
|
145
|
+
if (fieldType === thrift.TType.STOP) {
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
switch (fieldId) {
|
|
149
|
+
case 1:
|
|
150
|
+
if (fieldType === thrift.TType.STRING) {
|
|
151
|
+
const value_2 = input.readString();
|
|
152
|
+
_args.userId = value_2;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
input.skip(fieldType);
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
case 2:
|
|
159
|
+
if (fieldType === thrift.TType.STRING) {
|
|
160
|
+
const value_3 = input.readString();
|
|
161
|
+
_args.displayName = value_3;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
input.skip(fieldType);
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
case 3:
|
|
168
|
+
if (fieldType === thrift.TType.STRING) {
|
|
169
|
+
const value_4 = input.readString();
|
|
170
|
+
_args.webUrl = value_4;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
input.skip(fieldType);
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
case 4:
|
|
177
|
+
if (fieldType === thrift.TType.STRING) {
|
|
178
|
+
const value_5 = input.readString();
|
|
179
|
+
_args.apiUrl = value_5;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
input.skip(fieldType);
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
185
|
+
case 5:
|
|
186
|
+
if (fieldType === thrift.TType.STRING) {
|
|
187
|
+
const value_6 = input.readString();
|
|
188
|
+
_args.avatar = value_6;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
input.skip(fieldType);
|
|
192
|
+
}
|
|
193
|
+
break;
|
|
194
|
+
case 6:
|
|
195
|
+
if (fieldType === thrift.TType.STRING) {
|
|
196
|
+
const value_7 = input.readString();
|
|
197
|
+
_args.secureAvatarUrl = value_7;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
input.skip(fieldType);
|
|
201
|
+
}
|
|
202
|
+
break;
|
|
203
|
+
case 7:
|
|
204
|
+
if (fieldType === thrift.TType.LIST) {
|
|
205
|
+
const value_8 = new Array();
|
|
206
|
+
const metadata_1 = input.readListBegin();
|
|
207
|
+
const size_1 = metadata_1.size;
|
|
208
|
+
for (let i_1 = 0; i_1 < size_1; i_1++) {
|
|
209
|
+
const value_9 = DiscussionBadge.DiscussionBadgeCodec.decode(input);
|
|
210
|
+
value_8.push(value_9);
|
|
211
|
+
}
|
|
212
|
+
input.readListEnd();
|
|
213
|
+
_args.badge = value_8;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
input.skip(fieldType);
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
case 8:
|
|
220
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
221
|
+
const value_10 = input.readBool();
|
|
222
|
+
_args.canPostComment = value_10;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
input.skip(fieldType);
|
|
226
|
+
}
|
|
227
|
+
break;
|
|
228
|
+
case 9:
|
|
229
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
230
|
+
const value_11 = input.readBool();
|
|
231
|
+
_args.isPremoderated = value_11;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
input.skip(fieldType);
|
|
235
|
+
}
|
|
236
|
+
break;
|
|
237
|
+
case 10:
|
|
238
|
+
if (fieldType === thrift.TType.BOOL) {
|
|
239
|
+
const value_12 = input.readBool();
|
|
240
|
+
_args.hasCommented = value_12;
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
input.skip(fieldType);
|
|
244
|
+
}
|
|
245
|
+
break;
|
|
246
|
+
default: {
|
|
247
|
+
input.skip(fieldType);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
input.readFieldEnd();
|
|
251
|
+
}
|
|
252
|
+
input.readStructEnd();
|
|
253
|
+
if (_args.userId !== undefined && _args.displayName !== undefined && _args.webUrl !== undefined && _args.apiUrl !== undefined && _args.avatar !== undefined && _args.secureAvatarUrl !== undefined && _args.badge !== undefined && _args.canPostComment !== undefined && _args.isPremoderated !== undefined && _args.hasCommented !== undefined) {
|
|
254
|
+
return {
|
|
255
|
+
userId: _args.userId,
|
|
256
|
+
displayName: _args.displayName,
|
|
257
|
+
webUrl: _args.webUrl,
|
|
258
|
+
apiUrl: _args.apiUrl,
|
|
259
|
+
avatar: _args.avatar,
|
|
260
|
+
secureAvatarUrl: _args.secureAvatarUrl,
|
|
261
|
+
badge: _args.badge,
|
|
262
|
+
canPostComment: _args.canPostComment,
|
|
263
|
+
isPremoderated: _args.isPremoderated,
|
|
264
|
+
hasCommented: _args.hasCommented
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Unable to read DiscussionUserProfile from input");
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
class DiscussionUserProfile extends thrift.StructLike {
|
|
273
|
+
constructor(args) {
|
|
274
|
+
super();
|
|
275
|
+
this._annotations = {};
|
|
276
|
+
this._fieldAnnotations = {};
|
|
277
|
+
if (args.userId != null) {
|
|
278
|
+
const value_13 = args.userId;
|
|
279
|
+
this.userId = value_13;
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[userId] is unset!");
|
|
283
|
+
}
|
|
284
|
+
if (args.displayName != null) {
|
|
285
|
+
const value_14 = args.displayName;
|
|
286
|
+
this.displayName = value_14;
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[displayName] is unset!");
|
|
290
|
+
}
|
|
291
|
+
if (args.webUrl != null) {
|
|
292
|
+
const value_15 = args.webUrl;
|
|
293
|
+
this.webUrl = value_15;
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[webUrl] is unset!");
|
|
297
|
+
}
|
|
298
|
+
if (args.apiUrl != null) {
|
|
299
|
+
const value_16 = args.apiUrl;
|
|
300
|
+
this.apiUrl = value_16;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[apiUrl] is unset!");
|
|
304
|
+
}
|
|
305
|
+
if (args.avatar != null) {
|
|
306
|
+
const value_17 = args.avatar;
|
|
307
|
+
this.avatar = value_17;
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[avatar] is unset!");
|
|
311
|
+
}
|
|
312
|
+
if (args.secureAvatarUrl != null) {
|
|
313
|
+
const value_18 = args.secureAvatarUrl;
|
|
314
|
+
this.secureAvatarUrl = value_18;
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[secureAvatarUrl] is unset!");
|
|
318
|
+
}
|
|
319
|
+
if (args.badge != null) {
|
|
320
|
+
const value_19 = new Array();
|
|
321
|
+
args.badge.forEach((value_23) => {
|
|
322
|
+
const value_24 = new DiscussionBadge.DiscussionBadge(value_23);
|
|
323
|
+
value_19.push(value_24);
|
|
324
|
+
});
|
|
325
|
+
this.badge = value_19;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[badge] is unset!");
|
|
329
|
+
}
|
|
330
|
+
if (args.canPostComment != null) {
|
|
331
|
+
const value_20 = args.canPostComment;
|
|
332
|
+
this.canPostComment = value_20;
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[canPostComment] is unset!");
|
|
336
|
+
}
|
|
337
|
+
if (args.isPremoderated != null) {
|
|
338
|
+
const value_21 = args.isPremoderated;
|
|
339
|
+
this.isPremoderated = value_21;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[isPremoderated] is unset!");
|
|
343
|
+
}
|
|
344
|
+
if (args.hasCommented != null) {
|
|
345
|
+
const value_22 = args.hasCommented;
|
|
346
|
+
this.hasCommented = value_22;
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
throw new thrift.TProtocolException(thrift.TProtocolExceptionType.UNKNOWN, "Required field[hasCommented] is unset!");
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
static read(input) {
|
|
353
|
+
return new DiscussionUserProfile(exports.DiscussionUserProfileCodec.decode(input));
|
|
354
|
+
}
|
|
355
|
+
static write(args, output) {
|
|
356
|
+
return exports.DiscussionUserProfileCodec.encode(args, output);
|
|
357
|
+
}
|
|
358
|
+
write(output) {
|
|
359
|
+
return exports.DiscussionUserProfileCodec.encode(this, output);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
exports.DiscussionUserProfile = DiscussionUserProfile;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as thrift from "@creditkarma/thrift-server-core";
|
|
2
|
+
import * as DiscussionUserProfile from "./DiscussionUserProfile";
|
|
3
|
+
import * as DiscussionNativeError from "./DiscussionNativeError";
|
|
4
|
+
export declare enum GetUserProfileResponseType {
|
|
5
|
+
GetUserProfileResponseWithProfile = "profile",
|
|
6
|
+
GetUserProfileResponseWithError = "error"
|
|
7
|
+
}
|
|
8
|
+
export type GetUserProfileResponse = IGetUserProfileResponseWithProfile | IGetUserProfileResponseWithError;
|
|
9
|
+
export interface IGetUserProfileResponseWithProfile {
|
|
10
|
+
__type: GetUserProfileResponseType.GetUserProfileResponseWithProfile;
|
|
11
|
+
profile: DiscussionUserProfile.IDiscussionUserProfile;
|
|
12
|
+
error?: undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface IGetUserProfileResponseWithError {
|
|
15
|
+
__type: GetUserProfileResponseType.GetUserProfileResponseWithError;
|
|
16
|
+
profile?: undefined;
|
|
17
|
+
error: DiscussionNativeError.DiscussionNativeError;
|
|
18
|
+
}
|
|
19
|
+
export type GetUserProfileResponseArgs = IGetUserProfileResponseWithProfileArgs | IGetUserProfileResponseWithErrorArgs;
|
|
20
|
+
export interface IGetUserProfileResponseWithProfileArgs {
|
|
21
|
+
profile: DiscussionUserProfile.IDiscussionUserProfileArgs;
|
|
22
|
+
error?: undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface IGetUserProfileResponseWithErrorArgs {
|
|
25
|
+
profile?: undefined;
|
|
26
|
+
error: DiscussionNativeError.DiscussionNativeError;
|
|
27
|
+
}
|
|
28
|
+
export declare const GetUserProfileResponseCodec: thrift.IStructToolkit<GetUserProfileResponseArgs, GetUserProfileResponse>;
|