@headspace/protos-events 1.52.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.
Files changed (3) hide show
  1. package/lib/index.d.ts +294 -0
  2. package/lib/index.js +1036 -0
  3. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -5549,6 +5549,8 @@ $root.MessageSent = (function() {
5549
5549
  * @property {string|null} [deepLink] MessageSent deepLink
5550
5550
  * @property {string|null} [nudgeId] MessageSent nudgeId
5551
5551
  * @property {string|null} [imageUrl] MessageSent imageUrl
5552
+ * @property {string|null} [messageText] MessageSent messageText
5553
+ * @property {string|null} [messageTitle] MessageSent messageTitle
5552
5554
  */
5553
5555
 
5554
5556
  /**
@@ -5622,6 +5624,22 @@ $root.MessageSent = (function() {
5622
5624
  */
5623
5625
  MessageSent.prototype.imageUrl = "";
5624
5626
 
5627
+ /**
5628
+ * MessageSent messageText.
5629
+ * @member {string} messageText
5630
+ * @memberof MessageSent
5631
+ * @instance
5632
+ */
5633
+ MessageSent.prototype.messageText = "";
5634
+
5635
+ /**
5636
+ * MessageSent messageTitle.
5637
+ * @member {string} messageTitle
5638
+ * @memberof MessageSent
5639
+ * @instance
5640
+ */
5641
+ MessageSent.prototype.messageTitle = "";
5642
+
5625
5643
  /**
5626
5644
  * Creates a new MessageSent instance using the specified properties.
5627
5645
  * @function create
@@ -5660,6 +5678,10 @@ $root.MessageSent = (function() {
5660
5678
  writer.uint32(/* id 6, wireType 2 =*/50).string(message.nudgeId);
5661
5679
  if (message.imageUrl != null && message.hasOwnProperty("imageUrl"))
5662
5680
  writer.uint32(/* id 7, wireType 2 =*/58).string(message.imageUrl);
5681
+ if (message.messageText != null && message.hasOwnProperty("messageText"))
5682
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.messageText);
5683
+ if (message.messageTitle != null && message.hasOwnProperty("messageTitle"))
5684
+ writer.uint32(/* id 9, wireType 2 =*/74).string(message.messageTitle);
5663
5685
  return writer;
5664
5686
  };
5665
5687
 
@@ -5715,6 +5737,12 @@ $root.MessageSent = (function() {
5715
5737
  case 7:
5716
5738
  message.imageUrl = reader.string();
5717
5739
  break;
5740
+ case 8:
5741
+ message.messageText = reader.string();
5742
+ break;
5743
+ case 9:
5744
+ message.messageTitle = reader.string();
5745
+ break;
5718
5746
  default:
5719
5747
  reader.skipType(tag & 7);
5720
5748
  break;
@@ -5771,6 +5799,12 @@ $root.MessageSent = (function() {
5771
5799
  if (message.imageUrl != null && message.hasOwnProperty("imageUrl"))
5772
5800
  if (!$util.isString(message.imageUrl))
5773
5801
  return "imageUrl: string expected";
5802
+ if (message.messageText != null && message.hasOwnProperty("messageText"))
5803
+ if (!$util.isString(message.messageText))
5804
+ return "messageText: string expected";
5805
+ if (message.messageTitle != null && message.hasOwnProperty("messageTitle"))
5806
+ if (!$util.isString(message.messageTitle))
5807
+ return "messageTitle: string expected";
5774
5808
  return null;
5775
5809
  };
5776
5810
 
@@ -5800,6 +5834,10 @@ $root.MessageSent = (function() {
5800
5834
  message.nudgeId = String(object.nudgeId);
5801
5835
  if (object.imageUrl != null)
5802
5836
  message.imageUrl = String(object.imageUrl);
5837
+ if (object.messageText != null)
5838
+ message.messageText = String(object.messageText);
5839
+ if (object.messageTitle != null)
5840
+ message.messageTitle = String(object.messageTitle);
5803
5841
  return message;
5804
5842
  };
5805
5843
 
@@ -5824,6 +5862,8 @@ $root.MessageSent = (function() {
5824
5862
  object.deepLink = "";
5825
5863
  object.nudgeId = "";
5826
5864
  object.imageUrl = "";
5865
+ object.messageText = "";
5866
+ object.messageTitle = "";
5827
5867
  }
5828
5868
  if (message.recipientUserId != null && message.hasOwnProperty("recipientUserId"))
5829
5869
  object.recipientUserId = message.recipientUserId;
@@ -5839,6 +5879,10 @@ $root.MessageSent = (function() {
5839
5879
  object.nudgeId = message.nudgeId;
5840
5880
  if (message.imageUrl != null && message.hasOwnProperty("imageUrl"))
5841
5881
  object.imageUrl = message.imageUrl;
5882
+ if (message.messageText != null && message.hasOwnProperty("messageText"))
5883
+ object.messageText = message.messageText;
5884
+ if (message.messageTitle != null && message.hasOwnProperty("messageTitle"))
5885
+ object.messageTitle = message.messageTitle;
5842
5886
  return object;
5843
5887
  };
5844
5888
 
@@ -11849,6 +11893,998 @@ $root.SubscriptionGraced = (function() {
11849
11893
  return SubscriptionGraced;
11850
11894
  })();
11851
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
+
11852
12888
  $root.UserDoubleOptInEmailRequested = (function() {
11853
12889
 
11854
12890
  /**