@fatehan/tsrp 1.1.0 → 1.1.2

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.
@@ -8,7 +8,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  return (mod && mod.__esModule) ? mod : { "default": mod };
9
9
  };
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.ShownIo = exports.SystemIo_UnknownEntry = exports.SystemIo = exports.SystemIoStyle = exports.Car_Brand = exports.Car_Model_Metadata = exports.Car_Model = exports.Car = exports.Tracker_Document = exports.Tracker_Metadata_SmsCredentials = exports.Tracker_Metadata = exports.Tracker = exports.DeviceIcon_Image = exports.DeviceIcon = exports.Device = exports.SystemIo_SystemIoType = exports.protobufPackage = void 0;
11
+ exports.ShownIo = exports.SystemIo_UnknownEntry = exports.SystemIo = exports.SystemIoStyle = exports.Car = exports.CarBrand = exports.CarModel_Metadata = exports.CarModel = exports.Tracker_Document = exports.Tracker_Metadata_SmsCredentials = exports.Tracker_Metadata = exports.Tracker = exports.DeviceIcon_Image = exports.DeviceIcon = exports.Device = exports.SystemIo_SystemIoType = exports.protobufPackage = void 0;
12
12
  exports.systemIo_SystemIoTypeFromJSON = systemIo_SystemIoTypeFromJSON;
13
13
  exports.systemIo_SystemIoTypeToJSON = systemIo_SystemIoTypeToJSON;
14
14
  /* eslint-disable */
