protobuf-platform 1.0.49 → 1.0.51

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/user/user.proto CHANGED
@@ -10,10 +10,12 @@ service User {
10
10
  rpc getUserData(UserDataRequest) returns (UserDataResponse);
11
11
  //Role and Permissions
12
12
  rpc addPermissionToUserRole(RolePermissionRequest) returns (RolePermissionStatusResponse);
13
+ rpc rolesList(PaginationRequest) returns (RolesItemsResponse);
13
14
  }
14
15
 
15
16
  message PingRequest { string ping = 1; }
16
17
  message PongResponse { string pong = 1; }
18
+ message PaginationRequest { int32 limit = 1; int32 offset = 2; }
17
19
 
18
20
  //Auth [Registration & Login]
19
21
  message RegistrationRequest {
@@ -66,3 +68,14 @@ message RolePermissionRequest {
66
68
  message RolePermissionStatusResponse {
67
69
  string status = 1;
68
70
  }
71
+ //Roles
72
+ message Role {
73
+ int32 id = 1;
74
+ string title = 2;
75
+ optional string description = 3;
76
+ }
77
+ message RolesItemsResponse {
78
+ repeated Role items = 1;
79
+ int32 total_items = 2;
80
+ int32 total_pages = 3;
81
+ }
@@ -26,6 +26,17 @@ function deserialize_user_LoginRequest(buffer_arg) {
26
26
  return user_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg));
27
27
  }
28
28
 
