theragist-ts 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/auth/message.d.ts +242 -0
  2. package/dist/auth/message.js +2980 -0
  3. package/dist/auth/service.d.ts +239 -0
  4. package/dist/auth/service.js +963 -0
  5. package/dist/booking/message.d.ts +109 -0
  6. package/dist/booking/message.js +1263 -0
  7. package/dist/booking/service.d.ts +69 -0
  8. package/dist/booking/service.js +230 -0
  9. package/dist/common.d.ts +81 -0
  10. package/dist/common.js +641 -0
  11. package/dist/community/message.d.ts +67 -0
  12. package/dist/community/message.js +646 -0
  13. package/dist/community/service.d.ts +57 -0
  14. package/dist/community/service.js +213 -0
  15. package/dist/google/api/annotations.d.ts +1 -0
  16. package/dist/google/api/annotations.js +10 -0
  17. package/dist/google/api/http.d.ts +371 -0
  18. package/dist/google/api/http.js +360 -0
  19. package/dist/google/protobuf/descriptor.d.ts +884 -0
  20. package/dist/google/protobuf/descriptor.js +3595 -0
  21. package/dist/google/protobuf/struct.d.ts +107 -0
  22. package/dist/google/protobuf/struct.js +461 -0
  23. package/dist/index.d.ts +16 -0
  24. package/dist/index.js +192 -0
  25. package/dist/lookup/message.d.ts +128 -0
  26. package/dist/lookup/message.js +1498 -0
  27. package/dist/lookup/service.d.ts +93 -0
  28. package/dist/lookup/service.js +334 -0
  29. package/dist/therapist/message.d.ts +67 -0
  30. package/dist/therapist/message.js +679 -0
  31. package/dist/therapist/service.d.ts +47 -0
  32. package/dist/therapist/service.js +159 -0
  33. package/dist/user/message.d.ts +114 -0
  34. package/dist/user/message.js +1342 -0
  35. package/dist/user/service.d.ts +172 -0
  36. package/dist/user/service.js +1041 -0
  37. package/package.json +43 -0
