@headspace/protos-events 0.0.7-alpha.0 → 0.0.9-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
@@ -317,6 +317,210 @@ export class SleepcastEpisodeCompleted implements ISleepcastEpisodeCompleted {
317
317
  public toJSON(): { [k: string]: any };
318
318
  }
319
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 firstPlayTimestamp */
330
+ firstPlayTimestamp?: (number|Long|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 firstPlayTimestamp. */
349
+ public firstPlayTimestamp: (number|Long);
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
+
320
524
  /** Properties of a SubscriptionCreated. */
321
525
  export interface ISubscriptionCreated {
322
526
 
package/lib/index.js CHANGED
@@ -791,6 +791,512 @@ $root.SleepcastEpisodeCompleted = (function() {
791
791
  return SleepcastEpisodeCompleted;
792
792
  })();
793
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 {number|Long|null} [firstPlayTimestamp] FirstSleepcastPlayDateSet firstPlayTimestamp
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 firstPlayTimestamp.
838
+ * @member {number|Long} firstPlayTimestamp
839
+ * @memberof FirstSleepcastPlayDateSet
840
+ * @instance
841
+ */
842
+ FirstSleepcastPlayDateSet.prototype.firstPlayTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
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.firstPlayTimestamp != null && message.hasOwnProperty("firstPlayTimestamp"))
873
+ writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.firstPlayTimestamp);
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.firstPlayTimestamp = reader.uint64();
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.firstPlayTimestamp != null && message.hasOwnProperty("firstPlayTimestamp"))
959
+ if (!$util.isInteger(message.firstPlayTimestamp) && !(message.firstPlayTimestamp && $util.isInteger(message.firstPlayTimestamp.low) && $util.isInteger(message.firstPlayTimestamp.high)))
960
+ return "firstPlayTimestamp: integer|Long 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.firstPlayTimestamp != null)
988
+ if ($util.Long)
989
+ (message.firstPlayTimestamp = $util.Long.fromValue(object.firstPlayTimestamp)).unsigned = true;
990
+ else if (typeof object.firstPlayTimestamp === "string")
991
+ message.firstPlayTimestamp = parseInt(object.firstPlayTimestamp, 10);
992
+ else if (typeof object.firstPlayTimestamp === "number")
993
+ message.firstPlayTimestamp = object.firstPlayTimestamp;
994
+ else if (typeof object.firstPlayTimestamp === "object")
995
+ message.firstPlayTimestamp = new $util.LongBits(object.firstPlayTimestamp.low >>> 0, object.firstPlayTimestamp.high >>> 0).toNumber(true);
996
+ return message;
997
+ };
998
+
999
+ /**
1000
+ * Creates a plain object from a FirstSleepcastPlayDateSet message. Also converts values to other types if specified.
1001
+ * @function toObject
1002
+ * @memberof FirstSleepcastPlayDateSet
1003
+ * @static
1004
+ * @param {FirstSleepcastPlayDateSet} message FirstSleepcastPlayDateSet
1005
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1006
+ * @returns {Object.<string,*>} Plain object
1007
+ */
1008
+ FirstSleepcastPlayDateSet.toObject = function toObject(message, options) {
1009
+ if (!options)
1010
+ options = {};
1011
+ var object = {};
1012
+ if (options.defaults) {
1013
+ if ($util.Long) {
1014
+ var long = new $util.Long(0, 0, true);
1015
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1016
+ } else
1017
+ object.timestamp = options.longs === String ? "0" : 0;
1018
+ object.userId = "";
1019
+ if ($util.Long) {
1020
+ var long = new $util.Long(0, 0, true);
1021
+ object.firstPlayTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1022
+ } else
1023
+ object.firstPlayTimestamp = options.longs === String ? "0" : 0;
1024
+ }
1025
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1026
+ if (typeof message.timestamp === "number")
1027
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
1028
+ else
1029
+ 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;
1030
+ if (message.userId != null && message.hasOwnProperty("userId"))
1031
+ object.userId = message.userId;
1032
+ if (message.firstPlayTimestamp != null && message.hasOwnProperty("firstPlayTimestamp"))
1033
+ if (typeof message.firstPlayTimestamp === "number")
1034
+ object.firstPlayTimestamp = options.longs === String ? String(message.firstPlayTimestamp) : message.firstPlayTimestamp;
1035
+ else
1036
+ object.firstPlayTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.firstPlayTimestamp) : options.longs === Number ? new $util.LongBits(message.firstPlayTimestamp.low >>> 0, message.firstPlayTimestamp.high >>> 0).toNumber(true) : message.firstPlayTimestamp;
1037
+ return object;
1038
+ };
1039
+
1040
+ /**
1041
+ * Converts this FirstSleepcastPlayDateSet to JSON.
1042
+ * @function toJSON
1043
+ * @memberof FirstSleepcastPlayDateSet
1044
+ * @instance
1045
+ * @returns {Object.<string,*>} JSON object
1046
+ */
1047
+ FirstSleepcastPlayDateSet.prototype.toJSON = function toJSON() {
1048
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1049
+ };
1050
+
1051
+ return FirstSleepcastPlayDateSet;
1052
+ })();
1053
+
1054
+ $root.NumSleepcastPlaysSet = (function() {
1055
+
1056
+ /**
1057
+ * Properties of a NumSleepcastPlaysSet.
1058
+ * @exports INumSleepcastPlaysSet
1059
+ * @interface INumSleepcastPlaysSet
1060
+ * @property {number|Long|null} [timestamp] NumSleepcastPlaysSet timestamp
1061
+ * @property {string|null} [userId] NumSleepcastPlaysSet userId
1062
+ * @property {number|null} [numPlays] NumSleepcastPlaysSet numPlays
1063
+ */
1064
+
1065
+ /**
1066
+ * Constructs a new NumSleepcastPlaysSet.
1067
+ * @exports NumSleepcastPlaysSet
1068
+ * @classdesc Represents a NumSleepcastPlaysSet.
1069
+ * @implements INumSleepcastPlaysSet
1070
+ * @constructor
1071
+ * @param {INumSleepcastPlaysSet=} [properties] Properties to set
1072
+ */
1073
+ function NumSleepcastPlaysSet(properties) {
1074
+ if (properties)
1075
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1076
+ if (properties[keys[i]] != null)
1077
+ this[keys[i]] = properties[keys[i]];
1078
+ }
1079
+
1080
+ /**
1081
+ * NumSleepcastPlaysSet timestamp.
1082
+ * @member {number|Long} timestamp
1083
+ * @memberof NumSleepcastPlaysSet
1084
+ * @instance
1085
+ */
1086
+ NumSleepcastPlaysSet.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
1087
+
1088
+ /**
1089
+ * NumSleepcastPlaysSet userId.
1090
+ * @member {string} userId
1091
+ * @memberof NumSleepcastPlaysSet
1092
+ * @instance
1093
+ */
1094
+ NumSleepcastPlaysSet.prototype.userId = "";
1095
+
1096
+ /**
1097
+ * NumSleepcastPlaysSet numPlays.
1098
+ * @member {number} numPlays
1099
+ * @memberof NumSleepcastPlaysSet
1100
+ * @instance
1101
+ */
1102
+ NumSleepcastPlaysSet.prototype.numPlays = 0;
1103
+
1104
+ /**
1105
+ * Creates a new NumSleepcastPlaysSet instance using the specified properties.
1106
+ * @function create
1107
+ * @memberof NumSleepcastPlaysSet
1108
+ * @static
1109
+ * @param {INumSleepcastPlaysSet=} [properties] Properties to set
1110
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet instance
1111
+ */
1112
+ NumSleepcastPlaysSet.create = function create(properties) {
1113
+ return new NumSleepcastPlaysSet(properties);
1114
+ };
1115
+
1116
+ /**
1117
+ * Encodes the specified NumSleepcastPlaysSet message. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
1118
+ * @function encode
1119
+ * @memberof NumSleepcastPlaysSet
1120
+ * @static
1121
+ * @param {INumSleepcastPlaysSet} message NumSleepcastPlaysSet message or plain object to encode
1122
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1123
+ * @returns {$protobuf.Writer} Writer
1124
+ */
1125
+ NumSleepcastPlaysSet.encode = function encode(message, writer) {
1126
+ if (!writer)
1127
+ writer = $Writer.create();
1128
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1129
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp);
1130
+ if (message.userId != null && message.hasOwnProperty("userId"))
1131
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId);
1132
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1133
+ writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.numPlays);
1134
+ return writer;
1135
+ };
1136
+
1137
+ /**
1138
+ * Encodes the specified NumSleepcastPlaysSet message, length delimited. Does not implicitly {@link NumSleepcastPlaysSet.verify|verify} messages.
1139
+ * @function encodeDelimited
1140
+ * @memberof NumSleepcastPlaysSet
1141
+ * @static
1142
+ * @param {INumSleepcastPlaysSet} message NumSleepcastPlaysSet message or plain object to encode
1143
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1144
+ * @returns {$protobuf.Writer} Writer
1145
+ */
1146
+ NumSleepcastPlaysSet.encodeDelimited = function encodeDelimited(message, writer) {
1147
+ return this.encode(message, writer).ldelim();
1148
+ };
1149
+
1150
+ /**
1151
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer.
1152
+ * @function decode
1153
+ * @memberof NumSleepcastPlaysSet
1154
+ * @static
1155
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1156
+ * @param {number} [length] Message length if known beforehand
1157
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1158
+ * @throws {Error} If the payload is not a reader or valid buffer
1159
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1160
+ */
1161
+ NumSleepcastPlaysSet.decode = function decode(reader, length) {
1162
+ if (!(reader instanceof $Reader))
1163
+ reader = $Reader.create(reader);
1164
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.NumSleepcastPlaysSet();
1165
+ while (reader.pos < end) {
1166
+ var tag = reader.uint32();
1167
+ switch (tag >>> 3) {
1168
+ case 1:
1169
+ message.timestamp = reader.uint64();
1170
+ break;
1171
+ case 2:
1172
+ message.userId = reader.string();
1173
+ break;
1174
+ case 3:
1175
+ message.numPlays = reader.uint32();
1176
+ break;
1177
+ default:
1178
+ reader.skipType(tag & 7);
1179
+ break;
1180
+ }
1181
+ }
1182
+ return message;
1183
+ };
1184
+
1185
+ /**
1186
+ * Decodes a NumSleepcastPlaysSet message from the specified reader or buffer, length delimited.
1187
+ * @function decodeDelimited
1188
+ * @memberof NumSleepcastPlaysSet
1189
+ * @static
1190
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1191
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1192
+ * @throws {Error} If the payload is not a reader or valid buffer
1193
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1194
+ */
1195
+ NumSleepcastPlaysSet.decodeDelimited = function decodeDelimited(reader) {
1196
+ if (!(reader instanceof $Reader))
1197
+ reader = new $Reader(reader);
1198
+ return this.decode(reader, reader.uint32());
1199
+ };
1200
+
1201
+ /**
1202
+ * Verifies a NumSleepcastPlaysSet message.
1203
+ * @function verify
1204
+ * @memberof NumSleepcastPlaysSet
1205
+ * @static
1206
+ * @param {Object.<string,*>} message Plain object to verify
1207
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1208
+ */
1209
+ NumSleepcastPlaysSet.verify = function verify(message) {
1210
+ if (typeof message !== "object" || message === null)
1211
+ return "object expected";
1212
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1213
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
1214
+ return "timestamp: integer|Long expected";
1215
+ if (message.userId != null && message.hasOwnProperty("userId"))
1216
+ if (!$util.isString(message.userId))
1217
+ return "userId: string expected";
1218
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1219
+ if (!$util.isInteger(message.numPlays))
1220
+ return "numPlays: integer expected";
1221
+ return null;
1222
+ };
1223
+
1224
+ /**
1225
+ * Creates a NumSleepcastPlaysSet message from a plain object. Also converts values to their respective internal types.
1226
+ * @function fromObject
1227
+ * @memberof NumSleepcastPlaysSet
1228
+ * @static
1229
+ * @param {Object.<string,*>} object Plain object
1230
+ * @returns {NumSleepcastPlaysSet} NumSleepcastPlaysSet
1231
+ */
1232
+ NumSleepcastPlaysSet.fromObject = function fromObject(object) {
1233
+ if (object instanceof $root.NumSleepcastPlaysSet)
1234
+ return object;
1235
+ var message = new $root.NumSleepcastPlaysSet();
1236
+ if (object.timestamp != null)
1237
+ if ($util.Long)
1238
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
1239
+ else if (typeof object.timestamp === "string")
1240
+ message.timestamp = parseInt(object.timestamp, 10);
1241
+ else if (typeof object.timestamp === "number")
1242
+ message.timestamp = object.timestamp;
1243
+ else if (typeof object.timestamp === "object")
1244
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
1245
+ if (object.userId != null)
1246
+ message.userId = String(object.userId);
1247
+ if (object.numPlays != null)
1248
+ message.numPlays = object.numPlays >>> 0;
1249
+ return message;
1250
+ };
1251
+
1252
+ /**
1253
+ * Creates a plain object from a NumSleepcastPlaysSet message. Also converts values to other types if specified.
1254
+ * @function toObject
1255
+ * @memberof NumSleepcastPlaysSet
1256
+ * @static
1257
+ * @param {NumSleepcastPlaysSet} message NumSleepcastPlaysSet
1258
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1259
+ * @returns {Object.<string,*>} Plain object
1260
+ */
1261
+ NumSleepcastPlaysSet.toObject = function toObject(message, options) {
1262
+ if (!options)
1263
+ options = {};
1264
+ var object = {};
1265
+ if (options.defaults) {
1266
+ if ($util.Long) {
1267
+ var long = new $util.Long(0, 0, true);
1268
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1269
+ } else
1270
+ object.timestamp = options.longs === String ? "0" : 0;
1271
+ object.userId = "";
1272
+ object.numPlays = 0;
1273
+ }
1274
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1275
+ if (typeof message.timestamp === "number")
1276
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
1277
+ else
1278
+ 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;
1279
+ if (message.userId != null && message.hasOwnProperty("userId"))
1280
+ object.userId = message.userId;
1281
+ if (message.numPlays != null && message.hasOwnProperty("numPlays"))
1282
+ object.numPlays = message.numPlays;
1283
+ return object;
1284
+ };
1285
+
1286
+ /**
1287
+ * Converts this NumSleepcastPlaysSet to JSON.
1288
+ * @function toJSON
1289
+ * @memberof NumSleepcastPlaysSet
1290
+ * @instance
1291
+ * @returns {Object.<string,*>} JSON object
1292
+ */
1293
+ NumSleepcastPlaysSet.prototype.toJSON = function toJSON() {
1294
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1295
+ };
1296
+
1297
+ return NumSleepcastPlaysSet;
1298
+ })();
1299
+
794
1300
  $root.SubscriptionCreated = (function() {
795
1301
 
796
1302
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headspace/protos-events",
3
- "version": "0.0.7-alpha.0",
3
+ "version": "0.0.9-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": "558bc9568b5de28e571a58f3a855fc25a75ef0c8"
19
+ "gitHead": "16507b52c395c046c6ef9b4138c1f040b1724533"
20
20
  }
package/sleep.proto CHANGED
@@ -5,3 +5,15 @@ message SleepcastEpisodeCompleted {
5
5
  uint32 sleepcastId = 2;
6
6
  string userId = 3;
7
7
  }
8
+
9
+ message FirstSleepcastPlayDateSet {
10
+ uint64 timestamp = 1;
11
+ string userId = 2;
12
+ uint64 firstPlayTimestamp = 3;
13
+ }
14
+
15
+ message NumSleepcastPlaysSet {
16
+ uint64 timestamp = 1;
17
+ string userId = 2;
18
+ uint32 numPlays = 3;
19
+ }