@kenji71089/evaluation 0.0.1 → 0.0.8

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 (196) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +36 -6
  3. package/lib/bucketeer.d.ts +6 -0
  4. package/lib/bucketeer.js +65 -0
  5. package/lib/bucketeer.mjs +38 -0
  6. package/lib/clauseEvaluator.js +49 -7
  7. package/lib/clauseEvaluator.mjs +41 -7
  8. package/lib/evaluation.d.ts +10 -1
  9. package/lib/evaluation.js +184 -27
  10. package/lib/evaluation.mjs +141 -10
  11. package/lib/index.d.ts +12 -10
  12. package/lib/index.js +61 -40
  13. package/lib/index.mjs +16 -10
  14. package/lib/modelFactory.d.ts +1 -0
  15. package/lib/modelFactory.js +2 -0
  16. package/lib/modelFactory.mjs +2 -0
  17. package/lib/proto/event/client/event_pb.d.ts +19 -9
  18. package/lib/proto/event/client/event_pb.js +22 -12
  19. package/lib/proto/event/client/event_pb.mjs +100 -90
  20. package/lib/proto/feature/clause_pb.d.ts +2 -1
  21. package/lib/proto/feature/clause_pb.js +3 -2
  22. package/lib/proto/feature/clause_pb.mjs +7 -6
  23. package/lib/proto/feature/evaluation_pb.d.ts +3 -3
  24. package/lib/proto/feature/evaluation_pb.js +1 -1
  25. package/lib/proto/feature/evaluation_pb.mjs +15 -15
  26. package/lib/proto/feature/feature_last_used_info_pb.d.ts +10 -1
  27. package/lib/proto/feature/feature_last_used_info_pb.js +12 -1
  28. package/lib/proto/feature/feature_last_used_info_pb.mjs +18 -7
  29. package/lib/proto/feature/feature_pb.d.ts +72 -7
  30. package/lib/proto/feature/feature_pb.js +446 -4
  31. package/lib/proto/feature/feature_pb.mjs +535 -29
  32. package/lib/proto/feature/prerequisite_pb.d.ts +1 -1
  33. package/lib/proto/feature/prerequisite_pb.js +1 -1
  34. package/lib/proto/feature/prerequisite_pb.mjs +3 -3
  35. package/lib/proto/feature/reason_pb.d.ts +8 -1
  36. package/lib/proto/feature/reason_pb.js +9 -2
  37. package/lib/proto/feature/reason_pb.mjs +11 -4
  38. package/lib/proto/feature/rule_pb.d.ts +3 -3
  39. package/lib/proto/feature/rule_pb.js +1 -1
  40. package/lib/proto/feature/rule_pb.mjs +4 -4
  41. package/lib/proto/feature/segment_pb.d.ts +3 -3
  42. package/lib/proto/feature/segment_pb.js +1 -1
  43. package/lib/proto/feature/segment_pb.mjs +22 -22
  44. package/lib/proto/feature/strategy_pb.d.ts +31 -1
  45. package/lib/proto/feature/strategy_pb.js +206 -2
  46. package/lib/proto/feature/strategy_pb.mjs +242 -9
  47. package/lib/proto/feature/target_pb.d.ts +1 -1
  48. package/lib/proto/feature/target_pb.js +1 -1
  49. package/lib/proto/feature/target_pb.mjs +3 -3
  50. package/lib/proto/feature/variation_pb.d.ts +1 -1
  51. package/lib/proto/feature/variation_pb.js +1 -1
  52. package/lib/proto/feature/variation_pb.mjs +5 -5
  53. package/lib/proto/user/user_pb.d.ts +53 -1
  54. package/lib/proto/user/user_pb.js +374 -1
  55. package/lib/proto/user/user_pb.mjs +427 -7
  56. package/lib/strategyEvaluator.d.ts +0 -2
  57. package/lib/strategyEvaluator.js +23 -57
  58. package/lib/strategyEvaluator.mjs +23 -46
  59. package/lib/userEvaluation.js +13 -3
  60. package/lib/userEvaluation.mjs +13 -3
  61. package/package.json +15 -8
  62. package/lib/google/api/annotations_pb.d.ts +0 -8
  63. package/lib/google/api/annotations_pb.js +0 -40
  64. package/lib/google/api/annotations_pb.mjs +0 -54
  65. package/lib/google/api/annotations_pb_service.d.ts +0 -3
  66. package/lib/google/api/annotations_pb_service.js +0 -3
  67. package/lib/google/api/annotations_pb_service.mjs +0 -3
  68. package/lib/google/api/http_pb.d.ts +0 -132
  69. package/lib/google/api/http_pb.js +0 -860
  70. package/lib/google/api/http_pb.mjs +0 -982
  71. package/lib/google/api/http_pb_service.d.ts +0 -3
  72. package/lib/google/api/http_pb_service.js +0 -3
  73. package/lib/google/api/http_pb_service.mjs +0 -3
  74. package/lib/google/rpc/code_pb.d.ts +0 -26
  75. package/lib/google/rpc/code_pb.js +0 -44
  76. package/lib/google/rpc/code_pb.mjs +0 -48
  77. package/lib/google/rpc/code_pb_service.d.ts +0 -3
  78. package/lib/google/rpc/code_pb_service.js +0 -3
  79. package/lib/google/rpc/code_pb_service.mjs +0 -3
  80. package/lib/google/rpc/error_details_pb.d.ts +0 -322
  81. package/lib/google/rpc/error_details_pb.js +0 -2220
  82. package/lib/google/rpc/error_details_pb.mjs +0 -2499
  83. package/lib/google/rpc/error_details_pb_service.d.ts +0 -3
  84. package/lib/google/rpc/error_details_pb_service.js +0 -3
  85. package/lib/google/rpc/error_details_pb_service.mjs +0 -3
  86. package/lib/google/rpc/status_pb.d.ts +0 -36
  87. package/lib/google/rpc/status_pb.js +0 -235
  88. package/lib/google/rpc/status_pb.mjs +0 -268
  89. package/lib/google/rpc/status_pb_service.d.ts +0 -3
  90. package/lib/google/rpc/status_pb_service.js +0 -3
  91. package/lib/google/rpc/status_pb_service.mjs +0 -3
  92. package/lib/proto/event/client/event_pb_service.d.ts +0 -3
  93. package/lib/proto/event/client/event_pb_service.js +0 -3
  94. package/lib/proto/event/client/event_pb_service.mjs +0 -3
  95. package/lib/proto/event/domain/event_pb.d.ts +0 -4518
  96. package/lib/proto/event/domain/event_pb.js +0 -10834
  97. package/lib/proto/event/domain/event_pb.mjs +0 -33315
  98. package/lib/proto/event/domain/event_pb_service.d.ts +0 -3
  99. package/lib/proto/event/domain/event_pb_service.js +0 -3
  100. package/lib/proto/event/domain/event_pb_service.mjs +0 -3
  101. package/lib/proto/event/domain/localized_message_pb.d.ts +0 -29
  102. package/lib/proto/event/domain/localized_message_pb.js +0 -183
  103. package/lib/proto/event/domain/localized_message_pb.mjs +0 -206
  104. package/lib/proto/event/domain/localized_message_pb_service.d.ts +0 -3
  105. package/lib/proto/event/domain/localized_message_pb_service.js +0 -3
  106. package/lib/proto/event/domain/localized_message_pb_service.mjs +0 -3
  107. package/lib/proto/event/service/feature_pb.d.ts +0 -44
  108. package/lib/proto/event/service/feature_pb.js +0 -277
  109. package/lib/proto/event/service/feature_pb.mjs +0 -319
  110. package/lib/proto/event/service/feature_pb_service.d.ts +0 -3
  111. package/lib/proto/event/service/feature_pb_service.js +0 -3
  112. package/lib/proto/event/service/feature_pb_service.mjs +0 -3
  113. package/lib/proto/event/service/segment_pb.d.ts +0 -51
  114. package/lib/proto/event/service/segment_pb.js +0 -324
  115. package/lib/proto/event/service/segment_pb.mjs +0 -375
  116. package/lib/proto/event/service/segment_pb_service.d.ts +0 -3
  117. package/lib/proto/event/service/segment_pb_service.js +0 -3
  118. package/lib/proto/event/service/segment_pb_service.mjs +0 -3
  119. package/lib/proto/event/service/user_pb.d.ts +0 -49
  120. package/lib/proto/event/service/user_pb.js +0 -315
  121. package/lib/proto/event/service/user_pb.mjs +0 -362
  122. package/lib/proto/event/service/user_pb_service.d.ts +0 -3
  123. package/lib/proto/event/service/user_pb_service.js +0 -3
  124. package/lib/proto/event/service/user_pb_service.mjs +0 -3
  125. package/lib/proto/feature/clause_pb_service.d.ts +0 -3
  126. package/lib/proto/feature/clause_pb_service.js +0 -3
  127. package/lib/proto/feature/clause_pb_service.mjs +0 -3
  128. package/lib/proto/feature/command_pb.d.ts +0 -1213
  129. package/lib/proto/feature/command_pb.js +0 -8260
  130. package/lib/proto/feature/command_pb.mjs +0 -9275
  131. package/lib/proto/feature/command_pb_service.d.ts +0 -3
  132. package/lib/proto/feature/command_pb_service.js +0 -3
  133. package/lib/proto/feature/command_pb_service.mjs +0 -3
  134. package/lib/proto/feature/evaluation_pb_service.d.ts +0 -3
  135. package/lib/proto/feature/evaluation_pb_service.js +0 -3
  136. package/lib/proto/feature/evaluation_pb_service.mjs +0 -3
  137. package/lib/proto/feature/feature_last_used_info_pb_service.d.ts +0 -3
  138. package/lib/proto/feature/feature_last_used_info_pb_service.js +0 -3
  139. package/lib/proto/feature/feature_last_used_info_pb_service.mjs +0 -3
  140. package/lib/proto/feature/feature_pb_service.d.ts +0 -3
  141. package/lib/proto/feature/feature_pb_service.js +0 -3
  142. package/lib/proto/feature/feature_pb_service.mjs +0 -3
  143. package/lib/proto/feature/flag_trigger_pb.d.ts +0 -84
  144. package/lib/proto/feature/flag_trigger_pb.js +0 -452
  145. package/lib/proto/feature/flag_trigger_pb.mjs +0 -525
  146. package/lib/proto/feature/flag_trigger_pb_service.d.ts +0 -3
  147. package/lib/proto/feature/flag_trigger_pb_service.js +0 -3
  148. package/lib/proto/feature/flag_trigger_pb_service.mjs +0 -3
  149. package/lib/proto/feature/prerequisite_pb_service.d.ts +0 -3
  150. package/lib/proto/feature/prerequisite_pb_service.js +0 -3
  151. package/lib/proto/feature/prerequisite_pb_service.mjs +0 -3
  152. package/lib/proto/feature/reason_pb_service.d.ts +0 -3
  153. package/lib/proto/feature/reason_pb_service.js +0 -3
  154. package/lib/proto/feature/reason_pb_service.mjs +0 -3
  155. package/lib/proto/feature/rule_pb_service.d.ts +0 -3
  156. package/lib/proto/feature/rule_pb_service.js +0 -3
  157. package/lib/proto/feature/rule_pb_service.mjs +0 -3
  158. package/lib/proto/feature/segment_pb_service.d.ts +0 -3
  159. package/lib/proto/feature/segment_pb_service.js +0 -3
  160. package/lib/proto/feature/segment_pb_service.mjs +0 -3
  161. package/lib/proto/feature/service_pb.d.ts +0 -2158
  162. package/lib/proto/feature/service_pb.js +0 -5363
  163. package/lib/proto/feature/service_pb.mjs +0 -16348
  164. package/lib/proto/feature/service_pb_service.d.ts +0 -747
  165. package/lib/proto/feature/service_pb_service.js +0 -1424
  166. package/lib/proto/feature/service_pb_service.mjs +0 -1501
  167. package/lib/proto/feature/strategy_pb_service.d.ts +0 -3
  168. package/lib/proto/feature/strategy_pb_service.js +0 -3
  169. package/lib/proto/feature/strategy_pb_service.mjs +0 -3
  170. package/lib/proto/feature/target_pb_service.d.ts +0 -3
  171. package/lib/proto/feature/target_pb_service.js +0 -3
  172. package/lib/proto/feature/target_pb_service.mjs +0 -3
  173. package/lib/proto/feature/variation_pb_service.d.ts +0 -3
  174. package/lib/proto/feature/variation_pb_service.js +0 -3
  175. package/lib/proto/feature/variation_pb_service.mjs +0 -3
  176. package/lib/proto/gateway/service_pb.d.ts +0 -772
  177. package/lib/proto/gateway/service_pb.js +0 -5249
  178. package/lib/proto/gateway/service_pb.mjs +0 -6001
  179. package/lib/proto/gateway/service_pb_service.d.ts +0 -253
  180. package/lib/proto/gateway/service_pb_service.js +0 -436
  181. package/lib/proto/gateway/service_pb_service.mjs +0 -461
  182. package/lib/proto/user/user_pb_service.d.ts +0 -3
  183. package/lib/proto/user/user_pb_service.js +0 -3
  184. package/lib/proto/user/user_pb_service.mjs +0 -3
  185. package/lib/protoc-gen-openapiv2/options/annotations_pb.d.ts +0 -16
  186. package/lib/protoc-gen-openapiv2/options/annotations_pb.js +0 -100
  187. package/lib/protoc-gen-openapiv2/options/annotations_pb.mjs +0 -158
  188. package/lib/protoc-gen-openapiv2/options/annotations_pb_service.d.ts +0 -3
  189. package/lib/protoc-gen-openapiv2/options/annotations_pb_service.js +0 -3
  190. package/lib/protoc-gen-openapiv2/options/annotations_pb_service.mjs +0 -3
  191. package/lib/protoc-gen-openapiv2/options/openapiv2_pb.d.ts +0 -834
  192. package/lib/protoc-gen-openapiv2/options/openapiv2_pb.js +0 -5456
  193. package/lib/protoc-gen-openapiv2/options/openapiv2_pb.mjs +0 -6256
  194. package/lib/protoc-gen-openapiv2/options/openapiv2_pb_service.d.ts +0 -3
  195. package/lib/protoc-gen-openapiv2/options/openapiv2_pb_service.js +0 -3
  196. package/lib/protoc-gen-openapiv2/options/openapiv2_pb_service.mjs +0 -3
