@headspace/protos-events 1.414.0 → 1.416.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
@@ -10037,6 +10037,9 @@ export namespace b2b {
10037
10037
 
10038
10038
  /** Organization orgSlug */
10039
10039
  orgSlug?: (string|null);
10040
+
10041
+ /** Organization orgAddons */
10042
+ orgAddons?: (b2b.AddOn[]|null);
10040
10043
  }
10041
10044
 
10042
10045
  /** Represents an Organization. */
@@ -10087,6 +10090,9 @@ export namespace b2b {
10087
10090
  /** Organization orgSlug. */
10088
10091
  public orgSlug: string;
10089
10092
 
10093
+ /** Organization orgAddons. */
10094
+ public orgAddons: b2b.AddOn[];
10095
+
10090
10096
  /**
10091
10097
  * Creates a new Organization instance using the specified properties.
10092
10098
  * @param [properties] Properties to set
@@ -10363,6 +10369,14 @@ export namespace b2b {
10363
10369
  SUBSCRIPTION_OFFERING_HEADSPACE = 1,
10364
10370
  SUBSCRIPTION_OFFERING_GINGER = 2
10365
10371
  }
10372
+
10373
+ /** AddOn enum. */
10374
+ enum AddOn {
10375
+ ADD_ON_UNKNOWN = 0,
10376
+ ADD_ON_EAP = 1,
10377
+ ADD_ON_WPO = 2,
10378
+ ADD_ON_R3C = 3
10379
+ }
10366
10380
  }
10367
10381
 
10368
10382
  /** Namespace community. */
@@ -29086,6 +29100,153 @@ export class B2BAdminCreated implements IB2BAdminCreated {
29086
29100
  public toJSON(): { [k: string]: any };
29087
29101
  }
29088
29102
 
