@headspace/protos-events 1.82.0 → 1.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -3673,6 +3673,309 @@ export class ContentPlayedMetadata implements IContentPlayedMetadata {
3673
3673
  public toJSON(): { [k: string]: any };
3674
3674
  }
3675
3675
 
3676
+ /** Properties of a SurveyResponse. */
3677
+ export interface ISurveyResponse {
3678
+
3679
+ /** SurveyResponse userId */
3680
+ userId?: (string|null);
3681
+
3682
+ /** SurveyResponse surveyId */
3683
+ surveyId?: (string|null);
3684
+
3685
+ /** SurveyResponse questions */
3686
+ questions?: (ISurveyQuestion[]|null);
3687
+
3688
+ /** SurveyResponse createdAtIsoDate */
3689
+ createdAtIsoDate?: (string|null);
3690
+ }
3691
+
3692
+ /** Represents a SurveyResponse. */
3693
+ export class SurveyResponse implements ISurveyResponse {
3694
+
3695
+ /**
3696
+ * Constructs a new SurveyResponse.
3697
+ * @param [properties] Properties to set
3698
+ */
3699
+ constructor(properties?: ISurveyResponse);
3700
+
3701
+ /** SurveyResponse userId. */
3702
+ public userId: string;
3703
+
3704
+ /** SurveyResponse surveyId. */
3705
+ public surveyId: string;
3706
+
3707
+ /** SurveyResponse questions. */
3708
+ public questions: ISurveyQuestion[];
3709
+
3710
+ /** SurveyResponse createdAtIsoDate. */
3711
+ public createdAtIsoDate: string;
3712
+
3713
+ /**
3714
+ * Creates a new SurveyResponse instance using the specified properties.
3715
+ * @param [properties] Properties to set
3716
+ * @returns SurveyResponse instance
3717
+ */
3718
+ public static create(properties?: ISurveyResponse): SurveyResponse;
3719
+
3720
+ /**
3721
+ * Encodes the specified SurveyResponse message. Does not implicitly {@link SurveyResponse.verify|verify} messages.
3722
+ * @param message SurveyResponse message or plain object to encode
3723
+ * @param [writer] Writer to encode to
3724
+ * @returns Writer
3725
+ */
3726
+ public static encode(message: ISurveyResponse, writer?: $protobuf.Writer): $protobuf.Writer;
3727
+
3728
+ /**
3729
+ * Encodes the specified SurveyResponse message, length delimited. Does not implicitly {@link SurveyResponse.verify|verify} messages.
3730
+ * @param message SurveyResponse message or plain object to encode
3731
+ * @param [writer] Writer to encode to
3732
+ * @returns Writer
3733
+ */
3734
+ public static encodeDelimited(message: ISurveyResponse, writer?: $protobuf.Writer): $protobuf.Writer;
3735
+
3736
+ /**
3737
+ * Decodes a SurveyResponse message from the specified reader or buffer.
3738
+ * @param reader Reader or buffer to decode from
3739
+ * @param [length] Message length if known beforehand
3740
+ * @returns SurveyResponse
3741
+ * @throws {Error} If the payload is not a reader or valid buffer
3742
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3743
+ */
3744
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SurveyResponse;
3745
+
3746
+ /**
3747
+ * Decodes a SurveyResponse message from the specified reader or buffer, length delimited.
3748
+ * @param reader Reader or buffer to decode from
3749
+ * @returns SurveyResponse
3750
+ * @throws {Error} If the payload is not a reader or valid buffer
3751
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3752
+ */
3753
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SurveyResponse;
3754
+
3755
+ /**
3756
+ * Verifies a SurveyResponse message.
3757
+ * @param message Plain object to verify
3758
+ * @returns `null` if valid, otherwise the reason why it is not
3759
+ */
3760
+ public static verify(message: { [k: string]: any }): (string|null);
3761
+
3762
+ /**
3763
+ * Creates a SurveyResponse message from a plain object. Also converts values to their respective internal types.
3764
+ * @param object Plain object
3765
+ * @returns SurveyResponse
3766
+ */
3767
+ public static fromObject(object: { [k: string]: any }): SurveyResponse;
3768
+
3769
+ /**
3770
+ * Creates a plain object from a SurveyResponse message. Also converts values to other types if specified.
3771
+ * @param message SurveyResponse
3772
+ * @param [options] Conversion options
3773
+ * @returns Plain object
3774
+ */
3775
+ public static toObject(message: SurveyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };
3776
+
3777
+ /**
3778
+ * Converts this SurveyResponse to JSON.
3779
+ * @returns JSON object
3780
+ */
3781
+ public toJSON(): { [k: string]: any };
3782
+ }
3783
+
3784
+ /** Properties of a SurveyQuestion. */
3785
+ export interface ISurveyQuestion {
3786
+
3787
+ /** SurveyQuestion title */
3788
+ title?: (string|null);
3789
+
3790
+ /** SurveyQuestion answers */
3791
+ answers?: (ISurveyAnswer[]|null);
3792
+ }
3793
+
3794
+ /** Represents a SurveyQuestion. */
3795
+ export class SurveyQuestion implements ISurveyQuestion {
3796
+
3797
+ /**
3798
+ * Constructs a new SurveyQuestion.
3799
+ * @param [properties] Properties to set
3800
+ */
3801
+ constructor(properties?: ISurveyQuestion);
3802
+
3803
+ /** SurveyQuestion title. */
3804
+ public title: string;
3805
+
3806
+ /** SurveyQuestion answers. */
3807
+ public answers: ISurveyAnswer[];
3808
+
3809
+ /**
3810
+ * Creates a new SurveyQuestion instance using the specified properties.
3811
+ * @param [properties] Properties to set
3812
+ * @returns SurveyQuestion instance
3813
+ */
3814
+ public static create(properties?: ISurveyQuestion): SurveyQuestion;
3815
+
3816
+ /**
3817
+ * Encodes the specified SurveyQuestion message. Does not implicitly {@link SurveyQuestion.verify|verify} messages.
3818
+ * @param message SurveyQuestion message or plain object to encode
3819
+ * @param [writer] Writer to encode to
3820
+ * @returns Writer
3821
+ */
3822
+ public static encode(message: ISurveyQuestion, writer?: $protobuf.Writer): $protobuf.Writer;
3823
+
3824
+ /**
3825
+ * Encodes the specified SurveyQuestion message, length delimited. Does not implicitly {@link SurveyQuestion.verify|verify} messages.
3826
+ * @param message SurveyQuestion message or plain object to encode
3827
+ * @param [writer] Writer to encode to
3828
+ * @returns Writer
3829
+ */
3830
+ public static encodeDelimited(message: ISurveyQuestion, writer?: $protobuf.Writer): $protobuf.Writer;
3831
+
3832
+ /**
3833
+ * Decodes a SurveyQuestion message from the specified reader or buffer.
3834
+ * @param reader Reader or buffer to decode from
3835
+ * @param [length] Message length if known beforehand
3836
+ * @returns SurveyQuestion
3837
+ * @throws {Error} If the payload is not a reader or valid buffer
3838
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3839
+ */
3840
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SurveyQuestion;
3841
+
3842
+ /**
3843
+ * Decodes a SurveyQuestion message from the specified reader or buffer, length delimited.
3844
+ * @param reader Reader or buffer to decode from
3845
+ * @returns SurveyQuestion
3846
+ * @throws {Error} If the payload is not a reader or valid buffer
3847
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3848
+ */
3849
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SurveyQuestion;
3850
+
3851
+ /**
3852
+ * Verifies a SurveyQuestion message.
3853
+ * @param message Plain object to verify
3854
+ * @returns `null` if valid, otherwise the reason why it is not
3855
+ */
3856
+ public static verify(message: { [k: string]: any }): (string|null);
3857
+
3858
+ /**
3859
+ * Creates a SurveyQuestion message from a plain object. Also converts values to their respective internal types.
3860
+ * @param object Plain object
3861
+ * @returns SurveyQuestion
3862
+ */
3863
+ public static fromObject(object: { [k: string]: any }): SurveyQuestion;
3864
+
3865
+ /**
3866
+ * Creates a plain object from a SurveyQuestion message. Also converts values to other types if specified.
3867
+ * @param message SurveyQuestion
3868
+ * @param [options] Conversion options
3869
+ * @returns Plain object
3870
+ */
3871
+ public static toObject(message: SurveyQuestion, options?: $protobuf.IConversionOptions): { [k: string]: any };
3872
+
3873
+ /**
3874
+ * Converts this SurveyQuestion to JSON.
3875
+ * @returns JSON object
3876
+ */
3877
+ public toJSON(): { [k: string]: any };
3878
+ }
3879
+
3880
+ /** Properties of a SurveyAnswer. */
3881
+ export interface ISurveyAnswer {
3882
+
3883
+ /** SurveyAnswer text */
3884
+ text?: (string|null);
3885
+
3886
+ /** SurveyAnswer choice */
3887
+ choice?: (string|null);
3888
+ }
3889
+
3890
+ /** Represents a SurveyAnswer. */
3891
+ export class SurveyAnswer implements ISurveyAnswer {
3892
+
3893
+ /**
3894
+ * Constructs a new SurveyAnswer.
3895
+ * @param [properties] Properties to set
3896
+ */
3897
+ constructor(properties?: ISurveyAnswer);
3898
+
3899
+ /** SurveyAnswer text. */
3900
+ public text: string;
3901
+
3902
+ /** SurveyAnswer choice. */
3903
+ public choice: string;
3904
+
3905
+ /** SurveyAnswer answer. */
3906
+ public answer?: ("text"|"choice");
3907
+
3908
+ /**
3909
+ * Creates a new SurveyAnswer instance using the specified properties.
3910
+ * @param [properties] Properties to set
3911
+ * @returns SurveyAnswer instance
3912
+ */
3913
+ public static create(properties?: ISurveyAnswer): SurveyAnswer;
3914
+
3915
+ /**
3916
+ * Encodes the specified SurveyAnswer message. Does not implicitly {@link SurveyAnswer.verify|verify} messages.
3917
+ * @param message SurveyAnswer message or plain object to encode
3918
+ * @param [writer] Writer to encode to
3919
+ * @returns Writer
3920
+ */
3921
+ public static encode(message: ISurveyAnswer, writer?: $protobuf.Writer): $protobuf.Writer;
3922
+
3923
+ /**
3924
+ * Encodes the specified SurveyAnswer message, length delimited. Does not implicitly {@link SurveyAnswer.verify|verify} messages.
3925
+ * @param message SurveyAnswer message or plain object to encode
3926
+ * @param [writer] Writer to encode to
3927
+ * @returns Writer
3928
+ */
3929
+ public static encodeDelimited(message: ISurveyAnswer, writer?: $protobuf.Writer): $protobuf.Writer;
3930
+
3931
+ /**
3932
+ * Decodes a SurveyAnswer message from the specified reader or buffer.
3933
+ * @param reader Reader or buffer to decode from
3934
+ * @param [length] Message length if known beforehand
3935
+ * @returns SurveyAnswer
3936
+ * @throws {Error} If the payload is not a reader or valid buffer
3937
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3938
+ */
3939
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SurveyAnswer;
3940
+
3941
+ /**
3942
+ * Decodes a SurveyAnswer message from the specified reader or buffer, length delimited.
3943
+ * @param reader Reader or buffer to decode from
3944
+ * @returns SurveyAnswer
3945
+ * @throws {Error} If the payload is not a reader or valid buffer
3946
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3947
+ */
3948
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SurveyAnswer;
3949
+
3950
+ /**
3951
+ * Verifies a SurveyAnswer message.
3952
+ * @param message Plain object to verify
3953
+ * @returns `null` if valid, otherwise the reason why it is not
3954
+ */
3955
+ public static verify(message: { [k: string]: any }): (string|null);
3956
+
3957
+ /**
3958
+ * Creates a SurveyAnswer message from a plain object. Also converts values to their respective internal types.
3959
+ * @param object Plain object
3960
+ * @returns SurveyAnswer
3961
+ */
3962
+ public static fromObject(object: { [k: string]: any }): SurveyAnswer;
3963
+
3964
+ /**
3965
+ * Creates a plain object from a SurveyAnswer message. Also converts values to other types if specified.
3966
+ * @param message SurveyAnswer
3967
+ * @param [options] Conversion options
3968
+ * @returns Plain object
3969
+ */
3970
+ public static toObject(message: SurveyAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any };
3971
+
3972
+ /**
3973
+ * Converts this SurveyAnswer to JSON.
3974
+ * @returns JSON object
3975
+ */
3976
+ public toJSON(): { [k: string]: any };
3977
+ }
3978
+
3676
3979
  /** Properties of a BuddyAccepted. */