@@ -64,35 +64,34 @@ function systemIo_SystemIoTypeToJSON(object) {
64
64
  function createBaseDevice() {
65
65
  return {
66
66
  id: long_1.default.UZERO,
67
- organizationId: long_1.default.UZERO,
68
- partnerId: long_1.default.UZERO,
67
+ organizationId: undefined,
68
+ partnerId: undefined,
69
69
  generation: undefined,
70
70
  deviceId: "",
71
- objectId: long_1.default.UZERO,
72
- objectType: "",
73
- trackerId: long_1.default.UZERO,
74
- ownerId: undefined,
71
+ objectId: undefined,
72
+ objectType: undefined,
73
+ trackerId: undefined,
74
+ ownerId: long_1.default.UZERO,
75
+ iconId: undefined,
75
76
  warehouseId: undefined,
76
- createdBy: undefined,
77
+ createdBy: long_1.default.UZERO,
77
78
  simCard: undefined,
78
79
  simProvider: undefined,
79
- idChanged: long_1.default.UZERO,
80
+ idChanged: false,
80
81
  iccId: undefined,
81
82
  smsUsername: undefined,
82
83
  smsPassword: undefined,
83
84
  configPassword: undefined,
84
- test: undefined,
85
+ test: false,
85
86
  simCardId: undefined,
86
- timezone: "",
87
- isUnlimited: long_1.default.UZERO,
88
- tripType: undefined,
87
+ timezone: undefined,
88
+ isUnlimited: false,
89
+ tripType: "",
89
90
  receiveAt: undefined,
90
91
  expiresAt: undefined,
91
92
  connectAt: undefined,
92
93
  createdAt: undefined,
93
94
  updatedAt: undefined,
94
- iconId: undefined,
95
- active: false,
96
95
  icon: undefined,
97
96
  tracker: undefined,
98
97
  car: undefined,
@@ -106,44 +105,47 @@ exports.Device = {
106
105
  if (!message.id.equals(long_1.default.UZERO)) {
107
106
  writer.uint32(8).uint64(message.id.toString());
108
107
  }
109
- if (!message.organizationId.equals(long_1.default.UZERO)) {
108
+ if (message.organizationId !== undefined) {
110
109
  writer.uint32(16).uint64(message.organizationId.toString());
111
110
  }
112
- if (!message.partnerId.equals(long_1.default.UZERO)) {
111
+ if (message.partnerId !== undefined) {
113
112
  writer.uint32(24).uint64(message.partnerId.toString());
114
113
  }
115
114
  if (message.generation !== undefined) {
116
- writer.uint32(32).uint64(message.generation.toString());
115
+ writer.uint32(34).string(message.generation);
117
116
  }
118
117
  if (message.deviceId !== "") {
119
118
  writer.uint32(42).string(message.deviceId);
120
119
  }
121
- if (!message.objectId.equals(long_1.default.UZERO)) {
120
+ if (message.objectId !== undefined) {
122
121
  writer.uint32(48).uint64(message.objectId.toString());
123
122
  }
124
- if (message.objectType !== "") {
123
+ if (message.objectType !== undefined) {
125
124
  writer.uint32(58).string(message.objectType);
126
125
  }
127
- if (!message.trackerId.equals(long_1.default.UZERO)) {
126
+ if (message.trackerId !== undefined) {
128
127
  writer.uint32(64).uint64(message.trackerId.toString());
129
128
  }
130
- if (message.ownerId !== undefined) {
129
+ if (!message.ownerId.equals(long_1.default.UZERO)) {
131
130
  writer.uint32(72).uint64(message.ownerId.toString());
132
131
  }
132
+ if (message.iconId !== undefined) {
133
+ writer.uint32(232).uint64(message.iconId.toString());
134
+ }
133
135
  if (message.warehouseId !== undefined) {
134
136
  writer.uint32(80).uint64(message.warehouseId.toString());
135
137
  }
136
- if (message.createdBy !== undefined) {
138
+ if (!message.createdBy.equals(long_1.default.UZERO)) {
137
139
  writer.uint32(88).uint64(message.createdBy.toString());
138
140
  }
139
141
  if (message.simCard !== undefined) {
140
142
  writer.uint32(98).string(message.simCard);
141
143
  }
142
144
  if (message.simProvider !== undefined) {
143
- writer.uint32(104).uint64(message.simProvider.toString());
145
+ writer.uint32(104).sint32(message.simProvider);
144
146
  }
145
- if (!message.idChanged.equals(long_1.default.UZERO)) {
146
- writer.uint32(112).uint64(message.idChanged.toString());
147
+ if (message.idChanged !== false) {
148
+ writer.uint32(112).bool(message.idChanged);
147
149
  }
148
150
  if (message.iccId !== undefined) {
149
151
  writer.uint32(122).string(message.iccId);
@@ -157,19 +159,19 @@ exports.Device = {
157
159
  if (message.configPassword !== undefined) {
158
160
  writer.uint32(146).string(message.configPassword);
159
161
  }
160
- if (message.test !== undefined) {
161
- writer.uint32(152).uint64(message.test.toString());
162
+ if (message.test !== false) {
163
+ writer.uint32(152).bool(message.test);
162
164
  }
163
165
  if (message.simCardId !== undefined) {
164
166
  writer.uint32(162).string(message.simCardId);
165
167
  }
166
- if (message.timezone !== "") {
168
+ if (message.timezone !== undefined) {
167
169
  writer.uint32(170).string(message.timezone);
168
170
  }
169
- if (!message.isUnlimited.equals(long_1.default.UZERO)) {
170
- writer.uint32(176).uint64(message.isUnlimited.toString());
171
+ if (message.isUnlimited !== false) {
172
+ writer.uint32(176).bool(message.isUnlimited);
171
173
  }
172
- if (message.tripType !== undefined) {
174
+ if (message.tripType !== "") {
173
175
  writer.uint32(186).string(message.tripType);
174
176
  }
175
177
  if (message.receiveAt !== undefined) {
@@ -187,12 +189,6 @@ exports.Device = {
187
189
  if (message.updatedAt !== undefined) {
188
190
  timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(226).fork()).join();
189
191
  }
190
- if (message.iconId !== undefined) {
191
- writer.uint32(232).uint64(message.iconId.toString());
192
- }
193
- if (message.active !== false) {
194
- writer.uint32(240).bool(message.active);
195
- }
196
192
  if (message.icon !== undefined) {
197
193
  exports.DeviceIcon.encode(message.icon, writer.uint32(250).fork()).join();
198
194
  }
@@ -242,10 +238,10 @@ exports.Device = {
242
238
  continue;
243
239
  }
244
240
  case 4: {
245
- if (tag !== 32) {
241
+ if (tag !== 34) {
246
242
  break;
247
243
  }
248
- message.generation = long_1.default.fromString(reader.uint64().toString(), true);
244
+ message.generation = reader.string();
249
245
  continue;
250
246
  }
251
247
  case 5: {
@@ -283,6 +279,13 @@ exports.Device = {
283
279
  message.ownerId = long_1.default.fromString(reader.uint64().toString(), true);
284
280
  continue;
285
281
  }
282
+ case 29: {
283
+ if (tag !== 232) {
284
+ break;
285
+ }
286
+ message.iconId = long_1.default.fromString(reader.uint64().toString(), true);
287
+ continue;
288
+ }
286
289
  case 10: {
287
290
  if (tag !== 80) {
288
291
  break;
@@ -308,14 +311,14 @@ exports.Device = {
308
311
  if (tag !== 104) {
309
312
  break;
310
313
  }
311
- message.simProvider = long_1.default.fromString(reader.uint64().toString(), true);
314
+ message.simProvider = reader.sint32();
312
315
  continue;
313
316
  }
314
317
  case 14: {
315
318
  if (tag !== 112) {
316
319
  break;
317
320
  }
318
- message.idChanged = long_1.default.fromString(reader.uint64().toString(), true);
321
+ message.idChanged = reader.bool();
319
322
  continue;
320
323
  }
321
324
  case 15: {
@@ -350,7 +353,7 @@ exports.Device = {
350
353
  if (tag !== 152) {
351
354
  break;
352
355
  }
353
- message.test = long_1.default.fromString(reader.uint64().toString(), true);
356
+ message.test = reader.bool();
354
357
  continue;
355
358
  }
356
359
  case 20: {
@@ -371,7 +374,7 @@ exports.Device = {
371
374
  if (tag !== 176) {
372
375
  break;
373
376
  }
374
- message.isUnlimited = long_1.default.fromString(reader.uint64().toString(), true);
377
+ message.isUnlimited = reader.bool();
375
378
  continue;
376
379
  }
377
380
  case 23: {
@@ -416,20 +419,6 @@ exports.Device = {
416
419
  message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
417
420
  continue;
418
421
  }
419
- case 29: {
420
- if (tag !== 232) {
421
- break;
422
- }
423
- message.iconId = long_1.default.fromString(reader.uint64().toString(), true);
424
- continue;
425
- }
426
- case 30: {
427
- if (tag !== 240) {
428
- break;
429
- }
430
- message.active = reader.bool();
431
- continue;
432
- }
433
422
  case 31: {
434
423
  if (tag !== 250) {
435
424
  break;
@@ -483,35 +472,34 @@ exports.Device = {
483
472
  fromJSON(object) {
484
473
  return {
485
474
  id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
486
- organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
487
- partnerId: isSet(object.partner_id) ? long_1.default.fromValue(object.partner_id) : long_1.default.UZERO,
488
- generation: isSet(object.generation) ? long_1.default.fromValue(object.generation) : undefined,
475
+ organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : undefined,
476
+ partnerId: isSet(object.partner_id) ? long_1.default.fromValue(object.partner_id) : undefined,
477
+ generation: isSet(object.generation) ? globalThis.String(object.generation) : undefined,
489
478
  deviceId: isSet(object.device_id) ? globalThis.String(object.device_id) : "",
490
- objectId: isSet(object.object_id) ? long_1.default.fromValue(object.object_id) : long_1.default.UZERO,
491
- objectType: isSet(object.object_type) ? globalThis.String(object.object_type) : "",
492
- trackerId: isSet(object.tracker_id) ? long_1.default.fromValue(object.tracker_id) : long_1.default.UZERO,
493
- ownerId: isSet(object.owner_id) ? long_1.default.fromValue(object.owner_id) : undefined,
479
+ objectId: isSet(object.object_id) ? long_1.default.fromValue(object.object_id) : undefined,
480
+ objectType: isSet(object.object_type) ? globalThis.String(object.object_type) : undefined,
481
+ trackerId: isSet(object.tracker_id) ? long_1.default.fromValue(object.tracker_id) : undefined,
482
+ ownerId: isSet(object.owner_id) ? long_1.default.fromValue(object.owner_id) : long_1.default.UZERO,
483
+ iconId: isSet(object.icon_id) ? long_1.default.fromValue(object.icon_id) : undefined,
494
484
  warehouseId: isSet(object.warehouse_id) ? long_1.default.fromValue(object.warehouse_id) : undefined,
495
- createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
485
+ createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : long_1.default.UZERO,
496
486
  simCard: isSet(object.sim_card) ? globalThis.String(object.sim_card) : undefined,
497
- simProvider: isSet(object.sim_provider) ? long_1.default.fromValue(object.sim_provider) : undefined,
498
- idChanged: isSet(object.id_changed) ? long_1.default.fromValue(object.id_changed) : long_1.default.UZERO,
487
+ simProvider: isSet(object.sim_provider) ? globalThis.Number(object.sim_provider) : undefined,
488
+ idChanged: isSet(object.id_changed) ? globalThis.Boolean(object.id_changed) : false,
499
489
  iccId: isSet(object.icc_id) ? globalThis.String(object.icc_id) : undefined,
500
490
  smsUsername: isSet(object.sms_username) ? globalThis.String(object.sms_username) : undefined,
501
491
  smsPassword: isSet(object.sms_password) ? globalThis.String(object.sms_password) : undefined,
502
492
  configPassword: isSet(object.config_password) ? globalThis.String(object.config_password) : undefined,
503
- test: isSet(object.test) ? long_1.default.fromValue(object.test) : undefined,
493
+ test: isSet(object.test) ? globalThis.Boolean(object.test) : false,
504
494
  simCardId: isSet(object.sim_card_id) ? globalThis.String(object.sim_card_id) : undefined,
505
- timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : "",
506
- isUnlimited: isSet(object.is_unlimited) ? long_1.default.fromValue(object.is_unlimited) : long_1.default.UZERO,
507
- tripType: isSet(object.trip_type) ? globalThis.String(object.trip_type) : undefined,
495
+ timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : undefined,
496
+ isUnlimited: isSet(object.is_unlimited) ? globalThis.Boolean(object.is_unlimited) : false,
497
+ tripType: isSet(object.trip_type) ? globalThis.String(object.trip_type) : "",
508
498
  receiveAt: isSet(object.receive_at) ? fromJsonTimestamp(object.receive_at) : undefined,
509
499
  expiresAt: isSet(object.expires_at) ? fromJsonTimestamp(object.expires_at) : undefined,
510
500
  connectAt: isSet(object.connect_at) ? fromJsonTimestamp(object.connect_at) : undefined,
511
501
  createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
512
502
  updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
513
- iconId: isSet(object.icon_id) ? long_1.default.fromValue(object.icon_id) : undefined,
514
- active: isSet(object.active) ? globalThis.Boolean(object.active) : false,
515
503
  icon: isSet(object.icon) ? exports.DeviceIcon.fromJSON(object.icon) : undefined,
516
504
  tracker: isSet(object.tracker) ? exports.Tracker.fromJSON(object.tracker) : undefined,
517
505
  car: isSet(object.object) ? exports.Car.fromJSON(object.object) : undefined,
@@ -528,44 +516,47 @@ exports.Device = {
528
516
  if (!message.id.equals(long_1.default.UZERO)) {
529
517
  obj.id = (message.id || long_1.default.UZERO).toString();
530
518
  }
531
- if (!message.organizationId.equals(long_1.default.UZERO)) {
519
+ if (message.organizationId !== undefined) {
532
520
  obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
533
521
  }
534
- if (!message.partnerId.equals(long_1.default.UZERO)) {
522
+ if (message.partnerId !== undefined) {
535
523
  obj.partner_id = (message.partnerId || long_1.default.UZERO).toString();
536
524
  }
537
525
  if (message.generation !== undefined) {
538
- obj.generation = (message.generation || long_1.default.UZERO).toString();
526
+ obj.generation = message.generation;
539
527
  }
540
528
  if (message.deviceId !== "") {
541
529
  obj.device_id = message.deviceId;
542
530
  }
543
- if (!message.objectId.equals(long_1.default.UZERO)) {
531
+ if (message.objectId !== undefined) {
544
532
  obj.object_id = (message.objectId || long_1.default.UZERO).toString();
545
533
  }
546
- if (message.objectType !== "") {
534
+ if (message.objectType !== undefined) {
547
535
  obj.object_type = message.objectType;
548
536
  }
549
- if (!message.trackerId.equals(long_1.default.UZERO)) {
537
+ if (message.trackerId !== undefined) {
550
538
  obj.tracker_id = (message.trackerId || long_1.default.UZERO).toString();
551
539
  }
552
- if (message.ownerId !== undefined) {
540
+ if (!message.ownerId.equals(long_1.default.UZERO)) {
553
541
  obj.owner_id = (message.ownerId || long_1.default.UZERO).toString();
554
542
  }
543
+ if (message.iconId !== undefined) {
544
+ obj.icon_id = (message.iconId || long_1.default.UZERO).toString();
545
+ }
555
546
  if (message.warehouseId !== undefined) {
556
547
  obj.warehouse_id = (message.warehouseId || long_1.default.UZERO).toString();
557
548
  }
558
- if (message.createdBy !== undefined) {
549
+ if (!message.createdBy.equals(long_1.default.UZERO)) {
559
550
  obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
560
551
  }
561
552
  if (message.simCard !== undefined) {
562
553
  obj.sim_card = message.simCard;
563
554
  }
564
555
  if (message.simProvider !== undefined) {
565
- obj.sim_provider = (message.simProvider || long_1.default.UZERO).toString();
556
+ obj.sim_provider = Math.round(message.simProvider);
566
557
  }
567
- if (!message.idChanged.equals(long_1.default.UZERO)) {
568
- obj.id_changed = (message.idChanged || long_1.default.UZERO).toString();
558
+ if (message.idChanged !== false) {
559
+ obj.id_changed = message.idChanged;
569
560
  }
570
561
  if (message.iccId !== undefined) {
571
562
  obj.icc_id = message.iccId;
@@ -579,19 +570,19 @@ exports.Device = {
579
570
  if (message.configPassword !== undefined) {
580
571
  obj.config_password = message.configPassword;
581
572
  }
582
- if (message.test !== undefined) {
583
- obj.test = (message.test || long_1.default.UZERO).toString();
573
+ if (message.test !== false) {
574
+ obj.test = message.test;
584
575
  }
585
576
  if (message.simCardId !== undefined) {
586
577
  obj.sim_card_id = message.simCardId;
587
578
  }
588
- if (message.timezone !== "") {
579
+ if (message.timezone !== undefined) {
589
580
  obj.timezone = message.timezone;
590
581
  }
591
- if (!message.isUnlimited.equals(long_1.default.UZERO)) {
592
- obj.is_unlimited = (message.isUnlimited || long_1.default.UZERO).toString();
582
+ if (message.isUnlimited !== false) {
583
+ obj.is_unlimited = message.isUnlimited;
593
584
  }
594
- if (message.tripType !== undefined) {
585
+ if (message.tripType !== "") {
595
586
  obj.trip_type = message.tripType;
596
587
  }
597
588
  if (message.receiveAt !== undefined) {
@@ -609,12 +600,6 @@ exports.Device = {
609
600
  if (message.updatedAt !== undefined) {
610
601
  obj.updated_at = message.updatedAt.toISOString();
611
602
  }
612
- if (message.iconId !== undefined) {
613
- obj.icon_id = (message.iconId || long_1.default.UZERO).toString();
614
- }
615
- if (message.active !== false) {
616
- obj.active = message.active;
617
- }
618
603
  if (message.icon !== undefined) {
619
604
  obj.icon = exports.DeviceIcon.toJSON(message.icon);
620
605
  }
@@ -639,62 +624,53 @@ exports.Device = {
639
624
  return exports.Device.fromPartial(base !== null && base !== void 0 ? base : {});
640
625
  },
641
626
  fromPartial(object) {
642
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
627
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
643
628
  const message = createBaseDevice();
644
629
  message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
645
630
  message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
646
631
  ? long_1.default.fromValue(object.organizationId)
647
- : long_1.default.UZERO;
632
+ : undefined;
648
633
  message.partnerId = (object.partnerId !== undefined && object.partnerId !== null)
649
634
  ? long_1.default.fromValue(object.partnerId)
650
- : long_1.default.UZERO;
651
- message.generation = (object.generation !== undefined && object.generation !== null)
652
- ? long_1.default.fromValue(object.generation)
653
635
  : undefined;
654
- message.deviceId = (_a = object.deviceId) !== null && _a !== void 0 ? _a : "";
636
+ message.generation = (_a = object.generation) !== null && _a !== void 0 ? _a : undefined;
637
+ message.deviceId = (_b = object.deviceId) !== null && _b !== void 0 ? _b : "";
655
638
  message.objectId = (object.objectId !== undefined && object.objectId !== null)
656
639
  ? long_1.default.fromValue(object.objectId)
657
- : long_1.default.UZERO;
658
- message.objectType = (_b = object.objectType) !== null && _b !== void 0 ? _b : "";
640
+ : undefined;
641
+ message.objectType = (_c = object.objectType) !== null && _c !== void 0 ? _c : undefined;
659
642
  message.trackerId = (object.trackerId !== undefined && object.trackerId !== null)
660
643
  ? long_1.default.fromValue(object.trackerId)
661
- : long_1.default.UZERO;
644
+ : undefined;
662
645
  message.ownerId = (object.ownerId !== undefined && object.ownerId !== null)
663
646
  ? long_1.default.fromValue(object.ownerId)
647
+ : long_1.default.UZERO;
648
+ message.iconId = (object.iconId !== undefined && object.iconId !== null)
649
+ ? long_1.default.fromValue(object.iconId)
664
650
  : undefined;
665
651
  message.warehouseId = (object.warehouseId !== undefined && object.warehouseId !== null)
666
652
  ? long_1.default.fromValue(object.warehouseId)
667
653
  : undefined;
668
654
  message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
669
655
  ? long_1.default.fromValue(object.createdBy)
670
- : undefined;
671
- message.simCard = (_c = object.simCard) !== null && _c !== void 0 ? _c : undefined;
672
- message.simProvider = (object.simProvider !== undefined && object.simProvider !== null)
673
- ? long_1.default.fromValue(object.simProvider)
674
- : undefined;
675
- message.idChanged = (object.idChanged !== undefined && object.idChanged !== null)
676
- ? long_1.default.fromValue(object.idChanged)
677
- : long_1.default.UZERO;
678
- message.iccId = (_d = object.iccId) !== null && _d !== void 0 ? _d : undefined;
679
- message.smsUsername = (_e = object.smsUsername) !== null && _e !== void 0 ? _e : undefined;
680
- message.smsPassword = (_f = object.smsPassword) !== null && _f !== void 0 ? _f : undefined;
681
- message.configPassword = (_g = object.configPassword) !== null && _g !== void 0 ? _g : undefined;
682
- message.test = (object.test !== undefined && object.test !== null) ? long_1.default.fromValue(object.test) : undefined;
683
- message.simCardId = (_h = object.simCardId) !== null && _h !== void 0 ? _h : undefined;
684
- message.timezone = (_j = object.timezone) !== null && _j !== void 0 ? _j : "";
685
- message.isUnlimited = (object.isUnlimited !== undefined && object.isUnlimited !== null)
686
- ? long_1.default.fromValue(object.isUnlimited)
687
656
  : long_1.default.UZERO;
688
- message.tripType = (_k = object.tripType) !== null && _k !== void 0 ? _k : undefined;
689
- message.receiveAt = (_l = object.receiveAt) !== null && _l !== void 0 ? _l : undefined;
690
- message.expiresAt = (_m = object.expiresAt) !== null && _m !== void 0 ? _m : undefined;
691
- message.connectAt = (_o = object.connectAt) !== null && _o !== void 0 ? _o : undefined;
692
- message.createdAt = (_p = object.createdAt) !== null && _p !== void 0 ? _p : undefined;
693
- message.updatedAt = (_q = object.updatedAt) !== null && _q !== void 0 ? _q : undefined;
694
- message.iconId = (object.iconId !== undefined && object.iconId !== null)
695
- ? long_1.default.fromValue(object.iconId)
696
- : undefined;
697
- message.active = (_r = object.active) !== null && _r !== void 0 ? _r : false;
657
+ message.simCard = (_d = object.simCard) !== null && _d !== void 0 ? _d : undefined;
658
+ message.simProvider = (_e = object.simProvider) !== null && _e !== void 0 ? _e : undefined;
659
+ message.idChanged = (_f = object.idChanged) !== null && _f !== void 0 ? _f : false;
660
+ message.iccId = (_g = object.iccId) !== null && _g !== void 0 ? _g : undefined;
661
+ message.smsUsername = (_h = object.smsUsername) !== null && _h !== void 0 ? _h : undefined;
662
+ message.smsPassword = (_j = object.smsPassword) !== null && _j !== void 0 ? _j : undefined;
663
+ message.configPassword = (_k = object.configPassword) !== null && _k !== void 0 ? _k : undefined;
664
+ message.test = (_l = object.test) !== null && _l !== void 0 ? _l : false;
665
+ message.simCardId = (_m = object.simCardId) !== null && _m !== void 0 ? _m : undefined;
666
+ message.timezone = (_o = object.timezone) !== null && _o !== void 0 ? _o : undefined;
667
+ message.isUnlimited = (_p = object.isUnlimited) !== null && _p !== void 0 ? _p : false;
668
+ message.tripType = (_q = object.tripType) !== null && _q !== void 0 ? _q : "";
669
+ message.receiveAt = (_r = object.receiveAt) !== null && _r !== void 0 ? _r : undefined;
670
+ message.expiresAt = (_s = object.expiresAt) !== null && _s !== void 0 ? _s : undefined;
671
+ message.connectAt = (_t = object.connectAt) !== null && _t !== void 0 ? _t : undefined;
672
+ message.createdAt = (_u = object.createdAt) !== null && _u !== void 0 ? _u : undefined;
673
+ message.updatedAt = (_v = object.updatedAt) !== null && _v !== void 0 ? _v : undefined;
698
674
  message.icon = (object.icon !== undefined && object.icon !== null)
699
675
  ? exports.DeviceIcon.fromPartial(object.icon)
700
676
  : undefined;
@@ -705,7 +681,7 @@ exports.Device = {
705
681
  message.deviceStatus = (object.deviceStatus !== undefined && object.deviceStatus !== null)
706
682
  ? dataModel_1.DeviceStatus.fromPartial(object.deviceStatus)
707
683
  : undefined;
708
- message.userDeviceIO = ((_s = object.userDeviceIO) === null || _s === void 0 ? void 0 : _s.map((e) => exports.SystemIo.fromPartial(e))) || [];
684
+ message.userDeviceIO = ((_w = object.userDeviceIO) === null || _w === void 0 ? void 0 : _w.map((e) => exports.SystemIo.fromPartial(e))) || [];
709
685
  message.owner = (object.owner !== undefined && object.owner !== null) ? identities_1.User.fromPartial(object.owner) : undefined;
710
686
  return message;
711
687
  },
@@ -714,16 +690,15 @@ function createBaseDeviceIcon() {
714
690
  return {
715
691
  id: long_1.default.UZERO,
716
692
  organizationId: long_1.default.UZERO,
717
- createdBy: long_1.default.UZERO,
718
- updatedBy: long_1.default.UZERO,
693
+ createdBy: undefined,
694
+ updatedBy: undefined,
719
695
  iconType: long_1.default.UZERO,
720
696
  imageType: long_1.default.UZERO,
721
697
  name: "",
722
698
  images: undefined,
723
- isDefault: long_1.default.UZERO,
699
+ isDefault: false,
724
700
  createdAt: undefined,
725
701
  updatedAt: undefined,
726
- fullImages: undefined,
727
702
  };
728
703
  }
729
704
  exports.DeviceIcon = {
@@ -734,10 +709,10 @@ exports.DeviceIcon = {
734
709
  if (!message.organizationId.equals(long_1.default.UZERO)) {
735
710
  writer.uint32(16).uint64(message.organizationId.toString());
736
711
  }
737
- if (!message.createdBy.equals(long_1.default.UZERO)) {
712
+ if (message.createdBy !== undefined) {
738
713
  writer.uint32(24).uint64(message.createdBy.toString());
739
714
  }
740
- if (!message.updatedBy.equals(long_1.default.UZERO)) {
715
+ if (message.updatedBy !== undefined) {
741
716
  writer.uint32(32).uint64(message.updatedBy.toString());
742
717
  }
743
718
  if (!message.iconType.equals(long_1.default.UZERO)) {
@@ -752,8 +727,8 @@ exports.DeviceIcon = {
752
727
  if (message.images !== undefined) {
753
728
  exports.DeviceIcon_Image.encode(message.images, writer.uint32(66).fork()).join();
754
729
  }
755
- if (!message.isDefault.equals(long_1.default.UZERO)) {
756
- writer.uint32(72).uint64(message.isDefault.toString());
730
+ if (message.isDefault !== false) {
731
+ writer.uint32(72).bool(message.isDefault);
757
732
  }
758
733
  if (message.createdAt !== undefined) {
759
734
  timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
@@ -761,9 +736,6 @@ exports.DeviceIcon = {
761
736
  if (message.updatedAt !== undefined) {
762
737
  timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
763
738
  }
764
- if (message.fullImages !== undefined) {
765
- exports.DeviceIcon_Image.encode(message.fullImages, writer.uint32(98).fork()).join();
766
- }
767
739
  return writer;
768
740
  },
769
741
  decode(input, length) {
@@ -833,7 +805,7 @@ exports.DeviceIcon = {
833
805
  if (tag !== 72) {
834
806
  break;
835
807
  }
836
- message.isDefault = long_1.default.fromString(reader.uint64().toString(), true);
808
+ message.isDefault = reader.bool();
837
809
  continue;
838
810
  }
839
811
  case 10: {
@@ -850,13 +822,6 @@ exports.DeviceIcon = {
850
822
  message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
851
823
  continue;
852
824
  }
853
- case 12: {
854
- if (tag !== 98) {
855
- break;
856
- }
857
- message.fullImages = exports.DeviceIcon_Image.decode(reader, reader.uint32());
858
- continue;
859
- }
860
825
  }
861
826
  if ((tag & 7) === 4 || tag === 0) {
862
827
  break;
@@ -869,16 +834,15 @@ exports.DeviceIcon = {
869
834
  return {
870
835
  id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
871
836
  organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
872
- createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : long_1.default.UZERO,
873
- updatedBy: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : long_1.default.UZERO,
837
+ createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
838
+ updatedBy: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : undefined,
874
839
  iconType: isSet(object.icon_type) ? long_1.default.fromValue(object.icon_type) : long_1.default.UZERO,
875
840
  imageType: isSet(object.image_type) ? long_1.default.fromValue(object.image_type) : long_1.default.UZERO,
876
841
  name: isSet(object.name) ? globalThis.String(object.name) : "",
877
842
  images: isSet(object.images) ? exports.DeviceIcon_Image.fromJSON(object.images) : undefined,
878
- isDefault: isSet(object.is_default) ? long_1.default.fromValue(object.is_default) : long_1.default.UZERO,
843
+ isDefault: isSet(object.is_default) ? globalThis.Boolean(object.is_default) : false,
879
844
  createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
880
845
  updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
881
- fullImages: isSet(object.full_images) ? exports.DeviceIcon_Image.fromJSON(object.full_images) : undefined,
882
846
  };
883
847
  },
884
848
  toJSON(message) {
@@ -889,10 +853,10 @@ exports.DeviceIcon = {
889
853
  if (!message.organizationId.equals(long_1.default.UZERO)) {
890
854
  obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
891
855
  }
892
- if (!message.createdBy.equals(long_1.default.UZERO)) {
856
+ if (message.createdBy !== undefined) {
893
857
  obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
894
858
  }
895
- if (!message.updatedBy.equals(long_1.default.UZERO)) {
859
+ if (message.updatedBy !== undefined) {
896
860
  obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
897
861
  }
898
862
  if (!message.iconType.equals(long_1.default.UZERO)) {
@@ -907,8 +871,8 @@ exports.DeviceIcon = {
907
871
  if (message.images !== undefined) {
908
872
  obj.images = exports.DeviceIcon_Image.toJSON(message.images);
909
873
  }
910
- if (!message.isDefault.equals(long_1.default.UZERO)) {
911
- obj.is_default = (message.isDefault || long_1.default.UZERO).toString();
874
+ if (message.isDefault !== false) {
875
+ obj.is_default = message.isDefault;
912
876
  }
913
877
  if (message.createdAt !== undefined) {
914
878
  obj.created_at = message.createdAt.toISOString();
@@ -916,16 +880,13 @@ exports.DeviceIcon = {
916
880
  if (message.updatedAt !== undefined) {
917
881
  obj.updated_at = message.updatedAt.toISOString();
918
882
  }
919
- if (message.fullImages !== undefined) {
920
- obj.full_images = exports.DeviceIcon_Image.toJSON(message.fullImages);
921
- }
922
883
  return obj;
923
884
  },
924
885
  create(base) {
925
886
  return exports.DeviceIcon.fromPartial(base !== null && base !== void 0 ? base : {});
926
887
  },
927
888
  fromPartial(object) {
928
- var _a, _b, _c;
889
+ var _a, _b, _c, _d;
929
890
  const message = createBaseDeviceIcon();
930
891
  message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
931
892
  message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
@@ -933,10 +894,10 @@ exports.DeviceIcon = {
933
894
  : long_1.default.UZERO;
934
895
  message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
935
896
  ? long_1.default.fromValue(object.createdBy)
936
- : long_1.default.UZERO;
897
+ : undefined;
937
898
  message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
938
899
  ? long_1.default.fromValue(object.updatedBy)
939
- : long_1.default.UZERO;
900
+ : undefined;
940
901
  message.iconType = (object.iconType !== undefined && object.iconType !== null)
941
902
  ? long_1.default.fromValue(object.iconType)
942
903
  : long_1.default.UZERO;
@@ -947,14 +908,9 @@ exports.DeviceIcon = {
947
908
  message.images = (object.images !== undefined && object.images !== null)
948
909
  ? exports.DeviceIcon_Image.fromPartial(object.images)
949
910
  : undefined;
950
- message.isDefault = (object.isDefault !== undefined && object.isDefault !== null)
951
- ? long_1.default.fromValue(object.isDefault)
952
- : long_1.default.UZERO;
953
- message.createdAt = (_b = object.createdAt) !== null && _b !== void 0 ? _b : undefined;
954
- message.updatedAt = (_c = object.updatedAt) !== null && _c !== void 0 ? _c : undefined;
955
- message.fullImages = (object.fullImages !== undefined && object.fullImages !== null)
956
- ? exports.DeviceIcon_Image.fromPartial(object.fullImages)
957
- : undefined;
911
+ message.isDefault = (_b = object.isDefault) !== null && _b !== void 0 ? _b : false;
912
+ message.createdAt = (_c = object.createdAt) !== null && _c !== void 0 ? _c : undefined;
913
+ message.updatedAt = (_d = object.updatedAt) !== null && _d !== void 0 ? _d : undefined;
958
914
  return message;
959
915
  },
960
916
  };
@@ -1075,11 +1031,11 @@ exports.DeviceIcon_Image = {
1075
1031
  function createBaseTracker() {
1076
1032
  return {
1077
1033
  id: long_1.default.UZERO,
1078
- name: undefined,
1034
+ name: "",
1079
1035
  picture: undefined,
1080
1036
  metadata: undefined,
1081
1037
  generation: undefined,
1082
- level: undefined,
1038
+ level: 0,
1083
1039
  parentId: undefined,
1084
1040
  createdBy: undefined,
1085
1041
  createdAt: undefined,
@@ -1092,7 +1048,7 @@ exports.Tracker = {
1092
1048
  if (!message.id.equals(long_1.default.UZERO)) {
1093
1049
  writer.uint32(8).uint64(message.id.toString());
1094
1050
  }
1095
- if (message.name !== undefined) {
1051
+ if (message.name !== "") {
1096
1052
  writer.uint32(18).string(message.name);
1097
1053
  }
1098
1054
  if (message.picture !== undefined) {
@@ -1104,8 +1060,8 @@ exports.Tracker = {
1104
1060
  if (message.generation !== undefined) {
1105
1061
  writer.uint32(42).string(message.generation);
1106
1062
  }
1107
- if (message.level !== undefined) {
1108
- writer.uint32(48).uint64(message.level.toString());
1063
+ if (message.level !== 0) {
1064
+ writer.uint32(48).uint32(message.level);
1109
1065
  }
1110
1066
  if (message.parentId !== undefined) {
1111
1067
  writer.uint32(56).uint64(message.parentId.toString());
@@ -1170,7 +1126,7 @@ exports.Tracker = {
1170
1126
  if (tag !== 48) {
1171
1127
  break;
1172
1128
  }
1173
- message.level = long_1.default.fromString(reader.uint64().toString(), true);
1129
+ message.level = reader.uint32();
1174
1130
  continue;
1175
1131
  }
1176
1132
  case 7: {
@@ -1219,11 +1175,11 @@ exports.Tracker = {
1219
1175
  fromJSON(object) {
1220
1176
  return {
1221
1177
  id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
1222
- name: isSet(object.name) ? globalThis.String(object.name) : undefined,
1178
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1223
1179
  picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
1224
1180
  metadata: isSet(object.metadata) ? exports.Tracker_Metadata.fromJSON(object.metadata) : undefined,
1225
1181
  generation: isSet(object.generation) ? globalThis.String(object.generation) : undefined,
1226
- level: isSet(object.level) ? long_1.default.fromValue(object.level) : undefined,
1182
+ level: isSet(object.level) ? globalThis.Number(object.level) : 0,
1227
1183
  parentId: isSet(object.parent_id) ? long_1.default.fromValue(object.parent_id) : undefined,
1228
1184
  createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
1229
1185
  createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
@@ -1239,7 +1195,7 @@ exports.Tracker = {
1239
1195
  if (!message.id.equals(long_1.default.UZERO)) {
1240
1196
  obj.id = (message.id || long_1.default.UZERO).toString();
1241
1197
  }
1242
- if (message.name !== undefined) {
1198
+ if (message.name !== "") {
1243
1199
  obj.name = message.name;
1244
1200
  }
1245
1201
  if (message.picture !== undefined) {
@@ -1251,8 +1207,8 @@ exports.Tracker = {
1251
1207
  if (message.generation !== undefined) {
1252
1208
  obj.generation = message.generation;
1253
1209
  }
1254
- if (message.level !== undefined) {
1255
- obj.level = (message.level || long_1.default.UZERO).toString();
1210
+ if (message.level !== 0) {
1211
+ obj.level = Math.round(message.level);
1256
1212
  }
1257
1213
  if (message.parentId !== undefined) {
1258
1214
  obj.parent_id = (message.parentId || long_1.default.UZERO).toString();
@@ -1275,25 +1231,25 @@ exports.Tracker = {
1275
1231
  return exports.Tracker.fromPartial(base !== null && base !== void 0 ? base : {});
1276
1232
  },
1277
1233
  fromPartial(object) {
1278
- var _a, _b, _c, _d, _e, _f;
1234
+ var _a, _b, _c, _d, _e, _f, _g;
1279
1235
  const message = createBaseTracker();
1280
1236
  message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
1281
- message.name = (_a = object.name) !== null && _a !== void 0 ? _a : undefined;
1237
+ message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
1282
1238
  message.picture = (_b = object.picture) !== null && _b !== void 0 ? _b : undefined;
1283
1239
  message.metadata = (object.metadata !== undefined && object.metadata !== null)
1284
1240
  ? exports.Tracker_Metadata.fromPartial(object.metadata)
1285
1241
  : undefined;
1286
1242
  message.generation = (_c = object.generation) !== null && _c !== void 0 ? _c : undefined;
1287
- message.level = (object.level !== undefined && object.level !== null) ? long_1.default.fromValue(object.level) : undefined;
1243
+ message.level = (_d = object.level) !== null && _d !== void 0 ? _d : 0;
1288
1244
  message.parentId = (object.parentId !== undefined && object.parentId !== null)
1289
1245
  ? long_1.default.fromValue(object.parentId)
1290
1246
  : undefined;
1291
1247
  message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
1292
1248
  ? long_1.default.fromValue(object.createdBy)
1293
1249
  : undefined;
1294
- message.createdAt = (_d = object.createdAt) !== null && _d !== void 0 ? _d : undefined;
1295
- message.updatedAt = (_e = object.updatedAt) !== null && _e !== void 0 ? _e : undefined;
1296
- message.documents = ((_f = object.documents) === null || _f === void 0 ? void 0 : _f.map((e) => exports.Tracker_Document.fromPartial(e))) || [];
1250
+ message.createdAt = (_e = object.createdAt) !== null && _e !== void 0 ? _e : undefined;
1251
+ message.updatedAt = (_f = object.updatedAt) !== null && _f !== void 0 ? _f : undefined;
1252
+ message.documents = ((_g = object.documents) === null || _g === void 0 ? void 0 : _g.map((e) => exports.Tracker_Document.fromPartial(e))) || [];
1297
1253
  return message;
1298
1254
  },
1299
1255
  };
@@ -1810,126 +1766,66 @@ exports.Tracker_Document = {
1810
1766
  return message;
1811
1767
  },
1812
1768
  };
1813
- function createBaseCar() {
1769
+ function createBaseCarModel() {
1814
1770
  return {
1815
1771
  id: long_1.default.UZERO,
1816
- organizationId: long_1.default.UZERO,
1817
- createdBy: undefined,
1818
- updatedBy: undefined,
1772
+ carBrandId: long_1.default.UZERO,
1819
1773
  name: "",
1820
1774
  picture: undefined,
1821
- plateNumber: undefined,
1822
- carGroupId: undefined,
1823
- carType: undefined,
1824
- code: undefined,
1825
- tonnage: undefined,
1826
- maxSpeed: undefined,
1827
- vin: undefined,
1828
- engineNumber: undefined,
1829
- chassisNumber: undefined,
1830
- modelYear: undefined,
1831
- fuelUsage: undefined,
1832
- fuelUsagePerHour: undefined,
1833
- fuelType: undefined,
1834
- fuelCapacity: undefined,
1835
1775
  description: undefined,
1836
- guarantyExpirationDate: undefined,
1837
- guarantyExpirationKm: undefined,
1838
- color: undefined,
1776
+ sord: undefined,
1777
+ isActive: false,
1778
+ createdBy: undefined,
1779
+ updatedBy: undefined,
1780
+ metadata: [],
1839
1781
  createdAt: undefined,
1840
1782
  updatedAt: undefined,
1841
- model: undefined,
1842
1783
  };
1843
1784
  }
1844
- exports.Car = {
1785
+ exports.CarModel = {
1845
1786
  encode(message, writer = new wire_1.BinaryWriter()) {
1846
1787
  if (!message.id.equals(long_1.default.UZERO)) {
1847
1788
  writer.uint32(8).uint64(message.id.toString());
1848
1789
  }
1849
- if (!message.organizationId.equals(long_1.default.UZERO)) {
1850
- writer.uint32(16).uint64(message.organizationId.toString());
1851
- }
1852
- if (message.createdBy !== undefined) {
1853
- writer.uint32(24).uint64(message.createdBy.toString());
1854
- }
1855
- if (message.updatedBy !== undefined) {
1856
- writer.uint32(32).uint64(message.updatedBy.toString());
1790
+ if (!message.carBrandId.equals(long_1.default.UZERO)) {
1791
+ writer.uint32(16).uint64(message.carBrandId.toString());
1857
1792
  }
1858
1793
  if (message.name !== "") {
1859
- writer.uint32(42).string(message.name);
1794
+ writer.uint32(26).string(message.name);
1860
1795
  }
1861
1796
  if (message.picture !== undefined) {
1862
- writer.uint32(50).string(message.picture);
1863
- }
1864
- if (message.plateNumber !== undefined) {
1865
- writer.uint32(218).string(message.plateNumber);
1866
- }
1867
- if (message.carGroupId !== undefined) {
1868
- writer.uint32(56).uint64(message.carGroupId.toString());
1869
- }
1870
- if (message.carType !== undefined) {
1871
- writer.uint32(64).uint64(message.carType.toString());
1872
- }
1873
- if (message.code !== undefined) {
1874
- writer.uint32(74).string(message.code);
1875
- }
1876
- if (message.tonnage !== undefined) {
1877
- writer.uint32(80).uint64(message.tonnage.toString());
1878
- }
1879
- if (message.maxSpeed !== undefined) {
1880
- writer.uint32(88).uint64(message.maxSpeed.toString());
1881
- }
1882
- if (message.vin !== undefined) {
1883
- writer.uint32(98).string(message.vin);
1884
- }
1885
- if (message.engineNumber !== undefined) {
1886
- writer.uint32(106).string(message.engineNumber);
1887
- }
1888
- if (message.chassisNumber !== undefined) {
1889
- writer.uint32(114).string(message.chassisNumber);
1890
- }
1891
- if (message.modelYear !== undefined) {
1892
- writer.uint32(120).int32(message.modelYear);
1893
- }
1894
- if (message.fuelUsage !== undefined) {
1895
- writer.uint32(133).float(message.fuelUsage);
1896
- }
1897
- if (message.fuelUsagePerHour !== undefined) {
1898
- writer.uint32(141).float(message.fuelUsagePerHour);
1797
+ writer.uint32(34).string(message.picture);
1899
1798
  }
1900
- if (message.fuelType !== undefined) {
1901
- writer.uint32(146).string(message.fuelType);
1799
+ if (message.description !== undefined) {
1800
+ writer.uint32(42).string(message.description);
1902
1801
  }
1903
- if (message.fuelCapacity !== undefined) {
1904
- writer.uint32(157).float(message.fuelCapacity);
1802
+ if (message.sord !== undefined) {
1803
+ writer.uint32(48).int32(message.sord);
1905
1804
  }
1906
- if (message.description !== undefined) {
1907
- writer.uint32(162).string(message.description);
1805
+ if (message.isActive !== false) {
1806
+ writer.uint32(56).bool(message.isActive);
1908
1807
  }
1909
- if (message.guarantyExpirationDate !== undefined) {
1910
- timestamp_1.Timestamp.encode(toTimestamp(message.guarantyExpirationDate), writer.uint32(170).fork()).join();
1808
+ if (message.createdBy !== undefined) {
1809
+ writer.uint32(64).uint64(message.createdBy.toString());
1911
1810
  }
1912
- if (message.guarantyExpirationKm !== undefined) {
1913
- writer.uint32(176).uint64(message.guarantyExpirationKm.toString());
1811
+ if (message.updatedBy !== undefined) {
1812
+ writer.uint32(72).uint64(message.updatedBy.toString());
1914
1813
  }
1915
- if (message.color !== undefined) {
1916
- writer.uint32(186).string(message.color);
1814
+ for (const v of message.metadata) {
1815
+ exports.CarModel_Metadata.encode(v, writer.uint32(82).fork()).join();
1917
1816
  }
1918
1817
  if (message.createdAt !== undefined) {
1919
- timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(194).fork()).join();
1818
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(90).fork()).join();
1920
1819
  }
1921
1820
  if (message.updatedAt !== undefined) {
1922
- timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(202).fork()).join();
1923
- }
1924
- if (message.model !== undefined) {
1925
- exports.Car_Model.encode(message.model, writer.uint32(210).fork()).join();
1821
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(98).fork()).join();
1926
1822
  }
1927
1823
  return writer;
1928
1824
  },
1929
1825
  decode(input, length) {
1930
1826
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1931
1827
  const end = length === undefined ? reader.len : reader.pos + length;
1932
- const message = createBaseCar();
1828
+ const message = createBaseCarModel();
1933
1829
  while (reader.pos < end) {
1934
1830
  const tag = reader.uint32();
1935
1831
  switch (tag >>> 3) {
@@ -1944,184 +1840,79 @@ exports.Car = {
1944
1840
  if (tag !== 16) {
1945
1841
  break;
1946
1842
  }
1947
- message.organizationId = long_1.default.fromString(reader.uint64().toString(), true);
1843
+ message.carBrandId = long_1.default.fromString(reader.uint64().toString(), true);
1948
1844
  continue;
1949
1845
  }
1950
1846
  case 3: {
1951
- if (tag !== 24) {
1847
+ if (tag !== 26) {
1952
1848
  break;
1953
1849
  }
1954
- message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
1850
+ message.name = reader.string();
1955
1851
  continue;
1956
1852
  }
1957
1853
  case 4: {
1958
- if (tag !== 32) {
1854
+ if (tag !== 34) {
1959
1855
  break;
1960
1856
  }
1961
- message.updatedBy = long_1.default.fromString(reader.uint64().toString(), true);
1857
+ message.picture = reader.string();
1962
1858
  continue;
1963
1859
  }
1964
1860
  case 5: {
1965
1861
  if (tag !== 42) {
1966
1862
  break;
1967
1863
  }
1968
- message.name = reader.string();
1864
+ message.description = reader.string();
1969
1865
  continue;
1970
1866
  }
1971
1867
  case 6: {
1972
- if (tag !== 50) {
1973
- break;
1974
- }
1975
- message.picture = reader.string();
1976
- continue;
1977
- }
1978
- case 27: {
1979
- if (tag !== 218) {
1868
+ if (tag !== 48) {
1980
1869
  break;
1981
1870
  }
1982
- message.plateNumber = reader.string();
1871
+ message.sord = reader.int32();
1983
1872
  continue;
1984
1873
  }
1985
1874
  case 7: {
1986
1875
  if (tag !== 56) {
1987
1876
  break;
1988
1877
  }
1989
- message.carGroupId = long_1.default.fromString(reader.uint64().toString(), true);
1878
+ message.isActive = reader.bool();
1990
1879
  continue;
1991
1880
  }
1992
1881
  case 8: {
1993
1882
  if (tag !== 64) {
1994
1883
  break;
1995
1884
  }
1996
- message.carType = long_1.default.fromString(reader.uint64().toString(), true);
1885
+ message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
1997
1886
  continue;
1998
1887
  }
1999
1888
  case 9: {
2000
- if (tag !== 74) {
1889
+ if (tag !== 72) {
2001
1890
  break;
2002
1891
  }
2003
- message.code = reader.string();
1892
+ message.updatedBy = long_1.default.fromString(reader.uint64().toString(), true);
2004
1893
  continue;
2005
1894
  }
2006
1895
  case 10: {
2007
- if (tag !== 80) {
1896
+ if (tag !== 82) {
2008
1897
  break;
2009
1898
  }
2010
- message.tonnage = long_1.default.fromString(reader.uint64().toString(), true);
1899
+ message.metadata.push(exports.CarModel_Metadata.decode(reader, reader.uint32()));
2011
1900
  continue;
2012
1901
  }
2013
1902
  case 11: {
2014
- if (tag !== 88) {
1903
+ if (tag !== 90) {
2015
1904
  break;
2016
1905
  }
2017
- message.maxSpeed = long_1.default.fromString(reader.uint64().toString(), true);
1906
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2018
1907
  continue;
2019
1908
  }
2020
1909
  case 12: {
2021
1910
  if (tag !== 98) {
2022
1911
  break;
2023
1912
  }
2024
- message.vin = reader.string();
2025
- continue;
2026
- }
2027
- case 13: {
2028
- if (tag !== 106) {
2029
- break;
2030
- }
2031
- message.engineNumber = reader.string();
2032
- continue;
2033
- }
2034
- case 14: {
2035
- if (tag !== 114) {
2036
- break;
2037
- }
2038
- message.chassisNumber = reader.string();
2039
- continue;
2040
- }
2041
- case 15: {
2042
- if (tag !== 120) {
2043
- break;
2044
- }
2045
- message.modelYear = reader.int32();
2046
- continue;
2047
- }
2048
- case 16: {
2049
- if (tag !== 133) {
2050
- break;
2051
- }
2052
- message.fuelUsage = reader.float();
2053
- continue;
2054
- }
2055
- case 17: {
2056
- if (tag !== 141) {
2057
- break;
2058
- }
2059
- message.fuelUsagePerHour = reader.float();
2060
- continue;
2061
- }
2062
- case 18: {
2063
- if (tag !== 146) {
2064
- break;
2065
- }
2066
- message.fuelType = reader.string();
2067
- continue;
2068
- }
2069
- case 19: {
2070
- if (tag !== 157) {
2071
- break;
2072
- }
2073
- message.fuelCapacity = reader.float();
2074
- continue;
2075
- }
2076
- case 20: {
2077
- if (tag !== 162) {
2078
- break;
2079
- }
2080
- message.description = reader.string();
2081
- continue;
2082
- }
2083
- case 21: {
2084
- if (tag !== 170) {
2085
- break;
2086
- }
2087
- message.guarantyExpirationDate = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2088
- continue;
2089
- }
2090
- case 22: {
2091
- if (tag !== 176) {
2092
- break;
2093
- }
2094
- message.guarantyExpirationKm = long_1.default.fromString(reader.uint64().toString(), true);
2095
- continue;
2096
- }
2097
- case 23: {
2098
- if (tag !== 186) {
2099
- break;
2100
- }
2101
- message.color = reader.string();
2102
- continue;
2103
- }
2104
- case 24: {
2105
- if (tag !== 194) {
2106
- break;
2107
- }
2108
- message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2109
- continue;
2110
- }
2111
- case 25: {
2112
- if (tag !== 202) {
2113
- break;
2114
- }
2115
1913
  message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2116
1914
  continue;
2117
1915
  }
2118
- case 26: {
2119
- if (tag !== 210) {
2120
- break;
2121
- }
2122
- message.model = exports.Car_Model.decode(reader, reader.uint32());
2123
- continue;
2124
- }
2125
1916
  }
2126
1917
  if ((tag & 7) === 4 || tag === 0) {
2127
1918
  break;
@@ -2133,51 +1924,29 @@ exports.Car = {
2133
1924
  fromJSON(object) {
2134
1925
  return {
2135
1926
  id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
2136
- organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
2137
- createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
2138
- updatedBy: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : undefined,
1927
+ carBrandId: isSet(object.car_brand_id) ? long_1.default.fromValue(object.car_brand_id) : long_1.default.UZERO,
2139
1928
  name: isSet(object.name) ? globalThis.String(object.name) : "",
2140
1929
  picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
2141
- plateNumber: isSet(object.plate_number) ? globalThis.String(object.plate_number) : undefined,
2142
- carGroupId: isSet(object.car_group_id) ? long_1.default.fromValue(object.car_group_id) : undefined,
2143
- carType: isSet(object.car_type) ? long_1.default.fromValue(object.car_type) : undefined,
2144
- code: isSet(object.code) ? globalThis.String(object.code) : undefined,
2145
- tonnage: isSet(object.tonnage) ? long_1.default.fromValue(object.tonnage) : undefined,
2146
- maxSpeed: isSet(object.max_speed) ? long_1.default.fromValue(object.max_speed) : undefined,
2147
- vin: isSet(object.vin) ? globalThis.String(object.vin) : undefined,
2148
- engineNumber: isSet(object.engine_number) ? globalThis.String(object.engine_number) : undefined,
2149
- chassisNumber: isSet(object.chassis_number) ? globalThis.String(object.chassis_number) : undefined,
2150
- modelYear: isSet(object.model_year) ? globalThis.Number(object.model_year) : undefined,
2151
- fuelUsage: isSet(object.fuel_usage) ? globalThis.Number(object.fuel_usage) : undefined,
2152
- fuelUsagePerHour: isSet(object.fuel_usage_per_hour) ? globalThis.Number(object.fuel_usage_per_hour) : undefined,
2153
- fuelType: isSet(object.fuel_type) ? globalThis.String(object.fuel_type) : undefined,
2154
- fuelCapacity: isSet(object.fuel_capacity) ? globalThis.Number(object.fuel_capacity) : undefined,
2155
1930
  description: isSet(object.description) ? globalThis.String(object.description) : undefined,
2156
- guarantyExpirationDate: isSet(object.guaranty_expiration_date)
2157
- ? fromJsonTimestamp(object.guaranty_expiration_date)
2158
- : undefined,
2159
- guarantyExpirationKm: isSet(object.guaranty_expiration_km)
2160
- ? long_1.default.fromValue(object.guaranty_expiration_km)
2161
- : undefined,
2162
- color: isSet(object.color) ? globalThis.String(object.color) : undefined,
1931
+ sord: isSet(object.sord) ? globalThis.Number(object.sord) : undefined,
1932
+ isActive: isSet(object.is_active) ? globalThis.Boolean(object.is_active) : false,
1933
+ createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
1934
+ updatedBy: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : undefined,
1935
+ metadata: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.metadata)
1936
+ ? object.metadata.map((e) => exports.CarModel_Metadata.fromJSON(e))
1937
+ : [],
2163
1938
  createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
2164
1939
  updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
2165
- model: isSet(object.car_types) ? exports.Car_Model.fromJSON(object.car_types) : undefined,
2166
1940
  };
2167
1941
  },
2168
1942
  toJSON(message) {
1943
+ var _a;
2169
1944
  const obj = {};
2170
1945
  if (!message.id.equals(long_1.default.UZERO)) {
2171
1946
  obj.id = (message.id || long_1.default.UZERO).toString();
2172
1947
  }
2173
- if (!message.organizationId.equals(long_1.default.UZERO)) {
2174
- obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
2175
- }
2176
- if (message.createdBy !== undefined) {
2177
- obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
2178
- }
2179
- if (message.updatedBy !== undefined) {
2180
- obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
1948
+ if (!message.carBrandId.equals(long_1.default.UZERO)) {
1949
+ obj.car_brand_id = (message.carBrandId || long_1.default.UZERO).toString();
2181
1950
  }
2182
1951
  if (message.name !== "") {
2183
1952
  obj.name = message.name;
@@ -2185,59 +1954,23 @@ exports.Car = {
2185
1954
  if (message.picture !== undefined) {
2186
1955
  obj.picture = message.picture;
2187
1956
  }
2188
- if (message.plateNumber !== undefined) {
2189
- obj.plate_number = message.plateNumber;
2190
- }
2191
- if (message.carGroupId !== undefined) {
2192
- obj.car_group_id = (message.carGroupId || long_1.default.UZERO).toString();
2193
- }
2194
- if (message.carType !== undefined) {
2195
- obj.car_type = (message.carType || long_1.default.UZERO).toString();
2196
- }
2197
- if (message.code !== undefined) {
2198
- obj.code = message.code;
2199
- }
2200
- if (message.tonnage !== undefined) {
2201
- obj.tonnage = (message.tonnage || long_1.default.UZERO).toString();
2202
- }
2203
- if (message.maxSpeed !== undefined) {
2204
- obj.max_speed = (message.maxSpeed || long_1.default.UZERO).toString();
2205
- }
2206
- if (message.vin !== undefined) {
2207
- obj.vin = message.vin;
2208
- }
2209
- if (message.engineNumber !== undefined) {
2210
- obj.engine_number = message.engineNumber;
2211
- }
2212
- if (message.chassisNumber !== undefined) {
2213
- obj.chassis_number = message.chassisNumber;
2214
- }
2215
- if (message.modelYear !== undefined) {
2216
- obj.model_year = Math.round(message.modelYear);
2217
- }
2218
- if (message.fuelUsage !== undefined) {
2219
- obj.fuel_usage = message.fuelUsage;
2220
- }
2221
- if (message.fuelUsagePerHour !== undefined) {
2222
- obj.fuel_usage_per_hour = message.fuelUsagePerHour;
2223
- }
2224
- if (message.fuelType !== undefined) {
2225
- obj.fuel_type = message.fuelType;
2226
- }
2227
- if (message.fuelCapacity !== undefined) {
2228
- obj.fuel_capacity = message.fuelCapacity;
2229
- }
2230
1957
  if (message.description !== undefined) {
2231
1958
  obj.description = message.description;
2232
1959
  }
2233
- if (message.guarantyExpirationDate !== undefined) {
2234
- obj.guaranty_expiration_date = message.guarantyExpirationDate.toISOString();
1960
+ if (message.sord !== undefined) {
1961
+ obj.sord = Math.round(message.sord);
2235
1962
  }
2236
- if (message.guarantyExpirationKm !== undefined) {
2237
- obj.guaranty_expiration_km = (message.guarantyExpirationKm || long_1.default.UZERO).toString();
1963
+ if (message.isActive !== false) {
1964
+ obj.is_active = message.isActive;
2238
1965
  }
2239
- if (message.color !== undefined) {
2240
- obj.color = message.color;
1966
+ if (message.createdBy !== undefined) {
1967
+ obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
1968
+ }
1969
+ if (message.updatedBy !== undefined) {
1970
+ obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
1971
+ }
1972
+ if ((_a = message.metadata) === null || _a === void 0 ? void 0 : _a.length) {
1973
+ obj.metadata = message.metadata.map((e) => exports.CarModel_Metadata.toJSON(e));
2241
1974
  }
2242
1975
  if (message.createdAt !== undefined) {
2243
1976
  obj.created_at = message.createdAt.toISOString();
@@ -2245,103 +1978,155 @@ exports.Car = {
2245
1978
  if (message.updatedAt !== undefined) {
2246
1979
  obj.updated_at = message.updatedAt.toISOString();
2247
1980
  }
2248
- if (message.model !== undefined) {
2249
- obj.car_types = exports.Car_Model.toJSON(message.model);
2250
- }
2251
1981
  return obj;
2252
1982
  },
2253
1983
  create(base) {
2254
- return exports.Car.fromPartial(base !== null && base !== void 0 ? base : {});
1984
+ return exports.CarModel.fromPartial(base !== null && base !== void 0 ? base : {});
2255
1985
  },
2256
1986
  fromPartial(object) {
2257
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
2258
- const message = createBaseCar();
1987
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1988
+ const message = createBaseCarModel();
2259
1989
  message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
2260
- message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
2261
- ? long_1.default.fromValue(object.organizationId)
1990
+ message.carBrandId = (object.carBrandId !== undefined && object.carBrandId !== null)
1991
+ ? long_1.default.fromValue(object.carBrandId)
2262
1992
  : long_1.default.UZERO;
1993
+ message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
1994
+ message.picture = (_b = object.picture) !== null && _b !== void 0 ? _b : undefined;
1995
+ message.description = (_c = object.description) !== null && _c !== void 0 ? _c : undefined;
1996
+ message.sord = (_d = object.sord) !== null && _d !== void 0 ? _d : undefined;
1997
+ message.isActive = (_e = object.isActive) !== null && _e !== void 0 ? _e : false;
2263
1998
  message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2264
1999
  ? long_1.default.fromValue(object.createdBy)
2265
2000
  : undefined;
2266
2001
  message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
2267
2002
  ? long_1.default.fromValue(object.updatedBy)
2268
2003
  : undefined;
2269
- message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
2270
- message.picture = (_b = object.picture) !== null && _b !== void 0 ? _b : undefined;
2271
- message.plateNumber = (_c = object.plateNumber) !== null && _c !== void 0 ? _c : undefined;
2272
- message.carGroupId = (object.carGroupId !== undefined && object.carGroupId !== null)
2273
- ? long_1.default.fromValue(object.carGroupId)
2274
- : undefined;
2275
- message.carType = (object.carType !== undefined && object.carType !== null)
2276
- ? long_1.default.fromValue(object.carType)
2277
- : undefined;
2278
- message.code = (_d = object.code) !== null && _d !== void 0 ? _d : undefined;
2279
- message.tonnage = (object.tonnage !== undefined && object.tonnage !== null)
2280
- ? long_1.default.fromValue(object.tonnage)
2281
- : undefined;
2282
- message.maxSpeed = (object.maxSpeed !== undefined && object.maxSpeed !== null)
2283
- ? long_1.default.fromValue(object.maxSpeed)
2284
- : undefined;
2285
- message.vin = (_e = object.vin) !== null && _e !== void 0 ? _e : undefined;
2286
- message.engineNumber = (_f = object.engineNumber) !== null && _f !== void 0 ? _f : undefined;
2287
- message.chassisNumber = (_g = object.chassisNumber) !== null && _g !== void 0 ? _g : undefined;
2288
- message.modelYear = (_h = object.modelYear) !== null && _h !== void 0 ? _h : undefined;
2289
- message.fuelUsage = (_j = object.fuelUsage) !== null && _j !== void 0 ? _j : undefined;
2290
- message.fuelUsagePerHour = (_k = object.fuelUsagePerHour) !== null && _k !== void 0 ? _k : undefined;
2291
- message.fuelType = (_l = object.fuelType) !== null && _l !== void 0 ? _l : undefined;
2292
- message.fuelCapacity = (_m = object.fuelCapacity) !== null && _m !== void 0 ? _m : undefined;
2293
- message.description = (_o = object.description) !== null && _o !== void 0 ? _o : undefined;
2294
- message.guarantyExpirationDate = (_p = object.guarantyExpirationDate) !== null && _p !== void 0 ? _p : undefined;
2295
- message.guarantyExpirationKm = (object.guarantyExpirationKm !== undefined && object.guarantyExpirationKm !== null)
2296
- ? long_1.default.fromValue(object.guarantyExpirationKm)
2297
- : undefined;
2298
- message.color = (_q = object.color) !== null && _q !== void 0 ? _q : undefined;
2299
- message.createdAt = (_r = object.createdAt) !== null && _r !== void 0 ? _r : undefined;
2300
- message.updatedAt = (_s = object.updatedAt) !== null && _s !== void 0 ? _s : undefined;
2301
- message.model = (object.model !== undefined && object.model !== null)
2302
- ? exports.Car_Model.fromPartial(object.model)
2303
- : undefined;
2004
+ message.metadata = ((_f = object.metadata) === null || _f === void 0 ? void 0 : _f.map((e) => exports.CarModel_Metadata.fromPartial(e))) || [];
2005
+ message.createdAt = (_g = object.createdAt) !== null && _g !== void 0 ? _g : undefined;
2006
+ message.updatedAt = (_h = object.updatedAt) !== null && _h !== void 0 ? _h : undefined;
2304
2007
  return message;
2305
2008
  },
2306
2009
  };
2307
- function createBaseCar_Model() {
2010
+ function createBaseCarModel_Metadata() {
2011
+ return { key: undefined, name: undefined, value: undefined };
2012
+ }
2013
+ exports.CarModel_Metadata = {
2014
+ encode(message, writer = new wire_1.BinaryWriter()) {
2015
+ if (message.key !== undefined) {
2016
+ writer.uint32(10).string(message.key);
2017
+ }
2018
+ if (message.name !== undefined) {
2019
+ writer.uint32(18).string(message.name);
2020
+ }
2021
+ if (message.value !== undefined) {
2022
+ writer.uint32(26).string(message.value);
2023
+ }
2024
+ return writer;
2025
+ },
2026
+ decode(input, length) {
2027
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2028
+ const end = length === undefined ? reader.len : reader.pos + length;
2029
+ const message = createBaseCarModel_Metadata();
2030
+ while (reader.pos < end) {
2031
+ const tag = reader.uint32();
2032
+ switch (tag >>> 3) {
2033
+ case 1: {
2034
+ if (tag !== 10) {
2035
+ break;
2036
+ }
2037
+ message.key = reader.string();
2038
+ continue;
2039
+ }
2040
+ case 2: {
2041
+ if (tag !== 18) {
2042
+ break;
2043
+ }
2044
+ message.name = reader.string();
2045
+ continue;
2046
+ }
2047
+ case 3: {
2048
+ if (tag !== 26) {
2049
+ break;
2050
+ }
2051
+ message.value = reader.string();
2052
+ continue;
2053
+ }
2054
+ }
2055
+ if ((tag & 7) === 4 || tag === 0) {
2056
+ break;
2057
+ }
2058
+ reader.skip(tag & 7);
2059
+ }
2060
+ return message;
2061
+ },
2062
+ fromJSON(object) {
2063
+ return {
2064
+ key: isSet(object.key) ? globalThis.String(object.key) : undefined,
2065
+ name: isSet(object.name) ? globalThis.String(object.name) : undefined,
2066
+ value: isSet(object.value) ? globalThis.String(object.value) : undefined,
2067
+ };
2068
+ },
2069
+ toJSON(message) {
2070
+ const obj = {};
2071
+ if (message.key !== undefined) {
2072
+ obj.key = message.key;
2073
+ }
2074
+ if (message.name !== undefined) {
2075
+ obj.name = message.name;
2076
+ }
2077
+ if (message.value !== undefined) {
2078
+ obj.value = message.value;
2079
+ }
2080
+ return obj;
2081
+ },
2082
+ create(base) {
2083
+ return exports.CarModel_Metadata.fromPartial(base !== null && base !== void 0 ? base : {});
2084
+ },
2085
+ fromPartial(object) {
2086
+ var _a, _b, _c;
2087
+ const message = createBaseCarModel_Metadata();
2088
+ message.key = (_a = object.key) !== null && _a !== void 0 ? _a : undefined;
2089
+ message.name = (_b = object.name) !== null && _b !== void 0 ? _b : undefined;
2090
+ message.value = (_c = object.value) !== null && _c !== void 0 ? _c : undefined;
2091
+ return message;
2092
+ },
2093
+ };
2094
+ function createBaseCarBrand() {
2308
2095
  return {
2309
2096
  id: long_1.default.UZERO,
2310
- carBrandId: long_1.default.UZERO,
2097
+ carCategoryId: long_1.default.UZERO,
2311
2098
  name: "",
2312
- picture: undefined,
2313
2099
  description: undefined,
2100
+ picture: undefined,
2314
2101
  sord: undefined,
2315
- isActive: false,
2102
+ isActive: undefined,
2316
2103
  createdBy: undefined,
2317
2104
  updatedBy: undefined,
2318
- metadata: [],
2319
2105
  createdAt: undefined,
2320
2106
  updatedAt: undefined,
2321
- carBrand: undefined,
2322
2107
  };
2323
2108
  }
2324
- exports.Car_Model = {
2109
+ exports.CarBrand = {
2325
2110
  encode(message, writer = new wire_1.BinaryWriter()) {
2326
2111
  if (!message.id.equals(long_1.default.UZERO)) {
2327
2112
  writer.uint32(8).uint64(message.id.toString());
2328
2113
  }
2329
- if (!message.carBrandId.equals(long_1.default.UZERO)) {
2330
- writer.uint32(16).uint64(message.carBrandId.toString());
2114
+ if (!message.carCategoryId.equals(long_1.default.UZERO)) {
2115
+ writer.uint32(16).uint64(message.carCategoryId.toString());
2331
2116
  }
2332
2117
  if (message.name !== "") {
2333
2118
  writer.uint32(26).string(message.name);
2334
2119
  }
2335
- if (message.picture !== undefined) {
2336
- writer.uint32(34).string(message.picture);
2337
- }
2338
2120
  if (message.description !== undefined) {
2339
- writer.uint32(42).string(message.description);
2121
+ writer.uint32(34).string(message.description);
2122
+ }
2123
+ if (message.picture !== undefined) {
2124
+ writer.uint32(42).string(message.picture);
2340
2125
  }
2341
2126
  if (message.sord !== undefined) {
2342
2127
  writer.uint32(48).int32(message.sord);
2343
2128
  }
2344
- if (message.isActive !== false) {
2129
+ if (message.isActive !== undefined) {
2345
2130
  writer.uint32(56).bool(message.isActive);
2346
2131
  }
2347
2132
  if (message.createdBy !== undefined) {
@@ -2350,24 +2135,18 @@ exports.Car_Model = {
2350
2135
  if (message.updatedBy !== undefined) {
2351
2136
  writer.uint32(72).uint64(message.updatedBy.toString());
2352
2137
  }
2353
- for (const v of message.metadata) {
2354
- exports.Car_Model_Metadata.encode(v, writer.uint32(82).fork()).join();
2355
- }
2356
2138
  if (message.createdAt !== undefined) {
2357
- timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(90).fork()).join();
2139
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
2358
2140
  }
2359
2141
  if (message.updatedAt !== undefined) {
2360
- timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(98).fork()).join();
2361
- }
2362
- if (message.carBrand !== undefined) {
2363
- exports.Car_Brand.encode(message.carBrand, writer.uint32(106).fork()).join();
2142
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
2364
2143
  }
2365
2144
  return writer;
2366
2145
  },
2367
2146
  decode(input, length) {
2368
2147
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2369
2148
  const end = length === undefined ? reader.len : reader.pos + length;
2370
- const message = createBaseCar_Model();
2149
+ const message = createBaseCarBrand();
2371
2150
  while (reader.pos < end) {
2372
2151
  const tag = reader.uint32();
2373
2152
  switch (tag >>> 3) {
@@ -2382,7 +2161,7 @@ exports.Car_Model = {
2382
2161
  if (tag !== 16) {
2383
2162
  break;
2384
2163
  }
2385
- message.carBrandId = long_1.default.fromString(reader.uint64().toString(), true);
2164
+ message.carCategoryId = long_1.default.fromString(reader.uint64().toString(), true);
2386
2165
  continue;
2387
2166
  }
2388
2167
  case 3: {
@@ -2396,14 +2175,14 @@ exports.Car_Model = {
2396
2175
  if (tag !== 34) {
2397
2176
  break;
2398
2177
  }
2399
- message.picture = reader.string();
2178
+ message.description = reader.string();
2400
2179
  continue;
2401
2180
  }
2402
2181
  case 5: {
2403
2182
  if (tag !== 42) {
2404
2183
  break;
2405
2184
  }
2406
- message.description = reader.string();
2185
+ message.picture = reader.string();
2407
2186
  continue;
2408
2187
  }
2409
2188
  case 6: {
@@ -2438,30 +2217,16 @@ exports.Car_Model = {
2438
2217
  if (tag !== 82) {
2439
2218
  break;
2440
2219
  }
2441
- message.metadata.push(exports.Car_Model_Metadata.decode(reader, reader.uint32()));
2220
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2442
2221
  continue;
2443
2222
  }
2444
2223
  case 11: {
2445
2224
  if (tag !== 90) {
2446
2225
  break;
2447
2226
  }
2448
- message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2449
- continue;
2450
- }
2451
- case 12: {
2452
- if (tag !== 98) {
2453
- break;
2454
- }
2455
2227
  message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2456
2228
  continue;
2457
2229
  }
2458
- case 13: {
2459
- if (tag !== 106) {
2460
- break;
2461
- }
2462
- message.carBrand = exports.Car_Brand.decode(reader, reader.uint32());
2463
- continue;
2464
- }
2465
2230
  }
2466
2231
  if ((tag & 7) === 4 || tag === 0) {
2467
2232
  break;
@@ -2473,44 +2238,39 @@ exports.Car_Model = {
2473
2238
  fromJSON(object) {
2474
2239
  return {
2475
2240
  id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
2476
- carBrandId: isSet(object.car_brand_id) ? long_1.default.fromValue(object.car_brand_id) : long_1.default.UZERO,
2241
+ carCategoryId: isSet(object.car_category_id) ? long_1.default.fromValue(object.car_category_id) : long_1.default.UZERO,
2477
2242
  name: isSet(object.name) ? globalThis.String(object.name) : "",
2478
- picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
2479
2243
  description: isSet(object.description) ? globalThis.String(object.description) : undefined,
2244
+ picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
2480
2245
  sord: isSet(object.sord) ? globalThis.Number(object.sord) : undefined,
2481
- isActive: isSet(object.is_active) ? globalThis.Boolean(object.is_active) : false,
2246
+ isActive: isSet(object.is_active) ? globalThis.Boolean(object.is_active) : undefined,
2482
2247
  createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
2483
2248
  updatedBy: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : undefined,
2484
- metadata: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.metadata)
2485
- ? object.metadata.map((e) => exports.Car_Model_Metadata.fromJSON(e))
2486
- : [],
2487
2249
  createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
2488
2250
  updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
2489
- carBrand: isSet(object.car_brand) ? exports.Car_Brand.fromJSON(object.car_brand) : undefined,
2490
2251
  };
2491
2252
  },
2492
2253
  toJSON(message) {
2493
- var _a;
2494
2254
  const obj = {};
2495
2255
  if (!message.id.equals(long_1.default.UZERO)) {
2496
2256
  obj.id = (message.id || long_1.default.UZERO).toString();
2497
2257
  }
2498
- if (!message.carBrandId.equals(long_1.default.UZERO)) {
2499
- obj.car_brand_id = (message.carBrandId || long_1.default.UZERO).toString();
2258
+ if (!message.carCategoryId.equals(long_1.default.UZERO)) {
2259
+ obj.car_category_id = (message.carCategoryId || long_1.default.UZERO).toString();
2500
2260
  }
2501
2261
  if (message.name !== "") {
2502
2262
  obj.name = message.name;
2503
2263
  }
2504
- if (message.picture !== undefined) {
2505
- obj.picture = message.picture;
2506
- }
2507
2264
  if (message.description !== undefined) {
2508
2265
  obj.description = message.description;
2509
2266
  }
2267
+ if (message.picture !== undefined) {
2268
+ obj.picture = message.picture;
2269
+ }
2510
2270
  if (message.sord !== undefined) {
2511
2271
  obj.sord = Math.round(message.sord);
2512
2272
  }
2513
- if (message.isActive !== false) {
2273
+ if (message.isActive !== undefined) {
2514
2274
  obj.is_active = message.isActive;
2515
2275
  }
2516
2276
  if (message.createdBy !== undefined) {
@@ -2519,190 +2279,156 @@ exports.Car_Model = {
2519
2279
  if (message.updatedBy !== undefined) {
2520
2280
  obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
2521
2281
  }
2522
- if ((_a = message.metadata) === null || _a === void 0 ? void 0 : _a.length) {
2523
- obj.metadata = message.metadata.map((e) => exports.Car_Model_Metadata.toJSON(e));
2524
- }
2525
2282
  if (message.createdAt !== undefined) {
2526
2283
  obj.created_at = message.createdAt.toISOString();
2527
2284
  }
2528
2285
  if (message.updatedAt !== undefined) {
2529
2286
  obj.updated_at = message.updatedAt.toISOString();
2530
2287
  }
2531
- if (message.carBrand !== undefined) {
2532
- obj.car_brand = exports.Car_Brand.toJSON(message.carBrand);
2533
- }
2534
2288
  return obj;
2535
2289
  },
2536
2290
  create(base) {
2537
- return exports.Car_Model.fromPartial(base !== null && base !== void 0 ? base : {});
2291
+ return exports.CarBrand.fromPartial(base !== null && base !== void 0 ? base : {});
2538
2292
  },
2539
2293
  fromPartial(object) {
2540
- var _a, _b, _c, _d, _e, _f, _g, _h;
2541
- const message = createBaseCar_Model();
2294
+ var _a, _b, _c, _d, _e, _f, _g;
2295
+ const message = createBaseCarBrand();
2542
2296
  message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
2543
- message.carBrandId = (object.carBrandId !== undefined && object.carBrandId !== null)
2544
- ? long_1.default.fromValue(object.carBrandId)
2297
+ message.carCategoryId = (object.carCategoryId !== undefined && object.carCategoryId !== null)
2298
+ ? long_1.default.fromValue(object.carCategoryId)
2545
2299
  : long_1.default.UZERO;
2546
2300
  message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
2547
- message.picture = (_b = object.picture) !== null && _b !== void 0 ? _b : undefined;
2548
- message.description = (_c = object.description) !== null && _c !== void 0 ? _c : undefined;
2301
+ message.description = (_b = object.description) !== null && _b !== void 0 ? _b : undefined;
2302
+ message.picture = (_c = object.picture) !== null && _c !== void 0 ? _c : undefined;
2549
2303
  message.sord = (_d = object.sord) !== null && _d !== void 0 ? _d : undefined;
2550
- message.isActive = (_e = object.isActive) !== null && _e !== void 0 ? _e : false;
2304
+ message.isActive = (_e = object.isActive) !== null && _e !== void 0 ? _e : undefined;
2551
2305
  message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2552
2306
  ? long_1.default.fromValue(object.createdBy)
2553
2307
  : undefined;
2554
2308
  message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
2555
2309
  ? long_1.default.fromValue(object.updatedBy)
2556
2310
  : undefined;
2557
- message.metadata = ((_f = object.metadata) === null || _f === void 0 ? void 0 : _f.map((e) => exports.Car_Model_Metadata.fromPartial(e))) || [];
2558
- message.createdAt = (_g = object.createdAt) !== null && _g !== void 0 ? _g : undefined;
2559
- message.updatedAt = (_h = object.updatedAt) !== null && _h !== void 0 ? _h : undefined;
2560
- message.carBrand = (object.carBrand !== undefined && object.carBrand !== null)
2561
- ? exports.Car_Brand.fromPartial(object.carBrand)
2562
- : undefined;
2563
- return message;
2564
- },
2565
- };
2566
- function createBaseCar_Model_Metadata() {
2567
- return { key: undefined, name: undefined, value: undefined };
2568
- }
2569
- exports.Car_Model_Metadata = {
2570
- encode(message, writer = new wire_1.BinaryWriter()) {
2571
- if (message.key !== undefined) {
2572
- writer.uint32(10).string(message.key);
2573
- }
2574
- if (message.name !== undefined) {
2575
- writer.uint32(18).string(message.name);
2576
- }
2577
- if (message.value !== undefined) {
2578
- writer.uint32(26).string(message.value);
2579
- }
2580
- return writer;
2581
- },
2582
- decode(input, length) {
2583
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2584
- const end = length === undefined ? reader.len : reader.pos + length;
2585
- const message = createBaseCar_Model_Metadata();
2586
- while (reader.pos < end) {
2587
- const tag = reader.uint32();
2588
- switch (tag >>> 3) {
2589
- case 1: {
2590
- if (tag !== 10) {
2591
- break;
2592
- }
2593
- message.key = reader.string();
2594
- continue;
2595
- }
2596
- case 2: {
2597
- if (tag !== 18) {
2598
- break;
2599
- }
2600
- message.name = reader.string();
2601
- continue;
2602
- }
2603
- case 3: {
2604
- if (tag !== 26) {
2605
- break;
2606
- }
2607
- message.value = reader.string();
2608
- continue;
2609
- }
2610
- }
2611
- if ((tag & 7) === 4 || tag === 0) {
2612
- break;
2613
- }
2614
- reader.skip(tag & 7);
2615
- }
2616
- return message;
2617
- },
2618
- fromJSON(object) {
2619
- return {
2620
- key: isSet(object.key) ? globalThis.String(object.key) : undefined,
2621
- name: isSet(object.name) ? globalThis.String(object.name) : undefined,
2622
- value: isSet(object.value) ? globalThis.String(object.value) : undefined,
2623
- };
2624
- },
2625
- toJSON(message) {
2626
- const obj = {};
2627
- if (message.key !== undefined) {
2628
- obj.key = message.key;
2629
- }
2630
- if (message.name !== undefined) {
2631
- obj.name = message.name;
2632
- }
2633
- if (message.value !== undefined) {
2634
- obj.value = message.value;
2635
- }
2636
- return obj;
2637
- },
2638
- create(base) {
2639
- return exports.Car_Model_Metadata.fromPartial(base !== null && base !== void 0 ? base : {});
2640
- },
2641
- fromPartial(object) {
2642
- var _a, _b, _c;
2643
- const message = createBaseCar_Model_Metadata();
2644
- message.key = (_a = object.key) !== null && _a !== void 0 ? _a : undefined;
2645
- message.name = (_b = object.name) !== null && _b !== void 0 ? _b : undefined;
2646
- message.value = (_c = object.value) !== null && _c !== void 0 ? _c : undefined;
2311
+ message.createdAt = (_f = object.createdAt) !== null && _f !== void 0 ? _f : undefined;
2312
+ message.updatedAt = (_g = object.updatedAt) !== null && _g !== void 0 ? _g : undefined;
2647
2313
  return message;
2648
2314
  },
2649
2315
  };
2650
- function createBaseCar_Brand() {
2316
+ function createBaseCar() {
2651
2317
  return {
2652
2318
  id: long_1.default.UZERO,
2653
- carCategoryId: long_1.default.UZERO,
2654
- name: "",
2655
- description: undefined,
2656
- picture: undefined,
2657
- sord: undefined,
2658
- isActive: undefined,
2319
+ organizationId: long_1.default.UZERO,
2659
2320
  createdBy: undefined,
2660
2321
  updatedBy: undefined,
2322
+ name: "",
2323
+ picture: undefined,
2324
+ plateNumber: undefined,
2325
+ carGroupId: undefined,
2326
+ carType: undefined,
2327
+ code: undefined,
2328
+ tonnage: undefined,
2329
+ maxSpeed: undefined,
2330
+ vin: undefined,
2331
+ engineNumber: undefined,
2332
+ chassisNumber: undefined,
2333
+ modelYear: undefined,
2334
+ fuelUsage: undefined,
2335
+ fuelUsagePerHour: undefined,
2336
+ fuelType: undefined,
2337
+ fuelCapacity: undefined,
2338
+ description: undefined,
2339
+ guarantyExpirationDate: undefined,
2340
+ guarantyExpirationKm: undefined,
2341
+ color: undefined,
2661
2342
  createdAt: undefined,
2662
2343
  updatedAt: undefined,
2663
2344
  };
2664
2345
  }
2665
- exports.Car_Brand = {
2346
+ exports.Car = {
2666
2347
  encode(message, writer = new wire_1.BinaryWriter()) {
2667
2348
  if (!message.id.equals(long_1.default.UZERO)) {
2668
2349
  writer.uint32(8).uint64(message.id.toString());
2669
2350
  }
2670
- if (!message.carCategoryId.equals(long_1.default.UZERO)) {
2671
- writer.uint32(16).uint64(message.carCategoryId.toString());
2351
+ if (!message.organizationId.equals(long_1.default.UZERO)) {
2352
+ writer.uint32(16).uint64(message.organizationId.toString());
2672
2353
  }
2673
- if (message.name !== "") {
2674
- writer.uint32(26).string(message.name);
2354
+ if (message.createdBy !== undefined) {
2355
+ writer.uint32(24).uint64(message.createdBy.toString());
2675
2356
  }
2676
- if (message.description !== undefined) {
2677
- writer.uint32(34).string(message.description);
2357
+ if (message.updatedBy !== undefined) {
2358
+ writer.uint32(32).uint64(message.updatedBy.toString());
2359
+ }
2360
+ if (message.name !== "") {
2361
+ writer.uint32(42).string(message.name);
2678
2362
  }
2679
2363
  if (message.picture !== undefined) {
2680
- writer.uint32(42).string(message.picture);
2364
+ writer.uint32(50).string(message.picture);
2681
2365
  }
2682
- if (message.sord !== undefined) {
2683
- writer.uint32(48).int32(message.sord);
2366
+ if (message.plateNumber !== undefined) {
2367
+ writer.uint32(218).string(message.plateNumber);
2684
2368
  }
2685
- if (message.isActive !== undefined) {
2686
- writer.uint32(56).bool(message.isActive);
2369
+ if (message.carGroupId !== undefined) {
2370
+ writer.uint32(56).uint64(message.carGroupId.toString());
2687
2371
  }
2688
- if (message.createdBy !== undefined) {
2689
- writer.uint32(64).uint64(message.createdBy.toString());
2372
+ if (message.carType !== undefined) {
2373
+ writer.uint32(64).uint64(message.carType.toString());
2690
2374
  }
2691
- if (message.updatedBy !== undefined) {
2692
- writer.uint32(72).uint64(message.updatedBy.toString());
2375
+ if (message.code !== undefined) {
2376
+ writer.uint32(74).string(message.code);
2377
+ }
2378
+ if (message.tonnage !== undefined) {
2379
+ writer.uint32(80).uint64(message.tonnage.toString());
2380
+ }
2381
+ if (message.maxSpeed !== undefined) {
2382
+ writer.uint32(88).uint64(message.maxSpeed.toString());
2383
+ }
2384
+ if (message.vin !== undefined) {
2385
+ writer.uint32(98).string(message.vin);
2386
+ }
2387
+ if (message.engineNumber !== undefined) {
2388
+ writer.uint32(106).string(message.engineNumber);
2389
+ }
2390
+ if (message.chassisNumber !== undefined) {
2391
+ writer.uint32(114).string(message.chassisNumber);
2392
+ }
2393
+ if (message.modelYear !== undefined) {
2394
+ writer.uint32(120).int32(message.modelYear);
2395
+ }
2396
+ if (message.fuelUsage !== undefined) {
2397
+ writer.uint32(133).float(message.fuelUsage);
2398
+ }
2399
+ if (message.fuelUsagePerHour !== undefined) {
2400
+ writer.uint32(141).float(message.fuelUsagePerHour);
2401
+ }
2402
+ if (message.fuelType !== undefined) {
2403
+ writer.uint32(146).string(message.fuelType);
2404
+ }
2405
+ if (message.fuelCapacity !== undefined) {
2406
+ writer.uint32(157).float(message.fuelCapacity);
2407
+ }
2408
+ if (message.description !== undefined) {
2409
+ writer.uint32(162).string(message.description);
2410
+ }
2411
+ if (message.guarantyExpirationDate !== undefined) {
2412
+ timestamp_1.Timestamp.encode(toTimestamp(message.guarantyExpirationDate), writer.uint32(170).fork()).join();
2413
+ }
2414
+ if (message.guarantyExpirationKm !== undefined) {
2415
+ writer.uint32(176).uint64(message.guarantyExpirationKm.toString());
2416
+ }
2417
+ if (message.color !== undefined) {
2418
+ writer.uint32(186).string(message.color);
2693
2419
  }
2694
2420
  if (message.createdAt !== undefined) {
2695
- timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
2421
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(194).fork()).join();
2696
2422
  }
2697
2423
  if (message.updatedAt !== undefined) {
2698
- timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
2424
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(202).fork()).join();
2699
2425
  }
2700
2426
  return writer;
2701
2427
  },
2702
2428
  decode(input, length) {
2703
2429
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2704
2430
  const end = length === undefined ? reader.len : reader.pos + length;
2705
- const message = createBaseCar_Brand();
2431
+ const message = createBaseCar();
2706
2432
  while (reader.pos < end) {
2707
2433
  const tag = reader.uint32();
2708
2434
  switch (tag >>> 3) {
@@ -2710,74 +2436,179 @@ exports.Car_Brand = {
2710
2436
  if (tag !== 8) {
2711
2437
  break;
2712
2438
  }
2713
- message.id = long_1.default.fromString(reader.uint64().toString(), true);
2439
+ message.id = long_1.default.fromString(reader.uint64().toString(), true);
2440
+ continue;
2441
+ }
2442
+ case 2: {
2443
+ if (tag !== 16) {
2444
+ break;
2445
+ }
2446
+ message.organizationId = long_1.default.fromString(reader.uint64().toString(), true);
2447
+ continue;
2448
+ }
2449
+ case 3: {
2450
+ if (tag !== 24) {
2451
+ break;
2452
+ }
2453
+ message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
2454
+ continue;
2455
+ }
2456
+ case 4: {
2457
+ if (tag !== 32) {
2458
+ break;
2459
+ }
2460
+ message.updatedBy = long_1.default.fromString(reader.uint64().toString(), true);
2461
+ continue;
2462
+ }
2463
+ case 5: {
2464
+ if (tag !== 42) {
2465
+ break;
2466
+ }
2467
+ message.name = reader.string();
2468
+ continue;
2469
+ }
2470
+ case 6: {
2471
+ if (tag !== 50) {
2472
+ break;
2473
+ }
2474
+ message.picture = reader.string();
2475
+ continue;
2476
+ }
2477
+ case 27: {
2478
+ if (tag !== 218) {
2479
+ break;
2480
+ }
2481
+ message.plateNumber = reader.string();
2482
+ continue;
2483
+ }
2484
+ case 7: {
2485
+ if (tag !== 56) {
2486
+ break;
2487
+ }
2488
+ message.carGroupId = long_1.default.fromString(reader.uint64().toString(), true);
2489
+ continue;
2490
+ }
2491
+ case 8: {
2492
+ if (tag !== 64) {
2493
+ break;
2494
+ }
2495
+ message.carType = long_1.default.fromString(reader.uint64().toString(), true);
2714
2496
  continue;
2715
2497
  }
2716
- case 2: {
2717
- if (tag !== 16) {
2498
+ case 9: {
2499
+ if (tag !== 74) {
2718
2500
  break;
2719
2501
  }
2720
- message.carCategoryId = long_1.default.fromString(reader.uint64().toString(), true);
2502
+ message.code = reader.string();
2721
2503
  continue;
2722
2504
  }
2723
- case 3: {
2724
- if (tag !== 26) {
2505
+ case 10: {
2506
+ if (tag !== 80) {
2725
2507
  break;
2726
2508
  }
2727
- message.name = reader.string();
2509
+ message.tonnage = long_1.default.fromString(reader.uint64().toString(), true);
2728
2510
  continue;
2729
2511
  }
2730
- case 4: {
2731
- if (tag !== 34) {
2512
+ case 11: {
2513
+ if (tag !== 88) {
2732
2514
  break;
2733
2515
  }
2734
- message.description = reader.string();
2516
+ message.maxSpeed = long_1.default.fromString(reader.uint64().toString(), true);
2735
2517
  continue;
2736
2518
  }
2737
- case 5: {
2738
- if (tag !== 42) {
2519
+ case 12: {
2520
+ if (tag !== 98) {
2739
2521
  break;
2740
2522
  }
2741
- message.picture = reader.string();
2523
+ message.vin = reader.string();
2742
2524
  continue;
2743
2525
  }
2744
- case 6: {
2745
- if (tag !== 48) {
2526
+ case 13: {
2527
+ if (tag !== 106) {
2746
2528
  break;
2747
2529
  }
2748
- message.sord = reader.int32();
2530
+ message.engineNumber = reader.string();
2749
2531
  continue;
2750
2532
  }
2751
- case 7: {
2752
- if (tag !== 56) {
2533
+ case 14: {
2534
+ if (tag !== 114) {
2753
2535
  break;
2754
2536
  }
2755
- message.isActive = reader.bool();
2537
+ message.chassisNumber = reader.string();
2756
2538
  continue;
2757
2539
  }
2758
- case 8: {
2759
- if (tag !== 64) {
2540
+ case 15: {
2541
+ if (tag !== 120) {
2760
2542
  break;
2761
2543
  }
2762
- message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
2544
+ message.modelYear = reader.int32();
2763
2545
  continue;
2764
2546
  }
2765
- case 9: {
2766
- if (tag !== 72) {
2547
+ case 16: {
2548
+ if (tag !== 133) {
2767
2549
  break;
2768
2550
  }
2769
- message.updatedBy = long_1.default.fromString(reader.uint64().toString(), true);
2551
+ message.fuelUsage = reader.float();
2770
2552
  continue;
2771
2553
  }
2772
- case 10: {
2773
- if (tag !== 82) {
2554
+ case 17: {
2555
+ if (tag !== 141) {
2556
+ break;
2557
+ }
2558
+ message.fuelUsagePerHour = reader.float();
2559
+ continue;
2560
+ }
2561
+ case 18: {
2562
+ if (tag !== 146) {
2563
+ break;
2564
+ }
2565
+ message.fuelType = reader.string();
2566
+ continue;
2567
+ }
2568
+ case 19: {
2569
+ if (tag !== 157) {
2570
+ break;
2571
+ }
2572
+ message.fuelCapacity = reader.float();
2573
+ continue;
2574
+ }
2575
+ case 20: {
2576
+ if (tag !== 162) {
2577
+ break;
2578
+ }
2579
+ message.description = reader.string();
2580
+ continue;
2581
+ }
2582
+ case 21: {
2583
+ if (tag !== 170) {
2584
+ break;
2585
+ }
2586
+ message.guarantyExpirationDate = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2587
+ continue;
2588
+ }
2589
+ case 22: {
2590
+ if (tag !== 176) {
2591
+ break;
2592
+ }
2593
+ message.guarantyExpirationKm = long_1.default.fromString(reader.uint64().toString(), true);
2594
+ continue;
2595
+ }
2596
+ case 23: {
2597
+ if (tag !== 186) {
2598
+ break;
2599
+ }
2600
+ message.color = reader.string();
2601
+ continue;
2602
+ }
2603
+ case 24: {
2604
+ if (tag !== 194) {
2774
2605
  break;
2775
2606
  }
2776
2607
  message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2777
2608
  continue;
2778
2609
  }
2779
- case 11: {
2780
- if (tag !== 90) {
2610
+ case 25: {
2611
+ if (tag !== 202) {
2781
2612
  break;
2782
2613
  }
2783
2614
  message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
@@ -2794,14 +2625,33 @@ exports.Car_Brand = {
2794
2625
  fromJSON(object) {
2795
2626
  return {
2796
2627
  id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
2797
- carCategoryId: isSet(object.car_category_id) ? long_1.default.fromValue(object.car_category_id) : long_1.default.UZERO,
2798
- name: isSet(object.name) ? globalThis.String(object.name) : "",
2799
- description: isSet(object.description) ? globalThis.String(object.description) : undefined,
2800
- picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
2801
- sord: isSet(object.sord) ? globalThis.Number(object.sord) : undefined,
2802
- isActive: isSet(object.is_active) ? globalThis.Boolean(object.is_active) : undefined,
2628
+ organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
2803
2629
  createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
2804
2630
  updatedBy: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : undefined,
2631
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2632
+ picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
2633
+ plateNumber: isSet(object.plate_number) ? globalThis.String(object.plate_number) : undefined,
2634
+ carGroupId: isSet(object.car_group_id) ? long_1.default.fromValue(object.car_group_id) : undefined,
2635
+ carType: isSet(object.car_type) ? long_1.default.fromValue(object.car_type) : undefined,
2636
+ code: isSet(object.code) ? globalThis.String(object.code) : undefined,
2637
+ tonnage: isSet(object.tonnage) ? long_1.default.fromValue(object.tonnage) : undefined,
2638
+ maxSpeed: isSet(object.max_speed) ? long_1.default.fromValue(object.max_speed) : undefined,
2639
+ vin: isSet(object.vin) ? globalThis.String(object.vin) : undefined,
2640
+ engineNumber: isSet(object.engine_number) ? globalThis.String(object.engine_number) : undefined,
2641
+ chassisNumber: isSet(object.chassis_number) ? globalThis.String(object.chassis_number) : undefined,
2642
+ modelYear: isSet(object.model_year) ? globalThis.Number(object.model_year) : undefined,
2643
+ fuelUsage: isSet(object.fuel_usage) ? globalThis.Number(object.fuel_usage) : undefined,
2644
+ fuelUsagePerHour: isSet(object.fuel_usage_per_hour) ? globalThis.Number(object.fuel_usage_per_hour) : undefined,
2645
+ fuelType: isSet(object.fuel_type) ? globalThis.String(object.fuel_type) : undefined,
2646
+ fuelCapacity: isSet(object.fuel_capacity) ? globalThis.Number(object.fuel_capacity) : undefined,
2647
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
2648
+ guarantyExpirationDate: isSet(object.guaranty_expiration_date)
2649
+ ? fromJsonTimestamp(object.guaranty_expiration_date)
2650
+ : undefined,
2651
+ guarantyExpirationKm: isSet(object.guaranty_expiration_km)
2652
+ ? long_1.default.fromValue(object.guaranty_expiration_km)
2653
+ : undefined,
2654
+ color: isSet(object.color) ? globalThis.String(object.color) : undefined,
2805
2655
  createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
2806
2656
  updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
2807
2657
  };
@@ -2811,29 +2661,74 @@ exports.Car_Brand = {
2811
2661
  if (!message.id.equals(long_1.default.UZERO)) {
2812
2662
  obj.id = (message.id || long_1.default.UZERO).toString();
2813
2663
  }
2814
- if (!message.carCategoryId.equals(long_1.default.UZERO)) {
2815
- obj.car_category_id = (message.carCategoryId || long_1.default.UZERO).toString();
2664
+ if (!message.organizationId.equals(long_1.default.UZERO)) {
2665
+ obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
2666
+ }
2667
+ if (message.createdBy !== undefined) {
2668
+ obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
2669
+ }
2670
+ if (message.updatedBy !== undefined) {
2671
+ obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
2816
2672
  }
2817
2673
  if (message.name !== "") {
2818
2674
  obj.name = message.name;
2819
2675
  }
2820
- if (message.description !== undefined) {
2821
- obj.description = message.description;
2822
- }
2823
2676
  if (message.picture !== undefined) {
2824
2677
  obj.picture = message.picture;
2825
2678
  }
2826
- if (message.sord !== undefined) {
2827
- obj.sord = Math.round(message.sord);
2679
+ if (message.plateNumber !== undefined) {
2680
+ obj.plate_number = message.plateNumber;
2828
2681
  }
2829
- if (message.isActive !== undefined) {
2830
- obj.is_active = message.isActive;
2682
+ if (message.carGroupId !== undefined) {
2683
+ obj.car_group_id = (message.carGroupId || long_1.default.UZERO).toString();
2831
2684
  }
2832
- if (message.createdBy !== undefined) {
2833
- obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
2685
+ if (message.carType !== undefined) {
2686
+ obj.car_type = (message.carType || long_1.default.UZERO).toString();
2834
2687
  }
2835
- if (message.updatedBy !== undefined) {
2836
- obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
2688
+ if (message.code !== undefined) {
2689
+ obj.code = message.code;
2690
+ }
2691
+ if (message.tonnage !== undefined) {
2692
+ obj.tonnage = (message.tonnage || long_1.default.UZERO).toString();
2693
+ }
2694
+ if (message.maxSpeed !== undefined) {
2695
+ obj.max_speed = (message.maxSpeed || long_1.default.UZERO).toString();
2696
+ }
2697
+ if (message.vin !== undefined) {
2698
+ obj.vin = message.vin;
2699
+ }
2700
+ if (message.engineNumber !== undefined) {
2701
+ obj.engine_number = message.engineNumber;
2702
+ }
2703
+ if (message.chassisNumber !== undefined) {
2704
+ obj.chassis_number = message.chassisNumber;
2705
+ }
2706
+ if (message.modelYear !== undefined) {
2707
+ obj.model_year = Math.round(message.modelYear);
2708
+ }
2709
+ if (message.fuelUsage !== undefined) {
2710
+ obj.fuel_usage = message.fuelUsage;
2711
+ }
2712
+ if (message.fuelUsagePerHour !== undefined) {
2713
+ obj.fuel_usage_per_hour = message.fuelUsagePerHour;
2714
+ }
2715
+ if (message.fuelType !== undefined) {
2716
+ obj.fuel_type = message.fuelType;
2717
+ }
2718
+ if (message.fuelCapacity !== undefined) {
2719
+ obj.fuel_capacity = message.fuelCapacity;
2720
+ }
2721
+ if (message.description !== undefined) {
2722
+ obj.description = message.description;
2723
+ }
2724
+ if (message.guarantyExpirationDate !== undefined) {
2725
+ obj.guaranty_expiration_date = message.guarantyExpirationDate.toISOString();
2726
+ }
2727
+ if (message.guarantyExpirationKm !== undefined) {
2728
+ obj.guaranty_expiration_km = (message.guarantyExpirationKm || long_1.default.UZERO).toString();
2729
+ }
2730
+ if (message.color !== undefined) {
2731
+ obj.color = message.color;
2837
2732
  }
2838
2733
  if (message.createdAt !== undefined) {
2839
2734
  obj.created_at = message.createdAt.toISOString();
@@ -2844,28 +2739,53 @@ exports.Car_Brand = {
2844
2739
  return obj;
2845
2740
  },
2846
2741
  create(base) {
2847
- return exports.Car_Brand.fromPartial(base !== null && base !== void 0 ? base : {});
2742
+ return exports.Car.fromPartial(base !== null && base !== void 0 ? base : {});
2848
2743
  },
2849
2744
  fromPartial(object) {
2850
- var _a, _b, _c, _d, _e, _f, _g;
2851
- const message = createBaseCar_Brand();
2745
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
2746
+ const message = createBaseCar();
2852
2747
  message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
2853
- message.carCategoryId = (object.carCategoryId !== undefined && object.carCategoryId !== null)
2854
- ? long_1.default.fromValue(object.carCategoryId)
2748
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
2749
+ ? long_1.default.fromValue(object.organizationId)
2855
2750
  : long_1.default.UZERO;
2856
- message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
2857
- message.description = (_b = object.description) !== null && _b !== void 0 ? _b : undefined;
2858
- message.picture = (_c = object.picture) !== null && _c !== void 0 ? _c : undefined;
2859
- message.sord = (_d = object.sord) !== null && _d !== void 0 ? _d : undefined;
2860
- message.isActive = (_e = object.isActive) !== null && _e !== void 0 ? _e : undefined;
2861
2751
  message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2862
2752
  ? long_1.default.fromValue(object.createdBy)
2863
2753
  : undefined;
2864
2754
  message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
2865
2755
  ? long_1.default.fromValue(object.updatedBy)
2866
2756
  : undefined;
2867
- message.createdAt = (_f = object.createdAt) !== null && _f !== void 0 ? _f : undefined;
2868
- message.updatedAt = (_g = object.updatedAt) !== null && _g !== void 0 ? _g : undefined;
2757
+ message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
2758
+ message.picture = (_b = object.picture) !== null && _b !== void 0 ? _b : undefined;
2759
+ message.plateNumber = (_c = object.plateNumber) !== null && _c !== void 0 ? _c : undefined;
2760
+ message.carGroupId = (object.carGroupId !== undefined && object.carGroupId !== null)
2761
+ ? long_1.default.fromValue(object.carGroupId)
2762
+ : undefined;
2763
+ message.carType = (object.carType !== undefined && object.carType !== null)
2764
+ ? long_1.default.fromValue(object.carType)
2765
+ : undefined;
2766
+ message.code = (_d = object.code) !== null && _d !== void 0 ? _d : undefined;
2767
+ message.tonnage = (object.tonnage !== undefined && object.tonnage !== null)
2768
+ ? long_1.default.fromValue(object.tonnage)
2769
+ : undefined;
2770
+ message.maxSpeed = (object.maxSpeed !== undefined && object.maxSpeed !== null)
2771
+ ? long_1.default.fromValue(object.maxSpeed)
2772
+ : undefined;
2773
+ message.vin = (_e = object.vin) !== null && _e !== void 0 ? _e : undefined;
2774
+ message.engineNumber = (_f = object.engineNumber) !== null && _f !== void 0 ? _f : undefined;
2775
+ message.chassisNumber = (_g = object.chassisNumber) !== null && _g !== void 0 ? _g : undefined;
2776
+ message.modelYear = (_h = object.modelYear) !== null && _h !== void 0 ? _h : undefined;
2777
+ message.fuelUsage = (_j = object.fuelUsage) !== null && _j !== void 0 ? _j : undefined;
2778
+ message.fuelUsagePerHour = (_k = object.fuelUsagePerHour) !== null && _k !== void 0 ? _k : undefined;
2779
+ message.fuelType = (_l = object.fuelType) !== null && _l !== void 0 ? _l : undefined;
2780
+ message.fuelCapacity = (_m = object.fuelCapacity) !== null && _m !== void 0 ? _m : undefined;
2781
+ message.description = (_o = object.description) !== null && _o !== void 0 ? _o : undefined;
2782
+ message.guarantyExpirationDate = (_p = object.guarantyExpirationDate) !== null && _p !== void 0 ? _p : undefined;
2783
+ message.guarantyExpirationKm = (object.guarantyExpirationKm !== undefined && object.guarantyExpirationKm !== null)
2784
+ ? long_1.default.fromValue(object.guarantyExpirationKm)
2785
+ : undefined;
2786
+ message.color = (_q = object.color) !== null && _q !== void 0 ? _q : undefined;
2787
+ message.createdAt = (_r = object.createdAt) !== null && _r !== void 0 ? _r : undefined;
2788
+ message.updatedAt = (_s = object.updatedAt) !== null && _s !== void 0 ? _s : undefined;
2869
2789
  return message;
2870
2790
  },
2871
2791
  };