@headspace/protos-events 1.53.0 → 1.54.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
@@ -4603,6 +4603,288 @@ export class SubscriptionGraced implements ISubscriptionGraced {
4603
4603
  public toJSON(): { [k: string]: any };
4604
4604
  }
4605
4605
 
4606
+ /** Properties of a SubscriptionStarted. */
4607
+ export interface ISubscriptionStarted {
4608
+
4609
+ /** SubscriptionStarted updatedOn */
4610
+ updatedOn?: (number|Long|null);
4611
+
4612
+ /** SubscriptionStarted userId */
4613
+ userId?: (string|null);
4614
+
4615
+ /** SubscriptionStarted createdAt */
4616
+ createdAt?: (number|Long|null);
4617
+
4618
+ /** SubscriptionStarted startsAt */
4619
+ startsAt?: (number|Long|null);
4620
+
4621
+ /** SubscriptionStarted endsAt */
4622
+ endsAt?: (number|Long|null);
4623
+
4624
+ /** SubscriptionStarted voucherCode */
4625
+ voucherCode?: (string|null);
4626
+
4627
+ /** SubscriptionStarted platform */
4628
+ platform?: (subscription.SubscriptionPlatform|null);
4629
+
4630
+ /** SubscriptionStarted autoRenewalStatus */
4631
+ autoRenewalStatus?: (subscription.AutoRenewalStatus|null);
4632
+
4633
+ /** SubscriptionStarted plan */
4634
+ plan?: (subscription.IPlan|null);
4635
+ }
4636
+
4637
+ /** Represents a SubscriptionStarted. */
4638
+ export class SubscriptionStarted implements ISubscriptionStarted {
4639
+
4640
+ /**
4641
+ * Constructs a new SubscriptionStarted.
4642
+ * @param [properties] Properties to set
4643
+ */
4644
+ constructor(properties?: ISubscriptionStarted);
4645
+
4646
+ /** SubscriptionStarted updatedOn. */
4647
+ public updatedOn: (number|Long);
4648
+
4649
+ /** SubscriptionStarted userId. */
4650
+ public userId: string;
4651
+
4652
+ /** SubscriptionStarted createdAt. */
4653
+ public createdAt: (number|Long);
4654
+
4655
+ /** SubscriptionStarted startsAt. */
4656
+ public startsAt: (number|Long);
4657
+
4658
+ /** SubscriptionStarted endsAt. */
4659
+ public endsAt: (number|Long);
4660
+
4661
+ /** SubscriptionStarted voucherCode. */
4662
+ public voucherCode: string;
4663
+
4664
+ /** SubscriptionStarted platform. */
4665
+ public platform: subscription.SubscriptionPlatform;
4666
+
4667
+ /** SubscriptionStarted autoRenewalStatus. */
4668
+ public autoRenewalStatus: subscription.AutoRenewalStatus;
4669
+
4670
+ /** SubscriptionStarted plan. */
4671
+ public plan?: (subscription.IPlan|null);
4672
+
4673
+ /**
4674
+ * Creates a new SubscriptionStarted instance using the specified properties.
4675
+ * @param [properties] Properties to set
4676
+ * @returns SubscriptionStarted instance
4677
+ */
4678
+ public static create(properties?: ISubscriptionStarted): SubscriptionStarted;
4679
+
4680
+ /**
4681
+ * Encodes the specified SubscriptionStarted message. Does not implicitly {@link SubscriptionStarted.verify|verify} messages.
4682
+ * @param message SubscriptionStarted message or plain object to encode
4683
+ * @param [writer] Writer to encode to
4684
+ * @returns Writer
4685
+ */
4686
+ public static encode(message: ISubscriptionStarted, writer?: $protobuf.Writer): $protobuf.Writer;
4687
+
4688
+ /**
4689
+ * Encodes the specified SubscriptionStarted message, length delimited. Does not implicitly {@link SubscriptionStarted.verify|verify} messages.
4690
+ * @param message SubscriptionStarted message or plain object to encode
4691
+ * @param [writer] Writer to encode to
4692
+ * @returns Writer
4693
+ */
4694
+ public static encodeDelimited(message: ISubscriptionStarted, writer?: $protobuf.Writer): $protobuf.Writer;
4695
+
4696
+ /**
4697
+ * Decodes a SubscriptionStarted message from the specified reader or buffer.
4698
+ * @param reader Reader or buffer to decode from
4699
+ * @param [length] Message length if known beforehand
4700
+ * @returns SubscriptionStarted
4701
+ * @throws {Error} If the payload is not a reader or valid buffer
4702
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
4703
+ */
4704
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SubscriptionStarted;
4705
+
4706
+ /**
4707
+ * Decodes a SubscriptionStarted message from the specified reader or buffer, length delimited.
4708
+ * @param reader Reader or buffer to decode from
4709
+ * @returns SubscriptionStarted
4710
+ * @throws {Error} If the payload is not a reader or valid buffer
4711
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
4712
+ */
4713
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SubscriptionStarted;
4714
+
4715
+ /**
4716
+ * Verifies a SubscriptionStarted message.
4717
+ * @param message Plain object to verify
4718
+ * @returns `null` if valid, otherwise the reason why it is not
4719
+ */
4720
+ public static verify(message: { [k: string]: any }): (string|null);
4721
+
4722
+ /**
4723
+ * Creates a SubscriptionStarted message from a plain object. Also converts values to their respective internal types.
4724
+ * @param object Plain object
4725
+ * @returns SubscriptionStarted
4726
+ */
4727
+ public static fromObject(object: { [k: string]: any }): SubscriptionStarted;
4728
+
4729
+ /**
4730
+ * Creates a plain object from a SubscriptionStarted message. Also converts values to other types if specified.
4731
+ * @param message SubscriptionStarted
4732
+ * @param [options] Conversion options
4733
+ * @returns Plain object
4734
+ */
4735
+ public static toObject(message: SubscriptionStarted, options?: $protobuf.IConversionOptions): { [k: string]: any };
4736
+
4737
+ /**
4738
+ * Converts this SubscriptionStarted to JSON.
4739
+ * @returns JSON object
4740
+ */
4741
+ public toJSON(): { [k: string]: any };
4742
+ }
4743
+
4744
+ /** Properties of a SubscriptionEnded. */
4745
+ export interface ISubscriptionEnded {
4746
+
4747
+ /** SubscriptionEnded updatedOn */
4748
+ updatedOn?: (number|Long|null);
4749
+
4750
+ /** SubscriptionEnded userId */
4751
+ userId?: (string|null);
4752
+
4753
+ /** SubscriptionEnded createdAt */
4754
+ createdAt?: (number|Long|null);
4755
+
4756
+ /** SubscriptionEnded startsAt */
4757
+ startsAt?: (number|Long|null);
4758
+
4759
+ /** SubscriptionEnded endsAt */
4760
+ endsAt?: (number|Long|null);
4761
+
4762
+ /** SubscriptionEnded voucherCode */
4763
+ voucherCode?: (string|null);
4764
+
4765
+ /** SubscriptionEnded platform */
4766
+ platform?: (subscription.SubscriptionPlatform|null);
4767
+
4768
+ /** SubscriptionEnded autoRenewalStatus */
4769
+ autoRenewalStatus?: (subscription.AutoRenewalStatus|null);
4770
+
4771
+ /** SubscriptionEnded plan */
4772
+ plan?: (subscription.IPlan|null);
4773
+
4774
+ /** SubscriptionEnded cancellationType */
4775
+ cancellationType?: (subscription.CancellationType|null);
4776
+ }
4777
+
4778
+ /** Represents a SubscriptionEnded. */
4779
+ export class SubscriptionEnded implements ISubscriptionEnded {
4780
+
4781
+ /**
4782
+ * Constructs a new SubscriptionEnded.
4783
+ * @param [properties] Properties to set
4784
+ */
4785
+ constructor(properties?: ISubscriptionEnded);
4786
+
4787
+ /** SubscriptionEnded updatedOn. */
4788
+ public updatedOn: (number|Long);
4789
+
4790
+ /** SubscriptionEnded userId. */
4791
+ public userId: string;
4792
+
4793
+ /** SubscriptionEnded createdAt. */
4794
+ public createdAt: (number|Long);
4795
+
4796
+ /** SubscriptionEnded startsAt. */
4797
+ public startsAt: (number|Long);
4798
+
4799
+ /** SubscriptionEnded endsAt. */
4800
+ public endsAt: (number|Long);
4801
+
4802
+ /** SubscriptionEnded voucherCode. */
4803
+ public voucherCode: string;
4804
+
4805
+ /** SubscriptionEnded platform. */
4806
+ public platform: subscription.SubscriptionPlatform;
4807
+
4808
+ /** SubscriptionEnded autoRenewalStatus. */
4809
+ public autoRenewalStatus: subscription.AutoRenewalStatus;
4810
+
4811
+ /** SubscriptionEnded plan. */
4812
+ public plan?: (subscription.IPlan|null);
4813
+
4814
+ /** SubscriptionEnded cancellationType. */
4815
+ public cancellationType: subscription.CancellationType;
4816
+
4817
+ /**
4818
+ * Creates a new SubscriptionEnded instance using the specified properties.
4819
+ * @param [properties] Properties to set
4820
+ * @returns SubscriptionEnded instance
4821
+ */
4822
+ public static create(properties?: ISubscriptionEnded): SubscriptionEnded;
4823
+
4824
+ /**
4825
+ * Encodes the specified SubscriptionEnded message. Does not implicitly {@link SubscriptionEnded.verify|verify} messages.
4826
+ * @param message SubscriptionEnded message or plain object to encode
4827
+ * @param [writer] Writer to encode to
4828
+ * @returns Writer
4829
+ */
4830
+ public static encode(message: ISubscriptionEnded, writer?: $protobuf.Writer): $protobuf.Writer;
4831
+
4832
+ /**
4833
+ * Encodes the specified SubscriptionEnded message, length delimited. Does not implicitly {@link SubscriptionEnded.verify|verify} messages.
4834
+ * @param message SubscriptionEnded message or plain object to encode
4835
+ * @param [writer] Writer to encode to
4836
+ * @returns Writer
4837
+ */
4838
+ public static encodeDelimited(message: ISubscriptionEnded, writer?: $protobuf.Writer): $protobuf.Writer;
4839
+
4840
+ /**
4841
+ * Decodes a SubscriptionEnded message from the specified reader or buffer.
4842
+ * @param reader Reader or buffer to decode from
4843
+ * @param [length] Message length if known beforehand
4844
+ * @returns SubscriptionEnded
4845
+ * @throws {Error} If the payload is not a reader or valid buffer
4846
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
4847
+ */
4848
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SubscriptionEnded;
4849
+
4850
+ /**
4851
+ * Decodes a SubscriptionEnded message from the specified reader or buffer, length delimited.
4852
+ * @param reader Reader or buffer to decode from
4853
+ * @returns SubscriptionEnded
4854
+ * @throws {Error} If the payload is not a reader or valid buffer
4855
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
4856
+ */
4857
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SubscriptionEnded;
4858
+
4859
+ /**
4860
+ * Verifies a SubscriptionEnded message.
4861
+ * @param message Plain object to verify
4862
+ * @returns `null` if valid, otherwise the reason why it is not
4863
+ */
4864
+ public static verify(message: { [k: string]: any }): (string|null);
4865
+
4866
+ /**
4867
+ * Creates a SubscriptionEnded message from a plain object. Also converts values to their respective internal types.
4868
+ * @param object Plain object
4869
+ * @returns SubscriptionEnded
4870
+ */
4871
+ public static fromObject(object: { [k: string]: any }): SubscriptionEnded;
4872
+
4873
+ /**
4874
+ * Creates a plain object from a SubscriptionEnded message. Also converts values to other types if specified.
4875
+ * @param message SubscriptionEnded
4876
+ * @param [options] Conversion options
4877
+ * @returns Plain object
4878
+ */
4879
+ public static toObject(message: SubscriptionEnded, options?: $protobuf.IConversionOptions): { [k: string]: any };
4880
+
4881
+ /**
4882
+ * Converts this SubscriptionEnded to JSON.
4883
+ * @returns JSON object
4884
+ */
4885
+ public toJSON(): { [k: string]: any };
4886
+ }
4887
+
4606
4888
  /** Properties of a UserDoubleOptInEmailRequested. */