3677
3980
  export interface IBuddyAccepted {
3678
3981
 
package/lib/index.js CHANGED
@@ -9151,6 +9151,746 @@ $root.ContentPlayedMetadata = (function() {
9151
9151
  return ContentPlayedMetadata;
9152
9152
  })();
9153
9153
 
9154
+ $root.SurveyResponse = (function() {
9155
+
9156
+ /**
9157
+ * Properties of a SurveyResponse.
9158
+ * @exports ISurveyResponse
9159
+ * @interface ISurveyResponse
9160
+ * @property {string|null} [userId] SurveyResponse userId
9161
+ * @property {string|null} [surveyId] SurveyResponse surveyId
9162
+ * @property {Array.<ISurveyQuestion>|null} [questions] SurveyResponse questions
9163
+ * @property {string|null} [createdAtIsoDate] SurveyResponse createdAtIsoDate
9164
+ */
9165
+
9166
+ /**
9167
+ * Constructs a new SurveyResponse.
9168
+ * @exports SurveyResponse
9169
+ * @classdesc Represents a SurveyResponse.
9170
+ * @implements ISurveyResponse
9171
+ * @constructor
9172
+ * @param {ISurveyResponse=} [properties] Properties to set
9173
+ */
9174
+ function SurveyResponse(properties) {
9175
+ this.questions = [];
9176
+ if (properties)
9177
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
9178
+ if (properties[keys[i]] != null)
9179
+ this[keys[i]] = properties[keys[i]];
9180
+ }
9181
+
9182
+ /**
9183
+ * SurveyResponse userId.
9184
+ * @member {string} userId
9185
+ * @memberof SurveyResponse
9186
+ * @instance
9187
+ */
9188
+ SurveyResponse.prototype.userId = "";
9189
+
9190
+ /**
9191
+ * SurveyResponse surveyId.
9192
+ * @member {string} surveyId
9193
+ * @memberof SurveyResponse
9194
+ * @instance
9195
+ */
9196
+ SurveyResponse.prototype.surveyId = "";
9197
+
9198
+ /**
9199
+ * SurveyResponse questions.
9200
+ * @member {Array.<ISurveyQuestion>} questions
9201
+ * @memberof SurveyResponse
9202
+ * @instance
9203
+ */
9204
+ SurveyResponse.prototype.questions = $util.emptyArray;
9205
+
9206
+ /**
9207
+ * SurveyResponse createdAtIsoDate.
9208
+ * @member {string} createdAtIsoDate
9209
+ * @memberof SurveyResponse
9210
+ * @instance
9211
+ */
9212
+ SurveyResponse.prototype.createdAtIsoDate = "";
9213
+
9214
+ /**
9215
+ * Creates a new SurveyResponse instance using the specified properties.
9216
+ * @function create
9217
+ * @memberof SurveyResponse
9218
+ * @static
9219
+ * @param {ISurveyResponse=} [properties] Properties to set
9220
+ * @returns {SurveyResponse} SurveyResponse instance
9221
+ */
9222
+ SurveyResponse.create = function create(properties) {
9223
+ return new SurveyResponse(properties);
9224
+ };
9225
+
9226
+ /**
9227
+ * Encodes the specified SurveyResponse message. Does not implicitly {@link SurveyResponse.verify|verify} messages.
9228
+ * @function encode
9229
+ * @memberof SurveyResponse
9230
+ * @static
9231
+ * @param {ISurveyResponse} message SurveyResponse message or plain object to encode
9232
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9233
+ * @returns {$protobuf.Writer} Writer
9234
+ */
9235
+ SurveyResponse.encode = function encode(message, writer) {
9236
+ if (!writer)
9237
+ writer = $Writer.create();
9238
+ if (message.userId != null && message.hasOwnProperty("userId"))
9239
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId);
9240
+ if (message.surveyId != null && message.hasOwnProperty("surveyId"))
9241
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.surveyId);
9242
+ if (message.questions != null && message.questions.length)
9243
+ for (var i = 0; i < message.questions.length; ++i)
9244
+ $root.SurveyQuestion.encode(message.questions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
9245
+ if (message.createdAtIsoDate != null && message.hasOwnProperty("createdAtIsoDate"))
9246
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.createdAtIsoDate);
9247
+ return writer;
9248
+ };
9249
+
9250
+ /**
9251
+ * Encodes the specified SurveyResponse message, length delimited. Does not implicitly {@link SurveyResponse.verify|verify} messages.
9252
+ * @function encodeDelimited
9253
+ * @memberof SurveyResponse
9254
+ * @static
9255
+ * @param {ISurveyResponse} message SurveyResponse message or plain object to encode
9256
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9257
+ * @returns {$protobuf.Writer} Writer
9258
+ */
9259
+ SurveyResponse.encodeDelimited = function encodeDelimited(message, writer) {
9260
+ return this.encode(message, writer).ldelim();
9261
+ };
9262
+
9263
+ /**
9264
+ * Decodes a SurveyResponse message from the specified reader or buffer.
9265
+ * @function decode
9266
+ * @memberof SurveyResponse
9267
+ * @static
9268
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9269
+ * @param {number} [length] Message length if known beforehand
9270
+ * @returns {SurveyResponse} SurveyResponse
9271
+ * @throws {Error} If the payload is not a reader or valid buffer
9272
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9273
+ */
9274
+ SurveyResponse.decode = function decode(reader, length) {
9275
+ if (!(reader instanceof $Reader))
9276
+ reader = $Reader.create(reader);
9277
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SurveyResponse();
9278
+ while (reader.pos < end) {
9279
+ var tag = reader.uint32();
9280
+ switch (tag >>> 3) {
9281
+ case 1:
9282
+ message.userId = reader.string();
9283
+ break;
9284
+ case 2:
9285
+ message.surveyId = reader.string();
9286
+ break;
9287
+ case 3:
9288
+ if (!(message.questions && message.questions.length))
9289
+ message.questions = [];
9290
+ message.questions.push($root.SurveyQuestion.decode(reader, reader.uint32()));
9291
+ break;
9292
+ case 4:
9293
+ message.createdAtIsoDate = reader.string();
9294
+ break;
9295
+ default:
9296
+ reader.skipType(tag & 7);
9297
+ break;
9298
+ }
9299
+ }
9300
+ return message;
9301
+ };
9302
+
9303
+ /**
9304
+ * Decodes a SurveyResponse message from the specified reader or buffer, length delimited.
9305
+ * @function decodeDelimited
9306
+ * @memberof SurveyResponse
9307
+ * @static
9308
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9309
+ * @returns {SurveyResponse} SurveyResponse
9310
+ * @throws {Error} If the payload is not a reader or valid buffer
9311
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9312
+ */
9313
+ SurveyResponse.decodeDelimited = function decodeDelimited(reader) {
9314
+ if (!(reader instanceof $Reader))
9315
+ reader = new $Reader(reader);
9316
+ return this.decode(reader, reader.uint32());
9317
+ };
9318
+
9319
+ /**
9320
+ * Verifies a SurveyResponse message.
9321
+ * @function verify
9322
+ * @memberof SurveyResponse
9323
+ * @static
9324
+ * @param {Object.<string,*>} message Plain object to verify
9325
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9326
+ */
9327
+ SurveyResponse.verify = function verify(message) {
9328
+ if (typeof message !== "object" || message === null)
9329
+ return "object expected";
9330
+ if (message.userId != null && message.hasOwnProperty("userId"))
9331
+ if (!$util.isString(message.userId))
9332
+ return "userId: string expected";
9333
+ if (message.surveyId != null && message.hasOwnProperty("surveyId"))
9334
+ if (!$util.isString(message.surveyId))
9335
+ return "surveyId: string expected";
9336
+ if (message.questions != null && message.hasOwnProperty("questions")) {
9337
+ if (!Array.isArray(message.questions))
9338
+ return "questions: array expected";
9339
+ for (var i = 0; i < message.questions.length; ++i) {
9340
+ var error = $root.SurveyQuestion.verify(message.questions[i]);
9341
+ if (error)
9342
+ return "questions." + error;
9343
+ }
9344
+ }
9345
+ if (message.createdAtIsoDate != null && message.hasOwnProperty("createdAtIsoDate"))
9346
+ if (!$util.isString(message.createdAtIsoDate))
9347
+ return "createdAtIsoDate: string expected";
9348
+ return null;
9349
+ };
9350
+
9351
+ /**
9352
+ * Creates a SurveyResponse message from a plain object. Also converts values to their respective internal types.
9353
+ * @function fromObject
9354
+ * @memberof SurveyResponse
9355
+ * @static
9356
+ * @param {Object.<string,*>} object Plain object
9357
+ * @returns {SurveyResponse} SurveyResponse
9358
+ */
9359
+ SurveyResponse.fromObject = function fromObject(object) {
9360
+ if (object instanceof $root.SurveyResponse)
9361
+ return object;
9362
+ var message = new $root.SurveyResponse();
9363
+ if (object.userId != null)
9364
+ message.userId = String(object.userId);
9365
+ if (object.surveyId != null)
9366
+ message.surveyId = String(object.surveyId);
9367
+ if (object.questions) {
9368
+ if (!Array.isArray(object.questions))
9369
+ throw TypeError(".SurveyResponse.questions: array expected");
9370
+ message.questions = [];
9371
+ for (var i = 0; i < object.questions.length; ++i) {
9372
+ if (typeof object.questions[i] !== "object")
9373
+ throw TypeError(".SurveyResponse.questions: object expected");
9374
+ message.questions[i] = $root.SurveyQuestion.fromObject(object.questions[i]);
9375
+ }
9376
+ }
9377
+ if (object.createdAtIsoDate != null)
9378
+ message.createdAtIsoDate = String(object.createdAtIsoDate);
9379
+ return message;
9380
+ };
9381
+
9382
+ /**
9383
+ * Creates a plain object from a SurveyResponse message. Also converts values to other types if specified.
9384
+ * @function toObject
9385
+ * @memberof SurveyResponse
9386
+ * @static
9387
+ * @param {SurveyResponse} message SurveyResponse
9388
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9389
+ * @returns {Object.<string,*>} Plain object
9390
+ */
9391
+ SurveyResponse.toObject = function toObject(message, options) {
9392
+ if (!options)
9393
+ options = {};
9394
+ var object = {};
9395
+ if (options.arrays || options.defaults)
9396
+ object.questions = [];
9397
+ if (options.defaults) {
9398
+ object.userId = "";
9399
+ object.surveyId = "";
9400
+ object.createdAtIsoDate = "";
9401
+ }
9402
+ if (message.userId != null && message.hasOwnProperty("userId"))
9403
+ object.userId = message.userId;
9404
+ if (message.surveyId != null && message.hasOwnProperty("surveyId"))
9405
+ object.surveyId = message.surveyId;
9406
+ if (message.questions && message.questions.length) {
9407
+ object.questions = [];
9408
+ for (var j = 0; j < message.questions.length; ++j)
9409
+ object.questions[j] = $root.SurveyQuestion.toObject(message.questions[j], options);
9410
+ }
9411
+ if (message.createdAtIsoDate != null && message.hasOwnProperty("createdAtIsoDate"))
9412
+ object.createdAtIsoDate = message.createdAtIsoDate;
9413
+ return object;
9414
+ };
9415
+
9416
+ /**
9417
+ * Converts this SurveyResponse to JSON.
9418
+ * @function toJSON
9419
+ * @memberof SurveyResponse
9420
+ * @instance
9421
+ * @returns {Object.<string,*>} JSON object
9422
+ */
9423
+ SurveyResponse.prototype.toJSON = function toJSON() {
9424
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9425
+ };
9426
+
9427
+ return SurveyResponse;
9428
+ })();
9429
+
9430
+ $root.SurveyQuestion = (function() {
9431
+
9432
+ /**
9433
+ * Properties of a SurveyQuestion.
9434
+ * @exports ISurveyQuestion
9435
+ * @interface ISurveyQuestion
9436
+ * @property {string|null} [title] SurveyQuestion title
9437
+ * @property {Array.<ISurveyAnswer>|null} [answers] SurveyQuestion answers
9438
+ */
9439
+
9440
+ /**
9441
+ * Constructs a new SurveyQuestion.
9442
+ * @exports SurveyQuestion
9443
+ * @classdesc Represents a SurveyQuestion.
9444
+ * @implements ISurveyQuestion
9445
+ * @constructor
9446
+ * @param {ISurveyQuestion=} [properties] Properties to set
9447
+ */
9448
+ function SurveyQuestion(properties) {
9449
+ this.answers = [];
9450
+ if (properties)
9451
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
9452
+ if (properties[keys[i]] != null)
9453
+ this[keys[i]] = properties[keys[i]];
9454
+ }
9455
+
9456
+ /**
9457
+ * SurveyQuestion title.
9458
+ * @member {string} title
9459
+ * @memberof SurveyQuestion
9460
+ * @instance
9461
+ */
9462
+ SurveyQuestion.prototype.title = "";
9463
+
9464
+ /**
9465
+ * SurveyQuestion answers.
9466
+ * @member {Array.<ISurveyAnswer>} answers
9467
+ * @memberof SurveyQuestion
9468
+ * @instance
9469
+ */
9470
+ SurveyQuestion.prototype.answers = $util.emptyArray;
9471
+
9472
+ /**
9473
+ * Creates a new SurveyQuestion instance using the specified properties.
9474
+ * @function create
9475
+ * @memberof SurveyQuestion
9476
+ * @static
9477
+ * @param {ISurveyQuestion=} [properties] Properties to set
9478
+ * @returns {SurveyQuestion} SurveyQuestion instance
9479
+ */
9480
+ SurveyQuestion.create = function create(properties) {
9481
+ return new SurveyQuestion(properties);
9482
+ };
9483
+
9484
+ /**
9485
+ * Encodes the specified SurveyQuestion message. Does not implicitly {@link SurveyQuestion.verify|verify} messages.
9486
+ * @function encode
9487
+ * @memberof SurveyQuestion
9488
+ * @static
9489
+ * @param {ISurveyQuestion} message SurveyQuestion message or plain object to encode
9490
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9491
+ * @returns {$protobuf.Writer} Writer
9492
+ */
9493
+ SurveyQuestion.encode = function encode(message, writer) {
9494
+ if (!writer)
9495
+ writer = $Writer.create();
9496
+ if (message.title != null && message.hasOwnProperty("title"))
9497
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.title);
9498
+ if (message.answers != null && message.answers.length)
9499
+ for (var i = 0; i < message.answers.length; ++i)
9500
+ $root.SurveyAnswer.encode(message.answers[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
9501
+ return writer;
9502
+ };
9503
+
9504
+ /**
9505
+ * Encodes the specified SurveyQuestion message, length delimited. Does not implicitly {@link SurveyQuestion.verify|verify} messages.
9506
+ * @function encodeDelimited
9507
+ * @memberof SurveyQuestion
9508
+ * @static
9509
+ * @param {ISurveyQuestion} message SurveyQuestion message or plain object to encode
9510
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9511
+ * @returns {$protobuf.Writer} Writer
9512
+ */
9513
+ SurveyQuestion.encodeDelimited = function encodeDelimited(message, writer) {
9514
+ return this.encode(message, writer).ldelim();
9515
+ };
9516
+
9517
+ /**
9518
+ * Decodes a SurveyQuestion message from the specified reader or buffer.
9519
+ * @function decode
9520
+ * @memberof SurveyQuestion
9521
+ * @static
9522
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9523
+ * @param {number} [length] Message length if known beforehand
9524
+ * @returns {SurveyQuestion} SurveyQuestion
9525
+ * @throws {Error} If the payload is not a reader or valid buffer
9526
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9527
+ */
9528
+ SurveyQuestion.decode = function decode(reader, length) {
9529
+ if (!(reader instanceof $Reader))
9530
+ reader = $Reader.create(reader);
9531
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SurveyQuestion();
9532
+ while (reader.pos < end) {
9533
+ var tag = reader.uint32();
9534
+ switch (tag >>> 3) {
9535
+ case 1:
9536
+ message.title = reader.string();
9537
+ break;
9538
+ case 2:
9539
+ if (!(message.answers && message.answers.length))
9540
+ message.answers = [];
9541
+ message.answers.push($root.SurveyAnswer.decode(reader, reader.uint32()));
9542
+ break;
9543
+ default:
9544
+ reader.skipType(tag & 7);
9545
+ break;
9546
+ }
9547
+ }
9548
+ return message;
9549
+ };
9550
+
9551
+ /**
9552
+ * Decodes a SurveyQuestion message from the specified reader or buffer, length delimited.
9553
+ * @function decodeDelimited
9554
+ * @memberof SurveyQuestion
9555
+ * @static
9556
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9557
+ * @returns {SurveyQuestion} SurveyQuestion
9558
+ * @throws {Error} If the payload is not a reader or valid buffer
9559
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9560
+ */
9561
+ SurveyQuestion.decodeDelimited = function decodeDelimited(reader) {
9562
+ if (!(reader instanceof $Reader))
9563
+ reader = new $Reader(reader);
9564
+ return this.decode(reader, reader.uint32());
9565
+ };
9566
+
9567
+ /**
9568
+ * Verifies a SurveyQuestion message.
9569
+ * @function verify
9570
+ * @memberof SurveyQuestion
9571
+ * @static
9572
+ * @param {Object.<string,*>} message Plain object to verify
9573
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9574
+ */
9575
+ SurveyQuestion.verify = function verify(message) {
9576
+ if (typeof message !== "object" || message === null)
9577
+ return "object expected";
9578
+ if (message.title != null && message.hasOwnProperty("title"))
9579
+ if (!$util.isString(message.title))
9580
+ return "title: string expected";
9581
+ if (message.answers != null && message.hasOwnProperty("answers")) {
9582
+ if (!Array.isArray(message.answers))
9583
+ return "answers: array expected";
9584
+ for (var i = 0; i < message.answers.length; ++i) {
9585
+ var error = $root.SurveyAnswer.verify(message.answers[i]);
9586
+ if (error)
9587
+ return "answers." + error;
9588
+ }
9589
+ }
9590
+ return null;
9591
+ };
9592
+
9593
+ /**
9594
+ * Creates a SurveyQuestion message from a plain object. Also converts values to their respective internal types.
9595
+ * @function fromObject
9596
+ * @memberof SurveyQuestion
9597
+ * @static
9598
+ * @param {Object.<string,*>} object Plain object
9599
+ * @returns {SurveyQuestion} SurveyQuestion
9600
+ */
9601
+ SurveyQuestion.fromObject = function fromObject(object) {
9602
+ if (object instanceof $root.SurveyQuestion)
9603
+ return object;
9604
+ var message = new $root.SurveyQuestion();
9605
+ if (object.title != null)
9606
+ message.title = String(object.title);
9607
+ if (object.answers) {
9608
+ if (!Array.isArray(object.answers))
9609
+ throw TypeError(".SurveyQuestion.answers: array expected");
9610
+ message.answers = [];
9611
+ for (var i = 0; i < object.answers.length; ++i) {
9612
+ if (typeof object.answers[i] !== "object")
9613
+ throw TypeError(".SurveyQuestion.answers: object expected");
9614
+ message.answers[i] = $root.SurveyAnswer.fromObject(object.answers[i]);
9615
+ }
9616
+ }
9617
+ return message;
9618
+ };
9619
+
9620
+ /**
9621
+ * Creates a plain object from a SurveyQuestion message. Also converts values to other types if specified.
9622
+ * @function toObject
9623
+ * @memberof SurveyQuestion
9624
+ * @static
9625
+ * @param {SurveyQuestion} message SurveyQuestion
9626
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9627
+ * @returns {Object.<string,*>} Plain object
9628
+ */
9629
+ SurveyQuestion.toObject = function toObject(message, options) {
9630
+ if (!options)
9631
+ options = {};
9632
+ var object = {};
9633
+ if (options.arrays || options.defaults)
9634
+ object.answers = [];
9635
+ if (options.defaults)
9636
+ object.title = "";
9637
+ if (message.title != null && message.hasOwnProperty("title"))
9638
+ object.title = message.title;
9639
+ if (message.answers && message.answers.length) {
9640
+ object.answers = [];
9641
+ for (var j = 0; j < message.answers.length; ++j)
9642
+ object.answers[j] = $root.SurveyAnswer.toObject(message.answers[j], options);
9643
+ }
9644
+ return object;
9645
+ };
9646
+
9647
+ /**
9648
+ * Converts this SurveyQuestion to JSON.
9649
+ * @function toJSON
9650
+ * @memberof SurveyQuestion
9651
+ * @instance
9652
+ * @returns {Object.<string,*>} JSON object
9653
+ */
9654
+ SurveyQuestion.prototype.toJSON = function toJSON() {
9655
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9656
+ };
9657
+
9658
+ return SurveyQuestion;
9659
+ })();
9660
+
9661
+ $root.SurveyAnswer = (function() {
9662
+
9663
+ /**
9664
+ * Properties of a SurveyAnswer.
9665
+ * @exports ISurveyAnswer
9666
+ * @interface ISurveyAnswer
9667
+ * @property {string|null} [text] SurveyAnswer text
9668
+ * @property {string|null} [choice] SurveyAnswer choice
9669
+ */
9670
+
9671
+ /**
9672
+ * Constructs a new SurveyAnswer.
9673
+ * @exports SurveyAnswer
9674
+ * @classdesc Represents a SurveyAnswer.
9675
+ * @implements ISurveyAnswer
9676
+ * @constructor
9677
+ * @param {ISurveyAnswer=} [properties] Properties to set
9678
+ */
9679
+ function SurveyAnswer(properties) {
9680
+ if (properties)
9681
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
9682
+ if (properties[keys[i]] != null)
9683
+ this[keys[i]] = properties[keys[i]];
9684
+ }
9685
+
9686
+ /**
9687
+ * SurveyAnswer text.
9688
+ * @member {string} text
9689
+ * @memberof SurveyAnswer
9690
+ * @instance
9691
+ */
9692
+ SurveyAnswer.prototype.text = "";
9693
+
9694
+ /**
9695
+ * SurveyAnswer choice.
9696
+ * @member {string} choice
9697
+ * @memberof SurveyAnswer
9698
+ * @instance
9699
+ */
9700
+ SurveyAnswer.prototype.choice = "";
9701
+
9702
+ // OneOf field names bound to virtual getters and setters
9703
+ var $oneOfFields;
9704
+
9705
+ /**
9706
+ * SurveyAnswer answer.
9707
+ * @member {"text"|"choice"|undefined} answer
9708
+ * @memberof SurveyAnswer
9709
+ * @instance
9710
+ */
9711
+ Object.defineProperty(SurveyAnswer.prototype, "answer", {
9712
+ get: $util.oneOfGetter($oneOfFields = ["text", "choice"]),
9713
+ set: $util.oneOfSetter($oneOfFields)
9714
+ });
9715
+
9716
+ /**
9717
+ * Creates a new SurveyAnswer instance using the specified properties.
9718
+ * @function create
9719
+ * @memberof SurveyAnswer
9720
+ * @static
9721
+ * @param {ISurveyAnswer=} [properties] Properties to set
9722
+ * @returns {SurveyAnswer} SurveyAnswer instance
9723
+ */
9724
+ SurveyAnswer.create = function create(properties) {
9725
+ return new SurveyAnswer(properties);
9726
+ };
9727
+
9728
+ /**
9729
+ * Encodes the specified SurveyAnswer message. Does not implicitly {@link SurveyAnswer.verify|verify} messages.
9730
+ * @function encode
9731
+ * @memberof SurveyAnswer
9732
+ * @static
9733
+ * @param {ISurveyAnswer} message SurveyAnswer message or plain object to encode
9734
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9735
+ * @returns {$protobuf.Writer} Writer
9736
+ */
9737
+ SurveyAnswer.encode = function encode(message, writer) {
9738
+ if (!writer)
9739
+ writer = $Writer.create();
9740
+ if (message.text != null && message.hasOwnProperty("text"))
9741
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.text);
9742
+ if (message.choice != null && message.hasOwnProperty("choice"))
9743
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.choice);
9744
+ return writer;
9745
+ };
9746
+
9747
+ /**
9748
+ * Encodes the specified SurveyAnswer message, length delimited. Does not implicitly {@link SurveyAnswer.verify|verify} messages.
9749
+ * @function encodeDelimited
9750
+ * @memberof SurveyAnswer
9751
+ * @static
9752
+ * @param {ISurveyAnswer} message SurveyAnswer message or plain object to encode
9753
+ * @param {$protobuf.Writer} [writer] Writer to encode to
9754
+ * @returns {$protobuf.Writer} Writer
9755
+ */
9756
+ SurveyAnswer.encodeDelimited = function encodeDelimited(message, writer) {
9757
+ return this.encode(message, writer).ldelim();
9758
+ };
9759
+
9760
+ /**
9761
+ * Decodes a SurveyAnswer message from the specified reader or buffer.
9762
+ * @function decode
9763
+ * @memberof SurveyAnswer
9764
+ * @static
9765
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9766
+ * @param {number} [length] Message length if known beforehand
9767
+ * @returns {SurveyAnswer} SurveyAnswer
9768
+ * @throws {Error} If the payload is not a reader or valid buffer
9769
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9770
+ */
9771
+ SurveyAnswer.decode = function decode(reader, length) {
9772
+ if (!(reader instanceof $Reader))
9773
+ reader = $Reader.create(reader);
9774
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SurveyAnswer();
9775
+ while (reader.pos < end) {
9776
+ var tag = reader.uint32();
9777
+ switch (tag >>> 3) {
9778
+ case 1:
9779
+ message.text = reader.string();
9780
+ break;
9781
+ case 2:
9782
+ message.choice = reader.string();
9783
+ break;
9784
+ default:
9785
+ reader.skipType(tag & 7);
9786
+ break;
9787
+ }
9788
+ }
9789
+ return message;
9790
+ };
9791
+
9792
+ /**
9793
+ * Decodes a SurveyAnswer message from the specified reader or buffer, length delimited.
9794
+ * @function decodeDelimited
9795
+ * @memberof SurveyAnswer
9796
+ * @static
9797
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
9798
+ * @returns {SurveyAnswer} SurveyAnswer
9799
+ * @throws {Error} If the payload is not a reader or valid buffer
9800
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
9801
+ */
9802
+ SurveyAnswer.decodeDelimited = function decodeDelimited(reader) {
9803
+ if (!(reader instanceof $Reader))
9804
+ reader = new $Reader(reader);
9805
+ return this.decode(reader, reader.uint32());
9806
+ };
9807
+
9808
+ /**
9809
+ * Verifies a SurveyAnswer message.
9810
+ * @function verify
9811
+ * @memberof SurveyAnswer
9812
+ * @static
9813
+ * @param {Object.<string,*>} message Plain object to verify
9814
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
9815
+ */
9816
+ SurveyAnswer.verify = function verify(message) {
9817
+ if (typeof message !== "object" || message === null)
9818
+ return "object expected";
9819
+ var properties = {};
9820
+ if (message.text != null && message.hasOwnProperty("text")) {
9821
+ properties.answer = 1;
9822
+ if (!$util.isString(message.text))
9823
+ return "text: string expected";
9824
+ }
9825
+ if (message.choice != null && message.hasOwnProperty("choice")) {
9826
+ if (properties.answer === 1)
9827
+ return "answer: multiple values";
9828
+ properties.answer = 1;
9829
+ if (!$util.isString(message.choice))
9830
+ return "choice: string expected";
9831
+ }
9832
+ return null;
9833
+ };
9834
+
9835
+ /**
9836
+ * Creates a SurveyAnswer message from a plain object. Also converts values to their respective internal types.
9837
+ * @function fromObject
9838
+ * @memberof SurveyAnswer
9839
+ * @static
9840
+ * @param {Object.<string,*>} object Plain object
9841
+ * @returns {SurveyAnswer} SurveyAnswer
9842
+ */
9843
+ SurveyAnswer.fromObject = function fromObject(object) {
9844
+ if (object instanceof $root.SurveyAnswer)
9845
+ return object;
9846
+ var message = new $root.SurveyAnswer();
9847
+ if (object.text != null)
9848
+ message.text = String(object.text);
9849
+ if (object.choice != null)
9850
+ message.choice = String(object.choice);
9851
+ return message;
9852
+ };
9853
+
9854
+ /**
9855
+ * Creates a plain object from a SurveyAnswer message. Also converts values to other types if specified.
9856
+ * @function toObject
9857
+ * @memberof SurveyAnswer
9858
+ * @static
9859
+ * @param {SurveyAnswer} message SurveyAnswer
9860
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
9861
+ * @returns {Object.<string,*>} Plain object
9862
+ */
9863
+ SurveyAnswer.toObject = function toObject(message, options) {
9864
+ if (!options)
9865
+ options = {};
9866
+ var object = {};
9867
+ if (message.text != null && message.hasOwnProperty("text")) {
9868
+ object.text = message.text;
9869
+ if (options.oneofs)
9870
+ object.answer = "text";
9871
+ }
9872
+ if (message.choice != null && message.hasOwnProperty("choice")) {
9873
+ object.choice = message.choice;
9874
+ if (options.oneofs)
9875
+ object.answer = "choice";
9876
+ }
9877
+ return object;
9878
+ };
9879
+
9880
+ /**
9881
+ * Converts this SurveyAnswer to JSON.
9882
+ * @function toJSON
9883
+ * @memberof SurveyAnswer
9884
+ * @instance
9885
+ * @returns {Object.<string,*>} JSON object
9886
+ */
9887
+ SurveyAnswer.prototype.toJSON = function toJSON() {
9888
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9889
+ };
9890
+
9891
+ return SurveyAnswer;
9892
+ })();
9893
+
9154
9894
  $root.BuddyAccepted = (function() {
9155
9895
 
9156
9896
  /**
package/package.json CHANGED
@@ -16,5 +16,5 @@
16
16
  "main": "lib/index.js",
17
17
  "name": "@headspace/protos-events",
18
18
  "typings": "lib/index.d.ts",
19
- "version": "1.82.0"
19
+ "version": "1.84.0"
20
20
  }