29103
+ /** ChallengeType enum. */
29104
+ export enum ChallengeType {
29105
+ MEDITATION = 0,
29106
+ SLEEP = 1,
29107
+ FOCUS = 2,
29108
+ MOVE = 3,
29109
+ ALL = 4
29110
+ }
29111
+
29112
+ /** GoalType enum. */
29113
+ export enum GoalType {
29114
+ CONTENT_STARTS = 0,
29115
+ MINUTES = 1
29116
+ }
29117
+
29118
+ /** Properties of a B2BChallengeCreated. */
29119
+ export interface IB2BChallengeCreated {
29120
+
29121
+ /** B2BChallengeCreated b2bOrgId */
29122
+ b2bOrgId?: (string|null);
29123
+
29124
+ /** B2BChallengeCreated headspaceHealthId */
29125
+ headspaceHealthId?: (string|null);
29126
+
29127
+ /** B2BChallengeCreated orgName */
29128
+ orgName?: (string|null);
29129
+
29130
+ /** B2BChallengeCreated challengeType */
29131
+ challengeType?: (ChallengeType|null);
29132
+
29133
+ /** B2BChallengeCreated startDate_8601 */
29134
+ startDate_8601?: (string|null);
29135
+
29136
+ /** B2BChallengeCreated durationInWeeks */
29137
+ durationInWeeks?: (number|Long|null);
29138
+
29139
+ /** B2BChallengeCreated goalType */
29140
+ goalType?: (GoalType|null);
29141
+
29142
+ /** B2BChallengeCreated goalTarget */
29143
+ goalTarget?: (number|Long|null);
29144
+ }
29145
+
29146
+ /** Represents a B2BChallengeCreated. */
29147
+ export class B2BChallengeCreated implements IB2BChallengeCreated {
29148
+
29149
+ /**
29150
+ * Constructs a new B2BChallengeCreated.
29151
+ * @param [properties] Properties to set
29152
+ */
29153
+ constructor(properties?: IB2BChallengeCreated);
29154
+
29155
+ /** B2BChallengeCreated b2bOrgId. */
29156
+ public b2bOrgId: string;
29157
+
29158
+ /** B2BChallengeCreated headspaceHealthId. */
29159
+ public headspaceHealthId: string;
29160
+
29161
+ /** B2BChallengeCreated orgName. */
29162
+ public orgName: string;
29163
+
29164
+ /** B2BChallengeCreated challengeType. */
29165
+ public challengeType: ChallengeType;
29166
+
29167
+ /** B2BChallengeCreated startDate_8601. */
29168
+ public startDate_8601: string;
29169
+
29170
+ /** B2BChallengeCreated durationInWeeks. */
29171
+ public durationInWeeks: (number|Long);
29172
+
29173
+ /** B2BChallengeCreated goalType. */
29174
+ public goalType: GoalType;
29175
+
29176
+ /** B2BChallengeCreated goalTarget. */
29177
+ public goalTarget: (number|Long);
29178
+
29179
+ /**
29180
+ * Creates a new B2BChallengeCreated instance using the specified properties.
29181
+ * @param [properties] Properties to set
29182
+ * @returns B2BChallengeCreated instance
29183
+ */
29184
+ public static create(properties?: IB2BChallengeCreated): B2BChallengeCreated;
29185
+
29186
+ /**
29187
+ * Encodes the specified B2BChallengeCreated message. Does not implicitly {@link B2BChallengeCreated.verify|verify} messages.
29188
+ * @param message B2BChallengeCreated message or plain object to encode
29189
+ * @param [writer] Writer to encode to
29190
+ * @returns Writer
29191
+ */
29192
+ public static encode(message: IB2BChallengeCreated, writer?: $protobuf.Writer): $protobuf.Writer;
29193
+
29194
+ /**
29195
+ * Encodes the specified B2BChallengeCreated message, length delimited. Does not implicitly {@link B2BChallengeCreated.verify|verify} messages.
29196
+ * @param message B2BChallengeCreated message or plain object to encode
29197
+ * @param [writer] Writer to encode to
29198
+ * @returns Writer
29199
+ */
29200
+ public static encodeDelimited(message: IB2BChallengeCreated, writer?: $protobuf.Writer): $protobuf.Writer;
29201
+
29202
+ /**
29203
+ * Decodes a B2BChallengeCreated message from the specified reader or buffer.
29204
+ * @param reader Reader or buffer to decode from
29205
+ * @param [length] Message length if known beforehand
29206
+ * @returns B2BChallengeCreated
29207
+ * @throws {Error} If the payload is not a reader or valid buffer
29208
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
29209
+ */
29210
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): B2BChallengeCreated;
29211
+
29212
+ /**
29213
+ * Decodes a B2BChallengeCreated message from the specified reader or buffer, length delimited.
29214
+ * @param reader Reader or buffer to decode from
29215
+ * @returns B2BChallengeCreated
29216
+ * @throws {Error} If the payload is not a reader or valid buffer
29217
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
29218
+ */
29219
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): B2BChallengeCreated;
29220
+
29221
+ /**
29222
+ * Verifies a B2BChallengeCreated message.
29223
+ * @param message Plain object to verify
29224
+ * @returns `null` if valid, otherwise the reason why it is not
29225
+ */
29226
+ public static verify(message: { [k: string]: any }): (string|null);
29227
+
29228
+ /**
29229
+ * Creates a B2BChallengeCreated message from a plain object. Also converts values to their respective internal types.
29230
+ * @param object Plain object
29231
+ * @returns B2BChallengeCreated
29232
+ */
29233
+ public static fromObject(object: { [k: string]: any }): B2BChallengeCreated;
29234
+
29235
+ /**
29236
+ * Creates a plain object from a B2BChallengeCreated message. Also converts values to other types if specified.
29237
+ * @param message B2BChallengeCreated
29238
+ * @param [options] Conversion options
29239
+ * @returns Plain object
29240
+ */
29241
+ public static toObject(message: B2BChallengeCreated, options?: $protobuf.IConversionOptions): { [k: string]: any };
29242
+
29243
+ /**
29244
+ * Converts this B2BChallengeCreated to JSON.
29245
+ * @returns JSON object
29246
+ */
29247
+ public toJSON(): { [k: string]: any };
29248
+ }
29249
+
29089
29250
  /** Properties of an EligibilityFileProcessed. */
