@headspace/protos-events 1.9.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/index.d.ts +856 -0
  2. package/lib/index.js +1908 -0
  3. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -9,6 +9,219 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut
9
9
  // Exported root namespace
10
10
  var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
11
11
 
12
+ $root.date = (function() {
13
+
14
+ /**
15
+ * Namespace date.
16
+ * @exports date
17
+ * @namespace
18
+ */
19
+ var date = {};
20
+
21
+ date.Date = (function() {
22
+
23
+ /**
24
+ * Properties of a Date.
25
+ * @memberof date
26
+ * @interface IDate
27
+ * @property {number|Long|null} [epochMilliseconds] Date epochMilliseconds
28
+ */
29
+
30
+ /**
31
+ * Constructs a new Date.
32
+ * @memberof date
33
+ * @classdesc Represents a Date.
34
+ * @implements IDate
35
+ * @constructor
36
+ * @param {date.IDate=} [properties] Properties to set
37
+ */
38
+ function Date(properties) {
39
+ if (properties)
40
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
41
+ if (properties[keys[i]] != null)
42
+ this[keys[i]] = properties[keys[i]];
43
+ }
44
+
45
+ /**
46
+ * Date epochMilliseconds.
47
+ * @member {number|Long} epochMilliseconds
48
+ * @memberof date.Date
49
+ * @instance
50
+ */
51
+ Date.prototype.epochMilliseconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
52
+
53
+ /**
54
+ * Creates a new Date instance using the specified properties.
55
+ * @function create
56
+ * @memberof date.Date
57
+ * @static
58
+ * @param {date.IDate=} [properties] Properties to set
59
+ * @returns {date.Date} Date instance
60
+ */
61
+ Date.create = function create(properties) {
62
+ return new Date(properties);
63
+ };
64
+
65
+ /**
66
+ * Encodes the specified Date message. Does not implicitly {@link date.Date.verify|verify} messages.
67
+ * @function encode
68
+ * @memberof date.Date
69
+ * @static
70
+ * @param {date.IDate} message Date message or plain object to encode
71
+ * @param {$protobuf.Writer} [writer] Writer to encode to
72
+ * @returns {$protobuf.Writer} Writer
73
+ */
74
+ Date.encode = function encode(message, writer) {
75
+ if (!writer)
76
+ writer = $Writer.create();
77
+ if (message.epochMilliseconds != null && message.hasOwnProperty("epochMilliseconds"))
78
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.epochMilliseconds);
79
+ return writer;
80
+ };
81
+
82
+ /**
83
+ * Encodes the specified Date message, length delimited. Does not implicitly {@link date.Date.verify|verify} messages.
84
+ * @function encodeDelimited
85
+ * @memberof date.Date
86
+ * @static
87
+ * @param {date.IDate} message Date message or plain object to encode
88
+ * @param {$protobuf.Writer} [writer] Writer to encode to
89
+ * @returns {$protobuf.Writer} Writer
90
+ */
91
+ Date.encodeDelimited = function encodeDelimited(message, writer) {
92
+ return this.encode(message, writer).ldelim();
93
+ };
94
+
95
+ /**
96
+ * Decodes a Date message from the specified reader or buffer.
97
+ * @function decode
98
+ * @memberof date.Date
99
+ * @static
100
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
101
+ * @param {number} [length] Message length if known beforehand
102
+ * @returns {date.Date} Date
103
+ * @throws {Error} If the payload is not a reader or valid buffer
104
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
105
+ */
106
+ Date.decode = function decode(reader, length) {
107
+ if (!(reader instanceof $Reader))
108
+ reader = $Reader.create(reader);
109
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.date.Date();
110
+ while (reader.pos < end) {
111
+ var tag = reader.uint32();
112
+ switch (tag >>> 3) {
113
+ case 1:
114
+ message.epochMilliseconds = reader.int64();
115
+ break;
116
+ default:
117
+ reader.skipType(tag & 7);
118
+ break;
119
+ }
120
+ }
121
+ return message;
122
+ };
123
+
124
+ /**
125
+ * Decodes a Date message from the specified reader or buffer, length delimited.
126
+ * @function decodeDelimited
127
+ * @memberof date.Date
128
+ * @static
129
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
130
+ * @returns {date.Date} Date
131
+ * @throws {Error} If the payload is not a reader or valid buffer
132
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
133
+ */
134
+ Date.decodeDelimited = function decodeDelimited(reader) {
135
+ if (!(reader instanceof $Reader))
136
+ reader = new $Reader(reader);
137
+ return this.decode(reader, reader.uint32());
138
+ };
139
+
140
+ /**
141
+ * Verifies a Date message.
142
+ * @function verify
143
+ * @memberof date.Date
144
+ * @static
145
+ * @param {Object.<string,*>} message Plain object to verify
146
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
147
+ */
148
+ Date.verify = function verify(message) {
149
+ if (typeof message !== "object" || message === null)
150
+ return "object expected";
151
+ if (message.epochMilliseconds != null && message.hasOwnProperty("epochMilliseconds"))
152
+ if (!$util.isInteger(message.epochMilliseconds) && !(message.epochMilliseconds && $util.isInteger(message.epochMilliseconds.low) && $util.isInteger(message.epochMilliseconds.high)))
153
+ return "epochMilliseconds: integer|Long expected";
154
+ return null;
155
+ };
156
+
157
+ /**
158
+ * Creates a Date message from a plain object. Also converts values to their respective internal types.
159
+ * @function fromObject
160
+ * @memberof date.Date
161
+ * @static
162
+ * @param {Object.<string,*>} object Plain object
163
+ * @returns {date.Date} Date
164
+ */
165
+ Date.fromObject = function fromObject(object) {
166
+ if (object instanceof $root.date.Date)
167
+ return object;
168
+ var message = new $root.date.Date();
169
+ if (object.epochMilliseconds != null)
170
+ if ($util.Long)
171
+ (message.epochMilliseconds = $util.Long.fromValue(object.epochMilliseconds)).unsigned = false;
172
+ else if (typeof object.epochMilliseconds === "string")
173
+ message.epochMilliseconds = parseInt(object.epochMilliseconds, 10);
174
+ else if (typeof object.epochMilliseconds === "number")
175
+ message.epochMilliseconds = object.epochMilliseconds;
176
+ else if (typeof object.epochMilliseconds === "object")
177
+ message.epochMilliseconds = new $util.LongBits(object.epochMilliseconds.low >>> 0, object.epochMilliseconds.high >>> 0).toNumber();
178
+ return message;
179
+ };
180
+
181
+ /**
182
+ * Creates a plain object from a Date message. Also converts values to other types if specified.
183
+ * @function toObject
184
+ * @memberof date.Date
185
+ * @static
186
+ * @param {date.Date} message Date
187
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
188
+ * @returns {Object.<string,*>} Plain object
189
+ */
190
+ Date.toObject = function toObject(message, options) {
191
+ if (!options)
192
+ options = {};
193
+ var object = {};
194
+ if (options.defaults)
195
+ if ($util.Long) {
196
+ var long = new $util.Long(0, 0, false);
197
+ object.epochMilliseconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
198
+ } else
199
+ object.epochMilliseconds = options.longs === String ? "0" : 0;
200
+ if (message.epochMilliseconds != null && message.hasOwnProperty("epochMilliseconds"))
201
+ if (typeof message.epochMilliseconds === "number")
202
+ object.epochMilliseconds = options.longs === String ? String(message.epochMilliseconds) : message.epochMilliseconds;
203
+ else
204
+ object.epochMilliseconds = options.longs === String ? $util.Long.prototype.toString.call(message.epochMilliseconds) : options.longs === Number ? new $util.LongBits(message.epochMilliseconds.low >>> 0, message.epochMilliseconds.high >>> 0).toNumber() : message.epochMilliseconds;
205
+ return object;
206
+ };
207
+
208
+ /**
209
+ * Converts this Date to JSON.
210
+ * @function toJSON
211
+ * @memberof date.Date
212
+ * @instance
213
+ * @returns {Object.<string,*>} JSON object
214
+ */
215
+ Date.prototype.toJSON = function toJSON() {
216
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
217
+ };
218
+
219
+ return Date;
220
+ })();
221
+
222
+ return date;
223
+ })();
224
+
12
225
  $root.subscription = (function() {
13
226
 
14
227
  /**
@@ -48,6 +261,1514 @@ $root.subscription = (function() {
48
261
  return values;
49
262
  })();
50
263
 
264
+ subscription.SubscriptionGrpcManager = (function() {
265
+
266
+ /**
267
+ * Constructs a new SubscriptionGrpcManager service.
268
+ * @memberof subscription
269
+ * @classdesc Represents a SubscriptionGrpcManager
270
+ * @extends $protobuf.rpc.Service
271
+ * @constructor
272
+ * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
273
+ * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
274
+ * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
275
+ */
276
+ function SubscriptionGrpcManager(rpcImpl, requestDelimited, responseDelimited) {
277
+ $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
278
+ }
279
+
280
+ (SubscriptionGrpcManager.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SubscriptionGrpcManager;
281
+
282
+ /**
283
+ * Creates new SubscriptionGrpcManager service using the specified rpc implementation.
284
+ * @function create
285
+ * @memberof subscription.SubscriptionGrpcManager
286
+ * @static
287
+ * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
288
+ * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
289
+ * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
290
+ * @returns {SubscriptionGrpcManager} RPC service. Useful where requests and/or responses are streamed.
291
+ */
292
+ SubscriptionGrpcManager.create = function create(rpcImpl, requestDelimited, responseDelimited) {
293
+ return new this(rpcImpl, requestDelimited, responseDelimited);
294
+ };
295
+
296
+ /**
297
+ * Callback as used by {@link subscription.SubscriptionGrpcManager#findSubscriptions}.
298
+ * @memberof subscription.SubscriptionGrpcManager
299
+ * @typedef findSubscriptionsCallback
300
+ * @type {function}
301
+ * @param {Error|null} error Error, if any
302
+ * @param {subscription.ManySubscriptionsResponse} [response] ManySubscriptionsResponse
303
+ */
304
+
305
+ /**
306
+ * Calls findSubscriptions.
307
+ * @function findSubscriptions
308
+ * @memberof subscription.SubscriptionGrpcManager
309
+ * @instance
310
+ * @param {subscription.IFindAllSubscriptionsRequest} request FindAllSubscriptionsRequest message or plain object
311
+ * @param {subscription.SubscriptionGrpcManager.findSubscriptionsCallback} callback Node-style callback called with the error, if any, and ManySubscriptionsResponse
312
+ * @returns {undefined}
313
+ * @variation 1
314
+ */
315
+ Object.defineProperty(SubscriptionGrpcManager.prototype.findSubscriptions = function findSubscriptions(request, callback) {
316
+ return this.rpcCall(findSubscriptions, $root.subscription.FindAllSubscriptionsRequest, $root.subscription.ManySubscriptionsResponse, request, callback);
317
+ }, "name", { value: "findSubscriptions" });
318
+
319
+ /**
320
+ * Calls findSubscriptions.
321
+ * @function findSubscriptions
322
+ * @memberof subscription.SubscriptionGrpcManager
323
+ * @instance
324
+ * @param {subscription.IFindAllSubscriptionsRequest} request FindAllSubscriptionsRequest message or plain object
325
+ * @returns {Promise<subscription.ManySubscriptionsResponse>} Promise
326
+ * @variation 2
327
+ */
328
+
329
+ /**
330
+ * Callback as used by {@link subscription.SubscriptionGrpcManager#findCurrentSubscription}.
331
+ * @memberof subscription.SubscriptionGrpcManager
332
+ * @typedef findCurrentSubscriptionCallback
333
+ * @type {function}
334
+ * @param {Error|null} error Error, if any
335
+ * @param {subscription.OneSubscriptionResponse} [response] OneSubscriptionResponse
336
+ */
337
+
338
+ /**
339
+ * Calls findCurrentSubscription.
340
+ * @function findCurrentSubscription
341
+ * @memberof subscription.SubscriptionGrpcManager
342
+ * @instance
343
+ * @param {subscription.IFindCurrentSubscriptionRequest} request FindCurrentSubscriptionRequest message or plain object
344
+ * @param {subscription.SubscriptionGrpcManager.findCurrentSubscriptionCallback} callback Node-style callback called with the error, if any, and OneSubscriptionResponse
345
+ * @returns {undefined}
346
+ * @variation 1
347
+ */
348
+ Object.defineProperty(SubscriptionGrpcManager.prototype.findCurrentSubscription = function findCurrentSubscription(request, callback) {
349
+ return this.rpcCall(findCurrentSubscription, $root.subscription.FindCurrentSubscriptionRequest, $root.subscription.OneSubscriptionResponse, request, callback);
350
+ }, "name", { value: "findCurrentSubscription" });
351
+
352
+ /**
353
+ * Calls findCurrentSubscription.
354
+ * @function findCurrentSubscription
355
+ * @memberof subscription.SubscriptionGrpcManager
356
+ * @instance
357
+ * @param {subscription.IFindCurrentSubscriptionRequest} request FindCurrentSubscriptionRequest message or plain object
358
+ * @returns {Promise<subscription.OneSubscriptionResponse>} Promise
359
+ * @variation 2
360
+ */
361
+
362
+ return SubscriptionGrpcManager;
363
+ })();
364
+
365
+ subscription.FindAllSubscriptionsRequest = (function() {
366
+
367
+ /**
368
+ * Properties of a FindAllSubscriptionsRequest.
369
+ * @memberof subscription
370
+ * @interface IFindAllSubscriptionsRequest
371
+ * @property {string|null} [userId] FindAllSubscriptionsRequest userId
372
+ */
373
+
374
+ /**
375
+ * Constructs a new FindAllSubscriptionsRequest.
376
+ * @memberof subscription
377
+ * @classdesc Represents a FindAllSubscriptionsRequest.
378
+ * @implements IFindAllSubscriptionsRequest
379
+ * @constructor
380
+ * @param {subscription.IFindAllSubscriptionsRequest=} [properties] Properties to set
381
+ */
382
+ function FindAllSubscriptionsRequest(properties) {
383
+ if (properties)
384
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
385
+ if (properties[keys[i]] != null)
386
+ this[keys[i]] = properties[keys[i]];
387
+ }
388
+
389
+ /**
390
+ * FindAllSubscriptionsRequest userId.
391
+ * @member {string} userId
392
+ * @memberof subscription.FindAllSubscriptionsRequest
393
+ * @instance
394
+ */
395
+ FindAllSubscriptionsRequest.prototype.userId = "";
396
+
397
+ /**
398
+ * Creates a new FindAllSubscriptionsRequest instance using the specified properties.
399
+ * @function create
400
+ * @memberof subscription.FindAllSubscriptionsRequest
401
+ * @static
402
+ * @param {subscription.IFindAllSubscriptionsRequest=} [properties] Properties to set
403
+ * @returns {subscription.FindAllSubscriptionsRequest} FindAllSubscriptionsRequest instance
404
+ */
405
+ FindAllSubscriptionsRequest.create = function create(properties) {
406
+ return new FindAllSubscriptionsRequest(properties);
407
+ };
408
+
409
+ /**
410
+ * Encodes the specified FindAllSubscriptionsRequest message. Does not implicitly {@link subscription.FindAllSubscriptionsRequest.verify|verify} messages.
411
+ * @function encode
412
+ * @memberof subscription.FindAllSubscriptionsRequest
413
+ * @static
414
+ * @param {subscription.IFindAllSubscriptionsRequest} message FindAllSubscriptionsRequest message or plain object to encode
415
+ * @param {$protobuf.Writer} [writer] Writer to encode to
416
+ * @returns {$protobuf.Writer} Writer
417
+ */
418
+ FindAllSubscriptionsRequest.encode = function encode(message, writer) {
419
+ if (!writer)
420
+ writer = $Writer.create();
421
+ if (message.userId != null && message.hasOwnProperty("userId"))
422
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
423
+ return writer;
424
+ };
425
+
426
+ /**
427
+ * Encodes the specified FindAllSubscriptionsRequest message, length delimited. Does not implicitly {@link subscription.FindAllSubscriptionsRequest.verify|verify} messages.
428
+ * @function encodeDelimited
429
+ * @memberof subscription.FindAllSubscriptionsRequest
430
+ * @static
431
+ * @param {subscription.IFindAllSubscriptionsRequest} message FindAllSubscriptionsRequest message or plain object to encode
432
+ * @param {$protobuf.Writer} [writer] Writer to encode to
433
+ * @returns {$protobuf.Writer} Writer
434
+ */
435
+ FindAllSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) {
436
+ return this.encode(message, writer).ldelim();
437
+ };
438
+
439
+ /**
440
+ * Decodes a FindAllSubscriptionsRequest message from the specified reader or buffer.
441
+ * @function decode
442
+ * @memberof subscription.FindAllSubscriptionsRequest
443
+ * @static
444
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
445
+ * @param {number} [length] Message length if known beforehand
446
+ * @returns {subscription.FindAllSubscriptionsRequest} FindAllSubscriptionsRequest
447
+ * @throws {Error} If the payload is not a reader or valid buffer
448
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
449
+ */
450
+ FindAllSubscriptionsRequest.decode = function decode(reader, length) {
451
+ if (!(reader instanceof $Reader))
452
+ reader = $Reader.create(reader);
453
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.subscription.FindAllSubscriptionsRequest();
454
+ while (reader.pos < end) {
455
+ var tag = reader.uint32();
456
+ switch (tag >>> 3) {
457
+ case 1:
458
+ message.userId = reader.string();
459
+ break;
460
+ default:
461
+ reader.skipType(tag & 7);
462
+ break;
463
+ }
464
+ }
465
+ return message;
466
+ };
467
+
468
+ /**
469
+ * Decodes a FindAllSubscriptionsRequest message from the specified reader or buffer, length delimited.
470
+ * @function decodeDelimited
471
+ * @memberof subscription.FindAllSubscriptionsRequest
472
+ * @static
473
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
474
+ * @returns {subscription.FindAllSubscriptionsRequest} FindAllSubscriptionsRequest
475
+ * @throws {Error} If the payload is not a reader or valid buffer
476
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
477
+ */
478
+ FindAllSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) {
479
+ if (!(reader instanceof $Reader))
480
+ reader = new $Reader(reader);
481
+ return this.decode(reader, reader.uint32());
482
+ };
483
+
484
+ /**
485
+ * Verifies a FindAllSubscriptionsRequest message.
486
+ * @function verify
487
+ * @memberof subscription.FindAllSubscriptionsRequest
488
+ * @static
489
+ * @param {Object.<string,*>} message Plain object to verify
490
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
491
+ */
492
+ FindAllSubscriptionsRequest.verify = function verify(message) {
493
+ if (typeof message !== "object" || message === null)
494
+ return "object expected";
495
+ if (message.userId != null && message.hasOwnProperty("userId"))
496
+ if (!$util.isString(message.userId))
497
+ return "userId: string expected";
498
+ return null;
499
+ };
500
+
501
+ /**
502
+ * Creates a FindAllSubscriptionsRequest message from a plain object. Also converts values to their respective internal types.
503
+ * @function fromObject
504
+ * @memberof subscription.FindAllSubscriptionsRequest
505
+ * @static
506
+ * @param {Object.<string,*>} object Plain object
507
+ * @returns {subscription.FindAllSubscriptionsRequest} FindAllSubscriptionsRequest
508
+ */
509
+ FindAllSubscriptionsRequest.fromObject = function fromObject(object) {
510
+ if (object instanceof $root.subscription.FindAllSubscriptionsRequest)
511
+ return object;
512
+ var message = new $root.subscription.FindAllSubscriptionsRequest();
513
+ if (object.userId != null)
514
+ message.userId = String(object.userId);
515
+ return message;
516
+ };
517
+
518
+ /**
519
+ * Creates a plain object from a FindAllSubscriptionsRequest message. Also converts values to other types if specified.
520
+ * @function toObject
521
+ * @memberof subscription.FindAllSubscriptionsRequest
522
+ * @static
523
+ * @param {subscription.FindAllSubscriptionsRequest} message FindAllSubscriptionsRequest
524
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
525
+ * @returns {Object.<string,*>} Plain object
526
+ */
527
+ FindAllSubscriptionsRequest.toObject = function toObject(message, options) {
528
+ if (!options)
529
+ options = {};
530
+ var object = {};
531
+ if (options.defaults)
532
+ object.userId = "";
533
+ if (message.userId != null && message.hasOwnProperty("userId"))
534
+ object.userId = message.userId;
535
+ return object;
536
+ };
537
+
538
+ /**
539
+ * Converts this FindAllSubscriptionsRequest to JSON.
540
+ * @function toJSON
541
+ * @memberof subscription.FindAllSubscriptionsRequest
542
+ * @instance
543
+ * @returns {Object.<string,*>} JSON object
544
+ */
545
+ FindAllSubscriptionsRequest.prototype.toJSON = function toJSON() {
546
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
547
+ };
548
+
549
+ return FindAllSubscriptionsRequest;
550
+ })();
551
+
552
+ subscription.FindCurrentSubscriptionRequest = (function() {
553
+
554
+ /**
555
+ * Properties of a FindCurrentSubscriptionRequest.
556
+ * @memberof subscription
557
+ * @interface IFindCurrentSubscriptionRequest
558
+ * @property {string|null} [userId] FindCurrentSubscriptionRequest userId
559
+ */
560
+
561
+ /**
562
+ * Constructs a new FindCurrentSubscriptionRequest.
563
+ * @memberof subscription
564
+ * @classdesc Represents a FindCurrentSubscriptionRequest.
565
+ * @implements IFindCurrentSubscriptionRequest
566
+ * @constructor
567
+ * @param {subscription.IFindCurrentSubscriptionRequest=} [properties] Properties to set
568
+ */
569
+ function FindCurrentSubscriptionRequest(properties) {
570
+ if (properties)
571
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
572
+ if (properties[keys[i]] != null)
573
+ this[keys[i]] = properties[keys[i]];
574
+ }
575
+
576
+ /**
577
+ * FindCurrentSubscriptionRequest userId.
578
+ * @member {string} userId
579
+ * @memberof subscription.FindCurrentSubscriptionRequest
580
+ * @instance
581
+ */
582
+ FindCurrentSubscriptionRequest.prototype.userId = "";
583
+
584
+ /**
585
+ * Creates a new FindCurrentSubscriptionRequest instance using the specified properties.
586
+ * @function create
587
+ * @memberof subscription.FindCurrentSubscriptionRequest
588
+ * @static
589
+ * @param {subscription.IFindCurrentSubscriptionRequest=} [properties] Properties to set
590
+ * @returns {subscription.FindCurrentSubscriptionRequest} FindCurrentSubscriptionRequest instance
591
+ */
592
+ FindCurrentSubscriptionRequest.create = function create(properties) {
593
+ return new FindCurrentSubscriptionRequest(properties);
594
+ };
595
+
596
+ /**
597
+ * Encodes the specified FindCurrentSubscriptionRequest message. Does not implicitly {@link subscription.FindCurrentSubscriptionRequest.verify|verify} messages.
598
+ * @function encode
599
+ * @memberof subscription.FindCurrentSubscriptionRequest
600
+ * @static
601
+ * @param {subscription.IFindCurrentSubscriptionRequest} message FindCurrentSubscriptionRequest message or plain object to encode
602
+ * @param {$protobuf.Writer} [writer] Writer to encode to
603
+ * @returns {$protobuf.Writer} Writer
604
+ */
605
+ FindCurrentSubscriptionRequest.encode = function encode(message, writer) {
606
+ if (!writer)
607
+ writer = $Writer.create();
608
+ if (message.userId != null && message.hasOwnProperty("userId"))
609
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
610
+ return writer;
611
+ };
612
+
613
+ /**
614
+ * Encodes the specified FindCurrentSubscriptionRequest message, length delimited. Does not implicitly {@link subscription.FindCurrentSubscriptionRequest.verify|verify} messages.
615
+ * @function encodeDelimited
616
+ * @memberof subscription.FindCurrentSubscriptionRequest
617
+ * @static
618
+ * @param {subscription.IFindCurrentSubscriptionRequest} message FindCurrentSubscriptionRequest message or plain object to encode
619
+ * @param {$protobuf.Writer} [writer] Writer to encode to
620
+ * @returns {$protobuf.Writer} Writer
621
+ */
622
+ FindCurrentSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) {
623
+ return this.encode(message, writer).ldelim();
624
+ };
625
+
626
+ /**
627
+ * Decodes a FindCurrentSubscriptionRequest message from the specified reader or buffer.
628
+ * @function decode
629
+ * @memberof subscription.FindCurrentSubscriptionRequest
630
+ * @static
631
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
632
+ * @param {number} [length] Message length if known beforehand
633
+ * @returns {subscription.FindCurrentSubscriptionRequest} FindCurrentSubscriptionRequest
634
+ * @throws {Error} If the payload is not a reader or valid buffer
635
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
636
+ */
637
+ FindCurrentSubscriptionRequest.decode = function decode(reader, length) {
638
+ if (!(reader instanceof $Reader))
639
+ reader = $Reader.create(reader);
640
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.subscription.FindCurrentSubscriptionRequest();
641
+ while (reader.pos < end) {
642
+ var tag = reader.uint32();
643
+ switch (tag >>> 3) {
644
+ case 1:
645
+ message.userId = reader.string();
646
+ break;
647
+ default:
648
+ reader.skipType(tag & 7);
649
+ break;
650
+ }
651
+ }
652
+ return message;
653
+ };
654
+
655
+ /**
656
+ * Decodes a FindCurrentSubscriptionRequest message from the specified reader or buffer, length delimited.
657
+ * @function decodeDelimited
658
+ * @memberof subscription.FindCurrentSubscriptionRequest
659
+ * @static
660
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
661
+ * @returns {subscription.FindCurrentSubscriptionRequest} FindCurrentSubscriptionRequest
662
+ * @throws {Error} If the payload is not a reader or valid buffer
663
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
664
+ */
665
+ FindCurrentSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) {
666
+ if (!(reader instanceof $Reader))
667
+ reader = new $Reader(reader);
668
+ return this.decode(reader, reader.uint32());
669
+ };
670
+
671
+ /**
672
+ * Verifies a FindCurrentSubscriptionRequest message.
673
+ * @function verify
674
+ * @memberof subscription.FindCurrentSubscriptionRequest
675
+ * @static
676
+ * @param {Object.<string,*>} message Plain object to verify
677
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
678
+ */
679
+ FindCurrentSubscriptionRequest.verify = function verify(message) {
680
+ if (typeof message !== "object" || message === null)
681
+ return "object expected";
682
+ if (message.userId != null && message.hasOwnProperty("userId"))
683
+ if (!$util.isString(message.userId))
684
+ return "userId: string expected";
685
+ return null;
686
+ };
687
+
688
+ /**
689
+ * Creates a FindCurrentSubscriptionRequest message from a plain object. Also converts values to their respective internal types.
690
+ * @function fromObject
691
+ * @memberof subscription.FindCurrentSubscriptionRequest
692
+ * @static
693
+ * @param {Object.<string,*>} object Plain object
694
+ * @returns {subscription.FindCurrentSubscriptionRequest} FindCurrentSubscriptionRequest
695
+ */
696
+ FindCurrentSubscriptionRequest.fromObject = function fromObject(object) {
697
+ if (object instanceof $root.subscription.FindCurrentSubscriptionRequest)
698
+ return object;
699
+ var message = new $root.subscription.FindCurrentSubscriptionRequest();
700
+ if (object.userId != null)
701
+ message.userId = String(object.userId);
702
+ return message;
703
+ };
704
+
705
+ /**
706
+ * Creates a plain object from a FindCurrentSubscriptionRequest message. Also converts values to other types if specified.
707
+ * @function toObject
708
+ * @memberof subscription.FindCurrentSubscriptionRequest
709
+ * @static
710
+ * @param {subscription.FindCurrentSubscriptionRequest} message FindCurrentSubscriptionRequest
711
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
712
+ * @returns {Object.<string,*>} Plain object
713
+ */
714
+ FindCurrentSubscriptionRequest.toObject = function toObject(message, options) {
715
+ if (!options)
716
+ options = {};
717
+ var object = {};
718
+ if (options.defaults)
719
+ object.userId = "";
720
+ if (message.userId != null && message.hasOwnProperty("userId"))
721
+ object.userId = message.userId;
722
+ return object;
723
+ };
724
+
725
+ /**
726
+ * Converts this FindCurrentSubscriptionRequest to JSON.
727
+ * @function toJSON
728
+ * @memberof subscription.FindCurrentSubscriptionRequest
729
+ * @instance
730
+ * @returns {Object.<string,*>} JSON object
731
+ */
732
+ FindCurrentSubscriptionRequest.prototype.toJSON = function toJSON() {
733
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
734
+ };
735
+
736
+ return FindCurrentSubscriptionRequest;
737
+ })();
738
+
739
+ subscription.ManySubscriptionsResponse = (function() {
740
+
741
+ /**
742
+ * Properties of a ManySubscriptionsResponse.
743
+ * @memberof subscription
744
+ * @interface IManySubscriptionsResponse
745
+ * @property {Array.<subscription.ISubscription>|null} [subscriptions] ManySubscriptionsResponse subscriptions
746
+ */
747
+
748
+ /**
749
+ * Constructs a new ManySubscriptionsResponse.
750
+ * @memberof subscription
751
+ * @classdesc Represents a ManySubscriptionsResponse.
752
+ * @implements IManySubscriptionsResponse
753
+ * @constructor
754
+ * @param {subscription.IManySubscriptionsResponse=} [properties] Properties to set
755
+ */
756
+ function ManySubscriptionsResponse(properties) {
757
+ this.subscriptions = [];
758
+ if (properties)
759
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
760
+ if (properties[keys[i]] != null)
761
+ this[keys[i]] = properties[keys[i]];
762
+ }
763
+
764
+ /**
765
+ * ManySubscriptionsResponse subscriptions.
766
+ * @member {Array.<subscription.ISubscription>} subscriptions
767
+ * @memberof subscription.ManySubscriptionsResponse
768
+ * @instance
769
+ */
770
+ ManySubscriptionsResponse.prototype.subscriptions = $util.emptyArray;
771
+
772
+ /**
773
+ * Creates a new ManySubscriptionsResponse instance using the specified properties.
774
+ * @function create
775
+ * @memberof subscription.ManySubscriptionsResponse
776
+ * @static
777
+ * @param {subscription.IManySubscriptionsResponse=} [properties] Properties to set
778
+ * @returns {subscription.ManySubscriptionsResponse} ManySubscriptionsResponse instance
779
+ */
780
+ ManySubscriptionsResponse.create = function create(properties) {
781
+ return new ManySubscriptionsResponse(properties);
782
+ };
783
+
784
+ /**
785
+ * Encodes the specified ManySubscriptionsResponse message. Does not implicitly {@link subscription.ManySubscriptionsResponse.verify|verify} messages.
786
+ * @function encode
787
+ * @memberof subscription.ManySubscriptionsResponse
788
+ * @static
789
+ * @param {subscription.IManySubscriptionsResponse} message ManySubscriptionsResponse message or plain object to encode
790
+ * @param {$protobuf.Writer} [writer] Writer to encode to
791
+ * @returns {$protobuf.Writer} Writer
792
+ */
793
+ ManySubscriptionsResponse.encode = function encode(message, writer) {
794
+ if (!writer)
795
+ writer = $Writer.create();
796
+ if (message.subscriptions != null && message.subscriptions.length)
797
+ for (var i = 0; i < message.subscriptions.length; ++i)
798
+ $root.subscription.Subscription.encode(message.subscriptions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
799
+ return writer;
800
+ };
801
+
802
+ /**
803
+ * Encodes the specified ManySubscriptionsResponse message, length delimited. Does not implicitly {@link subscription.ManySubscriptionsResponse.verify|verify} messages.
804
+ * @function encodeDelimited
805
+ * @memberof subscription.ManySubscriptionsResponse
806
+ * @static
807
+ * @param {subscription.IManySubscriptionsResponse} message ManySubscriptionsResponse message or plain object to encode
808
+ * @param {$protobuf.Writer} [writer] Writer to encode to
809
+ * @returns {$protobuf.Writer} Writer
810
+ */
811
+ ManySubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) {
812
+ return this.encode(message, writer).ldelim();
813
+ };
814
+
815
+ /**
816
+ * Decodes a ManySubscriptionsResponse message from the specified reader or buffer.
817
+ * @function decode
818
+ * @memberof subscription.ManySubscriptionsResponse
819
+ * @static
820
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
821
+ * @param {number} [length] Message length if known beforehand
822
+ * @returns {subscription.ManySubscriptionsResponse} ManySubscriptionsResponse
823
+ * @throws {Error} If the payload is not a reader or valid buffer
824
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
825
+ */
826
+ ManySubscriptionsResponse.decode = function decode(reader, length) {
827
+ if (!(reader instanceof $Reader))
828
+ reader = $Reader.create(reader);
829
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.subscription.ManySubscriptionsResponse();
830
+ while (reader.pos < end) {
831
+ var tag = reader.uint32();
832
+ switch (tag >>> 3) {
833
+ case 1:
834
+ if (!(message.subscriptions && message.subscriptions.length))
835
+ message.subscriptions = [];
836
+ message.subscriptions.push($root.subscription.Subscription.decode(reader, reader.uint32()));
837
+ break;
838
+ default:
839
+ reader.skipType(tag & 7);
840
+ break;
841
+ }
842
+ }
843
+ return message;
844
+ };
845
+
846
+ /**
847
+ * Decodes a ManySubscriptionsResponse message from the specified reader or buffer, length delimited.
848
+ * @function decodeDelimited
849
+ * @memberof subscription.ManySubscriptionsResponse
850
+ * @static
851
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
852
+ * @returns {subscription.ManySubscriptionsResponse} ManySubscriptionsResponse
853
+ * @throws {Error} If the payload is not a reader or valid buffer
854
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
855
+ */
856
+ ManySubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) {
857
+ if (!(reader instanceof $Reader))
858
+ reader = new $Reader(reader);
859
+ return this.decode(reader, reader.uint32());
860
+ };
861
+
862
+ /**
863
+ * Verifies a ManySubscriptionsResponse message.
864
+ * @function verify
865
+ * @memberof subscription.ManySubscriptionsResponse
866
+ * @static
867
+ * @param {Object.<string,*>} message Plain object to verify
868
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
869
+ */
870
+ ManySubscriptionsResponse.verify = function verify(message) {
871
+ if (typeof message !== "object" || message === null)
872
+ return "object expected";
873
+ if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) {
874
+ if (!Array.isArray(message.subscriptions))
875
+ return "subscriptions: array expected";
876
+ for (var i = 0; i < message.subscriptions.length; ++i) {
877
+ var error = $root.subscription.Subscription.verify(message.subscriptions[i]);
878
+ if (error)
879
+ return "subscriptions." + error;
880
+ }
881
+ }
882
+ return null;
883
+ };
884
+
885
+ /**
886
+ * Creates a ManySubscriptionsResponse message from a plain object. Also converts values to their respective internal types.
887
+ * @function fromObject
888
+ * @memberof subscription.ManySubscriptionsResponse
889
+ * @static
890
+ * @param {Object.<string,*>} object Plain object
891
+ * @returns {subscription.ManySubscriptionsResponse} ManySubscriptionsResponse
892
+ */
893
+ ManySubscriptionsResponse.fromObject = function fromObject(object) {
894
+ if (object instanceof $root.subscription.ManySubscriptionsResponse)
895
+ return object;
896
+ var message = new $root.subscription.ManySubscriptionsResponse();
897
+ if (object.subscriptions) {
898
+ if (!Array.isArray(object.subscriptions))
899
+ throw TypeError(".subscription.ManySubscriptionsResponse.subscriptions: array expected");
900
+ message.subscriptions = [];
901
+ for (var i = 0; i < object.subscriptions.length; ++i) {
902
+ if (typeof object.subscriptions[i] !== "object")
903
+ throw TypeError(".subscription.ManySubscriptionsResponse.subscriptions: object expected");
904
+ message.subscriptions[i] = $root.subscription.Subscription.fromObject(object.subscriptions[i]);
905
+ }
906
+ }
907
+ return message;
908
+ };
909
+
910
+ /**
911
+ * Creates a plain object from a ManySubscriptionsResponse message. Also converts values to other types if specified.
912
+ * @function toObject
913
+ * @memberof subscription.ManySubscriptionsResponse
914
+ * @static
915
+ * @param {subscription.ManySubscriptionsResponse} message ManySubscriptionsResponse
916
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
917
+ * @returns {Object.<string,*>} Plain object
918
+ */
919
+ ManySubscriptionsResponse.toObject = function toObject(message, options) {
920
+ if (!options)
921
+ options = {};
922
+ var object = {};
923
+ if (options.arrays || options.defaults)
924
+ object.subscriptions = [];
925
+ if (message.subscriptions && message.subscriptions.length) {
926
+ object.subscriptions = [];
927
+ for (var j = 0; j < message.subscriptions.length; ++j)
928
+ object.subscriptions[j] = $root.subscription.Subscription.toObject(message.subscriptions[j], options);
929
+ }
930
+ return object;
931
+ };
932
+
933
+ /**
934
+ * Converts this ManySubscriptionsResponse to JSON.
935
+ * @function toJSON
936
+ * @memberof subscription.ManySubscriptionsResponse
937
+ * @instance
938
+ * @returns {Object.<string,*>} JSON object
939
+ */
940
+ ManySubscriptionsResponse.prototype.toJSON = function toJSON() {
941
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
942
+ };
943
+
944
+ return ManySubscriptionsResponse;
945
+ })();
946
+
947
+ subscription.OneSubscriptionResponse = (function() {
948
+
949
+ /**
950
+ * Properties of an OneSubscriptionResponse.
951
+ * @memberof subscription
952
+ * @interface IOneSubscriptionResponse
953
+ * @property {subscription.ISubscription|null} [subscription] OneSubscriptionResponse subscription
954
+ */
955
+
956
+ /**
957
+ * Constructs a new OneSubscriptionResponse.
958
+ * @memberof subscription
959
+ * @classdesc Represents an OneSubscriptionResponse.
960
+ * @implements IOneSubscriptionResponse
961
+ * @constructor
962
+ * @param {subscription.IOneSubscriptionResponse=} [properties] Properties to set
963
+ */
964
+ function OneSubscriptionResponse(properties) {
965
+ if (properties)
966
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
967
+ if (properties[keys[i]] != null)
968
+ this[keys[i]] = properties[keys[i]];
969
+ }
970
+
971
+ /**
972
+ * OneSubscriptionResponse subscription.
973
+ * @member {subscription.ISubscription|null|undefined} subscription
974
+ * @memberof subscription.OneSubscriptionResponse
975
+ * @instance
976
+ */
977
+ OneSubscriptionResponse.prototype.subscription = null;
978
+
979
+ /**
980
+ * Creates a new OneSubscriptionResponse instance using the specified properties.
981
+ * @function create
982
+ * @memberof subscription.OneSubscriptionResponse
983
+ * @static
984
+ * @param {subscription.IOneSubscriptionResponse=} [properties] Properties to set
985
+ * @returns {subscription.OneSubscriptionResponse} OneSubscriptionResponse instance
986
+ */
987
+ OneSubscriptionResponse.create = function create(properties) {
988
+ return new OneSubscriptionResponse(properties);
989
+ };
990
+
991
+ /**
992
+ * Encodes the specified OneSubscriptionResponse message. Does not implicitly {@link subscription.OneSubscriptionResponse.verify|verify} messages.
993
+ * @function encode
994
+ * @memberof subscription.OneSubscriptionResponse
995
+ * @static
996
+ * @param {subscription.IOneSubscriptionResponse} message OneSubscriptionResponse message or plain object to encode
997
+ * @param {$protobuf.Writer} [writer] Writer to encode to
998
+ * @returns {$protobuf.Writer} Writer
999
+ */
1000
+ OneSubscriptionResponse.encode = function encode(message, writer) {
1001
+ if (!writer)
1002
+ writer = $Writer.create();
1003
+ if (message.subscription != null && message.hasOwnProperty("subscription"))
1004
+ $root.subscription.Subscription.encode(message.subscription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
1005
+ return writer;
1006
+ };
1007
+
1008
+ /**
1009
+ * Encodes the specified OneSubscriptionResponse message, length delimited. Does not implicitly {@link subscription.OneSubscriptionResponse.verify|verify} messages.
1010
+ * @function encodeDelimited
1011
+ * @memberof subscription.OneSubscriptionResponse
1012
+ * @static
1013
+ * @param {subscription.IOneSubscriptionResponse} message OneSubscriptionResponse message or plain object to encode
1014
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1015
+ * @returns {$protobuf.Writer} Writer
1016
+ */
1017
+ OneSubscriptionResponse.encodeDelimited = function encodeDelimited(message, writer) {
1018
+ return this.encode(message, writer).ldelim();
1019
+ };
1020
+
1021
+ /**
1022
+ * Decodes an OneSubscriptionResponse message from the specified reader or buffer.
1023
+ * @function decode
1024
+ * @memberof subscription.OneSubscriptionResponse
1025
+ * @static
1026
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1027
+ * @param {number} [length] Message length if known beforehand
1028
+ * @returns {subscription.OneSubscriptionResponse} OneSubscriptionResponse
1029
+ * @throws {Error} If the payload is not a reader or valid buffer
1030
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1031
+ */
1032
+ OneSubscriptionResponse.decode = function decode(reader, length) {
1033
+ if (!(reader instanceof $Reader))
1034
+ reader = $Reader.create(reader);
1035
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.subscription.OneSubscriptionResponse();
1036
+ while (reader.pos < end) {
1037
+ var tag = reader.uint32();
1038
+ switch (tag >>> 3) {
1039
+ case 1:
1040
+ message.subscription = $root.subscription.Subscription.decode(reader, reader.uint32());
1041
+ break;
1042
+ default:
1043
+ reader.skipType(tag & 7);
1044
+ break;
1045
+ }
1046
+ }
1047
+ return message;
1048
+ };
1049
+
1050
+ /**
1051
+ * Decodes an OneSubscriptionResponse message from the specified reader or buffer, length delimited.
1052
+ * @function decodeDelimited
1053
+ * @memberof subscription.OneSubscriptionResponse
1054
+ * @static
1055
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1056
+ * @returns {subscription.OneSubscriptionResponse} OneSubscriptionResponse
1057
+ * @throws {Error} If the payload is not a reader or valid buffer
1058
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1059
+ */
1060
+ OneSubscriptionResponse.decodeDelimited = function decodeDelimited(reader) {
1061
+ if (!(reader instanceof $Reader))
1062
+ reader = new $Reader(reader);
1063
+ return this.decode(reader, reader.uint32());
1064
+ };
1065
+
1066
+ /**
1067
+ * Verifies an OneSubscriptionResponse message.
1068
+ * @function verify
1069
+ * @memberof subscription.OneSubscriptionResponse
1070
+ * @static
1071
+ * @param {Object.<string,*>} message Plain object to verify
1072
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1073
+ */
1074
+ OneSubscriptionResponse.verify = function verify(message) {
1075
+ if (typeof message !== "object" || message === null)
1076
+ return "object expected";
1077
+ if (message.subscription != null && message.hasOwnProperty("subscription")) {
1078
+ var error = $root.subscription.Subscription.verify(message.subscription);
1079
+ if (error)
1080
+ return "subscription." + error;
1081
+ }
1082
+ return null;
1083
+ };
1084
+
1085
+ /**
1086
+ * Creates an OneSubscriptionResponse message from a plain object. Also converts values to their respective internal types.
1087
+ * @function fromObject
1088
+ * @memberof subscription.OneSubscriptionResponse
1089
+ * @static
1090
+ * @param {Object.<string,*>} object Plain object
1091
+ * @returns {subscription.OneSubscriptionResponse} OneSubscriptionResponse
1092
+ */
1093
+ OneSubscriptionResponse.fromObject = function fromObject(object) {
1094
+ if (object instanceof $root.subscription.OneSubscriptionResponse)
1095
+ return object;
1096
+ var message = new $root.subscription.OneSubscriptionResponse();
1097
+ if (object.subscription != null) {
1098
+ if (typeof object.subscription !== "object")
1099
+ throw TypeError(".subscription.OneSubscriptionResponse.subscription: object expected");
1100
+ message.subscription = $root.subscription.Subscription.fromObject(object.subscription);
1101
+ }
1102
+ return message;
1103
+ };
1104
+
1105
+ /**
1106
+ * Creates a plain object from an OneSubscriptionResponse message. Also converts values to other types if specified.
1107
+ * @function toObject
1108
+ * @memberof subscription.OneSubscriptionResponse
1109
+ * @static
1110
+ * @param {subscription.OneSubscriptionResponse} message OneSubscriptionResponse
1111
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1112
+ * @returns {Object.<string,*>} Plain object
1113
+ */
1114
+ OneSubscriptionResponse.toObject = function toObject(message, options) {
1115
+ if (!options)
1116
+ options = {};
1117
+ var object = {};
1118
+ if (options.defaults)
1119
+ object.subscription = null;
1120
+ if (message.subscription != null && message.hasOwnProperty("subscription"))
1121
+ object.subscription = $root.subscription.Subscription.toObject(message.subscription, options);
1122
+ return object;
1123
+ };
1124
+
1125
+ /**
1126
+ * Converts this OneSubscriptionResponse to JSON.
1127
+ * @function toJSON
1128
+ * @memberof subscription.OneSubscriptionResponse
1129
+ * @instance
1130
+ * @returns {Object.<string,*>} JSON object
1131
+ */
1132
+ OneSubscriptionResponse.prototype.toJSON = function toJSON() {
1133
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1134
+ };
1135
+
1136
+ return OneSubscriptionResponse;
1137
+ })();
1138
+
1139
+ subscription.Subscription = (function() {
1140
+
1141
+ /**
1142
+ * Properties of a Subscription.
1143
+ * @memberof subscription
1144
+ * @interface ISubscription
1145
+ * @property {number|null} [id] Subscription id
1146
+ * @property {date.IDate|null} [startsAt] Subscription startsAt
1147
+ * @property {date.IDate|null} [endsAt] Subscription endsAt
1148
+ * @property {string|null} [status] Subscription status
1149
+ * @property {subscription.IPlan|null} [plan] Subscription plan
1150
+ * @property {string|null} [membership] Subscription membership
1151
+ * @property {string|null} [voucherCode] Subscription voucherCode
1152
+ */
1153
+
1154
+ /**
1155
+ * Constructs a new Subscription.
1156
+ * @memberof subscription
1157
+ * @classdesc Represents a Subscription.
1158
+ * @implements ISubscription
1159
+ * @constructor
1160
+ * @param {subscription.ISubscription=} [properties] Properties to set
1161
+ */
1162
+ function Subscription(properties) {
1163
+ if (properties)
1164
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1165
+ if (properties[keys[i]] != null)
1166
+ this[keys[i]] = properties[keys[i]];
1167
+ }
1168
+
1169
+ /**
1170
+ * Subscription id.
1171
+ * @member {number} id
1172
+ * @memberof subscription.Subscription
1173
+ * @instance
1174
+ */
1175
+ Subscription.prototype.id = 0;
1176
+
1177
+ /**
1178
+ * Subscription startsAt.
1179
+ * @member {date.IDate|null|undefined} startsAt
1180
+ * @memberof subscription.Subscription
1181
+ * @instance
1182
+ */
1183
+ Subscription.prototype.startsAt = null;
1184
+
1185
+ /**
1186
+ * Subscription endsAt.
1187
+ * @member {date.IDate|null|undefined} endsAt
1188
+ * @memberof subscription.Subscription
1189
+ * @instance
1190
+ */
1191
+ Subscription.prototype.endsAt = null;
1192
+
1193
+ /**
1194
+ * Subscription status.
1195
+ * @member {string} status
1196
+ * @memberof subscription.Subscription
1197
+ * @instance
1198
+ */
1199
+ Subscription.prototype.status = "";
1200
+
1201
+ /**
1202
+ * Subscription plan.
1203
+ * @member {subscription.IPlan|null|undefined} plan
1204
+ * @memberof subscription.Subscription
1205
+ * @instance
1206
+ */
1207
+ Subscription.prototype.plan = null;
1208
+
1209
+ /**
1210
+ * Subscription membership.
1211
+ * @member {string} membership
1212
+ * @memberof subscription.Subscription
1213
+ * @instance
1214
+ */
1215
+ Subscription.prototype.membership = "";
1216
+
1217
+ /**
1218
+ * Subscription voucherCode.
1219
+ * @member {string} voucherCode
1220
+ * @memberof subscription.Subscription
1221
+ * @instance
1222
+ */
1223
+ Subscription.prototype.voucherCode = "";
1224
+
1225
+ /**
1226
+ * Creates a new Subscription instance using the specified properties.
1227
+ * @function create
1228
+ * @memberof subscription.Subscription
1229
+ * @static
1230
+ * @param {subscription.ISubscription=} [properties] Properties to set
1231
+ * @returns {subscription.Subscription} Subscription instance
1232
+ */
1233
+ Subscription.create = function create(properties) {
1234
+ return new Subscription(properties);
1235
+ };
1236
+
1237
+ /**
1238
+ * Encodes the specified Subscription message. Does not implicitly {@link subscription.Subscription.verify|verify} messages.
1239
+ * @function encode
1240
+ * @memberof subscription.Subscription
1241
+ * @static
1242
+ * @param {subscription.ISubscription} message Subscription message or plain object to encode
1243
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1244
+ * @returns {$protobuf.Writer} Writer
1245
+ */
1246
+ Subscription.encode = function encode(message, writer) {
1247
+ if (!writer)
1248
+ writer = $Writer.create();
1249
+ if (message.id != null && message.hasOwnProperty("id"))
1250
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
1251
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
1252
+ $root.date.Date.encode(message.startsAt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1253
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
1254
+ $root.date.Date.encode(message.endsAt, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
1255
+ if (message.status != null && message.hasOwnProperty("status"))
1256
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.status);
1257
+ if (message.plan != null && message.hasOwnProperty("plan"))
1258
+ $root.subscription.Plan.encode(message.plan, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
1259
+ if (message.membership != null && message.hasOwnProperty("membership"))
1260
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.membership);
1261
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
1262
+ writer.uint32(/* id 7, wireType 2 =*/58).string(message.voucherCode);
1263
+ return writer;
1264
+ };
1265
+
1266
+ /**
1267
+ * Encodes the specified Subscription message, length delimited. Does not implicitly {@link subscription.Subscription.verify|verify} messages.
1268
+ * @function encodeDelimited
1269
+ * @memberof subscription.Subscription
1270
+ * @static
1271
+ * @param {subscription.ISubscription} message Subscription message or plain object to encode
1272
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1273
+ * @returns {$protobuf.Writer} Writer
1274
+ */
1275
+ Subscription.encodeDelimited = function encodeDelimited(message, writer) {
1276
+ return this.encode(message, writer).ldelim();
1277
+ };
1278
+
1279
+ /**
1280
+ * Decodes a Subscription message from the specified reader or buffer.
1281
+ * @function decode
1282
+ * @memberof subscription.Subscription
1283
+ * @static
1284
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1285
+ * @param {number} [length] Message length if known beforehand
1286
+ * @returns {subscription.Subscription} Subscription
1287
+ * @throws {Error} If the payload is not a reader or valid buffer
1288
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1289
+ */
1290
+ Subscription.decode = function decode(reader, length) {
1291
+ if (!(reader instanceof $Reader))
1292
+ reader = $Reader.create(reader);
1293
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.subscription.Subscription();
1294
+ while (reader.pos < end) {
1295
+ var tag = reader.uint32();
1296
+ switch (tag >>> 3) {
1297
+ case 1:
1298
+ message.id = reader.int32();
1299
+ break;
1300
+ case 2:
1301
+ message.startsAt = $root.date.Date.decode(reader, reader.uint32());
1302
+ break;
1303
+ case 3:
1304
+ message.endsAt = $root.date.Date.decode(reader, reader.uint32());
1305
+ break;
1306
+ case 4:
1307
+ message.status = reader.string();
1308
+ break;
1309
+ case 5:
1310
+ message.plan = $root.subscription.Plan.decode(reader, reader.uint32());
1311
+ break;
1312
+ case 6:
1313
+ message.membership = reader.string();
1314
+ break;
1315
+ case 7:
1316
+ message.voucherCode = reader.string();
1317
+ break;
1318
+ default:
1319
+ reader.skipType(tag & 7);
1320
+ break;
1321
+ }
1322
+ }
1323
+ return message;
1324
+ };
1325
+
1326
+ /**
1327
+ * Decodes a Subscription message from the specified reader or buffer, length delimited.
1328
+ * @function decodeDelimited
1329
+ * @memberof subscription.Subscription
1330
+ * @static
1331
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1332
+ * @returns {subscription.Subscription} Subscription
1333
+ * @throws {Error} If the payload is not a reader or valid buffer
1334
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1335
+ */
1336
+ Subscription.decodeDelimited = function decodeDelimited(reader) {
1337
+ if (!(reader instanceof $Reader))
1338
+ reader = new $Reader(reader);
1339
+ return this.decode(reader, reader.uint32());
1340
+ };
1341
+
1342
+ /**
1343
+ * Verifies a Subscription message.
1344
+ * @function verify
1345
+ * @memberof subscription.Subscription
1346
+ * @static
1347
+ * @param {Object.<string,*>} message Plain object to verify
1348
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1349
+ */
1350
+ Subscription.verify = function verify(message) {
1351
+ if (typeof message !== "object" || message === null)
1352
+ return "object expected";
1353
+ if (message.id != null && message.hasOwnProperty("id"))
1354
+ if (!$util.isInteger(message.id))
1355
+ return "id: integer expected";
1356
+ if (message.startsAt != null && message.hasOwnProperty("startsAt")) {
1357
+ var error = $root.date.Date.verify(message.startsAt);
1358
+ if (error)
1359
+ return "startsAt." + error;
1360
+ }
1361
+ if (message.endsAt != null && message.hasOwnProperty("endsAt")) {
1362
+ var error = $root.date.Date.verify(message.endsAt);
1363
+ if (error)
1364
+ return "endsAt." + error;
1365
+ }
1366
+ if (message.status != null && message.hasOwnProperty("status"))
1367
+ if (!$util.isString(message.status))
1368
+ return "status: string expected";
1369
+ if (message.plan != null && message.hasOwnProperty("plan")) {
1370
+ var error = $root.subscription.Plan.verify(message.plan);
1371
+ if (error)
1372
+ return "plan." + error;
1373
+ }
1374
+ if (message.membership != null && message.hasOwnProperty("membership"))
1375
+ if (!$util.isString(message.membership))
1376
+ return "membership: string expected";
1377
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
1378
+ if (!$util.isString(message.voucherCode))
1379
+ return "voucherCode: string expected";
1380
+ return null;
1381
+ };
1382
+
1383
+ /**
1384
+ * Creates a Subscription message from a plain object. Also converts values to their respective internal types.
1385
+ * @function fromObject
1386
+ * @memberof subscription.Subscription
1387
+ * @static
1388
+ * @param {Object.<string,*>} object Plain object
1389
+ * @returns {subscription.Subscription} Subscription
1390
+ */
1391
+ Subscription.fromObject = function fromObject(object) {
1392
+ if (object instanceof $root.subscription.Subscription)
1393
+ return object;
1394
+ var message = new $root.subscription.Subscription();
1395
+ if (object.id != null)
1396
+ message.id = object.id | 0;
1397
+ if (object.startsAt != null) {
1398
+ if (typeof object.startsAt !== "object")
1399
+ throw TypeError(".subscription.Subscription.startsAt: object expected");
1400
+ message.startsAt = $root.date.Date.fromObject(object.startsAt);
1401
+ }
1402
+ if (object.endsAt != null) {
1403
+ if (typeof object.endsAt !== "object")
1404
+ throw TypeError(".subscription.Subscription.endsAt: object expected");
1405
+ message.endsAt = $root.date.Date.fromObject(object.endsAt);
1406
+ }
1407
+ if (object.status != null)
1408
+ message.status = String(object.status);
1409
+ if (object.plan != null) {
1410
+ if (typeof object.plan !== "object")
1411
+ throw TypeError(".subscription.Subscription.plan: object expected");
1412
+ message.plan = $root.subscription.Plan.fromObject(object.plan);
1413
+ }
1414
+ if (object.membership != null)
1415
+ message.membership = String(object.membership);
1416
+ if (object.voucherCode != null)
1417
+ message.voucherCode = String(object.voucherCode);
1418
+ return message;
1419
+ };
1420
+
1421
+ /**
1422
+ * Creates a plain object from a Subscription message. Also converts values to other types if specified.
1423
+ * @function toObject
1424
+ * @memberof subscription.Subscription
1425
+ * @static
1426
+ * @param {subscription.Subscription} message Subscription
1427
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1428
+ * @returns {Object.<string,*>} Plain object
1429
+ */
1430
+ Subscription.toObject = function toObject(message, options) {
1431
+ if (!options)
1432
+ options = {};
1433
+ var object = {};
1434
+ if (options.defaults) {
1435
+ object.id = 0;
1436
+ object.startsAt = null;
1437
+ object.endsAt = null;
1438
+ object.status = "";
1439
+ object.plan = null;
1440
+ object.membership = "";
1441
+ object.voucherCode = "";
1442
+ }
1443
+ if (message.id != null && message.hasOwnProperty("id"))
1444
+ object.id = message.id;
1445
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
1446
+ object.startsAt = $root.date.Date.toObject(message.startsAt, options);
1447
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
1448
+ object.endsAt = $root.date.Date.toObject(message.endsAt, options);
1449
+ if (message.status != null && message.hasOwnProperty("status"))
1450
+ object.status = message.status;
1451
+ if (message.plan != null && message.hasOwnProperty("plan"))
1452
+ object.plan = $root.subscription.Plan.toObject(message.plan, options);
1453
+ if (message.membership != null && message.hasOwnProperty("membership"))
1454
+ object.membership = message.membership;
1455
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
1456
+ object.voucherCode = message.voucherCode;
1457
+ return object;
1458
+ };
1459
+
1460
+ /**
1461
+ * Converts this Subscription to JSON.
1462
+ * @function toJSON
1463
+ * @memberof subscription.Subscription
1464
+ * @instance
1465
+ * @returns {Object.<string,*>} JSON object
1466
+ */
1467
+ Subscription.prototype.toJSON = function toJSON() {
1468
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1469
+ };
1470
+
1471
+ return Subscription;
1472
+ })();
1473
+
1474
+ subscription.Plan = (function() {
1475
+
1476
+ /**
1477
+ * Properties of a Plan.
1478
+ * @memberof subscription
1479
+ * @interface IPlan
1480
+ * @property {number|null} [id] Plan id
1481
+ * @property {string|null} [description] Plan description
1482
+ * @property {number|null} [termLength] Plan termLength
1483
+ * @property {string|null} [name] Plan name
1484
+ * @property {string|null} [subscriptionType] Plan subscriptionType
1485
+ * @property {string|null} [affiliation] Plan affiliation
1486
+ */
1487
+
1488
+ /**
1489
+ * Constructs a new Plan.
1490
+ * @memberof subscription
1491
+ * @classdesc Represents a Plan.
1492
+ * @implements IPlan
1493
+ * @constructor
1494
+ * @param {subscription.IPlan=} [properties] Properties to set
1495
+ */
1496
+ function Plan(properties) {
1497
+ if (properties)
1498
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1499
+ if (properties[keys[i]] != null)
1500
+ this[keys[i]] = properties[keys[i]];
1501
+ }
1502
+
1503
+ /**
1504
+ * Plan id.
1505
+ * @member {number} id
1506
+ * @memberof subscription.Plan
1507
+ * @instance
1508
+ */
1509
+ Plan.prototype.id = 0;
1510
+
1511
+ /**
1512
+ * Plan description.
1513
+ * @member {string} description
1514
+ * @memberof subscription.Plan
1515
+ * @instance
1516
+ */
1517
+ Plan.prototype.description = "";
1518
+
1519
+ /**
1520
+ * Plan termLength.
1521
+ * @member {number} termLength
1522
+ * @memberof subscription.Plan
1523
+ * @instance
1524
+ */
1525
+ Plan.prototype.termLength = 0;
1526
+
1527
+ /**
1528
+ * Plan name.
1529
+ * @member {string} name
1530
+ * @memberof subscription.Plan
1531
+ * @instance
1532
+ */
1533
+ Plan.prototype.name = "";
1534
+
1535
+ /**
1536
+ * Plan subscriptionType.
1537
+ * @member {string} subscriptionType
1538
+ * @memberof subscription.Plan
1539
+ * @instance
1540
+ */
1541
+ Plan.prototype.subscriptionType = "";
1542
+
1543
+ /**
1544
+ * Plan affiliation.
1545
+ * @member {string} affiliation
1546
+ * @memberof subscription.Plan
1547
+ * @instance
1548
+ */
1549
+ Plan.prototype.affiliation = "";
1550
+
1551
+ /**
1552
+ * Creates a new Plan instance using the specified properties.
1553
+ * @function create
1554
+ * @memberof subscription.Plan
1555
+ * @static
1556
+ * @param {subscription.IPlan=} [properties] Properties to set
1557
+ * @returns {subscription.Plan} Plan instance
1558
+ */
1559
+ Plan.create = function create(properties) {
1560
+ return new Plan(properties);
1561
+ };
1562
+
1563
+ /**
1564
+ * Encodes the specified Plan message. Does not implicitly {@link subscription.Plan.verify|verify} messages.
1565
+ * @function encode
1566
+ * @memberof subscription.Plan
1567
+ * @static
1568
+ * @param {subscription.IPlan} message Plan message or plain object to encode
1569
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1570
+ * @returns {$protobuf.Writer} Writer
1571
+ */
1572
+ Plan.encode = function encode(message, writer) {
1573
+ if (!writer)
1574
+ writer = $Writer.create();
1575
+ if (message.id != null && message.hasOwnProperty("id"))
1576
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
1577
+ if (message.description != null && message.hasOwnProperty("description"))
1578
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
1579
+ if (message.termLength != null && message.hasOwnProperty("termLength"))
1580
+ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.termLength);
1581
+ if (message.name != null && message.hasOwnProperty("name"))
1582
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.name);
1583
+ if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType"))
1584
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.subscriptionType);
1585
+ if (message.affiliation != null && message.hasOwnProperty("affiliation"))
1586
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.affiliation);
1587
+ return writer;
1588
+ };
1589
+
1590
+ /**
1591
+ * Encodes the specified Plan message, length delimited. Does not implicitly {@link subscription.Plan.verify|verify} messages.
1592
+ * @function encodeDelimited
1593
+ * @memberof subscription.Plan
1594
+ * @static
1595
+ * @param {subscription.IPlan} message Plan message or plain object to encode
1596
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1597
+ * @returns {$protobuf.Writer} Writer
1598
+ */
1599
+ Plan.encodeDelimited = function encodeDelimited(message, writer) {
1600
+ return this.encode(message, writer).ldelim();
1601
+ };
1602
+
1603
+ /**
1604
+ * Decodes a Plan message from the specified reader or buffer.
1605
+ * @function decode
1606
+ * @memberof subscription.Plan
1607
+ * @static
1608
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1609
+ * @param {number} [length] Message length if known beforehand
1610
+ * @returns {subscription.Plan} Plan
1611
+ * @throws {Error} If the payload is not a reader or valid buffer
1612
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1613
+ */
1614
+ Plan.decode = function decode(reader, length) {
1615
+ if (!(reader instanceof $Reader))
1616
+ reader = $Reader.create(reader);
1617
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.subscription.Plan();
1618
+ while (reader.pos < end) {
1619
+ var tag = reader.uint32();
1620
+ switch (tag >>> 3) {
1621
+ case 1:
1622
+ message.id = reader.int32();
1623
+ break;
1624
+ case 2:
1625
+ message.description = reader.string();
1626
+ break;
1627
+ case 3:
1628
+ message.termLength = reader.int32();
1629
+ break;
1630
+ case 4:
1631
+ message.name = reader.string();
1632
+ break;
1633
+ case 5:
1634
+ message.subscriptionType = reader.string();
1635
+ break;
1636
+ case 6:
1637
+ message.affiliation = reader.string();
1638
+ break;
1639
+ default:
1640
+ reader.skipType(tag & 7);
1641
+ break;
1642
+ }
1643
+ }
1644
+ return message;
1645
+ };
1646
+
1647
+ /**
1648
+ * Decodes a Plan message from the specified reader or buffer, length delimited.
1649
+ * @function decodeDelimited
1650
+ * @memberof subscription.Plan
1651
+ * @static
1652
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1653
+ * @returns {subscription.Plan} Plan
1654
+ * @throws {Error} If the payload is not a reader or valid buffer
1655
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1656
+ */
1657
+ Plan.decodeDelimited = function decodeDelimited(reader) {
1658
+ if (!(reader instanceof $Reader))
1659
+ reader = new $Reader(reader);
1660
+ return this.decode(reader, reader.uint32());
1661
+ };
1662
+
1663
+ /**
1664
+ * Verifies a Plan message.
1665
+ * @function verify
1666
+ * @memberof subscription.Plan
1667
+ * @static
1668
+ * @param {Object.<string,*>} message Plain object to verify
1669
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1670
+ */
1671
+ Plan.verify = function verify(message) {
1672
+ if (typeof message !== "object" || message === null)
1673
+ return "object expected";
1674
+ if (message.id != null && message.hasOwnProperty("id"))
1675
+ if (!$util.isInteger(message.id))
1676
+ return "id: integer expected";
1677
+ if (message.description != null && message.hasOwnProperty("description"))
1678
+ if (!$util.isString(message.description))
1679
+ return "description: string expected";
1680
+ if (message.termLength != null && message.hasOwnProperty("termLength"))
1681
+ if (!$util.isInteger(message.termLength))
1682
+ return "termLength: integer expected";
1683
+ if (message.name != null && message.hasOwnProperty("name"))
1684
+ if (!$util.isString(message.name))
1685
+ return "name: string expected";
1686
+ if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType"))
1687
+ if (!$util.isString(message.subscriptionType))
1688
+ return "subscriptionType: string expected";
1689
+ if (message.affiliation != null && message.hasOwnProperty("affiliation"))
1690
+ if (!$util.isString(message.affiliation))
1691
+ return "affiliation: string expected";
1692
+ return null;
1693
+ };
1694
+
1695
+ /**
1696
+ * Creates a Plan message from a plain object. Also converts values to their respective internal types.
1697
+ * @function fromObject
1698
+ * @memberof subscription.Plan
1699
+ * @static
1700
+ * @param {Object.<string,*>} object Plain object
1701
+ * @returns {subscription.Plan} Plan
1702
+ */
1703
+ Plan.fromObject = function fromObject(object) {
1704
+ if (object instanceof $root.subscription.Plan)
1705
+ return object;
1706
+ var message = new $root.subscription.Plan();
1707
+ if (object.id != null)
1708
+ message.id = object.id | 0;
1709
+ if (object.description != null)
1710
+ message.description = String(object.description);
1711
+ if (object.termLength != null)
1712
+ message.termLength = object.termLength | 0;
1713
+ if (object.name != null)
1714
+ message.name = String(object.name);
1715
+ if (object.subscriptionType != null)
1716
+ message.subscriptionType = String(object.subscriptionType);
1717
+ if (object.affiliation != null)
1718
+ message.affiliation = String(object.affiliation);
1719
+ return message;
1720
+ };
1721
+
1722
+ /**
1723
+ * Creates a plain object from a Plan message. Also converts values to other types if specified.
1724
+ * @function toObject
1725
+ * @memberof subscription.Plan
1726
+ * @static
1727
+ * @param {subscription.Plan} message Plan
1728
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1729
+ * @returns {Object.<string,*>} Plain object
1730
+ */
1731
+ Plan.toObject = function toObject(message, options) {
1732
+ if (!options)
1733
+ options = {};
1734
+ var object = {};
1735
+ if (options.defaults) {
1736
+ object.id = 0;
1737
+ object.description = "";
1738
+ object.termLength = 0;
1739
+ object.name = "";
1740
+ object.subscriptionType = "";
1741
+ object.affiliation = "";
1742
+ }
1743
+ if (message.id != null && message.hasOwnProperty("id"))
1744
+ object.id = message.id;
1745
+ if (message.description != null && message.hasOwnProperty("description"))
1746
+ object.description = message.description;
1747
+ if (message.termLength != null && message.hasOwnProperty("termLength"))
1748
+ object.termLength = message.termLength;
1749
+ if (message.name != null && message.hasOwnProperty("name"))
1750
+ object.name = message.name;
1751
+ if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType"))
1752
+ object.subscriptionType = message.subscriptionType;
1753
+ if (message.affiliation != null && message.hasOwnProperty("affiliation"))
1754
+ object.affiliation = message.affiliation;
1755
+ return object;
1756
+ };
1757
+
1758
+ /**
1759
+ * Converts this Plan to JSON.
1760
+ * @function toJSON
1761
+ * @memberof subscription.Plan
1762
+ * @instance
1763
+ * @returns {Object.<string,*>} JSON object
1764
+ */
1765
+ Plan.prototype.toJSON = function toJSON() {
1766
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1767
+ };
1768
+
1769
+ return Plan;
1770
+ })();
1771
+
51
1772
  return subscription;