4607
4889
  export interface IUserDoubleOptInEmailRequested {
4608
4890
 
package/lib/index.js CHANGED
@@ -11893,6 +11893,998 @@ $root.SubscriptionGraced = (function() {
11893
11893
  return SubscriptionGraced;
11894
11894
  })();
11895
11895
 
11896
+ $root.SubscriptionStarted = (function() {
11897
+
11898
+ /**
11899
+ * Properties of a SubscriptionStarted.
11900
+ * @exports ISubscriptionStarted
11901
+ * @interface ISubscriptionStarted
11902
+ * @property {number|Long|null} [updatedOn] SubscriptionStarted updatedOn
11903
+ * @property {string|null} [userId] SubscriptionStarted userId
11904
+ * @property {number|Long|null} [createdAt] SubscriptionStarted createdAt
11905
+ * @property {number|Long|null} [startsAt] SubscriptionStarted startsAt
11906
+ * @property {number|Long|null} [endsAt] SubscriptionStarted endsAt
11907
+ * @property {string|null} [voucherCode] SubscriptionStarted voucherCode
11908
+ * @property {subscription.SubscriptionPlatform|null} [platform] SubscriptionStarted platform
11909
+ * @property {subscription.AutoRenewalStatus|null} [autoRenewalStatus] SubscriptionStarted autoRenewalStatus
11910
+ * @property {subscription.IPlan|null} [plan] SubscriptionStarted plan
11911
+ */
11912
+
11913
+ /**
11914
+ * Constructs a new SubscriptionStarted.
11915
+ * @exports SubscriptionStarted
11916
+ * @classdesc Represents a SubscriptionStarted.
11917
+ * @implements ISubscriptionStarted
11918
+ * @constructor
11919
+ * @param {ISubscriptionStarted=} [properties] Properties to set
11920
+ */
11921
+ function SubscriptionStarted(properties) {
11922
+ if (properties)
11923
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
11924
+ if (properties[keys[i]] != null)
11925
+ this[keys[i]] = properties[keys[i]];
11926
+ }
11927
+
11928
+ /**
11929
+ * SubscriptionStarted updatedOn.
11930
+ * @member {number|Long} updatedOn
11931
+ * @memberof SubscriptionStarted
11932
+ * @instance
11933
+ */
11934
+ SubscriptionStarted.prototype.updatedOn = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
11935
+
11936
+ /**
11937
+ * SubscriptionStarted userId.
11938
+ * @member {string} userId
11939
+ * @memberof SubscriptionStarted
11940
+ * @instance
11941
+ */
11942
+ SubscriptionStarted.prototype.userId = "";
11943
+
11944
+ /**
11945
+ * SubscriptionStarted createdAt.
11946
+ * @member {number|Long} createdAt
11947
+ * @memberof SubscriptionStarted
11948
+ * @instance
11949
+ */
11950
+ SubscriptionStarted.prototype.createdAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
11951
+
11952
+ /**
11953
+ * SubscriptionStarted startsAt.
11954
+ * @member {number|Long} startsAt
11955
+ * @memberof SubscriptionStarted
11956
+ * @instance
11957
+ */
11958
+ SubscriptionStarted.prototype.startsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
11959
+
11960
+ /**
11961
+ * SubscriptionStarted endsAt.
11962
+ * @member {number|Long} endsAt
11963
+ * @memberof SubscriptionStarted
11964
+ * @instance
11965
+ */
11966
+ SubscriptionStarted.prototype.endsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
11967
+
11968
+ /**
11969
+ * SubscriptionStarted voucherCode.
11970
+ * @member {string} voucherCode
11971
+ * @memberof SubscriptionStarted
11972
+ * @instance
11973
+ */
11974
+ SubscriptionStarted.prototype.voucherCode = "";
11975
+
11976
+ /**
11977
+ * SubscriptionStarted platform.
11978
+ * @member {subscription.SubscriptionPlatform} platform
11979
+ * @memberof SubscriptionStarted
11980
+ * @instance
11981
+ */
11982
+ SubscriptionStarted.prototype.platform = 0;
11983
+
11984
+ /**
11985
+ * SubscriptionStarted autoRenewalStatus.
11986
+ * @member {subscription.AutoRenewalStatus} autoRenewalStatus
11987
+ * @memberof SubscriptionStarted
11988
+ * @instance
11989
+ */
11990
+ SubscriptionStarted.prototype.autoRenewalStatus = 0;
11991
+
11992
+ /**
11993
+ * SubscriptionStarted plan.
11994
+ * @member {subscription.IPlan|null|undefined} plan
11995
+ * @memberof SubscriptionStarted
11996
+ * @instance
11997
+ */
11998
+ SubscriptionStarted.prototype.plan = null;
11999
+
12000
+ /**
12001
+ * Creates a new SubscriptionStarted instance using the specified properties.
12002
+ * @function create
12003
+ * @memberof SubscriptionStarted
12004
+ * @static
12005
+ * @param {ISubscriptionStarted=} [properties] Properties to set
12006
+ * @returns {SubscriptionStarted} SubscriptionStarted instance
12007
+ */
12008
+ SubscriptionStarted.create = function create(properties) {
12009
+ return new SubscriptionStarted(properties);
12010
+ };
12011
+
12012
+ /**
12013
+ * Encodes the specified SubscriptionStarted message. Does not implicitly {@link SubscriptionStarted.verify|verify} messages.
12014
+ * @function encode
12015
+ * @memberof SubscriptionStarted
12016
+ * @static
12017
+ * @param {ISubscriptionStarted} message SubscriptionStarted message or plain object to encode
12018
+ * @param {$protobuf.Writer} [writer] Writer to encode to
12019
+ * @returns {$protobuf.Writer} Writer
12020
+ */
12021
+ SubscriptionStarted.encode = function encode(message, writer) {
12022
+ if (!writer)
12023
+ writer = $Writer.create();
12024
+ if (message.updatedOn != null && message.hasOwnProperty("updatedOn"))
12025
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.updatedOn);
12026
+ if (message.userId != null && message.hasOwnProperty("userId"))
12027
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.userId);
12028
+ if (message.createdAt != null && message.hasOwnProperty("createdAt"))
12029
+ writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.createdAt);
12030
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
12031
+ writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.startsAt);
12032
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
12033
+ writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.endsAt);
12034
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
12035
+ writer.uint32(/* id 7, wireType 2 =*/58).string(message.voucherCode);
12036
+ if (message.platform != null && message.hasOwnProperty("platform"))
12037
+ writer.uint32(/* id 8, wireType 0 =*/64).int32(message.platform);
12038
+ if (message.autoRenewalStatus != null && message.hasOwnProperty("autoRenewalStatus"))
12039
+ writer.uint32(/* id 9, wireType 0 =*/72).int32(message.autoRenewalStatus);
12040
+ if (message.plan != null && message.hasOwnProperty("plan"))
12041
+ $root.subscription.Plan.encode(message.plan, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
12042
+ return writer;
12043
+ };
12044
+
12045
+ /**
12046
+ * Encodes the specified SubscriptionStarted message, length delimited. Does not implicitly {@link SubscriptionStarted.verify|verify} messages.
12047
+ * @function encodeDelimited
12048
+ * @memberof SubscriptionStarted
12049
+ * @static
12050
+ * @param {ISubscriptionStarted} message SubscriptionStarted message or plain object to encode
12051
+ * @param {$protobuf.Writer} [writer] Writer to encode to
12052
+ * @returns {$protobuf.Writer} Writer
12053
+ */
12054
+ SubscriptionStarted.encodeDelimited = function encodeDelimited(message, writer) {
12055
+ return this.encode(message, writer).ldelim();
12056
+ };
12057
+
12058
+ /**
12059
+ * Decodes a SubscriptionStarted message from the specified reader or buffer.
12060
+ * @function decode
12061
+ * @memberof SubscriptionStarted
12062
+ * @static
12063
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
12064
+ * @param {number} [length] Message length if known beforehand
12065
+ * @returns {SubscriptionStarted} SubscriptionStarted
12066
+ * @throws {Error} If the payload is not a reader or valid buffer
12067
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
12068
+ */
12069
+ SubscriptionStarted.decode = function decode(reader, length) {
12070
+ if (!(reader instanceof $Reader))
12071
+ reader = $Reader.create(reader);
12072
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SubscriptionStarted();
12073
+ while (reader.pos < end) {
12074
+ var tag = reader.uint32();
12075
+ switch (tag >>> 3) {
12076
+ case 2:
12077
+ message.updatedOn = reader.uint64();
12078
+ break;
12079
+ case 3:
12080
+ message.userId = reader.string();
12081
+ break;
12082
+ case 4:
12083
+ message.createdAt = reader.uint64();
12084
+ break;
12085
+ case 5:
12086
+ message.startsAt = reader.uint64();
12087
+ break;
12088
+ case 6:
12089
+ message.endsAt = reader.uint64();
12090
+ break;
12091
+ case 7:
12092
+ message.voucherCode = reader.string();
12093
+ break;
12094
+ case 8:
12095
+ message.platform = reader.int32();
12096
+ break;
12097
+ case 9:
12098
+ message.autoRenewalStatus = reader.int32();
12099
+ break;
12100
+ case 10:
12101
+ message.plan = $root.subscription.Plan.decode(reader, reader.uint32());
12102
+ break;
12103
+ default:
12104
+ reader.skipType(tag & 7);
12105
+ break;
12106
+ }
12107
+ }
12108
+ return message;
12109
+ };
12110
+
12111
+ /**
12112
+ * Decodes a SubscriptionStarted message from the specified reader or buffer, length delimited.
12113
+ * @function decodeDelimited
12114
+ * @memberof SubscriptionStarted
12115
+ * @static
12116
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
12117
+ * @returns {SubscriptionStarted} SubscriptionStarted
12118
+ * @throws {Error} If the payload is not a reader or valid buffer
12119
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
12120
+ */
12121
+ SubscriptionStarted.decodeDelimited = function decodeDelimited(reader) {
12122
+ if (!(reader instanceof $Reader))
12123
+ reader = new $Reader(reader);
12124
+ return this.decode(reader, reader.uint32());
12125
+ };
12126
+
12127
+ /**
12128
+ * Verifies a SubscriptionStarted message.
12129
+ * @function verify
12130
+ * @memberof SubscriptionStarted
12131
+ * @static
12132
+ * @param {Object.<string,*>} message Plain object to verify
12133
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
12134
+ */
12135
+ SubscriptionStarted.verify = function verify(message) {
12136
+ if (typeof message !== "object" || message === null)
12137
+ return "object expected";
12138
+ if (message.updatedOn != null && message.hasOwnProperty("updatedOn"))
12139
+ if (!$util.isInteger(message.updatedOn) && !(message.updatedOn && $util.isInteger(message.updatedOn.low) && $util.isInteger(message.updatedOn.high)))
12140
+ return "updatedOn: integer|Long expected";
12141
+ if (message.userId != null && message.hasOwnProperty("userId"))
12142
+ if (!$util.isString(message.userId))
12143
+ return "userId: string expected";
12144
+ if (message.createdAt != null && message.hasOwnProperty("createdAt"))
12145
+ if (!$util.isInteger(message.createdAt) && !(message.createdAt && $util.isInteger(message.createdAt.low) && $util.isInteger(message.createdAt.high)))
12146
+ return "createdAt: integer|Long expected";
12147
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
12148
+ if (!$util.isInteger(message.startsAt) && !(message.startsAt && $util.isInteger(message.startsAt.low) && $util.isInteger(message.startsAt.high)))
12149
+ return "startsAt: integer|Long expected";
12150
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
12151
+ if (!$util.isInteger(message.endsAt) && !(message.endsAt && $util.isInteger(message.endsAt.low) && $util.isInteger(message.endsAt.high)))
12152
+ return "endsAt: integer|Long expected";
12153
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
12154
+ if (!$util.isString(message.voucherCode))
12155
+ return "voucherCode: string expected";
12156
+ if (message.platform != null && message.hasOwnProperty("platform"))
12157
+ switch (message.platform) {
12158
+ default:
12159
+ return "platform: enum value expected";
12160
+ case 0:
12161
+ case 1:
12162
+ case 2:
12163
+ case 3:
12164
+ case 4:
12165
+ case 5:
12166
+ break;
12167
+ }
12168
+ if (message.autoRenewalStatus != null && message.hasOwnProperty("autoRenewalStatus"))
12169
+ switch (message.autoRenewalStatus) {
12170
+ default:
12171
+ return "autoRenewalStatus: enum value expected";
12172
+ case 0:
12173
+ case 1:
12174
+ case 2:
12175
+ break;
12176
+ }
12177
+ if (message.plan != null && message.hasOwnProperty("plan")) {
12178
+ var error = $root.subscription.Plan.verify(message.plan);
12179
+ if (error)
12180
+ return "plan." + error;
12181
+ }
12182
+ return null;
12183
+ };
12184
+
12185
+ /**
12186
+ * Creates a SubscriptionStarted message from a plain object. Also converts values to their respective internal types.
12187
+ * @function fromObject
12188
+ * @memberof SubscriptionStarted
12189
+ * @static
12190
+ * @param {Object.<string,*>} object Plain object
12191
+ * @returns {SubscriptionStarted} SubscriptionStarted
12192
+ */
12193
+ SubscriptionStarted.fromObject = function fromObject(object) {
12194
+ if (object instanceof $root.SubscriptionStarted)
12195
+ return object;
12196
+ var message = new $root.SubscriptionStarted();
12197
+ if (object.updatedOn != null)
12198
+ if ($util.Long)
12199
+ (message.updatedOn = $util.Long.fromValue(object.updatedOn)).unsigned = true;
12200
+ else if (typeof object.updatedOn === "string")
12201
+ message.updatedOn = parseInt(object.updatedOn, 10);
12202
+ else if (typeof object.updatedOn === "number")
12203
+ message.updatedOn = object.updatedOn;
12204
+ else if (typeof object.updatedOn === "object")
12205
+ message.updatedOn = new $util.LongBits(object.updatedOn.low >>> 0, object.updatedOn.high >>> 0).toNumber(true);
12206
+ if (object.userId != null)
12207
+ message.userId = String(object.userId);
12208
+ if (object.createdAt != null)
12209
+ if ($util.Long)
12210
+ (message.createdAt = $util.Long.fromValue(object.createdAt)).unsigned = true;
12211
+ else if (typeof object.createdAt === "string")
12212
+ message.createdAt = parseInt(object.createdAt, 10);
12213
+ else if (typeof object.createdAt === "number")
12214
+ message.createdAt = object.createdAt;
12215
+ else if (typeof object.createdAt === "object")
12216
+ message.createdAt = new $util.LongBits(object.createdAt.low >>> 0, object.createdAt.high >>> 0).toNumber(true);
12217
+ if (object.startsAt != null)
12218
+ if ($util.Long)
12219
+ (message.startsAt = $util.Long.fromValue(object.startsAt)).unsigned = true;
12220
+ else if (typeof object.startsAt === "string")
12221
+ message.startsAt = parseInt(object.startsAt, 10);
12222
+ else if (typeof object.startsAt === "number")
12223
+ message.startsAt = object.startsAt;
12224
+ else if (typeof object.startsAt === "object")
12225
+ message.startsAt = new $util.LongBits(object.startsAt.low >>> 0, object.startsAt.high >>> 0).toNumber(true);
12226
+ if (object.endsAt != null)
12227
+ if ($util.Long)
12228
+ (message.endsAt = $util.Long.fromValue(object.endsAt)).unsigned = true;
12229
+ else if (typeof object.endsAt === "string")
12230
+ message.endsAt = parseInt(object.endsAt, 10);
12231
+ else if (typeof object.endsAt === "number")
12232
+ message.endsAt = object.endsAt;
12233
+ else if (typeof object.endsAt === "object")
12234
+ message.endsAt = new $util.LongBits(object.endsAt.low >>> 0, object.endsAt.high >>> 0).toNumber(true);
12235
+ if (object.voucherCode != null)
12236
+ message.voucherCode = String(object.voucherCode);
12237
+ switch (object.platform) {
12238
+ case "PLATFORM_UNKNOWN":
12239
+ case 0:
12240
+ message.platform = 0;
12241
+ break;
12242
+ case "ITUNES":
12243
+ case 1:
12244
+ message.platform = 1;
12245
+ break;
12246
+ case "PLAY_STORE":
12247
+ case 2:
12248
+ message.platform = 2;
12249
+ break;
12250
+ case "ZUORA":
12251
+ case 3:
12252
+ message.platform = 3;
12253
+ break;
12254
+ case "HEADSPACE":
12255
+ case 4:
12256
+ message.platform = 4;
12257
+ break;
12258
+ case "SPOTIFY":
12259
+ case 5:
12260
+ message.platform = 5;
12261
+ break;
12262
+ }
12263
+ switch (object.autoRenewalStatus) {
12264
+ case "UNKNOWN_STATUS":
12265
+ case 0:
12266
+ message.autoRenewalStatus = 0;
12267
+ break;
12268
+ case "ENABLED":
12269
+ case 1:
12270
+ message.autoRenewalStatus = 1;
12271
+ break;
12272
+ case "DISABLED":
12273
+ case 2:
12274
+ message.autoRenewalStatus = 2;
12275
+ break;
12276
+ }
12277
+ if (object.plan != null) {
12278
+ if (typeof object.plan !== "object")
12279
+ throw TypeError(".SubscriptionStarted.plan: object expected");
12280
+ message.plan = $root.subscription.Plan.fromObject(object.plan);
12281
+ }
12282
+ return message;
12283
+ };
12284
+
12285
+ /**
12286
+ * Creates a plain object from a SubscriptionStarted message. Also converts values to other types if specified.
12287
+ * @function toObject
12288
+ * @memberof SubscriptionStarted
12289
+ * @static
12290
+ * @param {SubscriptionStarted} message SubscriptionStarted
12291
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
12292
+ * @returns {Object.<string,*>} Plain object
12293
+ */
12294
+ SubscriptionStarted.toObject = function toObject(message, options) {
12295
+ if (!options)
12296
+ options = {};
12297
+ var object = {};
12298
+ if (options.defaults) {
12299
+ if ($util.Long) {
12300
+ var long = new $util.Long(0, 0, true);
12301
+ object.updatedOn = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
12302
+ } else
12303
+ object.updatedOn = options.longs === String ? "0" : 0;
12304
+ object.userId = "";
12305
+ if ($util.Long) {
12306
+ var long = new $util.Long(0, 0, true);
12307
+ object.createdAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
12308
+ } else
12309
+ object.createdAt = options.longs === String ? "0" : 0;
12310
+ if ($util.Long) {
12311
+ var long = new $util.Long(0, 0, true);
12312
+ object.startsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
12313
+ } else
12314
+ object.startsAt = options.longs === String ? "0" : 0;
12315
+ if ($util.Long) {
12316
+ var long = new $util.Long(0, 0, true);
12317
+ object.endsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
12318
+ } else
12319
+ object.endsAt = options.longs === String ? "0" : 0;
12320
+ object.voucherCode = "";
12321
+ object.platform = options.enums === String ? "PLATFORM_UNKNOWN" : 0;
12322
+ object.autoRenewalStatus = options.enums === String ? "UNKNOWN_STATUS" : 0;
12323
+ object.plan = null;
12324
+ }
12325
+ if (message.updatedOn != null && message.hasOwnProperty("updatedOn"))
12326
+ if (typeof message.updatedOn === "number")
12327
+ object.updatedOn = options.longs === String ? String(message.updatedOn) : message.updatedOn;
12328
+ else
12329
+ object.updatedOn = options.longs === String ? $util.Long.prototype.toString.call(message.updatedOn) : options.longs === Number ? new $util.LongBits(message.updatedOn.low >>> 0, message.updatedOn.high >>> 0).toNumber(true) : message.updatedOn;
12330
+ if (message.userId != null && message.hasOwnProperty("userId"))
12331
+ object.userId = message.userId;
12332
+ if (message.createdAt != null && message.hasOwnProperty("createdAt"))
12333
+ if (typeof message.createdAt === "number")
12334
+ object.createdAt = options.longs === String ? String(message.createdAt) : message.createdAt;
12335
+ else
12336
+ object.createdAt = options.longs === String ? $util.Long.prototype.toString.call(message.createdAt) : options.longs === Number ? new $util.LongBits(message.createdAt.low >>> 0, message.createdAt.high >>> 0).toNumber(true) : message.createdAt;
12337
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
12338
+ if (typeof message.startsAt === "number")
12339
+ object.startsAt = options.longs === String ? String(message.startsAt) : message.startsAt;
12340
+ else
12341
+ object.startsAt = options.longs === String ? $util.Long.prototype.toString.call(message.startsAt) : options.longs === Number ? new $util.LongBits(message.startsAt.low >>> 0, message.startsAt.high >>> 0).toNumber(true) : message.startsAt;
12342
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
12343
+ if (typeof message.endsAt === "number")
12344
+ object.endsAt = options.longs === String ? String(message.endsAt) : message.endsAt;
12345
+ else
12346
+ object.endsAt = options.longs === String ? $util.Long.prototype.toString.call(message.endsAt) : options.longs === Number ? new $util.LongBits(message.endsAt.low >>> 0, message.endsAt.high >>> 0).toNumber(true) : message.endsAt;
12347
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
12348
+ object.voucherCode = message.voucherCode;
12349
+ if (message.platform != null && message.hasOwnProperty("platform"))
12350
+ object.platform = options.enums === String ? $root.subscription.SubscriptionPlatform[message.platform] : message.platform;
12351
+ if (message.autoRenewalStatus != null && message.hasOwnProperty("autoRenewalStatus"))
12352
+ object.autoRenewalStatus = options.enums === String ? $root.subscription.AutoRenewalStatus[message.autoRenewalStatus] : message.autoRenewalStatus;
12353
+ if (message.plan != null && message.hasOwnProperty("plan"))
12354
+ object.plan = $root.subscription.Plan.toObject(message.plan, options);
12355
+ return object;
12356
+ };
12357
+
12358
+ /**
12359
+ * Converts this SubscriptionStarted to JSON.
12360
+ * @function toJSON
12361
+ * @memberof SubscriptionStarted
12362
+ * @instance
12363
+ * @returns {Object.<string,*>} JSON object
12364
+ */
12365
+ SubscriptionStarted.prototype.toJSON = function toJSON() {
12366
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
12367
+ };
12368
+
12369
+ return SubscriptionStarted;
12370
+ })();
12371
+
12372
+ $root.SubscriptionEnded = (function() {
12373
+
12374
+ /**
12375
+ * Properties of a SubscriptionEnded.
12376
+ * @exports ISubscriptionEnded
12377
+ * @interface ISubscriptionEnded
12378
+ * @property {number|Long|null} [updatedOn] SubscriptionEnded updatedOn
12379
+ * @property {string|null} [userId] SubscriptionEnded userId
12380
+ * @property {number|Long|null} [createdAt] SubscriptionEnded createdAt
12381
+ * @property {number|Long|null} [startsAt] SubscriptionEnded startsAt
12382
+ * @property {number|Long|null} [endsAt] SubscriptionEnded endsAt
12383
+ * @property {string|null} [voucherCode] SubscriptionEnded voucherCode
12384
+ * @property {subscription.SubscriptionPlatform|null} [platform] SubscriptionEnded platform
12385
+ * @property {subscription.AutoRenewalStatus|null} [autoRenewalStatus] SubscriptionEnded autoRenewalStatus
12386
+ * @property {subscription.IPlan|null} [plan] SubscriptionEnded plan
12387
+ * @property {subscription.CancellationType|null} [cancellationType] SubscriptionEnded cancellationType
12388
+ */
12389
+
12390
+ /**
12391
+ * Constructs a new SubscriptionEnded.
12392
+ * @exports SubscriptionEnded
12393
+ * @classdesc Represents a SubscriptionEnded.
12394
+ * @implements ISubscriptionEnded
12395
+ * @constructor
12396
+ * @param {ISubscriptionEnded=} [properties] Properties to set
12397
+ */
12398
+ function SubscriptionEnded(properties) {
12399
+ if (properties)
12400
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
12401
+ if (properties[keys[i]] != null)
12402
+ this[keys[i]] = properties[keys[i]];
12403
+ }
12404
+
12405
+ /**
12406
+ * SubscriptionEnded updatedOn.
12407
+ * @member {number|Long} updatedOn
12408
+ * @memberof SubscriptionEnded
12409
+ * @instance
12410
+ */
12411
+ SubscriptionEnded.prototype.updatedOn = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
12412
+
12413
+ /**
12414
+ * SubscriptionEnded userId.
12415
+ * @member {string} userId
12416
+ * @memberof SubscriptionEnded
12417
+ * @instance
12418
+ */
12419
+ SubscriptionEnded.prototype.userId = "";
12420
+
12421
+ /**
12422
+ * SubscriptionEnded createdAt.
12423
+ * @member {number|Long} createdAt
12424
+ * @memberof SubscriptionEnded
12425
+ * @instance
12426
+ */
12427
+ SubscriptionEnded.prototype.createdAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
12428
+
12429
+ /**
12430
+ * SubscriptionEnded startsAt.
12431
+ * @member {number|Long} startsAt
12432
+ * @memberof SubscriptionEnded
12433
+ * @instance
12434
+ */
12435
+ SubscriptionEnded.prototype.startsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
12436
+
12437
+ /**
12438
+ * SubscriptionEnded endsAt.
12439
+ * @member {number|Long} endsAt
12440
+ * @memberof SubscriptionEnded
12441
+ * @instance
12442
+ */
12443
+ SubscriptionEnded.prototype.endsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
12444
+
12445
+ /**
12446
+ * SubscriptionEnded voucherCode.
12447
+ * @member {string} voucherCode
12448
+ * @memberof SubscriptionEnded
12449
+ * @instance
12450
+ */
12451
+ SubscriptionEnded.prototype.voucherCode = "";
12452
+
12453
+ /**
12454
+ * SubscriptionEnded platform.
12455
+ * @member {subscription.SubscriptionPlatform} platform
12456
+ * @memberof SubscriptionEnded
12457
+ * @instance
12458
+ */
12459
+ SubscriptionEnded.prototype.platform = 0;
12460
+
12461
+ /**
12462
+ * SubscriptionEnded autoRenewalStatus.
12463
+ * @member {subscription.AutoRenewalStatus} autoRenewalStatus
12464
+ * @memberof SubscriptionEnded
12465
+ * @instance
12466
+ */
12467
+ SubscriptionEnded.prototype.autoRenewalStatus = 0;
12468
+
12469
+ /**
12470
+ * SubscriptionEnded plan.
12471
+ * @member {subscription.IPlan|null|undefined} plan
12472
+ * @memberof SubscriptionEnded
12473
+ * @instance
12474
+ */
12475
+ SubscriptionEnded.prototype.plan = null;
12476
+
12477
+ /**
12478
+ * SubscriptionEnded cancellationType.
12479
+ * @member {subscription.CancellationType} cancellationType
12480
+ * @memberof SubscriptionEnded
12481
+ * @instance
12482
+ */
12483
+ SubscriptionEnded.prototype.cancellationType = 0;
12484
+
12485
+ /**
12486
+ * Creates a new SubscriptionEnded instance using the specified properties.
12487
+ * @function create
12488
+ * @memberof SubscriptionEnded
12489
+ * @static
12490
+ * @param {ISubscriptionEnded=} [properties] Properties to set
12491
+ * @returns {SubscriptionEnded} SubscriptionEnded instance
12492
+ */
12493
+ SubscriptionEnded.create = function create(properties) {
12494
+ return new SubscriptionEnded(properties);
12495
+ };
12496
+
12497
+ /**
12498
+ * Encodes the specified SubscriptionEnded message. Does not implicitly {@link SubscriptionEnded.verify|verify} messages.
12499
+ * @function encode
12500
+ * @memberof SubscriptionEnded
12501
+ * @static
12502
+ * @param {ISubscriptionEnded} message SubscriptionEnded message or plain object to encode
12503
+ * @param {$protobuf.Writer} [writer] Writer to encode to
12504
+ * @returns {$protobuf.Writer} Writer
12505
+ */
12506
+ SubscriptionEnded.encode = function encode(message, writer) {
12507
+ if (!writer)
12508
+ writer = $Writer.create();
12509
+ if (message.updatedOn != null && message.hasOwnProperty("updatedOn"))
12510
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.updatedOn);
12511
+ if (message.userId != null && message.hasOwnProperty("userId"))
12512
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.userId);
12513
+ if (message.createdAt != null && message.hasOwnProperty("createdAt"))
12514
+ writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.createdAt);
12515
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
12516
+ writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.startsAt);
12517
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
12518
+ writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.endsAt);
12519
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
12520
+ writer.uint32(/* id 7, wireType 2 =*/58).string(message.voucherCode);
12521
+ if (message.platform != null && message.hasOwnProperty("platform"))
12522
+ writer.uint32(/* id 8, wireType 0 =*/64).int32(message.platform);
12523
+ if (message.autoRenewalStatus != null && message.hasOwnProperty("autoRenewalStatus"))
12524
+ writer.uint32(/* id 9, wireType 0 =*/72).int32(message.autoRenewalStatus);
12525
+ if (message.plan != null && message.hasOwnProperty("plan"))
12526
+ $root.subscription.Plan.encode(message.plan, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
12527
+ if (message.cancellationType != null && message.hasOwnProperty("cancellationType"))
12528
+ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.cancellationType);
12529
+ return writer;
12530
+ };
12531
+
12532
+ /**
12533
+ * Encodes the specified SubscriptionEnded message, length delimited. Does not implicitly {@link SubscriptionEnded.verify|verify} messages.
12534
+ * @function encodeDelimited
12535
+ * @memberof SubscriptionEnded
12536
+ * @static
12537
+ * @param {ISubscriptionEnded} message SubscriptionEnded message or plain object to encode
12538
+ * @param {$protobuf.Writer} [writer] Writer to encode to
12539
+ * @returns {$protobuf.Writer} Writer
12540
+ */
12541
+ SubscriptionEnded.encodeDelimited = function encodeDelimited(message, writer) {
12542
+ return this.encode(message, writer).ldelim();
12543
+ };
12544
+
12545
+ /**
12546
+ * Decodes a SubscriptionEnded message from the specified reader or buffer.
12547
+ * @function decode
12548
+ * @memberof SubscriptionEnded
12549
+ * @static
12550
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
12551
+ * @param {number} [length] Message length if known beforehand
12552
+ * @returns {SubscriptionEnded} SubscriptionEnded
12553
+ * @throws {Error} If the payload is not a reader or valid buffer
12554
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
12555
+ */
12556
+ SubscriptionEnded.decode = function decode(reader, length) {
12557
+ if (!(reader instanceof $Reader))
12558
+ reader = $Reader.create(reader);
12559
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SubscriptionEnded();
12560
+ while (reader.pos < end) {
12561
+ var tag = reader.uint32();
12562
+ switch (tag >>> 3) {
12563
+ case 2:
12564
+ message.updatedOn = reader.uint64();
12565
+ break;
12566
+ case 3:
12567
+ message.userId = reader.string();
12568
+ break;
12569
+ case 4:
12570
+ message.createdAt = reader.uint64();
12571
+ break;
12572
+ case 5:
12573
+ message.startsAt = reader.uint64();
12574
+ break;
12575
+ case 6:
12576
+ message.endsAt = reader.uint64();
12577
+ break;
12578
+ case 7:
12579
+ message.voucherCode = reader.string();
12580
+ break;
12581
+ case 8:
12582
+ message.platform = reader.int32();
12583
+ break;
12584
+ case 9:
12585
+ message.autoRenewalStatus = reader.int32();
12586
+ break;
12587
+ case 10:
12588
+ message.plan = $root.subscription.Plan.decode(reader, reader.uint32());
12589
+ break;
12590
+ case 11:
12591
+ message.cancellationType = reader.int32();
12592
+ break;
12593
+ default:
12594
+ reader.skipType(tag & 7);
12595
+ break;
12596
+ }
12597
+ }
12598
+ return message;
12599
+ };
12600
+
12601
+ /**
12602
+ * Decodes a SubscriptionEnded message from the specified reader or buffer, length delimited.
12603
+ * @function decodeDelimited
12604
+ * @memberof SubscriptionEnded
12605
+ * @static
12606
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
12607
+ * @returns {SubscriptionEnded} SubscriptionEnded
12608
+ * @throws {Error} If the payload is not a reader or valid buffer
12609
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
12610
+ */
12611
+ SubscriptionEnded.decodeDelimited = function decodeDelimited(reader) {
12612
+ if (!(reader instanceof $Reader))
12613
+ reader = new $Reader(reader);
12614
+ return this.decode(reader, reader.uint32());
12615
+ };
12616
+
12617
+ /**
12618
+ * Verifies a SubscriptionEnded message.
12619
+ * @function verify
12620
+ * @memberof SubscriptionEnded
12621
+ * @static
12622
+ * @param {Object.<string,*>} message Plain object to verify
12623
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
12624
+ */
12625
+ SubscriptionEnded.verify = function verify(message) {
12626
+ if (typeof message !== "object" || message === null)
12627
+ return "object expected";
12628
+ if (message.updatedOn != null && message.hasOwnProperty("updatedOn"))
12629
+ if (!$util.isInteger(message.updatedOn) && !(message.updatedOn && $util.isInteger(message.updatedOn.low) && $util.isInteger(message.updatedOn.high)))
12630
+ return "updatedOn: integer|Long expected";
12631
+ if (message.userId != null && message.hasOwnProperty("userId"))
12632
+ if (!$util.isString(message.userId))
12633
+ return "userId: string expected";
12634
+ if (message.createdAt != null && message.hasOwnProperty("createdAt"))
12635
+ if (!$util.isInteger(message.createdAt) && !(message.createdAt && $util.isInteger(message.createdAt.low) && $util.isInteger(message.createdAt.high)))
12636
+ return "createdAt: integer|Long expected";
12637
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
12638
+ if (!$util.isInteger(message.startsAt) && !(message.startsAt && $util.isInteger(message.startsAt.low) && $util.isInteger(message.startsAt.high)))
12639
+ return "startsAt: integer|Long expected";
12640
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
12641
+ if (!$util.isInteger(message.endsAt) && !(message.endsAt && $util.isInteger(message.endsAt.low) && $util.isInteger(message.endsAt.high)))
12642
+ return "endsAt: integer|Long expected";
12643
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
12644
+ if (!$util.isString(message.voucherCode))
12645
+ return "voucherCode: string expected";
12646
+ if (message.platform != null && message.hasOwnProperty("platform"))
12647
+ switch (message.platform) {
12648
+ default:
12649
+ return "platform: enum value expected";
12650
+ case 0:
12651
+ case 1:
12652
+ case 2:
12653
+ case 3:
12654
+ case 4:
12655
+ case 5:
12656
+ break;
12657
+ }
12658
+ if (message.autoRenewalStatus != null && message.hasOwnProperty("autoRenewalStatus"))
12659
+ switch (message.autoRenewalStatus) {
12660
+ default:
12661
+ return "autoRenewalStatus: enum value expected";
12662
+ case 0:
12663
+ case 1:
12664
+ case 2:
12665
+ break;
12666
+ }
12667
+ if (message.plan != null && message.hasOwnProperty("plan")) {
12668
+ var error = $root.subscription.Plan.verify(message.plan);
12669
+ if (error)
12670
+ return "plan." + error;
12671
+ }
12672
+ if (message.cancellationType != null && message.hasOwnProperty("cancellationType"))
12673
+ switch (message.cancellationType) {
12674
+ default:
12675
+ return "cancellationType: enum value expected";
12676
+ case 0:
12677
+ case 1:
12678
+ case 2:
12679
+ break;
12680
+ }
12681
+ return null;
12682
+ };
12683
+
12684
+ /**
12685
+ * Creates a SubscriptionEnded message from a plain object. Also converts values to their respective internal types.
12686
+ * @function fromObject
12687
+ * @memberof SubscriptionEnded
12688
+ * @static
12689
+ * @param {Object.<string,*>} object Plain object
12690
+ * @returns {SubscriptionEnded} SubscriptionEnded
12691
+ */
12692
+ SubscriptionEnded.fromObject = function fromObject(object) {
12693
+ if (object instanceof $root.SubscriptionEnded)
12694
+ return object;
12695
+ var message = new $root.SubscriptionEnded();
12696
+ if (object.updatedOn != null)
12697
+ if ($util.Long)
12698
+ (message.updatedOn = $util.Long.fromValue(object.updatedOn)).unsigned = true;
12699
+ else if (typeof object.updatedOn === "string")
12700
+ message.updatedOn = parseInt(object.updatedOn, 10);
12701
+ else if (typeof object.updatedOn === "number")
12702
+ message.updatedOn = object.updatedOn;
12703
+ else if (typeof object.updatedOn === "object")
12704
+ message.updatedOn = new $util.LongBits(object.updatedOn.low >>> 0, object.updatedOn.high >>> 0).toNumber(true);
12705
+ if (object.userId != null)
12706
+ message.userId = String(object.userId);
12707
+ if (object.createdAt != null)
12708
+ if ($util.Long)
12709
+ (message.createdAt = $util.Long.fromValue(object.createdAt)).unsigned = true;
12710
+ else if (typeof object.createdAt === "string")
12711
+ message.createdAt = parseInt(object.createdAt, 10);
12712
+ else if (typeof object.createdAt === "number")
12713
+ message.createdAt = object.createdAt;
12714
+ else if (typeof object.createdAt === "object")
12715
+ message.createdAt = new $util.LongBits(object.createdAt.low >>> 0, object.createdAt.high >>> 0).toNumber(true);
12716
+ if (object.startsAt != null)
12717
+ if ($util.Long)
12718
+ (message.startsAt = $util.Long.fromValue(object.startsAt)).unsigned = true;
12719
+ else if (typeof object.startsAt === "string")
12720
+ message.startsAt = parseInt(object.startsAt, 10);
12721
+ else if (typeof object.startsAt === "number")
12722
+ message.startsAt = object.startsAt;
12723
+ else if (typeof object.startsAt === "object")
12724
+ message.startsAt = new $util.LongBits(object.startsAt.low >>> 0, object.startsAt.high >>> 0).toNumber(true);
12725
+ if (object.endsAt != null)
12726
+ if ($util.Long)
12727
+ (message.endsAt = $util.Long.fromValue(object.endsAt)).unsigned = true;
12728
+ else if (typeof object.endsAt === "string")
12729
+ message.endsAt = parseInt(object.endsAt, 10);
12730
+ else if (typeof object.endsAt === "number")
12731
+ message.endsAt = object.endsAt;
12732
+ else if (typeof object.endsAt === "object")
12733
+ message.endsAt = new $util.LongBits(object.endsAt.low >>> 0, object.endsAt.high >>> 0).toNumber(true);
12734
+ if (object.voucherCode != null)
12735
+ message.voucherCode = String(object.voucherCode);
12736
+ switch (object.platform) {
12737
+ case "PLATFORM_UNKNOWN":
12738
+ case 0:
12739
+ message.platform = 0;
12740
+ break;
12741
+ case "ITUNES":
12742
+ case 1:
12743
+ message.platform = 1;
12744
+ break;
12745
+ case "PLAY_STORE":
12746
+ case 2:
12747
+ message.platform = 2;
12748
+ break;
12749
+ case "ZUORA":
12750
+ case 3:
12751
+ message.platform = 3;
12752
+ break;
12753
+ case "HEADSPACE":
12754
+ case 4:
12755
+ message.platform = 4;
12756
+ break;
12757
+ case "SPOTIFY":
12758
+ case 5:
12759
+ message.platform = 5;
12760
+ break;
12761
+ }
12762
+ switch (object.autoRenewalStatus) {
12763
+ case "UNKNOWN_STATUS":
12764
+ case 0:
12765
+ message.autoRenewalStatus = 0;
12766
+ break;
12767
+ case "ENABLED":
12768
+ case 1:
12769
+ message.autoRenewalStatus = 1;
12770
+ break;
12771
+ case "DISABLED":
12772
+ case 2:
12773
+ message.autoRenewalStatus = 2;
12774
+ break;
12775
+ }
12776
+ if (object.plan != null) {
12777
+ if (typeof object.plan !== "object")
12778
+ throw TypeError(".SubscriptionEnded.plan: object expected");
12779
+ message.plan = $root.subscription.Plan.fromObject(object.plan);
12780
+ }
12781
+ switch (object.cancellationType) {
12782
+ case "CT_UNKNOWN":
12783
+ case 0:
12784
+ message.cancellationType = 0;
12785
+ break;
12786
+ case "CT_ACTIVE":
12787
+ case 1:
12788
+ message.cancellationType = 1;
12789
+ break;
12790
+ case "CT_PASSIVE":
12791
+ case 2:
12792
+ message.cancellationType = 2;
12793
+ break;
12794
+ }
12795
+ return message;
12796
+ };
12797
+
12798
+ /**
12799
+ * Creates a plain object from a SubscriptionEnded message. Also converts values to other types if specified.
12800
+ * @function toObject
12801
+ * @memberof SubscriptionEnded
12802
+ * @static
12803
+ * @param {SubscriptionEnded} message SubscriptionEnded
12804
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
12805
+ * @returns {Object.<string,*>} Plain object
12806
+ */
12807
+ SubscriptionEnded.toObject = function toObject(message, options) {
12808
+ if (!options)
12809
+ options = {};
12810
+ var object = {};
12811
+ if (options.defaults) {
12812
+ if ($util.Long) {
12813
+ var long = new $util.Long(0, 0, true);
12814
+ object.updatedOn = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
12815
+ } else
12816
+ object.updatedOn = options.longs === String ? "0" : 0;
12817
+ object.userId = "";
12818
+ if ($util.Long) {
12819
+ var long = new $util.Long(0, 0, true);
12820
+ object.createdAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
12821
+ } else
12822
+ object.createdAt = options.longs === String ? "0" : 0;
12823
+ if ($util.Long) {
12824
+ var long = new $util.Long(0, 0, true);
12825
+ object.startsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
12826
+ } else
12827
+ object.startsAt = options.longs === String ? "0" : 0;
12828
+ if ($util.Long) {
12829
+ var long = new $util.Long(0, 0, true);
12830
+ object.endsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
12831
+ } else
12832
+ object.endsAt = options.longs === String ? "0" : 0;
12833
+ object.voucherCode = "";
12834
+ object.platform = options.enums === String ? "PLATFORM_UNKNOWN" : 0;
12835
+ object.autoRenewalStatus = options.enums === String ? "UNKNOWN_STATUS" : 0;
12836
+ object.plan = null;
12837
+ object.cancellationType = options.enums === String ? "CT_UNKNOWN" : 0;
12838
+ }
12839
+ if (message.updatedOn != null && message.hasOwnProperty("updatedOn"))
12840
+ if (typeof message.updatedOn === "number")
12841
+ object.updatedOn = options.longs === String ? String(message.updatedOn) : message.updatedOn;
12842
+ else
12843
+ object.updatedOn = options.longs === String ? $util.Long.prototype.toString.call(message.updatedOn) : options.longs === Number ? new $util.LongBits(message.updatedOn.low >>> 0, message.updatedOn.high >>> 0).toNumber(true) : message.updatedOn;
12844
+ if (message.userId != null && message.hasOwnProperty("userId"))
12845
+ object.userId = message.userId;
12846
+ if (message.createdAt != null && message.hasOwnProperty("createdAt"))
12847
+ if (typeof message.createdAt === "number")
12848
+ object.createdAt = options.longs === String ? String(message.createdAt) : message.createdAt;
12849
+ else
12850
+ object.createdAt = options.longs === String ? $util.Long.prototype.toString.call(message.createdAt) : options.longs === Number ? new $util.LongBits(message.createdAt.low >>> 0, message.createdAt.high >>> 0).toNumber(true) : message.createdAt;
12851
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
12852
+ if (typeof message.startsAt === "number")
12853
+ object.startsAt = options.longs === String ? String(message.startsAt) : message.startsAt;
12854
+ else
12855
+ object.startsAt = options.longs === String ? $util.Long.prototype.toString.call(message.startsAt) : options.longs === Number ? new $util.LongBits(message.startsAt.low >>> 0, message.startsAt.high >>> 0).toNumber(true) : message.startsAt;
12856
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
12857
+ if (typeof message.endsAt === "number")
12858
+ object.endsAt = options.longs === String ? String(message.endsAt) : message.endsAt;
12859
+ else
12860
+ object.endsAt = options.longs === String ? $util.Long.prototype.toString.call(message.endsAt) : options.longs === Number ? new $util.LongBits(message.endsAt.low >>> 0, message.endsAt.high >>> 0).toNumber(true) : message.endsAt;
12861
+ if (message.voucherCode != null && message.hasOwnProperty("voucherCode"))
12862
+ object.voucherCode = message.voucherCode;
12863
+ if (message.platform != null && message.hasOwnProperty("platform"))
12864
+ object.platform = options.enums === String ? $root.subscription.SubscriptionPlatform[message.platform] : message.platform;
12865
+ if (message.autoRenewalStatus != null && message.hasOwnProperty("autoRenewalStatus"))
12866
+ object.autoRenewalStatus = options.enums === String ? $root.subscription.AutoRenewalStatus[message.autoRenewalStatus] : message.autoRenewalStatus;
12867
+ if (message.plan != null && message.hasOwnProperty("plan"))
12868
+ object.plan = $root.subscription.Plan.toObject(message.plan, options);
12869
+ if (message.cancellationType != null && message.hasOwnProperty("cancellationType"))
12870
+ object.cancellationType = options.enums === String ? $root.subscription.CancellationType[message.cancellationType] : message.cancellationType;
12871
+ return object;
12872
+ };
12873
+
12874
+ /**
12875
+ * Converts this SubscriptionEnded to JSON.
12876
+ * @function toJSON
12877
+ * @memberof SubscriptionEnded
12878
+ * @instance
12879
+ * @returns {Object.<string,*>} JSON object
12880
+ */
12881
+ SubscriptionEnded.prototype.toJSON = function toJSON() {
12882
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
12883
+ };
12884
+
12885
+ return SubscriptionEnded;
12886
+ })();
12887
+
11896
12888
  $root.UserDoubleOptInEmailRequested = (function() {
11897
12889
 
11898
12890
  /**
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.53.0"
19
+ "version": "1.54.0"
20
20
  }