@headspace/protos-events 0.0.5 → 0.0.8-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -215,6 +215,312 @@ export class FamilyMemberRemoved implements IFamilyMemberRemoved {
215
215
  public toJSON(): { [k: string]: any };
216
216
  }
217
217
 
218
+ /** Properties of a SleepcastEpisodeCompleted. */
219
+ export interface ISleepcastEpisodeCompleted {
220
+
221
+ /** SleepcastEpisodeCompleted timestampMs */
222
+ timestampMs?: (number|Long|null);
223
+
224
+ /** SleepcastEpisodeCompleted sleepcastId */
225
+ sleepcastId?: (number|null);
226
+
227
+ /** SleepcastEpisodeCompleted userId */
228
+ userId?: (string|null);
229
+ }
230
+
231
+ /** Represents a SleepcastEpisodeCompleted. */
232
+ export class SleepcastEpisodeCompleted implements ISleepcastEpisodeCompleted {
233
+
234
+ /**
235
+ * Constructs a new SleepcastEpisodeCompleted.
236
+ * @param [properties] Properties to set
237
+ */
238
+ constructor(properties?: ISleepcastEpisodeCompleted);
239
+
240
+ /** SleepcastEpisodeCompleted timestampMs. */
241
+ public timestampMs: (number|Long);
242
+
243
+ /** SleepcastEpisodeCompleted sleepcastId. */
244
+ public sleepcastId: number;
245
+
246
+ /** SleepcastEpisodeCompleted userId. */
247
+ public userId: string;
248
+
249
+ /**
250
+ * Creates a new SleepcastEpisodeCompleted instance using the specified properties.
251
+ * @param [properties] Properties to set
252
+ * @returns SleepcastEpisodeCompleted instance
253
+ */
254
+ public static create(properties?: ISleepcastEpisodeCompleted): SleepcastEpisodeCompleted;
255
+
256
+ /**
257
+ * Encodes the specified SleepcastEpisodeCompleted message. Does not implicitly {@link SleepcastEpisodeCompleted.verify|verify} messages.
258
+ * @param message SleepcastEpisodeCompleted message or plain object to encode
259
+ * @param [writer] Writer to encode to
260
+ * @returns Writer
261
+ */
262
+ public static encode(message: ISleepcastEpisodeCompleted, writer?: $protobuf.Writer): $protobuf.Writer;
263
+
264
+ /**
265
+ * Encodes the specified SleepcastEpisodeCompleted message, length delimited. Does not implicitly {@link SleepcastEpisodeCompleted.verify|verify} messages.
266
+ * @param message SleepcastEpisodeCompleted message or plain object to encode
267
+ * @param [writer] Writer to encode to
268
+ * @returns Writer
269
+ */
270
+ public static encodeDelimited(message: ISleepcastEpisodeCompleted, writer?: $protobuf.Writer): $protobuf.Writer;
271
+
272
+ /**
273
+ * Decodes a SleepcastEpisodeCompleted message from the specified reader or buffer.
274
+ * @param reader Reader or buffer to decode from
275
+ * @param [length] Message length if known beforehand
276
+ * @returns SleepcastEpisodeCompleted
277
+ * @throws {Error} If the payload is not a reader or valid buffer
278
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
279
+ */
280
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SleepcastEpisodeCompleted;
281
+
282
+ /**
283
+ * Decodes a SleepcastEpisodeCompleted message from the specified reader or buffer, length delimited.
284
+ * @param reader Reader or buffer to decode from
285
+ * @returns SleepcastEpisodeCompleted
286
+ * @throws {Error} If the payload is not a reader or valid buffer
287
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
288
+ */
289
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SleepcastEpisodeCompleted;
290
+
291
+ /**
292
+ * Verifies a SleepcastEpisodeCompleted message.
293
+ * @param message Plain object to verify
294
+ * @returns `null` if valid, otherwise the reason why it is not
295
+ */
296
+ public static verify(message: { [k: string]: any }): (string|null);
297
+
298
+ /**
299
+ * Creates a SleepcastEpisodeCompleted message from a plain object. Also converts values to their respective internal types.
300
+ * @param object Plain object
301
+ * @returns SleepcastEpisodeCompleted
302
+ */
303
+ public static fromObject(object: { [k: string]: any }): SleepcastEpisodeCompleted;
304
+
305
+ /**
306
+ * Creates a plain object from a SleepcastEpisodeCompleted message. Also converts values to other types if specified.
307
+ * @param message SleepcastEpisodeCompleted
308
+ * @param [options] Conversion options
309
+ * @returns Plain object
310
+ */
311
+ public static toObject(message: SleepcastEpisodeCompleted, options?: $protobuf.IConversionOptions): { [k: string]: any };
312
+
313
+ /**
314
+ * Converts this SleepcastEpisodeCompleted to JSON.
315
+ * @returns JSON object
316
+ */
317
+ public toJSON(): { [k: string]: any };
318
+ }
319
+
320
+ /** Properties of a FirstSleepcastPlayDateSet. */
321
+ export interface IFirstSleepcastPlayDateSet {
322
+
323
+ /** FirstSleepcastPlayDateSet timestamp */
324
+ timestamp?: (number|Long|null);
325
+
326
+ /** FirstSleepcastPlayDateSet userId */
327
+ userId?: (string|null);
328
+
329
+ /** FirstSleepcastPlayDateSet firstPlayDate */
330
+ firstPlayDate?: (string|null);
331
+ }
332
+
333
+ /** Represents a FirstSleepcastPlayDateSet. */
334
+ export class FirstSleepcastPlayDateSet implements IFirstSleepcastPlayDateSet {
335
+
336
+ /**
337
+ * Constructs a new FirstSleepcastPlayDateSet.
338
+ * @param [properties] Properties to set
339
+ */
340
+ constructor(properties?: IFirstSleepcastPlayDateSet);
341
+
342
+ /** FirstSleepcastPlayDateSet timestamp. */
343
+ public timestamp: (number|Long);
344
+
345
+ /** FirstSleepcastPlayDateSet userId. */
346
+ public userId: string;
347
+
348
+ /** FirstSleepcastPlayDateSet firstPlayDate. */
349
+ public firstPlayDate: string;
350
+
351
+ /**
352
+ * Creates a new FirstSleepcastPlayDateSet instance using the specified properties.
353
+ * @param [properties] Properties to set
354
+ * @returns FirstSleepcastPlayDateSet instance
355
+ */
356
+ public static create(properties?: IFirstSleepcastPlayDateSet): FirstSleepcastPlayDateSet;
357
+
358
+ /**
359
+ * Encodes the specified FirstSleepcastPlayDateSet message. Does not implicitly {@link FirstSleepcastPlayDateSet.verify|verify} messages.
360
+ * @param message FirstSleepcastPlayDateSet message or plain object to encode
361
+ * @param [writer] Writer to encode to
362
+ * @returns Writer
363
+ */
364
+ public static encode(message: IFirstSleepcastPlayDateSet, writer?: $protobuf.Writer): $protobuf.Writer;
365
+
366
+ /**
367
+ * Encodes the specified FirstSleepcastPlayDateSet message, length delimited. Does not implicitly {@link FirstSleepcastPlayDateSet.verify|verify} messages.
368
+ * @param message FirstSleepcastPlayDateSet message or plain object to encode
369
+ * @param [writer] Writer to encode to
370
+ * @returns Writer
371
+ */
372
+ public static encodeDelimited(message: IFirstSleepcastPlayDateSet, writer?: $protobuf.Writer): $protobuf.Writer;
373
+
374
+ /**
375
+ * Decodes a FirstSleepcastPlayDateSet message from the specified reader or buffer.
376
+ * @param reader Reader or buffer to decode from
377
+ * @param [length] Message length if known beforehand
378
+ * @returns FirstSleepcastPlayDateSet
379
+ * @throws {Error} If the payload is not a reader or valid buffer
380
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
381
+ */
382
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): FirstSleepcastPlayDateSet;
383
+
384
+ /**
385
+ * Decodes a FirstSleepcastPlayDateSet message from the specified reader or buffer, length delimited.
386
+ * @param reader Reader or buffer to decode from
387
+ * @returns FirstSleepcastPlayDateSet
388
+ * @throws {Error} If the payload is not a reader or valid buffer
389
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
390
+ */
391
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): FirstSleepcastPlayDateSet;
392
+
393
+ /**
394
+ * Verifies a FirstSleepcastPlayDateSet message.
395
+ * @param message Plain object to verify
396
+ * @returns `null` if valid, otherwise the reason why it is not
397
+ */
398
+ public static verify(message: { [k: string]: any }): (string|null);
399
+
400
+ /**
401
+ * Creates a FirstSleepcastPlayDateSet message from a plain object. Also converts values to their respective internal types.
402
+ * @param object Plain object
403
+ * @returns FirstSleepcastPlayDateSet
404
+ */
405
+ public static fromObject(object: { [k: string]: any }): FirstSleepcastPlayDateSet;
406
+
407
+ /**
408
+ * Creates a plain object from a FirstSleepcastPlayDateSet message. Also converts values to other types if specified.
409
+ * @param message FirstSleepcastPlayDateSet
410
+ * @param [options] Conversion options
411
+ * @returns Plain object
412
+ */
413
+ public static toObject(message: FirstSleepcastPlayDateSet, options?: $protobuf.IConversionOptions): { [k: string]: any };
414
+
415
+ /**
416
+ * Converts this FirstSleepcastPlayDateSet to JSON.
417
+ * @returns JSON object
418
+ */
419
+ public toJSON(): { [k: string]: any };
420
+ }
421
+
422
+ /** Properties of a NumSleepcastPlaysSet. */
423
+ export interface INumSleepcastPlaysSet {
424
+
425
+ /** NumSleepcastPlaysSet timestamp */
426
+ timestamp?: (number|Long|null);
427
+
428
+ /** NumSleepcastPlaysSet userId */
429
+ userId?: (string|null);
430
+
431
+ /** NumSleepcastPlaysSet numPlays */
432
+ numPlays?: (number|null);
433
+ }
434
+
435
+ /** Represents a NumSleepcastPlaysSet. */
436
+ export class NumSleepcastPlaysSet implements INumSleepcastPlaysSet {
437
+
438
+ /**
439
+ * Constructs a new NumSleepcastPlaysSet.
440
+ * @param [properties] Properties to set
441
+ */
442
+ constructor(properties?: INumSleepcastPlaysSet);
443
+
444
+ /** NumSleepcastPlaysSet timestamp. */
445
+ public timestamp: (number|Long);
446
+
447
+ /** NumSleepcastPlaysSet userId. */
448
+ public userId: string;
449
+
450
+ /** NumSleepcastPlaysSet numPlays. */
451
+ public numPlays: number;
452
+
453
+ /**
454
+ * Creates a new NumSleepcastPlaysSet instance using the specified properties.
455
+ * @param [properties] Properties to set
456
+ * @returns NumSleepcastPlaysSet instance
457
+ */
458
+ public static create(properties?: INumSleepcastPlaysSet): NumSleepcastPlaysSet;
459
+
460
+ /**
461
+ * Encodes the specified NumSleepcastPlaysSet message. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
462
+ * @param message NumSleepcastPlaysSet message or plain object to encode
463
+ * @param [writer] Writer to encode to
464
+ * @returns Writer
465
+ */
466
+ public static encode(message: INumSleepcastPlaysSet, writer?: $protobuf.Writer): $protobuf.Writer;
467
+
468
+ /**
469
+ * Encodes the specified NumSleepcastPlaysSet message, length delimited. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
470
+ * @param message NumSleepcastPlaysSet message or plain object to encode
471
+ * @param [writer] Writer to encode to
472
+ * @returns Writer
473
+ */
474
+ public static encodeDelimited(message: INumSleepcastPlaysSet, writer?: $protobuf.Writer): $protobuf.Writer;
475
+
476
+ /**
477
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer.
478
+ * @param reader Reader or buffer to decode from
479
+ * @param [length] Message length if known beforehand
480
+ * @returns NumSleepcastPlaysSet
481
+ * @throws {Error} If the payload is not a reader or valid buffer
482
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
483
+ */
484
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): NumSleepcastPlaysSet;
485
+
486
+ /**
487
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer, length delimited.
488
+ * @param reader Reader or buffer to decode from
489
+ * @returns NumSleepcastPlaysSet
490
+ * @throws {Error} If the payload is not a reader or valid buffer
491
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
492
+ */
493
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): NumSleepcastPlaysSet;
494
+
495
+ /**
496
+ * Verifies a NumSleepcastPlaysSet message.
497
+ * @param message Plain object to verify
498
+ * @returns `null` if valid, otherwise the reason why it is not
499
+ */
500
+ public static verify(message: { [k: string]: any }): (string|null);
501
+
502
+ /**
503
+ * Creates a NumSleepcastPlaysSet message from a plain object. Also converts values to their respective internal types.
504
+ * @param object Plain object
505
+ * @returns NumSleepcastPlaysSet
506
+ */
507
+ public static fromObject(object: { [k: string]: any }): NumSleepcastPlaysSet;
508
+
509
+ /**
510
+ * Creates a plain object from a NumSleepcastPlaysSet message. Also converts values to other types if specified.
511
+ * @param message NumSleepcastPlaysSet
512
+ * @param [options] Conversion options
513
+ * @returns Plain object
514
+ */
515
+ public static toObject(message: NumSleepcastPlaysSet, options?: $protobuf.IConversionOptions): { [k: string]: any };
516
+
517
+ /**
518
+ * Converts this NumSleepcastPlaysSet to JSON.
519
+ * @returns JSON object
520
+ */
521
+ public toJSON(): { [k: string]: any };
522
+ }
523
+
218
524
  /** Properties of a SubscriptionCreated. */