@@ -0,0 +1,679 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.10.1
5
+ // protoc v3.21.12
6
+ // source: therapist/message.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.TimeSlot = exports.GetAvailabilityResponse = exports.GetAvailabilityRequest = exports.TherapistSearchResult = exports.SearchTherapistsResponse = exports.SearchTherapistsRequest = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ const common_1 = require("../common");
12
+ const message_1 = require("../user/message");
13
+ exports.protobufPackage = "pb";
14
+ function createBaseSearchTherapistsRequest() {
15
+ return {
16
+ pagination: undefined,
17
+ specialties: [],
18
+ languages: [],
19
+ minPrice: 0,
20
+ maxPrice: 0,
21
+ minRating: 0,
22
+ availableFrom: "",
23
+ availableTo: "",
24
+ };
25
+ }
26
+ exports.SearchTherapistsRequest = {
27
+ encode(message, writer = new wire_1.BinaryWriter()) {
28
+ if (message.pagination !== undefined) {
29
+ common_1.BaseListRequest.encode(message.pagination, writer.uint32(10).fork()).join();
30
+ }
31
+ for (const v of message.specialties) {
32
+ writer.uint32(18).string(v);
33
+ }
34
+ for (const v of message.languages) {
35
+ writer.uint32(26).string(v);
36
+ }
37
+ if (message.minPrice !== 0) {
38
+ writer.uint32(32).int32(message.minPrice);
39
+ }
40
+ if (message.maxPrice !== 0) {
41
+ writer.uint32(40).int32(message.maxPrice);
42
+ }
43
+ if (message.minRating !== 0) {
44
+ writer.uint32(53).float(message.minRating);
45
+ }
46
+ if (message.availableFrom !== "") {
47
+ writer.uint32(58).string(message.availableFrom);
48
+ }
49
+ if (message.availableTo !== "") {
50
+ writer.uint32(66).string(message.availableTo);
51
+ }
52
+ return writer;
53
+ },
54
+ decode(input, length) {
55
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
56
+ const end = length === undefined ? reader.len : reader.pos + length;
57
+ const message = createBaseSearchTherapistsRequest();
58
+ while (reader.pos < end) {
59
+ const tag = reader.uint32();
60
+ switch (tag >>> 3) {
61
+ case 1: {
62
+ if (tag !== 10) {
63
+ break;
64
+ }
65
+ message.pagination = common_1.BaseListRequest.decode(reader, reader.uint32());
66
+ continue;
67
+ }
68
+ case 2: {
69
+ if (tag !== 18) {
70
+ break;
71
+ }
72
+ message.specialties.push(reader.string());
73
+ continue;
74
+ }
75
+ case 3: {
76
+ if (tag !== 26) {
77
+ break;
78
+ }
79
+ message.languages.push(reader.string());
80
+ continue;
81
+ }
82
+ case 4: {
83
+ if (tag !== 32) {
84
+ break;
85
+ }
86
+ message.minPrice = reader.int32();
87
+ continue;
88
+ }
89
+ case 5: {
90
+ if (tag !== 40) {
91
+ break;
92
+ }
93
+ message.maxPrice = reader.int32();
94
+ continue;
95
+ }
96
+ case 6: {
97
+ if (tag !== 53) {
98
+ break;
99
+ }
100
+ message.minRating = reader.float();
101
+ continue;
102
+ }
103
+ case 7: {
104
+ if (tag !== 58) {
105
+ break;
106
+ }
107
+ message.availableFrom = reader.string();
108
+ continue;
109
+ }
110
+ case 8: {
111
+ if (tag !== 66) {
112
+ break;
113
+ }
114
+ message.availableTo = reader.string();
115
+ continue;
116
+ }
117
+ }
118
+ if ((tag & 7) === 4 || tag === 0) {
119
+ break;
120
+ }
121
+ reader.skip(tag & 7);
122
+ }
123
+ return message;
124
+ },
125
+ fromJSON(object) {
126
+ return {
127
+ pagination: isSet(object.pagination) ? common_1.BaseListRequest.fromJSON(object.pagination) : undefined,
128
+ specialties: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.specialties)
129
+ ? object.specialties.map((e) => globalThis.String(e))
130
+ : [],
131
+ languages: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.languages)
132
+ ? object.languages.map((e) => globalThis.String(e))
133
+ : [],
134
+ minPrice: isSet(object.minPrice) ? globalThis.Number(object.minPrice) : 0,
135
+ maxPrice: isSet(object.maxPrice) ? globalThis.Number(object.maxPrice) : 0,
136
+ minRating: isSet(object.minRating) ? globalThis.Number(object.minRating) : 0,
137
+ availableFrom: isSet(object.availableFrom) ? globalThis.String(object.availableFrom) : "",
138
+ availableTo: isSet(object.availableTo) ? globalThis.String(object.availableTo) : "",
139
+ };
140
+ },
141
+ toJSON(message) {
142
+ var _a, _b;
143
+ const obj = {};
144
+ if (message.pagination !== undefined) {
145
+ obj.pagination = common_1.BaseListRequest.toJSON(message.pagination);
146
+ }
147
+ if ((_a = message.specialties) === null || _a === void 0 ? void 0 : _a.length) {
148
+ obj.specialties = message.specialties;
149
+ }
150
+ if ((_b = message.languages) === null || _b === void 0 ? void 0 : _b.length) {
151
+ obj.languages = message.languages;
152
+ }
153
+ if (message.minPrice !== 0) {
154
+ obj.minPrice = Math.round(message.minPrice);
155
+ }
156
+ if (message.maxPrice !== 0) {
157
+ obj.maxPrice = Math.round(message.maxPrice);
158
+ }
159
+ if (message.minRating !== 0) {
160
+ obj.minRating = message.minRating;
161
+ }
162
+ if (message.availableFrom !== "") {
163
+ obj.availableFrom = message.availableFrom;
164
+ }
165
+ if (message.availableTo !== "") {
166
+ obj.availableTo = message.availableTo;
167
+ }
168
+ return obj;
169
+ },
170
+ create(base) {
171
+ return exports.SearchTherapistsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
172
+ },
173
+ fromPartial(object) {
174
+ var _a, _b, _c, _d, _e, _f, _g;
175
+ const message = createBaseSearchTherapistsRequest();
176
+ message.pagination = (object.pagination !== undefined && object.pagination !== null)
177
+ ? common_1.BaseListRequest.fromPartial(object.pagination)
178
+ : undefined;
179
+ message.specialties = ((_a = object.specialties) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
180
+ message.languages = ((_b = object.languages) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
181
+ message.minPrice = (_c = object.minPrice) !== null && _c !== void 0 ? _c : 0;
182
+ message.maxPrice = (_d = object.maxPrice) !== null && _d !== void 0 ? _d : 0;
183
+ message.minRating = (_e = object.minRating) !== null && _e !== void 0 ? _e : 0;
184
+ message.availableFrom = (_f = object.availableFrom) !== null && _f !== void 0 ? _f : "";
185
+ message.availableTo = (_g = object.availableTo) !== null && _g !== void 0 ? _g : "";
186
+ return message;
187
+ },
188
+ };
189
+ function createBaseSearchTherapistsResponse() {
190
+ return { items: [] };
191
+ }
192
+ exports.SearchTherapistsResponse = {
193
+ encode(message, writer = new wire_1.BinaryWriter()) {
194
+ for (const v of message.items) {
195
+ exports.TherapistSearchResult.encode(v, writer.uint32(10).fork()).join();
196
+ }
197
+ return writer;
198
+ },
199
+ decode(input, length) {
200
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
201
+ const end = length === undefined ? reader.len : reader.pos + length;
202
+ const message = createBaseSearchTherapistsResponse();
203
+ while (reader.pos < end) {
204
+ const tag = reader.uint32();
205
+ switch (tag >>> 3) {
206
+ case 1: {
207
+ if (tag !== 10) {
208
+ break;
209
+ }
210
+ message.items.push(exports.TherapistSearchResult.decode(reader, reader.uint32()));
211
+ continue;
212
+ }
213
+ }
214
+ if ((tag & 7) === 4 || tag === 0) {
215
+ break;
216
+ }
217
+ reader.skip(tag & 7);
218
+ }
219
+ return message;
220
+ },
221
+ fromJSON(object) {
222
+ return {
223
+ items: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.items)
224
+ ? object.items.map((e) => exports.TherapistSearchResult.fromJSON(e))
225
+ : [],
226
+ };
227
+ },
228
+ toJSON(message) {
229
+ var _a;
230
+ const obj = {};
231
+ if ((_a = message.items) === null || _a === void 0 ? void 0 : _a.length) {
232
+ obj.items = message.items.map((e) => exports.TherapistSearchResult.toJSON(e));
233
+ }
234
+ return obj;
235
+ },
236
+ create(base) {
237
+ return exports.SearchTherapistsResponse.fromPartial(base !== null && base !== void 0 ? base : {});
238
+ },
239
+ fromPartial(object) {
240
+ var _a;
241
+ const message = createBaseSearchTherapistsResponse();
242
+ message.items = ((_a = object.items) === null || _a === void 0 ? void 0 : _a.map((e) => exports.TherapistSearchResult.fromPartial(e))) || [];
243
+ return message;
244
+ },
245
+ };
246
+ function createBaseTherapistSearchResult() {
247
+ return {
248
+ therapistId: "",
249
+ fullName: "",
250
+ avatarUrl: "",
251
+ specialties: [],
252
+ modalities: [],
253
+ rating: 0,
254
+ reviewCount: 0,
255
+ sessionPrice: undefined,
256
+ nextAvailableSessionAt: "",
257
+ };
258
+ }
259
+ exports.TherapistSearchResult = {
260
+ encode(message, writer = new wire_1.BinaryWriter()) {
261
+ if (message.therapistId !== "") {
262
+ writer.uint32(10).string(message.therapistId);
263
+ }
264
+ if (message.fullName !== "") {
265
+ writer.uint32(18).string(message.fullName);
266
+ }
267
+ if (message.avatarUrl !== "") {
268
+ writer.uint32(26).string(message.avatarUrl);
269
+ }
270
+ for (const v of message.specialties) {
271
+ writer.uint32(34).string(v);
272
+ }
273
+ for (const v of message.modalities) {
274
+ writer.uint32(42).string(v);
275
+ }
276
+ if (message.rating !== 0) {
277
+ writer.uint32(53).float(message.rating);
278
+ }
279
+ if (message.reviewCount !== 0) {
280
+ writer.uint32(56).int32(message.reviewCount);
281
+ }
282
+ if (message.sessionPrice !== undefined) {
283
+ message_1.SessionPrice.encode(message.sessionPrice, writer.uint32(66).fork()).join();
284
+ }
285
+ if (message.nextAvailableSessionAt !== "") {
286
+ writer.uint32(74).string(message.nextAvailableSessionAt);
287
+ }
288
+ return writer;
289
+ },
290
+ decode(input, length) {
291
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
292
+ const end = length === undefined ? reader.len : reader.pos + length;
293
+ const message = createBaseTherapistSearchResult();
294
+ while (reader.pos < end) {
295
+ const tag = reader.uint32();
296
+ switch (tag >>> 3) {
297
+ case 1: {
298
+ if (tag !== 10) {
299
+ break;
300
+ }
301
+ message.therapistId = reader.string();
302
+ continue;
303
+ }
304
+ case 2: {
305
+ if (tag !== 18) {
306
+ break;
307
+ }
308
+ message.fullName = reader.string();
309
+ continue;
310
+ }
311
+ case 3: {
312
+ if (tag !== 26) {
313
+ break;
314
+ }
315
+ message.avatarUrl = reader.string();
316
+ continue;
317
+ }
318
+ case 4: {
319
+ if (tag !== 34) {
320
+ break;
321
+ }
322
+ message.specialties.push(reader.string());
323
+ continue;
324
+ }
325
+ case 5: {
326
+ if (tag !== 42) {
327
+ break;
328
+ }
329
+ message.modalities.push(reader.string());
330
+ continue;
331
+ }
332
+ case 6: {
333
+ if (tag !== 53) {
334
+ break;
335
+ }
336
+ message.rating = reader.float();
337
+ continue;
338
+ }
339
+ case 7: {
340
+ if (tag !== 56) {
341
+ break;
342
+ }
343
+ message.reviewCount = reader.int32();
344
+ continue;
345
+ }
346
+ case 8: {
347
+ if (tag !== 66) {
348
+ break;
349
+ }
350
+ message.sessionPrice = message_1.SessionPrice.decode(reader, reader.uint32());
351
+ continue;
352
+ }
353
+ case 9: {
354
+ if (tag !== 74) {
355
+ break;
356
+ }
357
+ message.nextAvailableSessionAt = reader.string();
358
+ continue;
359
+ }
360
+ }
361
+ if ((tag & 7) === 4 || tag === 0) {
362
+ break;
363
+ }
364
+ reader.skip(tag & 7);
365
+ }
366
+ return message;
367
+ },
368
+ fromJSON(object) {
369
+ return {
370
+ therapistId: isSet(object.therapistId) ? globalThis.String(object.therapistId) : "",
371
+ fullName: isSet(object.fullName) ? globalThis.String(object.fullName) : "",
372
+ avatarUrl: isSet(object.avatarUrl) ? globalThis.String(object.avatarUrl) : "",
373
+ specialties: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.specialties)
374
+ ? object.specialties.map((e) => globalThis.String(e))
375
+ : [],
376
+ modalities: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.modalities)
377
+ ? object.modalities.map((e) => globalThis.String(e))
378
+ : [],
379
+ rating: isSet(object.rating) ? globalThis.Number(object.rating) : 0,
380
+ reviewCount: isSet(object.reviewCount) ? globalThis.Number(object.reviewCount) : 0,
381
+ sessionPrice: isSet(object.sessionPrice) ? message_1.SessionPrice.fromJSON(object.sessionPrice) : undefined,
382
+ nextAvailableSessionAt: isSet(object.nextAvailableSessionAt)
383
+ ? globalThis.String(object.nextAvailableSessionAt)
384
+ : "",
385
+ };
386
+ },
387
+ toJSON(message) {
388
+ var _a, _b;
389
+ const obj = {};
390
+ if (message.therapistId !== "") {
391
+ obj.therapistId = message.therapistId;
392
+ }
393
+ if (message.fullName !== "") {
394
+ obj.fullName = message.fullName;
395
+ }
396
+ if (message.avatarUrl !== "") {
397
+ obj.avatarUrl = message.avatarUrl;
398
+ }
399
+ if ((_a = message.specialties) === null || _a === void 0 ? void 0 : _a.length) {
400
+ obj.specialties = message.specialties;
401
+ }
402
+ if ((_b = message.modalities) === null || _b === void 0 ? void 0 : _b.length) {
403
+ obj.modalities = message.modalities;
404
+ }
405
+ if (message.rating !== 0) {
406
+ obj.rating = message.rating;
407
+ }
408
+ if (message.reviewCount !== 0) {
409
+ obj.reviewCount = Math.round(message.reviewCount);
410
+ }
411
+ if (message.sessionPrice !== undefined) {
412
+ obj.sessionPrice = message_1.SessionPrice.toJSON(message.sessionPrice);
413
+ }
414
+ if (message.nextAvailableSessionAt !== "") {
415
+ obj.nextAvailableSessionAt = message.nextAvailableSessionAt;
416
+ }
417
+ return obj;
418
+ },
419
+ create(base) {
420
+ return exports.TherapistSearchResult.fromPartial(base !== null && base !== void 0 ? base : {});
421
+ },
422
+ fromPartial(object) {
423
+ var _a, _b, _c, _d, _e, _f, _g, _h;
424
+ const message = createBaseTherapistSearchResult();
425
+ message.therapistId = (_a = object.therapistId) !== null && _a !== void 0 ? _a : "";
426
+ message.fullName = (_b = object.fullName) !== null && _b !== void 0 ? _b : "";
427
+ message.avatarUrl = (_c = object.avatarUrl) !== null && _c !== void 0 ? _c : "";
428
+ message.specialties = ((_d = object.specialties) === null || _d === void 0 ? void 0 : _d.map((e) => e)) || [];
429
+ message.modalities = ((_e = object.modalities) === null || _e === void 0 ? void 0 : _e.map((e) => e)) || [];
430
+ message.rating = (_f = object.rating) !== null && _f !== void 0 ? _f : 0;
431
+ message.reviewCount = (_g = object.reviewCount) !== null && _g !== void 0 ? _g : 0;
432
+ message.sessionPrice = (object.sessionPrice !== undefined && object.sessionPrice !== null)
433
+ ? message_1.SessionPrice.fromPartial(object.sessionPrice)
434
+ : undefined;
435
+ message.nextAvailableSessionAt = (_h = object.nextAvailableSessionAt) !== null && _h !== void 0 ? _h : "";
436
+ return message;
437
+ },
438
+ };
439
+ function createBaseGetAvailabilityRequest() {
440
+ return { therapistId: "", from: "", to: "" };
441
+ }
442
+ exports.GetAvailabilityRequest = {
443
+ encode(message, writer = new wire_1.BinaryWriter()) {
444
+ if (message.therapistId !== "") {
445
+ writer.uint32(10).string(message.therapistId);
446
+ }
447
+ if (message.from !== "") {
448
+ writer.uint32(18).string(message.from);
449
+ }
450
+ if (message.to !== "") {
451
+ writer.uint32(26).string(message.to);
452
+ }
453
+ return writer;
454
+ },
455
+ decode(input, length) {
456
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
457
+ const end = length === undefined ? reader.len : reader.pos + length;
458
+ const message = createBaseGetAvailabilityRequest();
459
+ while (reader.pos < end) {
460
+ const tag = reader.uint32();
461
+ switch (tag >>> 3) {
462
+ case 1: {
463
+ if (tag !== 10) {
464
+ break;
465
+ }
466
+ message.therapistId = reader.string();
467
+ continue;
468
+ }
469
+ case 2: {
470
+ if (tag !== 18) {
471
+ break;
472
+ }
473
+ message.from = reader.string();
474
+ continue;
475
+ }
476
+ case 3: {
477
+ if (tag !== 26) {
478
+ break;
479
+ }
480
+ message.to = reader.string();
481
+ continue;
482
+ }
483
+ }
484
+ if ((tag & 7) === 4 || tag === 0) {
485
+ break;
486
+ }
487
+ reader.skip(tag & 7);
488
+ }
489
+ return message;
490
+ },
491
+ fromJSON(object) {
492
+ return {
493
+ therapistId: isSet(object.therapistId) ? globalThis.String(object.therapistId) : "",
494
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
495
+ to: isSet(object.to) ? globalThis.String(object.to) : "",
496
+ };
497
+ },
498
+ toJSON(message) {
499
+ const obj = {};
500
+ if (message.therapistId !== "") {
501
+ obj.therapistId = message.therapistId;
502
+ }
503
+ if (message.from !== "") {
504
+ obj.from = message.from;
505
+ }
506
+ if (message.to !== "") {
507
+ obj.to = message.to;
508
+ }
509
+ return obj;
510
+ },
511
+ create(base) {
512
+ return exports.GetAvailabilityRequest.fromPartial(base !== null && base !== void 0 ? base : {});
513
+ },
514
+ fromPartial(object) {
515
+ var _a, _b, _c;
516
+ const message = createBaseGetAvailabilityRequest();
517
+ message.therapistId = (_a = object.therapistId) !== null && _a !== void 0 ? _a : "";
518
+ message.from = (_b = object.from) !== null && _b !== void 0 ? _b : "";
519
+ message.to = (_c = object.to) !== null && _c !== void 0 ? _c : "";
520
+ return message;
521
+ },
522
+ };
523
+ function createBaseGetAvailabilityResponse() {
524
+ return { therapistId: "", timeZone: "", slots: [] };
525
+ }
526
+ exports.GetAvailabilityResponse = {
527
+ encode(message, writer = new wire_1.BinaryWriter()) {
528
+ if (message.therapistId !== "") {
529
+ writer.uint32(10).string(message.therapistId);
530
+ }
531
+ if (message.timeZone !== "") {
532
+ writer.uint32(18).string(message.timeZone);
533
+ }
534
+ for (const v of message.slots) {
535
+ exports.TimeSlot.encode(v, writer.uint32(26).fork()).join();
536
+ }
537
+ return writer;
538
+ },
539
+ decode(input, length) {
540
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
541
+ const end = length === undefined ? reader.len : reader.pos + length;
542
+ const message = createBaseGetAvailabilityResponse();
543
+ while (reader.pos < end) {
544
+ const tag = reader.uint32();
545
+ switch (tag >>> 3) {
546
+ case 1: {
547
+ if (tag !== 10) {
548
+ break;
549
+ }
550
+ message.therapistId = reader.string();
551
+ continue;
552
+ }
553
+ case 2: {
554
+ if (tag !== 18) {
555
+ break;
556
+ }
557
+ message.timeZone = reader.string();
558
+ continue;
559
+ }
560
+ case 3: {
561
+ if (tag !== 26) {
562
+ break;
563
+ }
564
+ message.slots.push(exports.TimeSlot.decode(reader, reader.uint32()));
565
+ continue;
566
+ }
567
+ }
568
+ if ((tag & 7) === 4 || tag === 0) {
569
+ break;
570
+ }
571
+ reader.skip(tag & 7);
572
+ }
573
+ return message;
574
+ },
575
+ fromJSON(object) {
576
+ return {
577
+ therapistId: isSet(object.therapistId) ? globalThis.String(object.therapistId) : "",
578
+ timeZone: isSet(object.timeZone) ? globalThis.String(object.timeZone) : "",
579
+ slots: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.slots) ? object.slots.map((e) => exports.TimeSlot.fromJSON(e)) : [],
580
+ };
581
+ },
582
+ toJSON(message) {
583
+ var _a;
584
+ const obj = {};
585
+ if (message.therapistId !== "") {
586
+ obj.therapistId = message.therapistId;
587
+ }
588
+ if (message.timeZone !== "") {
589
+ obj.timeZone = message.timeZone;
590
+ }
591
+ if ((_a = message.slots) === null || _a === void 0 ? void 0 : _a.length) {
592
+ obj.slots = message.slots.map((e) => exports.TimeSlot.toJSON(e));
593
+ }
594
+ return obj;
595
+ },
596
+ create(base) {
597
+ return exports.GetAvailabilityResponse.fromPartial(base !== null && base !== void 0 ? base : {});
598
+ },
599
+ fromPartial(object) {
600
+ var _a, _b, _c;
601
+ const message = createBaseGetAvailabilityResponse();
602
+ message.therapistId = (_a = object.therapistId) !== null && _a !== void 0 ? _a : "";
603
+ message.timeZone = (_b = object.timeZone) !== null && _b !== void 0 ? _b : "";
604
+ message.slots = ((_c = object.slots) === null || _c === void 0 ? void 0 : _c.map((e) => exports.TimeSlot.fromPartial(e))) || [];
605
+ return message;
606
+ },
607
+ };
608
+ function createBaseTimeSlot() {
609
+ return { startAt: "", endAt: "" };
610
+ }
611
+ exports.TimeSlot = {
612
+ encode(message, writer = new wire_1.BinaryWriter()) {
613
+ if (message.startAt !== "") {
614
+ writer.uint32(10).string(message.startAt);
615
+ }
616
+ if (message.endAt !== "") {
617
+ writer.uint32(18).string(message.endAt);
618
+ }
619
+ return writer;
620
+ },
621
+ decode(input, length) {
622
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
623
+ const end = length === undefined ? reader.len : reader.pos + length;
624
+ const message = createBaseTimeSlot();
625
+ while (reader.pos < end) {
626
+ const tag = reader.uint32();
627
+ switch (tag >>> 3) {
628
+ case 1: {
629
+ if (tag !== 10) {
630
+ break;
631
+ }
632
+ message.startAt = reader.string();
633
+ continue;
634
+ }
635
+ case 2: {
636
+ if (tag !== 18) {
637
+ break;
638
+ }
639
+ message.endAt = reader.string();
640
+ continue;
641
+ }
642
+ }
643
+ if ((tag & 7) === 4 || tag === 0) {
644
+ break;
645
+ }
646
+ reader.skip(tag & 7);
647
+ }
648
+ return message;
649
+ },
650
+ fromJSON(object) {
651
+ return {
652
+ startAt: isSet(object.startAt) ? globalThis.String(object.startAt) : "",
653
+ endAt: isSet(object.endAt) ? globalThis.String(object.endAt) : "",
654
+ };
655
+ },
656
+ toJSON(message) {
657
+ const obj = {};
658
+ if (message.startAt !== "") {
659
+ obj.startAt = message.startAt;
660
+ }
661
+ if (message.endAt !== "") {
662
+ obj.endAt = message.endAt;
663
+ }
664
+ return obj;
665
+ },
666
+ create(base) {
667
+ return exports.TimeSlot.fromPartial(base !== null && base !== void 0 ? base : {});
668
+ },
669
+ fromPartial(object) {
670
+ var _a, _b;
671
+ const message = createBaseTimeSlot();
672
+ message.startAt = (_a = object.startAt) !== null && _a !== void 0 ? _a : "";
673
+ message.endAt = (_b = object.endAt) !== null && _b !== void 0 ? _b : "";
674
+ return message;
675
+ },
676
+ };
677
+ function isSet(value) {
678
+ return value !== null && value !== undefined;
679
+ }