@headspace/protos-events 1.73.0 → 1.74.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 +352 -0
  2. package/lib/index.js +1062 -0
  3. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -2741,6 +2741,292 @@ $root.subscription = (function() {
2741
2741
  return subscription;
2742
2742
  })();
2743
2743
 
2744
+ $root.appleReceipt = (function() {
2745
+
2746
+ /**
2747
+ * Namespace appleReceipt.
2748
+ * @exports appleReceipt
2749
+ * @namespace
2750
+ */
2751
+ var appleReceipt = {};
2752
+
2753
+ appleReceipt.IosSubscriptionTerm = (function() {
2754
+
2755
+ /**
2756
+ * Properties of an IosSubscriptionTerm.
2757
+ * @memberof appleReceipt
2758
+ * @interface IIosSubscriptionTerm
2759
+ * @property {number|Long|null} [startsAt] IosSubscriptionTerm startsAt
2760
+ * @property {number|Long|null} [endsAt] IosSubscriptionTerm endsAt
2761
+ * @property {boolean|null} [isFreeTrial] IosSubscriptionTerm isFreeTrial
2762
+ */
2763
+
2764
+ /**
2765
+ * Constructs a new IosSubscriptionTerm.
2766
+ * @memberof appleReceipt
2767
+ * @classdesc Represents an IosSubscriptionTerm.
2768
+ * @implements IIosSubscriptionTerm
2769
+ * @constructor
2770
+ * @param {appleReceipt.IIosSubscriptionTerm=} [properties] Properties to set
2771
+ */
2772
+ function IosSubscriptionTerm(properties) {
2773
+ if (properties)
2774
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2775
+ if (properties[keys[i]] != null)
2776
+ this[keys[i]] = properties[keys[i]];
2777
+ }
2778
+
2779
+ /**
2780
+ * IosSubscriptionTerm startsAt.
2781
+ * @member {number|Long} startsAt
2782
+ * @memberof appleReceipt.IosSubscriptionTerm
2783
+ * @instance
2784
+ */
2785
+ IosSubscriptionTerm.prototype.startsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2786
+
2787
+ /**
2788
+ * IosSubscriptionTerm endsAt.
2789
+ * @member {number|Long} endsAt
2790
+ * @memberof appleReceipt.IosSubscriptionTerm
2791
+ * @instance
2792
+ */
2793
+ IosSubscriptionTerm.prototype.endsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
2794
+
2795
+ /**
2796
+ * IosSubscriptionTerm isFreeTrial.
2797
+ * @member {boolean} isFreeTrial
2798
+ * @memberof appleReceipt.IosSubscriptionTerm
2799
+ * @instance
2800
+ */
2801
+ IosSubscriptionTerm.prototype.isFreeTrial = false;
2802
+
2803
+ /**
2804
+ * Creates a new IosSubscriptionTerm instance using the specified properties.
2805
+ * @function create
2806
+ * @memberof appleReceipt.IosSubscriptionTerm
2807
+ * @static
2808
+ * @param {appleReceipt.IIosSubscriptionTerm=} [properties] Properties to set
2809
+ * @returns {appleReceipt.IosSubscriptionTerm} IosSubscriptionTerm instance
2810
+ */
2811
+ IosSubscriptionTerm.create = function create(properties) {
2812
+ return new IosSubscriptionTerm(properties);
2813
+ };
2814
+
2815
+ /**
2816
+ * Encodes the specified IosSubscriptionTerm message. Does not implicitly {@link appleReceipt.IosSubscriptionTerm.verify|verify} messages.
2817
+ * @function encode
2818
+ * @memberof appleReceipt.IosSubscriptionTerm
2819
+ * @static
2820
+ * @param {appleReceipt.IIosSubscriptionTerm} message IosSubscriptionTerm message or plain object to encode
2821
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2822
+ * @returns {$protobuf.Writer} Writer
2823
+ */
2824
+ IosSubscriptionTerm.encode = function encode(message, writer) {
2825
+ if (!writer)
2826
+ writer = $Writer.create();
2827
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
2828
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startsAt);
2829
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
2830
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.endsAt);
2831
+ if (message.isFreeTrial != null && message.hasOwnProperty("isFreeTrial"))
2832
+ writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFreeTrial);
2833
+ return writer;
2834
+ };
2835
+
2836
+ /**
2837
+ * Encodes the specified IosSubscriptionTerm message, length delimited. Does not implicitly {@link appleReceipt.IosSubscriptionTerm.verify|verify} messages.
2838
+ * @function encodeDelimited
2839
+ * @memberof appleReceipt.IosSubscriptionTerm
2840
+ * @static
2841
+ * @param {appleReceipt.IIosSubscriptionTerm} message IosSubscriptionTerm message or plain object to encode
2842
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2843
+ * @returns {$protobuf.Writer} Writer
2844
+ */
2845
+ IosSubscriptionTerm.encodeDelimited = function encodeDelimited(message, writer) {
2846
+ return this.encode(message, writer).ldelim();
2847
+ };
2848
+
2849
+ /**
2850
+ * Decodes an IosSubscriptionTerm message from the specified reader or buffer.
2851
+ * @function decode
2852
+ * @memberof appleReceipt.IosSubscriptionTerm
2853
+ * @static
2854
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2855
+ * @param {number} [length] Message length if known beforehand
2856
+ * @returns {appleReceipt.IosSubscriptionTerm} IosSubscriptionTerm
2857
+ * @throws {Error} If the payload is not a reader or valid buffer
2858
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2859
+ */
2860
+ IosSubscriptionTerm.decode = function decode(reader, length) {
2861
+ if (!(reader instanceof $Reader))
2862
+ reader = $Reader.create(reader);
2863
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.appleReceipt.IosSubscriptionTerm();
2864
+ while (reader.pos < end) {
2865
+ var tag = reader.uint32();
2866
+ switch (tag >>> 3) {
2867
+ case 1:
2868
+ message.startsAt = reader.uint64();
2869
+ break;
2870
+ case 2:
2871
+ message.endsAt = reader.uint64();
2872
+ break;
2873
+ case 3:
2874
+ message.isFreeTrial = reader.bool();
2875
+ break;
2876
+ default:
2877
+ reader.skipType(tag & 7);
2878
+ break;
2879
+ }
2880
+ }
2881
+ return message;
2882
+ };
2883
+
2884
+ /**
2885
+ * Decodes an IosSubscriptionTerm message from the specified reader or buffer, length delimited.
2886
+ * @function decodeDelimited
2887
+ * @memberof appleReceipt.IosSubscriptionTerm
2888
+ * @static
2889
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2890
+ * @returns {appleReceipt.IosSubscriptionTerm} IosSubscriptionTerm
2891
+ * @throws {Error} If the payload is not a reader or valid buffer
2892
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2893
+ */
2894
+ IosSubscriptionTerm.decodeDelimited = function decodeDelimited(reader) {
2895
+ if (!(reader instanceof $Reader))
2896
+ reader = new $Reader(reader);
2897
+ return this.decode(reader, reader.uint32());
2898
+ };
2899
+
2900
+ /**
2901
+ * Verifies an IosSubscriptionTerm message.
2902
+ * @function verify
2903
+ * @memberof appleReceipt.IosSubscriptionTerm
2904
+ * @static
2905
+ * @param {Object.<string,*>} message Plain object to verify
2906
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2907
+ */
2908
+ IosSubscriptionTerm.verify = function verify(message) {
2909
+ if (typeof message !== "object" || message === null)
2910
+ return "object expected";
2911
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
2912
+ if (!$util.isInteger(message.startsAt) && !(message.startsAt && $util.isInteger(message.startsAt.low) && $util.isInteger(message.startsAt.high)))
2913
+ return "startsAt: integer|Long expected";
2914
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
2915
+ if (!$util.isInteger(message.endsAt) && !(message.endsAt && $util.isInteger(message.endsAt.low) && $util.isInteger(message.endsAt.high)))
2916
+ return "endsAt: integer|Long expected";
2917
+ if (message.isFreeTrial != null && message.hasOwnProperty("isFreeTrial"))
2918
+ if (typeof message.isFreeTrial !== "boolean")
2919
+ return "isFreeTrial: boolean expected";
2920
+ return null;
2921
+ };
2922
+
2923
+ /**
2924
+ * Creates an IosSubscriptionTerm message from a plain object. Also converts values to their respective internal types.
2925
+ * @function fromObject
2926
+ * @memberof appleReceipt.IosSubscriptionTerm
2927
+ * @static
2928
+ * @param {Object.<string,*>} object Plain object
2929
+ * @returns {appleReceipt.IosSubscriptionTerm} IosSubscriptionTerm
2930
+ */
2931
+ IosSubscriptionTerm.fromObject = function fromObject(object) {
2932
+ if (object instanceof $root.appleReceipt.IosSubscriptionTerm)
2933
+ return object;
2934
+ var message = new $root.appleReceipt.IosSubscriptionTerm();
2935
+ if (object.startsAt != null)
2936
+ if ($util.Long)
2937
+ (message.startsAt = $util.Long.fromValue(object.startsAt)).unsigned = true;
2938
+ else if (typeof object.startsAt === "string")
2939
+ message.startsAt = parseInt(object.startsAt, 10);
2940
+ else if (typeof object.startsAt === "number")
2941
+ message.startsAt = object.startsAt;
2942
+ else if (typeof object.startsAt === "object")
2943
+ message.startsAt = new $util.LongBits(object.startsAt.low >>> 0, object.startsAt.high >>> 0).toNumber(true);
2944
+ if (object.endsAt != null)
2945
+ if ($util.Long)
2946
+ (message.endsAt = $util.Long.fromValue(object.endsAt)).unsigned = true;
2947
+ else if (typeof object.endsAt === "string")
2948
+ message.endsAt = parseInt(object.endsAt, 10);
2949
+ else if (typeof object.endsAt === "number")
2950
+ message.endsAt = object.endsAt;
2951
+ else if (typeof object.endsAt === "object")
2952
+ message.endsAt = new $util.LongBits(object.endsAt.low >>> 0, object.endsAt.high >>> 0).toNumber(true);
2953
+ if (object.isFreeTrial != null)
2954
+ message.isFreeTrial = Boolean(object.isFreeTrial);
2955
+ return message;
2956
+ };
2957
+
2958
+ /**
2959
+ * Creates a plain object from an IosSubscriptionTerm message. Also converts values to other types if specified.
2960
+ * @function toObject
2961
+ * @memberof appleReceipt.IosSubscriptionTerm
2962
+ * @static
2963
+ * @param {appleReceipt.IosSubscriptionTerm} message IosSubscriptionTerm
2964
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2965
+ * @returns {Object.<string,*>} Plain object
2966
+ */
2967
+ IosSubscriptionTerm.toObject = function toObject(message, options) {
2968
+ if (!options)
2969
+ options = {};
2970
+ var object = {};
2971
+ if (options.defaults) {
2972
+ if ($util.Long) {
2973
+ var long = new $util.Long(0, 0, true);
2974
+ object.startsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2975
+ } else
2976
+ object.startsAt = options.longs === String ? "0" : 0;
2977
+ if ($util.Long) {
2978
+ var long = new $util.Long(0, 0, true);
2979
+ object.endsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2980
+ } else
2981
+ object.endsAt = options.longs === String ? "0" : 0;
2982
+ object.isFreeTrial = false;
2983
+ }
2984
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
2985
+ if (typeof message.startsAt === "number")
2986
+ object.startsAt = options.longs === String ? String(message.startsAt) : message.startsAt;
2987
+ else
2988
+ 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;
2989
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
2990
+ if (typeof message.endsAt === "number")
2991
+ object.endsAt = options.longs === String ? String(message.endsAt) : message.endsAt;
2992
+ else
2993
+ 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;
2994
+ if (message.isFreeTrial != null && message.hasOwnProperty("isFreeTrial"))
2995
+ object.isFreeTrial = message.isFreeTrial;
2996
+ return object;
2997
+ };
2998
+
2999
+ /**
3000
+ * Converts this IosSubscriptionTerm to JSON.
3001
+ * @function toJSON
3002
+ * @memberof appleReceipt.IosSubscriptionTerm
3003
+ * @instance
3004
+ * @returns {Object.<string,*>} JSON object
3005
+ */
3006
+ IosSubscriptionTerm.prototype.toJSON = function toJSON() {
3007
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3008
+ };
3009
+
3010
+ return IosSubscriptionTerm;
3011
+ })();
3012
+
3013
+ /**
3014
+ * IosSubscriptionTag enum.
3015
+ * @name appleReceipt.IosSubscriptionTag
3016
+ * @enum {string}
3017
+ * @property {number} IOSTAG_UNKNOWN=0 IOSTAG_UNKNOWN value
3018
+ * @property {number} IOSTAG_FREE_TRIAL=1 IOSTAG_FREE_TRIAL value
3019
+ */
3020
+ appleReceipt.IosSubscriptionTag = (function() {
3021
+ var valuesById = {}, values = Object.create(valuesById);
3022
+ values[valuesById[0] = "IOSTAG_UNKNOWN"] = 0;
3023
+ values[valuesById[1] = "IOSTAG_FREE_TRIAL"] = 1;
3024
+ return values;
3025
+ })();
3026
+
3027
+ return appleReceipt;
3028
+ })();
3029
+
2744
3030
  $root.asset = (function() {
2745
3031
 
2746
3032
  /**
@@ -8610,6 +8896,782 @@ $root.MessageSent = (function() {
8610
8896
  return MessageSent;
8611
8897
  })();
8612
8898
 
8899
+ $root.IosSubscriptionCreated = (function() {
8900
+
8901
+ /**
8902
+ * Properties of an IosSubscriptionCreated.
8903
+ * @exports IIosSubscriptionCreated
8904
+ * @interface IIosSubscriptionCreated
8905
+ * @property {string|null} [id] IosSubscriptionCreated id
8906
+ * @property {number|Long|null} [endsAt] IosSubscriptionCreated endsAt
8907
+ * @property {number|Long|null} [startsAt] IosSubscriptionCreated startsAt
8908
+ * @property {string|null} [userId] IosSubscriptionCreated userId
8909
+ * @property {Array.<appleReceipt.IosSubscriptionTag>|null} [tags] IosSubscriptionCreated tags
8910
+ * @property {Array.<appleReceipt.IIosSubscriptionTerm>|null} [terms] IosSubscriptionCreated terms
8911
+ */
8912
+
8913
+ /**
8914
+ * Constructs a new IosSubscriptionCreated.
8915
+ * @exports IosSubscriptionCreated
8916
+ * @classdesc Represents an IosSubscriptionCreated.
8917
+ * @implements IIosSubscriptionCreated
8918
+ * @constructor
8919
+ * @param {IIosSubscriptionCreated=} [properties] Properties to set
8920
+ */
8921
+ function IosSubscriptionCreated(properties) {
8922
+ this.tags = [];
8923
+ this.terms = [];
8924
+ if (properties)
8925
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
8926
+ if (properties[keys[i]] != null)
8927
+ this[keys[i]] = properties[keys[i]];
8928
+ }
8929
+
8930
+ /**
8931
+ * IosSubscriptionCreated id.
8932
+ * @member {string} id
8933
+ * @memberof IosSubscriptionCreated
8934
+ * @instance
8935
+ */
8936
+ IosSubscriptionCreated.prototype.id = "";
8937
+
8938
+ /**
8939
+ * IosSubscriptionCreated endsAt.
8940
+ * @member {number|Long} endsAt
8941
+ * @memberof IosSubscriptionCreated
8942
+ * @instance
8943
+ */
8944
+ IosSubscriptionCreated.prototype.endsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
8945
+
8946
+ /**
8947
+ * IosSubscriptionCreated startsAt.
8948
+ * @member {number|Long} startsAt
8949
+ * @memberof IosSubscriptionCreated
8950
+ * @instance
8951
+ */
8952
+ IosSubscriptionCreated.prototype.startsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
8953
+
8954
+ /**
8955
+ * IosSubscriptionCreated userId.
8956
+ * @member {string} userId
8957
+ * @memberof IosSubscriptionCreated
8958
+ * @instance
8959
+ */
8960
+ IosSubscriptionCreated.prototype.userId = "";
8961
+
8962
+ /**
8963
+ * IosSubscriptionCreated tags.
8964
+ * @member {Array.<appleReceipt.IosSubscriptionTag>} tags
8965
+ * @memberof IosSubscriptionCreated
8966
+ * @instance
8967
+ */
8968
+ IosSubscriptionCreated.prototype.tags = $util.emptyArray;
8969
+
8970
+ /**
8971
+ * IosSubscriptionCreated terms.
8972
+ * @member {Array.<appleReceipt.IIosSubscriptionTerm>} terms
8973
+ * @memberof IosSubscriptionCreated
8974
+ * @instance
8975
+ */
8976
+ IosSubscriptionCreated.prototype.terms = $util.emptyArray;
8977
+
8978
+ /**
8979
+ * Creates a new IosSubscriptionCreated instance using the specified properties.
8980
+ * @function create
8981
+ * @memberof IosSubscriptionCreated
8982
+ * @static
8983
+ * @param {IIosSubscriptionCreated=} [properties] Properties to set
8984
+ * @returns {IosSubscriptionCreated} IosSubscriptionCreated instance
8985
+ */
8986
+ IosSubscriptionCreated.create = function create(properties) {
8987
+ return new IosSubscriptionCreated(properties);
8988
+ };
8989
+
8990
+ /**
8991
+ * Encodes the specified IosSubscriptionCreated message. Does not implicitly {@link IosSubscriptionCreated.verify|verify} messages.
8992
+ * @function encode
8993
+ * @memberof IosSubscriptionCreated
8994
+ * @static
8995
+ * @param {IIosSubscriptionCreated} message IosSubscriptionCreated message or plain object to encode
8996
+ * @param {$protobuf.Writer} [writer] Writer to encode to
8997
+ * @returns {$protobuf.Writer} Writer
8998
+ */
8999
+ IosSubscriptionCreated.encode = function encode(message, writer) {
9000
+ if (!writer)
9001
+ writer = $Writer.create();
9002
+ if (message.id != null && message.hasOwnProperty("id"))
9003
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
9004
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
9005
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.endsAt);
9006
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
9007
+ writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.startsAt);
9008
+ if (message.userId != null && message.hasOwnProperty("userId"))
9009
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.userId);
9010
+ if (message.tags != null && message.tags.length) {
9011
+ writer.uint32(/* id 5, wireType 2 =*/42).fork();
9012
+ for (var i = 0; i < message.tags.length; ++i)
9013
+ writer.int32(message.tags[i]);
9014
+ writer.ldelim();
9015
+ }
9016
+ if (message.terms != null && message.terms.length)
9017
+ for (var i = 0; i < message.terms.length; ++i)
9018
+ $root.appleReceipt.IosSubscriptionTerm.encode(message.terms[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
9019
+ return writer;
9020
+ };
9021
+
9022
+ /**
9023
+ * Encodes the specified IosSubscriptionCreated message, length delimited. Does not implicitly {@link IosSubscriptionCreated.verify|verify} messages.
9024
+ * @function encodeDelimited
9025
+ * @memberof IosSubscriptionCreated
9026
+ * @static
9027
+ * @param {IIosSubscriptionCreated} message IosSubscriptionCreated message or plain object to encode
9028
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9029
+ * @returns {$protobuf.Writer} Writer
9030
+ */
9031
+ IosSubscriptionCreated.encodeDelimited = function encodeDelimited(message, writer) {
9032
+ return this.encode(message, writer).ldelim();
9033
+ };
9034
+
9035
+ /**
9036
+ * Decodes an IosSubscriptionCreated message from the specified reader or buffer.
9037
+ * @function decode
9038
+ * @memberof IosSubscriptionCreated
9039
+ * @static
9040
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9041
+ * @param {number} [length] Message length if known beforehand
9042
+ * @returns {IosSubscriptionCreated} IosSubscriptionCreated
9043
+ * @throws {Error} If the payload is not a reader or valid buffer
9044
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9045
+ */
9046
+ IosSubscriptionCreated.decode = function decode(reader, length) {
9047
+ if (!(reader instanceof $Reader))
9048
+ reader = $Reader.create(reader);
9049
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.IosSubscriptionCreated();
9050
+ while (reader.pos < end) {
9051
+ var tag = reader.uint32();
9052
+ switch (tag >>> 3) {
9053
+ case 1:
9054
+ message.id = reader.string();
9055
+ break;
9056
+ case 2:
9057
+ message.endsAt = reader.uint64();
9058
+ break;
9059
+ case 3:
9060
+ message.startsAt = reader.uint64();
9061
+ break;
9062
+ case 4:
9063
+ message.userId = reader.string();
9064
+ break;
9065
+ case 5:
9066
+ if (!(message.tags && message.tags.length))
9067
+ message.tags = [];
9068
+ if ((tag & 7) === 2) {
9069
+ var end2 = reader.uint32() + reader.pos;
9070
+ while (reader.pos < end2)
9071
+ message.tags.push(reader.int32());
9072
+ } else
9073
+ message.tags.push(reader.int32());
9074
+ break;
9075
+ case 6:
9076
+ if (!(message.terms && message.terms.length))
9077
+ message.terms = [];
9078
+ message.terms.push($root.appleReceipt.IosSubscriptionTerm.decode(reader, reader.uint32()));
9079
+ break;
9080
+ default:
9081
+ reader.skipType(tag & 7);
9082
+ break;
9083
+ }
9084
+ }
9085
+ return message;
9086
+ };
9087
+
9088
+ /**
9089
+ * Decodes an IosSubscriptionCreated message from the specified reader or buffer, length delimited.
9090
+ * @function decodeDelimited
9091
+ * @memberof IosSubscriptionCreated
9092
+ * @static
9093
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9094
+ * @returns {IosSubscriptionCreated} IosSubscriptionCreated
9095
+ * @throws {Error} If the payload is not a reader or valid buffer
9096
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9097
+ */
9098
+ IosSubscriptionCreated.decodeDelimited = function decodeDelimited(reader) {
9099
+ if (!(reader instanceof $Reader))
9100
+ reader = new $Reader(reader);
9101
+ return this.decode(reader, reader.uint32());
9102
+ };
9103
+
9104
+ /**
9105
+ * Verifies an IosSubscriptionCreated message.
9106
+ * @function verify
9107
+ * @memberof IosSubscriptionCreated
9108
+ * @static
9109
+ * @param {Object.<string,*>} message Plain object to verify
9110
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9111
+ */
9112
+ IosSubscriptionCreated.verify = function verify(message) {
9113
+ if (typeof message !== "object" || message === null)
9114
+ return "object expected";
9115
+ if (message.id != null && message.hasOwnProperty("id"))
9116
+ if (!$util.isString(message.id))
9117
+ return "id: string expected";
9118
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
9119
+ if (!$util.isInteger(message.endsAt) && !(message.endsAt && $util.isInteger(message.endsAt.low) && $util.isInteger(message.endsAt.high)))
9120
+ return "endsAt: integer|Long expected";
9121
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
9122
+ if (!$util.isInteger(message.startsAt) && !(message.startsAt && $util.isInteger(message.startsAt.low) && $util.isInteger(message.startsAt.high)))
9123
+ return "startsAt: integer|Long expected";
9124
+ if (message.userId != null && message.hasOwnProperty("userId"))
9125
+ if (!$util.isString(message.userId))
9126
+ return "userId: string expected";
9127
+ if (message.tags != null && message.hasOwnProperty("tags")) {
9128
+ if (!Array.isArray(message.tags))
9129
+ return "tags: array expected";
9130
+ for (var i = 0; i < message.tags.length; ++i)
9131
+ switch (message.tags[i]) {
9132
+ default:
9133
+ return "tags: enum value[] expected";
9134
+ case 0:
9135
+ case 1:
9136
+ break;
9137
+ }
9138
+ }
9139
+ if (message.terms != null && message.hasOwnProperty("terms")) {
9140
+ if (!Array.isArray(message.terms))
9141
+ return "terms: array expected";
9142
+ for (var i = 0; i < message.terms.length; ++i) {
9143
+ var error = $root.appleReceipt.IosSubscriptionTerm.verify(message.terms[i]);
9144
+ if (error)
9145
+ return "terms." + error;
9146
+ }
9147
+ }
9148
+ return null;
9149
+ };
9150
+
9151
+ /**
9152
+ * Creates an IosSubscriptionCreated message from a plain object. Also converts values to their respective internal types.
9153
+ * @function fromObject
9154
+ * @memberof IosSubscriptionCreated
9155
+ * @static
9156
+ * @param {Object.<string,*>} object Plain object
9157
+ * @returns {IosSubscriptionCreated} IosSubscriptionCreated
9158
+ */
9159
+ IosSubscriptionCreated.fromObject = function fromObject(object) {
9160
+ if (object instanceof $root.IosSubscriptionCreated)
9161
+ return object;
9162
+ var message = new $root.IosSubscriptionCreated();
9163
+ if (object.id != null)
9164
+ message.id = String(object.id);
9165
+ if (object.endsAt != null)
9166
+ if ($util.Long)
9167
+ (message.endsAt = $util.Long.fromValue(object.endsAt)).unsigned = true;
9168
+ else if (typeof object.endsAt === "string")
9169
+ message.endsAt = parseInt(object.endsAt, 10);
9170
+ else if (typeof object.endsAt === "number")
9171
+ message.endsAt = object.endsAt;
9172
+ else if (typeof object.endsAt === "object")
9173
+ message.endsAt = new $util.LongBits(object.endsAt.low >>> 0, object.endsAt.high >>> 0).toNumber(true);
9174
+ if (object.startsAt != null)
9175
+ if ($util.Long)
9176
+ (message.startsAt = $util.Long.fromValue(object.startsAt)).unsigned = true;
9177
+ else if (typeof object.startsAt === "string")
9178
+ message.startsAt = parseInt(object.startsAt, 10);
9179
+ else if (typeof object.startsAt === "number")
9180
+ message.startsAt = object.startsAt;
9181
+ else if (typeof object.startsAt === "object")
9182
+ message.startsAt = new $util.LongBits(object.startsAt.low >>> 0, object.startsAt.high >>> 0).toNumber(true);
9183
+ if (object.userId != null)
9184
+ message.userId = String(object.userId);
9185
+ if (object.tags) {
9186
+ if (!Array.isArray(object.tags))
9187
+ throw TypeError(".IosSubscriptionCreated.tags: array expected");
9188
+ message.tags = [];
9189
+ for (var i = 0; i < object.tags.length; ++i)
9190
+ switch (object.tags[i]) {
9191
+ default:
9192
+ case "IOSTAG_UNKNOWN":
9193
+ case 0:
9194
+ message.tags[i] = 0;
9195
+ break;
9196
+ case "IOSTAG_FREE_TRIAL":
9197
+ case 1:
9198
+ message.tags[i] = 1;
9199
+ break;
9200
+ }
9201
+ }
9202
+ if (object.terms) {
9203
+ if (!Array.isArray(object.terms))
9204
+ throw TypeError(".IosSubscriptionCreated.terms: array expected");
9205
+ message.terms = [];
9206
+ for (var i = 0; i < object.terms.length; ++i) {
9207
+ if (typeof object.terms[i] !== "object")
9208
+ throw TypeError(".IosSubscriptionCreated.terms: object expected");
9209
+ message.terms[i] = $root.appleReceipt.IosSubscriptionTerm.fromObject(object.terms[i]);
9210
+ }
9211
+ }
9212
+ return message;
9213
+ };
9214
+
9215
+ /**
9216
+ * Creates a plain object from an IosSubscriptionCreated message. Also converts values to other types if specified.
9217
+ * @function toObject
9218
+ * @memberof IosSubscriptionCreated
9219
+ * @static
9220
+ * @param {IosSubscriptionCreated} message IosSubscriptionCreated
9221
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9222
+ * @returns {Object.<string,*>} Plain object
9223
+ */
9224
+ IosSubscriptionCreated.toObject = function toObject(message, options) {
9225
+ if (!options)
9226
+ options = {};
9227
+ var object = {};
9228
+ if (options.arrays || options.defaults) {
9229
+ object.tags = [];
9230
+ object.terms = [];
9231
+ }
9232
+ if (options.defaults) {
9233
+ object.id = "";
9234
+ if ($util.Long) {
9235
+ var long = new $util.Long(0, 0, true);
9236
+ object.endsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
9237
+ } else
9238
+ object.endsAt = options.longs === String ? "0" : 0;
9239
+ if ($util.Long) {
9240
+ var long = new $util.Long(0, 0, true);
9241
+ object.startsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
9242
+ } else
9243
+ object.startsAt = options.longs === String ? "0" : 0;
9244
+ object.userId = "";
9245
+ }
9246
+ if (message.id != null && message.hasOwnProperty("id"))
9247
+ object.id = message.id;
9248
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
9249
+ if (typeof message.endsAt === "number")
9250
+ object.endsAt = options.longs === String ? String(message.endsAt) : message.endsAt;
9251
+ else
9252
+ 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;
9253
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
9254
+ if (typeof message.startsAt === "number")
9255
+ object.startsAt = options.longs === String ? String(message.startsAt) : message.startsAt;
9256
+ else
9257
+ 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;
9258
+ if (message.userId != null && message.hasOwnProperty("userId"))
9259
+ object.userId = message.userId;
9260
+ if (message.tags && message.tags.length) {
9261
+ object.tags = [];
9262
+ for (var j = 0; j < message.tags.length; ++j)
9263
+ object.tags[j] = options.enums === String ? $root.appleReceipt.IosSubscriptionTag[message.tags[j]] : message.tags[j];
9264
+ }
9265
+ if (message.terms && message.terms.length) {
9266
+ object.terms = [];
9267
+ for (var j = 0; j < message.terms.length; ++j)
9268
+ object.terms[j] = $root.appleReceipt.IosSubscriptionTerm.toObject(message.terms[j], options);
9269
+ }
9270
+ return object;
9271
+ };
9272
+
9273
+ /**
9274
+ * Converts this IosSubscriptionCreated to JSON.
9275
+ * @function toJSON
9276
+ * @memberof IosSubscriptionCreated
9277
+ * @instance
9278
+ * @returns {Object.<string,*>} JSON object
9279
+ */
9280
+ IosSubscriptionCreated.prototype.toJSON = function toJSON() {
9281
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9282
+ };
9283
+
9284
+ return IosSubscriptionCreated;
9285
+ })();
9286
+
9287
+ $root.IosSubscriptionRenewed = (function() {
9288
+
9289
+ /**
9290
+ * Properties of an IosSubscriptionRenewed.
9291
+ * @exports IIosSubscriptionRenewed
9292
+ * @interface IIosSubscriptionRenewed
9293
+ * @property {string|null} [id] IosSubscriptionRenewed id
9294
+ * @property {number|Long|null} [endsAt] IosSubscriptionRenewed endsAt
9295
+ * @property {number|Long|null} [startsAt] IosSubscriptionRenewed startsAt
9296
+ * @property {string|null} [userId] IosSubscriptionRenewed userId
9297
+ * @property {Array.<appleReceipt.IosSubscriptionTag>|null} [tags] IosSubscriptionRenewed tags
9298
+ * @property {Array.<appleReceipt.IIosSubscriptionTerm>|null} [terms] IosSubscriptionRenewed terms
9299
+ */
9300
+
9301
+ /**
9302
+ * Constructs a new IosSubscriptionRenewed.
9303
+ * @exports IosSubscriptionRenewed
9304
+ * @classdesc Represents an IosSubscriptionRenewed.
9305
+ * @implements IIosSubscriptionRenewed
9306
+ * @constructor
9307
+ * @param {IIosSubscriptionRenewed=} [properties] Properties to set
9308
+ */
9309
+ function IosSubscriptionRenewed(properties) {
9310
+ this.tags = [];
9311
+ this.terms = [];
9312
+ if (properties)
9313
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
9314
+ if (properties[keys[i]] != null)
9315
+ this[keys[i]] = properties[keys[i]];
9316
+ }
9317
+
9318
+ /**
9319
+ * IosSubscriptionRenewed id.
9320
+ * @member {string} id
9321
+ * @memberof IosSubscriptionRenewed
9322
+ * @instance
9323
+ */
9324
+ IosSubscriptionRenewed.prototype.id = "";
9325
+
9326
+ /**
9327
+ * IosSubscriptionRenewed endsAt.
9328
+ * @member {number|Long} endsAt
9329
+ * @memberof IosSubscriptionRenewed
9330
+ * @instance
9331
+ */
9332
+ IosSubscriptionRenewed.prototype.endsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
9333
+
9334
+ /**
9335
+ * IosSubscriptionRenewed startsAt.
9336
+ * @member {number|Long} startsAt
9337
+ * @memberof IosSubscriptionRenewed
9338
+ * @instance
9339
+ */
9340
+ IosSubscriptionRenewed.prototype.startsAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
9341
+
9342
+ /**
9343
+ * IosSubscriptionRenewed userId.
9344
+ * @member {string} userId
9345
+ * @memberof IosSubscriptionRenewed
9346
+ * @instance
9347
+ */
9348
+ IosSubscriptionRenewed.prototype.userId = "";
9349
+
9350
+ /**
9351
+ * IosSubscriptionRenewed tags.
9352
+ * @member {Array.<appleReceipt.IosSubscriptionTag>} tags
9353
+ * @memberof IosSubscriptionRenewed
9354
+ * @instance
9355
+ */
9356
+ IosSubscriptionRenewed.prototype.tags = $util.emptyArray;
9357
+
9358
+ /**
9359
+ * IosSubscriptionRenewed terms.
9360
+ * @member {Array.<appleReceipt.IIosSubscriptionTerm>} terms
9361
+ * @memberof IosSubscriptionRenewed
9362
+ * @instance
9363
+ */
9364
+ IosSubscriptionRenewed.prototype.terms = $util.emptyArray;
9365
+
9366
+ /**
9367
+ * Creates a new IosSubscriptionRenewed instance using the specified properties.
9368
+ * @function create
9369
+ * @memberof IosSubscriptionRenewed
9370
+ * @static
9371
+ * @param {IIosSubscriptionRenewed=} [properties] Properties to set
9372
+ * @returns {IosSubscriptionRenewed} IosSubscriptionRenewed instance
9373
+ */
9374
+ IosSubscriptionRenewed.create = function create(properties) {
9375
+ return new IosSubscriptionRenewed(properties);
9376
+ };
9377
+
9378
+ /**
9379
+ * Encodes the specified IosSubscriptionRenewed message. Does not implicitly {@link IosSubscriptionRenewed.verify|verify} messages.
9380
+ * @function encode
9381
+ * @memberof IosSubscriptionRenewed
9382
+ * @static
9383
+ * @param {IIosSubscriptionRenewed} message IosSubscriptionRenewed message or plain object to encode
9384
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9385
+ * @returns {$protobuf.Writer} Writer
9386
+ */
9387
+ IosSubscriptionRenewed.encode = function encode(message, writer) {
9388
+ if (!writer)
9389
+ writer = $Writer.create();
9390
+ if (message.id != null && message.hasOwnProperty("id"))
9391
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);
9392
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
9393
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.endsAt);
9394
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
9395
+ writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.startsAt);
9396
+ if (message.userId != null && message.hasOwnProperty("userId"))
9397
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.userId);
9398
+ if (message.tags != null && message.tags.length) {
9399
+ writer.uint32(/* id 5, wireType 2 =*/42).fork();
9400
+ for (var i = 0; i < message.tags.length; ++i)
9401
+ writer.int32(message.tags[i]);
9402
+ writer.ldelim();
9403
+ }
9404
+ if (message.terms != null && message.terms.length)
9405
+ for (var i = 0; i < message.terms.length; ++i)
9406
+ $root.appleReceipt.IosSubscriptionTerm.encode(message.terms[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
9407
+ return writer;
9408
+ };
9409
+
9410
+ /**
9411
+ * Encodes the specified IosSubscriptionRenewed message, length delimited. Does not implicitly {@link IosSubscriptionRenewed.verify|verify} messages.
9412
+ * @function encodeDelimited
9413
+ * @memberof IosSubscriptionRenewed
9414
+ * @static
9415
+ * @param {IIosSubscriptionRenewed} message IosSubscriptionRenewed message or plain object to encode
9416
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9417
+ * @returns {$protobuf.Writer} Writer
9418
+ */
9419
+ IosSubscriptionRenewed.encodeDelimited = function encodeDelimited(message, writer) {
9420
+ return this.encode(message, writer).ldelim();
9421
+ };
9422
+
9423
+ /**
9424
+ * Decodes an IosSubscriptionRenewed message from the specified reader or buffer.
9425
+ * @function decode
9426
+ * @memberof IosSubscriptionRenewed
9427
+ * @static
9428
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9429
+ * @param {number} [length] Message length if known beforehand
9430
+ * @returns {IosSubscriptionRenewed} IosSubscriptionRenewed
9431
+ * @throws {Error} If the payload is not a reader or valid buffer
9432
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9433
+ */
9434
+ IosSubscriptionRenewed.decode = function decode(reader, length) {
9435
+ if (!(reader instanceof $Reader))
9436
+ reader = $Reader.create(reader);
9437
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.IosSubscriptionRenewed();
9438
+ while (reader.pos < end) {
9439
+ var tag = reader.uint32();
9440
+ switch (tag >>> 3) {
9441
+ case 1:
9442
+ message.id = reader.string();
9443
+ break;
9444
+ case 2:
9445
+ message.endsAt = reader.uint64();
9446
+ break;
9447
+ case 3:
9448
+ message.startsAt = reader.uint64();
9449
+ break;
9450
+ case 4:
9451
+ message.userId = reader.string();
9452
+ break;
9453
+ case 5:
9454
+ if (!(message.tags && message.tags.length))
9455
+ message.tags = [];
9456
+ if ((tag & 7) === 2) {
9457
+ var end2 = reader.uint32() + reader.pos;
9458
+ while (reader.pos < end2)
9459
+ message.tags.push(reader.int32());
9460
+ } else
9461
+ message.tags.push(reader.int32());
9462
+ break;
9463
+ case 6:
9464
+ if (!(message.terms && message.terms.length))
9465
+ message.terms = [];
9466
+ message.terms.push($root.appleReceipt.IosSubscriptionTerm.decode(reader, reader.uint32()));
9467
+ break;
9468
+ default:
9469
+ reader.skipType(tag & 7);
9470
+ break;
9471
+ }
9472
+ }
9473
+ return message;
9474
+ };
9475
+
9476
+ /**
9477
+ * Decodes an IosSubscriptionRenewed message from the specified reader or buffer, length delimited.
9478
+ * @function decodeDelimited
9479
+ * @memberof IosSubscriptionRenewed
9480
+ * @static
9481
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9482
+ * @returns {IosSubscriptionRenewed} IosSubscriptionRenewed
9483
+ * @throws {Error} If the payload is not a reader or valid buffer
9484
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9485
+ */
9486
+ IosSubscriptionRenewed.decodeDelimited = function decodeDelimited(reader) {
9487
+ if (!(reader instanceof $Reader))
9488
+ reader = new $Reader(reader);
9489
+ return this.decode(reader, reader.uint32());
9490
+ };
9491
+
9492
+ /**
9493
+ * Verifies an IosSubscriptionRenewed message.
9494
+ * @function verify
9495
+ * @memberof IosSubscriptionRenewed
9496
+ * @static
9497
+ * @param {Object.<string,*>} message Plain object to verify
9498
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9499
+ */
9500
+ IosSubscriptionRenewed.verify = function verify(message) {
9501
+ if (typeof message !== "object" || message === null)
9502
+ return "object expected";
9503
+ if (message.id != null && message.hasOwnProperty("id"))
9504
+ if (!$util.isString(message.id))
9505
+ return "id: string expected";
9506
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
9507
+ if (!$util.isInteger(message.endsAt) && !(message.endsAt && $util.isInteger(message.endsAt.low) && $util.isInteger(message.endsAt.high)))
9508
+ return "endsAt: integer|Long expected";
9509
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
9510
+ if (!$util.isInteger(message.startsAt) && !(message.startsAt && $util.isInteger(message.startsAt.low) && $util.isInteger(message.startsAt.high)))
9511
+ return "startsAt: integer|Long expected";
9512
+ if (message.userId != null && message.hasOwnProperty("userId"))
9513
+ if (!$util.isString(message.userId))
9514
+ return "userId: string expected";
9515
+ if (message.tags != null && message.hasOwnProperty("tags")) {
9516
+ if (!Array.isArray(message.tags))
9517
+ return "tags: array expected";
9518
+ for (var i = 0; i < message.tags.length; ++i)
9519
+ switch (message.tags[i]) {
9520
+ default:
9521
+ return "tags: enum value[] expected";
9522
+ case 0:
9523
+ case 1:
9524
+ break;
9525
+ }
9526
+ }
9527
+ if (message.terms != null && message.hasOwnProperty("terms")) {
9528
+ if (!Array.isArray(message.terms))
9529
+ return "terms: array expected";
9530
+ for (var i = 0; i < message.terms.length; ++i) {
9531
+ var error = $root.appleReceipt.IosSubscriptionTerm.verify(message.terms[i]);
9532
+ if (error)
9533
+ return "terms." + error;
9534
+ }
9535
+ }
9536
+ return null;
9537
+ };
9538
+
9539
+ /**
9540
+ * Creates an IosSubscriptionRenewed message from a plain object. Also converts values to their respective internal types.
9541
+ * @function fromObject
9542
+ * @memberof IosSubscriptionRenewed
9543
+ * @static
9544
+ * @param {Object.<string,*>} object Plain object
9545
+ * @returns {IosSubscriptionRenewed} IosSubscriptionRenewed
9546
+ */
9547
+ IosSubscriptionRenewed.fromObject = function fromObject(object) {
9548
+ if (object instanceof $root.IosSubscriptionRenewed)
9549
+ return object;
9550
+ var message = new $root.IosSubscriptionRenewed();
9551
+ if (object.id != null)
9552
+ message.id = String(object.id);
9553
+ if (object.endsAt != null)
9554
+ if ($util.Long)
9555
+ (message.endsAt = $util.Long.fromValue(object.endsAt)).unsigned = true;
9556
+ else if (typeof object.endsAt === "string")
9557
+ message.endsAt = parseInt(object.endsAt, 10);
9558
+ else if (typeof object.endsAt === "number")
9559
+ message.endsAt = object.endsAt;
9560
+ else if (typeof object.endsAt === "object")
9561
+ message.endsAt = new $util.LongBits(object.endsAt.low >>> 0, object.endsAt.high >>> 0).toNumber(true);
9562
+ if (object.startsAt != null)
9563
+ if ($util.Long)
9564
+ (message.startsAt = $util.Long.fromValue(object.startsAt)).unsigned = true;
9565
+ else if (typeof object.startsAt === "string")
9566
+ message.startsAt = parseInt(object.startsAt, 10);
9567
+ else if (typeof object.startsAt === "number")
9568
+ message.startsAt = object.startsAt;
9569
+ else if (typeof object.startsAt === "object")
9570
+ message.startsAt = new $util.LongBits(object.startsAt.low >>> 0, object.startsAt.high >>> 0).toNumber(true);
9571
+ if (object.userId != null)
9572
+ message.userId = String(object.userId);
9573
+ if (object.tags) {
9574
+ if (!Array.isArray(object.tags))
9575
+ throw TypeError(".IosSubscriptionRenewed.tags: array expected");
9576
+ message.tags = [];
9577
+ for (var i = 0; i < object.tags.length; ++i)
9578
+ switch (object.tags[i]) {
9579
+ default:
9580
+ case "IOSTAG_UNKNOWN":
9581
+ case 0:
9582
+ message.tags[i] = 0;
9583
+ break;
9584
+ case "IOSTAG_FREE_TRIAL":
9585
+ case 1:
9586
+ message.tags[i] = 1;
9587
+ break;
9588
+ }
9589
+ }
9590
+ if (object.terms) {
9591
+ if (!Array.isArray(object.terms))
9592
+ throw TypeError(".IosSubscriptionRenewed.terms: array expected");
9593
+ message.terms = [];
9594
+ for (var i = 0; i < object.terms.length; ++i) {
9595
+ if (typeof object.terms[i] !== "object")
9596
+ throw TypeError(".IosSubscriptionRenewed.terms: object expected");
9597
+ message.terms[i] = $root.appleReceipt.IosSubscriptionTerm.fromObject(object.terms[i]);
9598
+ }
9599
+ }
9600
+ return message;
9601
+ };
9602
+
9603
+ /**
9604
+ * Creates a plain object from an IosSubscriptionRenewed message. Also converts values to other types if specified.
9605
+ * @function toObject
9606
+ * @memberof IosSubscriptionRenewed
9607
+ * @static
9608
+ * @param {IosSubscriptionRenewed} message IosSubscriptionRenewed
9609
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9610
+ * @returns {Object.<string,*>} Plain object
9611
+ */
9612
+ IosSubscriptionRenewed.toObject = function toObject(message, options) {
9613
+ if (!options)
9614
+ options = {};
9615
+ var object = {};
9616
+ if (options.arrays || options.defaults) {
9617
+ object.tags = [];
9618
+ object.terms = [];
9619
+ }
9620
+ if (options.defaults) {
9621
+ object.id = "";
9622
+ if ($util.Long) {
9623
+ var long = new $util.Long(0, 0, true);
9624
+ object.endsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
9625
+ } else
9626
+ object.endsAt = options.longs === String ? "0" : 0;
9627
+ if ($util.Long) {
9628
+ var long = new $util.Long(0, 0, true);
9629
+ object.startsAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
9630
+ } else
9631
+ object.startsAt = options.longs === String ? "0" : 0;
9632
+ object.userId = "";
9633
+ }
9634
+ if (message.id != null && message.hasOwnProperty("id"))
9635
+ object.id = message.id;
9636
+ if (message.endsAt != null && message.hasOwnProperty("endsAt"))
9637
+ if (typeof message.endsAt === "number")
9638
+ object.endsAt = options.longs === String ? String(message.endsAt) : message.endsAt;
9639
+ else
9640
+ 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;
9641
+ if (message.startsAt != null && message.hasOwnProperty("startsAt"))
9642
+ if (typeof message.startsAt === "number")
9643
+ object.startsAt = options.longs === String ? String(message.startsAt) : message.startsAt;
9644
+ else
9645
+ 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;
9646
+ if (message.userId != null && message.hasOwnProperty("userId"))
9647
+ object.userId = message.userId;
9648
+ if (message.tags && message.tags.length) {
9649
+ object.tags = [];
9650
+ for (var j = 0; j < message.tags.length; ++j)
9651
+ object.tags[j] = options.enums === String ? $root.appleReceipt.IosSubscriptionTag[message.tags[j]] : message.tags[j];
9652
+ }
9653
+ if (message.terms && message.terms.length) {
9654
+ object.terms = [];
9655
+ for (var j = 0; j < message.terms.length; ++j)
9656
+ object.terms[j] = $root.appleReceipt.IosSubscriptionTerm.toObject(message.terms[j], options);
9657
+ }
9658
+ return object;
9659
+ };
9660
+
9661
+ /**
9662
+ * Converts this IosSubscriptionRenewed to JSON.
9663
+ * @function toJSON
9664
+ * @memberof IosSubscriptionRenewed
9665
+ * @instance
9666
+ * @returns {Object.<string,*>} JSON object
9667
+ */
9668
+ IosSubscriptionRenewed.prototype.toJSON = function toJSON() {
9669
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9670
+ };
9671
+
9672
+ return IosSubscriptionRenewed;
9673
+ })();
9674
+
8613
9675
  $root.AssetCreated = (function() {
8614
9676
 
8615
9677
  /**