@@ -10,7 +10,7 @@
10
10
  * @public
11
11
  */
12
12
  // GENERATED CODE -- DO NOT EDIT!
13
-
13
+ /* eslint-disable */
14
14
  // @ts-nocheck
15
15
 
16
16
  var jspb = require('google-protobuf');
@@ -20,6 +20,8 @@ var global = typeof globalThis !== 'undefined' && globalThis || typeof window !=
20
20
  }.call(null) || Function('return this')();
21
21
  goog.exportSymbol('proto.bucketeer.user.User', null, global);
22
22
  goog.exportSymbol('proto.bucketeer.user.User.Data', null, global);
23
+ goog.exportSymbol('proto.bucketeer.user.UserAttribute', null, global);
24
+ goog.exportSymbol('proto.bucketeer.user.UserAttributes', null, global);
23
25
  /**
24
26
  * Generated by JsPbCodeGenerator.
25
27
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -62,6 +64,48 @@ if (goog.DEBUG && !COMPILED) {
62
64
  */
63
65
  proto.bucketeer.user.User.Data.displayName = 'proto.bucketeer.user.User.Data';
64
66
  }
67
+ /**
68
+ * Generated by JsPbCodeGenerator.
69
+ * @param {Array=} opt_data Optional initial data array, typically from a
70
+ * server response, or constructed directly in Javascript. The array is used
71
+ * in place and becomes part of the constructed object. It is not cloned.
72
+ * If no data is provided, the constructed object will be empty, but still
73
+ * valid.
74
+ * @extends {jspb.Message}
75
+ * @constructor
76
+ */
77
+ proto.bucketeer.user.UserAttributes = function (opt_data) {
78
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.bucketeer.user.UserAttributes.repeatedFields_, null);
79
+ };
80
+ goog.inherits(proto.bucketeer.user.UserAttributes, jspb.Message);
81
+ if (goog.DEBUG && !COMPILED) {
82
+ /**
83
+ * @public
84
+ * @override
85
+ */
86
+ proto.bucketeer.user.UserAttributes.displayName = 'proto.bucketeer.user.UserAttributes';
87
+ }
88
+ /**
89
+ * Generated by JsPbCodeGenerator.
90
+ * @param {Array=} opt_data Optional initial data array, typically from a
91
+ * server response, or constructed directly in Javascript. The array is used
92
+ * in place and becomes part of the constructed object. It is not cloned.
93
+ * If no data is provided, the constructed object will be empty, but still
94
+ * valid.
95
+ * @extends {jspb.Message}
96
+ * @constructor
97
+ */
98
+ proto.bucketeer.user.UserAttribute = function (opt_data) {
99
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.bucketeer.user.UserAttribute.repeatedFields_, null);
100
+ };
101
+ goog.inherits(proto.bucketeer.user.UserAttribute, jspb.Message);
102
+ if (goog.DEBUG && !COMPILED) {
103
+ /**
104
+ * @public
105
+ * @override
106
+ */
107
+ proto.bucketeer.user.UserAttribute.displayName = 'proto.bucketeer.user.UserAttribute';
108
+ }
65
109
  if (jspb.Message.GENERATE_TO_OBJECT) {
66
110
  /**
67
111
  * Creates an object representation of this proto.
@@ -407,4 +451,333 @@ proto.bucketeer.user.User.prototype.getCreatedAt = function () {
407
451
  proto.bucketeer.user.User.prototype.setCreatedAt = function (value) {
408
452
  return jspb.Message.setProto3IntField(this, 5, value);
409
453
  };
454
+
455
+ /**
456
+ * List of repeated fields within this message type.
457
+ * @private {!Array<number>}
458
+ * @const
459
+ */
460
+ proto.bucketeer.user.UserAttributes.repeatedFields_ = [2];
461
+ if (jspb.Message.GENERATE_TO_OBJECT) {
462
+ /**
463
+ * Creates an object representation of this proto.
464
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
465
+ * Optional fields that are not set will be set to undefined.
466
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
467
+ * For the list of reserved names please see:
468
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
469
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
470
+ * JSPB instance for transitional soy proto support:
471
+ * http://goto/soy-param-migration
472
+ * @return {!Object}
473
+ */
474
+ proto.bucketeer.user.UserAttributes.prototype.toObject = function (opt_includeInstance) {
475
+ return proto.bucketeer.user.UserAttributes.toObject(opt_includeInstance, this);
476
+ };
477
+
478
+ /**
479
+ * Static version of the {@see toObject} method.
480
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
481
+ * the JSPB instance for transitional soy proto support:
482
+ * http://goto/soy-param-migration
483
+ * @param {!proto.bucketeer.user.UserAttributes} msg The msg instance to transform.
484
+ * @return {!Object}
485
+ * @suppress {unusedLocalVariables} f is only used for nested messages
486
+ */
487
+ proto.bucketeer.user.UserAttributes.toObject = function (includeInstance, msg) {
488
+ var f,
489
+ obj = {
490
+ environmentId: jspb.Message.getFieldWithDefault(msg, 1, ""),
491
+ userAttributesList: jspb.Message.toObjectList(msg.getUserAttributesList(), proto.bucketeer.user.UserAttribute.toObject, includeInstance)
492
+ };
493
+ if (includeInstance) {
494
+ obj.$jspbMessageInstance = msg;
495
+ }
496
+ return obj;
497
+ };
498
+ }
499
+
500
+ /**
501
+ * Deserializes binary data (in protobuf wire format).
502
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
503
+ * @return {!proto.bucketeer.user.UserAttributes}
504
+ */
505
+ proto.bucketeer.user.UserAttributes.deserializeBinary = function (bytes) {
506
+ var reader = new jspb.BinaryReader(bytes);
507
+ var msg = new proto.bucketeer.user.UserAttributes();
508
+ return proto.bucketeer.user.UserAttributes.deserializeBinaryFromReader(msg, reader);
509
+ };
510
+
511
+ /**
512
+ * Deserializes binary data (in protobuf wire format) from the
513
+ * given reader into the given message object.
514
+ * @param {!proto.bucketeer.user.UserAttributes} msg The message object to deserialize into.
515
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
516
+ * @return {!proto.bucketeer.user.UserAttributes}
517
+ */
518
+ proto.bucketeer.user.UserAttributes.deserializeBinaryFromReader = function (msg, reader) {
519
+ while (reader.nextField()) {
520
+ if (reader.isEndGroup()) {
521
+ break;
522
+ }
523
+ var field = reader.getFieldNumber();
524
+ switch (field) {
525
+ case 1:
526
+ var value = /** @type {string} */reader.readString();
527
+ msg.setEnvironmentId(value);
528
+ break;
529
+ case 2:
530
+ var value = new proto.bucketeer.user.UserAttribute();
531
+ reader.readMessage(value, proto.bucketeer.user.UserAttribute.deserializeBinaryFromReader);
532
+ msg.addUserAttributes(value);
533
+ break;
534
+ default:
535
+ reader.skipField();
536
+ break;
537
+ }
538
+ }
539
+ return msg;
540
+ };
541
+
542
+ /**
543
+ * Serializes the message to binary data (in protobuf wire format).
544
+ * @return {!Uint8Array}
545
+ */
546
+ proto.bucketeer.user.UserAttributes.prototype.serializeBinary = function () {
547
+ var writer = new jspb.BinaryWriter();
548
+ proto.bucketeer.user.UserAttributes.serializeBinaryToWriter(this, writer);
549
+ return writer.getResultBuffer();
550
+ };
551
+
552
+ /**
553
+ * Serializes the given message to binary data (in protobuf wire
554
+ * format), writing to the given BinaryWriter.
555
+ * @param {!proto.bucketeer.user.UserAttributes} message
556
+ * @param {!jspb.BinaryWriter} writer
557
+ * @suppress {unusedLocalVariables} f is only used for nested messages
558
+ */
559
+ proto.bucketeer.user.UserAttributes.serializeBinaryToWriter = function (message, writer) {
560
+ var f = undefined;
561
+ f = message.getEnvironmentId();
562
+ if (f.length > 0) {
563
+ writer.writeString(1, f);
564
+ }
565
+ f = message.getUserAttributesList();
566
+ if (f.length > 0) {
567
+ writer.writeRepeatedMessage(2, f, proto.bucketeer.user.UserAttribute.serializeBinaryToWriter);
568
+ }
569
+ };
570
+
571
+ /**
572
+ * optional string environment_id = 1;
573
+ * @return {string}
574
+ */
575
+ proto.bucketeer.user.UserAttributes.prototype.getEnvironmentId = function () {
576
+ return /** @type {string} */jspb.Message.getFieldWithDefault(this, 1, "");
577
+ };
578
+
579
+ /**
580
+ * @param {string} value
581
+ * @return {!proto.bucketeer.user.UserAttributes} returns this
582
+ */
583
+ proto.bucketeer.user.UserAttributes.prototype.setEnvironmentId = function (value) {
584
+ return jspb.Message.setProto3StringField(this, 1, value);
585
+ };
586
+
587
+ /**
588
+ * repeated UserAttribute user_attributes = 2;
589
+ * @return {!Array<!proto.bucketeer.user.UserAttribute>}
590
+ */
591
+ proto.bucketeer.user.UserAttributes.prototype.getUserAttributesList = function () {
592
+ return /** @type{!Array<!proto.bucketeer.user.UserAttribute>} */jspb.Message.getRepeatedWrapperField(this, proto.bucketeer.user.UserAttribute, 2);
593
+ };
594
+
595
+ /**
596
+ * @param {!Array<!proto.bucketeer.user.UserAttribute>} value
597
+ * @return {!proto.bucketeer.user.UserAttributes} returns this
598
+ */
599
+ proto.bucketeer.user.UserAttributes.prototype.setUserAttributesList = function (value) {
600
+ return jspb.Message.setRepeatedWrapperField(this, 2, value);
601
+ };
602
+
603
+ /**
604
+ * @param {!proto.bucketeer.user.UserAttribute=} opt_value
605
+ * @param {number=} opt_index
606
+ * @return {!proto.bucketeer.user.UserAttribute}
607
+ */
608
+ proto.bucketeer.user.UserAttributes.prototype.addUserAttributes = function (opt_value, opt_index) {
609
+ return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.bucketeer.user.UserAttribute, opt_index);
610
+ };
611
+
612
+ /**
613
+ * Clears the list making it empty but non-null.
614
+ * @return {!proto.bucketeer.user.UserAttributes} returns this
615
+ */
616
+ proto.bucketeer.user.UserAttributes.prototype.clearUserAttributesList = function () {
617
+ return this.setUserAttributesList([]);
618
+ };
619
+
620
+ /**
621
+ * List of repeated fields within this message type.
622
+ * @private {!Array<number>}
623
+ * @const
624
+ */
625
+ proto.bucketeer.user.UserAttribute.repeatedFields_ = [2];
626
+ if (jspb.Message.GENERATE_TO_OBJECT) {
627
+ /**
628
+ * Creates an object representation of this proto.
629
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
630
+ * Optional fields that are not set will be set to undefined.
631
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
632
+ * For the list of reserved names please see:
633
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
634
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
635
+ * JSPB instance for transitional soy proto support:
636
+ * http://goto/soy-param-migration
637
+ * @return {!Object}
638
+ */
639
+ proto.bucketeer.user.UserAttribute.prototype.toObject = function (opt_includeInstance) {
640
+ return proto.bucketeer.user.UserAttribute.toObject(opt_includeInstance, this);
641
+ };
642
+
643
+ /**
644
+ * Static version of the {@see toObject} method.
645
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
646
+ * the JSPB instance for transitional soy proto support:
647
+ * http://goto/soy-param-migration
648
+ * @param {!proto.bucketeer.user.UserAttribute} msg The msg instance to transform.
649
+ * @return {!Object}
650
+ * @suppress {unusedLocalVariables} f is only used for nested messages
651
+ */
652
+ proto.bucketeer.user.UserAttribute.toObject = function (includeInstance, msg) {
653
+ var f,
654
+ obj = {
655
+ key: jspb.Message.getFieldWithDefault(msg, 1, ""),
656
+ valuesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
657
+ };
658
+ if (includeInstance) {
659
+ obj.$jspbMessageInstance = msg;
660
+ }
661
+ return obj;
662
+ };
663
+ }
664
+
665
+ /**
666
+ * Deserializes binary data (in protobuf wire format).
667
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
668
+ * @return {!proto.bucketeer.user.UserAttribute}
669
+ */
670
+ proto.bucketeer.user.UserAttribute.deserializeBinary = function (bytes) {
671
+ var reader = new jspb.BinaryReader(bytes);
672
+ var msg = new proto.bucketeer.user.UserAttribute();
673
+ return proto.bucketeer.user.UserAttribute.deserializeBinaryFromReader(msg, reader);
674
+ };
675
+
676
+ /**
677
+ * Deserializes binary data (in protobuf wire format) from the
678
+ * given reader into the given message object.
679
+ * @param {!proto.bucketeer.user.UserAttribute} msg The message object to deserialize into.
680
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
681
+ * @return {!proto.bucketeer.user.UserAttribute}
682
+ */
683
+ proto.bucketeer.user.UserAttribute.deserializeBinaryFromReader = function (msg, reader) {
684
+ while (reader.nextField()) {
685
+ if (reader.isEndGroup()) {
686
+ break;
687
+ }
688
+ var field = reader.getFieldNumber();
689
+ switch (field) {
690
+ case 1:
691
+ var value = /** @type {string} */reader.readString();
692
+ msg.setKey(value);
693
+ break;
694
+ case 2:
695
+ var value = /** @type {string} */reader.readString();
696
+ msg.addValues(value);
697
+ break;
698
+ default:
699
+ reader.skipField();
700
+ break;
701
+ }
702
+ }
703
+ return msg;
704
+ };
705
+
706
+ /**
707
+ * Serializes the message to binary data (in protobuf wire format).
708
+ * @return {!Uint8Array}
709
+ */
710
+ proto.bucketeer.user.UserAttribute.prototype.serializeBinary = function () {
711
+ var writer = new jspb.BinaryWriter();
712
+ proto.bucketeer.user.UserAttribute.serializeBinaryToWriter(this, writer);
713
+ return writer.getResultBuffer();
714
+ };
715
+
716
+ /**
717
+ * Serializes the given message to binary data (in protobuf wire
718
+ * format), writing to the given BinaryWriter.
719
+ * @param {!proto.bucketeer.user.UserAttribute} message
720
+ * @param {!jspb.BinaryWriter} writer
721
+ * @suppress {unusedLocalVariables} f is only used for nested messages
722
+ */
723
+ proto.bucketeer.user.UserAttribute.serializeBinaryToWriter = function (message, writer) {
724
+ var f = undefined;
725
+ f = message.getKey();
726
+ if (f.length > 0) {
727
+ writer.writeString(1, f);
728
+ }
729
+ f = message.getValuesList();
730
+ if (f.length > 0) {
731
+ writer.writeRepeatedString(2, f);
732
+ }
733
+ };
734
+
735
+ /**
736
+ * optional string key = 1;
737
+ * @return {string}
738
+ */
739
+ proto.bucketeer.user.UserAttribute.prototype.getKey = function () {
740
+ return /** @type {string} */jspb.Message.getFieldWithDefault(this, 1, "");
741
+ };
742
+
743
+ /**
744
+ * @param {string} value
745
+ * @return {!proto.bucketeer.user.UserAttribute} returns this
746
+ */
747
+ proto.bucketeer.user.UserAttribute.prototype.setKey = function (value) {
748
+ return jspb.Message.setProto3StringField(this, 1, value);
749
+ };
750
+
751
+ /**
752
+ * repeated string values = 2;
753
+ * @return {!Array<string>}
754
+ */
755
+ proto.bucketeer.user.UserAttribute.prototype.getValuesList = function () {
756
+ return /** @type {!Array<string>} */jspb.Message.getRepeatedField(this, 2);
757
+ };
758
+
759
+ /**
760
+ * @param {!Array<string>} value
761
+ * @return {!proto.bucketeer.user.UserAttribute} returns this
762
+ */
763
+ proto.bucketeer.user.UserAttribute.prototype.setValuesList = function (value) {
764
+ return jspb.Message.setField(this, 2, value || []);
765
+ };
766
+
767
+ /**
768
+ * @param {string} value
769
+ * @param {number=} opt_index
770
+ * @return {!proto.bucketeer.user.UserAttribute} returns this
771
+ */
772
+ proto.bucketeer.user.UserAttribute.prototype.addValues = function (value, opt_index) {
773
+ return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
774
+ };
775
+
776
+ /**
777
+ * Clears the list making it empty but non-null.
778
+ * @return {!proto.bucketeer.user.UserAttribute} returns this
779
+ */
780
+ proto.bucketeer.user.UserAttribute.prototype.clearValuesList = function () {
781
+ return this.setValuesList([]);
782
+ };
410
783
  goog.object.extend(exports, proto.bucketeer.user);