@headspace/protos-events 1.20.0 → 1.22.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
@@ -143,6 +143,20 @@ export namespace subscription {
143
143
  * @returns Promise
144
144
  */
145
145
  public findCurrentSubscription(request: subscription.IFindCurrentSubscriptionRequest): Promise<subscription.OneSubscriptionResponse>;
146
+
147
+ /**
148
+ * Calls FindCurrentUserSubscription.
149
+ * @param request FindCurrentUserSubscriptionRequest message or plain object
150
+ * @param callback Node-style callback called with the error, if any, and UserSubscriptionResponse
151
+ */
152
+ public findCurrentUserSubscription(request: subscription.IFindCurrentUserSubscriptionRequest, callback: subscription.SubscriptionGrpcManager.FindCurrentUserSubscriptionCallback): void;
153
+
154
+ /**
155
+ * Calls FindCurrentUserSubscription.
156
+ * @param request FindCurrentUserSubscriptionRequest message or plain object
157
+ * @returns Promise
158
+ */
159
+ public findCurrentUserSubscription(request: subscription.IFindCurrentUserSubscriptionRequest): Promise<subscription.UserSubscriptionResponse>;
146
160
  }
147
161
 
148
162
  namespace SubscriptionGrpcManager {
@@ -160,6 +174,13 @@ export namespace subscription {
160
174
  * @param [response] OneSubscriptionResponse
161
175
  */
162
176
  type findCurrentSubscriptionCallback = (error: (Error|null), response?: subscription.OneSubscriptionResponse) => void;
177
+
178
+ /**
179
+ * Callback as used by {@link subscription.SubscriptionGrpcManager#findCurrentUserSubscription}.
180
+ * @param error Error, if any
181
+ * @param [response] UserSubscriptionResponse
182
+ */
183
+ type FindCurrentUserSubscriptionCallback = (error: (Error|null), response?: subscription.UserSubscriptionResponse) => void;
163
184
  }
164
185
 
165
186
  /** Properties of a FindAllSubscriptionsRequest. */
@@ -342,6 +363,102 @@ export namespace subscription {
342
363
  public toJSON(): { [k: string]: any };
343
364
  }
344
365
 
366
+ /** Properties of a FindCurrentUserSubscriptionRequest. */
367
+ interface IFindCurrentUserSubscriptionRequest {
368
+
369
+ /** FindCurrentUserSubscriptionRequest userId */
370
+ userId?: (string|null);
371
+
372
+ /** FindCurrentUserSubscriptionRequest hsJwt */
373
+ hsJwt?: (string|null);
374
+ }
375
+
376
+ /** Represents a FindCurrentUserSubscriptionRequest. */
377
+ class FindCurrentUserSubscriptionRequest implements IFindCurrentUserSubscriptionRequest {
378
+
379
+ /**
380
+ * Constructs a new FindCurrentUserSubscriptionRequest.
381
+ * @param [properties] Properties to set
382
+ */
383
+ constructor(properties?: subscription.IFindCurrentUserSubscriptionRequest);
384
+
385
+ /** FindCurrentUserSubscriptionRequest userId. */
386
+ public userId: string;
387
+
388
+ /** FindCurrentUserSubscriptionRequest hsJwt. */
389
+ public hsJwt: string;
390
+
391
+ /**
392
+ * Creates a new FindCurrentUserSubscriptionRequest instance using the specified properties.
393
+ * @param [properties] Properties to set
394
+ * @returns FindCurrentUserSubscriptionRequest instance
395
+ */
396
+ public static create(properties?: subscription.IFindCurrentUserSubscriptionRequest): subscription.FindCurrentUserSubscriptionRequest;
397
+
398
+ /**
399
+ * Encodes the specified FindCurrentUserSubscriptionRequest message. Does not implicitly {@link subscription.FindCurrentUserSubscriptionRequest.verify|verify} messages.
400
+ * @param message FindCurrentUserSubscriptionRequest message or plain object to encode
401
+ * @param [writer] Writer to encode to
402
+ * @returns Writer
403
+ */
404
+ public static encode(message: subscription.IFindCurrentUserSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer;
405
+
406
+ /**
407
+ * Encodes the specified FindCurrentUserSubscriptionRequest message, length delimited. Does not implicitly {@link subscription.FindCurrentUserSubscriptionRequest.verify|verify} messages.
408
+ * @param message FindCurrentUserSubscriptionRequest message or plain object to encode
409
+ * @param [writer] Writer to encode to
410
+ * @returns Writer
411
+ */
412
+ public static encodeDelimited(message: subscription.IFindCurrentUserSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer;
413
+
414
+ /**
415
+ * Decodes a FindCurrentUserSubscriptionRequest message from the specified reader or buffer.
416
+ * @param reader Reader or buffer to decode from
417
+ * @param [length] Message length if known beforehand
418
+ * @returns FindCurrentUserSubscriptionRequest
419
+ * @throws {Error} If the payload is not a reader or valid buffer
420
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
421
+ */
422
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): subscription.FindCurrentUserSubscriptionRequest;
423
+
424
+ /**
425
+ * Decodes a FindCurrentUserSubscriptionRequest message from the specified reader or buffer, length delimited.
426
+ * @param reader Reader or buffer to decode from
427
+ * @returns FindCurrentUserSubscriptionRequest
428
+ * @throws {Error} If the payload is not a reader or valid buffer
429
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
430
+ */
431
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): subscription.FindCurrentUserSubscriptionRequest;
432
+
433
+ /**
434
+ * Verifies a FindCurrentUserSubscriptionRequest message.
435
+ * @param message Plain object to verify
436
+ * @returns `null` if valid, otherwise the reason why it is not
437
+ */
438
+ public static verify(message: { [k: string]: any }): (string|null);
439
+
440
+ /**
441
+ * Creates a FindCurrentUserSubscriptionRequest message from a plain object. Also converts values to their respective internal types.
442
+ * @param object Plain object
443
+ * @returns FindCurrentUserSubscriptionRequest
444
+ */
445
+ public static fromObject(object: { [k: string]: any }): subscription.FindCurrentUserSubscriptionRequest;
446
+
447
+ /**
448
+ * Creates a plain object from a FindCurrentUserSubscriptionRequest message. Also converts values to other types if specified.
449
+ * @param message FindCurrentUserSubscriptionRequest
450
+ * @param [options] Conversion options
451
+ * @returns Plain object
452
+ */
453
+ public static toObject(message: subscription.FindCurrentUserSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
454
+
455
+ /**
456
+ * Converts this FindCurrentUserSubscriptionRequest to JSON.
457
+ * @returns JSON object
458
+ */
459
+ public toJSON(): { [k: string]: any };
460
+ }
461
+
345
462
  /** Properties of a ManySubscriptionsResponse. */
346
463
  interface IManySubscriptionsResponse {
347
464
 
@@ -648,6 +765,120 @@ export namespace subscription {
648
765
  public toJSON(): { [k: string]: any };
649
766
  }
650
767
 
768
+ /** Properties of a UserSubscriptionResponse. */
769
+ interface IUserSubscriptionResponse {
770
+
771
+ /** UserSubscriptionResponse id */
772
+ id?: (string|null);
773
+
774
+ /** UserSubscriptionResponse startsAtIso8601 */
775
+ startsAtIso8601?: (string|null);
776
+
777
+ /** UserSubscriptionResponse endsAtIso8601 */
778
+ endsAtIso8601?: (string|null);
779
+
780
+ /** UserSubscriptionResponse status */
781
+ status?: (string|null);
782
+
783
+ /** UserSubscriptionResponse legacySubscriptionId */
784
+ legacySubscriptionId?: (string|null);
785
+ }
786
+
787
+ /** Represents a UserSubscriptionResponse. */
788
+ class UserSubscriptionResponse implements IUserSubscriptionResponse {
789
+
790
+ /**
791
+ * Constructs a new UserSubscriptionResponse.
792
+ * @param [properties] Properties to set
793
+ */
794
+ constructor(properties?: subscription.IUserSubscriptionResponse);
795
+
796
+ /** UserSubscriptionResponse id. */
797
+ public id: string;
798
+
799
+ /** UserSubscriptionResponse startsAtIso8601. */
800
+ public startsAtIso8601: string;
801
+
802
+ /** UserSubscriptionResponse endsAtIso8601. */
803
+ public endsAtIso8601: string;
804
+
805
+ /** UserSubscriptionResponse status. */
806
+ public status: string;
807
+
808
+ /** UserSubscriptionResponse legacySubscriptionId. */
809
+ public legacySubscriptionId: string;
810
+
811
+ /**
812
+ * Creates a new UserSubscriptionResponse instance using the specified properties.
813
+ * @param [properties] Properties to set
814
+ * @returns UserSubscriptionResponse instance
815
+ */
816
+ public static create(properties?: subscription.IUserSubscriptionResponse): subscription.UserSubscriptionResponse;
817
+
818
+ /**
819
+ * Encodes the specified UserSubscriptionResponse message. Does not implicitly {@link subscription.UserSubscriptionResponse.verify|verify} messages.
820
+ * @param message UserSubscriptionResponse message or plain object to encode
821
+ * @param [writer] Writer to encode to
822
+ * @returns Writer
823
+ */
824
+ public static encode(message: subscription.IUserSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer;
825
+
826
+ /**
827
+ * Encodes the specified UserSubscriptionResponse message, length delimited. Does not implicitly {@link subscription.UserSubscriptionResponse.verify|verify} messages.
828
+ * @param message UserSubscriptionResponse message or plain object to encode
829
+ * @param [writer] Writer to encode to
830
+ * @returns Writer
831
+ */
832
+ public static encodeDelimited(message: subscription.IUserSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer;
833
+
834
+ /**
835
+ * Decodes a UserSubscriptionResponse message from the specified reader or buffer.
836
+ * @param reader Reader or buffer to decode from
837
+ * @param [length] Message length if known beforehand
838
+ * @returns UserSubscriptionResponse
839
+ * @throws {Error} If the payload is not a reader or valid buffer
840
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
841
+ */
842
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): subscription.UserSubscriptionResponse;
843
+
844
+ /**
845
+ * Decodes a UserSubscriptionResponse message from the specified reader or buffer, length delimited.
846
+ * @param reader Reader or buffer to decode from
847
+ * @returns UserSubscriptionResponse
848
+ * @throws {Error} If the payload is not a reader or valid buffer
849
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
850
+ */
851
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): subscription.UserSubscriptionResponse;
852
+
853
+ /**
854
+ * Verifies a UserSubscriptionResponse message.
855
+ * @param message Plain object to verify
856
+ * @returns `null` if valid, otherwise the reason why it is not
857
+ */
858
+ public static verify(message: { [k: string]: any }): (string|null);
859
+
860
+ /**
861
+ * Creates a UserSubscriptionResponse message from a plain object. Also converts values to their respective internal types.
862
+ * @param object Plain object
863
+ * @returns UserSubscriptionResponse
864
+ */
865
+ public static fromObject(object: { [k: string]: any }): subscription.UserSubscriptionResponse;
866
+
867
+ /**
868
+ * Creates a plain object from a UserSubscriptionResponse message. Also converts values to other types if specified.
869
+ * @param message UserSubscriptionResponse
870
+ * @param [options] Conversion options
871
+ * @returns Plain object
872
+ */
873
+ public static toObject(message: subscription.UserSubscriptionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };
874
+
875
+ /**
876
+ * Converts this UserSubscriptionResponse to JSON.
877
+ * @returns JSON object
878
+ */
879
+ public toJSON(): { [k: string]: any };
880
+ }
881
+
651
882
  /** Properties of a Plan. */
652
883
  interface IPlan {
653
884
 
package/lib/index.js CHANGED
@@ -329,6 +329,39 @@ $root.subscription = (function() {
329
329
  * @variation 2
330
330
  */
331
331
 
332
+ /**
333
+ * Callback as used by {@link subscription.SubscriptionGrpcManager#findCurrentUserSubscription}.
334
+ * @memberof subscription.SubscriptionGrpcManager
335
+ * @typedef FindCurrentUserSubscriptionCallback
336
+ * @type {function}
337
+ * @param {Error|null} error Error, if any
338
+ * @param {subscription.UserSubscriptionResponse} [response] UserSubscriptionResponse
339
+ */
340
+
341
+ /**
342
+ * Calls FindCurrentUserSubscription.
343
+ * @function findCurrentUserSubscription
344
+ * @memberof subscription.SubscriptionGrpcManager
345
+ * @instance
346
+ * @param {subscription.IFindCurrentUserSubscriptionRequest} request FindCurrentUserSubscriptionRequest message or plain object
347
+ * @param {subscription.SubscriptionGrpcManager.FindCurrentUserSubscriptionCallback} callback Node-style callback called with the error, if any, and UserSubscriptionResponse
348
+ * @returns {undefined}
349
+ * @variation 1
350
+ */
351
+ Object.defineProperty(SubscriptionGrpcManager.prototype.findCurrentUserSubscription = function findCurrentUserSubscription(request, callback) {
352
+ return this.rpcCall(findCurrentUserSubscription, $root.subscription.FindCurrentUserSubscriptionRequest, $root.subscription.UserSubscriptionResponse, request, callback);
353
+ }, "name", { value: "FindCurrentUserSubscription" });
354
+
355
+ /**
356
+ * Calls FindCurrentUserSubscription.
357
+ * @function findCurrentUserSubscription
358
+ * @memberof subscription.SubscriptionGrpcManager
359
+ * @instance
360
+ * @param {subscription.IFindCurrentUserSubscriptionRequest} request FindCurrentUserSubscriptionRequest message or plain object
361
+ * @returns {Promise<subscription.UserSubscriptionResponse>} Promise
362
+ * @variation 2
363
+ */
364
+
332
365
  return SubscriptionGrpcManager;
333
366
  })();
334
367
 
@@ -706,6 +739,216 @@ $root.subscription = (function() {
706
739
  return FindCurrentSubscriptionRequest;
707
740
  })();
708
741
 
742
+ subscription.FindCurrentUserSubscriptionRequest = (function() {
743
+
744
+ /**
745
+ * Properties of a FindCurrentUserSubscriptionRequest.
746
+ * @memberof subscription
747
+ * @interface IFindCurrentUserSubscriptionRequest
748
+ * @property {string|null} [userId] FindCurrentUserSubscriptionRequest userId
749
+ * @property {string|null} [hsJwt] FindCurrentUserSubscriptionRequest hsJwt
750
+ */
751
+
752
+ /**
753
+ * Constructs a new FindCurrentUserSubscriptionRequest.
754
+ * @memberof subscription
755
+ * @classdesc Represents a FindCurrentUserSubscriptionRequest.
756
+ * @implements IFindCurrentUserSubscriptionRequest
757
+ * @constructor
758
+ * @param {subscription.IFindCurrentUserSubscriptionRequest=} [properties] Properties to set
759
+ */
760
+ function FindCurrentUserSubscriptionRequest(properties) {
761
+ if (properties)
762
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
763
+ if (properties[keys[i]] != null)
764
+ this[keys[i]] = properties[keys[i]];
765
+ }
766
+
767
+ /**
768
+ * FindCurrentUserSubscriptionRequest userId.
769
+ * @member {string} userId
770
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
771
+ * @instance
772
+ */
773
+ FindCurrentUserSubscriptionRequest.prototype.userId = "";
774
+
775
+ /**
776
+ * FindCurrentUserSubscriptionRequest hsJwt.
777
+ * @member {string} hsJwt
778
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
779
+ * @instance
780
+ */
781
+ FindCurrentUserSubscriptionRequest.prototype.hsJwt = "";
782
+
783
+ /**
784
+ * Creates a new FindCurrentUserSubscriptionRequest instance using the specified properties.
785
+ * @function create
786
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
787
+ * @static
788
+ * @param {subscription.IFindCurrentUserSubscriptionRequest=} [properties] Properties to set
789
+ * @returns {subscription.FindCurrentUserSubscriptionRequest} FindCurrentUserSubscriptionRequest instance
790
+ */
791
+ FindCurrentUserSubscriptionRequest.create = function create(properties) {
792
+ return new FindCurrentUserSubscriptionRequest(properties);
793
+ };
794
+
795
+ /**
796
+ * Encodes the specified FindCurrentUserSubscriptionRequest message. Does not implicitly {@link subscription.FindCurrentUserSubscriptionRequest.verify|verify} messages.
797
+ * @function encode
798
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
799
+ * @static
800
+ * @param {subscription.IFindCurrentUserSubscriptionRequest} message FindCurrentUserSubscriptionRequest message or plain object to encode
801
+ * @param {$protobuf.Writer} [writer] Writer to encode to
802
+ * @returns {$protobuf.Writer} Writer
803
+ */
804
+ FindCurrentUserSubscriptionRequest.encode = function encode(message, writer) {
805
+ if (!writer)
806
+ writer = $Writer.create();
807
+ if (message.userId != null && message.hasOwnProperty("userId"))
808
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
809
+ if (message.hsJwt != null && message.hasOwnProperty("hsJwt"))
810
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.hsJwt);
811
+ return writer;
812
+ };
813
+
814
+ /**
815
+ * Encodes the specified FindCurrentUserSubscriptionRequest message, length delimited. Does not implicitly {@link subscription.FindCurrentUserSubscriptionRequest.verify|verify} messages.
816
+ * @function encodeDelimited
817
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
818
+ * @static
819
+ * @param {subscription.IFindCurrentUserSubscriptionRequest} message FindCurrentUserSubscriptionRequest message or plain object to encode
820
+ * @param {$protobuf.Writer} [writer] Writer to encode to
821
+ * @returns {$protobuf.Writer} Writer
822
+ */
823
+ FindCurrentUserSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) {
824
+ return this.encode(message, writer).ldelim();
825
+ };
826
+
827
+ /**
828
+ * Decodes a FindCurrentUserSubscriptionRequest message from the specified reader or buffer.
829
+ * @function decode
830
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
831
+ * @static
832
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
833
+ * @param {number} [length] Message length if known beforehand
834
+ * @returns {subscription.FindCurrentUserSubscriptionRequest} FindCurrentUserSubscriptionRequest
835
+ * @throws {Error} If the payload is not a reader or valid buffer
836
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
837
+ */
838
+ FindCurrentUserSubscriptionRequest.decode = function decode(reader, length) {
839
+ if (!(reader instanceof $Reader))
840
+ reader = $Reader.create(reader);
841
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.subscription.FindCurrentUserSubscriptionRequest();
842
+ while (reader.pos < end) {
843
+ var tag = reader.uint32();
844
+ switch (tag >>> 3) {
845
+ case 1:
846
+ message.userId = reader.string();
847
+ break;
848
+ case 2:
849
+ message.hsJwt = reader.string();
850
+ break;
851
+ default:
852
+ reader.skipType(tag & 7);
853
+ break;
854
+ }
855
+ }
856
+ return message;
857
+ };
858
+
859
+ /**
860
+ * Decodes a FindCurrentUserSubscriptionRequest message from the specified reader or buffer, length delimited.
861
+ * @function decodeDelimited
862
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
863
+ * @static
864
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
865
+ * @returns {subscription.FindCurrentUserSubscriptionRequest} FindCurrentUserSubscriptionRequest
866
+ * @throws {Error} If the payload is not a reader or valid buffer
867
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
868
+ */
869
+ FindCurrentUserSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) {
870
+ if (!(reader instanceof $Reader))
871
+ reader = new $Reader(reader);
872
+ return this.decode(reader, reader.uint32());
873
+ };
874
+
875
+ /**
876
+ * Verifies a FindCurrentUserSubscriptionRequest message.
877
+ * @function verify
878
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
879
+ * @static
880
+ * @param {Object.<string,*>} message Plain object to verify
881
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
882
+ */
883
+ FindCurrentUserSubscriptionRequest.verify = function verify(message) {
884
+ if (typeof message !== "object" || message === null)
885
+ return "object expected";
886
+ if (message.userId != null && message.hasOwnProperty("userId"))
887
+ if (!$util.isString(message.userId))
888
+ return "userId: string expected";
889
+ if (message.hsJwt != null && message.hasOwnProperty("hsJwt"))
890
+ if (!$util.isString(message.hsJwt))
891
+ return "hsJwt: string expected";
892
+ return null;
893
+ };
894
+
895
+ /**
896
+ * Creates a FindCurrentUserSubscriptionRequest message from a plain object. Also converts values to their respective internal types.
897
+ * @function fromObject
898
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
899
+ * @static
900
+ * @param {Object.<string,*>} object Plain object
901
+ * @returns {subscription.FindCurrentUserSubscriptionRequest} FindCurrentUserSubscriptionRequest
902
+ */
903
+ FindCurrentUserSubscriptionRequest.fromObject = function fromObject(object) {
904
+ if (object instanceof $root.subscription.FindCurrentUserSubscriptionRequest)
905
+ return object;
906
+ var message = new $root.subscription.FindCurrentUserSubscriptionRequest();
907
+ if (object.userId != null)
908
+ message.userId = String(object.userId);
909
+ if (object.hsJwt != null)
910
+ message.hsJwt = String(object.hsJwt);
911
+ return message;
912
+ };
913
+
914
+ /**
915
+ * Creates a plain object from a FindCurrentUserSubscriptionRequest message. Also converts values to other types if specified.
916
+ * @function toObject
917
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
918
+ * @static
919
+ * @param {subscription.FindCurrentUserSubscriptionRequest} message FindCurrentUserSubscriptionRequest
920
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
921
+ * @returns {Object.<string,*>} Plain object
922
+ */
923
+ FindCurrentUserSubscriptionRequest.toObject = function toObject(message, options) {
924
+ if (!options)
925
+ options = {};
926
+ var object = {};
927
+ if (options.defaults) {
928
+ object.userId = "";
929
+ object.hsJwt = "";
930
+ }
931
+ if (message.userId != null && message.hasOwnProperty("userId"))
932
+ object.userId = message.userId;
933
+ if (message.hsJwt != null && message.hasOwnProperty("hsJwt"))
934
+ object.hsJwt = message.hsJwt;
935
+ return object;
936
+ };
937
+
938
+ /**
939
+ * Converts this FindCurrentUserSubscriptionRequest to JSON.
940
+ * @function toJSON
941
+ * @memberof subscription.FindCurrentUserSubscriptionRequest
942
+ * @instance
943
+ * @returns {Object.<string,*>} JSON object
944
+ */
945
+ FindCurrentUserSubscriptionRequest.prototype.toJSON = function toJSON() {
946
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
947
+ };
948
+
949
+ return FindCurrentUserSubscriptionRequest;
950
+ })();
951
+
709
952
  subscription.ManySubscriptionsResponse = (function() {
710
953
 
711
954
  /**
@@ -1441,6 +1684,282 @@ $root.subscription = (function() {
1441
1684
  return Subscription;
1442
1685
  })();
1443
1686
 
1687
+ subscription.UserSubscriptionResponse = (function() {
1688
+
1689
+ /**
1690
+ * Properties of a UserSubscriptionResponse.
1691
+ * @memberof subscription
1692
+ * @interface IUserSubscriptionResponse
1693
+ * @property {string|null} [id] UserSubscriptionResponse id
1694
+ * @property {string|null} [startsAtIso8601] UserSubscriptionResponse startsAtIso8601
1695
+ * @property {string|null} [endsAtIso8601] UserSubscriptionResponse endsAtIso8601
1696
+ * @property {string|null} [status] UserSubscriptionResponse status
1697
+ * @property {string|null} [legacySubscriptionId] UserSubscriptionResponse legacySubscriptionId
1698
+ */
1699
+
1700
+ /**
1701
+ * Constructs a new UserSubscriptionResponse.
1702
+ * @memberof subscription
1703
+ * @classdesc Represents a UserSubscriptionResponse.
1704
+ * @implements IUserSubscriptionResponse
1705
+ * @constructor
1706
+ * @param {subscription.IUserSubscriptionResponse=} [properties] Properties to set
1707
+ */
1708
+ function UserSubscriptionResponse(properties) {
1709
+ if (properties)
1710
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1711
+ if (properties[keys[i]] != null)
1712
+ this[keys[i]] = properties[keys[i]];
1713
+ }
1714
+
1715
+ /**
1716
+ * UserSubscriptionResponse id.
1717
+ * @member {string} id
1718
+ * @memberof subscription.UserSubscriptionResponse
1719
+ * @instance
1720
+ */
1721
+ UserSubscriptionResponse.prototype.id = "";
1722
+
1723
+ /**
1724
+ * UserSubscriptionResponse startsAtIso8601.
1725
+ * @member {string} startsAtIso8601
1726
+ * @memberof subscription.UserSubscriptionResponse
1727
+ * @instance
1728
+ */
1729
+ UserSubscriptionResponse.prototype.startsAtIso8601 = "";
1730
+
1731
+ /**
1732
+ * UserSubscriptionResponse endsAtIso8601.
1733
+ * @member {string} endsAtIso8601
1734
+ * @memberof subscription.UserSubscriptionResponse
1735
+ * @instance
1736
+ */
1737
+ UserSubscriptionResponse.prototype.endsAtIso8601 = "";
1738
+
1739
+ /**
1740
+ * UserSubscriptionResponse status.
1741
+ * @member {string} status
1742
+ * @memberof subscription.UserSubscriptionResponse
1743
+ * @instance
1744
+ */
1745
+ UserSubscriptionResponse.prototype.status = "";
1746
+
1747
+ /**
1748
+ * UserSubscriptionResponse legacySubscriptionId.
1749
+ * @member {string} legacySubscriptionId
1750
+ * @memberof subscription.UserSubscriptionResponse
1751
+ * @instance
1752
+ */
1753
+ UserSubscriptionResponse.prototype.legacySubscriptionId = "";
1754
+
1755
+ /**
1756
+ * Creates a new UserSubscriptionResponse instance using the specified properties.
1757
+ * @function create
1758
+ * @memberof subscription.UserSubscriptionResponse
1759
+ * @static
1760
+ * @param {subscription.IUserSubscriptionResponse=} [properties] Properties to set
1761
+ * @returns {subscription.UserSubscriptionResponse} UserSubscriptionResponse instance
1762
+ */
1763
+ UserSubscriptionResponse.create = function create(properties) {
1764
+ return new UserSubscriptionResponse(properties);
1765
+ };
1766
+
1767
+ /**
1768
+ * Encodes the specified UserSubscriptionResponse message. Does not implicitly {@link subscription.UserSubscriptionResponse.verify|verify} messages.
1769
+ * @function encode
1770
+ * @memberof subscription.UserSubscriptionResponse
1771
+ * @static
1772
+ * @param {subscription.IUserSubscriptionResponse} message UserSubscriptionResponse message or plain object to encode
1773
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1774
+ * @returns {$protobuf.Writer} Writer
1775
+ */
1776
+ UserSubscriptionResponse.encode = function encode(message, writer) {
1777
+ if (!writer)
1778
+ writer = $Writer.create();
1779
+ if (message.id != null && message.hasOwnProperty("id"))
1780
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
1781
+ if (message.startsAtIso8601 != null && message.hasOwnProperty("startsAtIso8601"))
1782
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.startsAtIso8601);
1783
+ if (message.endsAtIso8601 != null && message.hasOwnProperty("endsAtIso8601"))
1784
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.endsAtIso8601);
1785
+ if (message.status != null && message.hasOwnProperty("status"))
1786
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.status);
1787
+ if (message.legacySubscriptionId != null && message.hasOwnProperty("legacySubscriptionId"))
1788
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.legacySubscriptionId);
1789
+ return writer;
1790
+ };
1791
+
1792
+ /**
1793
+ * Encodes the specified UserSubscriptionResponse message, length delimited. Does not implicitly {@link subscription.UserSubscriptionResponse.verify|verify} messages.
1794
+ * @function encodeDelimited
1795
+ * @memberof subscription.UserSubscriptionResponse
1796
+ * @static
1797
+ * @param {subscription.IUserSubscriptionResponse} message UserSubscriptionResponse message or plain object to encode
1798
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1799
+ * @returns {$protobuf.Writer} Writer
1800
+ */
1801
+ UserSubscriptionResponse.encodeDelimited = function encodeDelimited(message, writer) {
1802
+ return this.encode(message, writer).ldelim();
1803
+ };
1804
+
1805
+ /**
1806
+ * Decodes a UserSubscriptionResponse message from the specified reader or buffer.
1807
+ * @function decode
1808
+ * @memberof subscription.UserSubscriptionResponse
1809
+ * @static
1810
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1811
+ * @param {number} [length] Message length if known beforehand
1812
+ * @returns {subscription.UserSubscriptionResponse} UserSubscriptionResponse
1813
+ * @throws {Error} If the payload is not a reader or valid buffer
1814
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1815
+ */
1816
+ UserSubscriptionResponse.decode = function decode(reader, length) {
1817
+ if (!(reader instanceof $Reader))
1818
+ reader = $Reader.create(reader);
1819
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.subscription.UserSubscriptionResponse();
1820
+ while (reader.pos < end) {
1821
+ var tag = reader.uint32();
1822
+ switch (tag >>> 3) {
1823
+ case 1:
1824
+ message.id = reader.string();
1825
+ break;
1826
+ case 2:
1827
+ message.startsAtIso8601 = reader.string();
1828
+ break;
1829
+ case 3:
1830
+ message.endsAtIso8601 = reader.string();
1831
+ break;
1832
+ case 4:
1833
+ message.status = reader.string();
1834
+ break;
1835
+ case 8:
1836
+ message.legacySubscriptionId = reader.string();
1837
+ break;
1838
+ default:
1839
+ reader.skipType(tag & 7);
1840
+ break;
1841
+ }
1842
+ }
1843
+ return message;
1844
+ };
1845
+
1846
+ /**
1847
+ * Decodes a UserSubscriptionResponse message from the specified reader or buffer, length delimited.
1848
+ * @function decodeDelimited
1849
+ * @memberof subscription.UserSubscriptionResponse
1850
+ * @static
1851
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1852
+ * @returns {subscription.UserSubscriptionResponse} UserSubscriptionResponse
1853
+ * @throws {Error} If the payload is not a reader or valid buffer
1854
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1855
+ */
1856
+ UserSubscriptionResponse.decodeDelimited = function decodeDelimited(reader) {
1857
+ if (!(reader instanceof $Reader))
1858
+ reader = new $Reader(reader);
1859
+ return this.decode(reader, reader.uint32());
1860
+ };
1861
+
1862
+ /**
1863
+ * Verifies a UserSubscriptionResponse message.
1864
+ * @function verify
1865
+ * @memberof subscription.UserSubscriptionResponse
1866
+ * @static
1867
+ * @param {Object.<string,*>} message Plain object to verify
1868
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1869
+ */
1870
+ UserSubscriptionResponse.verify = function verify(message) {
1871
+ if (typeof message !== "object" || message === null)
1872
+ return "object expected";
1873
+ if (message.id != null && message.hasOwnProperty("id"))
1874
+ if (!$util.isString(message.id))
1875
+ return "id: string expected";
1876
+ if (message.startsAtIso8601 != null && message.hasOwnProperty("startsAtIso8601"))
1877
+ if (!$util.isString(message.startsAtIso8601))
1878
+ return "startsAtIso8601: string expected";
1879
+ if (message.endsAtIso8601 != null && message.hasOwnProperty("endsAtIso8601"))
1880
+ if (!$util.isString(message.endsAtIso8601))
1881
+ return "endsAtIso8601: string expected";
1882
+ if (message.status != null && message.hasOwnProperty("status"))
1883
+ if (!$util.isString(message.status))
1884
+ return "status: string expected";
1885
+ if (message.legacySubscriptionId != null && message.hasOwnProperty("legacySubscriptionId"))
1886
+ if (!$util.isString(message.legacySubscriptionId))
1887
+ return "legacySubscriptionId: string expected";
1888
+ return null;
1889
+ };
1890
+
1891
+ /**
1892
+ * Creates a UserSubscriptionResponse message from a plain object. Also converts values to their respective internal types.
1893
+ * @function fromObject
1894
+ * @memberof subscription.UserSubscriptionResponse
1895
+ * @static
1896
+ * @param {Object.<string,*>} object Plain object
1897
+ * @returns {subscription.UserSubscriptionResponse} UserSubscriptionResponse
1898
+ */
1899
+ UserSubscriptionResponse.fromObject = function fromObject(object) {
1900
+ if (object instanceof $root.subscription.UserSubscriptionResponse)
1901
+ return object;
1902
+ var message = new $root.subscription.UserSubscriptionResponse();
1903
+ if (object.id != null)
1904
+ message.id = String(object.id);
1905
+ if (object.startsAtIso8601 != null)
1906
+ message.startsAtIso8601 = String(object.startsAtIso8601);
1907
+ if (object.endsAtIso8601 != null)
1908
+ message.endsAtIso8601 = String(object.endsAtIso8601);
1909
+ if (object.status != null)
1910
+ message.status = String(object.status);
1911
+ if (object.legacySubscriptionId != null)
1912
+ message.legacySubscriptionId = String(object.legacySubscriptionId);
1913
+ return message;
1914
+ };
1915
+
1916
+ /**
1917
+ * Creates a plain object from a UserSubscriptionResponse message. Also converts values to other types if specified.
1918
+ * @function toObject
1919
+ * @memberof subscription.UserSubscriptionResponse
1920
+ * @static
1921
+ * @param {subscription.UserSubscriptionResponse} message UserSubscriptionResponse
1922
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1923
+ * @returns {Object.<string,*>} Plain object
1924
+ */
1925
+ UserSubscriptionResponse.toObject = function toObject(message, options) {
1926
+ if (!options)
1927
+ options = {};
1928
+ var object = {};
1929
+ if (options.defaults) {
1930
+ object.id = "";
1931
+ object.startsAtIso8601 = "";
1932
+ object.endsAtIso8601 = "";
1933
+ object.status = "";
1934
+ object.legacySubscriptionId = "";
1935
+ }
1936
+ if (message.id != null && message.hasOwnProperty("id"))
1937
+ object.id = message.id;
1938
+ if (message.startsAtIso8601 != null && message.hasOwnProperty("startsAtIso8601"))
1939
+ object.startsAtIso8601 = message.startsAtIso8601;
1940
+ if (message.endsAtIso8601 != null && message.hasOwnProperty("endsAtIso8601"))
1941
+ object.endsAtIso8601 = message.endsAtIso8601;
1942
+ if (message.status != null && message.hasOwnProperty("status"))
1943
+ object.status = message.status;
1944
+ if (message.legacySubscriptionId != null && message.hasOwnProperty("legacySubscriptionId"))
1945
+ object.legacySubscriptionId = message.legacySubscriptionId;
1946
+ return object;
1947
+ };
1948
+
1949
+ /**
1950
+ * Converts this UserSubscriptionResponse to JSON.
1951
+ * @function toJSON
1952
+ * @memberof subscription.UserSubscriptionResponse
1953
+ * @instance
1954
+ * @returns {Object.<string,*>} JSON object
1955
+ */
1956
+ UserSubscriptionResponse.prototype.toJSON = function toJSON() {
1957
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1958
+ };
1959
+
1960
+ return UserSubscriptionResponse;
1961
+ })();
1962
+
1444
1963
  subscription.Plan = (function() {
1445
1964
 
1446
1965
  /**
package/package.json CHANGED
@@ -16,5 +16,5 @@
16
16
  "main": "lib/index.js",
17
17
  "name": "@headspace/protos-events",
18
18
  "typings": "lib/index.d.ts",
19
- "version": "1.20.0"
19
+ "version": "1.22.0"
20
20
  }