29090
29251
  export interface IEligibilityFileProcessed {
29091
29252
 
package/lib/index.js CHANGED
@@ -23947,6 +23947,7 @@ $root.b2b = (function() {
23947
23947
  * @property {string|null} [headspaceHealthId] Organization headspaceHealthId
23948
23948
  * @property {boolean|null} [mfaEnabled] Organization mfaEnabled
23949
23949
  * @property {string|null} [orgSlug] Organization orgSlug
23950
+ * @property {Array.<b2b.AddOn>|null} [orgAddons] Organization orgAddons
23950
23951
  */
23951
23952
 
23952
23953
  /**
@@ -23958,6 +23959,7 @@ $root.b2b = (function() {
23958
23959
  * @param {b2b.IOrganization=} [properties] Properties to set
23959
23960
  */
23960
23961
  function Organization(properties) {
23962
+ this.orgAddons = [];
23961
23963
  if (properties)
23962
23964
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
23963
23965
  if (properties[keys[i]] != null)
@@ -24068,6 +24070,14 @@ $root.b2b = (function() {
24068
24070
  */
24069
24071
  Organization.prototype.orgSlug = "";
24070
24072
 
24073
+ /**
24074
+ * Organization orgAddons.
24075
+ * @member {Array.<b2b.AddOn>} orgAddons
24076
+ * @memberof b2b.Organization
24077
+ * @instance
24078
+ */
24079
+ Organization.prototype.orgAddons = $util.emptyArray;
24080
+
24071
24081
  /**
24072
24082
  * Creates a new Organization instance using the specified properties.
24073
24083
  * @function create
@@ -24118,6 +24128,12 @@ $root.b2b = (function() {
24118
24128
  writer.uint32(/* id 12, wireType 0 =*/96).bool(message.mfaEnabled);
24119
24129
  if (message.orgSlug != null && message.hasOwnProperty("orgSlug"))
24120
24130
  writer.uint32(/* id 13, wireType 2 =*/106).string(message.orgSlug);
24131
+ if (message.orgAddons != null && message.orgAddons.length) {
24132
+ writer.uint32(/* id 14, wireType 2 =*/114).fork();
24133
+ for (var i = 0; i < message.orgAddons.length; ++i)
24134
+ writer.int32(message.orgAddons[i]);
24135
+ writer.ldelim();
24136
+ }
24121
24137
  return writer;
24122
24138
  };
24123
24139
 
@@ -24191,6 +24207,16 @@ $root.b2b = (function() {
24191
24207
  case 13:
24192
24208
  message.orgSlug = reader.string();
24193
24209
  break;
24210
+ case 14:
24211
+ if (!(message.orgAddons && message.orgAddons.length))
24212
+ message.orgAddons = [];
24213
+ if ((tag & 7) === 2) {
24214
+ var end2 = reader.uint32() + reader.pos;
24215
+ while (reader.pos < end2)
24216
+ message.orgAddons.push(reader.int32());
24217
+ } else
24218
+ message.orgAddons.push(reader.int32());
24219
+ break;
24194
24220
  default:
24195
24221
  reader.skipType(tag & 7);
24196
24222
  break;
@@ -24288,6 +24314,20 @@ $root.b2b = (function() {
24288
24314
  if (message.orgSlug != null && message.hasOwnProperty("orgSlug"))
24289
24315
  if (!$util.isString(message.orgSlug))
24290
24316
  return "orgSlug: string expected";
24317
+ if (message.orgAddons != null && message.hasOwnProperty("orgAddons")) {
24318
+ if (!Array.isArray(message.orgAddons))
24319
+ return "orgAddons: array expected";
24320
+ for (var i = 0; i < message.orgAddons.length; ++i)
24321
+ switch (message.orgAddons[i]) {
24322
+ default:
24323
+ return "orgAddons: enum value[] expected";
24324
+ case 0:
24325
+ case 1:
24326
+ case 2:
24327
+ case 3:
24328
+ break;
24329
+ }
24330
+ }
24291
24331
  return null;
24292
24332
  };
24293
24333
 
@@ -24397,6 +24437,31 @@ $root.b2b = (function() {
24397
24437
  message.mfaEnabled = Boolean(object.mfaEnabled);
24398
24438
  if (object.orgSlug != null)
24399
24439
  message.orgSlug = String(object.orgSlug);
24440
+ if (object.orgAddons) {
24441
+ if (!Array.isArray(object.orgAddons))
24442
+ throw TypeError(".b2b.Organization.orgAddons: array expected");
24443
+ message.orgAddons = [];
24444
+ for (var i = 0; i < object.orgAddons.length; ++i)
24445
+ switch (object.orgAddons[i]) {
24446
+ default:
24447
+ case "ADD_ON_UNKNOWN":
24448
+ case 0:
24449
+ message.orgAddons[i] = 0;
24450
+ break;
24451
+ case "ADD_ON_EAP":
24452
+ case 1:
24453
+ message.orgAddons[i] = 1;
24454
+ break;
24455
+ case "ADD_ON_WPO":
24456
+ case 2:
24457
+ message.orgAddons[i] = 2;
24458
+ break;
24459
+ case "ADD_ON_R3C":
24460
+ case 3:
24461
+ message.orgAddons[i] = 3;
24462
+ break;
24463
+ }
24464
+ }
24400
24465
  return message;
24401
24466
  };
24402
24467
 
@@ -24413,6 +24478,8 @@ $root.b2b = (function() {
24413
24478
  if (!options)
24414
24479
  options = {};
24415
24480
  var object = {};
24481
+ if (options.arrays || options.defaults)
24482
+ object.orgAddons = [];
24416
24483
  if (options.defaults) {
24417
24484
  object.orgId = 0;
24418
24485
  object.orgName = "";
@@ -24454,6 +24521,11 @@ $root.b2b = (function() {
24454
24521
  object.mfaEnabled = message.mfaEnabled;
24455
24522
  if (message.orgSlug != null && message.hasOwnProperty("orgSlug"))
24456
24523
  object.orgSlug = message.orgSlug;
24524
+ if (message.orgAddons && message.orgAddons.length) {
24525
+ object.orgAddons = [];
24526
+ for (var j = 0; j < message.orgAddons.length; ++j)
24527
+ object.orgAddons[j] = options.enums === String ? $root.b2b.AddOn[message.orgAddons[j]] : message.orgAddons[j];
24528
+ }
24457
24529
  return object;
24458
24530
  };
24459
24531
 
@@ -25094,6 +25166,24 @@ $root.b2b = (function() {
25094
25166
  return values;
25095
25167
  })();
25096
25168
 
25169
+ /**
25170
+ * AddOn enum.
25171
+ * @name b2b.AddOn
25172
+ * @enum {string}
25173
+ * @property {number} ADD_ON_UNKNOWN=0 ADD_ON_UNKNOWN value
25174
+ * @property {number} ADD_ON_EAP=1 ADD_ON_EAP value
25175
+ * @property {number} ADD_ON_WPO=2 ADD_ON_WPO value
25176
+ * @property {number} ADD_ON_R3C=3 ADD_ON_R3C value
25177
+ */
25178
+ b2b.AddOn = (function() {
25179
+ var valuesById = {}, values = Object.create(valuesById);
25180
+ values[valuesById[0] = "ADD_ON_UNKNOWN"] = 0;
25181
+ values[valuesById[1] = "ADD_ON_EAP"] = 1;
25182
+ values[valuesById[2] = "ADD_ON_WPO"] = 2;
25183
+ values[valuesById[3] = "ADD_ON_R3C"] = 3;
25184
+ return values;
25185
+ })();
25186
+
25097
25187
  return b2b;
25098
25188
  })();
25099
25189
 
@@ -80667,6 +80757,451 @@ $root.B2BAdminCreated = (function() {
80667
80757
  return B2BAdminCreated;
80668
80758
  })();
80669
80759
 
80760
+ /**
80761
+ * ChallengeType enum.
80762
+ * @exports ChallengeType
80763
+ * @enum {string}
80764
+ * @property {number} MEDITATION=0 MEDITATION value
80765
+ * @property {number} SLEEP=1 SLEEP value
80766
+ * @property {number} FOCUS=2 FOCUS value
80767
+ * @property {number} MOVE=3 MOVE value
80768
+ * @property {number} ALL=4 ALL value
80769
+ */
80770
+ $root.ChallengeType = (function() {
80771
+ var valuesById = {}, values = Object.create(valuesById);
80772
+ values[valuesById[0] = "MEDITATION"] = 0;
80773
+ values[valuesById[1] = "SLEEP"] = 1;
80774
+ values[valuesById[2] = "FOCUS"] = 2;
80775
+ values[valuesById[3] = "MOVE"] = 3;
80776
+ values[valuesById[4] = "ALL"] = 4;
80777
+ return values;
80778
+ })();
80779
+
80780
+ /**
80781
+ * GoalType enum.
80782
+ * @exports GoalType
80783
+ * @enum {string}
80784
+ * @property {number} CONTENT_STARTS=0 CONTENT_STARTS value
80785
+ * @property {number} MINUTES=1 MINUTES value
80786
+ */
80787
+ $root.GoalType = (function() {
80788
+ var valuesById = {}, values = Object.create(valuesById);
80789
+ values[valuesById[0] = "CONTENT_STARTS"] = 0;
80790
+ values[valuesById[1] = "MINUTES"] = 1;
80791
+ return values;
80792
+ })();
80793
+
80794
+ $root.B2BChallengeCreated = (function() {
80795
+
80796
+ /**
80797
+ * Properties of a B2BChallengeCreated.
80798
+ * @exports IB2BChallengeCreated
80799
+ * @interface IB2BChallengeCreated
80800
+ * @property {string|null} [b2bOrgId] B2BChallengeCreated b2bOrgId
80801
+ * @property {string|null} [headspaceHealthId] B2BChallengeCreated headspaceHealthId
80802
+ * @property {string|null} [orgName] B2BChallengeCreated orgName
80803
+ * @property {ChallengeType|null} [challengeType] B2BChallengeCreated challengeType
80804
+ * @property {string|null} [startDate_8601] B2BChallengeCreated startDate_8601
80805
+ * @property {number|Long|null} [durationInWeeks] B2BChallengeCreated durationInWeeks
80806
+ * @property {GoalType|null} [goalType] B2BChallengeCreated goalType
80807
+ * @property {number|Long|null} [goalTarget] B2BChallengeCreated goalTarget
80808
+ */
80809
+
80810
+ /**
80811
+ * Constructs a new B2BChallengeCreated.
80812
+ * @exports B2BChallengeCreated
80813
+ * @classdesc Represents a B2BChallengeCreated.
80814
+ * @implements IB2BChallengeCreated
80815
+ * @constructor
80816
+ * @param {IB2BChallengeCreated=} [properties] Properties to set
80817
+ */
80818
+ function B2BChallengeCreated(properties) {
80819
+ if (properties)
80820
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
80821
+ if (properties[keys[i]] != null)
80822
+ this[keys[i]] = properties[keys[i]];
80823
+ }
80824
+
80825
+ /**
80826
+ * B2BChallengeCreated b2bOrgId.
80827
+ * @member {string} b2bOrgId
80828
+ * @memberof B2BChallengeCreated
80829
+ * @instance
80830
+ */
80831
+ B2BChallengeCreated.prototype.b2bOrgId = "";
80832
+
80833
+ /**
80834
+ * B2BChallengeCreated headspaceHealthId.
80835
+ * @member {string} headspaceHealthId
80836
+ * @memberof B2BChallengeCreated
80837
+ * @instance
80838
+ */
80839
+ B2BChallengeCreated.prototype.headspaceHealthId = "";
80840
+
80841
+ /**
80842
+ * B2BChallengeCreated orgName.
80843
+ * @member {string} orgName
80844
+ * @memberof B2BChallengeCreated
80845
+ * @instance
80846
+ */
80847
+ B2BChallengeCreated.prototype.orgName = "";
80848
+
80849
+ /**
80850
+ * B2BChallengeCreated challengeType.
80851
+ * @member {ChallengeType} challengeType
80852
+ * @memberof B2BChallengeCreated
80853
+ * @instance
80854
+ */
80855
+ B2BChallengeCreated.prototype.challengeType = 0;
80856
+
80857
+ /**
80858
+ * B2BChallengeCreated startDate_8601.
80859
+ * @member {string} startDate_8601
80860
+ * @memberof B2BChallengeCreated
80861
+ * @instance
80862
+ */
80863
+ B2BChallengeCreated.prototype.startDate_8601 = "";
80864
+
80865
+ /**
80866
+ * B2BChallengeCreated durationInWeeks.
80867
+ * @member {number|Long} durationInWeeks
80868
+ * @memberof B2BChallengeCreated
80869
+ * @instance
80870
+ */
80871
+ B2BChallengeCreated.prototype.durationInWeeks = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
80872
+
80873
+ /**
80874
+ * B2BChallengeCreated goalType.
80875
+ * @member {GoalType} goalType
80876
+ * @memberof B2BChallengeCreated
80877
+ * @instance
80878
+ */
80879
+ B2BChallengeCreated.prototype.goalType = 0;
80880
+
80881
+ /**
80882
+ * B2BChallengeCreated goalTarget.
80883
+ * @member {number|Long} goalTarget
80884
+ * @memberof B2BChallengeCreated
80885
+ * @instance
80886
+ */
80887
+ B2BChallengeCreated.prototype.goalTarget = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
80888
+
80889
+ /**
80890
+ * Creates a new B2BChallengeCreated instance using the specified properties.
80891
+ * @function create
80892
+ * @memberof B2BChallengeCreated
80893
+ * @static
80894
+ * @param {IB2BChallengeCreated=} [properties] Properties to set
80895
+ * @returns {B2BChallengeCreated} B2BChallengeCreated instance
80896
+ */
80897
+ B2BChallengeCreated.create = function create(properties) {
80898
+ return new B2BChallengeCreated(properties);
80899
+ };
80900
+
80901
+ /**
80902
+ * Encodes the specified B2BChallengeCreated message. Does not implicitly {@link B2BChallengeCreated.verify|verify} messages.
80903
+ * @function encode
80904
+ * @memberof B2BChallengeCreated
80905
+ * @static
80906
+ * @param {IB2BChallengeCreated} message B2BChallengeCreated message or plain object to encode
80907
+ * @param {$protobuf.Writer} [writer] Writer to encode to
80908
+ * @returns {$protobuf.Writer} Writer
80909
+ */
80910
+ B2BChallengeCreated.encode = function encode(message, writer) {
80911
+ if (!writer)
80912
+ writer = $Writer.create();
80913
+ if (message.b2bOrgId != null && message.hasOwnProperty("b2bOrgId"))
80914
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.b2bOrgId);
80915
+ if (message.headspaceHealthId != null && message.hasOwnProperty("headspaceHealthId"))
80916
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.headspaceHealthId);
80917
+ if (message.orgName != null && message.hasOwnProperty("orgName"))
80918
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.orgName);
80919
+ if (message.challengeType != null && message.hasOwnProperty("challengeType"))
80920
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.challengeType);
80921
+ if (message.startDate_8601 != null && message.hasOwnProperty("startDate_8601"))
80922
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.startDate_8601);
80923
+ if (message.durationInWeeks != null && message.hasOwnProperty("durationInWeeks"))
80924
+ writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.durationInWeeks);
80925
+ if (message.goalType != null && message.hasOwnProperty("goalType"))
80926
+ writer.uint32(/* id 7, wireType 0 =*/56).int32(message.goalType);
80927
+ if (message.goalTarget != null && message.hasOwnProperty("goalTarget"))
80928
+ writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.goalTarget);
80929
+ return writer;
80930
+ };
80931
+
80932
+ /**
80933
+ * Encodes the specified B2BChallengeCreated message, length delimited. Does not implicitly {@link B2BChallengeCreated.verify|verify} messages.
80934
+ * @function encodeDelimited
80935
+ * @memberof B2BChallengeCreated
80936
+ * @static
80937
+ * @param {IB2BChallengeCreated} message B2BChallengeCreated message or plain object to encode
80938
+ * @param {$protobuf.Writer} [writer] Writer to encode to
80939
+ * @returns {$protobuf.Writer} Writer
80940
+ */
80941
+ B2BChallengeCreated.encodeDelimited = function encodeDelimited(message, writer) {
80942
+ return this.encode(message, writer).ldelim();
80943
+ };
80944
+
80945
+ /**
80946
+ * Decodes a B2BChallengeCreated message from the specified reader or buffer.
80947
+ * @function decode
80948
+ * @memberof B2BChallengeCreated
80949
+ * @static
80950
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
80951
+ * @param {number} [length] Message length if known beforehand
80952
+ * @returns {B2BChallengeCreated} B2BChallengeCreated
80953
+ * @throws {Error} If the payload is not a reader or valid buffer
80954
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
80955
+ */
80956
+ B2BChallengeCreated.decode = function decode(reader, length) {
80957
+ if (!(reader instanceof $Reader))
80958
+ reader = $Reader.create(reader);
80959
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.B2BChallengeCreated();
80960
+ while (reader.pos < end) {
80961
+ var tag = reader.uint32();
80962
+ switch (tag >>> 3) {
80963
+ case 1:
80964
+ message.b2bOrgId = reader.string();
80965
+ break;
80966
+ case 2:
80967
+ message.headspaceHealthId = reader.string();
80968
+ break;
80969
+ case 3:
80970
+ message.orgName = reader.string();
80971
+ break;
80972
+ case 4:
80973
+ message.challengeType = reader.int32();
80974
+ break;
80975
+ case 5:
80976
+ message.startDate_8601 = reader.string();
80977
+ break;
80978
+ case 6:
80979
+ message.durationInWeeks = reader.uint64();
80980
+ break;
80981
+ case 7:
80982
+ message.goalType = reader.int32();
80983
+ break;
80984
+ case 8:
80985
+ message.goalTarget = reader.uint64();
80986
+ break;
80987
+ default:
80988
+ reader.skipType(tag & 7);
80989
+ break;
80990
+ }
80991
+ }
80992
+ return message;
80993
+ };
80994
+
80995
+ /**
80996
+ * Decodes a B2BChallengeCreated message from the specified reader or buffer, length delimited.
80997
+ * @function decodeDelimited
80998
+ * @memberof B2BChallengeCreated
80999
+ * @static
81000
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
81001
+ * @returns {B2BChallengeCreated} B2BChallengeCreated
81002
+ * @throws {Error} If the payload is not a reader or valid buffer
81003
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
81004
+ */
81005
+ B2BChallengeCreated.decodeDelimited = function decodeDelimited(reader) {
81006
+ if (!(reader instanceof $Reader))
81007
+ reader = new $Reader(reader);
81008
+ return this.decode(reader, reader.uint32());
81009
+ };
81010
+
81011
+ /**
81012
+ * Verifies a B2BChallengeCreated message.
81013
+ * @function verify
81014
+ * @memberof B2BChallengeCreated
81015
+ * @static
81016
+ * @param {Object.<string,*>} message Plain object to verify
81017
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
81018
+ */
81019
+ B2BChallengeCreated.verify = function verify(message) {
81020
+ if (typeof message !== "object" || message === null)
81021
+ return "object expected";
81022
+ if (message.b2bOrgId != null && message.hasOwnProperty("b2bOrgId"))
81023
+ if (!$util.isString(message.b2bOrgId))
81024
+ return "b2bOrgId: string expected";
81025
+ if (message.headspaceHealthId != null && message.hasOwnProperty("headspaceHealthId"))
81026
+ if (!$util.isString(message.headspaceHealthId))
81027
+ return "headspaceHealthId: string expected";
81028
+ if (message.orgName != null && message.hasOwnProperty("orgName"))
81029
+ if (!$util.isString(message.orgName))
81030
+ return "orgName: string expected";
81031
+ if (message.challengeType != null && message.hasOwnProperty("challengeType"))
81032
+ switch (message.challengeType) {
81033
+ default:
81034
+ return "challengeType: enum value expected";
81035
+ case 0:
81036
+ case 1:
81037
+ case 2:
81038
+ case 3:
81039
+ case 4:
81040
+ break;
81041
+ }
81042
+ if (message.startDate_8601 != null && message.hasOwnProperty("startDate_8601"))
81043
+ if (!$util.isString(message.startDate_8601))
81044
+ return "startDate_8601: string expected";
81045
+ if (message.durationInWeeks != null && message.hasOwnProperty("durationInWeeks"))
81046
+ if (!$util.isInteger(message.durationInWeeks) && !(message.durationInWeeks && $util.isInteger(message.durationInWeeks.low) && $util.isInteger(message.durationInWeeks.high)))
81047
+ return "durationInWeeks: integer|Long expected";
81048
+ if (message.goalType != null && message.hasOwnProperty("goalType"))
81049
+ switch (message.goalType) {
81050
+ default:
81051
+ return "goalType: enum value expected";
81052
+ case 0:
81053
+ case 1:
81054
+ break;
81055
+ }
81056
+ if (message.goalTarget != null && message.hasOwnProperty("goalTarget"))
81057
+ if (!$util.isInteger(message.goalTarget) && !(message.goalTarget && $util.isInteger(message.goalTarget.low) && $util.isInteger(message.goalTarget.high)))
81058
+ return "goalTarget: integer|Long expected";
81059
+ return null;
81060
+ };
81061
+
81062
+ /**
81063
+ * Creates a B2BChallengeCreated message from a plain object. Also converts values to their respective internal types.
81064
+ * @function fromObject
81065
+ * @memberof B2BChallengeCreated
81066
+ * @static
81067
+ * @param {Object.<string,*>} object Plain object
81068
+ * @returns {B2BChallengeCreated} B2BChallengeCreated
81069
+ */
81070
+ B2BChallengeCreated.fromObject = function fromObject(object) {
81071
+ if (object instanceof $root.B2BChallengeCreated)
81072
+ return object;
81073
+ var message = new $root.B2BChallengeCreated();
81074
+ if (object.b2bOrgId != null)
81075
+ message.b2bOrgId = String(object.b2bOrgId);
81076
+ if (object.headspaceHealthId != null)
81077
+ message.headspaceHealthId = String(object.headspaceHealthId);
81078
+ if (object.orgName != null)
81079
+ message.orgName = String(object.orgName);
81080
+ switch (object.challengeType) {
81081
+ case "MEDITATION":
81082
+ case 0:
81083
+ message.challengeType = 0;
81084
+ break;
81085
+ case "SLEEP":
81086
+ case 1:
81087
+ message.challengeType = 1;
81088
+ break;
81089
+ case "FOCUS":
81090
+ case 2:
81091
+ message.challengeType = 2;
81092
+ break;
81093
+ case "MOVE":
81094
+ case 3:
81095
+ message.challengeType = 3;
81096
+ break;
81097
+ case "ALL":
81098
+ case 4:
81099
+ message.challengeType = 4;
81100
+ break;
81101
+ }
81102
+ if (object.startDate_8601 != null)
81103
+ message.startDate_8601 = String(object.startDate_8601);
81104
+ if (object.durationInWeeks != null)
81105
+ if ($util.Long)
81106
+ (message.durationInWeeks = $util.Long.fromValue(object.durationInWeeks)).unsigned = true;
81107
+ else if (typeof object.durationInWeeks === "string")
81108
+ message.durationInWeeks = parseInt(object.durationInWeeks, 10);
81109
+ else if (typeof object.durationInWeeks === "number")
81110
+ message.durationInWeeks = object.durationInWeeks;
81111
+ else if (typeof object.durationInWeeks === "object")
81112
+ message.durationInWeeks = new $util.LongBits(object.durationInWeeks.low >>> 0, object.durationInWeeks.high >>> 0).toNumber(true);
81113
+ switch (object.goalType) {
81114
+ case "CONTENT_STARTS":
81115
+ case 0:
81116
+ message.goalType = 0;
81117
+ break;
81118
+ case "MINUTES":
81119
+ case 1:
81120
+ message.goalType = 1;
81121
+ break;
81122
+ }
81123
+ if (object.goalTarget != null)
81124
+ if ($util.Long)
81125
+ (message.goalTarget = $util.Long.fromValue(object.goalTarget)).unsigned = true;
81126
+ else if (typeof object.goalTarget === "string")
81127
+ message.goalTarget = parseInt(object.goalTarget, 10);
81128
+ else if (typeof object.goalTarget === "number")
81129
+ message.goalTarget = object.goalTarget;
81130
+ else if (typeof object.goalTarget === "object")
81131
+ message.goalTarget = new $util.LongBits(object.goalTarget.low >>> 0, object.goalTarget.high >>> 0).toNumber(true);
81132
+ return message;
81133
+ };
81134
+
81135
+ /**
81136
+ * Creates a plain object from a B2BChallengeCreated message. Also converts values to other types if specified.
81137
+ * @function toObject
81138
+ * @memberof B2BChallengeCreated
81139
+ * @static
81140
+ * @param {B2BChallengeCreated} message B2BChallengeCreated
81141
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
81142
+ * @returns {Object.<string,*>} Plain object
81143
+ */
81144
+ B2BChallengeCreated.toObject = function toObject(message, options) {
81145
+ if (!options)
81146
+ options = {};
81147
+ var object = {};
81148
+ if (options.defaults) {
81149
+ object.b2bOrgId = "";
81150
+ object.headspaceHealthId = "";
81151
+ object.orgName = "";
81152
+ object.challengeType = options.enums === String ? "MEDITATION" : 0;
81153
+ object.startDate_8601 = "";
81154
+ if ($util.Long) {
81155
+ var long = new $util.Long(0, 0, true);
81156
+ object.durationInWeeks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
81157
+ } else
81158
+ object.durationInWeeks = options.longs === String ? "0" : 0;
81159
+ object.goalType = options.enums === String ? "CONTENT_STARTS" : 0;
81160
+ if ($util.Long) {
81161
+ var long = new $util.Long(0, 0, true);
81162
+ object.goalTarget = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
81163
+ } else
81164
+ object.goalTarget = options.longs === String ? "0" : 0;
81165
+ }
81166
+ if (message.b2bOrgId != null && message.hasOwnProperty("b2bOrgId"))
81167
+ object.b2bOrgId = message.b2bOrgId;
81168
+ if (message.headspaceHealthId != null && message.hasOwnProperty("headspaceHealthId"))
81169
+ object.headspaceHealthId = message.headspaceHealthId;
81170
+ if (message.orgName != null && message.hasOwnProperty("orgName"))
81171
+ object.orgName = message.orgName;
81172
+ if (message.challengeType != null && message.hasOwnProperty("challengeType"))
81173
+ object.challengeType = options.enums === String ? $root.ChallengeType[message.challengeType] : message.challengeType;
81174
+ if (message.startDate_8601 != null && message.hasOwnProperty("startDate_8601"))
81175
+ object.startDate_8601 = message.startDate_8601;
81176
+ if (message.durationInWeeks != null && message.hasOwnProperty("durationInWeeks"))
81177
+ if (typeof message.durationInWeeks === "number")
81178
+ object.durationInWeeks = options.longs === String ? String(message.durationInWeeks) : message.durationInWeeks;
81179
+ else
81180
+ object.durationInWeeks = options.longs === String ? $util.Long.prototype.toString.call(message.durationInWeeks) : options.longs === Number ? new $util.LongBits(message.durationInWeeks.low >>> 0, message.durationInWeeks.high >>> 0).toNumber(true) : message.durationInWeeks;
81181
+ if (message.goalType != null && message.hasOwnProperty("goalType"))
81182
+ object.goalType = options.enums === String ? $root.GoalType[message.goalType] : message.goalType;
81183
+ if (message.goalTarget != null && message.hasOwnProperty("goalTarget"))
81184
+ if (typeof message.goalTarget === "number")
81185
+ object.goalTarget = options.longs === String ? String(message.goalTarget) : message.goalTarget;
81186
+ else
81187
+ object.goalTarget = options.longs === String ? $util.Long.prototype.toString.call(message.goalTarget) : options.longs === Number ? new $util.LongBits(message.goalTarget.low >>> 0, message.goalTarget.high >>> 0).toNumber(true) : message.goalTarget;
81188
+ return object;
81189
+ };
81190
+
81191
+ /**
81192
+ * Converts this B2BChallengeCreated to JSON.
81193
+ * @function toJSON
81194
+ * @memberof B2BChallengeCreated
81195
+ * @instance
81196
+ * @returns {Object.<string,*>} JSON object
81197
+ */
81198
+ B2BChallengeCreated.prototype.toJSON = function toJSON() {
81199
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
81200
+ };
81201
+
81202
+ return B2BChallengeCreated;
81203
+ })();
81204
+
80670
81205
  $root.EligibilityFileProcessed = (function() {
80671
81206
 
80672
81207
  /**
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.414.0"
19
+ "version": "1.416.0"
20
20
  }