nodejs-insta-private-api-mqt 1.3.91 → 1.3.92
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/dist/dist/realtime/proto/direct-bundle.js +3552 -0
- package/dist/dist/realtime/proto/ig-messages-bundle.js +2249 -0
- package/dist/dist/realtime/proto/iris-bundle.js +7108 -0
- package/dist/dist/realtime/proto-parser.js +167 -86
- package/dist/dist/realtime/protocols/proto-definitions.js +18 -7
- package/package.json +1 -1
|
@@ -0,0 +1,3552 @@
|
|
|
1
|
+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var $protobuf = require("protobufjs/minimal");
|
|
5
|
+
|
|
6
|
+
// Common aliases
|
|
7
|
+
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
|
8
|
+
|
|
9
|
+
// Exported root namespace
|
|
10
|
+
var $root = $protobuf.roots.direct_root || ($protobuf.roots.direct_root = {});
|
|
11
|
+
|
|
12
|
+
$root.ig = (function() {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Namespace ig.
|
|
16
|
+
* @exports ig
|
|
17
|
+
* @namespace
|
|
18
|
+
*/
|
|
19
|
+
var ig = {};
|
|
20
|
+
|
|
21
|
+
ig.direct = (function() {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Namespace direct.
|
|
25
|
+
* @memberof ig
|
|
26
|
+
* @namespace
|
|
27
|
+
*/
|
|
28
|
+
var direct = {};
|
|
29
|
+
|
|
30
|
+
direct.DirectInboxMessageContent = (function() {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Properties of a DirectInboxMessageContent.
|
|
34
|
+
* @memberof ig.direct
|
|
35
|
+
* @interface IDirectInboxMessageContent
|
|
36
|
+
* @property {string|null} [text] DirectInboxMessageContent text
|
|
37
|
+
* @property {Array.<ig.common.IMediaAttachment>|null} [media] DirectInboxMessageContent media
|
|
38
|
+
* @property {Array.<ig.common.ILink>|null} [links] DirectInboxMessageContent links
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Constructs a new DirectInboxMessageContent.
|
|
43
|
+
* @memberof ig.direct
|
|
44
|
+
* @classdesc Represents a DirectInboxMessageContent.
|
|
45
|
+
* @implements IDirectInboxMessageContent
|
|
46
|
+
* @constructor
|
|
47
|
+
* @param {ig.direct.IDirectInboxMessageContent=} [properties] Properties to set
|
|
48
|
+
*/
|
|
49
|
+
function DirectInboxMessageContent(properties) {
|
|
50
|
+
this.media = [];
|
|
51
|
+
this.links = [];
|
|
52
|
+
if (properties)
|
|
53
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
54
|
+
if (properties[keys[i]] != null)
|
|
55
|
+
this[keys[i]] = properties[keys[i]];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* DirectInboxMessageContent text.
|
|
60
|
+
* @member {string} text
|
|
61
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
62
|
+
* @instance
|
|
63
|
+
*/
|
|
64
|
+
DirectInboxMessageContent.prototype.text = "";
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* DirectInboxMessageContent media.
|
|
68
|
+
* @member {Array.<ig.common.IMediaAttachment>} media
|
|
69
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
70
|
+
* @instance
|
|
71
|
+
*/
|
|
72
|
+
DirectInboxMessageContent.prototype.media = $util.emptyArray;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* DirectInboxMessageContent links.
|
|
76
|
+
* @member {Array.<ig.common.ILink>} links
|
|
77
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
78
|
+
* @instance
|
|
79
|
+
*/
|
|
80
|
+
DirectInboxMessageContent.prototype.links = $util.emptyArray;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new DirectInboxMessageContent instance using the specified properties.
|
|
84
|
+
* @function create
|
|
85
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
86
|
+
* @static
|
|
87
|
+
* @param {ig.direct.IDirectInboxMessageContent=} [properties] Properties to set
|
|
88
|
+
* @returns {ig.direct.DirectInboxMessageContent} DirectInboxMessageContent instance
|
|
89
|
+
*/
|
|
90
|
+
DirectInboxMessageContent.create = function create(properties) {
|
|
91
|
+
return new DirectInboxMessageContent(properties);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Encodes the specified DirectInboxMessageContent message. Does not implicitly {@link ig.direct.DirectInboxMessageContent.verify|verify} messages.
|
|
96
|
+
* @function encode
|
|
97
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
98
|
+
* @static
|
|
99
|
+
* @param {ig.direct.IDirectInboxMessageContent} message DirectInboxMessageContent message or plain object to encode
|
|
100
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
101
|
+
* @returns {$protobuf.Writer} Writer
|
|
102
|
+
*/
|
|
103
|
+
DirectInboxMessageContent.encode = function encode(message, writer) {
|
|
104
|
+
if (!writer)
|
|
105
|
+
writer = $Writer.create();
|
|
106
|
+
if (message.text != null && Object.hasOwnProperty.call(message, "text"))
|
|
107
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.text);
|
|
108
|
+
if (message.media != null && message.media.length)
|
|
109
|
+
for (var i = 0; i < message.media.length; ++i)
|
|
110
|
+
$root.ig.common.MediaAttachment.encode(message.media[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
111
|
+
if (message.links != null && message.links.length)
|
|
112
|
+
for (var i = 0; i < message.links.length; ++i)
|
|
113
|
+
$root.ig.common.Link.encode(message.links[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
114
|
+
return writer;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Encodes the specified DirectInboxMessageContent message, length delimited. Does not implicitly {@link ig.direct.DirectInboxMessageContent.verify|verify} messages.
|
|
119
|
+
* @function encodeDelimited
|
|
120
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
121
|
+
* @static
|
|
122
|
+
* @param {ig.direct.IDirectInboxMessageContent} message DirectInboxMessageContent message or plain object to encode
|
|
123
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
124
|
+
* @returns {$protobuf.Writer} Writer
|
|
125
|
+
*/
|
|
126
|
+
DirectInboxMessageContent.encodeDelimited = function encodeDelimited(message, writer) {
|
|
127
|
+
return this.encode(message, writer).ldelim();
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Decodes a DirectInboxMessageContent message from the specified reader or buffer.
|
|
132
|
+
* @function decode
|
|
133
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
134
|
+
* @static
|
|
135
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
136
|
+
* @param {number} [length] Message length if known beforehand
|
|
137
|
+
* @returns {ig.direct.DirectInboxMessageContent} DirectInboxMessageContent
|
|
138
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
139
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
140
|
+
*/
|
|
141
|
+
DirectInboxMessageContent.decode = function decode(reader, length, error) {
|
|
142
|
+
if (!(reader instanceof $Reader))
|
|
143
|
+
reader = $Reader.create(reader);
|
|
144
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.direct.DirectInboxMessageContent();
|
|
145
|
+
while (reader.pos < end) {
|
|
146
|
+
var tag = reader.uint32();
|
|
147
|
+
if (tag === error)
|
|
148
|
+
break;
|
|
149
|
+
switch (tag >>> 3) {
|
|
150
|
+
case 1: {
|
|
151
|
+
message.text = reader.string();
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
case 2: {
|
|
155
|
+
if (!(message.media && message.media.length))
|
|
156
|
+
message.media = [];
|
|
157
|
+
message.media.push($root.ig.common.MediaAttachment.decode(reader, reader.uint32()));
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
case 3: {
|
|
161
|
+
if (!(message.links && message.links.length))
|
|
162
|
+
message.links = [];
|
|
163
|
+
message.links.push($root.ig.common.Link.decode(reader, reader.uint32()));
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
default:
|
|
167
|
+
reader.skipType(tag & 7);
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return message;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Decodes a DirectInboxMessageContent message from the specified reader or buffer, length delimited.
|
|
176
|
+
* @function decodeDelimited
|
|
177
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
178
|
+
* @static
|
|
179
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
180
|
+
* @returns {ig.direct.DirectInboxMessageContent} DirectInboxMessageContent
|
|
181
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
182
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
183
|
+
*/
|
|
184
|
+
DirectInboxMessageContent.decodeDelimited = function decodeDelimited(reader) {
|
|
185
|
+
if (!(reader instanceof $Reader))
|
|
186
|
+
reader = new $Reader(reader);
|
|
187
|
+
return this.decode(reader, reader.uint32());
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Verifies a DirectInboxMessageContent message.
|
|
192
|
+
* @function verify
|
|
193
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
194
|
+
* @static
|
|
195
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
196
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
197
|
+
*/
|
|
198
|
+
DirectInboxMessageContent.verify = function verify(message) {
|
|
199
|
+
if (typeof message !== "object" || message === null)
|
|
200
|
+
return "object expected";
|
|
201
|
+
if (message.text != null && message.hasOwnProperty("text"))
|
|
202
|
+
if (!$util.isString(message.text))
|
|
203
|
+
return "text: string expected";
|
|
204
|
+
if (message.media != null && message.hasOwnProperty("media")) {
|
|
205
|
+
if (!Array.isArray(message.media))
|
|
206
|
+
return "media: array expected";
|
|
207
|
+
for (var i = 0; i < message.media.length; ++i) {
|
|
208
|
+
var error = $root.ig.common.MediaAttachment.verify(message.media[i]);
|
|
209
|
+
if (error)
|
|
210
|
+
return "media." + error;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (message.links != null && message.hasOwnProperty("links")) {
|
|
214
|
+
if (!Array.isArray(message.links))
|
|
215
|
+
return "links: array expected";
|
|
216
|
+
for (var i = 0; i < message.links.length; ++i) {
|
|
217
|
+
var error = $root.ig.common.Link.verify(message.links[i]);
|
|
218
|
+
if (error)
|
|
219
|
+
return "links." + error;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Creates a DirectInboxMessageContent message from a plain object. Also converts values to their respective internal types.
|
|
227
|
+
* @function fromObject
|
|
228
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
229
|
+
* @static
|
|
230
|
+
* @param {Object.<string,*>} object Plain object
|
|
231
|
+
* @returns {ig.direct.DirectInboxMessageContent} DirectInboxMessageContent
|
|
232
|
+
*/
|
|
233
|
+
DirectInboxMessageContent.fromObject = function fromObject(object) {
|
|
234
|
+
if (object instanceof $root.ig.direct.DirectInboxMessageContent)
|
|
235
|
+
return object;
|
|
236
|
+
var message = new $root.ig.direct.DirectInboxMessageContent();
|
|
237
|
+
if (object.text != null)
|
|
238
|
+
message.text = String(object.text);
|
|
239
|
+
if (object.media) {
|
|
240
|
+
if (!Array.isArray(object.media))
|
|
241
|
+
throw TypeError(".ig.direct.DirectInboxMessageContent.media: array expected");
|
|
242
|
+
message.media = [];
|
|
243
|
+
for (var i = 0; i < object.media.length; ++i) {
|
|
244
|
+
if (typeof object.media[i] !== "object")
|
|
245
|
+
throw TypeError(".ig.direct.DirectInboxMessageContent.media: object expected");
|
|
246
|
+
message.media[i] = $root.ig.common.MediaAttachment.fromObject(object.media[i]);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (object.links) {
|
|
250
|
+
if (!Array.isArray(object.links))
|
|
251
|
+
throw TypeError(".ig.direct.DirectInboxMessageContent.links: array expected");
|
|
252
|
+
message.links = [];
|
|
253
|
+
for (var i = 0; i < object.links.length; ++i) {
|
|
254
|
+
if (typeof object.links[i] !== "object")
|
|
255
|
+
throw TypeError(".ig.direct.DirectInboxMessageContent.links: object expected");
|
|
256
|
+
message.links[i] = $root.ig.common.Link.fromObject(object.links[i]);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return message;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Creates a plain object from a DirectInboxMessageContent message. Also converts values to other types if specified.
|
|
264
|
+
* @function toObject
|
|
265
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
266
|
+
* @static
|
|
267
|
+
* @param {ig.direct.DirectInboxMessageContent} message DirectInboxMessageContent
|
|
268
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
269
|
+
* @returns {Object.<string,*>} Plain object
|
|
270
|
+
*/
|
|
271
|
+
DirectInboxMessageContent.toObject = function toObject(message, options) {
|
|
272
|
+
if (!options)
|
|
273
|
+
options = {};
|
|
274
|
+
var object = {};
|
|
275
|
+
if (options.arrays || options.defaults) {
|
|
276
|
+
object.media = [];
|
|
277
|
+
object.links = [];
|
|
278
|
+
}
|
|
279
|
+
if (options.defaults)
|
|
280
|
+
object.text = "";
|
|
281
|
+
if (message.text != null && message.hasOwnProperty("text"))
|
|
282
|
+
object.text = message.text;
|
|
283
|
+
if (message.media && message.media.length) {
|
|
284
|
+
object.media = [];
|
|
285
|
+
for (var j = 0; j < message.media.length; ++j)
|
|
286
|
+
object.media[j] = $root.ig.common.MediaAttachment.toObject(message.media[j], options);
|
|
287
|
+
}
|
|
288
|
+
if (message.links && message.links.length) {
|
|
289
|
+
object.links = [];
|
|
290
|
+
for (var j = 0; j < message.links.length; ++j)
|
|
291
|
+
object.links[j] = $root.ig.common.Link.toObject(message.links[j], options);
|
|
292
|
+
}
|
|
293
|
+
return object;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Converts this DirectInboxMessageContent to JSON.
|
|
298
|
+
* @function toJSON
|
|
299
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
300
|
+
* @instance
|
|
301
|
+
* @returns {Object.<string,*>} JSON object
|
|
302
|
+
*/
|
|
303
|
+
DirectInboxMessageContent.prototype.toJSON = function toJSON() {
|
|
304
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Gets the default type url for DirectInboxMessageContent
|
|
309
|
+
* @function getTypeUrl
|
|
310
|
+
* @memberof ig.direct.DirectInboxMessageContent
|
|
311
|
+
* @static
|
|
312
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
313
|
+
* @returns {string} The default type url
|
|
314
|
+
*/
|
|
315
|
+
DirectInboxMessageContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
316
|
+
if (typeUrlPrefix === undefined) {
|
|
317
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
318
|
+
}
|
|
319
|
+
return typeUrlPrefix + "/ig.direct.DirectInboxMessageContent";
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
return DirectInboxMessageContent;
|
|
323
|
+
})();
|
|
324
|
+
|
|
325
|
+
direct.DirectInboxMessage = (function() {
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Properties of a DirectInboxMessage.
|
|
329
|
+
* @memberof ig.direct
|
|
330
|
+
* @interface IDirectInboxMessage
|
|
331
|
+
* @property {string|null} [id] DirectInboxMessage id
|
|
332
|
+
* @property {number|Long|null} [userId] DirectInboxMessage userId
|
|
333
|
+
* @property {number|Long|null} [timestamp] DirectInboxMessage timestamp
|
|
334
|
+
* @property {string|null} [itemType] DirectInboxMessage itemType
|
|
335
|
+
* @property {ig.direct.IDirectInboxMessageContent|null} [content] DirectInboxMessage content
|
|
336
|
+
* @property {Object.<string,string>|null} [reactions] DirectInboxMessage reactions
|
|
337
|
+
* @property {boolean|null} [isSent] DirectInboxMessage isSent
|
|
338
|
+
* @property {boolean|null} [isDelivered] DirectInboxMessage isDelivered
|
|
339
|
+
* @property {boolean|null} [isSeen] DirectInboxMessage isSeen
|
|
340
|
+
* @property {number|null} [isForward] DirectInboxMessage isForward
|
|
341
|
+
* @property {number|null} [forwardedFromId] DirectInboxMessage forwardedFromId
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Constructs a new DirectInboxMessage.
|
|
346
|
+
* @memberof ig.direct
|
|
347
|
+
* @classdesc Represents a DirectInboxMessage.
|
|
348
|
+
* @implements IDirectInboxMessage
|
|
349
|
+
* @constructor
|
|
350
|
+
* @param {ig.direct.IDirectInboxMessage=} [properties] Properties to set
|
|
351
|
+
*/
|
|
352
|
+
function DirectInboxMessage(properties) {
|
|
353
|
+
this.reactions = {};
|
|
354
|
+
if (properties)
|
|
355
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
356
|
+
if (properties[keys[i]] != null)
|
|
357
|
+
this[keys[i]] = properties[keys[i]];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* DirectInboxMessage id.
|
|
362
|
+
* @member {string} id
|
|
363
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
364
|
+
* @instance
|
|
365
|
+
*/
|
|
366
|
+
DirectInboxMessage.prototype.id = "";
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* DirectInboxMessage userId.
|
|
370
|
+
* @member {number|Long} userId
|
|
371
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
372
|
+
* @instance
|
|
373
|
+
*/
|
|
374
|
+
DirectInboxMessage.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* DirectInboxMessage timestamp.
|
|
378
|
+
* @member {number|Long} timestamp
|
|
379
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
380
|
+
* @instance
|
|
381
|
+
*/
|
|
382
|
+
DirectInboxMessage.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* DirectInboxMessage itemType.
|
|
386
|
+
* @member {string} itemType
|
|
387
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
388
|
+
* @instance
|
|
389
|
+
*/
|
|
390
|
+
DirectInboxMessage.prototype.itemType = "";
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* DirectInboxMessage content.
|
|
394
|
+
* @member {ig.direct.IDirectInboxMessageContent|null|undefined} content
|
|
395
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
396
|
+
* @instance
|
|
397
|
+
*/
|
|
398
|
+
DirectInboxMessage.prototype.content = null;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* DirectInboxMessage reactions.
|
|
402
|
+
* @member {Object.<string,string>} reactions
|
|
403
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
404
|
+
* @instance
|
|
405
|
+
*/
|
|
406
|
+
DirectInboxMessage.prototype.reactions = $util.emptyObject;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* DirectInboxMessage isSent.
|
|
410
|
+
* @member {boolean} isSent
|
|
411
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
412
|
+
* @instance
|
|
413
|
+
*/
|
|
414
|
+
DirectInboxMessage.prototype.isSent = false;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* DirectInboxMessage isDelivered.
|
|
418
|
+
* @member {boolean} isDelivered
|
|
419
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
420
|
+
* @instance
|
|
421
|
+
*/
|
|
422
|
+
DirectInboxMessage.prototype.isDelivered = false;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* DirectInboxMessage isSeen.
|
|
426
|
+
* @member {boolean} isSeen
|
|
427
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
428
|
+
* @instance
|
|
429
|
+
*/
|
|
430
|
+
DirectInboxMessage.prototype.isSeen = false;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* DirectInboxMessage isForward.
|
|
434
|
+
* @member {number} isForward
|
|
435
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
436
|
+
* @instance
|
|
437
|
+
*/
|
|
438
|
+
DirectInboxMessage.prototype.isForward = 0;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* DirectInboxMessage forwardedFromId.
|
|
442
|
+
* @member {number} forwardedFromId
|
|
443
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
444
|
+
* @instance
|
|
445
|
+
*/
|
|
446
|
+
DirectInboxMessage.prototype.forwardedFromId = 0;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Creates a new DirectInboxMessage instance using the specified properties.
|
|
450
|
+
* @function create
|
|
451
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
452
|
+
* @static
|
|
453
|
+
* @param {ig.direct.IDirectInboxMessage=} [properties] Properties to set
|
|
454
|
+
* @returns {ig.direct.DirectInboxMessage} DirectInboxMessage instance
|
|
455
|
+
*/
|
|
456
|
+
DirectInboxMessage.create = function create(properties) {
|
|
457
|
+
return new DirectInboxMessage(properties);
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Encodes the specified DirectInboxMessage message. Does not implicitly {@link ig.direct.DirectInboxMessage.verify|verify} messages.
|
|
462
|
+
* @function encode
|
|
463
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
464
|
+
* @static
|
|
465
|
+
* @param {ig.direct.IDirectInboxMessage} message DirectInboxMessage message or plain object to encode
|
|
466
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
467
|
+
* @returns {$protobuf.Writer} Writer
|
|
468
|
+
*/
|
|
469
|
+
DirectInboxMessage.encode = function encode(message, writer) {
|
|
470
|
+
if (!writer)
|
|
471
|
+
writer = $Writer.create();
|
|
472
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
473
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
|
|
474
|
+
if (message.userId != null && Object.hasOwnProperty.call(message, "userId"))
|
|
475
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.userId);
|
|
476
|
+
if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
|
|
477
|
+
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timestamp);
|
|
478
|
+
if (message.itemType != null && Object.hasOwnProperty.call(message, "itemType"))
|
|
479
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.itemType);
|
|
480
|
+
if (message.content != null && Object.hasOwnProperty.call(message, "content"))
|
|
481
|
+
$root.ig.direct.DirectInboxMessageContent.encode(message.content, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
482
|
+
if (message.reactions != null && Object.hasOwnProperty.call(message, "reactions"))
|
|
483
|
+
for (var keys = Object.keys(message.reactions), i = 0; i < keys.length; ++i)
|
|
484
|
+
writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.reactions[keys[i]]).ldelim();
|
|
485
|
+
if (message.isSent != null && Object.hasOwnProperty.call(message, "isSent"))
|
|
486
|
+
writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isSent);
|
|
487
|
+
if (message.isDelivered != null && Object.hasOwnProperty.call(message, "isDelivered"))
|
|
488
|
+
writer.uint32(/* id 8, wireType 0 =*/64).bool(message.isDelivered);
|
|
489
|
+
if (message.isSeen != null && Object.hasOwnProperty.call(message, "isSeen"))
|
|
490
|
+
writer.uint32(/* id 9, wireType 0 =*/72).bool(message.isSeen);
|
|
491
|
+
if (message.isForward != null && Object.hasOwnProperty.call(message, "isForward"))
|
|
492
|
+
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.isForward);
|
|
493
|
+
if (message.forwardedFromId != null && Object.hasOwnProperty.call(message, "forwardedFromId"))
|
|
494
|
+
writer.uint32(/* id 11, wireType 0 =*/88).int32(message.forwardedFromId);
|
|
495
|
+
return writer;
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Encodes the specified DirectInboxMessage message, length delimited. Does not implicitly {@link ig.direct.DirectInboxMessage.verify|verify} messages.
|
|
500
|
+
* @function encodeDelimited
|
|
501
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
502
|
+
* @static
|
|
503
|
+
* @param {ig.direct.IDirectInboxMessage} message DirectInboxMessage message or plain object to encode
|
|
504
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
505
|
+
* @returns {$protobuf.Writer} Writer
|
|
506
|
+
*/
|
|
507
|
+
DirectInboxMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
508
|
+
return this.encode(message, writer).ldelim();
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Decodes a DirectInboxMessage message from the specified reader or buffer.
|
|
513
|
+
* @function decode
|
|
514
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
515
|
+
* @static
|
|
516
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
517
|
+
* @param {number} [length] Message length if known beforehand
|
|
518
|
+
* @returns {ig.direct.DirectInboxMessage} DirectInboxMessage
|
|
519
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
520
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
521
|
+
*/
|
|
522
|
+
DirectInboxMessage.decode = function decode(reader, length, error) {
|
|
523
|
+
if (!(reader instanceof $Reader))
|
|
524
|
+
reader = $Reader.create(reader);
|
|
525
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.direct.DirectInboxMessage(), key, value;
|
|
526
|
+
while (reader.pos < end) {
|
|
527
|
+
var tag = reader.uint32();
|
|
528
|
+
if (tag === error)
|
|
529
|
+
break;
|
|
530
|
+
switch (tag >>> 3) {
|
|
531
|
+
case 1: {
|
|
532
|
+
message.id = reader.string();
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
case 2: {
|
|
536
|
+
message.userId = reader.int64();
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
case 3: {
|
|
540
|
+
message.timestamp = reader.int64();
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
case 4: {
|
|
544
|
+
message.itemType = reader.string();
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
case 5: {
|
|
548
|
+
message.content = $root.ig.direct.DirectInboxMessageContent.decode(reader, reader.uint32());
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
case 6: {
|
|
552
|
+
if (message.reactions === $util.emptyObject)
|
|
553
|
+
message.reactions = {};
|
|
554
|
+
var end2 = reader.uint32() + reader.pos;
|
|
555
|
+
key = "";
|
|
556
|
+
value = "";
|
|
557
|
+
while (reader.pos < end2) {
|
|
558
|
+
var tag2 = reader.uint32();
|
|
559
|
+
switch (tag2 >>> 3) {
|
|
560
|
+
case 1:
|
|
561
|
+
key = reader.string();
|
|
562
|
+
break;
|
|
563
|
+
case 2:
|
|
564
|
+
value = reader.string();
|
|
565
|
+
break;
|
|
566
|
+
default:
|
|
567
|
+
reader.skipType(tag2 & 7);
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
message.reactions[key] = value;
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
case 7: {
|
|
575
|
+
message.isSent = reader.bool();
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
case 8: {
|
|
579
|
+
message.isDelivered = reader.bool();
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
case 9: {
|
|
583
|
+
message.isSeen = reader.bool();
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
case 10: {
|
|
587
|
+
message.isForward = reader.int32();
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
case 11: {
|
|
591
|
+
message.forwardedFromId = reader.int32();
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
594
|
+
default:
|
|
595
|
+
reader.skipType(tag & 7);
|
|
596
|
+
break;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
return message;
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Decodes a DirectInboxMessage message from the specified reader or buffer, length delimited.
|
|
604
|
+
* @function decodeDelimited
|
|
605
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
606
|
+
* @static
|
|
607
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
608
|
+
* @returns {ig.direct.DirectInboxMessage} DirectInboxMessage
|
|
609
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
610
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
611
|
+
*/
|
|
612
|
+
DirectInboxMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
613
|
+
if (!(reader instanceof $Reader))
|
|
614
|
+
reader = new $Reader(reader);
|
|
615
|
+
return this.decode(reader, reader.uint32());
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Verifies a DirectInboxMessage message.
|
|
620
|
+
* @function verify
|
|
621
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
622
|
+
* @static
|
|
623
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
624
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
625
|
+
*/
|
|
626
|
+
DirectInboxMessage.verify = function verify(message) {
|
|
627
|
+
if (typeof message !== "object" || message === null)
|
|
628
|
+
return "object expected";
|
|
629
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
630
|
+
if (!$util.isString(message.id))
|
|
631
|
+
return "id: string expected";
|
|
632
|
+
if (message.userId != null && message.hasOwnProperty("userId"))
|
|
633
|
+
if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high)))
|
|
634
|
+
return "userId: integer|Long expected";
|
|
635
|
+
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
|
|
636
|
+
if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
|
|
637
|
+
return "timestamp: integer|Long expected";
|
|
638
|
+
if (message.itemType != null && message.hasOwnProperty("itemType"))
|
|
639
|
+
if (!$util.isString(message.itemType))
|
|
640
|
+
return "itemType: string expected";
|
|
641
|
+
if (message.content != null && message.hasOwnProperty("content")) {
|
|
642
|
+
var error = $root.ig.direct.DirectInboxMessageContent.verify(message.content);
|
|
643
|
+
if (error)
|
|
644
|
+
return "content." + error;
|
|
645
|
+
}
|
|
646
|
+
if (message.reactions != null && message.hasOwnProperty("reactions")) {
|
|
647
|
+
if (!$util.isObject(message.reactions))
|
|
648
|
+
return "reactions: object expected";
|
|
649
|
+
var key = Object.keys(message.reactions);
|
|
650
|
+
for (var i = 0; i < key.length; ++i)
|
|
651
|
+
if (!$util.isString(message.reactions[key[i]]))
|
|
652
|
+
return "reactions: string{k:string} expected";
|
|
653
|
+
}
|
|
654
|
+
if (message.isSent != null && message.hasOwnProperty("isSent"))
|
|
655
|
+
if (typeof message.isSent !== "boolean")
|
|
656
|
+
return "isSent: boolean expected";
|
|
657
|
+
if (message.isDelivered != null && message.hasOwnProperty("isDelivered"))
|
|
658
|
+
if (typeof message.isDelivered !== "boolean")
|
|
659
|
+
return "isDelivered: boolean expected";
|
|
660
|
+
if (message.isSeen != null && message.hasOwnProperty("isSeen"))
|
|
661
|
+
if (typeof message.isSeen !== "boolean")
|
|
662
|
+
return "isSeen: boolean expected";
|
|
663
|
+
if (message.isForward != null && message.hasOwnProperty("isForward"))
|
|
664
|
+
if (!$util.isInteger(message.isForward))
|
|
665
|
+
return "isForward: integer expected";
|
|
666
|
+
if (message.forwardedFromId != null && message.hasOwnProperty("forwardedFromId"))
|
|
667
|
+
if (!$util.isInteger(message.forwardedFromId))
|
|
668
|
+
return "forwardedFromId: integer expected";
|
|
669
|
+
return null;
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Creates a DirectInboxMessage message from a plain object. Also converts values to their respective internal types.
|
|
674
|
+
* @function fromObject
|
|
675
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
676
|
+
* @static
|
|
677
|
+
* @param {Object.<string,*>} object Plain object
|
|
678
|
+
* @returns {ig.direct.DirectInboxMessage} DirectInboxMessage
|
|
679
|
+
*/
|
|
680
|
+
DirectInboxMessage.fromObject = function fromObject(object) {
|
|
681
|
+
if (object instanceof $root.ig.direct.DirectInboxMessage)
|
|
682
|
+
return object;
|
|
683
|
+
var message = new $root.ig.direct.DirectInboxMessage();
|
|
684
|
+
if (object.id != null)
|
|
685
|
+
message.id = String(object.id);
|
|
686
|
+
if (object.userId != null)
|
|
687
|
+
if ($util.Long)
|
|
688
|
+
(message.userId = $util.Long.fromValue(object.userId)).unsigned = false;
|
|
689
|
+
else if (typeof object.userId === "string")
|
|
690
|
+
message.userId = parseInt(object.userId, 10);
|
|
691
|
+
else if (typeof object.userId === "number")
|
|
692
|
+
message.userId = object.userId;
|
|
693
|
+
else if (typeof object.userId === "object")
|
|
694
|
+
message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber();
|
|
695
|
+
if (object.timestamp != null)
|
|
696
|
+
if ($util.Long)
|
|
697
|
+
(message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false;
|
|
698
|
+
else if (typeof object.timestamp === "string")
|
|
699
|
+
message.timestamp = parseInt(object.timestamp, 10);
|
|
700
|
+
else if (typeof object.timestamp === "number")
|
|
701
|
+
message.timestamp = object.timestamp;
|
|
702
|
+
else if (typeof object.timestamp === "object")
|
|
703
|
+
message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber();
|
|
704
|
+
if (object.itemType != null)
|
|
705
|
+
message.itemType = String(object.itemType);
|
|
706
|
+
if (object.content != null) {
|
|
707
|
+
if (typeof object.content !== "object")
|
|
708
|
+
throw TypeError(".ig.direct.DirectInboxMessage.content: object expected");
|
|
709
|
+
message.content = $root.ig.direct.DirectInboxMessageContent.fromObject(object.content);
|
|
710
|
+
}
|
|
711
|
+
if (object.reactions) {
|
|
712
|
+
if (typeof object.reactions !== "object")
|
|
713
|
+
throw TypeError(".ig.direct.DirectInboxMessage.reactions: object expected");
|
|
714
|
+
message.reactions = {};
|
|
715
|
+
for (var keys = Object.keys(object.reactions), i = 0; i < keys.length; ++i)
|
|
716
|
+
message.reactions[keys[i]] = String(object.reactions[keys[i]]);
|
|
717
|
+
}
|
|
718
|
+
if (object.isSent != null)
|
|
719
|
+
message.isSent = Boolean(object.isSent);
|
|
720
|
+
if (object.isDelivered != null)
|
|
721
|
+
message.isDelivered = Boolean(object.isDelivered);
|
|
722
|
+
if (object.isSeen != null)
|
|
723
|
+
message.isSeen = Boolean(object.isSeen);
|
|
724
|
+
if (object.isForward != null)
|
|
725
|
+
message.isForward = object.isForward | 0;
|
|
726
|
+
if (object.forwardedFromId != null)
|
|
727
|
+
message.forwardedFromId = object.forwardedFromId | 0;
|
|
728
|
+
return message;
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Creates a plain object from a DirectInboxMessage message. Also converts values to other types if specified.
|
|
733
|
+
* @function toObject
|
|
734
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
735
|
+
* @static
|
|
736
|
+
* @param {ig.direct.DirectInboxMessage} message DirectInboxMessage
|
|
737
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
738
|
+
* @returns {Object.<string,*>} Plain object
|
|
739
|
+
*/
|
|
740
|
+
DirectInboxMessage.toObject = function toObject(message, options) {
|
|
741
|
+
if (!options)
|
|
742
|
+
options = {};
|
|
743
|
+
var object = {};
|
|
744
|
+
if (options.objects || options.defaults)
|
|
745
|
+
object.reactions = {};
|
|
746
|
+
if (options.defaults) {
|
|
747
|
+
object.id = "";
|
|
748
|
+
if ($util.Long) {
|
|
749
|
+
var long = new $util.Long(0, 0, false);
|
|
750
|
+
object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
751
|
+
} else
|
|
752
|
+
object.userId = options.longs === String ? "0" : 0;
|
|
753
|
+
if ($util.Long) {
|
|
754
|
+
var long = new $util.Long(0, 0, false);
|
|
755
|
+
object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
756
|
+
} else
|
|
757
|
+
object.timestamp = options.longs === String ? "0" : 0;
|
|
758
|
+
object.itemType = "";
|
|
759
|
+
object.content = null;
|
|
760
|
+
object.isSent = false;
|
|
761
|
+
object.isDelivered = false;
|
|
762
|
+
object.isSeen = false;
|
|
763
|
+
object.isForward = 0;
|
|
764
|
+
object.forwardedFromId = 0;
|
|
765
|
+
}
|
|
766
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
767
|
+
object.id = message.id;
|
|
768
|
+
if (message.userId != null && message.hasOwnProperty("userId"))
|
|
769
|
+
if (typeof message.userId === "number")
|
|
770
|
+
object.userId = options.longs === String ? String(message.userId) : message.userId;
|
|
771
|
+
else
|
|
772
|
+
object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId;
|
|
773
|
+
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
|
|
774
|
+
if (typeof message.timestamp === "number")
|
|
775
|
+
object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
|
|
776
|
+
else
|
|
777
|
+
object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp;
|
|
778
|
+
if (message.itemType != null && message.hasOwnProperty("itemType"))
|
|
779
|
+
object.itemType = message.itemType;
|
|
780
|
+
if (message.content != null && message.hasOwnProperty("content"))
|
|
781
|
+
object.content = $root.ig.direct.DirectInboxMessageContent.toObject(message.content, options);
|
|
782
|
+
var keys2;
|
|
783
|
+
if (message.reactions && (keys2 = Object.keys(message.reactions)).length) {
|
|
784
|
+
object.reactions = {};
|
|
785
|
+
for (var j = 0; j < keys2.length; ++j)
|
|
786
|
+
object.reactions[keys2[j]] = message.reactions[keys2[j]];
|
|
787
|
+
}
|
|
788
|
+
if (message.isSent != null && message.hasOwnProperty("isSent"))
|
|
789
|
+
object.isSent = message.isSent;
|
|
790
|
+
if (message.isDelivered != null && message.hasOwnProperty("isDelivered"))
|
|
791
|
+
object.isDelivered = message.isDelivered;
|
|
792
|
+
if (message.isSeen != null && message.hasOwnProperty("isSeen"))
|
|
793
|
+
object.isSeen = message.isSeen;
|
|
794
|
+
if (message.isForward != null && message.hasOwnProperty("isForward"))
|
|
795
|
+
object.isForward = message.isForward;
|
|
796
|
+
if (message.forwardedFromId != null && message.hasOwnProperty("forwardedFromId"))
|
|
797
|
+
object.forwardedFromId = message.forwardedFromId;
|
|
798
|
+
return object;
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Converts this DirectInboxMessage to JSON.
|
|
803
|
+
* @function toJSON
|
|
804
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
805
|
+
* @instance
|
|
806
|
+
* @returns {Object.<string,*>} JSON object
|
|
807
|
+
*/
|
|
808
|
+
DirectInboxMessage.prototype.toJSON = function toJSON() {
|
|
809
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Gets the default type url for DirectInboxMessage
|
|
814
|
+
* @function getTypeUrl
|
|
815
|
+
* @memberof ig.direct.DirectInboxMessage
|
|
816
|
+
* @static
|
|
817
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
818
|
+
* @returns {string} The default type url
|
|
819
|
+
*/
|
|
820
|
+
DirectInboxMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
821
|
+
if (typeUrlPrefix === undefined) {
|
|
822
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
823
|
+
}
|
|
824
|
+
return typeUrlPrefix + "/ig.direct.DirectInboxMessage";
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
return DirectInboxMessage;
|
|
828
|
+
})();
|
|
829
|
+
|
|
830
|
+
direct.DirectInboxThread = (function() {
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Properties of a DirectInboxThread.
|
|
834
|
+
* @memberof ig.direct
|
|
835
|
+
* @interface IDirectInboxThread
|
|
836
|
+
* @property {number|Long|null} [threadId] DirectInboxThread threadId
|
|
837
|
+
* @property {Array.<number|Long>|null} [userIds] DirectInboxThread userIds
|
|
838
|
+
* @property {string|null} [threadTitle] DirectInboxThread threadTitle
|
|
839
|
+
* @property {number|Long|null} [lastActivityAt] DirectInboxThread lastActivityAt
|
|
840
|
+
* @property {ig.direct.IDirectInboxMessage|null} [lastMessage] DirectInboxThread lastMessage
|
|
841
|
+
* @property {number|null} [unfollowersCount] DirectInboxThread unfollowersCount
|
|
842
|
+
* @property {number|null} [threadV2Id] DirectInboxThread threadV2Id
|
|
843
|
+
* @property {boolean|null} [isPin] DirectInboxThread isPin
|
|
844
|
+
* @property {boolean|null} [isMuted] DirectInboxThread isMuted
|
|
845
|
+
* @property {boolean|null} [isArchived] DirectInboxThread isArchived
|
|
846
|
+
* @property {boolean|null} [hasNewer] DirectInboxThread hasNewer
|
|
847
|
+
*/
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Constructs a new DirectInboxThread.
|
|
851
|
+
* @memberof ig.direct
|
|
852
|
+
* @classdesc Represents a DirectInboxThread.
|
|
853
|
+
* @implements IDirectInboxThread
|
|
854
|
+
* @constructor
|
|
855
|
+
* @param {ig.direct.IDirectInboxThread=} [properties] Properties to set
|
|
856
|
+
*/
|
|
857
|
+
function DirectInboxThread(properties) {
|
|
858
|
+
this.userIds = [];
|
|
859
|
+
if (properties)
|
|
860
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
861
|
+
if (properties[keys[i]] != null)
|
|
862
|
+
this[keys[i]] = properties[keys[i]];
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* DirectInboxThread threadId.
|
|
867
|
+
* @member {number|Long} threadId
|
|
868
|
+
* @memberof ig.direct.DirectInboxThread
|
|
869
|
+
* @instance
|
|
870
|
+
*/
|
|
871
|
+
DirectInboxThread.prototype.threadId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* DirectInboxThread userIds.
|
|
875
|
+
* @member {Array.<number|Long>} userIds
|
|
876
|
+
* @memberof ig.direct.DirectInboxThread
|
|
877
|
+
* @instance
|
|
878
|
+
*/
|
|
879
|
+
DirectInboxThread.prototype.userIds = $util.emptyArray;
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* DirectInboxThread threadTitle.
|
|
883
|
+
* @member {string} threadTitle
|
|
884
|
+
* @memberof ig.direct.DirectInboxThread
|
|
885
|
+
* @instance
|
|
886
|
+
*/
|
|
887
|
+
DirectInboxThread.prototype.threadTitle = "";
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* DirectInboxThread lastActivityAt.
|
|
891
|
+
* @member {number|Long} lastActivityAt
|
|
892
|
+
* @memberof ig.direct.DirectInboxThread
|
|
893
|
+
* @instance
|
|
894
|
+
*/
|
|
895
|
+
DirectInboxThread.prototype.lastActivityAt = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* DirectInboxThread lastMessage.
|
|
899
|
+
* @member {ig.direct.IDirectInboxMessage|null|undefined} lastMessage
|
|
900
|
+
* @memberof ig.direct.DirectInboxThread
|
|
901
|
+
* @instance
|
|
902
|
+
*/
|
|
903
|
+
DirectInboxThread.prototype.lastMessage = null;
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* DirectInboxThread unfollowersCount.
|
|
907
|
+
* @member {number} unfollowersCount
|
|
908
|
+
* @memberof ig.direct.DirectInboxThread
|
|
909
|
+
* @instance
|
|
910
|
+
*/
|
|
911
|
+
DirectInboxThread.prototype.unfollowersCount = 0;
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* DirectInboxThread threadV2Id.
|
|
915
|
+
* @member {number} threadV2Id
|
|
916
|
+
* @memberof ig.direct.DirectInboxThread
|
|
917
|
+
* @instance
|
|
918
|
+
*/
|
|
919
|
+
DirectInboxThread.prototype.threadV2Id = 0;
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* DirectInboxThread isPin.
|
|
923
|
+
* @member {boolean} isPin
|
|
924
|
+
* @memberof ig.direct.DirectInboxThread
|
|
925
|
+
* @instance
|
|
926
|
+
*/
|
|
927
|
+
DirectInboxThread.prototype.isPin = false;
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* DirectInboxThread isMuted.
|
|
931
|
+
* @member {boolean} isMuted
|
|
932
|
+
* @memberof ig.direct.DirectInboxThread
|
|
933
|
+
* @instance
|
|
934
|
+
*/
|
|
935
|
+
DirectInboxThread.prototype.isMuted = false;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* DirectInboxThread isArchived.
|
|
939
|
+
* @member {boolean} isArchived
|
|
940
|
+
* @memberof ig.direct.DirectInboxThread
|
|
941
|
+
* @instance
|
|
942
|
+
*/
|
|
943
|
+
DirectInboxThread.prototype.isArchived = false;
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* DirectInboxThread hasNewer.
|
|
947
|
+
* @member {boolean} hasNewer
|
|
948
|
+
* @memberof ig.direct.DirectInboxThread
|
|
949
|
+
* @instance
|
|
950
|
+
*/
|
|
951
|
+
DirectInboxThread.prototype.hasNewer = false;
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* Creates a new DirectInboxThread instance using the specified properties.
|
|
955
|
+
* @function create
|
|
956
|
+
* @memberof ig.direct.DirectInboxThread
|
|
957
|
+
* @static
|
|
958
|
+
* @param {ig.direct.IDirectInboxThread=} [properties] Properties to set
|
|
959
|
+
* @returns {ig.direct.DirectInboxThread} DirectInboxThread instance
|
|
960
|
+
*/
|
|
961
|
+
DirectInboxThread.create = function create(properties) {
|
|
962
|
+
return new DirectInboxThread(properties);
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Encodes the specified DirectInboxThread message. Does not implicitly {@link ig.direct.DirectInboxThread.verify|verify} messages.
|
|
967
|
+
* @function encode
|
|
968
|
+
* @memberof ig.direct.DirectInboxThread
|
|
969
|
+
* @static
|
|
970
|
+
* @param {ig.direct.IDirectInboxThread} message DirectInboxThread message or plain object to encode
|
|
971
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
972
|
+
* @returns {$protobuf.Writer} Writer
|
|
973
|
+
*/
|
|
974
|
+
DirectInboxThread.encode = function encode(message, writer) {
|
|
975
|
+
if (!writer)
|
|
976
|
+
writer = $Writer.create();
|
|
977
|
+
if (message.threadId != null && Object.hasOwnProperty.call(message, "threadId"))
|
|
978
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.threadId);
|
|
979
|
+
if (message.userIds != null && message.userIds.length) {
|
|
980
|
+
writer.uint32(/* id 2, wireType 2 =*/18).fork();
|
|
981
|
+
for (var i = 0; i < message.userIds.length; ++i)
|
|
982
|
+
writer.int64(message.userIds[i]);
|
|
983
|
+
writer.ldelim();
|
|
984
|
+
}
|
|
985
|
+
if (message.threadTitle != null && Object.hasOwnProperty.call(message, "threadTitle"))
|
|
986
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.threadTitle);
|
|
987
|
+
if (message.lastActivityAt != null && Object.hasOwnProperty.call(message, "lastActivityAt"))
|
|
988
|
+
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.lastActivityAt);
|
|
989
|
+
if (message.lastMessage != null && Object.hasOwnProperty.call(message, "lastMessage"))
|
|
990
|
+
$root.ig.direct.DirectInboxMessage.encode(message.lastMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
991
|
+
if (message.unfollowersCount != null && Object.hasOwnProperty.call(message, "unfollowersCount"))
|
|
992
|
+
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.unfollowersCount);
|
|
993
|
+
if (message.threadV2Id != null && Object.hasOwnProperty.call(message, "threadV2Id"))
|
|
994
|
+
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.threadV2Id);
|
|
995
|
+
if (message.isPin != null && Object.hasOwnProperty.call(message, "isPin"))
|
|
996
|
+
writer.uint32(/* id 8, wireType 0 =*/64).bool(message.isPin);
|
|
997
|
+
if (message.isMuted != null && Object.hasOwnProperty.call(message, "isMuted"))
|
|
998
|
+
writer.uint32(/* id 9, wireType 0 =*/72).bool(message.isMuted);
|
|
999
|
+
if (message.isArchived != null && Object.hasOwnProperty.call(message, "isArchived"))
|
|
1000
|
+
writer.uint32(/* id 10, wireType 0 =*/80).bool(message.isArchived);
|
|
1001
|
+
if (message.hasNewer != null && Object.hasOwnProperty.call(message, "hasNewer"))
|
|
1002
|
+
writer.uint32(/* id 11, wireType 0 =*/88).bool(message.hasNewer);
|
|
1003
|
+
return writer;
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Encodes the specified DirectInboxThread message, length delimited. Does not implicitly {@link ig.direct.DirectInboxThread.verify|verify} messages.
|
|
1008
|
+
* @function encodeDelimited
|
|
1009
|
+
* @memberof ig.direct.DirectInboxThread
|
|
1010
|
+
* @static
|
|
1011
|
+
* @param {ig.direct.IDirectInboxThread} message DirectInboxThread message or plain object to encode
|
|
1012
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1013
|
+
* @returns {$protobuf.Writer} Writer
|
|
1014
|
+
*/
|
|
1015
|
+
DirectInboxThread.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1016
|
+
return this.encode(message, writer).ldelim();
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Decodes a DirectInboxThread message from the specified reader or buffer.
|
|
1021
|
+
* @function decode
|
|
1022
|
+
* @memberof ig.direct.DirectInboxThread
|
|
1023
|
+
* @static
|
|
1024
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1025
|
+
* @param {number} [length] Message length if known beforehand
|
|
1026
|
+
* @returns {ig.direct.DirectInboxThread} DirectInboxThread
|
|
1027
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1028
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1029
|
+
*/
|
|
1030
|
+
DirectInboxThread.decode = function decode(reader, length, error) {
|
|
1031
|
+
if (!(reader instanceof $Reader))
|
|
1032
|
+
reader = $Reader.create(reader);
|
|
1033
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.direct.DirectInboxThread();
|
|
1034
|
+
while (reader.pos < end) {
|
|
1035
|
+
var tag = reader.uint32();
|
|
1036
|
+
if (tag === error)
|
|
1037
|
+
break;
|
|
1038
|
+
switch (tag >>> 3) {
|
|
1039
|
+
case 1: {
|
|
1040
|
+
message.threadId = reader.int64();
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
case 2: {
|
|
1044
|
+
if (!(message.userIds && message.userIds.length))
|
|
1045
|
+
message.userIds = [];
|
|
1046
|
+
if ((tag & 7) === 2) {
|
|
1047
|
+
var end2 = reader.uint32() + reader.pos;
|
|
1048
|
+
while (reader.pos < end2)
|
|
1049
|
+
message.userIds.push(reader.int64());
|
|
1050
|
+
} else
|
|
1051
|
+
message.userIds.push(reader.int64());
|
|
1052
|
+
break;
|
|
1053
|
+
}
|
|
1054
|
+
case 3: {
|
|
1055
|
+
message.threadTitle = reader.string();
|
|
1056
|
+
break;
|
|
1057
|
+
}
|
|
1058
|
+
case 4: {
|
|
1059
|
+
message.lastActivityAt = reader.int64();
|
|
1060
|
+
break;
|
|
1061
|
+
}
|
|
1062
|
+
case 5: {
|
|
1063
|
+
message.lastMessage = $root.ig.direct.DirectInboxMessage.decode(reader, reader.uint32());
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
case 6: {
|
|
1067
|
+
message.unfollowersCount = reader.int32();
|
|
1068
|
+
break;
|
|
1069
|
+
}
|
|
1070
|
+
case 7: {
|
|
1071
|
+
message.threadV2Id = reader.int32();
|
|
1072
|
+
break;
|
|
1073
|
+
}
|
|
1074
|
+
case 8: {
|
|
1075
|
+
message.isPin = reader.bool();
|
|
1076
|
+
break;
|
|
1077
|
+
}
|
|
1078
|
+
case 9: {
|
|
1079
|
+
message.isMuted = reader.bool();
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
case 10: {
|
|
1083
|
+
message.isArchived = reader.bool();
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
case 11: {
|
|
1087
|
+
message.hasNewer = reader.bool();
|
|
1088
|
+
break;
|
|
1089
|
+
}
|
|
1090
|
+
default:
|
|
1091
|
+
reader.skipType(tag & 7);
|
|
1092
|
+
break;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
return message;
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* Decodes a DirectInboxThread message from the specified reader or buffer, length delimited.
|
|
1100
|
+
* @function decodeDelimited
|
|
1101
|
+
* @memberof ig.direct.DirectInboxThread
|
|
1102
|
+
* @static
|
|
1103
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1104
|
+
* @returns {ig.direct.DirectInboxThread} DirectInboxThread
|
|
1105
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1106
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1107
|
+
*/
|
|
1108
|
+
DirectInboxThread.decodeDelimited = function decodeDelimited(reader) {
|
|
1109
|
+
if (!(reader instanceof $Reader))
|
|
1110
|
+
reader = new $Reader(reader);
|
|
1111
|
+
return this.decode(reader, reader.uint32());
|
|
1112
|
+
};
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Verifies a DirectInboxThread message.
|
|
1116
|
+
* @function verify
|
|
1117
|
+
* @memberof ig.direct.DirectInboxThread
|
|
1118
|
+
* @static
|
|
1119
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1120
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1121
|
+
*/
|
|
1122
|
+
DirectInboxThread.verify = function verify(message) {
|
|
1123
|
+
if (typeof message !== "object" || message === null)
|
|
1124
|
+
return "object expected";
|
|
1125
|
+
if (message.threadId != null && message.hasOwnProperty("threadId"))
|
|
1126
|
+
if (!$util.isInteger(message.threadId) && !(message.threadId && $util.isInteger(message.threadId.low) && $util.isInteger(message.threadId.high)))
|
|
1127
|
+
return "threadId: integer|Long expected";
|
|
1128
|
+
if (message.userIds != null && message.hasOwnProperty("userIds")) {
|
|
1129
|
+
if (!Array.isArray(message.userIds))
|
|
1130
|
+
return "userIds: array expected";
|
|
1131
|
+
for (var i = 0; i < message.userIds.length; ++i)
|
|
1132
|
+
if (!$util.isInteger(message.userIds[i]) && !(message.userIds[i] && $util.isInteger(message.userIds[i].low) && $util.isInteger(message.userIds[i].high)))
|
|
1133
|
+
return "userIds: integer|Long[] expected";
|
|
1134
|
+
}
|
|
1135
|
+
if (message.threadTitle != null && message.hasOwnProperty("threadTitle"))
|
|
1136
|
+
if (!$util.isString(message.threadTitle))
|
|
1137
|
+
return "threadTitle: string expected";
|
|
1138
|
+
if (message.lastActivityAt != null && message.hasOwnProperty("lastActivityAt"))
|
|
1139
|
+
if (!$util.isInteger(message.lastActivityAt) && !(message.lastActivityAt && $util.isInteger(message.lastActivityAt.low) && $util.isInteger(message.lastActivityAt.high)))
|
|
1140
|
+
return "lastActivityAt: integer|Long expected";
|
|
1141
|
+
if (message.lastMessage != null && message.hasOwnProperty("lastMessage")) {
|
|
1142
|
+
var error = $root.ig.direct.DirectInboxMessage.verify(message.lastMessage);
|
|
1143
|
+
if (error)
|
|
1144
|
+
return "lastMessage." + error;
|
|
1145
|
+
}
|
|
1146
|
+
if (message.unfollowersCount != null && message.hasOwnProperty("unfollowersCount"))
|
|
1147
|
+
if (!$util.isInteger(message.unfollowersCount))
|
|
1148
|
+
return "unfollowersCount: integer expected";
|
|
1149
|
+
if (message.threadV2Id != null && message.hasOwnProperty("threadV2Id"))
|
|
1150
|
+
if (!$util.isInteger(message.threadV2Id))
|
|
1151
|
+
return "threadV2Id: integer expected";
|
|
1152
|
+
if (message.isPin != null && message.hasOwnProperty("isPin"))
|
|
1153
|
+
if (typeof message.isPin !== "boolean")
|
|
1154
|
+
return "isPin: boolean expected";
|
|
1155
|
+
if (message.isMuted != null && message.hasOwnProperty("isMuted"))
|
|
1156
|
+
if (typeof message.isMuted !== "boolean")
|
|
1157
|
+
return "isMuted: boolean expected";
|
|
1158
|
+
if (message.isArchived != null && message.hasOwnProperty("isArchived"))
|
|
1159
|
+
if (typeof message.isArchived !== "boolean")
|
|
1160
|
+
return "isArchived: boolean expected";
|
|
1161
|
+
if (message.hasNewer != null && message.hasOwnProperty("hasNewer"))
|
|
1162
|
+
if (typeof message.hasNewer !== "boolean")
|
|
1163
|
+
return "hasNewer: boolean expected";
|
|
1164
|
+
return null;
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* Creates a DirectInboxThread message from a plain object. Also converts values to their respective internal types.
|
|
1169
|
+
* @function fromObject
|
|
1170
|
+
* @memberof ig.direct.DirectInboxThread
|
|
1171
|
+
* @static
|
|
1172
|
+
* @param {Object.<string,*>} object Plain object
|
|
1173
|
+
* @returns {ig.direct.DirectInboxThread} DirectInboxThread
|
|
1174
|
+
*/
|
|
1175
|
+
DirectInboxThread.fromObject = function fromObject(object) {
|
|
1176
|
+
if (object instanceof $root.ig.direct.DirectInboxThread)
|
|
1177
|
+
return object;
|
|
1178
|
+
var message = new $root.ig.direct.DirectInboxThread();
|
|
1179
|
+
if (object.threadId != null)
|
|
1180
|
+
if ($util.Long)
|
|
1181
|
+
(message.threadId = $util.Long.fromValue(object.threadId)).unsigned = false;
|
|
1182
|
+
else if (typeof object.threadId === "string")
|
|
1183
|
+
message.threadId = parseInt(object.threadId, 10);
|
|
1184
|
+
else if (typeof object.threadId === "number")
|
|
1185
|
+
message.threadId = object.threadId;
|
|
1186
|
+
else if (typeof object.threadId === "object")
|
|
1187
|
+
message.threadId = new $util.LongBits(object.threadId.low >>> 0, object.threadId.high >>> 0).toNumber();
|
|
1188
|
+
if (object.userIds) {
|
|
1189
|
+
if (!Array.isArray(object.userIds))
|
|
1190
|
+
throw TypeError(".ig.direct.DirectInboxThread.userIds: array expected");
|
|
1191
|
+
message.userIds = [];
|
|
1192
|
+
for (var i = 0; i < object.userIds.length; ++i)
|
|
1193
|
+
if ($util.Long)
|
|
1194
|
+
(message.userIds[i] = $util.Long.fromValue(object.userIds[i])).unsigned = false;
|
|
1195
|
+
else if (typeof object.userIds[i] === "string")
|
|
1196
|
+
message.userIds[i] = parseInt(object.userIds[i], 10);
|
|
1197
|
+
else if (typeof object.userIds[i] === "number")
|
|
1198
|
+
message.userIds[i] = object.userIds[i];
|
|
1199
|
+
else if (typeof object.userIds[i] === "object")
|
|
1200
|
+
message.userIds[i] = new $util.LongBits(object.userIds[i].low >>> 0, object.userIds[i].high >>> 0).toNumber();
|
|
1201
|
+
}
|
|
1202
|
+
if (object.threadTitle != null)
|
|
1203
|
+
message.threadTitle = String(object.threadTitle);
|
|
1204
|
+
if (object.lastActivityAt != null)
|
|
1205
|
+
if ($util.Long)
|
|
1206
|
+
(message.lastActivityAt = $util.Long.fromValue(object.lastActivityAt)).unsigned = false;
|
|
1207
|
+
else if (typeof object.lastActivityAt === "string")
|
|
1208
|
+
message.lastActivityAt = parseInt(object.lastActivityAt, 10);
|
|
1209
|
+
else if (typeof object.lastActivityAt === "number")
|
|
1210
|
+
message.lastActivityAt = object.lastActivityAt;
|
|
1211
|
+
else if (typeof object.lastActivityAt === "object")
|
|
1212
|
+
message.lastActivityAt = new $util.LongBits(object.lastActivityAt.low >>> 0, object.lastActivityAt.high >>> 0).toNumber();
|
|
1213
|
+
if (object.lastMessage != null) {
|
|
1214
|
+
if (typeof object.lastMessage !== "object")
|
|
1215
|
+
throw TypeError(".ig.direct.DirectInboxThread.lastMessage: object expected");
|
|
1216
|
+
message.lastMessage = $root.ig.direct.DirectInboxMessage.fromObject(object.lastMessage);
|
|
1217
|
+
}
|
|
1218
|
+
if (object.unfollowersCount != null)
|
|
1219
|
+
message.unfollowersCount = object.unfollowersCount | 0;
|
|
1220
|
+
if (object.threadV2Id != null)
|
|
1221
|
+
message.threadV2Id = object.threadV2Id | 0;
|
|
1222
|
+
if (object.isPin != null)
|
|
1223
|
+
message.isPin = Boolean(object.isPin);
|
|
1224
|
+
if (object.isMuted != null)
|
|
1225
|
+
message.isMuted = Boolean(object.isMuted);
|
|
1226
|
+
if (object.isArchived != null)
|
|
1227
|
+
message.isArchived = Boolean(object.isArchived);
|
|
1228
|
+
if (object.hasNewer != null)
|
|
1229
|
+
message.hasNewer = Boolean(object.hasNewer);
|
|
1230
|
+
return message;
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* Creates a plain object from a DirectInboxThread message. Also converts values to other types if specified.
|
|
1235
|
+
* @function toObject
|
|
1236
|
+
* @memberof ig.direct.DirectInboxThread
|
|
1237
|
+
* @static
|
|
1238
|
+
* @param {ig.direct.DirectInboxThread} message DirectInboxThread
|
|
1239
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1240
|
+
* @returns {Object.<string,*>} Plain object
|
|
1241
|
+
*/
|
|
1242
|
+
DirectInboxThread.toObject = function toObject(message, options) {
|
|
1243
|
+
if (!options)
|
|
1244
|
+
options = {};
|
|
1245
|
+
var object = {};
|
|
1246
|
+
if (options.arrays || options.defaults)
|
|
1247
|
+
object.userIds = [];
|
|
1248
|
+
if (options.defaults) {
|
|
1249
|
+
if ($util.Long) {
|
|
1250
|
+
var long = new $util.Long(0, 0, false);
|
|
1251
|
+
object.threadId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
1252
|
+
} else
|
|
1253
|
+
object.threadId = options.longs === String ? "0" : 0;
|
|
1254
|
+
object.threadTitle = "";
|
|
1255
|
+
if ($util.Long) {
|
|
1256
|
+
var long = new $util.Long(0, 0, false);
|
|
1257
|
+
object.lastActivityAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
1258
|
+
} else
|
|
1259
|
+
object.lastActivityAt = options.longs === String ? "0" : 0;
|
|
1260
|
+
object.lastMessage = null;
|
|
1261
|
+
object.unfollowersCount = 0;
|
|
1262
|
+
object.threadV2Id = 0;
|
|
1263
|
+
object.isPin = false;
|
|
1264
|
+
object.isMuted = false;
|
|
1265
|
+
object.isArchived = false;
|
|
1266
|
+
object.hasNewer = false;
|
|
1267
|
+
}
|
|
1268
|
+
if (message.threadId != null && message.hasOwnProperty("threadId"))
|
|
1269
|
+
if (typeof message.threadId === "number")
|
|
1270
|
+
object.threadId = options.longs === String ? String(message.threadId) : message.threadId;
|
|
1271
|
+
else
|
|
1272
|
+
object.threadId = options.longs === String ? $util.Long.prototype.toString.call(message.threadId) : options.longs === Number ? new $util.LongBits(message.threadId.low >>> 0, message.threadId.high >>> 0).toNumber() : message.threadId;
|
|
1273
|
+
if (message.userIds && message.userIds.length) {
|
|
1274
|
+
object.userIds = [];
|
|
1275
|
+
for (var j = 0; j < message.userIds.length; ++j)
|
|
1276
|
+
if (typeof message.userIds[j] === "number")
|
|
1277
|
+
object.userIds[j] = options.longs === String ? String(message.userIds[j]) : message.userIds[j];
|
|
1278
|
+
else
|
|
1279
|
+
object.userIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.userIds[j]) : options.longs === Number ? new $util.LongBits(message.userIds[j].low >>> 0, message.userIds[j].high >>> 0).toNumber() : message.userIds[j];
|
|
1280
|
+
}
|
|
1281
|
+
if (message.threadTitle != null && message.hasOwnProperty("threadTitle"))
|
|
1282
|
+
object.threadTitle = message.threadTitle;
|
|
1283
|
+
if (message.lastActivityAt != null && message.hasOwnProperty("lastActivityAt"))
|
|
1284
|
+
if (typeof message.lastActivityAt === "number")
|
|
1285
|
+
object.lastActivityAt = options.longs === String ? String(message.lastActivityAt) : message.lastActivityAt;
|
|
1286
|
+
else
|
|
1287
|
+
object.lastActivityAt = options.longs === String ? $util.Long.prototype.toString.call(message.lastActivityAt) : options.longs === Number ? new $util.LongBits(message.lastActivityAt.low >>> 0, message.lastActivityAt.high >>> 0).toNumber() : message.lastActivityAt;
|
|
1288
|
+
if (message.lastMessage != null && message.hasOwnProperty("lastMessage"))
|
|
1289
|
+
object.lastMessage = $root.ig.direct.DirectInboxMessage.toObject(message.lastMessage, options);
|
|
1290
|
+
if (message.unfollowersCount != null && message.hasOwnProperty("unfollowersCount"))
|
|
1291
|
+
object.unfollowersCount = message.unfollowersCount;
|
|
1292
|
+
if (message.threadV2Id != null && message.hasOwnProperty("threadV2Id"))
|
|
1293
|
+
object.threadV2Id = message.threadV2Id;
|
|
1294
|
+
if (message.isPin != null && message.hasOwnProperty("isPin"))
|
|
1295
|
+
object.isPin = message.isPin;
|
|
1296
|
+
if (message.isMuted != null && message.hasOwnProperty("isMuted"))
|
|
1297
|
+
object.isMuted = message.isMuted;
|
|
1298
|
+
if (message.isArchived != null && message.hasOwnProperty("isArchived"))
|
|
1299
|
+
object.isArchived = message.isArchived;
|
|
1300
|
+
if (message.hasNewer != null && message.hasOwnProperty("hasNewer"))
|
|
1301
|
+
object.hasNewer = message.hasNewer;
|
|
1302
|
+
return object;
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* Converts this DirectInboxThread to JSON.
|
|
1307
|
+
* @function toJSON
|
|
1308
|
+
* @memberof ig.direct.DirectInboxThread
|
|
1309
|
+
* @instance
|
|
1310
|
+
* @returns {Object.<string,*>} JSON object
|
|
1311
|
+
*/
|
|
1312
|
+
DirectInboxThread.prototype.toJSON = function toJSON() {
|
|
1313
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* Gets the default type url for DirectInboxThread
|
|
1318
|
+
* @function getTypeUrl
|
|
1319
|
+
* @memberof ig.direct.DirectInboxThread
|
|
1320
|
+
* @static
|
|
1321
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1322
|
+
* @returns {string} The default type url
|
|
1323
|
+
*/
|
|
1324
|
+
DirectInboxThread.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1325
|
+
if (typeUrlPrefix === undefined) {
|
|
1326
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1327
|
+
}
|
|
1328
|
+
return typeUrlPrefix + "/ig.direct.DirectInboxThread";
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1331
|
+
return DirectInboxThread;
|
|
1332
|
+
})();
|
|
1333
|
+
|
|
1334
|
+
direct.DirectInbox = (function() {
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* Properties of a DirectInbox.
|
|
1338
|
+
* @memberof ig.direct
|
|
1339
|
+
* @interface IDirectInbox
|
|
1340
|
+
* @property {Array.<ig.direct.IDirectInboxThread>|null} [threads] DirectInbox threads
|
|
1341
|
+
* @property {string|null} [cursor] DirectInbox cursor
|
|
1342
|
+
* @property {boolean|null} [hasOlder] DirectInbox hasOlder
|
|
1343
|
+
*/
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Constructs a new DirectInbox.
|
|
1347
|
+
* @memberof ig.direct
|
|
1348
|
+
* @classdesc Represents a DirectInbox.
|
|
1349
|
+
* @implements IDirectInbox
|
|
1350
|
+
* @constructor
|
|
1351
|
+
* @param {ig.direct.IDirectInbox=} [properties] Properties to set
|
|
1352
|
+
*/
|
|
1353
|
+
function DirectInbox(properties) {
|
|
1354
|
+
this.threads = [];
|
|
1355
|
+
if (properties)
|
|
1356
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1357
|
+
if (properties[keys[i]] != null)
|
|
1358
|
+
this[keys[i]] = properties[keys[i]];
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* DirectInbox threads.
|
|
1363
|
+
* @member {Array.<ig.direct.IDirectInboxThread>} threads
|
|
1364
|
+
* @memberof ig.direct.DirectInbox
|
|
1365
|
+
* @instance
|
|
1366
|
+
*/
|
|
1367
|
+
DirectInbox.prototype.threads = $util.emptyArray;
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* DirectInbox cursor.
|
|
1371
|
+
* @member {string} cursor
|
|
1372
|
+
* @memberof ig.direct.DirectInbox
|
|
1373
|
+
* @instance
|
|
1374
|
+
*/
|
|
1375
|
+
DirectInbox.prototype.cursor = "";
|
|
1376
|
+
|
|
1377
|
+
/**
|
|
1378
|
+
* DirectInbox hasOlder.
|
|
1379
|
+
* @member {boolean} hasOlder
|
|
1380
|
+
* @memberof ig.direct.DirectInbox
|
|
1381
|
+
* @instance
|
|
1382
|
+
*/
|
|
1383
|
+
DirectInbox.prototype.hasOlder = false;
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Creates a new DirectInbox instance using the specified properties.
|
|
1387
|
+
* @function create
|
|
1388
|
+
* @memberof ig.direct.DirectInbox
|
|
1389
|
+
* @static
|
|
1390
|
+
* @param {ig.direct.IDirectInbox=} [properties] Properties to set
|
|
1391
|
+
* @returns {ig.direct.DirectInbox} DirectInbox instance
|
|
1392
|
+
*/
|
|
1393
|
+
DirectInbox.create = function create(properties) {
|
|
1394
|
+
return new DirectInbox(properties);
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Encodes the specified DirectInbox message. Does not implicitly {@link ig.direct.DirectInbox.verify|verify} messages.
|
|
1399
|
+
* @function encode
|
|
1400
|
+
* @memberof ig.direct.DirectInbox
|
|
1401
|
+
* @static
|
|
1402
|
+
* @param {ig.direct.IDirectInbox} message DirectInbox message or plain object to encode
|
|
1403
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1404
|
+
* @returns {$protobuf.Writer} Writer
|
|
1405
|
+
*/
|
|
1406
|
+
DirectInbox.encode = function encode(message, writer) {
|
|
1407
|
+
if (!writer)
|
|
1408
|
+
writer = $Writer.create();
|
|
1409
|
+
if (message.threads != null && message.threads.length)
|
|
1410
|
+
for (var i = 0; i < message.threads.length; ++i)
|
|
1411
|
+
$root.ig.direct.DirectInboxThread.encode(message.threads[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
1412
|
+
if (message.cursor != null && Object.hasOwnProperty.call(message, "cursor"))
|
|
1413
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.cursor);
|
|
1414
|
+
if (message.hasOlder != null && Object.hasOwnProperty.call(message, "hasOlder"))
|
|
1415
|
+
writer.uint32(/* id 3, wireType 0 =*/24).bool(message.hasOlder);
|
|
1416
|
+
return writer;
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* Encodes the specified DirectInbox message, length delimited. Does not implicitly {@link ig.direct.DirectInbox.verify|verify} messages.
|
|
1421
|
+
* @function encodeDelimited
|
|
1422
|
+
* @memberof ig.direct.DirectInbox
|
|
1423
|
+
* @static
|
|
1424
|
+
* @param {ig.direct.IDirectInbox} message DirectInbox message or plain object to encode
|
|
1425
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1426
|
+
* @returns {$protobuf.Writer} Writer
|
|
1427
|
+
*/
|
|
1428
|
+
DirectInbox.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1429
|
+
return this.encode(message, writer).ldelim();
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
/**
|
|
1433
|
+
* Decodes a DirectInbox message from the specified reader or buffer.
|
|
1434
|
+
* @function decode
|
|
1435
|
+
* @memberof ig.direct.DirectInbox
|
|
1436
|
+
* @static
|
|
1437
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1438
|
+
* @param {number} [length] Message length if known beforehand
|
|
1439
|
+
* @returns {ig.direct.DirectInbox} DirectInbox
|
|
1440
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1441
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1442
|
+
*/
|
|
1443
|
+
DirectInbox.decode = function decode(reader, length, error) {
|
|
1444
|
+
if (!(reader instanceof $Reader))
|
|
1445
|
+
reader = $Reader.create(reader);
|
|
1446
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.direct.DirectInbox();
|
|
1447
|
+
while (reader.pos < end) {
|
|
1448
|
+
var tag = reader.uint32();
|
|
1449
|
+
if (tag === error)
|
|
1450
|
+
break;
|
|
1451
|
+
switch (tag >>> 3) {
|
|
1452
|
+
case 1: {
|
|
1453
|
+
if (!(message.threads && message.threads.length))
|
|
1454
|
+
message.threads = [];
|
|
1455
|
+
message.threads.push($root.ig.direct.DirectInboxThread.decode(reader, reader.uint32()));
|
|
1456
|
+
break;
|
|
1457
|
+
}
|
|
1458
|
+
case 2: {
|
|
1459
|
+
message.cursor = reader.string();
|
|
1460
|
+
break;
|
|
1461
|
+
}
|
|
1462
|
+
case 3: {
|
|
1463
|
+
message.hasOlder = reader.bool();
|
|
1464
|
+
break;
|
|
1465
|
+
}
|
|
1466
|
+
default:
|
|
1467
|
+
reader.skipType(tag & 7);
|
|
1468
|
+
break;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
return message;
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* Decodes a DirectInbox message from the specified reader or buffer, length delimited.
|
|
1476
|
+
* @function decodeDelimited
|
|
1477
|
+
* @memberof ig.direct.DirectInbox
|
|
1478
|
+
* @static
|
|
1479
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1480
|
+
* @returns {ig.direct.DirectInbox} DirectInbox
|
|
1481
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1482
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1483
|
+
*/
|
|
1484
|
+
DirectInbox.decodeDelimited = function decodeDelimited(reader) {
|
|
1485
|
+
if (!(reader instanceof $Reader))
|
|
1486
|
+
reader = new $Reader(reader);
|
|
1487
|
+
return this.decode(reader, reader.uint32());
|
|
1488
|
+
};
|
|
1489
|
+
|
|
1490
|
+
/**
|
|
1491
|
+
* Verifies a DirectInbox message.
|
|
1492
|
+
* @function verify
|
|
1493
|
+
* @memberof ig.direct.DirectInbox
|
|
1494
|
+
* @static
|
|
1495
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1496
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1497
|
+
*/
|
|
1498
|
+
DirectInbox.verify = function verify(message) {
|
|
1499
|
+
if (typeof message !== "object" || message === null)
|
|
1500
|
+
return "object expected";
|
|
1501
|
+
if (message.threads != null && message.hasOwnProperty("threads")) {
|
|
1502
|
+
if (!Array.isArray(message.threads))
|
|
1503
|
+
return "threads: array expected";
|
|
1504
|
+
for (var i = 0; i < message.threads.length; ++i) {
|
|
1505
|
+
var error = $root.ig.direct.DirectInboxThread.verify(message.threads[i]);
|
|
1506
|
+
if (error)
|
|
1507
|
+
return "threads." + error;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
if (message.cursor != null && message.hasOwnProperty("cursor"))
|
|
1511
|
+
if (!$util.isString(message.cursor))
|
|
1512
|
+
return "cursor: string expected";
|
|
1513
|
+
if (message.hasOlder != null && message.hasOwnProperty("hasOlder"))
|
|
1514
|
+
if (typeof message.hasOlder !== "boolean")
|
|
1515
|
+
return "hasOlder: boolean expected";
|
|
1516
|
+
return null;
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1519
|
+
/**
|
|
1520
|
+
* Creates a DirectInbox message from a plain object. Also converts values to their respective internal types.
|
|
1521
|
+
* @function fromObject
|
|
1522
|
+
* @memberof ig.direct.DirectInbox
|
|
1523
|
+
* @static
|
|
1524
|
+
* @param {Object.<string,*>} object Plain object
|
|
1525
|
+
* @returns {ig.direct.DirectInbox} DirectInbox
|
|
1526
|
+
*/
|
|
1527
|
+
DirectInbox.fromObject = function fromObject(object) {
|
|
1528
|
+
if (object instanceof $root.ig.direct.DirectInbox)
|
|
1529
|
+
return object;
|
|
1530
|
+
var message = new $root.ig.direct.DirectInbox();
|
|
1531
|
+
if (object.threads) {
|
|
1532
|
+
if (!Array.isArray(object.threads))
|
|
1533
|
+
throw TypeError(".ig.direct.DirectInbox.threads: array expected");
|
|
1534
|
+
message.threads = [];
|
|
1535
|
+
for (var i = 0; i < object.threads.length; ++i) {
|
|
1536
|
+
if (typeof object.threads[i] !== "object")
|
|
1537
|
+
throw TypeError(".ig.direct.DirectInbox.threads: object expected");
|
|
1538
|
+
message.threads[i] = $root.ig.direct.DirectInboxThread.fromObject(object.threads[i]);
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
if (object.cursor != null)
|
|
1542
|
+
message.cursor = String(object.cursor);
|
|
1543
|
+
if (object.hasOlder != null)
|
|
1544
|
+
message.hasOlder = Boolean(object.hasOlder);
|
|
1545
|
+
return message;
|
|
1546
|
+
};
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* Creates a plain object from a DirectInbox message. Also converts values to other types if specified.
|
|
1550
|
+
* @function toObject
|
|
1551
|
+
* @memberof ig.direct.DirectInbox
|
|
1552
|
+
* @static
|
|
1553
|
+
* @param {ig.direct.DirectInbox} message DirectInbox
|
|
1554
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1555
|
+
* @returns {Object.<string,*>} Plain object
|
|
1556
|
+
*/
|
|
1557
|
+
DirectInbox.toObject = function toObject(message, options) {
|
|
1558
|
+
if (!options)
|
|
1559
|
+
options = {};
|
|
1560
|
+
var object = {};
|
|
1561
|
+
if (options.arrays || options.defaults)
|
|
1562
|
+
object.threads = [];
|
|
1563
|
+
if (options.defaults) {
|
|
1564
|
+
object.cursor = "";
|
|
1565
|
+
object.hasOlder = false;
|
|
1566
|
+
}
|
|
1567
|
+
if (message.threads && message.threads.length) {
|
|
1568
|
+
object.threads = [];
|
|
1569
|
+
for (var j = 0; j < message.threads.length; ++j)
|
|
1570
|
+
object.threads[j] = $root.ig.direct.DirectInboxThread.toObject(message.threads[j], options);
|
|
1571
|
+
}
|
|
1572
|
+
if (message.cursor != null && message.hasOwnProperty("cursor"))
|
|
1573
|
+
object.cursor = message.cursor;
|
|
1574
|
+
if (message.hasOlder != null && message.hasOwnProperty("hasOlder"))
|
|
1575
|
+
object.hasOlder = message.hasOlder;
|
|
1576
|
+
return object;
|
|
1577
|
+
};
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* Converts this DirectInbox to JSON.
|
|
1581
|
+
* @function toJSON
|
|
1582
|
+
* @memberof ig.direct.DirectInbox
|
|
1583
|
+
* @instance
|
|
1584
|
+
* @returns {Object.<string,*>} JSON object
|
|
1585
|
+
*/
|
|
1586
|
+
DirectInbox.prototype.toJSON = function toJSON() {
|
|
1587
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1588
|
+
};
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* Gets the default type url for DirectInbox
|
|
1592
|
+
* @function getTypeUrl
|
|
1593
|
+
* @memberof ig.direct.DirectInbox
|
|
1594
|
+
* @static
|
|
1595
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1596
|
+
* @returns {string} The default type url
|
|
1597
|
+
*/
|
|
1598
|
+
DirectInbox.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1599
|
+
if (typeUrlPrefix === undefined) {
|
|
1600
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1601
|
+
}
|
|
1602
|
+
return typeUrlPrefix + "/ig.direct.DirectInbox";
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1605
|
+
return DirectInbox;
|
|
1606
|
+
})();
|
|
1607
|
+
|
|
1608
|
+
direct.DirectSync = (function() {
|
|
1609
|
+
|
|
1610
|
+
/**
|
|
1611
|
+
* Properties of a DirectSync.
|
|
1612
|
+
* @memberof ig.direct
|
|
1613
|
+
* @interface IDirectSync
|
|
1614
|
+
* @property {number|Long|null} [seqId] DirectSync seqId
|
|
1615
|
+
* @property {number|Long|null} [timestamp] DirectSync timestamp
|
|
1616
|
+
* @property {Array.<ig.direct.IDirectInboxMessage>|null} [messages] DirectSync messages
|
|
1617
|
+
* @property {Array.<ig.direct.IDirectInboxThread>|null} [threads] DirectSync threads
|
|
1618
|
+
* @property {Object.<string,number|Long>|null} [seqIds] DirectSync seqIds
|
|
1619
|
+
*/
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* Constructs a new DirectSync.
|
|
1623
|
+
* @memberof ig.direct
|
|
1624
|
+
* @classdesc Represents a DirectSync.
|
|
1625
|
+
* @implements IDirectSync
|
|
1626
|
+
* @constructor
|
|
1627
|
+
* @param {ig.direct.IDirectSync=} [properties] Properties to set
|
|
1628
|
+
*/
|
|
1629
|
+
function DirectSync(properties) {
|
|
1630
|
+
this.messages = [];
|
|
1631
|
+
this.threads = [];
|
|
1632
|
+
this.seqIds = {};
|
|
1633
|
+
if (properties)
|
|
1634
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1635
|
+
if (properties[keys[i]] != null)
|
|
1636
|
+
this[keys[i]] = properties[keys[i]];
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* DirectSync seqId.
|
|
1641
|
+
* @member {number|Long} seqId
|
|
1642
|
+
* @memberof ig.direct.DirectSync
|
|
1643
|
+
* @instance
|
|
1644
|
+
*/
|
|
1645
|
+
DirectSync.prototype.seqId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* DirectSync timestamp.
|
|
1649
|
+
* @member {number|Long} timestamp
|
|
1650
|
+
* @memberof ig.direct.DirectSync
|
|
1651
|
+
* @instance
|
|
1652
|
+
*/
|
|
1653
|
+
DirectSync.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
1654
|
+
|
|
1655
|
+
/**
|
|
1656
|
+
* DirectSync messages.
|
|
1657
|
+
* @member {Array.<ig.direct.IDirectInboxMessage>} messages
|
|
1658
|
+
* @memberof ig.direct.DirectSync
|
|
1659
|
+
* @instance
|
|
1660
|
+
*/
|
|
1661
|
+
DirectSync.prototype.messages = $util.emptyArray;
|
|
1662
|
+
|
|
1663
|
+
/**
|
|
1664
|
+
* DirectSync threads.
|
|
1665
|
+
* @member {Array.<ig.direct.IDirectInboxThread>} threads
|
|
1666
|
+
* @memberof ig.direct.DirectSync
|
|
1667
|
+
* @instance
|
|
1668
|
+
*/
|
|
1669
|
+
DirectSync.prototype.threads = $util.emptyArray;
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* DirectSync seqIds.
|
|
1673
|
+
* @member {Object.<string,number|Long>} seqIds
|
|
1674
|
+
* @memberof ig.direct.DirectSync
|
|
1675
|
+
* @instance
|
|
1676
|
+
*/
|
|
1677
|
+
DirectSync.prototype.seqIds = $util.emptyObject;
|
|
1678
|
+
|
|
1679
|
+
/**
|
|
1680
|
+
* Creates a new DirectSync instance using the specified properties.
|
|
1681
|
+
* @function create
|
|
1682
|
+
* @memberof ig.direct.DirectSync
|
|
1683
|
+
* @static
|
|
1684
|
+
* @param {ig.direct.IDirectSync=} [properties] Properties to set
|
|
1685
|
+
* @returns {ig.direct.DirectSync} DirectSync instance
|
|
1686
|
+
*/
|
|
1687
|
+
DirectSync.create = function create(properties) {
|
|
1688
|
+
return new DirectSync(properties);
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* Encodes the specified DirectSync message. Does not implicitly {@link ig.direct.DirectSync.verify|verify} messages.
|
|
1693
|
+
* @function encode
|
|
1694
|
+
* @memberof ig.direct.DirectSync
|
|
1695
|
+
* @static
|
|
1696
|
+
* @param {ig.direct.IDirectSync} message DirectSync message or plain object to encode
|
|
1697
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1698
|
+
* @returns {$protobuf.Writer} Writer
|
|
1699
|
+
*/
|
|
1700
|
+
DirectSync.encode = function encode(message, writer) {
|
|
1701
|
+
if (!writer)
|
|
1702
|
+
writer = $Writer.create();
|
|
1703
|
+
if (message.seqId != null && Object.hasOwnProperty.call(message, "seqId"))
|
|
1704
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seqId);
|
|
1705
|
+
if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
|
|
1706
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.timestamp);
|
|
1707
|
+
if (message.messages != null && message.messages.length)
|
|
1708
|
+
for (var i = 0; i < message.messages.length; ++i)
|
|
1709
|
+
$root.ig.direct.DirectInboxMessage.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
1710
|
+
if (message.threads != null && message.threads.length)
|
|
1711
|
+
for (var i = 0; i < message.threads.length; ++i)
|
|
1712
|
+
$root.ig.direct.DirectInboxThread.encode(message.threads[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
1713
|
+
if (message.seqIds != null && Object.hasOwnProperty.call(message, "seqIds"))
|
|
1714
|
+
for (var keys = Object.keys(message.seqIds), i = 0; i < keys.length; ++i)
|
|
1715
|
+
writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.seqIds[keys[i]]).ldelim();
|
|
1716
|
+
return writer;
|
|
1717
|
+
};
|
|
1718
|
+
|
|
1719
|
+
/**
|
|
1720
|
+
* Encodes the specified DirectSync message, length delimited. Does not implicitly {@link ig.direct.DirectSync.verify|verify} messages.
|
|
1721
|
+
* @function encodeDelimited
|
|
1722
|
+
* @memberof ig.direct.DirectSync
|
|
1723
|
+
* @static
|
|
1724
|
+
* @param {ig.direct.IDirectSync} message DirectSync message or plain object to encode
|
|
1725
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1726
|
+
* @returns {$protobuf.Writer} Writer
|
|
1727
|
+
*/
|
|
1728
|
+
DirectSync.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1729
|
+
return this.encode(message, writer).ldelim();
|
|
1730
|
+
};
|
|
1731
|
+
|
|
1732
|
+
/**
|
|
1733
|
+
* Decodes a DirectSync message from the specified reader or buffer.
|
|
1734
|
+
* @function decode
|
|
1735
|
+
* @memberof ig.direct.DirectSync
|
|
1736
|
+
* @static
|
|
1737
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1738
|
+
* @param {number} [length] Message length if known beforehand
|
|
1739
|
+
* @returns {ig.direct.DirectSync} DirectSync
|
|
1740
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1741
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1742
|
+
*/
|
|
1743
|
+
DirectSync.decode = function decode(reader, length, error) {
|
|
1744
|
+
if (!(reader instanceof $Reader))
|
|
1745
|
+
reader = $Reader.create(reader);
|
|
1746
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.direct.DirectSync(), key, value;
|
|
1747
|
+
while (reader.pos < end) {
|
|
1748
|
+
var tag = reader.uint32();
|
|
1749
|
+
if (tag === error)
|
|
1750
|
+
break;
|
|
1751
|
+
switch (tag >>> 3) {
|
|
1752
|
+
case 1: {
|
|
1753
|
+
message.seqId = reader.int64();
|
|
1754
|
+
break;
|
|
1755
|
+
}
|
|
1756
|
+
case 2: {
|
|
1757
|
+
message.timestamp = reader.int64();
|
|
1758
|
+
break;
|
|
1759
|
+
}
|
|
1760
|
+
case 3: {
|
|
1761
|
+
if (!(message.messages && message.messages.length))
|
|
1762
|
+
message.messages = [];
|
|
1763
|
+
message.messages.push($root.ig.direct.DirectInboxMessage.decode(reader, reader.uint32()));
|
|
1764
|
+
break;
|
|
1765
|
+
}
|
|
1766
|
+
case 4: {
|
|
1767
|
+
if (!(message.threads && message.threads.length))
|
|
1768
|
+
message.threads = [];
|
|
1769
|
+
message.threads.push($root.ig.direct.DirectInboxThread.decode(reader, reader.uint32()));
|
|
1770
|
+
break;
|
|
1771
|
+
}
|
|
1772
|
+
case 5: {
|
|
1773
|
+
if (message.seqIds === $util.emptyObject)
|
|
1774
|
+
message.seqIds = {};
|
|
1775
|
+
var end2 = reader.uint32() + reader.pos;
|
|
1776
|
+
key = "";
|
|
1777
|
+
value = 0;
|
|
1778
|
+
while (reader.pos < end2) {
|
|
1779
|
+
var tag2 = reader.uint32();
|
|
1780
|
+
switch (tag2 >>> 3) {
|
|
1781
|
+
case 1:
|
|
1782
|
+
key = reader.string();
|
|
1783
|
+
break;
|
|
1784
|
+
case 2:
|
|
1785
|
+
value = reader.int64();
|
|
1786
|
+
break;
|
|
1787
|
+
default:
|
|
1788
|
+
reader.skipType(tag2 & 7);
|
|
1789
|
+
break;
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
message.seqIds[key] = value;
|
|
1793
|
+
break;
|
|
1794
|
+
}
|
|
1795
|
+
default:
|
|
1796
|
+
reader.skipType(tag & 7);
|
|
1797
|
+
break;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
return message;
|
|
1801
|
+
};
|
|
1802
|
+
|
|
1803
|
+
/**
|
|
1804
|
+
* Decodes a DirectSync message from the specified reader or buffer, length delimited.
|
|
1805
|
+
* @function decodeDelimited
|
|
1806
|
+
* @memberof ig.direct.DirectSync
|
|
1807
|
+
* @static
|
|
1808
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1809
|
+
* @returns {ig.direct.DirectSync} DirectSync
|
|
1810
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1811
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1812
|
+
*/
|
|
1813
|
+
DirectSync.decodeDelimited = function decodeDelimited(reader) {
|
|
1814
|
+
if (!(reader instanceof $Reader))
|
|
1815
|
+
reader = new $Reader(reader);
|
|
1816
|
+
return this.decode(reader, reader.uint32());
|
|
1817
|
+
};
|
|
1818
|
+
|
|
1819
|
+
/**
|
|
1820
|
+
* Verifies a DirectSync message.
|
|
1821
|
+
* @function verify
|
|
1822
|
+
* @memberof ig.direct.DirectSync
|
|
1823
|
+
* @static
|
|
1824
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1825
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1826
|
+
*/
|
|
1827
|
+
DirectSync.verify = function verify(message) {
|
|
1828
|
+
if (typeof message !== "object" || message === null)
|
|
1829
|
+
return "object expected";
|
|
1830
|
+
if (message.seqId != null && message.hasOwnProperty("seqId"))
|
|
1831
|
+
if (!$util.isInteger(message.seqId) && !(message.seqId && $util.isInteger(message.seqId.low) && $util.isInteger(message.seqId.high)))
|
|
1832
|
+
return "seqId: integer|Long expected";
|
|
1833
|
+
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
|
|
1834
|
+
if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
|
|
1835
|
+
return "timestamp: integer|Long expected";
|
|
1836
|
+
if (message.messages != null && message.hasOwnProperty("messages")) {
|
|
1837
|
+
if (!Array.isArray(message.messages))
|
|
1838
|
+
return "messages: array expected";
|
|
1839
|
+
for (var i = 0; i < message.messages.length; ++i) {
|
|
1840
|
+
var error = $root.ig.direct.DirectInboxMessage.verify(message.messages[i]);
|
|
1841
|
+
if (error)
|
|
1842
|
+
return "messages." + error;
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
if (message.threads != null && message.hasOwnProperty("threads")) {
|
|
1846
|
+
if (!Array.isArray(message.threads))
|
|
1847
|
+
return "threads: array expected";
|
|
1848
|
+
for (var i = 0; i < message.threads.length; ++i) {
|
|
1849
|
+
var error = $root.ig.direct.DirectInboxThread.verify(message.threads[i]);
|
|
1850
|
+
if (error)
|
|
1851
|
+
return "threads." + error;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
if (message.seqIds != null && message.hasOwnProperty("seqIds")) {
|
|
1855
|
+
if (!$util.isObject(message.seqIds))
|
|
1856
|
+
return "seqIds: object expected";
|
|
1857
|
+
var key = Object.keys(message.seqIds);
|
|
1858
|
+
for (var i = 0; i < key.length; ++i)
|
|
1859
|
+
if (!$util.isInteger(message.seqIds[key[i]]) && !(message.seqIds[key[i]] && $util.isInteger(message.seqIds[key[i]].low) && $util.isInteger(message.seqIds[key[i]].high)))
|
|
1860
|
+
return "seqIds: integer|Long{k:string} expected";
|
|
1861
|
+
}
|
|
1862
|
+
return null;
|
|
1863
|
+
};
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
* Creates a DirectSync message from a plain object. Also converts values to their respective internal types.
|
|
1867
|
+
* @function fromObject
|
|
1868
|
+
* @memberof ig.direct.DirectSync
|
|
1869
|
+
* @static
|
|
1870
|
+
* @param {Object.<string,*>} object Plain object
|
|
1871
|
+
* @returns {ig.direct.DirectSync} DirectSync
|
|
1872
|
+
*/
|
|
1873
|
+
DirectSync.fromObject = function fromObject(object) {
|
|
1874
|
+
if (object instanceof $root.ig.direct.DirectSync)
|
|
1875
|
+
return object;
|
|
1876
|
+
var message = new $root.ig.direct.DirectSync();
|
|
1877
|
+
if (object.seqId != null)
|
|
1878
|
+
if ($util.Long)
|
|
1879
|
+
(message.seqId = $util.Long.fromValue(object.seqId)).unsigned = false;
|
|
1880
|
+
else if (typeof object.seqId === "string")
|
|
1881
|
+
message.seqId = parseInt(object.seqId, 10);
|
|
1882
|
+
else if (typeof object.seqId === "number")
|
|
1883
|
+
message.seqId = object.seqId;
|
|
1884
|
+
else if (typeof object.seqId === "object")
|
|
1885
|
+
message.seqId = new $util.LongBits(object.seqId.low >>> 0, object.seqId.high >>> 0).toNumber();
|
|
1886
|
+
if (object.timestamp != null)
|
|
1887
|
+
if ($util.Long)
|
|
1888
|
+
(message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false;
|
|
1889
|
+
else if (typeof object.timestamp === "string")
|
|
1890
|
+
message.timestamp = parseInt(object.timestamp, 10);
|
|
1891
|
+
else if (typeof object.timestamp === "number")
|
|
1892
|
+
message.timestamp = object.timestamp;
|
|
1893
|
+
else if (typeof object.timestamp === "object")
|
|
1894
|
+
message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber();
|
|
1895
|
+
if (object.messages) {
|
|
1896
|
+
if (!Array.isArray(object.messages))
|
|
1897
|
+
throw TypeError(".ig.direct.DirectSync.messages: array expected");
|
|
1898
|
+
message.messages = [];
|
|
1899
|
+
for (var i = 0; i < object.messages.length; ++i) {
|
|
1900
|
+
if (typeof object.messages[i] !== "object")
|
|
1901
|
+
throw TypeError(".ig.direct.DirectSync.messages: object expected");
|
|
1902
|
+
message.messages[i] = $root.ig.direct.DirectInboxMessage.fromObject(object.messages[i]);
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
if (object.threads) {
|
|
1906
|
+
if (!Array.isArray(object.threads))
|
|
1907
|
+
throw TypeError(".ig.direct.DirectSync.threads: array expected");
|
|
1908
|
+
message.threads = [];
|
|
1909
|
+
for (var i = 0; i < object.threads.length; ++i) {
|
|
1910
|
+
if (typeof object.threads[i] !== "object")
|
|
1911
|
+
throw TypeError(".ig.direct.DirectSync.threads: object expected");
|
|
1912
|
+
message.threads[i] = $root.ig.direct.DirectInboxThread.fromObject(object.threads[i]);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
if (object.seqIds) {
|
|
1916
|
+
if (typeof object.seqIds !== "object")
|
|
1917
|
+
throw TypeError(".ig.direct.DirectSync.seqIds: object expected");
|
|
1918
|
+
message.seqIds = {};
|
|
1919
|
+
for (var keys = Object.keys(object.seqIds), i = 0; i < keys.length; ++i)
|
|
1920
|
+
if ($util.Long)
|
|
1921
|
+
(message.seqIds[keys[i]] = $util.Long.fromValue(object.seqIds[keys[i]])).unsigned = false;
|
|
1922
|
+
else if (typeof object.seqIds[keys[i]] === "string")
|
|
1923
|
+
message.seqIds[keys[i]] = parseInt(object.seqIds[keys[i]], 10);
|
|
1924
|
+
else if (typeof object.seqIds[keys[i]] === "number")
|
|
1925
|
+
message.seqIds[keys[i]] = object.seqIds[keys[i]];
|
|
1926
|
+
else if (typeof object.seqIds[keys[i]] === "object")
|
|
1927
|
+
message.seqIds[keys[i]] = new $util.LongBits(object.seqIds[keys[i]].low >>> 0, object.seqIds[keys[i]].high >>> 0).toNumber();
|
|
1928
|
+
}
|
|
1929
|
+
return message;
|
|
1930
|
+
};
|
|
1931
|
+
|
|
1932
|
+
/**
|
|
1933
|
+
* Creates a plain object from a DirectSync message. Also converts values to other types if specified.
|
|
1934
|
+
* @function toObject
|
|
1935
|
+
* @memberof ig.direct.DirectSync
|
|
1936
|
+
* @static
|
|
1937
|
+
* @param {ig.direct.DirectSync} message DirectSync
|
|
1938
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1939
|
+
* @returns {Object.<string,*>} Plain object
|
|
1940
|
+
*/
|
|
1941
|
+
DirectSync.toObject = function toObject(message, options) {
|
|
1942
|
+
if (!options)
|
|
1943
|
+
options = {};
|
|
1944
|
+
var object = {};
|
|
1945
|
+
if (options.arrays || options.defaults) {
|
|
1946
|
+
object.messages = [];
|
|
1947
|
+
object.threads = [];
|
|
1948
|
+
}
|
|
1949
|
+
if (options.objects || options.defaults)
|
|
1950
|
+
object.seqIds = {};
|
|
1951
|
+
if (options.defaults) {
|
|
1952
|
+
if ($util.Long) {
|
|
1953
|
+
var long = new $util.Long(0, 0, false);
|
|
1954
|
+
object.seqId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
1955
|
+
} else
|
|
1956
|
+
object.seqId = options.longs === String ? "0" : 0;
|
|
1957
|
+
if ($util.Long) {
|
|
1958
|
+
var long = new $util.Long(0, 0, false);
|
|
1959
|
+
object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
1960
|
+
} else
|
|
1961
|
+
object.timestamp = options.longs === String ? "0" : 0;
|
|
1962
|
+
}
|
|
1963
|
+
if (message.seqId != null && message.hasOwnProperty("seqId"))
|
|
1964
|
+
if (typeof message.seqId === "number")
|
|
1965
|
+
object.seqId = options.longs === String ? String(message.seqId) : message.seqId;
|
|
1966
|
+
else
|
|
1967
|
+
object.seqId = options.longs === String ? $util.Long.prototype.toString.call(message.seqId) : options.longs === Number ? new $util.LongBits(message.seqId.low >>> 0, message.seqId.high >>> 0).toNumber() : message.seqId;
|
|
1968
|
+
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
|
|
1969
|
+
if (typeof message.timestamp === "number")
|
|
1970
|
+
object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
|
|
1971
|
+
else
|
|
1972
|
+
object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp;
|
|
1973
|
+
if (message.messages && message.messages.length) {
|
|
1974
|
+
object.messages = [];
|
|
1975
|
+
for (var j = 0; j < message.messages.length; ++j)
|
|
1976
|
+
object.messages[j] = $root.ig.direct.DirectInboxMessage.toObject(message.messages[j], options);
|
|
1977
|
+
}
|
|
1978
|
+
if (message.threads && message.threads.length) {
|
|
1979
|
+
object.threads = [];
|
|
1980
|
+
for (var j = 0; j < message.threads.length; ++j)
|
|
1981
|
+
object.threads[j] = $root.ig.direct.DirectInboxThread.toObject(message.threads[j], options);
|
|
1982
|
+
}
|
|
1983
|
+
var keys2;
|
|
1984
|
+
if (message.seqIds && (keys2 = Object.keys(message.seqIds)).length) {
|
|
1985
|
+
object.seqIds = {};
|
|
1986
|
+
for (var j = 0; j < keys2.length; ++j)
|
|
1987
|
+
if (typeof message.seqIds[keys2[j]] === "number")
|
|
1988
|
+
object.seqIds[keys2[j]] = options.longs === String ? String(message.seqIds[keys2[j]]) : message.seqIds[keys2[j]];
|
|
1989
|
+
else
|
|
1990
|
+
object.seqIds[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.seqIds[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.seqIds[keys2[j]].low >>> 0, message.seqIds[keys2[j]].high >>> 0).toNumber() : message.seqIds[keys2[j]];
|
|
1991
|
+
}
|
|
1992
|
+
return object;
|
|
1993
|
+
};
|
|
1994
|
+
|
|
1995
|
+
/**
|
|
1996
|
+
* Converts this DirectSync to JSON.
|
|
1997
|
+
* @function toJSON
|
|
1998
|
+
* @memberof ig.direct.DirectSync
|
|
1999
|
+
* @instance
|
|
2000
|
+
* @returns {Object.<string,*>} JSON object
|
|
2001
|
+
*/
|
|
2002
|
+
DirectSync.prototype.toJSON = function toJSON() {
|
|
2003
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2004
|
+
};
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* Gets the default type url for DirectSync
|
|
2008
|
+
* @function getTypeUrl
|
|
2009
|
+
* @memberof ig.direct.DirectSync
|
|
2010
|
+
* @static
|
|
2011
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
2012
|
+
* @returns {string} The default type url
|
|
2013
|
+
*/
|
|
2014
|
+
DirectSync.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2015
|
+
if (typeUrlPrefix === undefined) {
|
|
2016
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2017
|
+
}
|
|
2018
|
+
return typeUrlPrefix + "/ig.direct.DirectSync";
|
|
2019
|
+
};
|
|
2020
|
+
|
|
2021
|
+
return DirectSync;
|
|
2022
|
+
})();
|
|
2023
|
+
|
|
2024
|
+
return direct;
|
|
2025
|
+
})();
|
|
2026
|
+
|
|
2027
|
+
ig.common = (function() {
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* Namespace common.
|
|
2031
|
+
* @memberof ig
|
|
2032
|
+
* @namespace
|
|
2033
|
+
*/
|
|
2034
|
+
var common = {};
|
|
2035
|
+
|
|
2036
|
+
common.Timestamp = (function() {
|
|
2037
|
+
|
|
2038
|
+
/**
|
|
2039
|
+
* Properties of a Timestamp.
|
|
2040
|
+
* @memberof ig.common
|
|
2041
|
+
* @interface ITimestamp
|
|
2042
|
+
* @property {number|Long|null} [unixTimeMs] Timestamp unixTimeMs
|
|
2043
|
+
*/
|
|
2044
|
+
|
|
2045
|
+
/**
|
|
2046
|
+
* Constructs a new Timestamp.
|
|
2047
|
+
* @memberof ig.common
|
|
2048
|
+
* @classdesc Represents a Timestamp.
|
|
2049
|
+
* @implements ITimestamp
|
|
2050
|
+
* @constructor
|
|
2051
|
+
* @param {ig.common.ITimestamp=} [properties] Properties to set
|
|
2052
|
+
*/
|
|
2053
|
+
function Timestamp(properties) {
|
|
2054
|
+
if (properties)
|
|
2055
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2056
|
+
if (properties[keys[i]] != null)
|
|
2057
|
+
this[keys[i]] = properties[keys[i]];
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
/**
|
|
2061
|
+
* Timestamp unixTimeMs.
|
|
2062
|
+
* @member {number|Long} unixTimeMs
|
|
2063
|
+
* @memberof ig.common.Timestamp
|
|
2064
|
+
* @instance
|
|
2065
|
+
*/
|
|
2066
|
+
Timestamp.prototype.unixTimeMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
2067
|
+
|
|
2068
|
+
/**
|
|
2069
|
+
* Creates a new Timestamp instance using the specified properties.
|
|
2070
|
+
* @function create
|
|
2071
|
+
* @memberof ig.common.Timestamp
|
|
2072
|
+
* @static
|
|
2073
|
+
* @param {ig.common.ITimestamp=} [properties] Properties to set
|
|
2074
|
+
* @returns {ig.common.Timestamp} Timestamp instance
|
|
2075
|
+
*/
|
|
2076
|
+
Timestamp.create = function create(properties) {
|
|
2077
|
+
return new Timestamp(properties);
|
|
2078
|
+
};
|
|
2079
|
+
|
|
2080
|
+
/**
|
|
2081
|
+
* Encodes the specified Timestamp message. Does not implicitly {@link ig.common.Timestamp.verify|verify} messages.
|
|
2082
|
+
* @function encode
|
|
2083
|
+
* @memberof ig.common.Timestamp
|
|
2084
|
+
* @static
|
|
2085
|
+
* @param {ig.common.ITimestamp} message Timestamp message or plain object to encode
|
|
2086
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2087
|
+
* @returns {$protobuf.Writer} Writer
|
|
2088
|
+
*/
|
|
2089
|
+
Timestamp.encode = function encode(message, writer) {
|
|
2090
|
+
if (!writer)
|
|
2091
|
+
writer = $Writer.create();
|
|
2092
|
+
if (message.unixTimeMs != null && Object.hasOwnProperty.call(message, "unixTimeMs"))
|
|
2093
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.unixTimeMs);
|
|
2094
|
+
return writer;
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
/**
|
|
2098
|
+
* Encodes the specified Timestamp message, length delimited. Does not implicitly {@link ig.common.Timestamp.verify|verify} messages.
|
|
2099
|
+
* @function encodeDelimited
|
|
2100
|
+
* @memberof ig.common.Timestamp
|
|
2101
|
+
* @static
|
|
2102
|
+
* @param {ig.common.ITimestamp} message Timestamp message or plain object to encode
|
|
2103
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2104
|
+
* @returns {$protobuf.Writer} Writer
|
|
2105
|
+
*/
|
|
2106
|
+
Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2107
|
+
return this.encode(message, writer).ldelim();
|
|
2108
|
+
};
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* Decodes a Timestamp message from the specified reader or buffer.
|
|
2112
|
+
* @function decode
|
|
2113
|
+
* @memberof ig.common.Timestamp
|
|
2114
|
+
* @static
|
|
2115
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2116
|
+
* @param {number} [length] Message length if known beforehand
|
|
2117
|
+
* @returns {ig.common.Timestamp} Timestamp
|
|
2118
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2119
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2120
|
+
*/
|
|
2121
|
+
Timestamp.decode = function decode(reader, length, error) {
|
|
2122
|
+
if (!(reader instanceof $Reader))
|
|
2123
|
+
reader = $Reader.create(reader);
|
|
2124
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.common.Timestamp();
|
|
2125
|
+
while (reader.pos < end) {
|
|
2126
|
+
var tag = reader.uint32();
|
|
2127
|
+
if (tag === error)
|
|
2128
|
+
break;
|
|
2129
|
+
switch (tag >>> 3) {
|
|
2130
|
+
case 1: {
|
|
2131
|
+
message.unixTimeMs = reader.int64();
|
|
2132
|
+
break;
|
|
2133
|
+
}
|
|
2134
|
+
default:
|
|
2135
|
+
reader.skipType(tag & 7);
|
|
2136
|
+
break;
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
return message;
|
|
2140
|
+
};
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* Decodes a Timestamp message from the specified reader or buffer, length delimited.
|
|
2144
|
+
* @function decodeDelimited
|
|
2145
|
+
* @memberof ig.common.Timestamp
|
|
2146
|
+
* @static
|
|
2147
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2148
|
+
* @returns {ig.common.Timestamp} Timestamp
|
|
2149
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2150
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2151
|
+
*/
|
|
2152
|
+
Timestamp.decodeDelimited = function decodeDelimited(reader) {
|
|
2153
|
+
if (!(reader instanceof $Reader))
|
|
2154
|
+
reader = new $Reader(reader);
|
|
2155
|
+
return this.decode(reader, reader.uint32());
|
|
2156
|
+
};
|
|
2157
|
+
|
|
2158
|
+
/**
|
|
2159
|
+
* Verifies a Timestamp message.
|
|
2160
|
+
* @function verify
|
|
2161
|
+
* @memberof ig.common.Timestamp
|
|
2162
|
+
* @static
|
|
2163
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2164
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2165
|
+
*/
|
|
2166
|
+
Timestamp.verify = function verify(message) {
|
|
2167
|
+
if (typeof message !== "object" || message === null)
|
|
2168
|
+
return "object expected";
|
|
2169
|
+
if (message.unixTimeMs != null && message.hasOwnProperty("unixTimeMs"))
|
|
2170
|
+
if (!$util.isInteger(message.unixTimeMs) && !(message.unixTimeMs && $util.isInteger(message.unixTimeMs.low) && $util.isInteger(message.unixTimeMs.high)))
|
|
2171
|
+
return "unixTimeMs: integer|Long expected";
|
|
2172
|
+
return null;
|
|
2173
|
+
};
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
|
|
2177
|
+
* @function fromObject
|
|
2178
|
+
* @memberof ig.common.Timestamp
|
|
2179
|
+
* @static
|
|
2180
|
+
* @param {Object.<string,*>} object Plain object
|
|
2181
|
+
* @returns {ig.common.Timestamp} Timestamp
|
|
2182
|
+
*/
|
|
2183
|
+
Timestamp.fromObject = function fromObject(object) {
|
|
2184
|
+
if (object instanceof $root.ig.common.Timestamp)
|
|
2185
|
+
return object;
|
|
2186
|
+
var message = new $root.ig.common.Timestamp();
|
|
2187
|
+
if (object.unixTimeMs != null)
|
|
2188
|
+
if ($util.Long)
|
|
2189
|
+
(message.unixTimeMs = $util.Long.fromValue(object.unixTimeMs)).unsigned = false;
|
|
2190
|
+
else if (typeof object.unixTimeMs === "string")
|
|
2191
|
+
message.unixTimeMs = parseInt(object.unixTimeMs, 10);
|
|
2192
|
+
else if (typeof object.unixTimeMs === "number")
|
|
2193
|
+
message.unixTimeMs = object.unixTimeMs;
|
|
2194
|
+
else if (typeof object.unixTimeMs === "object")
|
|
2195
|
+
message.unixTimeMs = new $util.LongBits(object.unixTimeMs.low >>> 0, object.unixTimeMs.high >>> 0).toNumber();
|
|
2196
|
+
return message;
|
|
2197
|
+
};
|
|
2198
|
+
|
|
2199
|
+
/**
|
|
2200
|
+
* Creates a plain object from a Timestamp message. Also converts values to other types if specified.
|
|
2201
|
+
* @function toObject
|
|
2202
|
+
* @memberof ig.common.Timestamp
|
|
2203
|
+
* @static
|
|
2204
|
+
* @param {ig.common.Timestamp} message Timestamp
|
|
2205
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2206
|
+
* @returns {Object.<string,*>} Plain object
|
|
2207
|
+
*/
|
|
2208
|
+
Timestamp.toObject = function toObject(message, options) {
|
|
2209
|
+
if (!options)
|
|
2210
|
+
options = {};
|
|
2211
|
+
var object = {};
|
|
2212
|
+
if (options.defaults)
|
|
2213
|
+
if ($util.Long) {
|
|
2214
|
+
var long = new $util.Long(0, 0, false);
|
|
2215
|
+
object.unixTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
2216
|
+
} else
|
|
2217
|
+
object.unixTimeMs = options.longs === String ? "0" : 0;
|
|
2218
|
+
if (message.unixTimeMs != null && message.hasOwnProperty("unixTimeMs"))
|
|
2219
|
+
if (typeof message.unixTimeMs === "number")
|
|
2220
|
+
object.unixTimeMs = options.longs === String ? String(message.unixTimeMs) : message.unixTimeMs;
|
|
2221
|
+
else
|
|
2222
|
+
object.unixTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.unixTimeMs) : options.longs === Number ? new $util.LongBits(message.unixTimeMs.low >>> 0, message.unixTimeMs.high >>> 0).toNumber() : message.unixTimeMs;
|
|
2223
|
+
return object;
|
|
2224
|
+
};
|
|
2225
|
+
|
|
2226
|
+
/**
|
|
2227
|
+
* Converts this Timestamp to JSON.
|
|
2228
|
+
* @function toJSON
|
|
2229
|
+
* @memberof ig.common.Timestamp
|
|
2230
|
+
* @instance
|
|
2231
|
+
* @returns {Object.<string,*>} JSON object
|
|
2232
|
+
*/
|
|
2233
|
+
Timestamp.prototype.toJSON = function toJSON() {
|
|
2234
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2235
|
+
};
|
|
2236
|
+
|
|
2237
|
+
/**
|
|
2238
|
+
* Gets the default type url for Timestamp
|
|
2239
|
+
* @function getTypeUrl
|
|
2240
|
+
* @memberof ig.common.Timestamp
|
|
2241
|
+
* @static
|
|
2242
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
2243
|
+
* @returns {string} The default type url
|
|
2244
|
+
*/
|
|
2245
|
+
Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2246
|
+
if (typeUrlPrefix === undefined) {
|
|
2247
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2248
|
+
}
|
|
2249
|
+
return typeUrlPrefix + "/ig.common.Timestamp";
|
|
2250
|
+
};
|
|
2251
|
+
|
|
2252
|
+
return Timestamp;
|
|
2253
|
+
})();
|
|
2254
|
+
|
|
2255
|
+
common.UserId = (function() {
|
|
2256
|
+
|
|
2257
|
+
/**
|
|
2258
|
+
* Properties of a UserId.
|
|
2259
|
+
* @memberof ig.common
|
|
2260
|
+
* @interface IUserId
|
|
2261
|
+
* @property {number|Long|null} [id] UserId id
|
|
2262
|
+
*/
|
|
2263
|
+
|
|
2264
|
+
/**
|
|
2265
|
+
* Constructs a new UserId.
|
|
2266
|
+
* @memberof ig.common
|
|
2267
|
+
* @classdesc Represents a UserId.
|
|
2268
|
+
* @implements IUserId
|
|
2269
|
+
* @constructor
|
|
2270
|
+
* @param {ig.common.IUserId=} [properties] Properties to set
|
|
2271
|
+
*/
|
|
2272
|
+
function UserId(properties) {
|
|
2273
|
+
if (properties)
|
|
2274
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2275
|
+
if (properties[keys[i]] != null)
|
|
2276
|
+
this[keys[i]] = properties[keys[i]];
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
/**
|
|
2280
|
+
* UserId id.
|
|
2281
|
+
* @member {number|Long} id
|
|
2282
|
+
* @memberof ig.common.UserId
|
|
2283
|
+
* @instance
|
|
2284
|
+
*/
|
|
2285
|
+
UserId.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
2286
|
+
|
|
2287
|
+
/**
|
|
2288
|
+
* Creates a new UserId instance using the specified properties.
|
|
2289
|
+
* @function create
|
|
2290
|
+
* @memberof ig.common.UserId
|
|
2291
|
+
* @static
|
|
2292
|
+
* @param {ig.common.IUserId=} [properties] Properties to set
|
|
2293
|
+
* @returns {ig.common.UserId} UserId instance
|
|
2294
|
+
*/
|
|
2295
|
+
UserId.create = function create(properties) {
|
|
2296
|
+
return new UserId(properties);
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
/**
|
|
2300
|
+
* Encodes the specified UserId message. Does not implicitly {@link ig.common.UserId.verify|verify} messages.
|
|
2301
|
+
* @function encode
|
|
2302
|
+
* @memberof ig.common.UserId
|
|
2303
|
+
* @static
|
|
2304
|
+
* @param {ig.common.IUserId} message UserId message or plain object to encode
|
|
2305
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2306
|
+
* @returns {$protobuf.Writer} Writer
|
|
2307
|
+
*/
|
|
2308
|
+
UserId.encode = function encode(message, writer) {
|
|
2309
|
+
if (!writer)
|
|
2310
|
+
writer = $Writer.create();
|
|
2311
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
2312
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
|
|
2313
|
+
return writer;
|
|
2314
|
+
};
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* Encodes the specified UserId message, length delimited. Does not implicitly {@link ig.common.UserId.verify|verify} messages.
|
|
2318
|
+
* @function encodeDelimited
|
|
2319
|
+
* @memberof ig.common.UserId
|
|
2320
|
+
* @static
|
|
2321
|
+
* @param {ig.common.IUserId} message UserId message or plain object to encode
|
|
2322
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2323
|
+
* @returns {$protobuf.Writer} Writer
|
|
2324
|
+
*/
|
|
2325
|
+
UserId.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2326
|
+
return this.encode(message, writer).ldelim();
|
|
2327
|
+
};
|
|
2328
|
+
|
|
2329
|
+
/**
|
|
2330
|
+
* Decodes a UserId message from the specified reader or buffer.
|
|
2331
|
+
* @function decode
|
|
2332
|
+
* @memberof ig.common.UserId
|
|
2333
|
+
* @static
|
|
2334
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2335
|
+
* @param {number} [length] Message length if known beforehand
|
|
2336
|
+
* @returns {ig.common.UserId} UserId
|
|
2337
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2338
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2339
|
+
*/
|
|
2340
|
+
UserId.decode = function decode(reader, length, error) {
|
|
2341
|
+
if (!(reader instanceof $Reader))
|
|
2342
|
+
reader = $Reader.create(reader);
|
|
2343
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.common.UserId();
|
|
2344
|
+
while (reader.pos < end) {
|
|
2345
|
+
var tag = reader.uint32();
|
|
2346
|
+
if (tag === error)
|
|
2347
|
+
break;
|
|
2348
|
+
switch (tag >>> 3) {
|
|
2349
|
+
case 1: {
|
|
2350
|
+
message.id = reader.int64();
|
|
2351
|
+
break;
|
|
2352
|
+
}
|
|
2353
|
+
default:
|
|
2354
|
+
reader.skipType(tag & 7);
|
|
2355
|
+
break;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
return message;
|
|
2359
|
+
};
|
|
2360
|
+
|
|
2361
|
+
/**
|
|
2362
|
+
* Decodes a UserId message from the specified reader or buffer, length delimited.
|
|
2363
|
+
* @function decodeDelimited
|
|
2364
|
+
* @memberof ig.common.UserId
|
|
2365
|
+
* @static
|
|
2366
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2367
|
+
* @returns {ig.common.UserId} UserId
|
|
2368
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2369
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2370
|
+
*/
|
|
2371
|
+
UserId.decodeDelimited = function decodeDelimited(reader) {
|
|
2372
|
+
if (!(reader instanceof $Reader))
|
|
2373
|
+
reader = new $Reader(reader);
|
|
2374
|
+
return this.decode(reader, reader.uint32());
|
|
2375
|
+
};
|
|
2376
|
+
|
|
2377
|
+
/**
|
|
2378
|
+
* Verifies a UserId message.
|
|
2379
|
+
* @function verify
|
|
2380
|
+
* @memberof ig.common.UserId
|
|
2381
|
+
* @static
|
|
2382
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2383
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2384
|
+
*/
|
|
2385
|
+
UserId.verify = function verify(message) {
|
|
2386
|
+
if (typeof message !== "object" || message === null)
|
|
2387
|
+
return "object expected";
|
|
2388
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
2389
|
+
if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
|
|
2390
|
+
return "id: integer|Long expected";
|
|
2391
|
+
return null;
|
|
2392
|
+
};
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* Creates a UserId message from a plain object. Also converts values to their respective internal types.
|
|
2396
|
+
* @function fromObject
|
|
2397
|
+
* @memberof ig.common.UserId
|
|
2398
|
+
* @static
|
|
2399
|
+
* @param {Object.<string,*>} object Plain object
|
|
2400
|
+
* @returns {ig.common.UserId} UserId
|
|
2401
|
+
*/
|
|
2402
|
+
UserId.fromObject = function fromObject(object) {
|
|
2403
|
+
if (object instanceof $root.ig.common.UserId)
|
|
2404
|
+
return object;
|
|
2405
|
+
var message = new $root.ig.common.UserId();
|
|
2406
|
+
if (object.id != null)
|
|
2407
|
+
if ($util.Long)
|
|
2408
|
+
(message.id = $util.Long.fromValue(object.id)).unsigned = false;
|
|
2409
|
+
else if (typeof object.id === "string")
|
|
2410
|
+
message.id = parseInt(object.id, 10);
|
|
2411
|
+
else if (typeof object.id === "number")
|
|
2412
|
+
message.id = object.id;
|
|
2413
|
+
else if (typeof object.id === "object")
|
|
2414
|
+
message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
|
|
2415
|
+
return message;
|
|
2416
|
+
};
|
|
2417
|
+
|
|
2418
|
+
/**
|
|
2419
|
+
* Creates a plain object from a UserId message. Also converts values to other types if specified.
|
|
2420
|
+
* @function toObject
|
|
2421
|
+
* @memberof ig.common.UserId
|
|
2422
|
+
* @static
|
|
2423
|
+
* @param {ig.common.UserId} message UserId
|
|
2424
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2425
|
+
* @returns {Object.<string,*>} Plain object
|
|
2426
|
+
*/
|
|
2427
|
+
UserId.toObject = function toObject(message, options) {
|
|
2428
|
+
if (!options)
|
|
2429
|
+
options = {};
|
|
2430
|
+
var object = {};
|
|
2431
|
+
if (options.defaults)
|
|
2432
|
+
if ($util.Long) {
|
|
2433
|
+
var long = new $util.Long(0, 0, false);
|
|
2434
|
+
object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
2435
|
+
} else
|
|
2436
|
+
object.id = options.longs === String ? "0" : 0;
|
|
2437
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
2438
|
+
if (typeof message.id === "number")
|
|
2439
|
+
object.id = options.longs === String ? String(message.id) : message.id;
|
|
2440
|
+
else
|
|
2441
|
+
object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id;
|
|
2442
|
+
return object;
|
|
2443
|
+
};
|
|
2444
|
+
|
|
2445
|
+
/**
|
|
2446
|
+
* Converts this UserId to JSON.
|
|
2447
|
+
* @function toJSON
|
|
2448
|
+
* @memberof ig.common.UserId
|
|
2449
|
+
* @instance
|
|
2450
|
+
* @returns {Object.<string,*>} JSON object
|
|
2451
|
+
*/
|
|
2452
|
+
UserId.prototype.toJSON = function toJSON() {
|
|
2453
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2454
|
+
};
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* Gets the default type url for UserId
|
|
2458
|
+
* @function getTypeUrl
|
|
2459
|
+
* @memberof ig.common.UserId
|
|
2460
|
+
* @static
|
|
2461
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
2462
|
+
* @returns {string} The default type url
|
|
2463
|
+
*/
|
|
2464
|
+
UserId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2465
|
+
if (typeUrlPrefix === undefined) {
|
|
2466
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2467
|
+
}
|
|
2468
|
+
return typeUrlPrefix + "/ig.common.UserId";
|
|
2469
|
+
};
|
|
2470
|
+
|
|
2471
|
+
return UserId;
|
|
2472
|
+
})();
|
|
2473
|
+
|
|
2474
|
+
common.ThreadId = (function() {
|
|
2475
|
+
|
|
2476
|
+
/**
|
|
2477
|
+
* Properties of a ThreadId.
|
|
2478
|
+
* @memberof ig.common
|
|
2479
|
+
* @interface IThreadId
|
|
2480
|
+
* @property {number|Long|null} [id] ThreadId id
|
|
2481
|
+
*/
|
|
2482
|
+
|
|
2483
|
+
/**
|
|
2484
|
+
* Constructs a new ThreadId.
|
|
2485
|
+
* @memberof ig.common
|
|
2486
|
+
* @classdesc Represents a ThreadId.
|
|
2487
|
+
* @implements IThreadId
|
|
2488
|
+
* @constructor
|
|
2489
|
+
* @param {ig.common.IThreadId=} [properties] Properties to set
|
|
2490
|
+
*/
|
|
2491
|
+
function ThreadId(properties) {
|
|
2492
|
+
if (properties)
|
|
2493
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2494
|
+
if (properties[keys[i]] != null)
|
|
2495
|
+
this[keys[i]] = properties[keys[i]];
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* ThreadId id.
|
|
2500
|
+
* @member {number|Long} id
|
|
2501
|
+
* @memberof ig.common.ThreadId
|
|
2502
|
+
* @instance
|
|
2503
|
+
*/
|
|
2504
|
+
ThreadId.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
2505
|
+
|
|
2506
|
+
/**
|
|
2507
|
+
* Creates a new ThreadId instance using the specified properties.
|
|
2508
|
+
* @function create
|
|
2509
|
+
* @memberof ig.common.ThreadId
|
|
2510
|
+
* @static
|
|
2511
|
+
* @param {ig.common.IThreadId=} [properties] Properties to set
|
|
2512
|
+
* @returns {ig.common.ThreadId} ThreadId instance
|
|
2513
|
+
*/
|
|
2514
|
+
ThreadId.create = function create(properties) {
|
|
2515
|
+
return new ThreadId(properties);
|
|
2516
|
+
};
|
|
2517
|
+
|
|
2518
|
+
/**
|
|
2519
|
+
* Encodes the specified ThreadId message. Does not implicitly {@link ig.common.ThreadId.verify|verify} messages.
|
|
2520
|
+
* @function encode
|
|
2521
|
+
* @memberof ig.common.ThreadId
|
|
2522
|
+
* @static
|
|
2523
|
+
* @param {ig.common.IThreadId} message ThreadId message or plain object to encode
|
|
2524
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2525
|
+
* @returns {$protobuf.Writer} Writer
|
|
2526
|
+
*/
|
|
2527
|
+
ThreadId.encode = function encode(message, writer) {
|
|
2528
|
+
if (!writer)
|
|
2529
|
+
writer = $Writer.create();
|
|
2530
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
2531
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.id);
|
|
2532
|
+
return writer;
|
|
2533
|
+
};
|
|
2534
|
+
|
|
2535
|
+
/**
|
|
2536
|
+
* Encodes the specified ThreadId message, length delimited. Does not implicitly {@link ig.common.ThreadId.verify|verify} messages.
|
|
2537
|
+
* @function encodeDelimited
|
|
2538
|
+
* @memberof ig.common.ThreadId
|
|
2539
|
+
* @static
|
|
2540
|
+
* @param {ig.common.IThreadId} message ThreadId message or plain object to encode
|
|
2541
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2542
|
+
* @returns {$protobuf.Writer} Writer
|
|
2543
|
+
*/
|
|
2544
|
+
ThreadId.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2545
|
+
return this.encode(message, writer).ldelim();
|
|
2546
|
+
};
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* Decodes a ThreadId message from the specified reader or buffer.
|
|
2550
|
+
* @function decode
|
|
2551
|
+
* @memberof ig.common.ThreadId
|
|
2552
|
+
* @static
|
|
2553
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2554
|
+
* @param {number} [length] Message length if known beforehand
|
|
2555
|
+
* @returns {ig.common.ThreadId} ThreadId
|
|
2556
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2557
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2558
|
+
*/
|
|
2559
|
+
ThreadId.decode = function decode(reader, length, error) {
|
|
2560
|
+
if (!(reader instanceof $Reader))
|
|
2561
|
+
reader = $Reader.create(reader);
|
|
2562
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.common.ThreadId();
|
|
2563
|
+
while (reader.pos < end) {
|
|
2564
|
+
var tag = reader.uint32();
|
|
2565
|
+
if (tag === error)
|
|
2566
|
+
break;
|
|
2567
|
+
switch (tag >>> 3) {
|
|
2568
|
+
case 1: {
|
|
2569
|
+
message.id = reader.int64();
|
|
2570
|
+
break;
|
|
2571
|
+
}
|
|
2572
|
+
default:
|
|
2573
|
+
reader.skipType(tag & 7);
|
|
2574
|
+
break;
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
return message;
|
|
2578
|
+
};
|
|
2579
|
+
|
|
2580
|
+
/**
|
|
2581
|
+
* Decodes a ThreadId message from the specified reader or buffer, length delimited.
|
|
2582
|
+
* @function decodeDelimited
|
|
2583
|
+
* @memberof ig.common.ThreadId
|
|
2584
|
+
* @static
|
|
2585
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2586
|
+
* @returns {ig.common.ThreadId} ThreadId
|
|
2587
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2588
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2589
|
+
*/
|
|
2590
|
+
ThreadId.decodeDelimited = function decodeDelimited(reader) {
|
|
2591
|
+
if (!(reader instanceof $Reader))
|
|
2592
|
+
reader = new $Reader(reader);
|
|
2593
|
+
return this.decode(reader, reader.uint32());
|
|
2594
|
+
};
|
|
2595
|
+
|
|
2596
|
+
/**
|
|
2597
|
+
* Verifies a ThreadId message.
|
|
2598
|
+
* @function verify
|
|
2599
|
+
* @memberof ig.common.ThreadId
|
|
2600
|
+
* @static
|
|
2601
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2602
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2603
|
+
*/
|
|
2604
|
+
ThreadId.verify = function verify(message) {
|
|
2605
|
+
if (typeof message !== "object" || message === null)
|
|
2606
|
+
return "object expected";
|
|
2607
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
2608
|
+
if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))
|
|
2609
|
+
return "id: integer|Long expected";
|
|
2610
|
+
return null;
|
|
2611
|
+
};
|
|
2612
|
+
|
|
2613
|
+
/**
|
|
2614
|
+
* Creates a ThreadId message from a plain object. Also converts values to their respective internal types.
|
|
2615
|
+
* @function fromObject
|
|
2616
|
+
* @memberof ig.common.ThreadId
|
|
2617
|
+
* @static
|
|
2618
|
+
* @param {Object.<string,*>} object Plain object
|
|
2619
|
+
* @returns {ig.common.ThreadId} ThreadId
|
|
2620
|
+
*/
|
|
2621
|
+
ThreadId.fromObject = function fromObject(object) {
|
|
2622
|
+
if (object instanceof $root.ig.common.ThreadId)
|
|
2623
|
+
return object;
|
|
2624
|
+
var message = new $root.ig.common.ThreadId();
|
|
2625
|
+
if (object.id != null)
|
|
2626
|
+
if ($util.Long)
|
|
2627
|
+
(message.id = $util.Long.fromValue(object.id)).unsigned = false;
|
|
2628
|
+
else if (typeof object.id === "string")
|
|
2629
|
+
message.id = parseInt(object.id, 10);
|
|
2630
|
+
else if (typeof object.id === "number")
|
|
2631
|
+
message.id = object.id;
|
|
2632
|
+
else if (typeof object.id === "object")
|
|
2633
|
+
message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber();
|
|
2634
|
+
return message;
|
|
2635
|
+
};
|
|
2636
|
+
|
|
2637
|
+
/**
|
|
2638
|
+
* Creates a plain object from a ThreadId message. Also converts values to other types if specified.
|
|
2639
|
+
* @function toObject
|
|
2640
|
+
* @memberof ig.common.ThreadId
|
|
2641
|
+
* @static
|
|
2642
|
+
* @param {ig.common.ThreadId} message ThreadId
|
|
2643
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2644
|
+
* @returns {Object.<string,*>} Plain object
|
|
2645
|
+
*/
|
|
2646
|
+
ThreadId.toObject = function toObject(message, options) {
|
|
2647
|
+
if (!options)
|
|
2648
|
+
options = {};
|
|
2649
|
+
var object = {};
|
|
2650
|
+
if (options.defaults)
|
|
2651
|
+
if ($util.Long) {
|
|
2652
|
+
var long = new $util.Long(0, 0, false);
|
|
2653
|
+
object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
2654
|
+
} else
|
|
2655
|
+
object.id = options.longs === String ? "0" : 0;
|
|
2656
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
2657
|
+
if (typeof message.id === "number")
|
|
2658
|
+
object.id = options.longs === String ? String(message.id) : message.id;
|
|
2659
|
+
else
|
|
2660
|
+
object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id;
|
|
2661
|
+
return object;
|
|
2662
|
+
};
|
|
2663
|
+
|
|
2664
|
+
/**
|
|
2665
|
+
* Converts this ThreadId to JSON.
|
|
2666
|
+
* @function toJSON
|
|
2667
|
+
* @memberof ig.common.ThreadId
|
|
2668
|
+
* @instance
|
|
2669
|
+
* @returns {Object.<string,*>} JSON object
|
|
2670
|
+
*/
|
|
2671
|
+
ThreadId.prototype.toJSON = function toJSON() {
|
|
2672
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2673
|
+
};
|
|
2674
|
+
|
|
2675
|
+
/**
|
|
2676
|
+
* Gets the default type url for ThreadId
|
|
2677
|
+
* @function getTypeUrl
|
|
2678
|
+
* @memberof ig.common.ThreadId
|
|
2679
|
+
* @static
|
|
2680
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
2681
|
+
* @returns {string} The default type url
|
|
2682
|
+
*/
|
|
2683
|
+
ThreadId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2684
|
+
if (typeUrlPrefix === undefined) {
|
|
2685
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2686
|
+
}
|
|
2687
|
+
return typeUrlPrefix + "/ig.common.ThreadId";
|
|
2688
|
+
};
|
|
2689
|
+
|
|
2690
|
+
return ThreadId;
|
|
2691
|
+
})();
|
|
2692
|
+
|
|
2693
|
+
common.Reaction = (function() {
|
|
2694
|
+
|
|
2695
|
+
/**
|
|
2696
|
+
* Properties of a Reaction.
|
|
2697
|
+
* @memberof ig.common
|
|
2698
|
+
* @interface IReaction
|
|
2699
|
+
* @property {string|null} [emoji] Reaction emoji
|
|
2700
|
+
* @property {number|null} [count] Reaction count
|
|
2701
|
+
* @property {number|Long|null} [createdAt] Reaction createdAt
|
|
2702
|
+
*/
|
|
2703
|
+
|
|
2704
|
+
/**
|
|
2705
|
+
* Constructs a new Reaction.
|
|
2706
|
+
* @memberof ig.common
|
|
2707
|
+
* @classdesc Represents a Reaction.
|
|
2708
|
+
* @implements IReaction
|
|
2709
|
+
* @constructor
|
|
2710
|
+
* @param {ig.common.IReaction=} [properties] Properties to set
|
|
2711
|
+
*/
|
|
2712
|
+
function Reaction(properties) {
|
|
2713
|
+
if (properties)
|
|
2714
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2715
|
+
if (properties[keys[i]] != null)
|
|
2716
|
+
this[keys[i]] = properties[keys[i]];
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
/**
|
|
2720
|
+
* Reaction emoji.
|
|
2721
|
+
* @member {string} emoji
|
|
2722
|
+
* @memberof ig.common.Reaction
|
|
2723
|
+
* @instance
|
|
2724
|
+
*/
|
|
2725
|
+
Reaction.prototype.emoji = "";
|
|
2726
|
+
|
|
2727
|
+
/**
|
|
2728
|
+
* Reaction count.
|
|
2729
|
+
* @member {number} count
|
|
2730
|
+
* @memberof ig.common.Reaction
|
|
2731
|
+
* @instance
|
|
2732
|
+
*/
|
|
2733
|
+
Reaction.prototype.count = 0;
|
|
2734
|
+
|
|
2735
|
+
/**
|
|
2736
|
+
* Reaction createdAt.
|
|
2737
|
+
* @member {number|Long} createdAt
|
|
2738
|
+
* @memberof ig.common.Reaction
|
|
2739
|
+
* @instance
|
|
2740
|
+
*/
|
|
2741
|
+
Reaction.prototype.createdAt = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
2742
|
+
|
|
2743
|
+
/**
|
|
2744
|
+
* Creates a new Reaction instance using the specified properties.
|
|
2745
|
+
* @function create
|
|
2746
|
+
* @memberof ig.common.Reaction
|
|
2747
|
+
* @static
|
|
2748
|
+
* @param {ig.common.IReaction=} [properties] Properties to set
|
|
2749
|
+
* @returns {ig.common.Reaction} Reaction instance
|
|
2750
|
+
*/
|
|
2751
|
+
Reaction.create = function create(properties) {
|
|
2752
|
+
return new Reaction(properties);
|
|
2753
|
+
};
|
|
2754
|
+
|
|
2755
|
+
/**
|
|
2756
|
+
* Encodes the specified Reaction message. Does not implicitly {@link ig.common.Reaction.verify|verify} messages.
|
|
2757
|
+
* @function encode
|
|
2758
|
+
* @memberof ig.common.Reaction
|
|
2759
|
+
* @static
|
|
2760
|
+
* @param {ig.common.IReaction} message Reaction message or plain object to encode
|
|
2761
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2762
|
+
* @returns {$protobuf.Writer} Writer
|
|
2763
|
+
*/
|
|
2764
|
+
Reaction.encode = function encode(message, writer) {
|
|
2765
|
+
if (!writer)
|
|
2766
|
+
writer = $Writer.create();
|
|
2767
|
+
if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji"))
|
|
2768
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.emoji);
|
|
2769
|
+
if (message.count != null && Object.hasOwnProperty.call(message, "count"))
|
|
2770
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count);
|
|
2771
|
+
if (message.createdAt != null && Object.hasOwnProperty.call(message, "createdAt"))
|
|
2772
|
+
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.createdAt);
|
|
2773
|
+
return writer;
|
|
2774
|
+
};
|
|
2775
|
+
|
|
2776
|
+
/**
|
|
2777
|
+
* Encodes the specified Reaction message, length delimited. Does not implicitly {@link ig.common.Reaction.verify|verify} messages.
|
|
2778
|
+
* @function encodeDelimited
|
|
2779
|
+
* @memberof ig.common.Reaction
|
|
2780
|
+
* @static
|
|
2781
|
+
* @param {ig.common.IReaction} message Reaction message or plain object to encode
|
|
2782
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2783
|
+
* @returns {$protobuf.Writer} Writer
|
|
2784
|
+
*/
|
|
2785
|
+
Reaction.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2786
|
+
return this.encode(message, writer).ldelim();
|
|
2787
|
+
};
|
|
2788
|
+
|
|
2789
|
+
/**
|
|
2790
|
+
* Decodes a Reaction message from the specified reader or buffer.
|
|
2791
|
+
* @function decode
|
|
2792
|
+
* @memberof ig.common.Reaction
|
|
2793
|
+
* @static
|
|
2794
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2795
|
+
* @param {number} [length] Message length if known beforehand
|
|
2796
|
+
* @returns {ig.common.Reaction} Reaction
|
|
2797
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2798
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2799
|
+
*/
|
|
2800
|
+
Reaction.decode = function decode(reader, length, error) {
|
|
2801
|
+
if (!(reader instanceof $Reader))
|
|
2802
|
+
reader = $Reader.create(reader);
|
|
2803
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.common.Reaction();
|
|
2804
|
+
while (reader.pos < end) {
|
|
2805
|
+
var tag = reader.uint32();
|
|
2806
|
+
if (tag === error)
|
|
2807
|
+
break;
|
|
2808
|
+
switch (tag >>> 3) {
|
|
2809
|
+
case 1: {
|
|
2810
|
+
message.emoji = reader.string();
|
|
2811
|
+
break;
|
|
2812
|
+
}
|
|
2813
|
+
case 2: {
|
|
2814
|
+
message.count = reader.int32();
|
|
2815
|
+
break;
|
|
2816
|
+
}
|
|
2817
|
+
case 3: {
|
|
2818
|
+
message.createdAt = reader.int64();
|
|
2819
|
+
break;
|
|
2820
|
+
}
|
|
2821
|
+
default:
|
|
2822
|
+
reader.skipType(tag & 7);
|
|
2823
|
+
break;
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
return message;
|
|
2827
|
+
};
|
|
2828
|
+
|
|
2829
|
+
/**
|
|
2830
|
+
* Decodes a Reaction message from the specified reader or buffer, length delimited.
|
|
2831
|
+
* @function decodeDelimited
|
|
2832
|
+
* @memberof ig.common.Reaction
|
|
2833
|
+
* @static
|
|
2834
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2835
|
+
* @returns {ig.common.Reaction} Reaction
|
|
2836
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2837
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2838
|
+
*/
|
|
2839
|
+
Reaction.decodeDelimited = function decodeDelimited(reader) {
|
|
2840
|
+
if (!(reader instanceof $Reader))
|
|
2841
|
+
reader = new $Reader(reader);
|
|
2842
|
+
return this.decode(reader, reader.uint32());
|
|
2843
|
+
};
|
|
2844
|
+
|
|
2845
|
+
/**
|
|
2846
|
+
* Verifies a Reaction message.
|
|
2847
|
+
* @function verify
|
|
2848
|
+
* @memberof ig.common.Reaction
|
|
2849
|
+
* @static
|
|
2850
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2851
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2852
|
+
*/
|
|
2853
|
+
Reaction.verify = function verify(message) {
|
|
2854
|
+
if (typeof message !== "object" || message === null)
|
|
2855
|
+
return "object expected";
|
|
2856
|
+
if (message.emoji != null && message.hasOwnProperty("emoji"))
|
|
2857
|
+
if (!$util.isString(message.emoji))
|
|
2858
|
+
return "emoji: string expected";
|
|
2859
|
+
if (message.count != null && message.hasOwnProperty("count"))
|
|
2860
|
+
if (!$util.isInteger(message.count))
|
|
2861
|
+
return "count: integer expected";
|
|
2862
|
+
if (message.createdAt != null && message.hasOwnProperty("createdAt"))
|
|
2863
|
+
if (!$util.isInteger(message.createdAt) && !(message.createdAt && $util.isInteger(message.createdAt.low) && $util.isInteger(message.createdAt.high)))
|
|
2864
|
+
return "createdAt: integer|Long expected";
|
|
2865
|
+
return null;
|
|
2866
|
+
};
|
|
2867
|
+
|
|
2868
|
+
/**
|
|
2869
|
+
* Creates a Reaction message from a plain object. Also converts values to their respective internal types.
|
|
2870
|
+
* @function fromObject
|
|
2871
|
+
* @memberof ig.common.Reaction
|
|
2872
|
+
* @static
|
|
2873
|
+
* @param {Object.<string,*>} object Plain object
|
|
2874
|
+
* @returns {ig.common.Reaction} Reaction
|
|
2875
|
+
*/
|
|
2876
|
+
Reaction.fromObject = function fromObject(object) {
|
|
2877
|
+
if (object instanceof $root.ig.common.Reaction)
|
|
2878
|
+
return object;
|
|
2879
|
+
var message = new $root.ig.common.Reaction();
|
|
2880
|
+
if (object.emoji != null)
|
|
2881
|
+
message.emoji = String(object.emoji);
|
|
2882
|
+
if (object.count != null)
|
|
2883
|
+
message.count = object.count | 0;
|
|
2884
|
+
if (object.createdAt != null)
|
|
2885
|
+
if ($util.Long)
|
|
2886
|
+
(message.createdAt = $util.Long.fromValue(object.createdAt)).unsigned = false;
|
|
2887
|
+
else if (typeof object.createdAt === "string")
|
|
2888
|
+
message.createdAt = parseInt(object.createdAt, 10);
|
|
2889
|
+
else if (typeof object.createdAt === "number")
|
|
2890
|
+
message.createdAt = object.createdAt;
|
|
2891
|
+
else if (typeof object.createdAt === "object")
|
|
2892
|
+
message.createdAt = new $util.LongBits(object.createdAt.low >>> 0, object.createdAt.high >>> 0).toNumber();
|
|
2893
|
+
return message;
|
|
2894
|
+
};
|
|
2895
|
+
|
|
2896
|
+
/**
|
|
2897
|
+
* Creates a plain object from a Reaction message. Also converts values to other types if specified.
|
|
2898
|
+
* @function toObject
|
|
2899
|
+
* @memberof ig.common.Reaction
|
|
2900
|
+
* @static
|
|
2901
|
+
* @param {ig.common.Reaction} message Reaction
|
|
2902
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2903
|
+
* @returns {Object.<string,*>} Plain object
|
|
2904
|
+
*/
|
|
2905
|
+
Reaction.toObject = function toObject(message, options) {
|
|
2906
|
+
if (!options)
|
|
2907
|
+
options = {};
|
|
2908
|
+
var object = {};
|
|
2909
|
+
if (options.defaults) {
|
|
2910
|
+
object.emoji = "";
|
|
2911
|
+
object.count = 0;
|
|
2912
|
+
if ($util.Long) {
|
|
2913
|
+
var long = new $util.Long(0, 0, false);
|
|
2914
|
+
object.createdAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
2915
|
+
} else
|
|
2916
|
+
object.createdAt = options.longs === String ? "0" : 0;
|
|
2917
|
+
}
|
|
2918
|
+
if (message.emoji != null && message.hasOwnProperty("emoji"))
|
|
2919
|
+
object.emoji = message.emoji;
|
|
2920
|
+
if (message.count != null && message.hasOwnProperty("count"))
|
|
2921
|
+
object.count = message.count;
|
|
2922
|
+
if (message.createdAt != null && message.hasOwnProperty("createdAt"))
|
|
2923
|
+
if (typeof message.createdAt === "number")
|
|
2924
|
+
object.createdAt = options.longs === String ? String(message.createdAt) : message.createdAt;
|
|
2925
|
+
else
|
|
2926
|
+
object.createdAt = options.longs === String ? $util.Long.prototype.toString.call(message.createdAt) : options.longs === Number ? new $util.LongBits(message.createdAt.low >>> 0, message.createdAt.high >>> 0).toNumber() : message.createdAt;
|
|
2927
|
+
return object;
|
|
2928
|
+
};
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* Converts this Reaction to JSON.
|
|
2932
|
+
* @function toJSON
|
|
2933
|
+
* @memberof ig.common.Reaction
|
|
2934
|
+
* @instance
|
|
2935
|
+
* @returns {Object.<string,*>} JSON object
|
|
2936
|
+
*/
|
|
2937
|
+
Reaction.prototype.toJSON = function toJSON() {
|
|
2938
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2939
|
+
};
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* Gets the default type url for Reaction
|
|
2943
|
+
* @function getTypeUrl
|
|
2944
|
+
* @memberof ig.common.Reaction
|
|
2945
|
+
* @static
|
|
2946
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
2947
|
+
* @returns {string} The default type url
|
|
2948
|
+
*/
|
|
2949
|
+
Reaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2950
|
+
if (typeUrlPrefix === undefined) {
|
|
2951
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2952
|
+
}
|
|
2953
|
+
return typeUrlPrefix + "/ig.common.Reaction";
|
|
2954
|
+
};
|
|
2955
|
+
|
|
2956
|
+
return Reaction;
|
|
2957
|
+
})();
|
|
2958
|
+
|
|
2959
|
+
common.MediaAttachment = (function() {
|
|
2960
|
+
|
|
2961
|
+
/**
|
|
2962
|
+
* Properties of a MediaAttachment.
|
|
2963
|
+
* @memberof ig.common
|
|
2964
|
+
* @interface IMediaAttachment
|
|
2965
|
+
* @property {number|Long|null} [mediaId] MediaAttachment mediaId
|
|
2966
|
+
* @property {string|null} [type] MediaAttachment type
|
|
2967
|
+
* @property {string|null} [url] MediaAttachment url
|
|
2968
|
+
* @property {number|null} [width] MediaAttachment width
|
|
2969
|
+
* @property {number|null} [height] MediaAttachment height
|
|
2970
|
+
*/
|
|
2971
|
+
|
|
2972
|
+
/**
|
|
2973
|
+
* Constructs a new MediaAttachment.
|
|
2974
|
+
* @memberof ig.common
|
|
2975
|
+
* @classdesc Represents a MediaAttachment.
|
|
2976
|
+
* @implements IMediaAttachment
|
|
2977
|
+
* @constructor
|
|
2978
|
+
* @param {ig.common.IMediaAttachment=} [properties] Properties to set
|
|
2979
|
+
*/
|
|
2980
|
+
function MediaAttachment(properties) {
|
|
2981
|
+
if (properties)
|
|
2982
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2983
|
+
if (properties[keys[i]] != null)
|
|
2984
|
+
this[keys[i]] = properties[keys[i]];
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
/**
|
|
2988
|
+
* MediaAttachment mediaId.
|
|
2989
|
+
* @member {number|Long} mediaId
|
|
2990
|
+
* @memberof ig.common.MediaAttachment
|
|
2991
|
+
* @instance
|
|
2992
|
+
*/
|
|
2993
|
+
MediaAttachment.prototype.mediaId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
2994
|
+
|
|
2995
|
+
/**
|
|
2996
|
+
* MediaAttachment type.
|
|
2997
|
+
* @member {string} type
|
|
2998
|
+
* @memberof ig.common.MediaAttachment
|
|
2999
|
+
* @instance
|
|
3000
|
+
*/
|
|
3001
|
+
MediaAttachment.prototype.type = "";
|
|
3002
|
+
|
|
3003
|
+
/**
|
|
3004
|
+
* MediaAttachment url.
|
|
3005
|
+
* @member {string} url
|
|
3006
|
+
* @memberof ig.common.MediaAttachment
|
|
3007
|
+
* @instance
|
|
3008
|
+
*/
|
|
3009
|
+
MediaAttachment.prototype.url = "";
|
|
3010
|
+
|
|
3011
|
+
/**
|
|
3012
|
+
* MediaAttachment width.
|
|
3013
|
+
* @member {number} width
|
|
3014
|
+
* @memberof ig.common.MediaAttachment
|
|
3015
|
+
* @instance
|
|
3016
|
+
*/
|
|
3017
|
+
MediaAttachment.prototype.width = 0;
|
|
3018
|
+
|
|
3019
|
+
/**
|
|
3020
|
+
* MediaAttachment height.
|
|
3021
|
+
* @member {number} height
|
|
3022
|
+
* @memberof ig.common.MediaAttachment
|
|
3023
|
+
* @instance
|
|
3024
|
+
*/
|
|
3025
|
+
MediaAttachment.prototype.height = 0;
|
|
3026
|
+
|
|
3027
|
+
/**
|
|
3028
|
+
* Creates a new MediaAttachment instance using the specified properties.
|
|
3029
|
+
* @function create
|
|
3030
|
+
* @memberof ig.common.MediaAttachment
|
|
3031
|
+
* @static
|
|
3032
|
+
* @param {ig.common.IMediaAttachment=} [properties] Properties to set
|
|
3033
|
+
* @returns {ig.common.MediaAttachment} MediaAttachment instance
|
|
3034
|
+
*/
|
|
3035
|
+
MediaAttachment.create = function create(properties) {
|
|
3036
|
+
return new MediaAttachment(properties);
|
|
3037
|
+
};
|
|
3038
|
+
|
|
3039
|
+
/**
|
|
3040
|
+
* Encodes the specified MediaAttachment message. Does not implicitly {@link ig.common.MediaAttachment.verify|verify} messages.
|
|
3041
|
+
* @function encode
|
|
3042
|
+
* @memberof ig.common.MediaAttachment
|
|
3043
|
+
* @static
|
|
3044
|
+
* @param {ig.common.IMediaAttachment} message MediaAttachment message or plain object to encode
|
|
3045
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3046
|
+
* @returns {$protobuf.Writer} Writer
|
|
3047
|
+
*/
|
|
3048
|
+
MediaAttachment.encode = function encode(message, writer) {
|
|
3049
|
+
if (!writer)
|
|
3050
|
+
writer = $Writer.create();
|
|
3051
|
+
if (message.mediaId != null && Object.hasOwnProperty.call(message, "mediaId"))
|
|
3052
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.mediaId);
|
|
3053
|
+
if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
|
3054
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.type);
|
|
3055
|
+
if (message.url != null && Object.hasOwnProperty.call(message, "url"))
|
|
3056
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.url);
|
|
3057
|
+
if (message.width != null && Object.hasOwnProperty.call(message, "width"))
|
|
3058
|
+
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.width);
|
|
3059
|
+
if (message.height != null && Object.hasOwnProperty.call(message, "height"))
|
|
3060
|
+
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.height);
|
|
3061
|
+
return writer;
|
|
3062
|
+
};
|
|
3063
|
+
|
|
3064
|
+
/**
|
|
3065
|
+
* Encodes the specified MediaAttachment message, length delimited. Does not implicitly {@link ig.common.MediaAttachment.verify|verify} messages.
|
|
3066
|
+
* @function encodeDelimited
|
|
3067
|
+
* @memberof ig.common.MediaAttachment
|
|
3068
|
+
* @static
|
|
3069
|
+
* @param {ig.common.IMediaAttachment} message MediaAttachment message or plain object to encode
|
|
3070
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3071
|
+
* @returns {$protobuf.Writer} Writer
|
|
3072
|
+
*/
|
|
3073
|
+
MediaAttachment.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3074
|
+
return this.encode(message, writer).ldelim();
|
|
3075
|
+
};
|
|
3076
|
+
|
|
3077
|
+
/**
|
|
3078
|
+
* Decodes a MediaAttachment message from the specified reader or buffer.
|
|
3079
|
+
* @function decode
|
|
3080
|
+
* @memberof ig.common.MediaAttachment
|
|
3081
|
+
* @static
|
|
3082
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3083
|
+
* @param {number} [length] Message length if known beforehand
|
|
3084
|
+
* @returns {ig.common.MediaAttachment} MediaAttachment
|
|
3085
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3086
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3087
|
+
*/
|
|
3088
|
+
MediaAttachment.decode = function decode(reader, length, error) {
|
|
3089
|
+
if (!(reader instanceof $Reader))
|
|
3090
|
+
reader = $Reader.create(reader);
|
|
3091
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.common.MediaAttachment();
|
|
3092
|
+
while (reader.pos < end) {
|
|
3093
|
+
var tag = reader.uint32();
|
|
3094
|
+
if (tag === error)
|
|
3095
|
+
break;
|
|
3096
|
+
switch (tag >>> 3) {
|
|
3097
|
+
case 1: {
|
|
3098
|
+
message.mediaId = reader.int64();
|
|
3099
|
+
break;
|
|
3100
|
+
}
|
|
3101
|
+
case 2: {
|
|
3102
|
+
message.type = reader.string();
|
|
3103
|
+
break;
|
|
3104
|
+
}
|
|
3105
|
+
case 3: {
|
|
3106
|
+
message.url = reader.string();
|
|
3107
|
+
break;
|
|
3108
|
+
}
|
|
3109
|
+
case 4: {
|
|
3110
|
+
message.width = reader.int32();
|
|
3111
|
+
break;
|
|
3112
|
+
}
|
|
3113
|
+
case 5: {
|
|
3114
|
+
message.height = reader.int32();
|
|
3115
|
+
break;
|
|
3116
|
+
}
|
|
3117
|
+
default:
|
|
3118
|
+
reader.skipType(tag & 7);
|
|
3119
|
+
break;
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
return message;
|
|
3123
|
+
};
|
|
3124
|
+
|
|
3125
|
+
/**
|
|
3126
|
+
* Decodes a MediaAttachment message from the specified reader or buffer, length delimited.
|
|
3127
|
+
* @function decodeDelimited
|
|
3128
|
+
* @memberof ig.common.MediaAttachment
|
|
3129
|
+
* @static
|
|
3130
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3131
|
+
* @returns {ig.common.MediaAttachment} MediaAttachment
|
|
3132
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3133
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3134
|
+
*/
|
|
3135
|
+
MediaAttachment.decodeDelimited = function decodeDelimited(reader) {
|
|
3136
|
+
if (!(reader instanceof $Reader))
|
|
3137
|
+
reader = new $Reader(reader);
|
|
3138
|
+
return this.decode(reader, reader.uint32());
|
|
3139
|
+
};
|
|
3140
|
+
|
|
3141
|
+
/**
|
|
3142
|
+
* Verifies a MediaAttachment message.
|
|
3143
|
+
* @function verify
|
|
3144
|
+
* @memberof ig.common.MediaAttachment
|
|
3145
|
+
* @static
|
|
3146
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
3147
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
3148
|
+
*/
|
|
3149
|
+
MediaAttachment.verify = function verify(message) {
|
|
3150
|
+
if (typeof message !== "object" || message === null)
|
|
3151
|
+
return "object expected";
|
|
3152
|
+
if (message.mediaId != null && message.hasOwnProperty("mediaId"))
|
|
3153
|
+
if (!$util.isInteger(message.mediaId) && !(message.mediaId && $util.isInteger(message.mediaId.low) && $util.isInteger(message.mediaId.high)))
|
|
3154
|
+
return "mediaId: integer|Long expected";
|
|
3155
|
+
if (message.type != null && message.hasOwnProperty("type"))
|
|
3156
|
+
if (!$util.isString(message.type))
|
|
3157
|
+
return "type: string expected";
|
|
3158
|
+
if (message.url != null && message.hasOwnProperty("url"))
|
|
3159
|
+
if (!$util.isString(message.url))
|
|
3160
|
+
return "url: string expected";
|
|
3161
|
+
if (message.width != null && message.hasOwnProperty("width"))
|
|
3162
|
+
if (!$util.isInteger(message.width))
|
|
3163
|
+
return "width: integer expected";
|
|
3164
|
+
if (message.height != null && message.hasOwnProperty("height"))
|
|
3165
|
+
if (!$util.isInteger(message.height))
|
|
3166
|
+
return "height: integer expected";
|
|
3167
|
+
return null;
|
|
3168
|
+
};
|
|
3169
|
+
|
|
3170
|
+
/**
|
|
3171
|
+
* Creates a MediaAttachment message from a plain object. Also converts values to their respective internal types.
|
|
3172
|
+
* @function fromObject
|
|
3173
|
+
* @memberof ig.common.MediaAttachment
|
|
3174
|
+
* @static
|
|
3175
|
+
* @param {Object.<string,*>} object Plain object
|
|
3176
|
+
* @returns {ig.common.MediaAttachment} MediaAttachment
|
|
3177
|
+
*/
|
|
3178
|
+
MediaAttachment.fromObject = function fromObject(object) {
|
|
3179
|
+
if (object instanceof $root.ig.common.MediaAttachment)
|
|
3180
|
+
return object;
|
|
3181
|
+
var message = new $root.ig.common.MediaAttachment();
|
|
3182
|
+
if (object.mediaId != null)
|
|
3183
|
+
if ($util.Long)
|
|
3184
|
+
(message.mediaId = $util.Long.fromValue(object.mediaId)).unsigned = false;
|
|
3185
|
+
else if (typeof object.mediaId === "string")
|
|
3186
|
+
message.mediaId = parseInt(object.mediaId, 10);
|
|
3187
|
+
else if (typeof object.mediaId === "number")
|
|
3188
|
+
message.mediaId = object.mediaId;
|
|
3189
|
+
else if (typeof object.mediaId === "object")
|
|
3190
|
+
message.mediaId = new $util.LongBits(object.mediaId.low >>> 0, object.mediaId.high >>> 0).toNumber();
|
|
3191
|
+
if (object.type != null)
|
|
3192
|
+
message.type = String(object.type);
|
|
3193
|
+
if (object.url != null)
|
|
3194
|
+
message.url = String(object.url);
|
|
3195
|
+
if (object.width != null)
|
|
3196
|
+
message.width = object.width | 0;
|
|
3197
|
+
if (object.height != null)
|
|
3198
|
+
message.height = object.height | 0;
|
|
3199
|
+
return message;
|
|
3200
|
+
};
|
|
3201
|
+
|
|
3202
|
+
/**
|
|
3203
|
+
* Creates a plain object from a MediaAttachment message. Also converts values to other types if specified.
|
|
3204
|
+
* @function toObject
|
|
3205
|
+
* @memberof ig.common.MediaAttachment
|
|
3206
|
+
* @static
|
|
3207
|
+
* @param {ig.common.MediaAttachment} message MediaAttachment
|
|
3208
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
3209
|
+
* @returns {Object.<string,*>} Plain object
|
|
3210
|
+
*/
|
|
3211
|
+
MediaAttachment.toObject = function toObject(message, options) {
|
|
3212
|
+
if (!options)
|
|
3213
|
+
options = {};
|
|
3214
|
+
var object = {};
|
|
3215
|
+
if (options.defaults) {
|
|
3216
|
+
if ($util.Long) {
|
|
3217
|
+
var long = new $util.Long(0, 0, false);
|
|
3218
|
+
object.mediaId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
3219
|
+
} else
|
|
3220
|
+
object.mediaId = options.longs === String ? "0" : 0;
|
|
3221
|
+
object.type = "";
|
|
3222
|
+
object.url = "";
|
|
3223
|
+
object.width = 0;
|
|
3224
|
+
object.height = 0;
|
|
3225
|
+
}
|
|
3226
|
+
if (message.mediaId != null && message.hasOwnProperty("mediaId"))
|
|
3227
|
+
if (typeof message.mediaId === "number")
|
|
3228
|
+
object.mediaId = options.longs === String ? String(message.mediaId) : message.mediaId;
|
|
3229
|
+
else
|
|
3230
|
+
object.mediaId = options.longs === String ? $util.Long.prototype.toString.call(message.mediaId) : options.longs === Number ? new $util.LongBits(message.mediaId.low >>> 0, message.mediaId.high >>> 0).toNumber() : message.mediaId;
|
|
3231
|
+
if (message.type != null && message.hasOwnProperty("type"))
|
|
3232
|
+
object.type = message.type;
|
|
3233
|
+
if (message.url != null && message.hasOwnProperty("url"))
|
|
3234
|
+
object.url = message.url;
|
|
3235
|
+
if (message.width != null && message.hasOwnProperty("width"))
|
|
3236
|
+
object.width = message.width;
|
|
3237
|
+
if (message.height != null && message.hasOwnProperty("height"))
|
|
3238
|
+
object.height = message.height;
|
|
3239
|
+
return object;
|
|
3240
|
+
};
|
|
3241
|
+
|
|
3242
|
+
/**
|
|
3243
|
+
* Converts this MediaAttachment to JSON.
|
|
3244
|
+
* @function toJSON
|
|
3245
|
+
* @memberof ig.common.MediaAttachment
|
|
3246
|
+
* @instance
|
|
3247
|
+
* @returns {Object.<string,*>} JSON object
|
|
3248
|
+
*/
|
|
3249
|
+
MediaAttachment.prototype.toJSON = function toJSON() {
|
|
3250
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3251
|
+
};
|
|
3252
|
+
|
|
3253
|
+
/**
|
|
3254
|
+
* Gets the default type url for MediaAttachment
|
|
3255
|
+
* @function getTypeUrl
|
|
3256
|
+
* @memberof ig.common.MediaAttachment
|
|
3257
|
+
* @static
|
|
3258
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
3259
|
+
* @returns {string} The default type url
|
|
3260
|
+
*/
|
|
3261
|
+
MediaAttachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3262
|
+
if (typeUrlPrefix === undefined) {
|
|
3263
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
3264
|
+
}
|
|
3265
|
+
return typeUrlPrefix + "/ig.common.MediaAttachment";
|
|
3266
|
+
};
|
|
3267
|
+
|
|
3268
|
+
return MediaAttachment;
|
|
3269
|
+
})();
|
|
3270
|
+
|
|
3271
|
+
common.Link = (function() {
|
|
3272
|
+
|
|
3273
|
+
/**
|
|
3274
|
+
* Properties of a Link.
|
|
3275
|
+
* @memberof ig.common
|
|
3276
|
+
* @interface ILink
|
|
3277
|
+
* @property {string|null} [url] Link url
|
|
3278
|
+
* @property {string|null} [title] Link title
|
|
3279
|
+
* @property {string|null} [description] Link description
|
|
3280
|
+
* @property {string|null} [imageUrl] Link imageUrl
|
|
3281
|
+
*/
|
|
3282
|
+
|
|
3283
|
+
/**
|
|
3284
|
+
* Constructs a new Link.
|
|
3285
|
+
* @memberof ig.common
|
|
3286
|
+
* @classdesc Represents a Link.
|
|
3287
|
+
* @implements ILink
|
|
3288
|
+
* @constructor
|
|
3289
|
+
* @param {ig.common.ILink=} [properties] Properties to set
|
|
3290
|
+
*/
|
|
3291
|
+
function Link(properties) {
|
|
3292
|
+
if (properties)
|
|
3293
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3294
|
+
if (properties[keys[i]] != null)
|
|
3295
|
+
this[keys[i]] = properties[keys[i]];
|
|
3296
|
+
}
|
|
3297
|
+
|
|
3298
|
+
/**
|
|
3299
|
+
* Link url.
|
|
3300
|
+
* @member {string} url
|
|
3301
|
+
* @memberof ig.common.Link
|
|
3302
|
+
* @instance
|
|
3303
|
+
*/
|
|
3304
|
+
Link.prototype.url = "";
|
|
3305
|
+
|
|
3306
|
+
/**
|
|
3307
|
+
* Link title.
|
|
3308
|
+
* @member {string} title
|
|
3309
|
+
* @memberof ig.common.Link
|
|
3310
|
+
* @instance
|
|
3311
|
+
*/
|
|
3312
|
+
Link.prototype.title = "";
|
|
3313
|
+
|
|
3314
|
+
/**
|
|
3315
|
+
* Link description.
|
|
3316
|
+
* @member {string} description
|
|
3317
|
+
* @memberof ig.common.Link
|
|
3318
|
+
* @instance
|
|
3319
|
+
*/
|
|
3320
|
+
Link.prototype.description = "";
|
|
3321
|
+
|
|
3322
|
+
/**
|
|
3323
|
+
* Link imageUrl.
|
|
3324
|
+
* @member {string} imageUrl
|
|
3325
|
+
* @memberof ig.common.Link
|
|
3326
|
+
* @instance
|
|
3327
|
+
*/
|
|
3328
|
+
Link.prototype.imageUrl = "";
|
|
3329
|
+
|
|
3330
|
+
/**
|
|
3331
|
+
* Creates a new Link instance using the specified properties.
|
|
3332
|
+
* @function create
|
|
3333
|
+
* @memberof ig.common.Link
|
|
3334
|
+
* @static
|
|
3335
|
+
* @param {ig.common.ILink=} [properties] Properties to set
|
|
3336
|
+
* @returns {ig.common.Link} Link instance
|
|
3337
|
+
*/
|
|
3338
|
+
Link.create = function create(properties) {
|
|
3339
|
+
return new Link(properties);
|
|
3340
|
+
};
|
|
3341
|
+
|
|
3342
|
+
/**
|
|
3343
|
+
* Encodes the specified Link message. Does not implicitly {@link ig.common.Link.verify|verify} messages.
|
|
3344
|
+
* @function encode
|
|
3345
|
+
* @memberof ig.common.Link
|
|
3346
|
+
* @static
|
|
3347
|
+
* @param {ig.common.ILink} message Link message or plain object to encode
|
|
3348
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3349
|
+
* @returns {$protobuf.Writer} Writer
|
|
3350
|
+
*/
|
|
3351
|
+
Link.encode = function encode(message, writer) {
|
|
3352
|
+
if (!writer)
|
|
3353
|
+
writer = $Writer.create();
|
|
3354
|
+
if (message.url != null && Object.hasOwnProperty.call(message, "url"))
|
|
3355
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.url);
|
|
3356
|
+
if (message.title != null && Object.hasOwnProperty.call(message, "title"))
|
|
3357
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.title);
|
|
3358
|
+
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
3359
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);
|
|
3360
|
+
if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl"))
|
|
3361
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.imageUrl);
|
|
3362
|
+
return writer;
|
|
3363
|
+
};
|
|
3364
|
+
|
|
3365
|
+
/**
|
|
3366
|
+
* Encodes the specified Link message, length delimited. Does not implicitly {@link ig.common.Link.verify|verify} messages.
|
|
3367
|
+
* @function encodeDelimited
|
|
3368
|
+
* @memberof ig.common.Link
|
|
3369
|
+
* @static
|
|
3370
|
+
* @param {ig.common.ILink} message Link message or plain object to encode
|
|
3371
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3372
|
+
* @returns {$protobuf.Writer} Writer
|
|
3373
|
+
*/
|
|
3374
|
+
Link.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3375
|
+
return this.encode(message, writer).ldelim();
|
|
3376
|
+
};
|
|
3377
|
+
|
|
3378
|
+
/**
|
|
3379
|
+
* Decodes a Link message from the specified reader or buffer.
|
|
3380
|
+
* @function decode
|
|
3381
|
+
* @memberof ig.common.Link
|
|
3382
|
+
* @static
|
|
3383
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3384
|
+
* @param {number} [length] Message length if known beforehand
|
|
3385
|
+
* @returns {ig.common.Link} Link
|
|
3386
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3387
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3388
|
+
*/
|
|
3389
|
+
Link.decode = function decode(reader, length, error) {
|
|
3390
|
+
if (!(reader instanceof $Reader))
|
|
3391
|
+
reader = $Reader.create(reader);
|
|
3392
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ig.common.Link();
|
|
3393
|
+
while (reader.pos < end) {
|
|
3394
|
+
var tag = reader.uint32();
|
|
3395
|
+
if (tag === error)
|
|
3396
|
+
break;
|
|
3397
|
+
switch (tag >>> 3) {
|
|
3398
|
+
case 1: {
|
|
3399
|
+
message.url = reader.string();
|
|
3400
|
+
break;
|
|
3401
|
+
}
|
|
3402
|
+
case 2: {
|
|
3403
|
+
message.title = reader.string();
|
|
3404
|
+
break;
|
|
3405
|
+
}
|
|
3406
|
+
case 3: {
|
|
3407
|
+
message.description = reader.string();
|
|
3408
|
+
break;
|
|
3409
|
+
}
|
|
3410
|
+
case 4: {
|
|
3411
|
+
message.imageUrl = reader.string();
|
|
3412
|
+
break;
|
|
3413
|
+
}
|
|
3414
|
+
default:
|
|
3415
|
+
reader.skipType(tag & 7);
|
|
3416
|
+
break;
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
return message;
|
|
3420
|
+
};
|
|
3421
|
+
|
|
3422
|
+
/**
|
|
3423
|
+
* Decodes a Link message from the specified reader or buffer, length delimited.
|
|
3424
|
+
* @function decodeDelimited
|
|
3425
|
+
* @memberof ig.common.Link
|
|
3426
|
+
* @static
|
|
3427
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3428
|
+
* @returns {ig.common.Link} Link
|
|
3429
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3430
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3431
|
+
*/
|
|
3432
|
+
Link.decodeDelimited = function decodeDelimited(reader) {
|
|
3433
|
+
if (!(reader instanceof $Reader))
|
|
3434
|
+
reader = new $Reader(reader);
|
|
3435
|
+
return this.decode(reader, reader.uint32());
|
|
3436
|
+
};
|
|
3437
|
+
|
|
3438
|
+
/**
|
|
3439
|
+
* Verifies a Link message.
|
|
3440
|
+
* @function verify
|
|
3441
|
+
* @memberof ig.common.Link
|
|
3442
|
+
* @static
|
|
3443
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
3444
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
3445
|
+
*/
|
|
3446
|
+
Link.verify = function verify(message) {
|
|
3447
|
+
if (typeof message !== "object" || message === null)
|
|
3448
|
+
return "object expected";
|
|
3449
|
+
if (message.url != null && message.hasOwnProperty("url"))
|
|
3450
|
+
if (!$util.isString(message.url))
|
|
3451
|
+
return "url: string expected";
|
|
3452
|
+
if (message.title != null && message.hasOwnProperty("title"))
|
|
3453
|
+
if (!$util.isString(message.title))
|
|
3454
|
+
return "title: string expected";
|
|
3455
|
+
if (message.description != null && message.hasOwnProperty("description"))
|
|
3456
|
+
if (!$util.isString(message.description))
|
|
3457
|
+
return "description: string expected";
|
|
3458
|
+
if (message.imageUrl != null && message.hasOwnProperty("imageUrl"))
|
|
3459
|
+
if (!$util.isString(message.imageUrl))
|
|
3460
|
+
return "imageUrl: string expected";
|
|
3461
|
+
return null;
|
|
3462
|
+
};
|
|
3463
|
+
|
|
3464
|
+
/**
|
|
3465
|
+
* Creates a Link message from a plain object. Also converts values to their respective internal types.
|
|
3466
|
+
* @function fromObject
|
|
3467
|
+
* @memberof ig.common.Link
|
|
3468
|
+
* @static
|
|
3469
|
+
* @param {Object.<string,*>} object Plain object
|
|
3470
|
+
* @returns {ig.common.Link} Link
|
|
3471
|
+
*/
|
|
3472
|
+
Link.fromObject = function fromObject(object) {
|
|
3473
|
+
if (object instanceof $root.ig.common.Link)
|
|
3474
|
+
return object;
|
|
3475
|
+
var message = new $root.ig.common.Link();
|
|
3476
|
+
if (object.url != null)
|
|
3477
|
+
message.url = String(object.url);
|
|
3478
|
+
if (object.title != null)
|
|
3479
|
+
message.title = String(object.title);
|
|
3480
|
+
if (object.description != null)
|
|
3481
|
+
message.description = String(object.description);
|
|
3482
|
+
if (object.imageUrl != null)
|
|
3483
|
+
message.imageUrl = String(object.imageUrl);
|
|
3484
|
+
return message;
|
|
3485
|
+
};
|
|
3486
|
+
|
|
3487
|
+
/**
|
|
3488
|
+
* Creates a plain object from a Link message. Also converts values to other types if specified.
|
|
3489
|
+
* @function toObject
|
|
3490
|
+
* @memberof ig.common.Link
|
|
3491
|
+
* @static
|
|
3492
|
+
* @param {ig.common.Link} message Link
|
|
3493
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
3494
|
+
* @returns {Object.<string,*>} Plain object
|
|
3495
|
+
*/
|
|
3496
|
+
Link.toObject = function toObject(message, options) {
|
|
3497
|
+
if (!options)
|
|
3498
|
+
options = {};
|
|
3499
|
+
var object = {};
|
|
3500
|
+
if (options.defaults) {
|
|
3501
|
+
object.url = "";
|
|
3502
|
+
object.title = "";
|
|
3503
|
+
object.description = "";
|
|
3504
|
+
object.imageUrl = "";
|
|
3505
|
+
}
|
|
3506
|
+
if (message.url != null && message.hasOwnProperty("url"))
|
|
3507
|
+
object.url = message.url;
|
|
3508
|
+
if (message.title != null && message.hasOwnProperty("title"))
|
|
3509
|
+
object.title = message.title;
|
|
3510
|
+
if (message.description != null && message.hasOwnProperty("description"))
|
|
3511
|
+
object.description = message.description;
|
|
3512
|
+
if (message.imageUrl != null && message.hasOwnProperty("imageUrl"))
|
|
3513
|
+
object.imageUrl = message.imageUrl;
|
|
3514
|
+
return object;
|
|
3515
|
+
};
|
|
3516
|
+
|
|
3517
|
+
/**
|
|
3518
|
+
* Converts this Link to JSON.
|
|
3519
|
+
* @function toJSON
|
|
3520
|
+
* @memberof ig.common.Link
|
|
3521
|
+
* @instance
|
|
3522
|
+
* @returns {Object.<string,*>} JSON object
|
|
3523
|
+
*/
|
|
3524
|
+
Link.prototype.toJSON = function toJSON() {
|
|
3525
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3526
|
+
};
|
|
3527
|
+
|
|
3528
|
+
/**
|
|
3529
|
+
* Gets the default type url for Link
|
|
3530
|
+
* @function getTypeUrl
|
|
3531
|
+
* @memberof ig.common.Link
|
|
3532
|
+
* @static
|
|
3533
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
3534
|
+
* @returns {string} The default type url
|
|
3535
|
+
*/
|
|
3536
|
+
Link.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3537
|
+
if (typeUrlPrefix === undefined) {
|
|
3538
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
3539
|
+
}
|
|
3540
|
+
return typeUrlPrefix + "/ig.common.Link";
|
|
3541
|
+
};
|
|
3542
|
+
|
|
3543
|
+
return Link;
|
|
3544
|
+
})();
|
|
3545
|
+
|
|
3546
|
+
return common;
|
|
3547
|
+
})();
|
|
3548
|
+
|
|
3549
|
+
return ig;
|
|
3550
|
+
})();
|
|
3551
|
+
|
|
3552
|
+
module.exports = $root;
|