219
525
  export interface ISubscriptionCreated {
220
526
 
package/lib/index.js CHANGED
@@ -545,6 +545,744 @@ $root.FamilyMemberRemoved = (function() {
545
545
  return FamilyMemberRemoved;
546
546
  })();
547
547
 
548
+ $root.SleepcastEpisodeCompleted = (function() {
549
+
550
+ /**
551
+ * Properties of a SleepcastEpisodeCompleted.
552
+ * @exports ISleepcastEpisodeCompleted
553
+ * @interface ISleepcastEpisodeCompleted
554
+ * @property {number|Long|null} [timestampMs] SleepcastEpisodeCompleted timestampMs
555
+ * @property {number|null} [sleepcastId] SleepcastEpisodeCompleted sleepcastId
556
+ * @property {string|null} [userId] SleepcastEpisodeCompleted userId
557
+ */
558
+
559
+ /**
560
+ * Constructs a new SleepcastEpisodeCompleted.
561
+ * @exports SleepcastEpisodeCompleted
562
+ * @classdesc Represents a SleepcastEpisodeCompleted.
563
+ * @implements ISleepcastEpisodeCompleted
564
+ * @constructor
565
+ * @param {ISleepcastEpisodeCompleted=} [properties] Properties to set
566
+ */
567
+ function SleepcastEpisodeCompleted(properties) {
568
+ if (properties)
569
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
570
+ if (properties[keys[i]] != null)
571
+ this[keys[i]] = properties[keys[i]];
572
+ }
573
+
574
+ /**
575
+ * SleepcastEpisodeCompleted timestampMs.
576
+ * @member {number|Long} timestampMs
577
+ * @memberof SleepcastEpisodeCompleted
578
+ * @instance
579
+ */
580
+ SleepcastEpisodeCompleted.prototype.timestampMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
581
+
582
+ /**
583
+ * SleepcastEpisodeCompleted sleepcastId.
584
+ * @member {number} sleepcastId
585
+ * @memberof SleepcastEpisodeCompleted
586
+ * @instance
587
+ */
588
+ SleepcastEpisodeCompleted.prototype.sleepcastId = 0;
589
+
590
+ /**
591
+ * SleepcastEpisodeCompleted userId.
592
+ * @member {string} userId
593
+ * @memberof SleepcastEpisodeCompleted
594
+ * @instance
595
+ */
596
+ SleepcastEpisodeCompleted.prototype.userId = "";
597
+
598
+ /**
599
+ * Creates a new SleepcastEpisodeCompleted instance using the specified properties.
600
+ * @function create
601
+ * @memberof SleepcastEpisodeCompleted
602
+ * @static
603
+ * @param {ISleepcastEpisodeCompleted=} [properties] Properties to set
604
+ * @returns {SleepcastEpisodeCompleted} SleepcastEpisodeCompleted instance
605
+ */
606
+ SleepcastEpisodeCompleted.create = function create(properties) {
607
+ return new SleepcastEpisodeCompleted(properties);
608
+ };
609
+
610
+ /**
611
+ * Encodes the specified SleepcastEpisodeCompleted message. Does not implicitly {@link SleepcastEpisodeCompleted.verify|verify} messages.
612
+ * @function encode
613
+ * @memberof SleepcastEpisodeCompleted
614
+ * @static
615
+ * @param {ISleepcastEpisodeCompleted} message SleepcastEpisodeCompleted message or plain object to encode
616
+ * @param {$protobuf.Writer} [writer] Writer to encode to
617
+ * @returns {$protobuf.Writer} Writer
618
+ */
619
+ SleepcastEpisodeCompleted.encode = function encode(message, writer) {
620
+ if (!writer)
621
+ writer = $Writer.create();
622
+ if (message.timestampMs != null && message.hasOwnProperty("timestampMs"))
623
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestampMs);
624
+ if (message.sleepcastId != null && message.hasOwnProperty("sleepcastId"))
625
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.sleepcastId);
626
+ if (message.userId != null && message.hasOwnProperty("userId"))
627
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.userId);
628
+ return writer;
629
+ };
630
+
631
+ /**
632
+ * Encodes the specified SleepcastEpisodeCompleted message, length delimited. Does not implicitly {@link SleepcastEpisodeCompleted.verify|verify} messages.
633
+ * @function encodeDelimited
634
+ * @memberof SleepcastEpisodeCompleted
635
+ * @static
636
+ * @param {ISleepcastEpisodeCompleted} message SleepcastEpisodeCompleted message or plain object to encode
637
+ * @param {$protobuf.Writer} [writer] Writer to encode to
638
+ * @returns {$protobuf.Writer} Writer
639
+ */
640
+ SleepcastEpisodeCompleted.encodeDelimited = function encodeDelimited(message, writer) {
641
+ return this.encode(message, writer).ldelim();
642
+ };
643
+
644
+ /**
645
+ * Decodes a SleepcastEpisodeCompleted message from the specified reader or buffer.
646
+ * @function decode
647
+ * @memberof SleepcastEpisodeCompleted
648
+ * @static
649
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
650
+ * @param {number} [length] Message length if known beforehand
651
+ * @returns {SleepcastEpisodeCompleted} SleepcastEpisodeCompleted
652
+ * @throws {Error} If the payload is not a reader or valid buffer
653
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
654
+ */
655
+ SleepcastEpisodeCompleted.decode = function decode(reader, length) {
656
+ if (!(reader instanceof $Reader))
657
+ reader = $Reader.create(reader);
658
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SleepcastEpisodeCompleted();
659
+ while (reader.pos < end) {
660
+ var tag = reader.uint32();
661
+ switch (tag >>> 3) {
662
+ case 1:
663
+ message.timestampMs = reader.uint64();
664
+ break;
665
+ case 2:
666
+ message.sleepcastId = reader.uint32();
667
+ break;
668
+ case 3:
669
+ message.userId = reader.string();
670
+ break;
671
+ default:
672
+ reader.skipType(tag & 7);
673
+ break;
674
+ }
675
+ }
676
+ return message;
677
+ };
678
+
679
+ /**
680
+ * Decodes a SleepcastEpisodeCompleted message from the specified reader or buffer, length delimited.
681
+ * @function decodeDelimited
682
+ * @memberof SleepcastEpisodeCompleted
683
+ * @static
684
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
685
+ * @returns {SleepcastEpisodeCompleted} SleepcastEpisodeCompleted
686
+ * @throws {Error} If the payload is not a reader or valid buffer
687
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
688
+ */
689
+ SleepcastEpisodeCompleted.decodeDelimited = function decodeDelimited(reader) {
690
+ if (!(reader instanceof $Reader))
691
+ reader = new $Reader(reader);
692
+ return this.decode(reader, reader.uint32());
693
+ };
694
+
695
+ /**
696
+ * Verifies a SleepcastEpisodeCompleted message.
697
+ * @function verify
698
+ * @memberof SleepcastEpisodeCompleted
699
+ * @static
700
+ * @param {Object.<string,*>} message Plain object to verify
701
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
702
+ */
703
+ SleepcastEpisodeCompleted.verify = function verify(message) {
704
+ if (typeof message !== "object" || message === null)
705
+ return "object expected";
706
+ if (message.timestampMs != null && message.hasOwnProperty("timestampMs"))
707
+ if (!$util.isInteger(message.timestampMs) && !(message.timestampMs && $util.isInteger(message.timestampMs.low) && $util.isInteger(message.timestampMs.high)))
708
+ return "timestampMs: integer|Long expected";
709
+ if (message.sleepcastId != null && message.hasOwnProperty("sleepcastId"))
710
+ if (!$util.isInteger(message.sleepcastId))
711
+ return "sleepcastId: integer expected";
712
+ if (message.userId != null && message.hasOwnProperty("userId"))
713
+ if (!$util.isString(message.userId))
714
+ return "userId: string expected";
715
+ return null;
716
+ };
717
+
718
+ /**
719
+ * Creates a SleepcastEpisodeCompleted message from a plain object. Also converts values to their respective internal types.
720
+ * @function fromObject
721
+ * @memberof SleepcastEpisodeCompleted
722
+ * @static
723
+ * @param {Object.<string,*>} object Plain object
724
+ * @returns {SleepcastEpisodeCompleted} SleepcastEpisodeCompleted
725
+ */
726
+ SleepcastEpisodeCompleted.fromObject = function fromObject(object) {
727
+ if (object instanceof $root.SleepcastEpisodeCompleted)
728
+ return object;
729
+ var message = new $root.SleepcastEpisodeCompleted();
730
+ if (object.timestampMs != null)
731
+ if ($util.Long)
732
+ (message.timestampMs = $util.Long.fromValue(object.timestampMs)).unsigned = true;
733
+ else if (typeof object.timestampMs === "string")
734
+ message.timestampMs = parseInt(object.timestampMs, 10);
735
+ else if (typeof object.timestampMs === "number")
736
+ message.timestampMs = object.timestampMs;
737
+ else if (typeof object.timestampMs === "object")
738
+ message.timestampMs = new $util.LongBits(object.timestampMs.low >>> 0, object.timestampMs.high >>> 0).toNumber(true);
739
+ if (object.sleepcastId != null)
740
+ message.sleepcastId = object.sleepcastId >>> 0;
741
+ if (object.userId != null)
742
+ message.userId = String(object.userId);
743
+ return message;
744
+ };
745
+
746
+ /**
747
+ * Creates a plain object from a SleepcastEpisodeCompleted message. Also converts values to other types if specified.
748
+ * @function toObject
749
+ * @memberof SleepcastEpisodeCompleted
750
+ * @static
751
+ * @param {SleepcastEpisodeCompleted} message SleepcastEpisodeCompleted
752
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
753
+ * @returns {Object.<string,*>} Plain object
754
+ */
755
+ SleepcastEpisodeCompleted.toObject = function toObject(message, options) {
756
+ if (!options)
757
+ options = {};
758
+ var object = {};
759
+ if (options.defaults) {
760
+ if ($util.Long) {
761
+ var long = new $util.Long(0, 0, true);
762
+ object.timestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
763
+ } else
764
+ object.timestampMs = options.longs === String ? "0" : 0;
765
+ object.sleepcastId = 0;
766
+ object.userId = "";
767
+ }
768
+ if (message.timestampMs != null && message.hasOwnProperty("timestampMs"))
769
+ if (typeof message.timestampMs === "number")
770
+ object.timestampMs = options.longs === String ? String(message.timestampMs) : message.timestampMs;
771
+ else
772
+ object.timestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.timestampMs) : options.longs === Number ? new $util.LongBits(message.timestampMs.low >>> 0, message.timestampMs.high >>> 0).toNumber(true) : message.timestampMs;
773
+ if (message.sleepcastId != null && message.hasOwnProperty("sleepcastId"))
774
+ object.sleepcastId = message.sleepcastId;
775
+ if (message.userId != null && message.hasOwnProperty("userId"))
776
+ object.userId = message.userId;
777
+ return object;
778
+ };
779
+
780
+ /**
781
+ * Converts this SleepcastEpisodeCompleted to JSON.
782
+ * @function toJSON
783
+ * @memberof SleepcastEpisodeCompleted
784
+ * @instance
785
+ * @returns {Object.<string,*>} JSON object
786
+ */
787
+ SleepcastEpisodeCompleted.prototype.toJSON = function toJSON() {
788
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
789
+ };
790
+
791
+ return SleepcastEpisodeCompleted;
792
+ })();
793
+
794
+ $root.FirstSleepcastPlayDateSet = (function() {
795
+
796
+ /**
797
+ * Properties of a FirstSleepcastPlayDateSet.
798
+ * @exports IFirstSleepcastPlayDateSet
799
+ * @interface IFirstSleepcastPlayDateSet
800
+ * @property {number|Long|null} [timestamp] FirstSleepcastPlayDateSet timestamp
801
+ * @property {string|null} [userId] FirstSleepcastPlayDateSet userId
802
+ * @property {string|null} [firstPlayDate] FirstSleepcastPlayDateSet firstPlayDate
803
+ */
804
+
805
+ /**
806
+ * Constructs a new FirstSleepcastPlayDateSet.
807
+ * @exports FirstSleepcastPlayDateSet
808
+ * @classdesc Represents a FirstSleepcastPlayDateSet.
809
+ * @implements IFirstSleepcastPlayDateSet
810
+ * @constructor
811
+ * @param {IFirstSleepcastPlayDateSet=} [properties] Properties to set
812
+ */
813
+ function FirstSleepcastPlayDateSet(properties) {
814
+ if (properties)
815
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
816
+ if (properties[keys[i]] != null)
817
+ this[keys[i]] = properties[keys[i]];
818
+ }
819
+
820
+ /**
821
+ * FirstSleepcastPlayDateSet timestamp.
822
+ * @member {number|Long} timestamp
823
+ * @memberof FirstSleepcastPlayDateSet
824
+ * @instance
825
+ */
826
+ FirstSleepcastPlayDateSet.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
827
+
828
+ /**
829
+ * FirstSleepcastPlayDateSet userId.
830
+ * @member {string} userId
831
+ * @memberof FirstSleepcastPlayDateSet
832
+ * @instance
833
+ */
834
+ FirstSleepcastPlayDateSet.prototype.userId = "";
835
+
836
+ /**
837
+ * FirstSleepcastPlayDateSet firstPlayDate.
838
+ * @member {string} firstPlayDate
839
+ * @memberof FirstSleepcastPlayDateSet
840
+ * @instance
841
+ */
842
+ FirstSleepcastPlayDateSet.prototype.firstPlayDate = "";
843
+
844
+ /**
845
+ * Creates a new FirstSleepcastPlayDateSet instance using the specified properties.
846
+ * @function create
847
+ * @memberof FirstSleepcastPlayDateSet
848
+ * @static
849
+ * @param {IFirstSleepcastPlayDateSet=} [properties] Properties to set
850
+ * @returns {FirstSleepcastPlayDateSet} FirstSleepcastPlayDateSet instance
851
+ */
852
+ FirstSleepcastPlayDateSet.create = function create(properties) {
853
+ return new FirstSleepcastPlayDateSet(properties);
854
+ };
855
+
856
+ /**
857
+ * Encodes the specified FirstSleepcastPlayDateSet message. Does not implicitly {@link FirstSleepcastPlayDateSet.verify|verify} messages.
858
+ * @function encode
859
+ * @memberof FirstSleepcastPlayDateSet
860
+ * @static
861
+ * @param {IFirstSleepcastPlayDateSet} message FirstSleepcastPlayDateSet message or plain object to encode
862
+ * @param {$protobuf.Writer} [writer] Writer to encode to
863
+ * @returns {$protobuf.Writer} Writer
864
+ */
865
+ FirstSleepcastPlayDateSet.encode = function encode(message, writer) {
866
+ if (!writer)
867
+ writer = $Writer.create();
868
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
869
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp);
870
+ if (message.userId != null && message.hasOwnProperty("userId"))
871
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId);
872
+ if (message.firstPlayDate != null && message.hasOwnProperty("firstPlayDate"))
873
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.firstPlayDate);
874
+ return writer;
875
+ };
876
+
877
+ /**
878
+ * Encodes the specified FirstSleepcastPlayDateSet message, length delimited. Does not implicitly {@link FirstSleepcastPlayDateSet.verify|verify} messages.
879
+ * @function encodeDelimited
880
+ * @memberof FirstSleepcastPlayDateSet
881
+ * @static
882
+ * @param {IFirstSleepcastPlayDateSet} message FirstSleepcastPlayDateSet message or plain object to encode
883
+ * @param {$protobuf.Writer} [writer] Writer to encode to
884
+ * @returns {$protobuf.Writer} Writer
885
+ */
886
+ FirstSleepcastPlayDateSet.encodeDelimited = function encodeDelimited(message, writer) {
887
+ return this.encode(message, writer).ldelim();
888
+ };
889
+
890
+ /**
891
+ * Decodes a FirstSleepcastPlayDateSet message from the specified reader or buffer.
892
+ * @function decode
893
+ * @memberof FirstSleepcastPlayDateSet
894
+ * @static
895
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
896
+ * @param {number} [length] Message length if known beforehand
897
+ * @returns {FirstSleepcastPlayDateSet} FirstSleepcastPlayDateSet
898
+ * @throws {Error} If the payload is not a reader or valid buffer
899
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
900
+ */
901
+ FirstSleepcastPlayDateSet.decode = function decode(reader, length) {
902
+ if (!(reader instanceof $Reader))
903
+ reader = $Reader.create(reader);
904
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.FirstSleepcastPlayDateSet();
905
+ while (reader.pos < end) {
906
+ var tag = reader.uint32();
907
+ switch (tag >>> 3) {
908
+ case 1:
909
+ message.timestamp = reader.uint64();
910
+ break;
911
+ case 2:
912
+ message.userId = reader.string();
913
+ break;
914
+ case 3:
915
+ message.firstPlayDate = reader.string();
916
+ break;
917
+ default:
918
+ reader.skipType(tag & 7);
919
+ break;
920
+ }
921
+ }
922
+ return message;
923
+ };
924
+
925
+ /**
926
+ * Decodes a FirstSleepcastPlayDateSet message from the specified reader or buffer, length delimited.
927
+ * @function decodeDelimited
928
+ * @memberof FirstSleepcastPlayDateSet
929
+ * @static
930
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
931
+ * @returns {FirstSleepcastPlayDateSet} FirstSleepcastPlayDateSet
932
+ * @throws {Error} If the payload is not a reader or valid buffer
933
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
934
+ */
935
+ FirstSleepcastPlayDateSet.decodeDelimited = function decodeDelimited(reader) {
936
+ if (!(reader instanceof $Reader))
937
+ reader = new $Reader(reader);
938
+ return this.decode(reader, reader.uint32());
939
+ };
940
+
941
+ /**
942
+ * Verifies a FirstSleepcastPlayDateSet message.
943
+ * @function verify
944
+ * @memberof FirstSleepcastPlayDateSet
945
+ * @static
946
+ * @param {Object.<string,*>} message Plain object to verify
947
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
948
+ */
949
+ FirstSleepcastPlayDateSet.verify = function verify(message) {
950
+ if (typeof message !== "object" || message === null)
951
+ return "object expected";
952
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
953
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
954
+ return "timestamp: integer|Long expected";
955
+ if (message.userId != null && message.hasOwnProperty("userId"))
956
+ if (!$util.isString(message.userId))
957
+ return "userId: string expected";
958
+ if (message.firstPlayDate != null && message.hasOwnProperty("firstPlayDate"))
959
+ if (!$util.isString(message.firstPlayDate))
960
+ return "firstPlayDate: string expected";
961
+ return null;
962
+ };
963
+
964
+ /**
965
+ * Creates a FirstSleepcastPlayDateSet message from a plain object. Also converts values to their respective internal types.
966
+ * @function fromObject
967
+ * @memberof FirstSleepcastPlayDateSet
968
+ * @static
969
+ * @param {Object.<string,*>} object Plain object
970
+ * @returns {FirstSleepcastPlayDateSet} FirstSleepcastPlayDateSet
971
+ */
972
+ FirstSleepcastPlayDateSet.fromObject = function fromObject(object) {
973
+ if (object instanceof $root.FirstSleepcastPlayDateSet)
974
+ return object;
975
+ var message = new $root.FirstSleepcastPlayDateSet();
976
+ if (object.timestamp != null)
977
+ if ($util.Long)
978
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
979
+ else if (typeof object.timestamp === "string")
980
+ message.timestamp = parseInt(object.timestamp, 10);
981
+ else if (typeof object.timestamp === "number")
982
+ message.timestamp = object.timestamp;
983
+ else if (typeof object.timestamp === "object")
984
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
985
+ if (object.userId != null)
986
+ message.userId = String(object.userId);
987
+ if (object.firstPlayDate != null)
988
+ message.firstPlayDate = String(object.firstPlayDate);
989
+ return message;
990
+ };
991
+
992
+ /**
993
+ * Creates a plain object from a FirstSleepcastPlayDateSet message. Also converts values to other types if specified.
994
+ * @function toObject
995
+ * @memberof FirstSleepcastPlayDateSet
996
+ * @static
997
+ * @param {FirstSleepcastPlayDateSet} message FirstSleepcastPlayDateSet
998
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
999
+ * @returns {Object.<string,*>} Plain object
1000
+ */
1001
+ FirstSleepcastPlayDateSet.toObject = function toObject(message, options) {
1002
+ if (!options)
1003
+ options = {};
1004
+ var object = {};
1005
+ if (options.defaults) {
1006
+ if ($util.Long) {
1007
+ var long = new $util.Long(0, 0, true);
1008
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1009
+ } else
1010
+ object.timestamp = options.longs === String ? "0" : 0;
1011
+ object.userId = "";
1012
+ object.firstPlayDate = "";
1013
+ }
1014
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1015
+ if (typeof message.timestamp === "number")
1016
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
1017
+ else
1018
+ 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(true) : message.timestamp;
1019
+ if (message.userId != null && message.hasOwnProperty("userId"))
1020
+ object.userId = message.userId;
1021
+ if (message.firstPlayDate != null && message.hasOwnProperty("firstPlayDate"))
1022
+ object.firstPlayDate = message.firstPlayDate;
1023
+ return object;
1024
+ };
1025
+
1026
+ /**
1027
+ * Converts this FirstSleepcastPlayDateSet to JSON.
1028
+ * @function toJSON
1029
+ * @memberof FirstSleepcastPlayDateSet
1030
+ * @instance
1031
+ * @returns {Object.<string,*>} JSON object
1032
+ */
1033
+ FirstSleepcastPlayDateSet.prototype.toJSON = function toJSON() {
1034
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1035
+ };
1036
+
1037
+ return FirstSleepcastPlayDateSet;
1038
+ })();
1039
+
1040
+ $root.NumSleepcastPlaysSet = (function() {
1041
+
1042
+ /**
1043
+ * Properties of a NumSleepcastPlaysSet.
1044
+ * @exports INumSleepcastPlaysSet
1045
+ * @interface INumSleepcastPlaysSet
1046
+ * @property {number|Long|null} [timestamp] NumSleepcastPlaysSet timestamp
1047
+ * @property {string|null} [userId] NumSleepcastPlaysSet userId
1048
+ * @property {number|null} [numPlays] NumSleepcastPlaysSet numPlays
1049
+ */
1050
+
1051
+ /**
1052
+ * Constructs a new NumSleepcastPlaysSet.
1053
+ * @exports NumSleepcastPlaysSet
1054
+ * @classdesc Represents a NumSleepcastPlaysSet.
1055
+ * @implements INumSleepcastPlaysSet
1056
+ * @constructor
1057
+ * @param {INumSleepcastPlaysSet=} [properties] Properties to set
1058
+ */
1059
+ function NumSleepcastPlaysSet(properties) {
1060
+ if (properties)
1061
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1062
+ if (properties[keys[i]] != null)
1063
+ this[keys[i]] = properties[keys[i]];
1064
+ }
1065
+
1066
+ /**
1067
+ * NumSleepcastPlaysSet timestamp.
1068
+ * @member {number|Long} timestamp
1069
+ * @memberof NumSleepcastPlaysSet
1070
+ * @instance
1071
+ */
1072
+ NumSleepcastPlaysSet.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
1073
+
1074
+ /**
1075
+ * NumSleepcastPlaysSet userId.
1076
+ * @member {string} userId
1077
+ * @memberof NumSleepcastPlaysSet
1078
+ * @instance
1079
+ */
1080
+ NumSleepcastPlaysSet.prototype.userId = "";
1081
+
1082
+ /**
1083
+ * NumSleepcastPlaysSet numPlays.
1084
+ * @member {number} numPlays
1085
+ * @memberof NumSleepcastPlaysSet
1086
+ * @instance
1087
+ */
1088
+ NumSleepcastPlaysSet.prototype.numPlays = 0;
1089
+
1090
+ /**
1091
+ * Creates a new NumSleepcastPlaysSet instance using the specified properties.
1092
+ * @function create
1093
+ * @memberof NumSleepcastPlaysSet
1094
+ * @static
1095
+ * @param {INumSleepcastPlaysSet=} [properties] Properties to set
1096
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet instance
1097
+ */
1098
+ NumSleepcastPlaysSet.create = function create(properties) {
1099
+ return new NumSleepcastPlaysSet(properties);
1100
+ };
1101
+
1102
+ /**
1103
+ * Encodes the specified NumSleepcastPlaysSet message. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
1104
+ * @function encode
1105
+ * @memberof NumSleepcastPlaysSet
1106
+ * @static
1107
+ * @param {INumSleepcastPlaysSet} message NumSleepcastPlaysSet message or plain object to encode
1108
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1109
+ * @returns {$protobuf.Writer} Writer
1110
+ */
1111
+ NumSleepcastPlaysSet.encode = function encode(message, writer) {
1112
+ if (!writer)
1113
+ writer = $Writer.create();
1114
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1115
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp);
1116
+ if (message.userId != null && message.hasOwnProperty("userId"))
1117
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId);
1118
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1119
+ writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.numPlays);
1120
+ return writer;
1121
+ };
1122
+
1123
+ /**
1124
+ * Encodes the specified NumSleepcastPlaysSet message, length delimited. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
1125
+ * @function encodeDelimited
1126
+ * @memberof NumSleepcastPlaysSet
1127
+ * @static
1128
+ * @param {INumSleepcastPlaysSet} message NumSleepcastPlaysSet message or plain object to encode
1129
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1130
+ * @returns {$protobuf.Writer} Writer
1131
+ */
1132
+ NumSleepcastPlaysSet.encodeDelimited = function encodeDelimited(message, writer) {
1133
+ return this.encode(message, writer).ldelim();
1134
+ };
1135
+
1136
+ /**
1137
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer.
1138
+ * @function decode
1139
+ * @memberof NumSleepcastPlaysSet
1140
+ * @static
1141
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1142
+ * @param {number} [length] Message length if known beforehand
1143
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1144
+ * @throws {Error} If the payload is not a reader or valid buffer
1145
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1146
+ */
1147
+ NumSleepcastPlaysSet.decode = function decode(reader, length) {
1148
+ if (!(reader instanceof $Reader))
1149
+ reader = $Reader.create(reader);
1150
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.NumSleepcastPlaysSet();
1151
+ while (reader.pos < end) {
1152
+ var tag = reader.uint32();
1153
+ switch (tag >>> 3) {
1154
+ case 1:
1155
+ message.timestamp = reader.uint64();
1156
+ break;
1157
+ case 2:
1158
+ message.userId = reader.string();
1159
+ break;
1160
+ case 3:
1161
+ message.numPlays = reader.uint32();
1162
+ break;
1163
+ default:
1164
+ reader.skipType(tag & 7);
1165
+ break;
1166
+ }
1167
+ }
1168
+ return message;
1169
+ };
1170
+
1171
+ /**
1172
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer, length delimited.
1173
+ * @function decodeDelimited
1174
+ * @memberof NumSleepcastPlaysSet
1175
+ * @static
1176
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1177
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1178
+ * @throws {Error} If the payload is not a reader or valid buffer
1179
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1180
+ */
1181
+ NumSleepcastPlaysSet.decodeDelimited = function decodeDelimited(reader) {
1182
+ if (!(reader instanceof $Reader))
1183
+ reader = new $Reader(reader);
1184
+ return this.decode(reader, reader.uint32());
1185
+ };
1186
+
1187
+ /**
1188
+ * Verifies a NumSleepcastPlaysSet message.
1189
+ * @function verify
1190
+ * @memberof NumSleepcastPlaysSet
1191
+ * @static
1192
+ * @param {Object.<string,*>} message Plain object to verify
1193
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1194
+ */
1195
+ NumSleepcastPlaysSet.verify = function verify(message) {
1196
+ if (typeof message !== "object" || message === null)
1197
+ return "object expected";
1198
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1199
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
1200
+ return "timestamp: integer|Long expected";
1201
+ if (message.userId != null && message.hasOwnProperty("userId"))
1202
+ if (!$util.isString(message.userId))
1203
+ return "userId: string expected";
1204
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1205
+ if (!$util.isInteger(message.numPlays))
1206
+ return "numPlays: integer expected";
1207
+ return null;
1208
+ };
1209
+
1210
+ /**
1211
+ * Creates a NumSleepcastPlaysSet message from a plain object. Also converts values to their respective internal types.
1212
+ * @function fromObject
1213
+ * @memberof NumSleepcastPlaysSet
1214
+ * @static
1215
+ * @param {Object.<string,*>} object Plain object
1216
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1217
+ */
1218
+ NumSleepcastPlaysSet.fromObject = function fromObject(object) {
1219
+ if (object instanceof $root.NumSleepcastPlaysSet)
1220
+ return object;
1221
+ var message = new $root.NumSleepcastPlaysSet();
1222
+ if (object.timestamp != null)
1223
+ if ($util.Long)
1224
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
1225
+ else if (typeof object.timestamp === "string")
1226
+ message.timestamp = parseInt(object.timestamp, 10);
1227
+ else if (typeof object.timestamp === "number")
1228
+ message.timestamp = object.timestamp;
1229
+ else if (typeof object.timestamp === "object")
1230
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
1231
+ if (object.userId != null)
1232
+ message.userId = String(object.userId);
1233
+ if (object.numPlays != null)
1234
+ message.numPlays = object.numPlays >>> 0;
1235
+ return message;
1236
+ };
1237
+
1238
+ /**
1239
+ * Creates a plain object from a NumSleepcastPlaysSet message. Also converts values to other types if specified.
1240
+ * @function toObject
1241
+ * @memberof NumSleepcastPlaysSet
1242
+ * @static
1243
+ * @param {NumSleepcastPlaysSet} message NumSleepcastPlaysSet
1244
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1245
+ * @returns {Object.<string,*>} Plain object
1246
+ */
1247
+ NumSleepcastPlaysSet.toObject = function toObject(message, options) {
1248
+ if (!options)
1249
+ options = {};
1250
+ var object = {};
1251
+ if (options.defaults) {
1252
+ if ($util.Long) {
1253
+ var long = new $util.Long(0, 0, true);
1254
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1255
+ } else
1256
+ object.timestamp = options.longs === String ? "0" : 0;
1257
+ object.userId = "";
1258
+ object.numPlays = 0;
1259
+ }
1260
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1261
+ if (typeof message.timestamp === "number")
1262
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
1263
+ else
1264
+ 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(true) : message.timestamp;
1265
+ if (message.userId != null && message.hasOwnProperty("userId"))
1266
+ object.userId = message.userId;
1267
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1268
+ object.numPlays = message.numPlays;
1269
+ return object;
1270
+ };
1271
+
1272
+ /**
1273
+ * Converts this NumSleepcastPlaysSet to JSON.
1274
+ * @function toJSON
1275
+ * @memberof NumSleepcastPlaysSet
1276
+ * @instance
1277
+ * @returns {Object.<string,*>} JSON object
1278
+ */
1279
+ NumSleepcastPlaysSet.prototype.toJSON = function toJSON() {
1280
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1281
+ };
1282
+
1283
+ return NumSleepcastPlaysSet;
1284
+ })();
1285
+
548
1286
  $root.SubscriptionCreated = (function() {
549
1287
 
550
1288
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headspace/protos-events",
3
- "version": "0.0.5",
3
+ "version": "0.0.8-alpha.0",
4
4
  "main": "lib/index.js",
5
5
  "typings": "lib/index.d.ts",
6
6
  "scripts": {
@@ -16,5 +16,5 @@
16
16
  "devDependencies": {
17
17
  "typescript": "^3.0.1"
18
18
  },
19
- "gitHead": "b3faf5b4835f10316b9abb6b0c0420f816343370"
19
+ "gitHead": "d1366d67d1a7d00fdc0a058a1a7ef53c19bcd849"
20
20
  }
package/sleep.proto ADDED
@@ -0,0 +1,19 @@
1
+ syntax = "proto3";
2
+
3
+ message SleepcastEpisodeCompleted {
4
+ uint64 timestampMs = 1;
5
+ uint32 sleepcastId = 2;
6
+ string userId = 3;
7
+ }
8
+
9
+ message FirstSleepcastPlayDateSet {
10
+ uint64 timestamp = 1;
11
+ string userId = 2;
12
+ string firstPlayDate = 3;
13
+ }
14
+
15
+ message NumSleepcastPlaysSet {
16
+ uint64 timestamp = 1;
17
+ string userId = 2;
18
+ uint32 numPlays = 3;
19
+ }