@m1kad0/hannah-proto 0.3.3 → 0.3.5

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/dist/control.js CHANGED
@@ -5,6 +5,3712 @@
5
5
  // protoc unknown
6
6
  // source: control.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.protobufPackage = void 0;
8
+ exports.GetCarsResponse = exports.Car = exports.DeleteBleTagRequest = exports.UpdateBleTagRequest = exports.CreateBleTagResponse = exports.CreateBleTagRequest = exports.GetBleTagsResponse = exports.BleTag = exports.UpdateConfigRequest = exports.SettingUpdate = exports.GetSettingsResponse = exports.Setting = exports.Category = exports.DeleteAlarmRequest = exports.UpdateAlarmRequest = exports.CreateAlarmResponse = exports.CreateAlarmRequest = exports.GetAlarmsResponse = exports.Alarm = exports.DeleteTriggerRequest = exports.UpdateTriggerRequest = exports.CreateTriggerRequest = exports.GetTriggersResponse = exports.Trigger = exports.DeleteRoutineRequest = exports.UpdateRoutineRequest = exports.CreateRoutineResponse = exports.CreateRoutineRequest = exports.GetRoutinesResponse = exports.Routine = exports.SetGroupRoomsRequest = exports.DeleteGroupRequest = exports.UpdateGroupRequest = exports.CreateGroupRequest = exports.GetGroupsResponse = exports.Group = exports.GetRoomsResponse = exports.Room = exports.DeleteSatelliteRequest = exports.SetSatelliteOwnerRequest = exports.SetSatelliteDisplayNameRequest = exports.SetSatelliteRoomRequest = exports.GetSatellitesResponse = exports.Satellite = exports.AnnounceRequest = exports.SubmitVoiceResponse = exports.SubmitVoiceRequest = exports.SubmitTextResponse = exports.SubmitTextRequest = exports.protobufPackage = void 0;
9
+ exports.DeleteCarRequest = exports.UpdateCarRequest = exports.CreateCarResponse = exports.CreateCarRequest = void 0;
9
10
  /* eslint-disable */
11
+ const wire_1 = require("@bufbuild/protobuf/wire");
10
12
  exports.protobufPackage = "hannah";