29
+ function serialize_user_PaginationRequest(arg) {
30
+ if (!(arg instanceof user_pb.PaginationRequest)) {
31
+ throw new Error('Expected argument of type user.PaginationRequest');
32
+ }
33
+ return Buffer.from(arg.serializeBinary());
34
+ }
35
+
36
+ function deserialize_user_PaginationRequest(buffer_arg) {
37
+ return user_pb.PaginationRequest.deserializeBinary(new Uint8Array(buffer_arg));
38
+ }
39
+
29
40
  function serialize_user_PingRequest(arg) {
30
41
  if (!(arg instanceof user_pb.PingRequest)) {
31
42
  throw new Error('Expected argument of type user.PingRequest');
@@ -81,6 +92,17 @@ function deserialize_user_RolePermissionStatusResponse(buffer_arg) {
81
92
  return user_pb.RolePermissionStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
82
93
  }
83
94
 
95
+ function serialize_user_RolesItemsResponse(arg) {
96
+ if (!(arg instanceof user_pb.RolesItemsResponse)) {
97
+ throw new Error('Expected argument of type user.RolesItemsResponse');
98
+ }
99
+ return Buffer.from(arg.serializeBinary());
100
+ }
101
+
102
+ function deserialize_user_RolesItemsResponse(buffer_arg) {
103
+ return user_pb.RolesItemsResponse.deserializeBinary(new Uint8Array(buffer_arg));
104
+ }
105
+
84
106
  function serialize_user_UserDataRequest(arg) {
85
107
  if (!(arg instanceof user_pb.UserDataRequest)) {
86
108
  throw new Error('Expected argument of type user.UserDataRequest');
@@ -162,6 +184,17 @@ addPermissionToUserRole: {
162
184
  responseSerialize: serialize_user_RolePermissionStatusResponse,
163
185
  responseDeserialize: deserialize_user_RolePermissionStatusResponse,
164
186
  },
187
+ rolesList: {
188
+ path: '/user.User/rolesList',
189
+ requestStream: false,
190
+ responseStream: false,
191
+ requestType: user_pb.PaginationRequest,
192
+ responseType: user_pb.RolesItemsResponse,
193
+ requestSerialize: serialize_user_PaginationRequest,
194
+ requestDeserialize: deserialize_user_PaginationRequest,
195
+ responseSerialize: serialize_user_RolesItemsResponse,
196
+ responseDeserialize: deserialize_user_RolesItemsResponse,
197
+ },
165
198
  };
166
199
 
167
200
  exports.UserClient = grpc.makeGenericClientConstructor(UserService);
package/user/user_pb.js CHANGED
@@ -23,11 +23,14 @@ var global = (function() {
23
23
 
24
24
  goog.exportSymbol('proto.user.LoggedInResponse', null, global);
25
25
  goog.exportSymbol('proto.user.LoginRequest', null, global);
26
+ goog.exportSymbol('proto.user.PaginationRequest', null, global);
26
27
  goog.exportSymbol('proto.user.PingRequest', null, global);
27
28
  goog.exportSymbol('proto.user.PongResponse', null, global);
28
29
  goog.exportSymbol('proto.user.RegistrationRequest', null, global);
30
+ goog.exportSymbol('proto.user.Role', null, global);
29
31
  goog.exportSymbol('proto.user.RolePermissionRequest', null, global);
30
32
  goog.exportSymbol('proto.user.RolePermissionStatusResponse', null, global);
33
+ goog.exportSymbol('proto.user.RolesItemsResponse', null, global);
31
34
  goog.exportSymbol('proto.user.UserDataRequest', null, global);
32
35
  goog.exportSymbol('proto.user.UserDataResponse', null, global);
33
36
  /**
@@ -72,6 +75,27 @@ if (goog.DEBUG && !COMPILED) {
72
75
  */
73
76
  proto.user.PongResponse.displayName = 'proto.user.PongResponse';
74
77
  }
78
+ /**
79
+ * Generated by JsPbCodeGenerator.
80
+ * @param {Array=} opt_data Optional initial data array, typically from a
81
+ * server response, or constructed directly in Javascript. The array is used
82
+ * in place and becomes part of the constructed object. It is not cloned.
83
+ * If no data is provided, the constructed object will be empty, but still
84
+ * valid.
85
+ * @extends {jspb.Message}
86
+ * @constructor
87
+ */
88
+ proto.user.PaginationRequest = function(opt_data) {
89
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
90
+ };
91
+ goog.inherits(proto.user.PaginationRequest, jspb.Message);
92
+ if (goog.DEBUG && !COMPILED) {
93
+ /**
94
+ * @public
95
+ * @override
96
+ */
97
+ proto.user.PaginationRequest.displayName = 'proto.user.PaginationRequest';
98
+ }
75
99
  /**
76
100
  * Generated by JsPbCodeGenerator.
77
101
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -219,6 +243,48 @@ if (goog.DEBUG && !COMPILED) {
219
243
  */
220
244
  proto.user.RolePermissionStatusResponse.displayName = 'proto.user.RolePermissionStatusResponse';
221
245
  }
246
+ /**
247
+ * Generated by JsPbCodeGenerator.
248
+ * @param {Array=} opt_data Optional initial data array, typically from a
249
+ * server response, or constructed directly in Javascript. The array is used
250
+ * in place and becomes part of the constructed object. It is not cloned.
251
+ * If no data is provided, the constructed object will be empty, but still
252
+ * valid.
253
+ * @extends {jspb.Message}
254
+ * @constructor
255
+ */
256
+ proto.user.Role = function(opt_data) {
257
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
258
+ };
259
+ goog.inherits(proto.user.Role, jspb.Message);
260
+ if (goog.DEBUG && !COMPILED) {
261
+ /**
262
+ * @public
263
+ * @override
264
+ */
265
+ proto.user.Role.displayName = 'proto.user.Role';
266
+ }
267
+ /**
268
+ * Generated by JsPbCodeGenerator.
269
+ * @param {Array=} opt_data Optional initial data array, typically from a
270
+ * server response, or constructed directly in Javascript. The array is used
271
+ * in place and becomes part of the constructed object. It is not cloned.
272
+ * If no data is provided, the constructed object will be empty, but still
273
+ * valid.
274
+ * @extends {jspb.Message}
275
+ * @constructor
276
+ */
277
+ proto.user.RolesItemsResponse = function(opt_data) {
278
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.user.RolesItemsResponse.repeatedFields_, null);
279
+ };
280
+ goog.inherits(proto.user.RolesItemsResponse, jspb.Message);
281
+ if (goog.DEBUG && !COMPILED) {
282
+ /**
283
+ * @public
284
+ * @override
285
+ */
286
+ proto.user.RolesItemsResponse.displayName = 'proto.user.RolesItemsResponse';
287
+ }
222
288
 
223
289
 
224
290
 
@@ -482,6 +548,166 @@ proto.user.PongResponse.prototype.setPong = function(value) {
482
548
 
483
549
 
484
550
 
551
+ if (jspb.Message.GENERATE_TO_OBJECT) {
552
+ /**
553
+ * Creates an object representation of this proto.
554
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
555
+ * Optional fields that are not set will be set to undefined.
556
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
557
+ * For the list of reserved names please see:
558
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
559
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
560
+ * JSPB instance for transitional soy proto support:
561
+ * http://goto/soy-param-migration
562
+ * @return {!Object}
563
+ */
564
+ proto.user.PaginationRequest.prototype.toObject = function(opt_includeInstance) {
565
+ return proto.user.PaginationRequest.toObject(opt_includeInstance, this);
566
+ };
567
+
568
+
569
+ /**
570
+ * Static version of the {@see toObject} method.
571
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
572
+ * the JSPB instance for transitional soy proto support:
573
+ * http://goto/soy-param-migration
574
+ * @param {!proto.user.PaginationRequest} msg The msg instance to transform.
575
+ * @return {!Object}
576
+ * @suppress {unusedLocalVariables} f is only used for nested messages
577
+ */
578
+ proto.user.PaginationRequest.toObject = function(includeInstance, msg) {
579
+ var f, obj = {
580
+ limit: jspb.Message.getFieldWithDefault(msg, 1, 0),
581
+ offset: jspb.Message.getFieldWithDefault(msg, 2, 0)
582
+ };
583
+
584
+ if (includeInstance) {
585
+ obj.$jspbMessageInstance = msg;
586
+ }
587
+ return obj;
588
+ };
589
+ }
590
+
591
+
592
+ /**
593
+ * Deserializes binary data (in protobuf wire format).
594
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
595
+ * @return {!proto.user.PaginationRequest}
596
+ */
597
+ proto.user.PaginationRequest.deserializeBinary = function(bytes) {
598
+ var reader = new jspb.BinaryReader(bytes);
599
+ var msg = new proto.user.PaginationRequest;
600
+ return proto.user.PaginationRequest.deserializeBinaryFromReader(msg, reader);
601
+ };
602
+
603
+
604
+ /**
605
+ * Deserializes binary data (in protobuf wire format) from the
606
+ * given reader into the given message object.
607
+ * @param {!proto.user.PaginationRequest} msg The message object to deserialize into.
608
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
609
+ * @return {!proto.user.PaginationRequest}
610
+ */
611
+ proto.user.PaginationRequest.deserializeBinaryFromReader = function(msg, reader) {
612
+ while (reader.nextField()) {
613
+ if (reader.isEndGroup()) {
614
+ break;
615
+ }
616
+ var field = reader.getFieldNumber();
617
+ switch (field) {
618
+ case 1:
619
+ var value = /** @type {number} */ (reader.readInt32());
620
+ msg.setLimit(value);
621
+ break;
622
+ case 2:
623
+ var value = /** @type {number} */ (reader.readInt32());
624
+ msg.setOffset(value);
625
+ break;
626
+ default:
627
+ reader.skipField();
628
+ break;
629
+ }
630
+ }
631
+ return msg;
632
+ };
633
+
634
+
635
+ /**
636
+ * Serializes the message to binary data (in protobuf wire format).
637
+ * @return {!Uint8Array}
638
+ */
639
+ proto.user.PaginationRequest.prototype.serializeBinary = function() {
640
+ var writer = new jspb.BinaryWriter();
641
+ proto.user.PaginationRequest.serializeBinaryToWriter(this, writer);
642
+ return writer.getResultBuffer();
643
+ };
644
+
645
+
646
+ /**
647
+ * Serializes the given message to binary data (in protobuf wire
648
+ * format), writing to the given BinaryWriter.
649
+ * @param {!proto.user.PaginationRequest} message
650
+ * @param {!jspb.BinaryWriter} writer
651
+ * @suppress {unusedLocalVariables} f is only used for nested messages
652
+ */
653
+ proto.user.PaginationRequest.serializeBinaryToWriter = function(message, writer) {
654
+ var f = undefined;
655
+ f = message.getLimit();
656
+ if (f !== 0) {
657
+ writer.writeInt32(
658
+ 1,
659
+ f
660
+ );
661
+ }
662
+ f = message.getOffset();
663
+ if (f !== 0) {
664
+ writer.writeInt32(
665
+ 2,
666
+ f
667
+ );
668
+ }
669
+ };
670
+
671
+
672
+ /**
673
+ * optional int32 limit = 1;
674
+ * @return {number}
675
+ */
676
+ proto.user.PaginationRequest.prototype.getLimit = function() {
677
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
678
+ };
679
+
680
+
681
+ /**
682
+ * @param {number} value
683
+ * @return {!proto.user.PaginationRequest} returns this
684
+ */
685
+ proto.user.PaginationRequest.prototype.setLimit = function(value) {
686
+ return jspb.Message.setProto3IntField(this, 1, value);
687
+ };
688
+
689
+
690
+ /**
691
+ * optional int32 offset = 2;
692
+ * @return {number}
693
+ */
694
+ proto.user.PaginationRequest.prototype.getOffset = function() {
695
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
696
+ };
697
+
698
+
699
+ /**
700
+ * @param {number} value
701
+ * @return {!proto.user.PaginationRequest} returns this
702
+ */
703
+ proto.user.PaginationRequest.prototype.setOffset = function(value) {
704
+ return jspb.Message.setProto3IntField(this, 2, value);
705
+ };
706
+
707
+
708
+
709
+
710
+
485
711
  if (jspb.Message.GENERATE_TO_OBJECT) {
486
712
  /**
487
713
  * Creates an object representation of this proto.
@@ -2481,4 +2707,432 @@ proto.user.RolePermissionStatusResponse.prototype.setStatus = function(value) {
2481
2707
  };
2482
2708
 
2483
2709
 
2710
+
2711
+
2712
+
2713
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2714
+ /**
2715
+ * Creates an object representation of this proto.
2716
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2717
+ * Optional fields that are not set will be set to undefined.
2718
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2719
+ * For the list of reserved names please see:
2720
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2721
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2722
+ * JSPB instance for transitional soy proto support:
2723
+ * http://goto/soy-param-migration
2724
+ * @return {!Object}
2725
+ */
2726
+ proto.user.Role.prototype.toObject = function(opt_includeInstance) {
2727
+ return proto.user.Role.toObject(opt_includeInstance, this);
2728
+ };
2729
+
2730
+
2731
+ /**
2732
+ * Static version of the {@see toObject} method.
2733
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2734
+ * the JSPB instance for transitional soy proto support:
2735
+ * http://goto/soy-param-migration
2736
+ * @param {!proto.user.Role} msg The msg instance to transform.
2737
+ * @return {!Object}
2738
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2739
+ */
2740
+ proto.user.Role.toObject = function(includeInstance, msg) {
2741
+ var f, obj = {
2742
+ id: jspb.Message.getFieldWithDefault(msg, 1, 0),
2743
+ title: jspb.Message.getFieldWithDefault(msg, 2, ""),
2744
+ description: jspb.Message.getFieldWithDefault(msg, 3, "")
2745
+ };
2746
+
2747
+ if (includeInstance) {
2748
+ obj.$jspbMessageInstance = msg;
2749
+ }
2750
+ return obj;
2751
+ };
2752
+ }
2753
+
2754
+
2755
+ /**
2756
+ * Deserializes binary data (in protobuf wire format).
2757
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2758
+ * @return {!proto.user.Role}
2759
+ */
2760
+ proto.user.Role.deserializeBinary = function(bytes) {
2761
+ var reader = new jspb.BinaryReader(bytes);
2762
+ var msg = new proto.user.Role;
2763
+ return proto.user.Role.deserializeBinaryFromReader(msg, reader);
2764
+ };
2765
+
2766
+
2767
+ /**
2768
+ * Deserializes binary data (in protobuf wire format) from the
2769
+ * given reader into the given message object.
2770
+ * @param {!proto.user.Role} msg The message object to deserialize into.
2771
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2772
+ * @return {!proto.user.Role}
2773
+ */
2774
+ proto.user.Role.deserializeBinaryFromReader = function(msg, reader) {
2775
+ while (reader.nextField()) {
2776
+ if (reader.isEndGroup()) {
2777
+ break;
2778
+ }
2779
+ var field = reader.getFieldNumber();
2780
+ switch (field) {
2781
+ case 1:
2782
+ var value = /** @type {number} */ (reader.readInt32());
2783
+ msg.setId(value);
2784
+ break;
2785
+ case 2:
2786
+ var value = /** @type {string} */ (reader.readString());
2787
+ msg.setTitle(value);
2788
+ break;
2789
+ case 3:
2790
+ var value = /** @type {string} */ (reader.readString());
2791
+ msg.setDescription(value);
2792
+ break;
2793
+ default:
2794
+ reader.skipField();
2795
+ break;
2796
+ }
2797
+ }
2798
+ return msg;
2799
+ };
2800
+
2801
+
2802
+ /**
2803
+ * Serializes the message to binary data (in protobuf wire format).
2804
+ * @return {!Uint8Array}
2805
+ */
2806
+ proto.user.Role.prototype.serializeBinary = function() {
2807
+ var writer = new jspb.BinaryWriter();
2808
+ proto.user.Role.serializeBinaryToWriter(this, writer);
2809
+ return writer.getResultBuffer();
2810
+ };
2811
+
2812
+
2813
+ /**
2814
+ * Serializes the given message to binary data (in protobuf wire
2815
+ * format), writing to the given BinaryWriter.
2816
+ * @param {!proto.user.Role} message
2817
+ * @param {!jspb.BinaryWriter} writer
2818
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2819
+ */
2820
+ proto.user.Role.serializeBinaryToWriter = function(message, writer) {
2821
+ var f = undefined;
2822
+ f = message.getId();
2823
+ if (f !== 0) {
2824
+ writer.writeInt32(
2825
+ 1,
2826
+ f
2827
+ );
2828
+ }
2829
+ f = message.getTitle();
2830
+ if (f.length > 0) {
2831
+ writer.writeString(
2832
+ 2,
2833
+ f
2834
+ );
2835
+ }
2836
+ f = /** @type {string} */ (jspb.Message.getField(message, 3));
2837
+ if (f != null) {
2838
+ writer.writeString(
2839
+ 3,
2840
+ f
2841
+ );
2842
+ }
2843
+ };
2844
+
2845
+
2846
+ /**
2847
+ * optional int32 id = 1;
2848
+ * @return {number}
2849
+ */
2850
+ proto.user.Role.prototype.getId = function() {
2851
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
2852
+ };
2853
+
2854
+
2855
+ /**
2856
+ * @param {number} value
2857
+ * @return {!proto.user.Role} returns this
2858
+ */
2859
+ proto.user.Role.prototype.setId = function(value) {
2860
+ return jspb.Message.setProto3IntField(this, 1, value);
2861
+ };
2862
+
2863
+
2864
+ /**
2865
+ * optional string title = 2;
2866
+ * @return {string}
2867
+ */
2868
+ proto.user.Role.prototype.getTitle = function() {
2869
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
2870
+ };
2871
+
2872
+
2873
+ /**
2874
+ * @param {string} value
2875
+ * @return {!proto.user.Role} returns this
2876
+ */
2877
+ proto.user.Role.prototype.setTitle = function(value) {
2878
+ return jspb.Message.setProto3StringField(this, 2, value);
2879
+ };
2880
+
2881
+
2882
+ /**
2883
+ * optional string description = 3;
2884
+ * @return {string}
2885
+ */
2886
+ proto.user.Role.prototype.getDescription = function() {
2887
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
2888
+ };
2889
+
2890
+
2891
+ /**
2892
+ * @param {string} value
2893
+ * @return {!proto.user.Role} returns this
2894
+ */
2895
+ proto.user.Role.prototype.setDescription = function(value) {
2896
+ return jspb.Message.setField(this, 3, value);
2897
+ };
2898
+
2899
+
2900
+ /**
2901
+ * Clears the field making it undefined.
2902
+ * @return {!proto.user.Role} returns this
2903
+ */
2904
+ proto.user.Role.prototype.clearDescription = function() {
2905
+ return jspb.Message.setField(this, 3, undefined);
2906
+ };
2907
+
2908
+
2909
+ /**
2910
+ * Returns whether this field is set.
2911
+ * @return {boolean}
2912
+ */
2913
+ proto.user.Role.prototype.hasDescription = function() {
2914
+ return jspb.Message.getField(this, 3) != null;
2915
+ };
2916
+
2917
+
2918
+
2919
+ /**
2920
+ * List of repeated fields within this message type.
2921
+ * @private {!Array<number>}
2922
+ * @const
2923
+ */
2924
+ proto.user.RolesItemsResponse.repeatedFields_ = [1];
2925
+
2926
+
2927
+
2928
+ if (jspb.Message.GENERATE_TO_OBJECT) {
2929
+ /**
2930
+ * Creates an object representation of this proto.
2931
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
2932
+ * Optional fields that are not set will be set to undefined.
2933
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
2934
+ * For the list of reserved names please see:
2935
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
2936
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
2937
+ * JSPB instance for transitional soy proto support:
2938
+ * http://goto/soy-param-migration
2939
+ * @return {!Object}
2940
+ */
2941
+ proto.user.RolesItemsResponse.prototype.toObject = function(opt_includeInstance) {
2942
+ return proto.user.RolesItemsResponse.toObject(opt_includeInstance, this);
2943
+ };
2944
+
2945
+
2946
+ /**
2947
+ * Static version of the {@see toObject} method.
2948
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
2949
+ * the JSPB instance for transitional soy proto support:
2950
+ * http://goto/soy-param-migration
2951
+ * @param {!proto.user.RolesItemsResponse} msg The msg instance to transform.
2952
+ * @return {!Object}
2953
+ * @suppress {unusedLocalVariables} f is only used for nested messages
2954
+ */
2955
+ proto.user.RolesItemsResponse.toObject = function(includeInstance, msg) {
2956
+ var f, obj = {
2957
+ itemsList: jspb.Message.toObjectList(msg.getItemsList(),
2958
+ proto.user.Role.toObject, includeInstance),
2959
+ totalItems: jspb.Message.getFieldWithDefault(msg, 2, 0),
2960
+ totalPages: jspb.Message.getFieldWithDefault(msg, 3, 0)
2961
+ };
2962
+
2963
+ if (includeInstance) {
2964
+ obj.$jspbMessageInstance = msg;
2965
+ }
2966
+ return obj;
2967
+ };
2968
+ }
2969
+
2970
+
2971
+ /**
2972
+ * Deserializes binary data (in protobuf wire format).
2973
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
2974
+ * @return {!proto.user.RolesItemsResponse}
2975
+ */
2976
+ proto.user.RolesItemsResponse.deserializeBinary = function(bytes) {
2977
+ var reader = new jspb.BinaryReader(bytes);
2978
+ var msg = new proto.user.RolesItemsResponse;
2979
+ return proto.user.RolesItemsResponse.deserializeBinaryFromReader(msg, reader);
2980
+ };
2981
+
2982
+
2983
+ /**
2984
+ * Deserializes binary data (in protobuf wire format) from the
2985
+ * given reader into the given message object.
2986
+ * @param {!proto.user.RolesItemsResponse} msg The message object to deserialize into.
2987
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
2988
+ * @return {!proto.user.RolesItemsResponse}
2989
+ */
2990
+ proto.user.RolesItemsResponse.deserializeBinaryFromReader = function(msg, reader) {
2991
+ while (reader.nextField()) {
2992
+ if (reader.isEndGroup()) {
2993
+ break;
2994
+ }
2995
+ var field = reader.getFieldNumber();
2996
+ switch (field) {
2997
+ case 1:
2998
+ var value = new proto.user.Role;
2999
+ reader.readMessage(value,proto.user.Role.deserializeBinaryFromReader);
3000
+ msg.addItems(value);
3001
+ break;
3002
+ case 2:
3003
+ var value = /** @type {number} */ (reader.readInt32());
3004
+ msg.setTotalItems(value);
3005
+ break;
3006
+ case 3:
3007
+ var value = /** @type {number} */ (reader.readInt32());
3008
+ msg.setTotalPages(value);
3009
+ break;
3010
+ default:
3011
+ reader.skipField();
3012
+ break;
3013
+ }
3014
+ }
3015
+ return msg;
3016
+ };
3017
+
3018
+
3019
+ /**
3020
+ * Serializes the message to binary data (in protobuf wire format).
3021
+ * @return {!Uint8Array}
3022
+ */
3023
+ proto.user.RolesItemsResponse.prototype.serializeBinary = function() {
3024
+ var writer = new jspb.BinaryWriter();
3025
+ proto.user.RolesItemsResponse.serializeBinaryToWriter(this, writer);
3026
+ return writer.getResultBuffer();
3027
+ };
3028
+
3029
+
3030
+ /**
3031
+ * Serializes the given message to binary data (in protobuf wire
3032
+ * format), writing to the given BinaryWriter.
3033
+ * @param {!proto.user.RolesItemsResponse} message
3034
+ * @param {!jspb.BinaryWriter} writer
3035
+ * @suppress {unusedLocalVariables} f is only used for nested messages
3036
+ */
3037
+ proto.user.RolesItemsResponse.serializeBinaryToWriter = function(message, writer) {
3038
+ var f = undefined;
3039
+ f = message.getItemsList();
3040
+ if (f.length > 0) {
3041
+ writer.writeRepeatedMessage(
3042
+ 1,
3043
+ f,
3044
+ proto.user.Role.serializeBinaryToWriter
3045
+ );
3046
+ }
3047
+ f = message.getTotalItems();
3048
+ if (f !== 0) {
3049
+ writer.writeInt32(
3050
+ 2,
3051
+ f
3052
+ );
3053
+ }
3054
+ f = message.getTotalPages();
3055
+ if (f !== 0) {
3056
+ writer.writeInt32(
3057
+ 3,
3058
+ f
3059
+ );
3060
+ }
3061
+ };
3062
+
3063
+
3064
+ /**
3065
+ * repeated Role items = 1;
3066
+ * @return {!Array<!proto.user.Role>}
3067
+ */
3068
+ proto.user.RolesItemsResponse.prototype.getItemsList = function() {
3069
+ return /** @type{!Array<!proto.user.Role>} */ (
3070
+ jspb.Message.getRepeatedWrapperField(this, proto.user.Role, 1));
3071
+ };
3072
+
3073
+
3074
+ /**
3075
+ * @param {!Array<!proto.user.Role>} value
3076
+ * @return {!proto.user.RolesItemsResponse} returns this
3077
+ */
3078
+ proto.user.RolesItemsResponse.prototype.setItemsList = function(value) {
3079
+ return jspb.Message.setRepeatedWrapperField(this, 1, value);
3080
+ };
3081
+
3082
+
3083
+ /**
3084
+ * @param {!proto.user.Role=} opt_value
3085
+ * @param {number=} opt_index
3086
+ * @return {!proto.user.Role}
3087
+ */
3088
+ proto.user.RolesItemsResponse.prototype.addItems = function(opt_value, opt_index) {
3089
+ return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.user.Role, opt_index);
3090
+ };
3091
+
3092
+
3093
+ /**
3094
+ * Clears the list making it empty but non-null.
3095
+ * @return {!proto.user.RolesItemsResponse} returns this
3096
+ */
3097
+ proto.user.RolesItemsResponse.prototype.clearItemsList = function() {
3098
+ return this.setItemsList([]);
3099
+ };
3100
+
3101
+
3102
+ /**
3103
+ * optional int32 total_items = 2;
3104
+ * @return {number}
3105
+ */
3106
+ proto.user.RolesItemsResponse.prototype.getTotalItems = function() {
3107
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
3108
+ };
3109
+
3110
+
3111
+ /**
3112
+ * @param {number} value
3113
+ * @return {!proto.user.RolesItemsResponse} returns this
3114
+ */
3115
+ proto.user.RolesItemsResponse.prototype.setTotalItems = function(value) {
3116
+ return jspb.Message.setProto3IntField(this, 2, value);
3117
+ };
3118
+
3119
+
3120
+ /**
3121
+ * optional int32 total_pages = 3;
3122
+ * @return {number}
3123
+ */
3124
+ proto.user.RolesItemsResponse.prototype.getTotalPages = function() {
3125
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
3126
+ };
3127
+
3128
+
3129
+ /**
3130
+ * @param {number} value
3131
+ * @return {!proto.user.RolesItemsResponse} returns this
3132
+ */
3133
+ proto.user.RolesItemsResponse.prototype.setTotalPages = function(value) {
3134
+ return jspb.Message.setProto3IntField(this, 3, value);
3135
+ };
3136
+
3137
+
2484
3138
  goog.object.extend(exports, proto.user);