52
1773
  })();
53
1774
 
@@ -4832,4 +6553,191 @@ $root.UserEmailVerificationRequested = (function() {
4832
6553
  return UserEmailVerificationRequested;
4833
6554
  })();
4834
6555
 
6556
+ $root.UserDoubleOptInEmailRequested = (function() {
6557
+
6558
+ /**
6559
+ * Properties of a UserDoubleOptInEmailRequested.
6560
+ * @exports IUserDoubleOptInEmailRequested
6561
+ * @interface IUserDoubleOptInEmailRequested
6562
+ * @property {string|null} [userId] UserDoubleOptInEmailRequested userId
6563
+ */
6564
+
6565
+ /**
6566
+ * Constructs a new UserDoubleOptInEmailRequested.
6567
+ * @exports UserDoubleOptInEmailRequested
6568
+ * @classdesc Represents a UserDoubleOptInEmailRequested.
6569
+ * @implements IUserDoubleOptInEmailRequested
6570
+ * @constructor
6571
+ * @param {IUserDoubleOptInEmailRequested=} [properties] Properties to set
6572
+ */
6573
+ function UserDoubleOptInEmailRequested(properties) {
6574
+ if (properties)
6575
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6576
+ if (properties[keys[i]] != null)
6577
+ this[keys[i]] = properties[keys[i]];
6578
+ }
6579
+
6580
+ /**
6581
+ * UserDoubleOptInEmailRequested userId.
6582
+ * @member {string} userId
6583
+ * @memberof UserDoubleOptInEmailRequested
6584
+ * @instance
6585
+ */
6586
+ UserDoubleOptInEmailRequested.prototype.userId = "";
6587
+
6588
+ /**
6589
+ * Creates a new UserDoubleOptInEmailRequested instance using the specified properties.
6590
+ * @function create
6591
+ * @memberof UserDoubleOptInEmailRequested
6592
+ * @static
6593
+ * @param {IUserDoubleOptInEmailRequested=} [properties] Properties to set
6594
+ * @returns {UserDoubleOptInEmailRequested} UserDoubleOptInEmailRequested instance
6595
+ */
6596
+ UserDoubleOptInEmailRequested.create = function create(properties) {
6597
+ return new UserDoubleOptInEmailRequested(properties);
6598
+ };
6599
+
6600
+ /**
6601
+ * Encodes the specified UserDoubleOptInEmailRequested message. Does not implicitly {@link UserDoubleOptInEmailRequested.verify|verify} messages.
6602
+ * @function encode
6603
+ * @memberof UserDoubleOptInEmailRequested
6604
+ * @static
6605
+ * @param {IUserDoubleOptInEmailRequested} message UserDoubleOptInEmailRequested message or plain object to encode
6606
+ * @param {$protobuf.Writer} [writer] Writer to encode to
6607
+ * @returns {$protobuf.Writer} Writer
6608
+ */
6609
+ UserDoubleOptInEmailRequested.encode = function encode(message, writer) {
6610
+ if (!writer)
6611
+ writer = $Writer.create();
6612
+ if (message.userId != null && message.hasOwnProperty("userId"))
6613
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
6614
+ return writer;
6615
+ };
6616
+
6617
+ /**
6618
+ * Encodes the specified UserDoubleOptInEmailRequested message, length delimited. Does not implicitly {@link UserDoubleOptInEmailRequested.verify|verify} messages.
6619
+ * @function encodeDelimited
6620
+ * @memberof UserDoubleOptInEmailRequested
6621
+ * @static
6622
+ * @param {IUserDoubleOptInEmailRequested} message UserDoubleOptInEmailRequested message or plain object to encode
6623
+ * @param {$protobuf.Writer} [writer] Writer to encode to
6624
+ * @returns {$protobuf.Writer} Writer
6625
+ */
6626
+ UserDoubleOptInEmailRequested.encodeDelimited = function encodeDelimited(message, writer) {
6627
+ return this.encode(message, writer).ldelim();
6628
+ };
6629
+
6630
+ /**
6631
+ * Decodes a UserDoubleOptInEmailRequested message from the specified reader or buffer.
6632
+ * @function decode
6633
+ * @memberof UserDoubleOptInEmailRequested
6634
+ * @static
6635
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6636
+ * @param {number} [length] Message length if known beforehand
6637
+ * @returns {UserDoubleOptInEmailRequested} UserDoubleOptInEmailRequested
6638
+ * @throws {Error} If the payload is not a reader or valid buffer
6639
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
6640
+ */
6641
+ UserDoubleOptInEmailRequested.decode = function decode(reader, length) {
6642
+ if (!(reader instanceof $Reader))
6643
+ reader = $Reader.create(reader);
6644
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserDoubleOptInEmailRequested();
6645
+ while (reader.pos < end) {
6646
+ var tag = reader.uint32();
6647
+ switch (tag >>> 3) {
6648
+ case 1:
6649
+ message.userId = reader.string();
6650
+ break;
6651
+ default:
6652
+ reader.skipType(tag & 7);
6653
+ break;
6654
+ }
6655
+ }
6656
+ return message;
6657
+ };
6658
+
6659
+ /**
6660
+ * Decodes a UserDoubleOptInEmailRequested message from the specified reader or buffer, length delimited.
6661
+ * @function decodeDelimited
6662
+ * @memberof UserDoubleOptInEmailRequested
6663
+ * @static
6664
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
6665
+ * @returns {UserDoubleOptInEmailRequested} UserDoubleOptInEmailRequested
6666
+ * @throws {Error} If the payload is not a reader or valid buffer
6667
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
6668
+ */
6669
+ UserDoubleOptInEmailRequested.decodeDelimited = function decodeDelimited(reader) {
6670
+ if (!(reader instanceof $Reader))
6671
+ reader = new $Reader(reader);
6672
+ return this.decode(reader, reader.uint32());
6673
+ };
6674
+
6675
+ /**
6676
+ * Verifies a UserDoubleOptInEmailRequested message.
6677
+ * @function verify
6678
+ * @memberof UserDoubleOptInEmailRequested
6679
+ * @static
6680
+ * @param {Object.<string,*>} message Plain object to verify
6681
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
6682
+ */
6683
+ UserDoubleOptInEmailRequested.verify = function verify(message) {
6684
+ if (typeof message !== "object" || message === null)
6685
+ return "object expected";
6686
+ if (message.userId != null && message.hasOwnProperty("userId"))
6687
+ if (!$util.isString(message.userId))
6688
+ return "userId: string expected";
6689
+ return null;
6690
+ };
6691
+
6692
+ /**
6693
+ * Creates a UserDoubleOptInEmailRequested message from a plain object. Also converts values to their respective internal types.
6694
+ * @function fromObject
6695
+ * @memberof UserDoubleOptInEmailRequested
6696
+ * @static
6697
+ * @param {Object.<string,*>} object Plain object
6698
+ * @returns {UserDoubleOptInEmailRequested} UserDoubleOptInEmailRequested
6699
+ */
6700
+ UserDoubleOptInEmailRequested.fromObject = function fromObject(object) {
6701
+ if (object instanceof $root.UserDoubleOptInEmailRequested)
6702
+ return object;
6703
+ var message = new $root.UserDoubleOptInEmailRequested();
6704
+ if (object.userId != null)
6705
+ message.userId = String(object.userId);
6706
+ return message;
6707
+ };
6708
+
6709
+ /**
6710
+ * Creates a plain object from a UserDoubleOptInEmailRequested message. Also converts values to other types if specified.
6711
+ * @function toObject
6712
+ * @memberof UserDoubleOptInEmailRequested
6713
+ * @static
6714
+ * @param {UserDoubleOptInEmailRequested} message UserDoubleOptInEmailRequested
6715
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
6716
+ * @returns {Object.<string,*>} Plain object
6717
+ */
6718
+ UserDoubleOptInEmailRequested.toObject = function toObject(message, options) {
6719
+ if (!options)
6720
+ options = {};
6721
+ var object = {};
6722
+ if (options.defaults)
6723
+ object.userId = "";
6724
+ if (message.userId != null && message.hasOwnProperty("userId"))
6725
+ object.userId = message.userId;
6726
+ return object;
6727
+ };
6728
+
6729
+ /**
6730
+ * Converts this UserDoubleOptInEmailRequested to JSON.
6731
+ * @function toJSON
6732
+ * @memberof UserDoubleOptInEmailRequested
6733
+ * @instance
6734
+ * @returns {Object.<string,*>} JSON object
6735
+ */
6736
+ UserDoubleOptInEmailRequested.prototype.toJSON = function toJSON() {
6737
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6738
+ };
6739
+
6740
+ return UserDoubleOptInEmailRequested;
6741
+ })();
6742
+
4835
6743
  module.exports = $root;