13
+ function createBaseSubmitTextRequest() {
14
+ return { text: "", sourceService: "", sourceUserId: "" };
15
+ }
16
+ exports.SubmitTextRequest = {
17
+ encode(message, writer = new wire_1.BinaryWriter()) {
18
+ if (message.text !== "") {
19
+ writer.uint32(10).string(message.text);
20
+ }
21
+ if (message.sourceService !== "") {
22
+ writer.uint32(18).string(message.sourceService);
23
+ }
24
+ if (message.sourceUserId !== "") {
25
+ writer.uint32(26).string(message.sourceUserId);
26
+ }
27
+ return writer;
28
+ },
29
+ decode(input, length) {
30
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
31
+ const end = length === undefined ? reader.len : reader.pos + length;
32
+ const message = createBaseSubmitTextRequest();
33
+ while (reader.pos < end) {
34
+ const tag = reader.uint32();
35
+ switch (tag >>> 3) {
36
+ case 1: {
37
+ if (tag !== 10) {
38
+ break;
39
+ }
40
+ message.text = reader.string();
41
+ continue;
42
+ }
43
+ case 2: {
44
+ if (tag !== 18) {
45
+ break;
46
+ }
47
+ message.sourceService = reader.string();
48
+ continue;
49
+ }
50
+ case 3: {
51
+ if (tag !== 26) {
52
+ break;
53
+ }
54
+ message.sourceUserId = reader.string();
55
+ continue;
56
+ }
57
+ }
58
+ if ((tag & 7) === 4 || tag === 0) {
59
+ break;
60
+ }
61
+ reader.skip(tag & 7);
62
+ }
63
+ return message;
64
+ },
65
+ create(base) {
66
+ return exports.SubmitTextRequest.fromPartial(base ?? {});
67
+ },
68
+ fromPartial(object) {
69
+ const message = createBaseSubmitTextRequest();
70
+ message.text = object.text ?? "";
71
+ message.sourceService = object.sourceService ?? "";
72
+ message.sourceUserId = object.sourceUserId ?? "";
73
+ return message;
74
+ },
75
+ };
76
+ function createBaseSubmitTextResponse() {
77
+ return { answer: "", intentName: "" };
78
+ }
79
+ exports.SubmitTextResponse = {
80
+ encode(message, writer = new wire_1.BinaryWriter()) {
81
+ if (message.answer !== "") {
82
+ writer.uint32(10).string(message.answer);
83
+ }
84
+ if (message.intentName !== "") {
85
+ writer.uint32(18).string(message.intentName);
86
+ }
87
+ return writer;
88
+ },
89
+ decode(input, length) {
90
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
91
+ const end = length === undefined ? reader.len : reader.pos + length;
92
+ const message = createBaseSubmitTextResponse();
93
+ while (reader.pos < end) {
94
+ const tag = reader.uint32();
95
+ switch (tag >>> 3) {
96
+ case 1: {
97
+ if (tag !== 10) {
98
+ break;
99
+ }
100
+ message.answer = reader.string();
101
+ continue;
102
+ }
103
+ case 2: {
104
+ if (tag !== 18) {
105
+ break;
106
+ }
107
+ message.intentName = reader.string();
108
+ continue;
109
+ }
110
+ }
111
+ if ((tag & 7) === 4 || tag === 0) {
112
+ break;
113
+ }
114
+ reader.skip(tag & 7);
115
+ }
116
+ return message;
117
+ },
118
+ create(base) {
119
+ return exports.SubmitTextResponse.fromPartial(base ?? {});
120
+ },
121
+ fromPartial(object) {
122
+ const message = createBaseSubmitTextResponse();
123
+ message.answer = object.answer ?? "";
124
+ message.intentName = object.intentName ?? "";
125
+ return message;
126
+ },
127
+ };
128
+ function createBaseSubmitVoiceRequest() {
129
+ return { audio: new Uint8Array(0), sourceService: "", sourceUserId: "" };
130
+ }
131
+ exports.SubmitVoiceRequest = {
132
+ encode(message, writer = new wire_1.BinaryWriter()) {
133
+ if (message.audio.length !== 0) {
134
+ writer.uint32(10).bytes(message.audio);
135
+ }
136
+ if (message.sourceService !== "") {
137
+ writer.uint32(18).string(message.sourceService);
138
+ }
139
+ if (message.sourceUserId !== "") {
140
+ writer.uint32(26).string(message.sourceUserId);
141
+ }
142
+ return writer;
143
+ },
144
+ decode(input, length) {
145
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
146
+ const end = length === undefined ? reader.len : reader.pos + length;
147
+ const message = createBaseSubmitVoiceRequest();
148
+ while (reader.pos < end) {
149
+ const tag = reader.uint32();
150
+ switch (tag >>> 3) {
151
+ case 1: {
152
+ if (tag !== 10) {
153
+ break;
154
+ }
155
+ message.audio = reader.bytes();
156
+ continue;
157
+ }
158
+ case 2: {
159
+ if (tag !== 18) {
160
+ break;
161
+ }
162
+ message.sourceService = reader.string();
163
+ continue;
164
+ }
165
+ case 3: {
166
+ if (tag !== 26) {
167
+ break;
168
+ }
169
+ message.sourceUserId = reader.string();
170
+ continue;
171
+ }
172
+ }
173
+ if ((tag & 7) === 4 || tag === 0) {
174
+ break;
175
+ }
176
+ reader.skip(tag & 7);
177
+ }
178
+ return message;
179
+ },
180
+ create(base) {
181
+ return exports.SubmitVoiceRequest.fromPartial(base ?? {});
182
+ },
183
+ fromPartial(object) {
184
+ const message = createBaseSubmitVoiceRequest();
185
+ message.audio = object.audio ?? new Uint8Array(0);
186
+ message.sourceService = object.sourceService ?? "";
187
+ message.sourceUserId = object.sourceUserId ?? "";
188
+ return message;
189
+ },
190
+ };
191
+ function createBaseSubmitVoiceResponse() {
192
+ return { transcript: "", answer: "", intentName: "", audioOgg: new Uint8Array(0) };
193
+ }
194
+ exports.SubmitVoiceResponse = {
195
+ encode(message, writer = new wire_1.BinaryWriter()) {
196
+ if (message.transcript !== "") {
197
+ writer.uint32(10).string(message.transcript);
198
+ }
199
+ if (message.answer !== "") {
200
+ writer.uint32(18).string(message.answer);
201
+ }
202
+ if (message.intentName !== "") {
203
+ writer.uint32(26).string(message.intentName);
204
+ }
205
+ if (message.audioOgg.length !== 0) {
206
+ writer.uint32(34).bytes(message.audioOgg);
207
+ }
208
+ return writer;
209
+ },
210
+ decode(input, length) {
211
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
212
+ const end = length === undefined ? reader.len : reader.pos + length;
213
+ const message = createBaseSubmitVoiceResponse();
214
+ while (reader.pos < end) {
215
+ const tag = reader.uint32();
216
+ switch (tag >>> 3) {
217
+ case 1: {
218
+ if (tag !== 10) {
219
+ break;
220
+ }
221
+ message.transcript = reader.string();
222
+ continue;
223
+ }
224
+ case 2: {
225
+ if (tag !== 18) {
226
+ break;
227
+ }
228
+ message.answer = reader.string();
229
+ continue;
230
+ }
231
+ case 3: {
232
+ if (tag !== 26) {
233
+ break;
234
+ }
235
+ message.intentName = reader.string();
236
+ continue;
237
+ }
238
+ case 4: {
239
+ if (tag !== 34) {
240
+ break;
241
+ }
242
+ message.audioOgg = reader.bytes();
243
+ continue;
244
+ }
245
+ }
246
+ if ((tag & 7) === 4 || tag === 0) {
247
+ break;
248
+ }
249
+ reader.skip(tag & 7);
250
+ }
251
+ return message;
252
+ },
253
+ create(base) {
254
+ return exports.SubmitVoiceResponse.fromPartial(base ?? {});
255
+ },
256
+ fromPartial(object) {
257
+ const message = createBaseSubmitVoiceResponse();
258
+ message.transcript = object.transcript ?? "";
259
+ message.answer = object.answer ?? "";
260
+ message.intentName = object.intentName ?? "";
261
+ message.audioOgg = object.audioOgg ?? new Uint8Array(0);
262
+ return message;
263
+ },
264
+ };
265
+ function createBaseAnnounceRequest() {
266
+ return { text: "", device: "", roomId: "", userId: 0 };
267
+ }
268
+ exports.AnnounceRequest = {
269
+ encode(message, writer = new wire_1.BinaryWriter()) {
270
+ if (message.text !== "") {
271
+ writer.uint32(10).string(message.text);
272
+ }
273
+ if (message.device !== "") {
274
+ writer.uint32(18).string(message.device);
275
+ }
276
+ if (message.roomId !== "") {
277
+ writer.uint32(26).string(message.roomId);
278
+ }
279
+ if (message.userId !== 0) {
280
+ writer.uint32(32).int32(message.userId);
281
+ }
282
+ return writer;
283
+ },
284
+ decode(input, length) {
285
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
286
+ const end = length === undefined ? reader.len : reader.pos + length;
287
+ const message = createBaseAnnounceRequest();
288
+ while (reader.pos < end) {
289
+ const tag = reader.uint32();
290
+ switch (tag >>> 3) {
291
+ case 1: {
292
+ if (tag !== 10) {
293
+ break;
294
+ }
295
+ message.text = reader.string();
296
+ continue;
297
+ }
298
+ case 2: {
299
+ if (tag !== 18) {
300
+ break;
301
+ }
302
+ message.device = reader.string();
303
+ continue;
304
+ }
305
+ case 3: {
306
+ if (tag !== 26) {
307
+ break;
308
+ }
309
+ message.roomId = reader.string();
310
+ continue;
311
+ }
312
+ case 4: {
313
+ if (tag !== 32) {
314
+ break;
315
+ }
316
+ message.userId = reader.int32();
317
+ continue;
318
+ }
319
+ }
320
+ if ((tag & 7) === 4 || tag === 0) {
321
+ break;
322
+ }
323
+ reader.skip(tag & 7);
324
+ }
325
+ return message;
326
+ },
327
+ create(base) {
328
+ return exports.AnnounceRequest.fromPartial(base ?? {});
329
+ },
330
+ fromPartial(object) {
331
+ const message = createBaseAnnounceRequest();
332
+ message.text = object.text ?? "";
333
+ message.device = object.device ?? "";
334
+ message.roomId = object.roomId ?? "";
335
+ message.userId = object.userId ?? 0;
336
+ return message;
337
+ },
338
+ };
339
+ function createBaseSatellite() {
340
+ return {
341
+ deviceId: "",
342
+ room: "",
343
+ address: "",
344
+ displayName: "",
345
+ roomId: "",
346
+ roomDisplayName: "",
347
+ lastSeen: "",
348
+ connected: false,
349
+ roomMismatch: false,
350
+ ownerUserId: 0,
351
+ ownerDisplayName: "",
352
+ };
353
+ }
354
+ exports.Satellite = {
355
+ encode(message, writer = new wire_1.BinaryWriter()) {
356
+ if (message.deviceId !== "") {
357
+ writer.uint32(10).string(message.deviceId);
358
+ }
359
+ if (message.room !== "") {
360
+ writer.uint32(18).string(message.room);
361
+ }
362
+ if (message.address !== "") {
363
+ writer.uint32(26).string(message.address);
364
+ }
365
+ if (message.displayName !== "") {
366
+ writer.uint32(42).string(message.displayName);
367
+ }
368
+ if (message.roomId !== "") {
369
+ writer.uint32(50).string(message.roomId);
370
+ }
371
+ if (message.roomDisplayName !== "") {
372
+ writer.uint32(58).string(message.roomDisplayName);
373
+ }
374
+ if (message.lastSeen !== "") {
375
+ writer.uint32(66).string(message.lastSeen);
376
+ }
377
+ if (message.connected !== false) {
378
+ writer.uint32(72).bool(message.connected);
379
+ }
380
+ if (message.roomMismatch !== false) {
381
+ writer.uint32(80).bool(message.roomMismatch);
382
+ }
383
+ if (message.ownerUserId !== 0) {
384
+ writer.uint32(88).int32(message.ownerUserId);
385
+ }
386
+ if (message.ownerDisplayName !== "") {
387
+ writer.uint32(98).string(message.ownerDisplayName);
388
+ }
389
+ return writer;
390
+ },
391
+ decode(input, length) {
392
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
393
+ const end = length === undefined ? reader.len : reader.pos + length;
394
+ const message = createBaseSatellite();
395
+ while (reader.pos < end) {
396
+ const tag = reader.uint32();
397
+ switch (tag >>> 3) {
398
+ case 1: {
399
+ if (tag !== 10) {
400
+ break;
401
+ }
402
+ message.deviceId = reader.string();
403
+ continue;
404
+ }
405
+ case 2: {
406
+ if (tag !== 18) {
407
+ break;
408
+ }
409
+ message.room = reader.string();
410
+ continue;
411
+ }
412
+ case 3: {
413
+ if (tag !== 26) {
414
+ break;
415
+ }
416
+ message.address = reader.string();
417
+ continue;
418
+ }
419
+ case 5: {
420
+ if (tag !== 42) {
421
+ break;
422
+ }
423
+ message.displayName = reader.string();
424
+ continue;
425
+ }
426
+ case 6: {
427
+ if (tag !== 50) {
428
+ break;
429
+ }
430
+ message.roomId = reader.string();
431
+ continue;
432
+ }
433
+ case 7: {
434
+ if (tag !== 58) {
435
+ break;
436
+ }
437
+ message.roomDisplayName = reader.string();
438
+ continue;
439
+ }
440
+ case 8: {
441
+ if (tag !== 66) {
442
+ break;
443
+ }
444
+ message.lastSeen = reader.string();
445
+ continue;
446
+ }
447
+ case 9: {
448
+ if (tag !== 72) {
449
+ break;
450
+ }
451
+ message.connected = reader.bool();
452
+ continue;
453
+ }
454
+ case 10: {
455
+ if (tag !== 80) {
456
+ break;
457
+ }
458
+ message.roomMismatch = reader.bool();
459
+ continue;
460
+ }
461
+ case 11: {
462
+ if (tag !== 88) {
463
+ break;
464
+ }
465
+ message.ownerUserId = reader.int32();
466
+ continue;
467
+ }
468
+ case 12: {
469
+ if (tag !== 98) {
470
+ break;
471
+ }
472
+ message.ownerDisplayName = reader.string();
473
+ continue;
474
+ }
475
+ }
476
+ if ((tag & 7) === 4 || tag === 0) {
477
+ break;
478
+ }
479
+ reader.skip(tag & 7);
480
+ }
481
+ return message;
482
+ },
483
+ create(base) {
484
+ return exports.Satellite.fromPartial(base ?? {});
485
+ },
486
+ fromPartial(object) {
487
+ const message = createBaseSatellite();
488
+ message.deviceId = object.deviceId ?? "";
489
+ message.room = object.room ?? "";
490
+ message.address = object.address ?? "";
491
+ message.displayName = object.displayName ?? "";
492
+ message.roomId = object.roomId ?? "";
493
+ message.roomDisplayName = object.roomDisplayName ?? "";
494
+ message.lastSeen = object.lastSeen ?? "";
495
+ message.connected = object.connected ?? false;
496
+ message.roomMismatch = object.roomMismatch ?? false;
497
+ message.ownerUserId = object.ownerUserId ?? 0;
498
+ message.ownerDisplayName = object.ownerDisplayName ?? "";
499
+ return message;
500
+ },
501
+ };
502
+ function createBaseGetSatellitesResponse() {
503
+ return { satellites: [] };
504
+ }
505
+ exports.GetSatellitesResponse = {
506
+ encode(message, writer = new wire_1.BinaryWriter()) {
507
+ for (const v of message.satellites) {
508
+ exports.Satellite.encode(v, writer.uint32(10).fork()).join();
509
+ }
510
+ return writer;
511
+ },
512
+ decode(input, length) {
513
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
514
+ const end = length === undefined ? reader.len : reader.pos + length;
515
+ const message = createBaseGetSatellitesResponse();
516
+ while (reader.pos < end) {
517
+ const tag = reader.uint32();
518
+ switch (tag >>> 3) {
519
+ case 1: {
520
+ if (tag !== 10) {
521
+ break;
522
+ }
523
+ message.satellites.push(exports.Satellite.decode(reader, reader.uint32()));
524
+ continue;
525
+ }
526
+ }
527
+ if ((tag & 7) === 4 || tag === 0) {
528
+ break;
529
+ }
530
+ reader.skip(tag & 7);
531
+ }
532
+ return message;
533
+ },
534
+ create(base) {
535
+ return exports.GetSatellitesResponse.fromPartial(base ?? {});
536
+ },
537
+ fromPartial(object) {
538
+ const message = createBaseGetSatellitesResponse();
539
+ message.satellites = object.satellites?.map((e) => exports.Satellite.fromPartial(e)) || [];
540
+ return message;
541
+ },
542
+ };
543
+ function createBaseSetSatelliteRoomRequest() {
544
+ return { deviceId: "", roomId: "", requestorId: 0 };
545
+ }
546
+ exports.SetSatelliteRoomRequest = {
547
+ encode(message, writer = new wire_1.BinaryWriter()) {
548
+ if (message.deviceId !== "") {
549
+ writer.uint32(10).string(message.deviceId);
550
+ }
551
+ if (message.roomId !== "") {
552
+ writer.uint32(18).string(message.roomId);
553
+ }
554
+ if (message.requestorId !== 0) {
555
+ writer.uint32(24).int32(message.requestorId);
556
+ }
557
+ return writer;
558
+ },
559
+ decode(input, length) {
560
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
561
+ const end = length === undefined ? reader.len : reader.pos + length;
562
+ const message = createBaseSetSatelliteRoomRequest();
563
+ while (reader.pos < end) {
564
+ const tag = reader.uint32();
565
+ switch (tag >>> 3) {
566
+ case 1: {
567
+ if (tag !== 10) {
568
+ break;
569
+ }
570
+ message.deviceId = reader.string();
571
+ continue;
572
+ }
573
+ case 2: {
574
+ if (tag !== 18) {
575
+ break;
576
+ }
577
+ message.roomId = reader.string();
578
+ continue;
579
+ }
580
+ case 3: {
581
+ if (tag !== 24) {
582
+ break;
583
+ }
584
+ message.requestorId = reader.int32();
585
+ continue;
586
+ }
587
+ }
588
+ if ((tag & 7) === 4 || tag === 0) {
589
+ break;
590
+ }
591
+ reader.skip(tag & 7);
592
+ }
593
+ return message;
594
+ },
595
+ create(base) {
596
+ return exports.SetSatelliteRoomRequest.fromPartial(base ?? {});
597
+ },
598
+ fromPartial(object) {
599
+ const message = createBaseSetSatelliteRoomRequest();
600
+ message.deviceId = object.deviceId ?? "";
601
+ message.roomId = object.roomId ?? "";
602
+ message.requestorId = object.requestorId ?? 0;
603
+ return message;
604
+ },
605
+ };
606
+ function createBaseSetSatelliteDisplayNameRequest() {
607
+ return { deviceId: "", displayName: "", requestorId: 0 };
608
+ }
609
+ exports.SetSatelliteDisplayNameRequest = {
610
+ encode(message, writer = new wire_1.BinaryWriter()) {
611
+ if (message.deviceId !== "") {
612
+ writer.uint32(10).string(message.deviceId);
613
+ }
614
+ if (message.displayName !== "") {
615
+ writer.uint32(18).string(message.displayName);
616
+ }
617
+ if (message.requestorId !== 0) {
618
+ writer.uint32(24).int32(message.requestorId);
619
+ }
620
+ return writer;
621
+ },
622
+ decode(input, length) {
623
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
624
+ const end = length === undefined ? reader.len : reader.pos + length;
625
+ const message = createBaseSetSatelliteDisplayNameRequest();
626
+ while (reader.pos < end) {
627
+ const tag = reader.uint32();
628
+ switch (tag >>> 3) {
629
+ case 1: {
630
+ if (tag !== 10) {
631
+ break;
632
+ }
633
+ message.deviceId = reader.string();
634
+ continue;
635
+ }
636
+ case 2: {
637
+ if (tag !== 18) {
638
+ break;
639
+ }
640
+ message.displayName = reader.string();
641
+ continue;
642
+ }
643
+ case 3: {
644
+ if (tag !== 24) {
645
+ break;
646
+ }
647
+ message.requestorId = reader.int32();
648
+ continue;
649
+ }
650
+ }
651
+ if ((tag & 7) === 4 || tag === 0) {
652
+ break;
653
+ }
654
+ reader.skip(tag & 7);
655
+ }
656
+ return message;
657
+ },
658
+ create(base) {
659
+ return exports.SetSatelliteDisplayNameRequest.fromPartial(base ?? {});
660
+ },
661
+ fromPartial(object) {
662
+ const message = createBaseSetSatelliteDisplayNameRequest();
663
+ message.deviceId = object.deviceId ?? "";
664
+ message.displayName = object.displayName ?? "";
665
+ message.requestorId = object.requestorId ?? 0;
666
+ return message;
667
+ },
668
+ };
669
+ function createBaseSetSatelliteOwnerRequest() {
670
+ return { deviceId: "", userId: 0, requestorId: 0 };
671
+ }
672
+ exports.SetSatelliteOwnerRequest = {
673
+ encode(message, writer = new wire_1.BinaryWriter()) {
674
+ if (message.deviceId !== "") {
675
+ writer.uint32(10).string(message.deviceId);
676
+ }
677
+ if (message.userId !== 0) {
678
+ writer.uint32(16).int32(message.userId);
679
+ }
680
+ if (message.requestorId !== 0) {
681
+ writer.uint32(24).int32(message.requestorId);
682
+ }
683
+ return writer;
684
+ },
685
+ decode(input, length) {
686
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
687
+ const end = length === undefined ? reader.len : reader.pos + length;
688
+ const message = createBaseSetSatelliteOwnerRequest();
689
+ while (reader.pos < end) {
690
+ const tag = reader.uint32();
691
+ switch (tag >>> 3) {
692
+ case 1: {
693
+ if (tag !== 10) {
694
+ break;
695
+ }
696
+ message.deviceId = reader.string();
697
+ continue;
698
+ }
699
+ case 2: {
700
+ if (tag !== 16) {
701
+ break;
702
+ }
703
+ message.userId = reader.int32();
704
+ continue;
705
+ }
706
+ case 3: {
707
+ if (tag !== 24) {
708
+ break;
709
+ }
710
+ message.requestorId = reader.int32();
711
+ continue;
712
+ }
713
+ }
714
+ if ((tag & 7) === 4 || tag === 0) {
715
+ break;
716
+ }
717
+ reader.skip(tag & 7);
718
+ }
719
+ return message;
720
+ },
721
+ create(base) {
722
+ return exports.SetSatelliteOwnerRequest.fromPartial(base ?? {});
723
+ },
724
+ fromPartial(object) {
725
+ const message = createBaseSetSatelliteOwnerRequest();
726
+ message.deviceId = object.deviceId ?? "";
727
+ message.userId = object.userId ?? 0;
728
+ message.requestorId = object.requestorId ?? 0;
729
+ return message;
730
+ },
731
+ };
732
+ function createBaseDeleteSatelliteRequest() {
733
+ return { deviceId: "", requestorId: 0 };
734
+ }
735
+ exports.DeleteSatelliteRequest = {
736
+ encode(message, writer = new wire_1.BinaryWriter()) {
737
+ if (message.deviceId !== "") {
738
+ writer.uint32(10).string(message.deviceId);
739
+ }
740
+ if (message.requestorId !== 0) {
741
+ writer.uint32(16).int32(message.requestorId);
742
+ }
743
+ return writer;
744
+ },
745
+ decode(input, length) {
746
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
747
+ const end = length === undefined ? reader.len : reader.pos + length;
748
+ const message = createBaseDeleteSatelliteRequest();
749
+ while (reader.pos < end) {
750
+ const tag = reader.uint32();
751
+ switch (tag >>> 3) {
752
+ case 1: {
753
+ if (tag !== 10) {
754
+ break;
755
+ }
756
+ message.deviceId = reader.string();
757
+ continue;
758
+ }
759
+ case 2: {
760
+ if (tag !== 16) {
761
+ break;
762
+ }
763
+ message.requestorId = reader.int32();
764
+ continue;
765
+ }
766
+ }
767
+ if ((tag & 7) === 4 || tag === 0) {
768
+ break;
769
+ }
770
+ reader.skip(tag & 7);
771
+ }
772
+ return message;
773
+ },
774
+ create(base) {
775
+ return exports.DeleteSatelliteRequest.fromPartial(base ?? {});
776
+ },
777
+ fromPartial(object) {
778
+ const message = createBaseDeleteSatelliteRequest();
779
+ message.deviceId = object.deviceId ?? "";
780
+ message.requestorId = object.requestorId ?? 0;
781
+ return message;
782
+ },
783
+ };
784
+ function createBaseRoom() {
785
+ return { roomId: "", displayName: "" };
786
+ }
787
+ exports.Room = {
788
+ encode(message, writer = new wire_1.BinaryWriter()) {
789
+ if (message.roomId !== "") {
790
+ writer.uint32(10).string(message.roomId);
791
+ }
792
+ if (message.displayName !== "") {
793
+ writer.uint32(18).string(message.displayName);
794
+ }
795
+ return writer;
796
+ },
797
+ decode(input, length) {
798
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
799
+ const end = length === undefined ? reader.len : reader.pos + length;
800
+ const message = createBaseRoom();
801
+ while (reader.pos < end) {
802
+ const tag = reader.uint32();
803
+ switch (tag >>> 3) {
804
+ case 1: {
805
+ if (tag !== 10) {
806
+ break;
807
+ }
808
+ message.roomId = reader.string();
809
+ continue;
810
+ }
811
+ case 2: {
812
+ if (tag !== 18) {
813
+ break;
814
+ }
815
+ message.displayName = reader.string();
816
+ continue;
817
+ }
818
+ }
819
+ if ((tag & 7) === 4 || tag === 0) {
820
+ break;
821
+ }
822
+ reader.skip(tag & 7);
823
+ }
824
+ return message;
825
+ },
826
+ create(base) {
827
+ return exports.Room.fromPartial(base ?? {});
828
+ },
829
+ fromPartial(object) {
830
+ const message = createBaseRoom();
831
+ message.roomId = object.roomId ?? "";
832
+ message.displayName = object.displayName ?? "";
833
+ return message;
834
+ },
835
+ };
836
+ function createBaseGetRoomsResponse() {
837
+ return { rooms: [] };
838
+ }
839
+ exports.GetRoomsResponse = {
840
+ encode(message, writer = new wire_1.BinaryWriter()) {
841
+ for (const v of message.rooms) {
842
+ exports.Room.encode(v, writer.uint32(10).fork()).join();
843
+ }
844
+ return writer;
845
+ },
846
+ decode(input, length) {
847
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
848
+ const end = length === undefined ? reader.len : reader.pos + length;
849
+ const message = createBaseGetRoomsResponse();
850
+ while (reader.pos < end) {
851
+ const tag = reader.uint32();
852
+ switch (tag >>> 3) {
853
+ case 1: {
854
+ if (tag !== 10) {
855
+ break;
856
+ }
857
+ message.rooms.push(exports.Room.decode(reader, reader.uint32()));
858
+ continue;
859
+ }
860
+ }
861
+ if ((tag & 7) === 4 || tag === 0) {
862
+ break;
863
+ }
864
+ reader.skip(tag & 7);
865
+ }
866
+ return message;
867
+ },
868
+ create(base) {
869
+ return exports.GetRoomsResponse.fromPartial(base ?? {});
870
+ },
871
+ fromPartial(object) {
872
+ const message = createBaseGetRoomsResponse();
873
+ message.rooms = object.rooms?.map((e) => exports.Room.fromPartial(e)) || [];
874
+ return message;
875
+ },
876
+ };
877
+ function createBaseGroup() {
878
+ return { groupId: "", displayName: "", rooms: [] };
879
+ }
880
+ exports.Group = {
881
+ encode(message, writer = new wire_1.BinaryWriter()) {
882
+ if (message.groupId !== "") {
883
+ writer.uint32(10).string(message.groupId);
884
+ }
885
+ if (message.displayName !== "") {
886
+ writer.uint32(18).string(message.displayName);
887
+ }
888
+ for (const v of message.rooms) {
889
+ exports.Room.encode(v, writer.uint32(26).fork()).join();
890
+ }
891
+ return writer;
892
+ },
893
+ decode(input, length) {
894
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
895
+ const end = length === undefined ? reader.len : reader.pos + length;
896
+ const message = createBaseGroup();
897
+ while (reader.pos < end) {
898
+ const tag = reader.uint32();
899
+ switch (tag >>> 3) {
900
+ case 1: {
901
+ if (tag !== 10) {
902
+ break;
903
+ }
904
+ message.groupId = reader.string();
905
+ continue;
906
+ }
907
+ case 2: {
908
+ if (tag !== 18) {
909
+ break;
910
+ }
911
+ message.displayName = reader.string();
912
+ continue;
913
+ }
914
+ case 3: {
915
+ if (tag !== 26) {
916
+ break;
917
+ }
918
+ message.rooms.push(exports.Room.decode(reader, reader.uint32()));
919
+ continue;
920
+ }
921
+ }
922
+ if ((tag & 7) === 4 || tag === 0) {
923
+ break;
924
+ }
925
+ reader.skip(tag & 7);
926
+ }
927
+ return message;
928
+ },
929
+ create(base) {
930
+ return exports.Group.fromPartial(base ?? {});
931
+ },
932
+ fromPartial(object) {
933
+ const message = createBaseGroup();
934
+ message.groupId = object.groupId ?? "";
935
+ message.displayName = object.displayName ?? "";
936
+ message.rooms = object.rooms?.map((e) => exports.Room.fromPartial(e)) || [];
937
+ return message;
938
+ },
939
+ };
940
+ function createBaseGetGroupsResponse() {
941
+ return { groups: [] };
942
+ }
943
+ exports.GetGroupsResponse = {
944
+ encode(message, writer = new wire_1.BinaryWriter()) {
945
+ for (const v of message.groups) {
946
+ exports.Group.encode(v, writer.uint32(10).fork()).join();
947
+ }
948
+ return writer;
949
+ },
950
+ decode(input, length) {
951
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
952
+ const end = length === undefined ? reader.len : reader.pos + length;
953
+ const message = createBaseGetGroupsResponse();
954
+ while (reader.pos < end) {
955
+ const tag = reader.uint32();
956
+ switch (tag >>> 3) {
957
+ case 1: {
958
+ if (tag !== 10) {
959
+ break;
960
+ }
961
+ message.groups.push(exports.Group.decode(reader, reader.uint32()));
962
+ continue;
963
+ }
964
+ }
965
+ if ((tag & 7) === 4 || tag === 0) {
966
+ break;
967
+ }
968
+ reader.skip(tag & 7);
969
+ }
970
+ return message;
971
+ },
972
+ create(base) {
973
+ return exports.GetGroupsResponse.fromPartial(base ?? {});
974
+ },
975
+ fromPartial(object) {
976
+ const message = createBaseGetGroupsResponse();
977
+ message.groups = object.groups?.map((e) => exports.Group.fromPartial(e)) || [];
978
+ return message;
979
+ },
980
+ };
981
+ function createBaseCreateGroupRequest() {
982
+ return { groupId: "", displayName: "" };
983
+ }
984
+ exports.CreateGroupRequest = {
985
+ encode(message, writer = new wire_1.BinaryWriter()) {
986
+ if (message.groupId !== "") {
987
+ writer.uint32(10).string(message.groupId);
988
+ }
989
+ if (message.displayName !== "") {
990
+ writer.uint32(18).string(message.displayName);
991
+ }
992
+ return writer;
993
+ },
994
+ decode(input, length) {
995
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
996
+ const end = length === undefined ? reader.len : reader.pos + length;
997
+ const message = createBaseCreateGroupRequest();
998
+ while (reader.pos < end) {
999
+ const tag = reader.uint32();
1000
+ switch (tag >>> 3) {
1001
+ case 1: {
1002
+ if (tag !== 10) {
1003
+ break;
1004
+ }
1005
+ message.groupId = reader.string();
1006
+ continue;
1007
+ }
1008
+ case 2: {
1009
+ if (tag !== 18) {
1010
+ break;
1011
+ }
1012
+ message.displayName = reader.string();
1013
+ continue;
1014
+ }
1015
+ }
1016
+ if ((tag & 7) === 4 || tag === 0) {
1017
+ break;
1018
+ }
1019
+ reader.skip(tag & 7);
1020
+ }
1021
+ return message;
1022
+ },
1023
+ create(base) {
1024
+ return exports.CreateGroupRequest.fromPartial(base ?? {});
1025
+ },
1026
+ fromPartial(object) {
1027
+ const message = createBaseCreateGroupRequest();
1028
+ message.groupId = object.groupId ?? "";
1029
+ message.displayName = object.displayName ?? "";
1030
+ return message;
1031
+ },
1032
+ };
1033
+ function createBaseUpdateGroupRequest() {
1034
+ return { groupId: "", displayName: "" };
1035
+ }
1036
+ exports.UpdateGroupRequest = {
1037
+ encode(message, writer = new wire_1.BinaryWriter()) {
1038
+ if (message.groupId !== "") {
1039
+ writer.uint32(10).string(message.groupId);
1040
+ }
1041
+ if (message.displayName !== "") {
1042
+ writer.uint32(18).string(message.displayName);
1043
+ }
1044
+ return writer;
1045
+ },
1046
+ decode(input, length) {
1047
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1048
+ const end = length === undefined ? reader.len : reader.pos + length;
1049
+ const message = createBaseUpdateGroupRequest();
1050
+ while (reader.pos < end) {
1051
+ const tag = reader.uint32();
1052
+ switch (tag >>> 3) {
1053
+ case 1: {
1054
+ if (tag !== 10) {
1055
+ break;
1056
+ }
1057
+ message.groupId = reader.string();
1058
+ continue;
1059
+ }
1060
+ case 2: {
1061
+ if (tag !== 18) {
1062
+ break;
1063
+ }
1064
+ message.displayName = reader.string();
1065
+ continue;
1066
+ }
1067
+ }
1068
+ if ((tag & 7) === 4 || tag === 0) {
1069
+ break;
1070
+ }
1071
+ reader.skip(tag & 7);
1072
+ }
1073
+ return message;
1074
+ },
1075
+ create(base) {
1076
+ return exports.UpdateGroupRequest.fromPartial(base ?? {});
1077
+ },
1078
+ fromPartial(object) {
1079
+ const message = createBaseUpdateGroupRequest();
1080
+ message.groupId = object.groupId ?? "";
1081
+ message.displayName = object.displayName ?? "";
1082
+ return message;
1083
+ },
1084
+ };
1085
+ function createBaseDeleteGroupRequest() {
1086
+ return { groupId: "" };
1087
+ }
1088
+ exports.DeleteGroupRequest = {
1089
+ encode(message, writer = new wire_1.BinaryWriter()) {
1090
+ if (message.groupId !== "") {
1091
+ writer.uint32(10).string(message.groupId);
1092
+ }
1093
+ return writer;
1094
+ },
1095
+ decode(input, length) {
1096
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1097
+ const end = length === undefined ? reader.len : reader.pos + length;
1098
+ const message = createBaseDeleteGroupRequest();
1099
+ while (reader.pos < end) {
1100
+ const tag = reader.uint32();
1101
+ switch (tag >>> 3) {
1102
+ case 1: {
1103
+ if (tag !== 10) {
1104
+ break;
1105
+ }
1106
+ message.groupId = reader.string();
1107
+ continue;
1108
+ }
1109
+ }
1110
+ if ((tag & 7) === 4 || tag === 0) {
1111
+ break;
1112
+ }
1113
+ reader.skip(tag & 7);
1114
+ }
1115
+ return message;
1116
+ },
1117
+ create(base) {
1118
+ return exports.DeleteGroupRequest.fromPartial(base ?? {});
1119
+ },
1120
+ fromPartial(object) {
1121
+ const message = createBaseDeleteGroupRequest();
1122
+ message.groupId = object.groupId ?? "";
1123
+ return message;
1124
+ },
1125
+ };
1126
+ function createBaseSetGroupRoomsRequest() {
1127
+ return { groupId: "", roomIds: [] };
1128
+ }
1129
+ exports.SetGroupRoomsRequest = {
1130
+ encode(message, writer = new wire_1.BinaryWriter()) {
1131
+ if (message.groupId !== "") {
1132
+ writer.uint32(10).string(message.groupId);
1133
+ }
1134
+ for (const v of message.roomIds) {
1135
+ writer.uint32(18).string(v);
1136
+ }
1137
+ return writer;
1138
+ },
1139
+ decode(input, length) {
1140
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1141
+ const end = length === undefined ? reader.len : reader.pos + length;
1142
+ const message = createBaseSetGroupRoomsRequest();
1143
+ while (reader.pos < end) {
1144
+ const tag = reader.uint32();
1145
+ switch (tag >>> 3) {
1146
+ case 1: {
1147
+ if (tag !== 10) {
1148
+ break;
1149
+ }
1150
+ message.groupId = reader.string();
1151
+ continue;
1152
+ }
1153
+ case 2: {
1154
+ if (tag !== 18) {
1155
+ break;
1156
+ }
1157
+ message.roomIds.push(reader.string());
1158
+ continue;
1159
+ }
1160
+ }
1161
+ if ((tag & 7) === 4 || tag === 0) {
1162
+ break;
1163
+ }
1164
+ reader.skip(tag & 7);
1165
+ }
1166
+ return message;
1167
+ },
1168
+ create(base) {
1169
+ return exports.SetGroupRoomsRequest.fromPartial(base ?? {});
1170
+ },
1171
+ fromPartial(object) {
1172
+ const message = createBaseSetGroupRoomsRequest();
1173
+ message.groupId = object.groupId ?? "";
1174
+ message.roomIds = object.roomIds?.map((e) => e) || [];
1175
+ return message;
1176
+ },
1177
+ };
1178
+ function createBaseRoutine() {
1179
+ return { id: 0, name: "", triggers: [], actionsJson: "", reply: "" };
1180
+ }
1181
+ exports.Routine = {
1182
+ encode(message, writer = new wire_1.BinaryWriter()) {
1183
+ if (message.id !== 0) {
1184
+ writer.uint32(8).int32(message.id);
1185
+ }
1186
+ if (message.name !== "") {
1187
+ writer.uint32(18).string(message.name);
1188
+ }
1189
+ for (const v of message.triggers) {
1190
+ writer.uint32(26).string(v);
1191
+ }
1192
+ if (message.actionsJson !== "") {
1193
+ writer.uint32(34).string(message.actionsJson);
1194
+ }
1195
+ if (message.reply !== "") {
1196
+ writer.uint32(42).string(message.reply);
1197
+ }
1198
+ return writer;
1199
+ },
1200
+ decode(input, length) {
1201
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1202
+ const end = length === undefined ? reader.len : reader.pos + length;
1203
+ const message = createBaseRoutine();
1204
+ while (reader.pos < end) {
1205
+ const tag = reader.uint32();
1206
+ switch (tag >>> 3) {
1207
+ case 1: {
1208
+ if (tag !== 8) {
1209
+ break;
1210
+ }
1211
+ message.id = reader.int32();
1212
+ continue;
1213
+ }
1214
+ case 2: {
1215
+ if (tag !== 18) {
1216
+ break;
1217
+ }
1218
+ message.name = reader.string();
1219
+ continue;
1220
+ }
1221
+ case 3: {
1222
+ if (tag !== 26) {
1223
+ break;
1224
+ }
1225
+ message.triggers.push(reader.string());
1226
+ continue;
1227
+ }
1228
+ case 4: {
1229
+ if (tag !== 34) {
1230
+ break;
1231
+ }
1232
+ message.actionsJson = reader.string();
1233
+ continue;
1234
+ }
1235
+ case 5: {
1236
+ if (tag !== 42) {
1237
+ break;
1238
+ }
1239
+ message.reply = reader.string();
1240
+ continue;
1241
+ }
1242
+ }
1243
+ if ((tag & 7) === 4 || tag === 0) {
1244
+ break;
1245
+ }
1246
+ reader.skip(tag & 7);
1247
+ }
1248
+ return message;
1249
+ },
1250
+ create(base) {
1251
+ return exports.Routine.fromPartial(base ?? {});
1252
+ },
1253
+ fromPartial(object) {
1254
+ const message = createBaseRoutine();
1255
+ message.id = object.id ?? 0;
1256
+ message.name = object.name ?? "";
1257
+ message.triggers = object.triggers?.map((e) => e) || [];
1258
+ message.actionsJson = object.actionsJson ?? "";
1259
+ message.reply = object.reply ?? "";
1260
+ return message;
1261
+ },
1262
+ };
1263
+ function createBaseGetRoutinesResponse() {
1264
+ return { routines: [] };
1265
+ }
1266
+ exports.GetRoutinesResponse = {
1267
+ encode(message, writer = new wire_1.BinaryWriter()) {
1268
+ for (const v of message.routines) {
1269
+ exports.Routine.encode(v, writer.uint32(10).fork()).join();
1270
+ }
1271
+ return writer;
1272
+ },
1273
+ decode(input, length) {
1274
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1275
+ const end = length === undefined ? reader.len : reader.pos + length;
1276
+ const message = createBaseGetRoutinesResponse();
1277
+ while (reader.pos < end) {
1278
+ const tag = reader.uint32();
1279
+ switch (tag >>> 3) {
1280
+ case 1: {
1281
+ if (tag !== 10) {
1282
+ break;
1283
+ }
1284
+ message.routines.push(exports.Routine.decode(reader, reader.uint32()));
1285
+ continue;
1286
+ }
1287
+ }
1288
+ if ((tag & 7) === 4 || tag === 0) {
1289
+ break;
1290
+ }
1291
+ reader.skip(tag & 7);
1292
+ }
1293
+ return message;
1294
+ },
1295
+ create(base) {
1296
+ return exports.GetRoutinesResponse.fromPartial(base ?? {});
1297
+ },
1298
+ fromPartial(object) {
1299
+ const message = createBaseGetRoutinesResponse();
1300
+ message.routines = object.routines?.map((e) => exports.Routine.fromPartial(e)) || [];
1301
+ return message;
1302
+ },
1303
+ };
1304
+ function createBaseCreateRoutineRequest() {
1305
+ return { name: "", triggers: [], actionsJson: "", reply: "" };
1306
+ }
1307
+ exports.CreateRoutineRequest = {
1308
+ encode(message, writer = new wire_1.BinaryWriter()) {
1309
+ if (message.name !== "") {
1310
+ writer.uint32(10).string(message.name);
1311
+ }
1312
+ for (const v of message.triggers) {
1313
+ writer.uint32(18).string(v);
1314
+ }
1315
+ if (message.actionsJson !== "") {
1316
+ writer.uint32(26).string(message.actionsJson);
1317
+ }
1318
+ if (message.reply !== "") {
1319
+ writer.uint32(34).string(message.reply);
1320
+ }
1321
+ return writer;
1322
+ },
1323
+ decode(input, length) {
1324
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1325
+ const end = length === undefined ? reader.len : reader.pos + length;
1326
+ const message = createBaseCreateRoutineRequest();
1327
+ while (reader.pos < end) {
1328
+ const tag = reader.uint32();
1329
+ switch (tag >>> 3) {
1330
+ case 1: {
1331
+ if (tag !== 10) {
1332
+ break;
1333
+ }
1334
+ message.name = reader.string();
1335
+ continue;
1336
+ }
1337
+ case 2: {
1338
+ if (tag !== 18) {
1339
+ break;
1340
+ }
1341
+ message.triggers.push(reader.string());
1342
+ continue;
1343
+ }
1344
+ case 3: {
1345
+ if (tag !== 26) {
1346
+ break;
1347
+ }
1348
+ message.actionsJson = reader.string();
1349
+ continue;
1350
+ }
1351
+ case 4: {
1352
+ if (tag !== 34) {
1353
+ break;
1354
+ }
1355
+ message.reply = reader.string();
1356
+ continue;
1357
+ }
1358
+ }
1359
+ if ((tag & 7) === 4 || tag === 0) {
1360
+ break;
1361
+ }
1362
+ reader.skip(tag & 7);
1363
+ }
1364
+ return message;
1365
+ },
1366
+ create(base) {
1367
+ return exports.CreateRoutineRequest.fromPartial(base ?? {});
1368
+ },
1369
+ fromPartial(object) {
1370
+ const message = createBaseCreateRoutineRequest();
1371
+ message.name = object.name ?? "";
1372
+ message.triggers = object.triggers?.map((e) => e) || [];
1373
+ message.actionsJson = object.actionsJson ?? "";
1374
+ message.reply = object.reply ?? "";
1375
+ return message;
1376
+ },
1377
+ };
1378
+ function createBaseCreateRoutineResponse() {
1379
+ return { ok: false, id: 0, message: "" };
1380
+ }
1381
+ exports.CreateRoutineResponse = {
1382
+ encode(message, writer = new wire_1.BinaryWriter()) {
1383
+ if (message.ok !== false) {
1384
+ writer.uint32(8).bool(message.ok);
1385
+ }
1386
+ if (message.id !== 0) {
1387
+ writer.uint32(16).int32(message.id);
1388
+ }
1389
+ if (message.message !== "") {
1390
+ writer.uint32(26).string(message.message);
1391
+ }
1392
+ return writer;
1393
+ },
1394
+ decode(input, length) {
1395
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1396
+ const end = length === undefined ? reader.len : reader.pos + length;
1397
+ const message = createBaseCreateRoutineResponse();
1398
+ while (reader.pos < end) {
1399
+ const tag = reader.uint32();
1400
+ switch (tag >>> 3) {
1401
+ case 1: {
1402
+ if (tag !== 8) {
1403
+ break;
1404
+ }
1405
+ message.ok = reader.bool();
1406
+ continue;
1407
+ }
1408
+ case 2: {
1409
+ if (tag !== 16) {
1410
+ break;
1411
+ }
1412
+ message.id = reader.int32();
1413
+ continue;
1414
+ }
1415
+ case 3: {
1416
+ if (tag !== 26) {
1417
+ break;
1418
+ }
1419
+ message.message = reader.string();
1420
+ continue;
1421
+ }
1422
+ }
1423
+ if ((tag & 7) === 4 || tag === 0) {
1424
+ break;
1425
+ }
1426
+ reader.skip(tag & 7);
1427
+ }
1428
+ return message;
1429
+ },
1430
+ create(base) {
1431
+ return exports.CreateRoutineResponse.fromPartial(base ?? {});
1432
+ },
1433
+ fromPartial(object) {
1434
+ const message = createBaseCreateRoutineResponse();
1435
+ message.ok = object.ok ?? false;
1436
+ message.id = object.id ?? 0;
1437
+ message.message = object.message ?? "";
1438
+ return message;
1439
+ },
1440
+ };
1441
+ function createBaseUpdateRoutineRequest() {
1442
+ return { id: 0, name: "", triggers: [], actionsJson: "", reply: "" };
1443
+ }
1444
+ exports.UpdateRoutineRequest = {
1445
+ encode(message, writer = new wire_1.BinaryWriter()) {
1446
+ if (message.id !== 0) {
1447
+ writer.uint32(8).int32(message.id);
1448
+ }
1449
+ if (message.name !== "") {
1450
+ writer.uint32(18).string(message.name);
1451
+ }
1452
+ for (const v of message.triggers) {
1453
+ writer.uint32(26).string(v);
1454
+ }
1455
+ if (message.actionsJson !== "") {
1456
+ writer.uint32(34).string(message.actionsJson);
1457
+ }
1458
+ if (message.reply !== "") {
1459
+ writer.uint32(42).string(message.reply);
1460
+ }
1461
+ return writer;
1462
+ },
1463
+ decode(input, length) {
1464
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1465
+ const end = length === undefined ? reader.len : reader.pos + length;
1466
+ const message = createBaseUpdateRoutineRequest();
1467
+ while (reader.pos < end) {
1468
+ const tag = reader.uint32();
1469
+ switch (tag >>> 3) {
1470
+ case 1: {
1471
+ if (tag !== 8) {
1472
+ break;
1473
+ }
1474
+ message.id = reader.int32();
1475
+ continue;
1476
+ }
1477
+ case 2: {
1478
+ if (tag !== 18) {
1479
+ break;
1480
+ }
1481
+ message.name = reader.string();
1482
+ continue;
1483
+ }
1484
+ case 3: {
1485
+ if (tag !== 26) {
1486
+ break;
1487
+ }
1488
+ message.triggers.push(reader.string());
1489
+ continue;
1490
+ }
1491
+ case 4: {
1492
+ if (tag !== 34) {
1493
+ break;
1494
+ }
1495
+ message.actionsJson = reader.string();
1496
+ continue;
1497
+ }
1498
+ case 5: {
1499
+ if (tag !== 42) {
1500
+ break;
1501
+ }
1502
+ message.reply = reader.string();
1503
+ continue;
1504
+ }
1505
+ }
1506
+ if ((tag & 7) === 4 || tag === 0) {
1507
+ break;
1508
+ }
1509
+ reader.skip(tag & 7);
1510
+ }
1511
+ return message;
1512
+ },
1513
+ create(base) {
1514
+ return exports.UpdateRoutineRequest.fromPartial(base ?? {});
1515
+ },
1516
+ fromPartial(object) {
1517
+ const message = createBaseUpdateRoutineRequest();
1518
+ message.id = object.id ?? 0;
1519
+ message.name = object.name ?? "";
1520
+ message.triggers = object.triggers?.map((e) => e) || [];
1521
+ message.actionsJson = object.actionsJson ?? "";
1522
+ message.reply = object.reply ?? "";
1523
+ return message;
1524
+ },
1525
+ };
1526
+ function createBaseDeleteRoutineRequest() {
1527
+ return { id: 0 };
1528
+ }
1529
+ exports.DeleteRoutineRequest = {
1530
+ encode(message, writer = new wire_1.BinaryWriter()) {
1531
+ if (message.id !== 0) {
1532
+ writer.uint32(8).int32(message.id);
1533
+ }
1534
+ return writer;
1535
+ },
1536
+ decode(input, length) {
1537
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1538
+ const end = length === undefined ? reader.len : reader.pos + length;
1539
+ const message = createBaseDeleteRoutineRequest();
1540
+ while (reader.pos < end) {
1541
+ const tag = reader.uint32();
1542
+ switch (tag >>> 3) {
1543
+ case 1: {
1544
+ if (tag !== 8) {
1545
+ break;
1546
+ }
1547
+ message.id = reader.int32();
1548
+ continue;
1549
+ }
1550
+ }
1551
+ if ((tag & 7) === 4 || tag === 0) {
1552
+ break;
1553
+ }
1554
+ reader.skip(tag & 7);
1555
+ }
1556
+ return message;
1557
+ },
1558
+ create(base) {
1559
+ return exports.DeleteRoutineRequest.fromPartial(base ?? {});
1560
+ },
1561
+ fromPartial(object) {
1562
+ const message = createBaseDeleteRoutineRequest();
1563
+ message.id = object.id ?? 0;
1564
+ return message;
1565
+ },
1566
+ };
1567
+ function createBaseTrigger() {
1568
+ return {
1569
+ id: "",
1570
+ whenJson: "",
1571
+ cancelWhenJson: "",
1572
+ onResponseJson: "",
1573
+ say: "",
1574
+ ask: "",
1575
+ rephrase: false,
1576
+ room: "",
1577
+ cooldown: 0,
1578
+ delay: "",
1579
+ actionsJson: "",
1580
+ };
1581
+ }
1582
+ exports.Trigger = {
1583
+ encode(message, writer = new wire_1.BinaryWriter()) {
1584
+ if (message.id !== "") {
1585
+ writer.uint32(10).string(message.id);
1586
+ }
1587
+ if (message.whenJson !== "") {
1588
+ writer.uint32(18).string(message.whenJson);
1589
+ }
1590
+ if (message.cancelWhenJson !== "") {
1591
+ writer.uint32(26).string(message.cancelWhenJson);
1592
+ }
1593
+ if (message.onResponseJson !== "") {
1594
+ writer.uint32(34).string(message.onResponseJson);
1595
+ }
1596
+ if (message.say !== "") {
1597
+ writer.uint32(42).string(message.say);
1598
+ }
1599
+ if (message.ask !== "") {
1600
+ writer.uint32(50).string(message.ask);
1601
+ }
1602
+ if (message.rephrase !== false) {
1603
+ writer.uint32(56).bool(message.rephrase);
1604
+ }
1605
+ if (message.room !== "") {
1606
+ writer.uint32(66).string(message.room);
1607
+ }
1608
+ if (message.cooldown !== 0) {
1609
+ writer.uint32(72).int32(message.cooldown);
1610
+ }
1611
+ if (message.delay !== "") {
1612
+ writer.uint32(82).string(message.delay);
1613
+ }
1614
+ if (message.actionsJson !== "") {
1615
+ writer.uint32(90).string(message.actionsJson);
1616
+ }
1617
+ return writer;
1618
+ },
1619
+ decode(input, length) {
1620
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1621
+ const end = length === undefined ? reader.len : reader.pos + length;
1622
+ const message = createBaseTrigger();
1623
+ while (reader.pos < end) {
1624
+ const tag = reader.uint32();
1625
+ switch (tag >>> 3) {
1626
+ case 1: {
1627
+ if (tag !== 10) {
1628
+ break;
1629
+ }
1630
+ message.id = reader.string();
1631
+ continue;
1632
+ }
1633
+ case 2: {
1634
+ if (tag !== 18) {
1635
+ break;
1636
+ }
1637
+ message.whenJson = reader.string();
1638
+ continue;
1639
+ }
1640
+ case 3: {
1641
+ if (tag !== 26) {
1642
+ break;
1643
+ }
1644
+ message.cancelWhenJson = reader.string();
1645
+ continue;
1646
+ }
1647
+ case 4: {
1648
+ if (tag !== 34) {
1649
+ break;
1650
+ }
1651
+ message.onResponseJson = reader.string();
1652
+ continue;
1653
+ }
1654
+ case 5: {
1655
+ if (tag !== 42) {
1656
+ break;
1657
+ }
1658
+ message.say = reader.string();
1659
+ continue;
1660
+ }
1661
+ case 6: {
1662
+ if (tag !== 50) {
1663
+ break;
1664
+ }
1665
+ message.ask = reader.string();
1666
+ continue;
1667
+ }
1668
+ case 7: {
1669
+ if (tag !== 56) {
1670
+ break;
1671
+ }
1672
+ message.rephrase = reader.bool();
1673
+ continue;
1674
+ }
1675
+ case 8: {
1676
+ if (tag !== 66) {
1677
+ break;
1678
+ }
1679
+ message.room = reader.string();
1680
+ continue;
1681
+ }
1682
+ case 9: {
1683
+ if (tag !== 72) {
1684
+ break;
1685
+ }
1686
+ message.cooldown = reader.int32();
1687
+ continue;
1688
+ }
1689
+ case 10: {
1690
+ if (tag !== 82) {
1691
+ break;
1692
+ }
1693
+ message.delay = reader.string();
1694
+ continue;
1695
+ }
1696
+ case 11: {
1697
+ if (tag !== 90) {
1698
+ break;
1699
+ }
1700
+ message.actionsJson = reader.string();
1701
+ continue;
1702
+ }
1703
+ }
1704
+ if ((tag & 7) === 4 || tag === 0) {
1705
+ break;
1706
+ }
1707
+ reader.skip(tag & 7);
1708
+ }
1709
+ return message;
1710
+ },
1711
+ create(base) {
1712
+ return exports.Trigger.fromPartial(base ?? {});
1713
+ },
1714
+ fromPartial(object) {
1715
+ const message = createBaseTrigger();
1716
+ message.id = object.id ?? "";
1717
+ message.whenJson = object.whenJson ?? "";
1718
+ message.cancelWhenJson = object.cancelWhenJson ?? "";
1719
+ message.onResponseJson = object.onResponseJson ?? "";
1720
+ message.say = object.say ?? "";
1721
+ message.ask = object.ask ?? "";
1722
+ message.rephrase = object.rephrase ?? false;
1723
+ message.room = object.room ?? "";
1724
+ message.cooldown = object.cooldown ?? 0;
1725
+ message.delay = object.delay ?? "";
1726
+ message.actionsJson = object.actionsJson ?? "";
1727
+ return message;
1728
+ },
1729
+ };
1730
+ function createBaseGetTriggersResponse() {
1731
+ return { triggers: [] };
1732
+ }
1733
+ exports.GetTriggersResponse = {
1734
+ encode(message, writer = new wire_1.BinaryWriter()) {
1735
+ for (const v of message.triggers) {
1736
+ exports.Trigger.encode(v, writer.uint32(10).fork()).join();
1737
+ }
1738
+ return writer;
1739
+ },
1740
+ decode(input, length) {
1741
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1742
+ const end = length === undefined ? reader.len : reader.pos + length;
1743
+ const message = createBaseGetTriggersResponse();
1744
+ while (reader.pos < end) {
1745
+ const tag = reader.uint32();
1746
+ switch (tag >>> 3) {
1747
+ case 1: {
1748
+ if (tag !== 10) {
1749
+ break;
1750
+ }
1751
+ message.triggers.push(exports.Trigger.decode(reader, reader.uint32()));
1752
+ continue;
1753
+ }
1754
+ }
1755
+ if ((tag & 7) === 4 || tag === 0) {
1756
+ break;
1757
+ }
1758
+ reader.skip(tag & 7);
1759
+ }
1760
+ return message;
1761
+ },
1762
+ create(base) {
1763
+ return exports.GetTriggersResponse.fromPartial(base ?? {});
1764
+ },
1765
+ fromPartial(object) {
1766
+ const message = createBaseGetTriggersResponse();
1767
+ message.triggers = object.triggers?.map((e) => exports.Trigger.fromPartial(e)) || [];
1768
+ return message;
1769
+ },
1770
+ };
1771
+ function createBaseCreateTriggerRequest() {
1772
+ return {
1773
+ id: "",
1774
+ whenJson: "",
1775
+ cancelWhenJson: "",
1776
+ onResponseJson: "",
1777
+ say: "",
1778
+ ask: "",
1779
+ rephrase: false,
1780
+ room: "",
1781
+ cooldown: 0,
1782
+ delay: "",
1783
+ actionsJson: "",
1784
+ };
1785
+ }
1786
+ exports.CreateTriggerRequest = {
1787
+ encode(message, writer = new wire_1.BinaryWriter()) {
1788
+ if (message.id !== "") {
1789
+ writer.uint32(10).string(message.id);
1790
+ }
1791
+ if (message.whenJson !== "") {
1792
+ writer.uint32(18).string(message.whenJson);
1793
+ }
1794
+ if (message.cancelWhenJson !== "") {
1795
+ writer.uint32(26).string(message.cancelWhenJson);
1796
+ }
1797
+ if (message.onResponseJson !== "") {
1798
+ writer.uint32(34).string(message.onResponseJson);
1799
+ }
1800
+ if (message.say !== "") {
1801
+ writer.uint32(42).string(message.say);
1802
+ }
1803
+ if (message.ask !== "") {
1804
+ writer.uint32(50).string(message.ask);
1805
+ }
1806
+ if (message.rephrase !== false) {
1807
+ writer.uint32(56).bool(message.rephrase);
1808
+ }
1809
+ if (message.room !== "") {
1810
+ writer.uint32(66).string(message.room);
1811
+ }
1812
+ if (message.cooldown !== 0) {
1813
+ writer.uint32(72).int32(message.cooldown);
1814
+ }
1815
+ if (message.delay !== "") {
1816
+ writer.uint32(82).string(message.delay);
1817
+ }
1818
+ if (message.actionsJson !== "") {
1819
+ writer.uint32(90).string(message.actionsJson);
1820
+ }
1821
+ return writer;
1822
+ },
1823
+ decode(input, length) {
1824
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1825
+ const end = length === undefined ? reader.len : reader.pos + length;
1826
+ const message = createBaseCreateTriggerRequest();
1827
+ while (reader.pos < end) {
1828
+ const tag = reader.uint32();
1829
+ switch (tag >>> 3) {
1830
+ case 1: {
1831
+ if (tag !== 10) {
1832
+ break;
1833
+ }
1834
+ message.id = reader.string();
1835
+ continue;
1836
+ }
1837
+ case 2: {
1838
+ if (tag !== 18) {
1839
+ break;
1840
+ }
1841
+ message.whenJson = reader.string();
1842
+ continue;
1843
+ }
1844
+ case 3: {
1845
+ if (tag !== 26) {
1846
+ break;
1847
+ }
1848
+ message.cancelWhenJson = reader.string();
1849
+ continue;
1850
+ }
1851
+ case 4: {
1852
+ if (tag !== 34) {
1853
+ break;
1854
+ }
1855
+ message.onResponseJson = reader.string();
1856
+ continue;
1857
+ }
1858
+ case 5: {
1859
+ if (tag !== 42) {
1860
+ break;
1861
+ }
1862
+ message.say = reader.string();
1863
+ continue;
1864
+ }
1865
+ case 6: {
1866
+ if (tag !== 50) {
1867
+ break;
1868
+ }
1869
+ message.ask = reader.string();
1870
+ continue;
1871
+ }
1872
+ case 7: {
1873
+ if (tag !== 56) {
1874
+ break;
1875
+ }
1876
+ message.rephrase = reader.bool();
1877
+ continue;
1878
+ }
1879
+ case 8: {
1880
+ if (tag !== 66) {
1881
+ break;
1882
+ }
1883
+ message.room = reader.string();
1884
+ continue;
1885
+ }
1886
+ case 9: {
1887
+ if (tag !== 72) {
1888
+ break;
1889
+ }
1890
+ message.cooldown = reader.int32();
1891
+ continue;
1892
+ }
1893
+ case 10: {
1894
+ if (tag !== 82) {
1895
+ break;
1896
+ }
1897
+ message.delay = reader.string();
1898
+ continue;
1899
+ }
1900
+ case 11: {
1901
+ if (tag !== 90) {
1902
+ break;
1903
+ }
1904
+ message.actionsJson = reader.string();
1905
+ continue;
1906
+ }
1907
+ }
1908
+ if ((tag & 7) === 4 || tag === 0) {
1909
+ break;
1910
+ }
1911
+ reader.skip(tag & 7);
1912
+ }
1913
+ return message;
1914
+ },
1915
+ create(base) {
1916
+ return exports.CreateTriggerRequest.fromPartial(base ?? {});
1917
+ },
1918
+ fromPartial(object) {
1919
+ const message = createBaseCreateTriggerRequest();
1920
+ message.id = object.id ?? "";
1921
+ message.whenJson = object.whenJson ?? "";
1922
+ message.cancelWhenJson = object.cancelWhenJson ?? "";
1923
+ message.onResponseJson = object.onResponseJson ?? "";
1924
+ message.say = object.say ?? "";
1925
+ message.ask = object.ask ?? "";
1926
+ message.rephrase = object.rephrase ?? false;
1927
+ message.room = object.room ?? "";
1928
+ message.cooldown = object.cooldown ?? 0;
1929
+ message.delay = object.delay ?? "";
1930
+ message.actionsJson = object.actionsJson ?? "";
1931
+ return message;
1932
+ },
1933
+ };
1934
+ function createBaseUpdateTriggerRequest() {
1935
+ return {
1936
+ id: "",
1937
+ whenJson: "",
1938
+ cancelWhenJson: "",
1939
+ onResponseJson: "",
1940
+ say: "",
1941
+ ask: "",
1942
+ rephrase: false,
1943
+ room: "",
1944
+ cooldown: 0,
1945
+ delay: "",
1946
+ actionsJson: "",
1947
+ };
1948
+ }
1949
+ exports.UpdateTriggerRequest = {
1950
+ encode(message, writer = new wire_1.BinaryWriter()) {
1951
+ if (message.id !== "") {
1952
+ writer.uint32(10).string(message.id);
1953
+ }
1954
+ if (message.whenJson !== "") {
1955
+ writer.uint32(18).string(message.whenJson);
1956
+ }
1957
+ if (message.cancelWhenJson !== "") {
1958
+ writer.uint32(26).string(message.cancelWhenJson);
1959
+ }
1960
+ if (message.onResponseJson !== "") {
1961
+ writer.uint32(34).string(message.onResponseJson);
1962
+ }
1963
+ if (message.say !== "") {
1964
+ writer.uint32(42).string(message.say);
1965
+ }
1966
+ if (message.ask !== "") {
1967
+ writer.uint32(50).string(message.ask);
1968
+ }
1969
+ if (message.rephrase !== false) {
1970
+ writer.uint32(56).bool(message.rephrase);
1971
+ }
1972
+ if (message.room !== "") {
1973
+ writer.uint32(66).string(message.room);
1974
+ }
1975
+ if (message.cooldown !== 0) {
1976
+ writer.uint32(72).int32(message.cooldown);
1977
+ }
1978
+ if (message.delay !== "") {
1979
+ writer.uint32(82).string(message.delay);
1980
+ }
1981
+ if (message.actionsJson !== "") {
1982
+ writer.uint32(90).string(message.actionsJson);
1983
+ }
1984
+ return writer;
1985
+ },
1986
+ decode(input, length) {
1987
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1988
+ const end = length === undefined ? reader.len : reader.pos + length;
1989
+ const message = createBaseUpdateTriggerRequest();
1990
+ while (reader.pos < end) {
1991
+ const tag = reader.uint32();
1992
+ switch (tag >>> 3) {
1993
+ case 1: {
1994
+ if (tag !== 10) {
1995
+ break;
1996
+ }
1997
+ message.id = reader.string();
1998
+ continue;
1999
+ }
2000
+ case 2: {
2001
+ if (tag !== 18) {
2002
+ break;
2003
+ }
2004
+ message.whenJson = reader.string();
2005
+ continue;
2006
+ }
2007
+ case 3: {
2008
+ if (tag !== 26) {
2009
+ break;
2010
+ }
2011
+ message.cancelWhenJson = reader.string();
2012
+ continue;
2013
+ }
2014
+ case 4: {
2015
+ if (tag !== 34) {
2016
+ break;
2017
+ }
2018
+ message.onResponseJson = reader.string();
2019
+ continue;
2020
+ }
2021
+ case 5: {
2022
+ if (tag !== 42) {
2023
+ break;
2024
+ }
2025
+ message.say = reader.string();
2026
+ continue;
2027
+ }
2028
+ case 6: {
2029
+ if (tag !== 50) {
2030
+ break;
2031
+ }
2032
+ message.ask = reader.string();
2033
+ continue;
2034
+ }
2035
+ case 7: {
2036
+ if (tag !== 56) {
2037
+ break;
2038
+ }
2039
+ message.rephrase = reader.bool();
2040
+ continue;
2041
+ }
2042
+ case 8: {
2043
+ if (tag !== 66) {
2044
+ break;
2045
+ }
2046
+ message.room = reader.string();
2047
+ continue;
2048
+ }
2049
+ case 9: {
2050
+ if (tag !== 72) {
2051
+ break;
2052
+ }
2053
+ message.cooldown = reader.int32();
2054
+ continue;
2055
+ }
2056
+ case 10: {
2057
+ if (tag !== 82) {
2058
+ break;
2059
+ }
2060
+ message.delay = reader.string();
2061
+ continue;
2062
+ }
2063
+ case 11: {
2064
+ if (tag !== 90) {
2065
+ break;
2066
+ }
2067
+ message.actionsJson = reader.string();
2068
+ continue;
2069
+ }
2070
+ }
2071
+ if ((tag & 7) === 4 || tag === 0) {
2072
+ break;
2073
+ }
2074
+ reader.skip(tag & 7);
2075
+ }
2076
+ return message;
2077
+ },
2078
+ create(base) {
2079
+ return exports.UpdateTriggerRequest.fromPartial(base ?? {});
2080
+ },
2081
+ fromPartial(object) {
2082
+ const message = createBaseUpdateTriggerRequest();
2083
+ message.id = object.id ?? "";
2084
+ message.whenJson = object.whenJson ?? "";
2085
+ message.cancelWhenJson = object.cancelWhenJson ?? "";
2086
+ message.onResponseJson = object.onResponseJson ?? "";
2087
+ message.say = object.say ?? "";
2088
+ message.ask = object.ask ?? "";
2089
+ message.rephrase = object.rephrase ?? false;
2090
+ message.room = object.room ?? "";
2091
+ message.cooldown = object.cooldown ?? 0;
2092
+ message.delay = object.delay ?? "";
2093
+ message.actionsJson = object.actionsJson ?? "";
2094
+ return message;
2095
+ },
2096
+ };
2097
+ function createBaseDeleteTriggerRequest() {
2098
+ return { id: "" };
2099
+ }
2100
+ exports.DeleteTriggerRequest = {
2101
+ encode(message, writer = new wire_1.BinaryWriter()) {
2102
+ if (message.id !== "") {
2103
+ writer.uint32(10).string(message.id);
2104
+ }
2105
+ return writer;
2106
+ },
2107
+ decode(input, length) {
2108
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2109
+ const end = length === undefined ? reader.len : reader.pos + length;
2110
+ const message = createBaseDeleteTriggerRequest();
2111
+ while (reader.pos < end) {
2112
+ const tag = reader.uint32();
2113
+ switch (tag >>> 3) {
2114
+ case 1: {
2115
+ if (tag !== 10) {
2116
+ break;
2117
+ }
2118
+ message.id = reader.string();
2119
+ continue;
2120
+ }
2121
+ }
2122
+ if ((tag & 7) === 4 || tag === 0) {
2123
+ break;
2124
+ }
2125
+ reader.skip(tag & 7);
2126
+ }
2127
+ return message;
2128
+ },
2129
+ create(base) {
2130
+ return exports.DeleteTriggerRequest.fromPartial(base ?? {});
2131
+ },
2132
+ fromPartial(object) {
2133
+ const message = createBaseDeleteTriggerRequest();
2134
+ message.id = object.id ?? "";
2135
+ return message;
2136
+ },
2137
+ };
2138
+ function createBaseAlarm() {
2139
+ return {
2140
+ id: 0,
2141
+ satelliteId: "",
2142
+ time: "",
2143
+ weekdays: [],
2144
+ skipDates: [],
2145
+ oneShotDate: "",
2146
+ enabled: false,
2147
+ label: "",
2148
+ userId: 0,
2149
+ };
2150
+ }
2151
+ exports.Alarm = {
2152
+ encode(message, writer = new wire_1.BinaryWriter()) {
2153
+ if (message.id !== 0) {
2154
+ writer.uint32(8).int32(message.id);
2155
+ }
2156
+ if (message.satelliteId !== "") {
2157
+ writer.uint32(18).string(message.satelliteId);
2158
+ }
2159
+ if (message.time !== "") {
2160
+ writer.uint32(26).string(message.time);
2161
+ }
2162
+ writer.uint32(34).fork();
2163
+ for (const v of message.weekdays) {
2164
+ writer.int32(v);
2165
+ }
2166
+ writer.join();
2167
+ for (const v of message.skipDates) {
2168
+ writer.uint32(42).string(v);
2169
+ }
2170
+ if (message.oneShotDate !== "") {
2171
+ writer.uint32(50).string(message.oneShotDate);
2172
+ }
2173
+ if (message.enabled !== false) {
2174
+ writer.uint32(56).bool(message.enabled);
2175
+ }
2176
+ if (message.label !== "") {
2177
+ writer.uint32(66).string(message.label);
2178
+ }
2179
+ if (message.userId !== 0) {
2180
+ writer.uint32(72).int32(message.userId);
2181
+ }
2182
+ return writer;
2183
+ },
2184
+ decode(input, length) {
2185
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2186
+ const end = length === undefined ? reader.len : reader.pos + length;
2187
+ const message = createBaseAlarm();
2188
+ while (reader.pos < end) {
2189
+ const tag = reader.uint32();
2190
+ switch (tag >>> 3) {
2191
+ case 1: {
2192
+ if (tag !== 8) {
2193
+ break;
2194
+ }
2195
+ message.id = reader.int32();
2196
+ continue;
2197
+ }
2198
+ case 2: {
2199
+ if (tag !== 18) {
2200
+ break;
2201
+ }
2202
+ message.satelliteId = reader.string();
2203
+ continue;
2204
+ }
2205
+ case 3: {
2206
+ if (tag !== 26) {
2207
+ break;
2208
+ }
2209
+ message.time = reader.string();
2210
+ continue;
2211
+ }
2212
+ case 4: {
2213
+ if (tag === 32) {
2214
+ message.weekdays.push(reader.int32());
2215
+ continue;
2216
+ }
2217
+ if (tag === 34) {
2218
+ const end2 = reader.uint32() + reader.pos;
2219
+ while (reader.pos < end2) {
2220
+ message.weekdays.push(reader.int32());
2221
+ }
2222
+ continue;
2223
+ }
2224
+ break;
2225
+ }
2226
+ case 5: {
2227
+ if (tag !== 42) {
2228
+ break;
2229
+ }
2230
+ message.skipDates.push(reader.string());
2231
+ continue;
2232
+ }
2233
+ case 6: {
2234
+ if (tag !== 50) {
2235
+ break;
2236
+ }
2237
+ message.oneShotDate = reader.string();
2238
+ continue;
2239
+ }
2240
+ case 7: {
2241
+ if (tag !== 56) {
2242
+ break;
2243
+ }
2244
+ message.enabled = reader.bool();
2245
+ continue;
2246
+ }
2247
+ case 8: {
2248
+ if (tag !== 66) {
2249
+ break;
2250
+ }
2251
+ message.label = reader.string();
2252
+ continue;
2253
+ }
2254
+ case 9: {
2255
+ if (tag !== 72) {
2256
+ break;
2257
+ }
2258
+ message.userId = reader.int32();
2259
+ continue;
2260
+ }
2261
+ }
2262
+ if ((tag & 7) === 4 || tag === 0) {
2263
+ break;
2264
+ }
2265
+ reader.skip(tag & 7);
2266
+ }
2267
+ return message;
2268
+ },
2269
+ create(base) {
2270
+ return exports.Alarm.fromPartial(base ?? {});
2271
+ },
2272
+ fromPartial(object) {
2273
+ const message = createBaseAlarm();
2274
+ message.id = object.id ?? 0;
2275
+ message.satelliteId = object.satelliteId ?? "";
2276
+ message.time = object.time ?? "";
2277
+ message.weekdays = object.weekdays?.map((e) => e) || [];
2278
+ message.skipDates = object.skipDates?.map((e) => e) || [];
2279
+ message.oneShotDate = object.oneShotDate ?? "";
2280
+ message.enabled = object.enabled ?? false;
2281
+ message.label = object.label ?? "";
2282
+ message.userId = object.userId ?? 0;
2283
+ return message;
2284
+ },
2285
+ };
2286
+ function createBaseGetAlarmsResponse() {
2287
+ return { alarms: [] };
2288
+ }
2289
+ exports.GetAlarmsResponse = {
2290
+ encode(message, writer = new wire_1.BinaryWriter()) {
2291
+ for (const v of message.alarms) {
2292
+ exports.Alarm.encode(v, writer.uint32(10).fork()).join();
2293
+ }
2294
+ return writer;
2295
+ },
2296
+ decode(input, length) {
2297
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2298
+ const end = length === undefined ? reader.len : reader.pos + length;
2299
+ const message = createBaseGetAlarmsResponse();
2300
+ while (reader.pos < end) {
2301
+ const tag = reader.uint32();
2302
+ switch (tag >>> 3) {
2303
+ case 1: {
2304
+ if (tag !== 10) {
2305
+ break;
2306
+ }
2307
+ message.alarms.push(exports.Alarm.decode(reader, reader.uint32()));
2308
+ continue;
2309
+ }
2310
+ }
2311
+ if ((tag & 7) === 4 || tag === 0) {
2312
+ break;
2313
+ }
2314
+ reader.skip(tag & 7);
2315
+ }
2316
+ return message;
2317
+ },
2318
+ create(base) {
2319
+ return exports.GetAlarmsResponse.fromPartial(base ?? {});
2320
+ },
2321
+ fromPartial(object) {
2322
+ const message = createBaseGetAlarmsResponse();
2323
+ message.alarms = object.alarms?.map((e) => exports.Alarm.fromPartial(e)) || [];
2324
+ return message;
2325
+ },
2326
+ };
2327
+ function createBaseCreateAlarmRequest() {
2328
+ return { satelliteId: "", time: "", weekdays: [], oneShotDate: "", label: "", userId: 0 };
2329
+ }
2330
+ exports.CreateAlarmRequest = {
2331
+ encode(message, writer = new wire_1.BinaryWriter()) {
2332
+ if (message.satelliteId !== "") {
2333
+ writer.uint32(10).string(message.satelliteId);
2334
+ }
2335
+ if (message.time !== "") {
2336
+ writer.uint32(18).string(message.time);
2337
+ }
2338
+ writer.uint32(26).fork();
2339
+ for (const v of message.weekdays) {
2340
+ writer.int32(v);
2341
+ }
2342
+ writer.join();
2343
+ if (message.oneShotDate !== "") {
2344
+ writer.uint32(34).string(message.oneShotDate);
2345
+ }
2346
+ if (message.label !== "") {
2347
+ writer.uint32(42).string(message.label);
2348
+ }
2349
+ if (message.userId !== 0) {
2350
+ writer.uint32(48).int32(message.userId);
2351
+ }
2352
+ return writer;
2353
+ },
2354
+ decode(input, length) {
2355
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2356
+ const end = length === undefined ? reader.len : reader.pos + length;
2357
+ const message = createBaseCreateAlarmRequest();
2358
+ while (reader.pos < end) {
2359
+ const tag = reader.uint32();
2360
+ switch (tag >>> 3) {
2361
+ case 1: {
2362
+ if (tag !== 10) {
2363
+ break;
2364
+ }
2365
+ message.satelliteId = reader.string();
2366
+ continue;
2367
+ }
2368
+ case 2: {
2369
+ if (tag !== 18) {
2370
+ break;
2371
+ }
2372
+ message.time = reader.string();
2373
+ continue;
2374
+ }
2375
+ case 3: {
2376
+ if (tag === 24) {
2377
+ message.weekdays.push(reader.int32());
2378
+ continue;
2379
+ }
2380
+ if (tag === 26) {
2381
+ const end2 = reader.uint32() + reader.pos;
2382
+ while (reader.pos < end2) {
2383
+ message.weekdays.push(reader.int32());
2384
+ }
2385
+ continue;
2386
+ }
2387
+ break;
2388
+ }
2389
+ case 4: {
2390
+ if (tag !== 34) {
2391
+ break;
2392
+ }
2393
+ message.oneShotDate = reader.string();
2394
+ continue;
2395
+ }
2396
+ case 5: {
2397
+ if (tag !== 42) {
2398
+ break;
2399
+ }
2400
+ message.label = reader.string();
2401
+ continue;
2402
+ }
2403
+ case 6: {
2404
+ if (tag !== 48) {
2405
+ break;
2406
+ }
2407
+ message.userId = reader.int32();
2408
+ continue;
2409
+ }
2410
+ }
2411
+ if ((tag & 7) === 4 || tag === 0) {
2412
+ break;
2413
+ }
2414
+ reader.skip(tag & 7);
2415
+ }
2416
+ return message;
2417
+ },
2418
+ create(base) {
2419
+ return exports.CreateAlarmRequest.fromPartial(base ?? {});
2420
+ },
2421
+ fromPartial(object) {
2422
+ const message = createBaseCreateAlarmRequest();
2423
+ message.satelliteId = object.satelliteId ?? "";
2424
+ message.time = object.time ?? "";
2425
+ message.weekdays = object.weekdays?.map((e) => e) || [];
2426
+ message.oneShotDate = object.oneShotDate ?? "";
2427
+ message.label = object.label ?? "";
2428
+ message.userId = object.userId ?? 0;
2429
+ return message;
2430
+ },
2431
+ };
2432
+ function createBaseCreateAlarmResponse() {
2433
+ return { ok: false, id: 0, message: "" };
2434
+ }
2435
+ exports.CreateAlarmResponse = {
2436
+ encode(message, writer = new wire_1.BinaryWriter()) {
2437
+ if (message.ok !== false) {
2438
+ writer.uint32(8).bool(message.ok);
2439
+ }
2440
+ if (message.id !== 0) {
2441
+ writer.uint32(16).int32(message.id);
2442
+ }
2443
+ if (message.message !== "") {
2444
+ writer.uint32(26).string(message.message);
2445
+ }
2446
+ return writer;
2447
+ },
2448
+ decode(input, length) {
2449
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2450
+ const end = length === undefined ? reader.len : reader.pos + length;
2451
+ const message = createBaseCreateAlarmResponse();
2452
+ while (reader.pos < end) {
2453
+ const tag = reader.uint32();
2454
+ switch (tag >>> 3) {
2455
+ case 1: {
2456
+ if (tag !== 8) {
2457
+ break;
2458
+ }
2459
+ message.ok = reader.bool();
2460
+ continue;
2461
+ }
2462
+ case 2: {
2463
+ if (tag !== 16) {
2464
+ break;
2465
+ }
2466
+ message.id = reader.int32();
2467
+ continue;
2468
+ }
2469
+ case 3: {
2470
+ if (tag !== 26) {
2471
+ break;
2472
+ }
2473
+ message.message = reader.string();
2474
+ continue;
2475
+ }
2476
+ }
2477
+ if ((tag & 7) === 4 || tag === 0) {
2478
+ break;
2479
+ }
2480
+ reader.skip(tag & 7);
2481
+ }
2482
+ return message;
2483
+ },
2484
+ create(base) {
2485
+ return exports.CreateAlarmResponse.fromPartial(base ?? {});
2486
+ },
2487
+ fromPartial(object) {
2488
+ const message = createBaseCreateAlarmResponse();
2489
+ message.ok = object.ok ?? false;
2490
+ message.id = object.id ?? 0;
2491
+ message.message = object.message ?? "";
2492
+ return message;
2493
+ },
2494
+ };
2495
+ function createBaseUpdateAlarmRequest() {
2496
+ return { id: 0, satelliteId: "", time: "", weekdays: [], skipDates: [], oneShotDate: "", enabled: false, label: "" };
2497
+ }
2498
+ exports.UpdateAlarmRequest = {
2499
+ encode(message, writer = new wire_1.BinaryWriter()) {
2500
+ if (message.id !== 0) {
2501
+ writer.uint32(8).int32(message.id);
2502
+ }
2503
+ if (message.satelliteId !== "") {
2504
+ writer.uint32(18).string(message.satelliteId);
2505
+ }
2506
+ if (message.time !== "") {
2507
+ writer.uint32(26).string(message.time);
2508
+ }
2509
+ writer.uint32(34).fork();
2510
+ for (const v of message.weekdays) {
2511
+ writer.int32(v);
2512
+ }
2513
+ writer.join();
2514
+ for (const v of message.skipDates) {
2515
+ writer.uint32(42).string(v);
2516
+ }
2517
+ if (message.oneShotDate !== "") {
2518
+ writer.uint32(50).string(message.oneShotDate);
2519
+ }
2520
+ if (message.enabled !== false) {
2521
+ writer.uint32(56).bool(message.enabled);
2522
+ }
2523
+ if (message.label !== "") {
2524
+ writer.uint32(66).string(message.label);
2525
+ }
2526
+ return writer;
2527
+ },
2528
+ decode(input, length) {
2529
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2530
+ const end = length === undefined ? reader.len : reader.pos + length;
2531
+ const message = createBaseUpdateAlarmRequest();
2532
+ while (reader.pos < end) {
2533
+ const tag = reader.uint32();
2534
+ switch (tag >>> 3) {
2535
+ case 1: {
2536
+ if (tag !== 8) {
2537
+ break;
2538
+ }
2539
+ message.id = reader.int32();
2540
+ continue;
2541
+ }
2542
+ case 2: {
2543
+ if (tag !== 18) {
2544
+ break;
2545
+ }
2546
+ message.satelliteId = reader.string();
2547
+ continue;
2548
+ }
2549
+ case 3: {
2550
+ if (tag !== 26) {
2551
+ break;
2552
+ }
2553
+ message.time = reader.string();
2554
+ continue;
2555
+ }
2556
+ case 4: {
2557
+ if (tag === 32) {
2558
+ message.weekdays.push(reader.int32());
2559
+ continue;
2560
+ }
2561
+ if (tag === 34) {
2562
+ const end2 = reader.uint32() + reader.pos;
2563
+ while (reader.pos < end2) {
2564
+ message.weekdays.push(reader.int32());
2565
+ }
2566
+ continue;
2567
+ }
2568
+ break;
2569
+ }
2570
+ case 5: {
2571
+ if (tag !== 42) {
2572
+ break;
2573
+ }
2574
+ message.skipDates.push(reader.string());
2575
+ continue;
2576
+ }
2577
+ case 6: {
2578
+ if (tag !== 50) {
2579
+ break;
2580
+ }
2581
+ message.oneShotDate = reader.string();
2582
+ continue;
2583
+ }
2584
+ case 7: {
2585
+ if (tag !== 56) {
2586
+ break;
2587
+ }
2588
+ message.enabled = reader.bool();
2589
+ continue;
2590
+ }
2591
+ case 8: {
2592
+ if (tag !== 66) {
2593
+ break;
2594
+ }
2595
+ message.label = reader.string();
2596
+ continue;
2597
+ }
2598
+ }
2599
+ if ((tag & 7) === 4 || tag === 0) {
2600
+ break;
2601
+ }
2602
+ reader.skip(tag & 7);
2603
+ }
2604
+ return message;
2605
+ },
2606
+ create(base) {
2607
+ return exports.UpdateAlarmRequest.fromPartial(base ?? {});
2608
+ },
2609
+ fromPartial(object) {
2610
+ const message = createBaseUpdateAlarmRequest();
2611
+ message.id = object.id ?? 0;
2612
+ message.satelliteId = object.satelliteId ?? "";
2613
+ message.time = object.time ?? "";
2614
+ message.weekdays = object.weekdays?.map((e) => e) || [];
2615
+ message.skipDates = object.skipDates?.map((e) => e) || [];
2616
+ message.oneShotDate = object.oneShotDate ?? "";
2617
+ message.enabled = object.enabled ?? false;
2618
+ message.label = object.label ?? "";
2619
+ return message;
2620
+ },
2621
+ };
2622
+ function createBaseDeleteAlarmRequest() {
2623
+ return { id: 0 };
2624
+ }
2625
+ exports.DeleteAlarmRequest = {
2626
+ encode(message, writer = new wire_1.BinaryWriter()) {
2627
+ if (message.id !== 0) {
2628
+ writer.uint32(8).int32(message.id);
2629
+ }
2630
+ return writer;
2631
+ },
2632
+ decode(input, length) {
2633
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2634
+ const end = length === undefined ? reader.len : reader.pos + length;
2635
+ const message = createBaseDeleteAlarmRequest();
2636
+ while (reader.pos < end) {
2637
+ const tag = reader.uint32();
2638
+ switch (tag >>> 3) {
2639
+ case 1: {
2640
+ if (tag !== 8) {
2641
+ break;
2642
+ }
2643
+ message.id = reader.int32();
2644
+ continue;
2645
+ }
2646
+ }
2647
+ if ((tag & 7) === 4 || tag === 0) {
2648
+ break;
2649
+ }
2650
+ reader.skip(tag & 7);
2651
+ }
2652
+ return message;
2653
+ },
2654
+ create(base) {
2655
+ return exports.DeleteAlarmRequest.fromPartial(base ?? {});
2656
+ },
2657
+ fromPartial(object) {
2658
+ const message = createBaseDeleteAlarmRequest();
2659
+ message.id = object.id ?? 0;
2660
+ return message;
2661
+ },
2662
+ };
2663
+ function createBaseCategory() {
2664
+ return { id: 0, name: "", parentId: 0 };
2665
+ }
2666
+ exports.Category = {
2667
+ encode(message, writer = new wire_1.BinaryWriter()) {
2668
+ if (message.id !== 0) {
2669
+ writer.uint32(8).int32(message.id);
2670
+ }
2671
+ if (message.name !== "") {
2672
+ writer.uint32(18).string(message.name);
2673
+ }
2674
+ if (message.parentId !== 0) {
2675
+ writer.uint32(24).int32(message.parentId);
2676
+ }
2677
+ return writer;
2678
+ },
2679
+ decode(input, length) {
2680
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2681
+ const end = length === undefined ? reader.len : reader.pos + length;
2682
+ const message = createBaseCategory();
2683
+ while (reader.pos < end) {
2684
+ const tag = reader.uint32();
2685
+ switch (tag >>> 3) {
2686
+ case 1: {
2687
+ if (tag !== 8) {
2688
+ break;
2689
+ }
2690
+ message.id = reader.int32();
2691
+ continue;
2692
+ }
2693
+ case 2: {
2694
+ if (tag !== 18) {
2695
+ break;
2696
+ }
2697
+ message.name = reader.string();
2698
+ continue;
2699
+ }
2700
+ case 3: {
2701
+ if (tag !== 24) {
2702
+ break;
2703
+ }
2704
+ message.parentId = reader.int32();
2705
+ continue;
2706
+ }
2707
+ }
2708
+ if ((tag & 7) === 4 || tag === 0) {
2709
+ break;
2710
+ }
2711
+ reader.skip(tag & 7);
2712
+ }
2713
+ return message;
2714
+ },
2715
+ create(base) {
2716
+ return exports.Category.fromPartial(base ?? {});
2717
+ },
2718
+ fromPartial(object) {
2719
+ const message = createBaseCategory();
2720
+ message.id = object.id ?? 0;
2721
+ message.name = object.name ?? "";
2722
+ message.parentId = object.parentId ?? 0;
2723
+ return message;
2724
+ },
2725
+ };
2726
+ function createBaseSetting() {
2727
+ return { id: 0, categoryId: 0, name: "", value: "" };
2728
+ }
2729
+ exports.Setting = {
2730
+ encode(message, writer = new wire_1.BinaryWriter()) {
2731
+ if (message.id !== 0) {
2732
+ writer.uint32(8).int32(message.id);
2733
+ }
2734
+ if (message.categoryId !== 0) {
2735
+ writer.uint32(16).int32(message.categoryId);
2736
+ }
2737
+ if (message.name !== "") {
2738
+ writer.uint32(26).string(message.name);
2739
+ }
2740
+ if (message.value !== "") {
2741
+ writer.uint32(34).string(message.value);
2742
+ }
2743
+ return writer;
2744
+ },
2745
+ decode(input, length) {
2746
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2747
+ const end = length === undefined ? reader.len : reader.pos + length;
2748
+ const message = createBaseSetting();
2749
+ while (reader.pos < end) {
2750
+ const tag = reader.uint32();
2751
+ switch (tag >>> 3) {
2752
+ case 1: {
2753
+ if (tag !== 8) {
2754
+ break;
2755
+ }
2756
+ message.id = reader.int32();
2757
+ continue;
2758
+ }
2759
+ case 2: {
2760
+ if (tag !== 16) {
2761
+ break;
2762
+ }
2763
+ message.categoryId = reader.int32();
2764
+ continue;
2765
+ }
2766
+ case 3: {
2767
+ if (tag !== 26) {
2768
+ break;
2769
+ }
2770
+ message.name = reader.string();
2771
+ continue;
2772
+ }
2773
+ case 4: {
2774
+ if (tag !== 34) {
2775
+ break;
2776
+ }
2777
+ message.value = reader.string();
2778
+ continue;
2779
+ }
2780
+ }
2781
+ if ((tag & 7) === 4 || tag === 0) {
2782
+ break;
2783
+ }
2784
+ reader.skip(tag & 7);
2785
+ }
2786
+ return message;
2787
+ },
2788
+ create(base) {
2789
+ return exports.Setting.fromPartial(base ?? {});
2790
+ },
2791
+ fromPartial(object) {
2792
+ const message = createBaseSetting();
2793
+ message.id = object.id ?? 0;
2794
+ message.categoryId = object.categoryId ?? 0;
2795
+ message.name = object.name ?? "";
2796
+ message.value = object.value ?? "";
2797
+ return message;
2798
+ },
2799
+ };
2800
+ function createBaseGetSettingsResponse() {
2801
+ return { categories: [], settings: [] };
2802
+ }
2803
+ exports.GetSettingsResponse = {
2804
+ encode(message, writer = new wire_1.BinaryWriter()) {
2805
+ for (const v of message.categories) {
2806
+ exports.Category.encode(v, writer.uint32(10).fork()).join();
2807
+ }
2808
+ for (const v of message.settings) {
2809
+ exports.Setting.encode(v, writer.uint32(18).fork()).join();
2810
+ }
2811
+ return writer;
2812
+ },
2813
+ decode(input, length) {
2814
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2815
+ const end = length === undefined ? reader.len : reader.pos + length;
2816
+ const message = createBaseGetSettingsResponse();
2817
+ while (reader.pos < end) {
2818
+ const tag = reader.uint32();
2819
+ switch (tag >>> 3) {
2820
+ case 1: {
2821
+ if (tag !== 10) {
2822
+ break;
2823
+ }
2824
+ message.categories.push(exports.Category.decode(reader, reader.uint32()));
2825
+ continue;
2826
+ }
2827
+ case 2: {
2828
+ if (tag !== 18) {
2829
+ break;
2830
+ }
2831
+ message.settings.push(exports.Setting.decode(reader, reader.uint32()));
2832
+ continue;
2833
+ }
2834
+ }
2835
+ if ((tag & 7) === 4 || tag === 0) {
2836
+ break;
2837
+ }
2838
+ reader.skip(tag & 7);
2839
+ }
2840
+ return message;
2841
+ },
2842
+ create(base) {
2843
+ return exports.GetSettingsResponse.fromPartial(base ?? {});
2844
+ },
2845
+ fromPartial(object) {
2846
+ const message = createBaseGetSettingsResponse();
2847
+ message.categories = object.categories?.map((e) => exports.Category.fromPartial(e)) || [];
2848
+ message.settings = object.settings?.map((e) => exports.Setting.fromPartial(e)) || [];
2849
+ return message;
2850
+ },
2851
+ };
2852
+ function createBaseSettingUpdate() {
2853
+ return { settingId: 0, value: "" };
2854
+ }
2855
+ exports.SettingUpdate = {
2856
+ encode(message, writer = new wire_1.BinaryWriter()) {
2857
+ if (message.settingId !== 0) {
2858
+ writer.uint32(8).int32(message.settingId);
2859
+ }
2860
+ if (message.value !== "") {
2861
+ writer.uint32(18).string(message.value);
2862
+ }
2863
+ return writer;
2864
+ },
2865
+ decode(input, length) {
2866
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2867
+ const end = length === undefined ? reader.len : reader.pos + length;
2868
+ const message = createBaseSettingUpdate();
2869
+ while (reader.pos < end) {
2870
+ const tag = reader.uint32();
2871
+ switch (tag >>> 3) {
2872
+ case 1: {
2873
+ if (tag !== 8) {
2874
+ break;
2875
+ }
2876
+ message.settingId = reader.int32();
2877
+ continue;
2878
+ }
2879
+ case 2: {
2880
+ if (tag !== 18) {
2881
+ break;
2882
+ }
2883
+ message.value = reader.string();
2884
+ continue;
2885
+ }
2886
+ }
2887
+ if ((tag & 7) === 4 || tag === 0) {
2888
+ break;
2889
+ }
2890
+ reader.skip(tag & 7);
2891
+ }
2892
+ return message;
2893
+ },
2894
+ create(base) {
2895
+ return exports.SettingUpdate.fromPartial(base ?? {});
2896
+ },
2897
+ fromPartial(object) {
2898
+ const message = createBaseSettingUpdate();
2899
+ message.settingId = object.settingId ?? 0;
2900
+ message.value = object.value ?? "";
2901
+ return message;
2902
+ },
2903
+ };
2904
+ function createBaseUpdateConfigRequest() {
2905
+ return { updates: [] };
2906
+ }
2907
+ exports.UpdateConfigRequest = {
2908
+ encode(message, writer = new wire_1.BinaryWriter()) {
2909
+ for (const v of message.updates) {
2910
+ exports.SettingUpdate.encode(v, writer.uint32(10).fork()).join();
2911
+ }
2912
+ return writer;
2913
+ },
2914
+ decode(input, length) {
2915
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2916
+ const end = length === undefined ? reader.len : reader.pos + length;
2917
+ const message = createBaseUpdateConfigRequest();
2918
+ while (reader.pos < end) {
2919
+ const tag = reader.uint32();
2920
+ switch (tag >>> 3) {
2921
+ case 1: {
2922
+ if (tag !== 10) {
2923
+ break;
2924
+ }
2925
+ message.updates.push(exports.SettingUpdate.decode(reader, reader.uint32()));
2926
+ continue;
2927
+ }
2928
+ }
2929
+ if ((tag & 7) === 4 || tag === 0) {
2930
+ break;
2931
+ }
2932
+ reader.skip(tag & 7);
2933
+ }
2934
+ return message;
2935
+ },
2936
+ create(base) {
2937
+ return exports.UpdateConfigRequest.fromPartial(base ?? {});
2938
+ },
2939
+ fromPartial(object) {
2940
+ const message = createBaseUpdateConfigRequest();
2941
+ message.updates = object.updates?.map((e) => exports.SettingUpdate.fromPartial(e)) || [];
2942
+ return message;
2943
+ },
2944
+ };
2945
+ function createBaseBleTag() {
2946
+ return { id: 0, macAddress: "", label: "", userId: 0 };
2947
+ }
2948
+ exports.BleTag = {
2949
+ encode(message, writer = new wire_1.BinaryWriter()) {
2950
+ if (message.id !== 0) {
2951
+ writer.uint32(8).int32(message.id);
2952
+ }
2953
+ if (message.macAddress !== "") {
2954
+ writer.uint32(18).string(message.macAddress);
2955
+ }
2956
+ if (message.label !== "") {
2957
+ writer.uint32(26).string(message.label);
2958
+ }
2959
+ if (message.userId !== 0) {
2960
+ writer.uint32(32).int32(message.userId);
2961
+ }
2962
+ return writer;
2963
+ },
2964
+ decode(input, length) {
2965
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2966
+ const end = length === undefined ? reader.len : reader.pos + length;
2967
+ const message = createBaseBleTag();
2968
+ while (reader.pos < end) {
2969
+ const tag = reader.uint32();
2970
+ switch (tag >>> 3) {
2971
+ case 1: {
2972
+ if (tag !== 8) {
2973
+ break;
2974
+ }
2975
+ message.id = reader.int32();
2976
+ continue;
2977
+ }
2978
+ case 2: {
2979
+ if (tag !== 18) {
2980
+ break;
2981
+ }
2982
+ message.macAddress = reader.string();
2983
+ continue;
2984
+ }
2985
+ case 3: {
2986
+ if (tag !== 26) {
2987
+ break;
2988
+ }
2989
+ message.label = reader.string();
2990
+ continue;
2991
+ }
2992
+ case 4: {
2993
+ if (tag !== 32) {
2994
+ break;
2995
+ }
2996
+ message.userId = reader.int32();
2997
+ continue;
2998
+ }
2999
+ }
3000
+ if ((tag & 7) === 4 || tag === 0) {
3001
+ break;
3002
+ }
3003
+ reader.skip(tag & 7);
3004
+ }
3005
+ return message;
3006
+ },
3007
+ create(base) {
3008
+ return exports.BleTag.fromPartial(base ?? {});
3009
+ },
3010
+ fromPartial(object) {
3011
+ const message = createBaseBleTag();
3012
+ message.id = object.id ?? 0;
3013
+ message.macAddress = object.macAddress ?? "";
3014
+ message.label = object.label ?? "";
3015
+ message.userId = object.userId ?? 0;
3016
+ return message;
3017
+ },
3018
+ };
3019
+ function createBaseGetBleTagsResponse() {
3020
+ return { tags: [] };
3021
+ }
3022
+ exports.GetBleTagsResponse = {
3023
+ encode(message, writer = new wire_1.BinaryWriter()) {
3024
+ for (const v of message.tags) {
3025
+ exports.BleTag.encode(v, writer.uint32(10).fork()).join();
3026
+ }
3027
+ return writer;
3028
+ },
3029
+ decode(input, length) {
3030
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3031
+ const end = length === undefined ? reader.len : reader.pos + length;
3032
+ const message = createBaseGetBleTagsResponse();
3033
+ while (reader.pos < end) {
3034
+ const tag = reader.uint32();
3035
+ switch (tag >>> 3) {
3036
+ case 1: {
3037
+ if (tag !== 10) {
3038
+ break;
3039
+ }
3040
+ message.tags.push(exports.BleTag.decode(reader, reader.uint32()));
3041
+ continue;
3042
+ }
3043
+ }
3044
+ if ((tag & 7) === 4 || tag === 0) {
3045
+ break;
3046
+ }
3047
+ reader.skip(tag & 7);
3048
+ }
3049
+ return message;
3050
+ },
3051
+ create(base) {
3052
+ return exports.GetBleTagsResponse.fromPartial(base ?? {});
3053
+ },
3054
+ fromPartial(object) {
3055
+ const message = createBaseGetBleTagsResponse();
3056
+ message.tags = object.tags?.map((e) => exports.BleTag.fromPartial(e)) || [];
3057
+ return message;
3058
+ },
3059
+ };
3060
+ function createBaseCreateBleTagRequest() {
3061
+ return { macAddress: "", label: "", userId: 0 };
3062
+ }
3063
+ exports.CreateBleTagRequest = {
3064
+ encode(message, writer = new wire_1.BinaryWriter()) {
3065
+ if (message.macAddress !== "") {
3066
+ writer.uint32(10).string(message.macAddress);
3067
+ }
3068
+ if (message.label !== "") {
3069
+ writer.uint32(18).string(message.label);
3070
+ }
3071
+ if (message.userId !== 0) {
3072
+ writer.uint32(24).int32(message.userId);
3073
+ }
3074
+ return writer;
3075
+ },
3076
+ decode(input, length) {
3077
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3078
+ const end = length === undefined ? reader.len : reader.pos + length;
3079
+ const message = createBaseCreateBleTagRequest();
3080
+ while (reader.pos < end) {
3081
+ const tag = reader.uint32();
3082
+ switch (tag >>> 3) {
3083
+ case 1: {
3084
+ if (tag !== 10) {
3085
+ break;
3086
+ }
3087
+ message.macAddress = reader.string();
3088
+ continue;
3089
+ }
3090
+ case 2: {
3091
+ if (tag !== 18) {
3092
+ break;
3093
+ }
3094
+ message.label = reader.string();
3095
+ continue;
3096
+ }
3097
+ case 3: {
3098
+ if (tag !== 24) {
3099
+ break;
3100
+ }
3101
+ message.userId = reader.int32();
3102
+ continue;
3103
+ }
3104
+ }
3105
+ if ((tag & 7) === 4 || tag === 0) {
3106
+ break;
3107
+ }
3108
+ reader.skip(tag & 7);
3109
+ }
3110
+ return message;
3111
+ },
3112
+ create(base) {
3113
+ return exports.CreateBleTagRequest.fromPartial(base ?? {});
3114
+ },
3115
+ fromPartial(object) {
3116
+ const message = createBaseCreateBleTagRequest();
3117
+ message.macAddress = object.macAddress ?? "";
3118
+ message.label = object.label ?? "";
3119
+ message.userId = object.userId ?? 0;
3120
+ return message;
3121
+ },
3122
+ };
3123
+ function createBaseCreateBleTagResponse() {
3124
+ return { ok: false, id: 0, message: "" };
3125
+ }
3126
+ exports.CreateBleTagResponse = {
3127
+ encode(message, writer = new wire_1.BinaryWriter()) {
3128
+ if (message.ok !== false) {
3129
+ writer.uint32(8).bool(message.ok);
3130
+ }
3131
+ if (message.id !== 0) {
3132
+ writer.uint32(16).int32(message.id);
3133
+ }
3134
+ if (message.message !== "") {
3135
+ writer.uint32(26).string(message.message);
3136
+ }
3137
+ return writer;
3138
+ },
3139
+ decode(input, length) {
3140
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3141
+ const end = length === undefined ? reader.len : reader.pos + length;
3142
+ const message = createBaseCreateBleTagResponse();
3143
+ while (reader.pos < end) {
3144
+ const tag = reader.uint32();
3145
+ switch (tag >>> 3) {
3146
+ case 1: {
3147
+ if (tag !== 8) {
3148
+ break;
3149
+ }
3150
+ message.ok = reader.bool();
3151
+ continue;
3152
+ }
3153
+ case 2: {
3154
+ if (tag !== 16) {
3155
+ break;
3156
+ }
3157
+ message.id = reader.int32();
3158
+ continue;
3159
+ }
3160
+ case 3: {
3161
+ if (tag !== 26) {
3162
+ break;
3163
+ }
3164
+ message.message = reader.string();
3165
+ continue;
3166
+ }
3167
+ }
3168
+ if ((tag & 7) === 4 || tag === 0) {
3169
+ break;
3170
+ }
3171
+ reader.skip(tag & 7);
3172
+ }
3173
+ return message;
3174
+ },
3175
+ create(base) {
3176
+ return exports.CreateBleTagResponse.fromPartial(base ?? {});
3177
+ },
3178
+ fromPartial(object) {
3179
+ const message = createBaseCreateBleTagResponse();
3180
+ message.ok = object.ok ?? false;
3181
+ message.id = object.id ?? 0;
3182
+ message.message = object.message ?? "";
3183
+ return message;
3184
+ },
3185
+ };
3186
+ function createBaseUpdateBleTagRequest() {
3187
+ return { id: 0, macAddress: "", label: "", userId: 0 };
3188
+ }
3189
+ exports.UpdateBleTagRequest = {
3190
+ encode(message, writer = new wire_1.BinaryWriter()) {
3191
+ if (message.id !== 0) {
3192
+ writer.uint32(8).int32(message.id);
3193
+ }
3194
+ if (message.macAddress !== "") {
3195
+ writer.uint32(18).string(message.macAddress);
3196
+ }
3197
+ if (message.label !== "") {
3198
+ writer.uint32(26).string(message.label);
3199
+ }
3200
+ if (message.userId !== 0) {
3201
+ writer.uint32(32).int32(message.userId);
3202
+ }
3203
+ return writer;
3204
+ },
3205
+ decode(input, length) {
3206
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3207
+ const end = length === undefined ? reader.len : reader.pos + length;
3208
+ const message = createBaseUpdateBleTagRequest();
3209
+ while (reader.pos < end) {
3210
+ const tag = reader.uint32();
3211
+ switch (tag >>> 3) {
3212
+ case 1: {
3213
+ if (tag !== 8) {
3214
+ break;
3215
+ }
3216
+ message.id = reader.int32();
3217
+ continue;
3218
+ }
3219
+ case 2: {
3220
+ if (tag !== 18) {
3221
+ break;
3222
+ }
3223
+ message.macAddress = reader.string();
3224
+ continue;
3225
+ }
3226
+ case 3: {
3227
+ if (tag !== 26) {
3228
+ break;
3229
+ }
3230
+ message.label = reader.string();
3231
+ continue;
3232
+ }
3233
+ case 4: {
3234
+ if (tag !== 32) {
3235
+ break;
3236
+ }
3237
+ message.userId = reader.int32();
3238
+ continue;
3239
+ }
3240
+ }
3241
+ if ((tag & 7) === 4 || tag === 0) {
3242
+ break;
3243
+ }
3244
+ reader.skip(tag & 7);
3245
+ }
3246
+ return message;
3247
+ },
3248
+ create(base) {
3249
+ return exports.UpdateBleTagRequest.fromPartial(base ?? {});
3250
+ },
3251
+ fromPartial(object) {
3252
+ const message = createBaseUpdateBleTagRequest();
3253
+ message.id = object.id ?? 0;
3254
+ message.macAddress = object.macAddress ?? "";
3255
+ message.label = object.label ?? "";
3256
+ message.userId = object.userId ?? 0;
3257
+ return message;
3258
+ },
3259
+ };
3260
+ function createBaseDeleteBleTagRequest() {
3261
+ return { id: 0 };
3262
+ }
3263
+ exports.DeleteBleTagRequest = {
3264
+ encode(message, writer = new wire_1.BinaryWriter()) {
3265
+ if (message.id !== 0) {
3266
+ writer.uint32(8).int32(message.id);
3267
+ }
3268
+ return writer;
3269
+ },
3270
+ decode(input, length) {
3271
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3272
+ const end = length === undefined ? reader.len : reader.pos + length;
3273
+ const message = createBaseDeleteBleTagRequest();
3274
+ while (reader.pos < end) {
3275
+ const tag = reader.uint32();
3276
+ switch (tag >>> 3) {
3277
+ case 1: {
3278
+ if (tag !== 8) {
3279
+ break;
3280
+ }
3281
+ message.id = reader.int32();
3282
+ continue;
3283
+ }
3284
+ }
3285
+ if ((tag & 7) === 4 || tag === 0) {
3286
+ break;
3287
+ }
3288
+ reader.skip(tag & 7);
3289
+ }
3290
+ return message;
3291
+ },
3292
+ create(base) {
3293
+ return exports.DeleteBleTagRequest.fromPartial(base ?? {});
3294
+ },
3295
+ fromPartial(object) {
3296
+ const message = createBaseDeleteBleTagRequest();
3297
+ message.id = object.id ?? 0;
3298
+ return message;
3299
+ },
3300
+ };
3301
+ function createBaseCar() {
3302
+ return { id: 0, topicPrefix: "", homeAddress: "", ownerUserIds: [], name: "" };
3303
+ }
3304
+ exports.Car = {
3305
+ encode(message, writer = new wire_1.BinaryWriter()) {
3306
+ if (message.id !== 0) {
3307
+ writer.uint32(8).int32(message.id);
3308
+ }
3309
+ if (message.topicPrefix !== "") {
3310
+ writer.uint32(18).string(message.topicPrefix);
3311
+ }
3312
+ if (message.homeAddress !== "") {
3313
+ writer.uint32(26).string(message.homeAddress);
3314
+ }
3315
+ writer.uint32(34).fork();
3316
+ for (const v of message.ownerUserIds) {
3317
+ writer.int32(v);
3318
+ }
3319
+ writer.join();
3320
+ if (message.name !== "") {
3321
+ writer.uint32(42).string(message.name);
3322
+ }
3323
+ return writer;
3324
+ },
3325
+ decode(input, length) {
3326
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3327
+ const end = length === undefined ? reader.len : reader.pos + length;
3328
+ const message = createBaseCar();
3329
+ while (reader.pos < end) {
3330
+ const tag = reader.uint32();
3331
+ switch (tag >>> 3) {
3332
+ case 1: {
3333
+ if (tag !== 8) {
3334
+ break;
3335
+ }
3336
+ message.id = reader.int32();
3337
+ continue;
3338
+ }
3339
+ case 2: {
3340
+ if (tag !== 18) {
3341
+ break;
3342
+ }
3343
+ message.topicPrefix = reader.string();
3344
+ continue;
3345
+ }
3346
+ case 3: {
3347
+ if (tag !== 26) {
3348
+ break;
3349
+ }
3350
+ message.homeAddress = reader.string();
3351
+ continue;
3352
+ }
3353
+ case 4: {
3354
+ if (tag === 32) {
3355
+ message.ownerUserIds.push(reader.int32());
3356
+ continue;
3357
+ }
3358
+ if (tag === 34) {
3359
+ const end2 = reader.uint32() + reader.pos;
3360
+ while (reader.pos < end2) {
3361
+ message.ownerUserIds.push(reader.int32());
3362
+ }
3363
+ continue;
3364
+ }
3365
+ break;
3366
+ }
3367
+ case 5: {
3368
+ if (tag !== 42) {
3369
+ break;
3370
+ }
3371
+ message.name = reader.string();
3372
+ continue;
3373
+ }
3374
+ }
3375
+ if ((tag & 7) === 4 || tag === 0) {
3376
+ break;
3377
+ }
3378
+ reader.skip(tag & 7);
3379
+ }
3380
+ return message;
3381
+ },
3382
+ create(base) {
3383
+ return exports.Car.fromPartial(base ?? {});
3384
+ },
3385
+ fromPartial(object) {
3386
+ const message = createBaseCar();
3387
+ message.id = object.id ?? 0;
3388
+ message.topicPrefix = object.topicPrefix ?? "";
3389
+ message.homeAddress = object.homeAddress ?? "";
3390
+ message.ownerUserIds = object.ownerUserIds?.map((e) => e) || [];
3391
+ message.name = object.name ?? "";
3392
+ return message;
3393
+ },
3394
+ };
3395
+ function createBaseGetCarsResponse() {
3396
+ return { cars: [] };
3397
+ }
3398
+ exports.GetCarsResponse = {
3399
+ encode(message, writer = new wire_1.BinaryWriter()) {
3400
+ for (const v of message.cars) {
3401
+ exports.Car.encode(v, writer.uint32(10).fork()).join();
3402
+ }
3403
+ return writer;
3404
+ },
3405
+ decode(input, length) {
3406
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3407
+ const end = length === undefined ? reader.len : reader.pos + length;
3408
+ const message = createBaseGetCarsResponse();
3409
+ while (reader.pos < end) {
3410
+ const tag = reader.uint32();
3411
+ switch (tag >>> 3) {
3412
+ case 1: {
3413
+ if (tag !== 10) {
3414
+ break;
3415
+ }
3416
+ message.cars.push(exports.Car.decode(reader, reader.uint32()));
3417
+ continue;
3418
+ }
3419
+ }
3420
+ if ((tag & 7) === 4 || tag === 0) {
3421
+ break;
3422
+ }
3423
+ reader.skip(tag & 7);
3424
+ }
3425
+ return message;
3426
+ },
3427
+ create(base) {
3428
+ return exports.GetCarsResponse.fromPartial(base ?? {});
3429
+ },
3430
+ fromPartial(object) {
3431
+ const message = createBaseGetCarsResponse();
3432
+ message.cars = object.cars?.map((e) => exports.Car.fromPartial(e)) || [];
3433
+ return message;
3434
+ },
3435
+ };
3436
+ function createBaseCreateCarRequest() {
3437
+ return { topicPrefix: "", homeAddress: "", ownerUserIds: [], name: "" };
3438
+ }
3439
+ exports.CreateCarRequest = {
3440
+ encode(message, writer = new wire_1.BinaryWriter()) {
3441
+ if (message.topicPrefix !== "") {
3442
+ writer.uint32(10).string(message.topicPrefix);
3443
+ }
3444
+ if (message.homeAddress !== "") {
3445
+ writer.uint32(18).string(message.homeAddress);
3446
+ }
3447
+ writer.uint32(26).fork();
3448
+ for (const v of message.ownerUserIds) {
3449
+ writer.int32(v);
3450
+ }
3451
+ writer.join();
3452
+ if (message.name !== "") {
3453
+ writer.uint32(34).string(message.name);
3454
+ }
3455
+ return writer;
3456
+ },
3457
+ decode(input, length) {
3458
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3459
+ const end = length === undefined ? reader.len : reader.pos + length;
3460
+ const message = createBaseCreateCarRequest();
3461
+ while (reader.pos < end) {
3462
+ const tag = reader.uint32();
3463
+ switch (tag >>> 3) {
3464
+ case 1: {
3465
+ if (tag !== 10) {
3466
+ break;
3467
+ }
3468
+ message.topicPrefix = reader.string();
3469
+ continue;
3470
+ }
3471
+ case 2: {
3472
+ if (tag !== 18) {
3473
+ break;
3474
+ }
3475
+ message.homeAddress = reader.string();
3476
+ continue;
3477
+ }
3478
+ case 3: {
3479
+ if (tag === 24) {
3480
+ message.ownerUserIds.push(reader.int32());
3481
+ continue;
3482
+ }
3483
+ if (tag === 26) {
3484
+ const end2 = reader.uint32() + reader.pos;
3485
+ while (reader.pos < end2) {
3486
+ message.ownerUserIds.push(reader.int32());
3487
+ }
3488
+ continue;
3489
+ }
3490
+ break;
3491
+ }
3492
+ case 4: {
3493
+ if (tag !== 34) {
3494
+ break;
3495
+ }
3496
+ message.name = reader.string();
3497
+ continue;
3498
+ }
3499
+ }
3500
+ if ((tag & 7) === 4 || tag === 0) {
3501
+ break;
3502
+ }
3503
+ reader.skip(tag & 7);
3504
+ }
3505
+ return message;
3506
+ },
3507
+ create(base) {
3508
+ return exports.CreateCarRequest.fromPartial(base ?? {});
3509
+ },
3510
+ fromPartial(object) {
3511
+ const message = createBaseCreateCarRequest();
3512
+ message.topicPrefix = object.topicPrefix ?? "";
3513
+ message.homeAddress = object.homeAddress ?? "";
3514
+ message.ownerUserIds = object.ownerUserIds?.map((e) => e) || [];
3515
+ message.name = object.name ?? "";
3516
+ return message;
3517
+ },
3518
+ };
3519
+ function createBaseCreateCarResponse() {
3520
+ return { ok: false, id: 0, message: "" };
3521
+ }
3522
+ exports.CreateCarResponse = {
3523
+ encode(message, writer = new wire_1.BinaryWriter()) {
3524
+ if (message.ok !== false) {
3525
+ writer.uint32(8).bool(message.ok);
3526
+ }
3527
+ if (message.id !== 0) {
3528
+ writer.uint32(16).int32(message.id);
3529
+ }
3530
+ if (message.message !== "") {
3531
+ writer.uint32(26).string(message.message);
3532
+ }
3533
+ return writer;
3534
+ },
3535
+ decode(input, length) {
3536
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3537
+ const end = length === undefined ? reader.len : reader.pos + length;
3538
+ const message = createBaseCreateCarResponse();
3539
+ while (reader.pos < end) {
3540
+ const tag = reader.uint32();
3541
+ switch (tag >>> 3) {
3542
+ case 1: {
3543
+ if (tag !== 8) {
3544
+ break;
3545
+ }
3546
+ message.ok = reader.bool();
3547
+ continue;
3548
+ }
3549
+ case 2: {
3550
+ if (tag !== 16) {
3551
+ break;
3552
+ }
3553
+ message.id = reader.int32();
3554
+ continue;
3555
+ }
3556
+ case 3: {
3557
+ if (tag !== 26) {
3558
+ break;
3559
+ }
3560
+ message.message = reader.string();
3561
+ continue;
3562
+ }
3563
+ }
3564
+ if ((tag & 7) === 4 || tag === 0) {
3565
+ break;
3566
+ }
3567
+ reader.skip(tag & 7);
3568
+ }
3569
+ return message;
3570
+ },
3571
+ create(base) {
3572
+ return exports.CreateCarResponse.fromPartial(base ?? {});
3573
+ },
3574
+ fromPartial(object) {
3575
+ const message = createBaseCreateCarResponse();
3576
+ message.ok = object.ok ?? false;
3577
+ message.id = object.id ?? 0;
3578
+ message.message = object.message ?? "";
3579
+ return message;
3580
+ },
3581
+ };
3582
+ function createBaseUpdateCarRequest() {
3583
+ return { id: 0, topicPrefix: "", homeAddress: "", ownerUserIds: [], name: "" };
3584
+ }
3585
+ exports.UpdateCarRequest = {
3586
+ encode(message, writer = new wire_1.BinaryWriter()) {
3587
+ if (message.id !== 0) {
3588
+ writer.uint32(8).int32(message.id);
3589
+ }
3590
+ if (message.topicPrefix !== "") {
3591
+ writer.uint32(18).string(message.topicPrefix);
3592
+ }
3593
+ if (message.homeAddress !== "") {
3594
+ writer.uint32(26).string(message.homeAddress);
3595
+ }
3596
+ writer.uint32(34).fork();
3597
+ for (const v of message.ownerUserIds) {
3598
+ writer.int32(v);
3599
+ }
3600
+ writer.join();
3601
+ if (message.name !== "") {
3602
+ writer.uint32(42).string(message.name);
3603
+ }
3604
+ return writer;
3605
+ },
3606
+ decode(input, length) {
3607
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3608
+ const end = length === undefined ? reader.len : reader.pos + length;
3609
+ const message = createBaseUpdateCarRequest();
3610
+ while (reader.pos < end) {
3611
+ const tag = reader.uint32();
3612
+ switch (tag >>> 3) {
3613
+ case 1: {
3614
+ if (tag !== 8) {
3615
+ break;
3616
+ }
3617
+ message.id = reader.int32();
3618
+ continue;
3619
+ }
3620
+ case 2: {
3621
+ if (tag !== 18) {
3622
+ break;
3623
+ }
3624
+ message.topicPrefix = reader.string();
3625
+ continue;
3626
+ }
3627
+ case 3: {
3628
+ if (tag !== 26) {
3629
+ break;
3630
+ }
3631
+ message.homeAddress = reader.string();
3632
+ continue;
3633
+ }
3634
+ case 4: {
3635
+ if (tag === 32) {
3636
+ message.ownerUserIds.push(reader.int32());
3637
+ continue;
3638
+ }
3639
+ if (tag === 34) {
3640
+ const end2 = reader.uint32() + reader.pos;
3641
+ while (reader.pos < end2) {
3642
+ message.ownerUserIds.push(reader.int32());
3643
+ }
3644
+ continue;
3645
+ }
3646
+ break;
3647
+ }
3648
+ case 5: {
3649
+ if (tag !== 42) {
3650
+ break;
3651
+ }
3652
+ message.name = reader.string();
3653
+ continue;
3654
+ }
3655
+ }
3656
+ if ((tag & 7) === 4 || tag === 0) {
3657
+ break;
3658
+ }
3659
+ reader.skip(tag & 7);
3660
+ }
3661
+ return message;
3662
+ },
3663
+ create(base) {
3664
+ return exports.UpdateCarRequest.fromPartial(base ?? {});
3665
+ },
3666
+ fromPartial(object) {
3667
+ const message = createBaseUpdateCarRequest();
3668
+ message.id = object.id ?? 0;
3669
+ message.topicPrefix = object.topicPrefix ?? "";
3670
+ message.homeAddress = object.homeAddress ?? "";
3671
+ message.ownerUserIds = object.ownerUserIds?.map((e) => e) || [];
3672
+ message.name = object.name ?? "";
3673
+ return message;
3674
+ },
3675
+ };
3676
+ function createBaseDeleteCarRequest() {
3677
+ return { id: 0 };
3678
+ }
3679
+ exports.DeleteCarRequest = {
3680
+ encode(message, writer = new wire_1.BinaryWriter()) {
3681
+ if (message.id !== 0) {
3682
+ writer.uint32(8).int32(message.id);
3683
+ }
3684
+ return writer;
3685
+ },
3686
+ decode(input, length) {
3687
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3688
+ const end = length === undefined ? reader.len : reader.pos + length;
3689
+ const message = createBaseDeleteCarRequest();
3690
+ while (reader.pos < end) {
3691
+ const tag = reader.uint32();
3692
+ switch (tag >>> 3) {
3693
+ case 1: {
3694
+ if (tag !== 8) {
3695
+ break;
3696
+ }
3697
+ message.id = reader.int32();
3698
+ continue;
3699
+ }
3700
+ }
3701
+ if ((tag & 7) === 4 || tag === 0) {
3702
+ break;
3703
+ }
3704
+ reader.skip(tag & 7);
3705
+ }
3706
+ return message;
3707
+ },
3708
+ create(base) {
3709
+ return exports.DeleteCarRequest.fromPartial(base ?? {});
3710
+ },
3711
+ fromPartial(object) {
3712
+ const message = createBaseDeleteCarRequest();
3713
+ message.id = object.id ?? 0;
3714
+ return message;
3715
+ },
3716
+ };