@vendasta/conversation 0.13.0 → 0.16.0

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 (63) hide show
  1. package/esm2020/lib/_generated/host.service.mjs +25 -0
  2. package/esm2020/lib/_internal/conversation.api.service.mjs +116 -0
  3. package/esm2020/lib/_internal/enums/api.enum.mjs +14 -0
  4. package/esm2020/lib/_internal/enums/conversation.enum.mjs +25 -0
  5. package/esm2020/lib/_internal/enums/index.mjs +11 -0
  6. package/esm2020/lib/_internal/enums/message.enum.mjs +21 -0
  7. package/esm2020/lib/_internal/enums/participant.enum.mjs +18 -0
  8. package/esm2020/lib/_internal/index.mjs +11 -0
  9. package/esm2020/lib/_internal/interfaces/api.interface.mjs +2 -0
  10. package/esm2020/lib/_internal/interfaces/conversation.interface.mjs +8 -0
  11. package/esm2020/lib/_internal/interfaces/index.mjs +2 -0
  12. package/esm2020/lib/_internal/interfaces/message.interface.mjs +8 -0
  13. package/esm2020/lib/_internal/interfaces/participant.interface.mjs +8 -0
  14. package/esm2020/lib/_internal/objects/api.mjs +1141 -0
  15. package/esm2020/lib/_internal/objects/conversation.mjs +73 -0
  16. package/esm2020/lib/_internal/objects/index.mjs +11 -0
  17. package/esm2020/lib/_internal/objects/message.mjs +105 -0
  18. package/esm2020/lib/_internal/objects/participant.mjs +129 -0
  19. package/esm2020/lib/index.mjs +3 -0
  20. package/esm2020/public_api.mjs +2 -0
  21. package/esm2020/vendasta-conversation.mjs +5 -0
  22. package/fesm2015/vendasta-conversation.mjs +1664 -0
  23. package/fesm2015/vendasta-conversation.mjs.map +1 -0
  24. package/{fesm2015/vendasta-conversation.js → fesm2020/vendasta-conversation.mjs} +144 -125
  25. package/fesm2020/vendasta-conversation.mjs.map +1 -0
  26. package/lib/_generated/host.service.d.ts +5 -9
  27. package/lib/_internal/conversation.api.service.d.ts +7 -2
  28. package/lib/_internal/interfaces/api.interface.d.ts +10 -2
  29. package/lib/_internal/interfaces/index.d.ts +1 -1
  30. package/lib/_internal/interfaces/participant.interface.d.ts +1 -0
  31. package/lib/_internal/objects/api.d.ts +20 -6
  32. package/lib/_internal/objects/index.d.ts +1 -1
  33. package/lib/_internal/objects/participant.d.ts +1 -0
  34. package/package.json +27 -16
  35. package/src/README.md +1 -0
  36. package/vendasta-conversation.d.ts +1 -1
  37. package/bundles/vendasta-conversation.umd.js +0 -1712
  38. package/bundles/vendasta-conversation.umd.js.map +0 -1
  39. package/bundles/vendasta-conversation.umd.min.js +0 -2
  40. package/bundles/vendasta-conversation.umd.min.js.map +0 -1
  41. package/esm2015/lib/_generated/host.service.js +0 -65
  42. package/esm2015/lib/_internal/conversation.api.service.js +0 -112
  43. package/esm2015/lib/_internal/enums/api.enum.js +0 -14
  44. package/esm2015/lib/_internal/enums/conversation.enum.js +0 -25
  45. package/esm2015/lib/_internal/enums/index.js +0 -11
  46. package/esm2015/lib/_internal/enums/message.enum.js +0 -21
  47. package/esm2015/lib/_internal/enums/participant.enum.js +0 -18
  48. package/esm2015/lib/_internal/index.js +0 -11
  49. package/esm2015/lib/_internal/interfaces/api.interface.js +0 -2
  50. package/esm2015/lib/_internal/interfaces/conversation.interface.js +0 -8
  51. package/esm2015/lib/_internal/interfaces/index.js +0 -2
  52. package/esm2015/lib/_internal/interfaces/message.interface.js +0 -8
  53. package/esm2015/lib/_internal/interfaces/participant.interface.js +0 -8
  54. package/esm2015/lib/_internal/objects/api.js +0 -1092
  55. package/esm2015/lib/_internal/objects/conversation.js +0 -73
  56. package/esm2015/lib/_internal/objects/index.js +0 -11
  57. package/esm2015/lib/_internal/objects/message.js +0 -105
  58. package/esm2015/lib/_internal/objects/participant.js +0 -126
  59. package/esm2015/lib/index.js +0 -3
  60. package/esm2015/public_api.js +0 -2
  61. package/esm2015/vendasta-conversation.js +0 -6
  62. package/fesm2015/vendasta-conversation.js.map +0 -1
  63. package/vendasta-conversation.metadata.json +0 -1
@@ -0,0 +1,1664 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import { HttpHeaders } from '@angular/common/http';
5
+ import { map } from 'rxjs/operators';
6
+
7
+ // *********************************
8
+ // Code generated by sdkgen
9
+ // DO NOT EDIT!.
10
+ //
11
+ // Enums.
12
+ // *********************************
13
+ var MessageStatus;
14
+ (function (MessageStatus) {
15
+ MessageStatus[MessageStatus["MESSAGE_STATUS_NOT_READ"] = 0] = "MESSAGE_STATUS_NOT_READ";
16
+ MessageStatus[MessageStatus["MESSAGE_STATUS_READ"] = 1] = "MESSAGE_STATUS_READ";
17
+ MessageStatus[MessageStatus["MESSAGE_STATUS_SENT"] = 2] = "MESSAGE_STATUS_SENT";
18
+ MessageStatus[MessageStatus["MESSAGE_STATUS_DELIVERED"] = 3] = "MESSAGE_STATUS_DELIVERED";
19
+ MessageStatus[MessageStatus["MESSAGE_STATUS_FAILED"] = 4] = "MESSAGE_STATUS_FAILED";
20
+ MessageStatus[MessageStatus["MESSAGE_STATUS_UNDELIVERED"] = 5] = "MESSAGE_STATUS_UNDELIVERED";
21
+ })(MessageStatus || (MessageStatus = {}));
22
+ var MessageType;
23
+ (function (MessageType) {
24
+ MessageType[MessageType["MESSAGE_TYPE_MESSAGE"] = 0] = "MESSAGE_TYPE_MESSAGE";
25
+ MessageType[MessageType["MESSAGE_TYPE_MEDIA"] = 1] = "MESSAGE_TYPE_MEDIA";
26
+ })(MessageType || (MessageType = {}));
27
+
28
+ // *********************************
29
+ // Code generated by sdkgen
30
+ // DO NOT EDIT!.
31
+ //
32
+ // Enums.
33
+ // *********************************
34
+ var ConversationChannel;
35
+ (function (ConversationChannel) {
36
+ ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_UNDEFINED"] = 0] = "CONVERSATION_CHANNEL_UNDEFINED";
37
+ ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_INTERNAL"] = 1] = "CONVERSATION_CHANNEL_INTERNAL";
38
+ ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_SMS"] = 2] = "CONVERSATION_CHANNEL_SMS";
39
+ ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_FACEBOOK"] = 3] = "CONVERSATION_CHANNEL_FACEBOOK";
40
+ ConversationChannel[ConversationChannel["CONVERSATION_CHANNEL_GOOGLE_MESSAGES"] = 4] = "CONVERSATION_CHANNEL_GOOGLE_MESSAGES";
41
+ })(ConversationChannel || (ConversationChannel = {}));
42
+ var PlatformLocation;
43
+ (function (PlatformLocation) {
44
+ PlatformLocation[PlatformLocation["PLATFORM_LOCATION_UNDEFINED"] = 0] = "PLATFORM_LOCATION_UNDEFINED";
45
+ PlatformLocation[PlatformLocation["PLATFORM_LOCATION_BUSINESS_APP"] = 1] = "PLATFORM_LOCATION_BUSINESS_APP";
46
+ PlatformLocation[PlatformLocation["PLATFORM_LOCATION_PARTNER_CENTER"] = 2] = "PLATFORM_LOCATION_PARTNER_CENTER";
47
+ PlatformLocation[PlatformLocation["PLATFORM_LOCATION_VENDOR_CENTER"] = 3] = "PLATFORM_LOCATION_VENDOR_CENTER";
48
+ PlatformLocation[PlatformLocation["PLATFORM_LOCATION_TASK_MANAGER"] = 4] = "PLATFORM_LOCATION_TASK_MANAGER";
49
+ PlatformLocation[PlatformLocation["PLATFORM_LOCATION_PROPOSAL_BUILDER"] = 5] = "PLATFORM_LOCATION_PROPOSAL_BUILDER";
50
+ PlatformLocation[PlatformLocation["PLATFORM_LOCATION_SALES_CENTER"] = 6] = "PLATFORM_LOCATION_SALES_CENTER";
51
+ })(PlatformLocation || (PlatformLocation = {}));
52
+
53
+ // *********************************
54
+ // Code generated by sdkgen
55
+ // DO NOT EDIT!.
56
+ //
57
+ // Enums.
58
+ // *********************************
59
+ var ParticipantType;
60
+ (function (ParticipantType) {
61
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_UNDEFINED"] = 0] = "PARTICIPANT_TYPE_UNDEFINED";
62
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_CUSTOMER"] = 1] = "PARTICIPANT_TYPE_CUSTOMER";
63
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_IAM_USER"] = 2] = "PARTICIPANT_TYPE_IAM_USER";
64
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_ACCOUNT_GROUP"] = 3] = "PARTICIPANT_TYPE_ACCOUNT_GROUP";
65
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_PARTNER"] = 4] = "PARTICIPANT_TYPE_PARTNER";
66
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT"] = 5] = "PARTICIPANT_TYPE_IAM_TEMPORARY_SUBJECT";
67
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_DIGITAL_AGENT"] = 6] = "PARTICIPANT_TYPE_DIGITAL_AGENT";
68
+ ParticipantType[ParticipantType["PARTICIPANT_TYPE_VENDOR"] = 7] = "PARTICIPANT_TYPE_VENDOR";
69
+ })(ParticipantType || (ParticipantType = {}));
70
+
71
+ // *********************************
72
+ // Code generated by sdkgen
73
+ // DO NOT EDIT!.
74
+ //
75
+ // Enums.
76
+ // *********************************
77
+ var MetadataIdentifier;
78
+ (function (MetadataIdentifier) {
79
+ MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_UNDEFINED"] = 0] = "METADATA_IDENTIFIER_UNDEFINED";
80
+ MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_RECIPIENT"] = 1] = "METADATA_IDENTIFIER_RECIPIENT";
81
+ MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_SENDER"] = 2] = "METADATA_IDENTIFIER_SENDER";
82
+ MetadataIdentifier[MetadataIdentifier["METADATA_IDENTIFIER_CONVERSATION"] = 3] = "METADATA_IDENTIFIER_CONVERSATION";
83
+ })(MetadataIdentifier || (MetadataIdentifier = {}));
84
+
85
+ // *********************************
86
+
87
+ function enumStringToValue$3(enumRef, value) {
88
+ if (typeof value === 'number') {
89
+ return value;
90
+ }
91
+ return enumRef[value];
92
+ }
93
+ class Message {
94
+ constructor(kwargs) {
95
+ if (!kwargs) {
96
+ return;
97
+ }
98
+ Object.assign(this, kwargs);
99
+ }
100
+ static fromProto(proto) {
101
+ let m = new Message();
102
+ m = Object.assign(m, proto);
103
+ if (proto.type) {
104
+ m.type = enumStringToValue$3(MessageType, proto.type);
105
+ }
106
+ if (proto.created) {
107
+ m.created = new Date(proto.created);
108
+ }
109
+ if (proto.updated) {
110
+ m.updated = new Date(proto.updated);
111
+ }
112
+ if (proto.deleted) {
113
+ m.deleted = new Date(proto.deleted);
114
+ }
115
+ return m;
116
+ }
117
+ toApiJson() {
118
+ const toReturn = {};
119
+ if (typeof this.messageId !== 'undefined') {
120
+ toReturn['messageId'] = this.messageId;
121
+ }
122
+ if (typeof this.externalMessageId !== 'undefined') {
123
+ toReturn['externalMessageId'] = this.externalMessageId;
124
+ }
125
+ if (typeof this.conversationId !== 'undefined') {
126
+ toReturn['conversationId'] = this.conversationId;
127
+ }
128
+ if (typeof this.participantId !== 'undefined') {
129
+ toReturn['participantId'] = this.participantId;
130
+ }
131
+ if (typeof this.type !== 'undefined') {
132
+ toReturn['type'] = this.type;
133
+ }
134
+ if (typeof this.body !== 'undefined') {
135
+ toReturn['body'] = this.body;
136
+ }
137
+ if (typeof this.error !== 'undefined') {
138
+ toReturn['error'] = this.error;
139
+ }
140
+ if (typeof this.created !== 'undefined' && this.created !== null) {
141
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
142
+ }
143
+ if (typeof this.updated !== 'undefined' && this.updated !== null) {
144
+ toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
145
+ }
146
+ if (typeof this.deleted !== 'undefined' && this.deleted !== null) {
147
+ toReturn['deleted'] = 'toApiJson' in this.deleted ? this.deleted.toApiJson() : this.deleted;
148
+ }
149
+ if (typeof this.media !== 'undefined') {
150
+ toReturn['media'] = this.media;
151
+ }
152
+ return toReturn;
153
+ }
154
+ }
155
+ class ParticipantMessageStatus {
156
+ constructor(kwargs) {
157
+ if (!kwargs) {
158
+ return;
159
+ }
160
+ Object.assign(this, kwargs);
161
+ }
162
+ static fromProto(proto) {
163
+ let m = new ParticipantMessageStatus();
164
+ m = Object.assign(m, proto);
165
+ if (proto.status) {
166
+ m.status = enumStringToValue$3(MessageStatus, proto.status);
167
+ }
168
+ if (proto.updated) {
169
+ m.updated = new Date(proto.updated);
170
+ }
171
+ return m;
172
+ }
173
+ toApiJson() {
174
+ const toReturn = {};
175
+ if (typeof this.participantId !== 'undefined') {
176
+ toReturn['participantId'] = this.participantId;
177
+ }
178
+ if (typeof this.messageId !== 'undefined') {
179
+ toReturn['messageId'] = this.messageId;
180
+ }
181
+ if (typeof this.status !== 'undefined') {
182
+ toReturn['status'] = this.status;
183
+ }
184
+ if (typeof this.updated !== 'undefined' && this.updated !== null) {
185
+ toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
186
+ }
187
+ return toReturn;
188
+ }
189
+ }
190
+
191
+ function enumStringToValue$2(enumRef, value) {
192
+ if (typeof value === 'number') {
193
+ return value;
194
+ }
195
+ return enumRef[value];
196
+ }
197
+ class Conversation {
198
+ constructor(kwargs) {
199
+ if (!kwargs) {
200
+ return;
201
+ }
202
+ Object.assign(this, kwargs);
203
+ }
204
+ static fromProto(proto) {
205
+ let m = new Conversation();
206
+ m = Object.assign(m, proto);
207
+ if (proto.channel) {
208
+ m.channel = enumStringToValue$2(ConversationChannel, proto.channel);
209
+ }
210
+ if (proto.created) {
211
+ m.created = new Date(proto.created);
212
+ }
213
+ if (proto.updated) {
214
+ m.updated = new Date(proto.updated);
215
+ }
216
+ if (proto.deleted) {
217
+ m.deleted = new Date(proto.deleted);
218
+ }
219
+ if (proto.latestMsgSentTime) {
220
+ m.latestMsgSentTime = new Date(proto.latestMsgSentTime);
221
+ }
222
+ if (proto.originLocation) {
223
+ m.originLocation = enumStringToValue$2(PlatformLocation, proto.originLocation);
224
+ }
225
+ return m;
226
+ }
227
+ toApiJson() {
228
+ const toReturn = {};
229
+ if (typeof this.conversationId !== 'undefined') {
230
+ toReturn['conversationId'] = this.conversationId;
231
+ }
232
+ if (typeof this.channel !== 'undefined') {
233
+ toReturn['channel'] = this.channel;
234
+ }
235
+ if (typeof this.externalConversationId !== 'undefined') {
236
+ toReturn['externalConversationId'] = this.externalConversationId;
237
+ }
238
+ if (typeof this.created !== 'undefined' && this.created !== null) {
239
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
240
+ }
241
+ if (typeof this.updated !== 'undefined' && this.updated !== null) {
242
+ toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
243
+ }
244
+ if (typeof this.deleted !== 'undefined' && this.deleted !== null) {
245
+ toReturn['deleted'] = 'toApiJson' in this.deleted ? this.deleted.toApiJson() : this.deleted;
246
+ }
247
+ if (typeof this.participantIds !== 'undefined') {
248
+ toReturn['participantIds'] = this.participantIds;
249
+ }
250
+ if (typeof this.latestMsgSentTime !== 'undefined' && this.latestMsgSentTime !== null) {
251
+ toReturn['latestMsgSentTime'] = 'toApiJson' in this.latestMsgSentTime ? this.latestMsgSentTime.toApiJson() : this.latestMsgSentTime;
252
+ }
253
+ if (typeof this.originLocation !== 'undefined') {
254
+ toReturn['originLocation'] = this.originLocation;
255
+ }
256
+ if (typeof this.originLocationExternalId !== 'undefined') {
257
+ toReturn['originLocationExternalId'] = this.originLocationExternalId;
258
+ }
259
+ return toReturn;
260
+ }
261
+ }
262
+
263
+ function enumStringToValue$1(enumRef, value) {
264
+ if (typeof value === 'number') {
265
+ return value;
266
+ }
267
+ return enumRef[value];
268
+ }
269
+ class Address {
270
+ constructor(kwargs) {
271
+ if (!kwargs) {
272
+ return;
273
+ }
274
+ Object.assign(this, kwargs);
275
+ }
276
+ static fromProto(proto) {
277
+ let m = new Address();
278
+ m = Object.assign(m, proto);
279
+ return m;
280
+ }
281
+ toApiJson() {
282
+ const toReturn = {};
283
+ if (typeof this.firstLineAddress !== 'undefined') {
284
+ toReturn['firstLineAddress'] = this.firstLineAddress;
285
+ }
286
+ if (typeof this.secondLineAddress !== 'undefined') {
287
+ toReturn['secondLineAddress'] = this.secondLineAddress;
288
+ }
289
+ if (typeof this.city !== 'undefined') {
290
+ toReturn['city'] = this.city;
291
+ }
292
+ if (typeof this.state !== 'undefined') {
293
+ toReturn['state'] = this.state;
294
+ }
295
+ if (typeof this.country !== 'undefined') {
296
+ toReturn['country'] = this.country;
297
+ }
298
+ if (typeof this.zipCode !== 'undefined') {
299
+ toReturn['zipCode'] = this.zipCode;
300
+ }
301
+ return toReturn;
302
+ }
303
+ }
304
+ class Participant {
305
+ constructor(kwargs) {
306
+ if (!kwargs) {
307
+ return;
308
+ }
309
+ Object.assign(this, kwargs);
310
+ }
311
+ static fromProto(proto) {
312
+ let m = new Participant();
313
+ m = Object.assign(m, proto);
314
+ if (proto.location) {
315
+ m.location = enumStringToValue$1(PlatformLocation, proto.location);
316
+ }
317
+ if (proto.channel) {
318
+ m.channel = enumStringToValue$1(ConversationChannel, proto.channel);
319
+ }
320
+ if (proto.created) {
321
+ m.created = new Date(proto.created);
322
+ }
323
+ if (proto.updated) {
324
+ m.updated = new Date(proto.updated);
325
+ }
326
+ if (proto.deleted) {
327
+ m.deleted = new Date(proto.deleted);
328
+ }
329
+ if (proto.participantType) {
330
+ m.participantType = enumStringToValue$1(ParticipantType, proto.participantType);
331
+ }
332
+ if (proto.address) {
333
+ m.address = Address.fromProto(proto.address);
334
+ }
335
+ return m;
336
+ }
337
+ toApiJson() {
338
+ const toReturn = {};
339
+ if (typeof this.participantId !== 'undefined') {
340
+ toReturn['participantId'] = this.participantId;
341
+ }
342
+ if (typeof this.internalParticipantId !== 'undefined') {
343
+ toReturn['internalParticipantId'] = this.internalParticipantId;
344
+ }
345
+ if (typeof this.partnerId !== 'undefined') {
346
+ toReturn['partnerId'] = this.partnerId;
347
+ }
348
+ if (typeof this.accountGroupId !== 'undefined') {
349
+ toReturn['accountGroupId'] = this.accountGroupId;
350
+ }
351
+ if (typeof this.location !== 'undefined') {
352
+ toReturn['location'] = this.location;
353
+ }
354
+ if (typeof this.channel !== 'undefined') {
355
+ toReturn['channel'] = this.channel;
356
+ }
357
+ if (typeof this.externalParticipantId !== 'undefined') {
358
+ toReturn['externalParticipantId'] = this.externalParticipantId;
359
+ }
360
+ if (typeof this.name !== 'undefined') {
361
+ toReturn['name'] = this.name;
362
+ }
363
+ if (typeof this.created !== 'undefined' && this.created !== null) {
364
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
365
+ }
366
+ if (typeof this.updated !== 'undefined' && this.updated !== null) {
367
+ toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
368
+ }
369
+ if (typeof this.deleted !== 'undefined' && this.deleted !== null) {
370
+ toReturn['deleted'] = 'toApiJson' in this.deleted ? this.deleted.toApiJson() : this.deleted;
371
+ }
372
+ if (typeof this.participantType !== 'undefined') {
373
+ toReturn['participantType'] = this.participantType;
374
+ }
375
+ if (typeof this.email !== 'undefined') {
376
+ toReturn['email'] = this.email;
377
+ }
378
+ if (typeof this.phoneNumber !== 'undefined') {
379
+ toReturn['phoneNumber'] = this.phoneNumber;
380
+ }
381
+ if (typeof this.address !== 'undefined' && this.address !== null) {
382
+ toReturn['address'] = 'toApiJson' in this.address ? this.address.toApiJson() : this.address;
383
+ }
384
+ if (typeof this.isSubjectParticipant !== 'undefined') {
385
+ toReturn['isSubjectParticipant'] = this.isSubjectParticipant;
386
+ }
387
+ return toReturn;
388
+ }
389
+ }
390
+
391
+ function enumStringToValue(enumRef, value) {
392
+ if (typeof value === 'number') {
393
+ return value;
394
+ }
395
+ return enumRef[value];
396
+ }
397
+ class AddMultiParticipantsRequest {
398
+ constructor(kwargs) {
399
+ if (!kwargs) {
400
+ return;
401
+ }
402
+ Object.assign(this, kwargs);
403
+ }
404
+ static fromProto(proto) {
405
+ let m = new AddMultiParticipantsRequest();
406
+ m = Object.assign(m, proto);
407
+ if (proto.participants) {
408
+ m.participants = proto.participants.map(Participant.fromProto);
409
+ }
410
+ return m;
411
+ }
412
+ toApiJson() {
413
+ const toReturn = {};
414
+ if (typeof this.conversationId !== 'undefined') {
415
+ toReturn['conversationId'] = this.conversationId;
416
+ }
417
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
418
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
419
+ }
420
+ return toReturn;
421
+ }
422
+ }
423
+ class AddMultiParticipantsResponse {
424
+ constructor(kwargs) {
425
+ if (!kwargs) {
426
+ return;
427
+ }
428
+ Object.assign(this, kwargs);
429
+ }
430
+ static fromProto(proto) {
431
+ let m = new AddMultiParticipantsResponse();
432
+ m = Object.assign(m, proto);
433
+ if (proto.participants) {
434
+ m.participants = proto.participants.map(Participant.fromProto);
435
+ }
436
+ return m;
437
+ }
438
+ toApiJson() {
439
+ const toReturn = {};
440
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
441
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
442
+ }
443
+ return toReturn;
444
+ }
445
+ }
446
+ class ConversationMessageCount {
447
+ constructor(kwargs) {
448
+ if (!kwargs) {
449
+ return;
450
+ }
451
+ Object.assign(this, kwargs);
452
+ }
453
+ static fromProto(proto) {
454
+ let m = new ConversationMessageCount();
455
+ m = Object.assign(m, proto);
456
+ if (proto.count) {
457
+ m.count = parseInt(proto.count, 10);
458
+ }
459
+ return m;
460
+ }
461
+ toApiJson() {
462
+ const toReturn = {};
463
+ if (typeof this.conversationId !== 'undefined') {
464
+ toReturn['conversationId'] = this.conversationId;
465
+ }
466
+ if (typeof this.count !== 'undefined') {
467
+ toReturn['count'] = this.count;
468
+ }
469
+ return toReturn;
470
+ }
471
+ }
472
+ class LookupConversationsResponseConversations {
473
+ constructor(kwargs) {
474
+ if (!kwargs) {
475
+ return;
476
+ }
477
+ Object.assign(this, kwargs);
478
+ }
479
+ static fromProto(proto) {
480
+ let m = new LookupConversationsResponseConversations();
481
+ m = Object.assign(m, proto);
482
+ if (proto.conversation) {
483
+ m.conversation = Conversation.fromProto(proto.conversation);
484
+ }
485
+ if (proto.participants) {
486
+ m.participants = proto.participants.map(Participant.fromProto);
487
+ }
488
+ return m;
489
+ }
490
+ toApiJson() {
491
+ const toReturn = {};
492
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
493
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
494
+ }
495
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
496
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
497
+ }
498
+ return toReturn;
499
+ }
500
+ }
501
+ class GetMultiConversationMessageCountResponseCountsEntry {
502
+ constructor(kwargs) {
503
+ if (!kwargs) {
504
+ return;
505
+ }
506
+ Object.assign(this, kwargs);
507
+ }
508
+ static fromProto(proto) {
509
+ let m = new GetMultiConversationMessageCountResponseCountsEntry();
510
+ m = Object.assign(m, proto);
511
+ if (proto.value) {
512
+ m.value = parseInt(proto.value, 10);
513
+ }
514
+ return m;
515
+ }
516
+ toApiJson() {
517
+ const toReturn = {};
518
+ if (typeof this.key !== 'undefined') {
519
+ toReturn['key'] = this.key;
520
+ }
521
+ if (typeof this.value !== 'undefined') {
522
+ toReturn['value'] = this.value;
523
+ }
524
+ return toReturn;
525
+ }
526
+ }
527
+ class CreateConversationRequest {
528
+ constructor(kwargs) {
529
+ if (!kwargs) {
530
+ return;
531
+ }
532
+ Object.assign(this, kwargs);
533
+ }
534
+ static fromProto(proto) {
535
+ let m = new CreateConversationRequest();
536
+ m = Object.assign(m, proto);
537
+ if (proto.participants) {
538
+ m.participants = proto.participants.map(Participant.fromProto);
539
+ }
540
+ if (proto.channel) {
541
+ m.channel = enumStringToValue(ConversationChannel, proto.channel);
542
+ }
543
+ if (proto.created) {
544
+ m.created = new Date(proto.created);
545
+ }
546
+ if (proto.updated) {
547
+ m.updated = new Date(proto.updated);
548
+ }
549
+ if (proto.originLocation) {
550
+ m.originLocation = enumStringToValue(PlatformLocation, proto.originLocation);
551
+ }
552
+ return m;
553
+ }
554
+ toApiJson() {
555
+ const toReturn = {};
556
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
557
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
558
+ }
559
+ if (typeof this.channel !== 'undefined') {
560
+ toReturn['channel'] = this.channel;
561
+ }
562
+ if (typeof this.externalConversationId !== 'undefined') {
563
+ toReturn['externalConversationId'] = this.externalConversationId;
564
+ }
565
+ if (typeof this.created !== 'undefined' && this.created !== null) {
566
+ toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;
567
+ }
568
+ if (typeof this.updated !== 'undefined' && this.updated !== null) {
569
+ toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
570
+ }
571
+ if (typeof this.originLocation !== 'undefined') {
572
+ toReturn['originLocation'] = this.originLocation;
573
+ }
574
+ if (typeof this.originLocationExternalId !== 'undefined') {
575
+ toReturn['originLocationExternalId'] = this.originLocationExternalId;
576
+ }
577
+ return toReturn;
578
+ }
579
+ }
580
+ class CreateConversationResponse {
581
+ constructor(kwargs) {
582
+ if (!kwargs) {
583
+ return;
584
+ }
585
+ Object.assign(this, kwargs);
586
+ }
587
+ static fromProto(proto) {
588
+ let m = new CreateConversationResponse();
589
+ m = Object.assign(m, proto);
590
+ if (proto.conversation) {
591
+ m.conversation = Conversation.fromProto(proto.conversation);
592
+ }
593
+ if (proto.participants) {
594
+ m.participants = proto.participants.map(Participant.fromProto);
595
+ }
596
+ return m;
597
+ }
598
+ toApiJson() {
599
+ const toReturn = {};
600
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
601
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
602
+ }
603
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
604
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
605
+ }
606
+ return toReturn;
607
+ }
608
+ }
609
+ class CreateMultiMessagesRequest {
610
+ constructor(kwargs) {
611
+ if (!kwargs) {
612
+ return;
613
+ }
614
+ Object.assign(this, kwargs);
615
+ }
616
+ static fromProto(proto) {
617
+ let m = new CreateMultiMessagesRequest();
618
+ m = Object.assign(m, proto);
619
+ if (proto.messages) {
620
+ m.messages = proto.messages.map(Message.fromProto);
621
+ }
622
+ if (proto.lastSeen) {
623
+ m.lastSeen = new Date(proto.lastSeen);
624
+ }
625
+ return m;
626
+ }
627
+ toApiJson() {
628
+ const toReturn = {};
629
+ if (typeof this.messages !== 'undefined' && this.messages !== null) {
630
+ toReturn['messages'] = 'toApiJson' in this.messages ? this.messages.toApiJson() : this.messages;
631
+ }
632
+ if (typeof this.lastSeen !== 'undefined' && this.lastSeen !== null) {
633
+ toReturn['lastSeen'] = 'toApiJson' in this.lastSeen ? this.lastSeen.toApiJson() : this.lastSeen;
634
+ }
635
+ return toReturn;
636
+ }
637
+ }
638
+ class MetadataDataEntry {
639
+ constructor(kwargs) {
640
+ if (!kwargs) {
641
+ return;
642
+ }
643
+ Object.assign(this, kwargs);
644
+ }
645
+ static fromProto(proto) {
646
+ let m = new MetadataDataEntry();
647
+ m = Object.assign(m, proto);
648
+ return m;
649
+ }
650
+ toApiJson() {
651
+ const toReturn = {};
652
+ if (typeof this.key !== 'undefined') {
653
+ toReturn['key'] = this.key;
654
+ }
655
+ if (typeof this.value !== 'undefined') {
656
+ toReturn['value'] = this.value;
657
+ }
658
+ return toReturn;
659
+ }
660
+ }
661
+ class DeleteConversationRequest {
662
+ constructor(kwargs) {
663
+ if (!kwargs) {
664
+ return;
665
+ }
666
+ Object.assign(this, kwargs);
667
+ }
668
+ static fromProto(proto) {
669
+ let m = new DeleteConversationRequest();
670
+ m = Object.assign(m, proto);
671
+ return m;
672
+ }
673
+ toApiJson() {
674
+ const toReturn = {};
675
+ if (typeof this.conversationId !== 'undefined') {
676
+ toReturn['conversationId'] = this.conversationId;
677
+ }
678
+ return toReturn;
679
+ }
680
+ }
681
+ class DeleteMessageRequest {
682
+ constructor(kwargs) {
683
+ if (!kwargs) {
684
+ return;
685
+ }
686
+ Object.assign(this, kwargs);
687
+ }
688
+ static fromProto(proto) {
689
+ let m = new DeleteMessageRequest();
690
+ m = Object.assign(m, proto);
691
+ return m;
692
+ }
693
+ toApiJson() {
694
+ const toReturn = {};
695
+ if (typeof this.messageId !== 'undefined') {
696
+ toReturn['messageId'] = this.messageId;
697
+ }
698
+ return toReturn;
699
+ }
700
+ }
701
+ class SearchConversationsResponseDetailedConversation {
702
+ constructor(kwargs) {
703
+ if (!kwargs) {
704
+ return;
705
+ }
706
+ Object.assign(this, kwargs);
707
+ }
708
+ static fromProto(proto) {
709
+ let m = new SearchConversationsResponseDetailedConversation();
710
+ m = Object.assign(m, proto);
711
+ if (proto.conversation) {
712
+ m.conversation = Conversation.fromProto(proto.conversation);
713
+ }
714
+ if (proto.latestMessage) {
715
+ m.latestMessage = Message.fromProto(proto.latestMessage);
716
+ }
717
+ if (proto.participants) {
718
+ m.participants = proto.participants.map(Participant.fromProto);
719
+ }
720
+ return m;
721
+ }
722
+ toApiJson() {
723
+ const toReturn = {};
724
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
725
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
726
+ }
727
+ if (typeof this.latestMessage !== 'undefined' && this.latestMessage !== null) {
728
+ toReturn['latestMessage'] = 'toApiJson' in this.latestMessage ? this.latestMessage.toApiJson() : this.latestMessage;
729
+ }
730
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
731
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
732
+ }
733
+ return toReturn;
734
+ }
735
+ }
736
+ class GetMultiConversationDetailsResponseDetailedConversation {
737
+ constructor(kwargs) {
738
+ if (!kwargs) {
739
+ return;
740
+ }
741
+ Object.assign(this, kwargs);
742
+ }
743
+ static fromProto(proto) {
744
+ let m = new GetMultiConversationDetailsResponseDetailedConversation();
745
+ m = Object.assign(m, proto);
746
+ if (proto.conversation) {
747
+ m.conversation = Conversation.fromProto(proto.conversation);
748
+ }
749
+ if (proto.latestMessage) {
750
+ m.latestMessage = Message.fromProto(proto.latestMessage);
751
+ }
752
+ if (proto.participants) {
753
+ m.participants = proto.participants.map(Participant.fromProto);
754
+ }
755
+ return m;
756
+ }
757
+ toApiJson() {
758
+ const toReturn = {};
759
+ if (typeof this.conversation !== 'undefined' && this.conversation !== null) {
760
+ toReturn['conversation'] = 'toApiJson' in this.conversation ? this.conversation.toApiJson() : this.conversation;
761
+ }
762
+ if (typeof this.latestMessage !== 'undefined' && this.latestMessage !== null) {
763
+ toReturn['latestMessage'] = 'toApiJson' in this.latestMessage ? this.latestMessage.toApiJson() : this.latestMessage;
764
+ }
765
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
766
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
767
+ }
768
+ return toReturn;
769
+ }
770
+ }
771
+ class GetMessageRequest {
772
+ constructor(kwargs) {
773
+ if (!kwargs) {
774
+ return;
775
+ }
776
+ Object.assign(this, kwargs);
777
+ }
778
+ static fromProto(proto) {
779
+ let m = new GetMessageRequest();
780
+ m = Object.assign(m, proto);
781
+ return m;
782
+ }
783
+ toApiJson() {
784
+ const toReturn = {};
785
+ if (typeof this.messageId !== 'undefined') {
786
+ toReturn['messageId'] = this.messageId;
787
+ }
788
+ return toReturn;
789
+ }
790
+ }
791
+ class GetMultiConversationDetailsRequest {
792
+ constructor(kwargs) {
793
+ if (!kwargs) {
794
+ return;
795
+ }
796
+ Object.assign(this, kwargs);
797
+ }
798
+ static fromProto(proto) {
799
+ let m = new GetMultiConversationDetailsRequest();
800
+ m = Object.assign(m, proto);
801
+ return m;
802
+ }
803
+ toApiJson() {
804
+ const toReturn = {};
805
+ if (typeof this.conversationIds !== 'undefined') {
806
+ toReturn['conversationIds'] = this.conversationIds;
807
+ }
808
+ return toReturn;
809
+ }
810
+ }
811
+ class GetMultiConversationDetailsResponse {
812
+ constructor(kwargs) {
813
+ if (!kwargs) {
814
+ return;
815
+ }
816
+ Object.assign(this, kwargs);
817
+ }
818
+ static fromProto(proto) {
819
+ let m = new GetMultiConversationDetailsResponse();
820
+ m = Object.assign(m, proto);
821
+ if (proto.conversations) {
822
+ m.conversations = proto.conversations.map(GetMultiConversationDetailsResponseDetailedConversation.fromProto);
823
+ }
824
+ return m;
825
+ }
826
+ toApiJson() {
827
+ const toReturn = {};
828
+ if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
829
+ toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
830
+ }
831
+ return toReturn;
832
+ }
833
+ }
834
+ class GetMultiConversationMessageCountRequest {
835
+ constructor(kwargs) {
836
+ if (!kwargs) {
837
+ return;
838
+ }
839
+ Object.assign(this, kwargs);
840
+ }
841
+ static fromProto(proto) {
842
+ let m = new GetMultiConversationMessageCountRequest();
843
+ m = Object.assign(m, proto);
844
+ return m;
845
+ }
846
+ toApiJson() {
847
+ const toReturn = {};
848
+ if (typeof this.conversationIds !== 'undefined') {
849
+ toReturn['conversationIds'] = this.conversationIds;
850
+ }
851
+ return toReturn;
852
+ }
853
+ }
854
+ class GetMultiConversationMessageCountResponse {
855
+ constructor(kwargs) {
856
+ if (!kwargs) {
857
+ return;
858
+ }
859
+ Object.assign(this, kwargs);
860
+ }
861
+ static fromProto(proto) {
862
+ let m = new GetMultiConversationMessageCountResponse();
863
+ m = Object.assign(m, proto);
864
+ if (proto.messageCounts) {
865
+ m.messageCounts = proto.messageCounts.map(ConversationMessageCount.fromProto);
866
+ }
867
+ if (proto.counts) {
868
+ m.counts = Object.keys(proto.counts).reduce((obj, k) => { obj[k] = parseInt(proto.counts[k], 10); return obj; }, {});
869
+ }
870
+ return m;
871
+ }
872
+ toApiJson() {
873
+ const toReturn = {};
874
+ if (typeof this.messageCounts !== 'undefined' && this.messageCounts !== null) {
875
+ toReturn['messageCounts'] = 'toApiJson' in this.messageCounts ? this.messageCounts.toApiJson() : this.messageCounts;
876
+ }
877
+ if (typeof this.counts !== 'undefined' && this.counts !== null) {
878
+ toReturn['counts'] = 'toApiJson' in this.counts ? this.counts.toApiJson() : this.counts;
879
+ }
880
+ return toReturn;
881
+ }
882
+ }
883
+ class GetMultiMessagesRequest {
884
+ constructor(kwargs) {
885
+ if (!kwargs) {
886
+ return;
887
+ }
888
+ Object.assign(this, kwargs);
889
+ }
890
+ static fromProto(proto) {
891
+ let m = new GetMultiMessagesRequest();
892
+ m = Object.assign(m, proto);
893
+ return m;
894
+ }
895
+ toApiJson() {
896
+ const toReturn = {};
897
+ if (typeof this.messageIds !== 'undefined') {
898
+ toReturn['messageIds'] = this.messageIds;
899
+ }
900
+ if (typeof this.conversationId !== 'undefined') {
901
+ toReturn['conversationId'] = this.conversationId;
902
+ }
903
+ return toReturn;
904
+ }
905
+ }
906
+ class GetMultiMessagesResponse {
907
+ constructor(kwargs) {
908
+ if (!kwargs) {
909
+ return;
910
+ }
911
+ Object.assign(this, kwargs);
912
+ }
913
+ static fromProto(proto) {
914
+ let m = new GetMultiMessagesResponse();
915
+ m = Object.assign(m, proto);
916
+ if (proto.messages) {
917
+ m.messages = proto.messages.map(Message.fromProto);
918
+ }
919
+ return m;
920
+ }
921
+ toApiJson() {
922
+ const toReturn = {};
923
+ if (typeof this.messages !== 'undefined' && this.messages !== null) {
924
+ toReturn['messages'] = 'toApiJson' in this.messages ? this.messages.toApiJson() : this.messages;
925
+ }
926
+ return toReturn;
927
+ }
928
+ }
929
+ class GetMultiParticipantsRequest {
930
+ constructor(kwargs) {
931
+ if (!kwargs) {
932
+ return;
933
+ }
934
+ Object.assign(this, kwargs);
935
+ }
936
+ static fromProto(proto) {
937
+ let m = new GetMultiParticipantsRequest();
938
+ m = Object.assign(m, proto);
939
+ return m;
940
+ }
941
+ toApiJson() {
942
+ const toReturn = {};
943
+ if (typeof this.participantIds !== 'undefined') {
944
+ toReturn['participantIds'] = this.participantIds;
945
+ }
946
+ if (typeof this.conversationId !== 'undefined') {
947
+ toReturn['conversationId'] = this.conversationId;
948
+ }
949
+ return toReturn;
950
+ }
951
+ }
952
+ class GetMultiParticipantsResponse {
953
+ constructor(kwargs) {
954
+ if (!kwargs) {
955
+ return;
956
+ }
957
+ Object.assign(this, kwargs);
958
+ }
959
+ static fromProto(proto) {
960
+ let m = new GetMultiParticipantsResponse();
961
+ m = Object.assign(m, proto);
962
+ if (proto.participants) {
963
+ m.participants = proto.participants.map(Participant.fromProto);
964
+ }
965
+ return m;
966
+ }
967
+ toApiJson() {
968
+ const toReturn = {};
969
+ if (typeof this.participants !== 'undefined' && this.participants !== null) {
970
+ toReturn['participants'] = 'toApiJson' in this.participants ? this.participants.toApiJson() : this.participants;
971
+ }
972
+ return toReturn;
973
+ }
974
+ }
975
+ class ListMessagesRequestListMessagesFilters {
976
+ constructor(kwargs) {
977
+ if (!kwargs) {
978
+ return;
979
+ }
980
+ Object.assign(this, kwargs);
981
+ }
982
+ static fromProto(proto) {
983
+ let m = new ListMessagesRequestListMessagesFilters();
984
+ m = Object.assign(m, proto);
985
+ return m;
986
+ }
987
+ toApiJson() {
988
+ const toReturn = {};
989
+ if (typeof this.conversationId !== 'undefined') {
990
+ toReturn['conversationId'] = this.conversationId;
991
+ }
992
+ return toReturn;
993
+ }
994
+ }
995
+ class ListMessagesRequest {
996
+ constructor(kwargs) {
997
+ if (!kwargs) {
998
+ return;
999
+ }
1000
+ Object.assign(this, kwargs);
1001
+ }
1002
+ static fromProto(proto) {
1003
+ let m = new ListMessagesRequest();
1004
+ m = Object.assign(m, proto);
1005
+ if (proto.filters) {
1006
+ m.filters = ListMessagesRequestListMessagesFilters.fromProto(proto.filters);
1007
+ }
1008
+ if (proto.pagingOptions) {
1009
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1010
+ }
1011
+ return m;
1012
+ }
1013
+ toApiJson() {
1014
+ const toReturn = {};
1015
+ if (typeof this.filters !== 'undefined' && this.filters !== null) {
1016
+ toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
1017
+ }
1018
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1019
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1020
+ }
1021
+ return toReturn;
1022
+ }
1023
+ }
1024
+ class ListMessagesResponse {
1025
+ constructor(kwargs) {
1026
+ if (!kwargs) {
1027
+ return;
1028
+ }
1029
+ Object.assign(this, kwargs);
1030
+ }
1031
+ static fromProto(proto) {
1032
+ let m = new ListMessagesResponse();
1033
+ m = Object.assign(m, proto);
1034
+ if (proto.messages) {
1035
+ m.messages = proto.messages.map(Message.fromProto);
1036
+ }
1037
+ if (proto.pagingMetadata) {
1038
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1039
+ }
1040
+ return m;
1041
+ }
1042
+ toApiJson() {
1043
+ const toReturn = {};
1044
+ if (typeof this.messages !== 'undefined' && this.messages !== null) {
1045
+ toReturn['messages'] = 'toApiJson' in this.messages ? this.messages.toApiJson() : this.messages;
1046
+ }
1047
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1048
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1049
+ }
1050
+ return toReturn;
1051
+ }
1052
+ }
1053
+ class LookupConversationsRequestLookupConversationsFilters {
1054
+ constructor(kwargs) {
1055
+ if (!kwargs) {
1056
+ return;
1057
+ }
1058
+ Object.assign(this, kwargs);
1059
+ }
1060
+ static fromProto(proto) {
1061
+ let m = new LookupConversationsRequestLookupConversationsFilters();
1062
+ m = Object.assign(m, proto);
1063
+ if (proto.location) {
1064
+ m.location = enumStringToValue(PlatformLocation, proto.location);
1065
+ }
1066
+ if (proto.channel) {
1067
+ m.channel = enumStringToValue(ConversationChannel, proto.channel);
1068
+ }
1069
+ if (proto.originLocation) {
1070
+ m.originLocation = enumStringToValue(PlatformLocation, proto.originLocation);
1071
+ }
1072
+ return m;
1073
+ }
1074
+ toApiJson() {
1075
+ const toReturn = {};
1076
+ if (typeof this.internalParticipantId !== 'undefined') {
1077
+ toReturn['internalParticipantId'] = this.internalParticipantId;
1078
+ }
1079
+ if (typeof this.location !== 'undefined') {
1080
+ toReturn['location'] = this.location;
1081
+ }
1082
+ if (typeof this.channel !== 'undefined') {
1083
+ toReturn['channel'] = this.channel;
1084
+ }
1085
+ if (typeof this.accountGroupId !== 'undefined') {
1086
+ toReturn['accountGroupId'] = this.accountGroupId;
1087
+ }
1088
+ if (typeof this.externalConversationId !== 'undefined') {
1089
+ toReturn['externalConversationId'] = this.externalConversationId;
1090
+ }
1091
+ if (typeof this.originLocation !== 'undefined') {
1092
+ toReturn['originLocation'] = this.originLocation;
1093
+ }
1094
+ if (typeof this.originLocationExternalId !== 'undefined') {
1095
+ toReturn['originLocationExternalId'] = this.originLocationExternalId;
1096
+ }
1097
+ return toReturn;
1098
+ }
1099
+ }
1100
+ class LookupConversationsRequest {
1101
+ constructor(kwargs) {
1102
+ if (!kwargs) {
1103
+ return;
1104
+ }
1105
+ Object.assign(this, kwargs);
1106
+ }
1107
+ static fromProto(proto) {
1108
+ let m = new LookupConversationsRequest();
1109
+ m = Object.assign(m, proto);
1110
+ if (proto.filters) {
1111
+ m.filters = LookupConversationsRequestLookupConversationsFilters.fromProto(proto.filters);
1112
+ }
1113
+ if (proto.pagingOptions) {
1114
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1115
+ }
1116
+ return m;
1117
+ }
1118
+ toApiJson() {
1119
+ const toReturn = {};
1120
+ if (typeof this.filters !== 'undefined' && this.filters !== null) {
1121
+ toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
1122
+ }
1123
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1124
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1125
+ }
1126
+ return toReturn;
1127
+ }
1128
+ }
1129
+ class LookupConversationsResponse {
1130
+ constructor(kwargs) {
1131
+ if (!kwargs) {
1132
+ return;
1133
+ }
1134
+ Object.assign(this, kwargs);
1135
+ }
1136
+ static fromProto(proto) {
1137
+ let m = new LookupConversationsResponse();
1138
+ m = Object.assign(m, proto);
1139
+ if (proto.conversations) {
1140
+ m.conversations = proto.conversations.map(LookupConversationsResponseConversations.fromProto);
1141
+ }
1142
+ if (proto.pagingMetadata) {
1143
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1144
+ }
1145
+ return m;
1146
+ }
1147
+ toApiJson() {
1148
+ const toReturn = {};
1149
+ if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
1150
+ toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
1151
+ }
1152
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1153
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1154
+ }
1155
+ return toReturn;
1156
+ }
1157
+ }
1158
+ class Metadata {
1159
+ constructor(kwargs) {
1160
+ if (!kwargs) {
1161
+ return;
1162
+ }
1163
+ Object.assign(this, kwargs);
1164
+ }
1165
+ static fromProto(proto) {
1166
+ let m = new Metadata();
1167
+ m = Object.assign(m, proto);
1168
+ if (proto.identifier) {
1169
+ m.identifier = enumStringToValue(MetadataIdentifier, proto.identifier);
1170
+ }
1171
+ if (proto.data) {
1172
+ m.data = Object.keys(proto.data).reduce((obj, k) => { obj[k] = proto.data[k]; return obj; }, {});
1173
+ }
1174
+ return m;
1175
+ }
1176
+ toApiJson() {
1177
+ const toReturn = {};
1178
+ if (typeof this.identifier !== 'undefined') {
1179
+ toReturn['identifier'] = this.identifier;
1180
+ }
1181
+ if (typeof this.data !== 'undefined' && this.data !== null) {
1182
+ toReturn['data'] = 'toApiJson' in this.data ? this.data.toApiJson() : this.data;
1183
+ }
1184
+ return toReturn;
1185
+ }
1186
+ }
1187
+ class ReceiveMessageRequestMetadataEntry {
1188
+ constructor(kwargs) {
1189
+ if (!kwargs) {
1190
+ return;
1191
+ }
1192
+ Object.assign(this, kwargs);
1193
+ }
1194
+ static fromProto(proto) {
1195
+ let m = new ReceiveMessageRequestMetadataEntry();
1196
+ m = Object.assign(m, proto);
1197
+ return m;
1198
+ }
1199
+ toApiJson() {
1200
+ const toReturn = {};
1201
+ if (typeof this.key !== 'undefined') {
1202
+ toReturn['key'] = this.key;
1203
+ }
1204
+ if (typeof this.value !== 'undefined') {
1205
+ toReturn['value'] = this.value;
1206
+ }
1207
+ return toReturn;
1208
+ }
1209
+ }
1210
+ class PagedRequestOptions {
1211
+ constructor(kwargs) {
1212
+ if (!kwargs) {
1213
+ return;
1214
+ }
1215
+ Object.assign(this, kwargs);
1216
+ }
1217
+ static fromProto(proto) {
1218
+ let m = new PagedRequestOptions();
1219
+ m = Object.assign(m, proto);
1220
+ return m;
1221
+ }
1222
+ toApiJson() {
1223
+ const toReturn = {};
1224
+ if (typeof this.cursor !== 'undefined') {
1225
+ toReturn['cursor'] = this.cursor;
1226
+ }
1227
+ if (typeof this.pageSize !== 'undefined') {
1228
+ toReturn['pageSize'] = this.pageSize;
1229
+ }
1230
+ return toReturn;
1231
+ }
1232
+ }
1233
+ class PagedResponseMetadata {
1234
+ constructor(kwargs) {
1235
+ if (!kwargs) {
1236
+ return;
1237
+ }
1238
+ Object.assign(this, kwargs);
1239
+ }
1240
+ static fromProto(proto) {
1241
+ let m = new PagedResponseMetadata();
1242
+ m = Object.assign(m, proto);
1243
+ return m;
1244
+ }
1245
+ toApiJson() {
1246
+ const toReturn = {};
1247
+ if (typeof this.nextCursor !== 'undefined') {
1248
+ toReturn['nextCursor'] = this.nextCursor;
1249
+ }
1250
+ if (typeof this.hasMore !== 'undefined') {
1251
+ toReturn['hasMore'] = this.hasMore;
1252
+ }
1253
+ return toReturn;
1254
+ }
1255
+ }
1256
+ class ReceiveMessageRequest {
1257
+ constructor(kwargs) {
1258
+ if (!kwargs) {
1259
+ return;
1260
+ }
1261
+ Object.assign(this, kwargs);
1262
+ }
1263
+ static fromProto(proto) {
1264
+ let m = new ReceiveMessageRequest();
1265
+ m = Object.assign(m, proto);
1266
+ if (proto.channel) {
1267
+ m.channel = enumStringToValue(ConversationChannel, proto.channel);
1268
+ }
1269
+ if (proto.type) {
1270
+ m.type = enumStringToValue(MessageType, proto.type);
1271
+ }
1272
+ if (proto.location) {
1273
+ m.location = enumStringToValue(PlatformLocation, proto.location);
1274
+ }
1275
+ if (proto.metadata) {
1276
+ m.metadata = Object.keys(proto.metadata).reduce((obj, k) => { obj[k] = proto.metadata[k]; return obj; }, {});
1277
+ }
1278
+ return m;
1279
+ }
1280
+ toApiJson() {
1281
+ const toReturn = {};
1282
+ if (typeof this.senderId !== 'undefined') {
1283
+ toReturn['senderId'] = this.senderId;
1284
+ }
1285
+ if (typeof this.recipientId !== 'undefined') {
1286
+ toReturn['recipientId'] = this.recipientId;
1287
+ }
1288
+ if (typeof this.conversationId !== 'undefined') {
1289
+ toReturn['conversationId'] = this.conversationId;
1290
+ }
1291
+ if (typeof this.messageId !== 'undefined') {
1292
+ toReturn['messageId'] = this.messageId;
1293
+ }
1294
+ if (typeof this.body !== 'undefined') {
1295
+ toReturn['body'] = this.body;
1296
+ }
1297
+ if (typeof this.channel !== 'undefined') {
1298
+ toReturn['channel'] = this.channel;
1299
+ }
1300
+ if (typeof this.type !== 'undefined') {
1301
+ toReturn['type'] = this.type;
1302
+ }
1303
+ if (typeof this.location !== 'undefined') {
1304
+ toReturn['location'] = this.location;
1305
+ }
1306
+ if (typeof this.partnerId !== 'undefined') {
1307
+ toReturn['partnerId'] = this.partnerId;
1308
+ }
1309
+ if (typeof this.accountGroupId !== 'undefined') {
1310
+ toReturn['accountGroupId'] = this.accountGroupId;
1311
+ }
1312
+ if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
1313
+ toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
1314
+ }
1315
+ if (typeof this.media !== 'undefined') {
1316
+ toReturn['media'] = this.media;
1317
+ }
1318
+ return toReturn;
1319
+ }
1320
+ }
1321
+ class SearchConversationsRequest {
1322
+ constructor(kwargs) {
1323
+ if (!kwargs) {
1324
+ return;
1325
+ }
1326
+ Object.assign(this, kwargs);
1327
+ }
1328
+ static fromProto(proto) {
1329
+ let m = new SearchConversationsRequest();
1330
+ m = Object.assign(m, proto);
1331
+ if (proto.location) {
1332
+ m.location = enumStringToValue(PlatformLocation, proto.location);
1333
+ }
1334
+ if (proto.pagingOptions) {
1335
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
1336
+ }
1337
+ return m;
1338
+ }
1339
+ toApiJson() {
1340
+ const toReturn = {};
1341
+ if (typeof this.partnerId !== 'undefined') {
1342
+ toReturn['partnerId'] = this.partnerId;
1343
+ }
1344
+ if (typeof this.accountGroupId !== 'undefined') {
1345
+ toReturn['accountGroupId'] = this.accountGroupId;
1346
+ }
1347
+ if (typeof this.location !== 'undefined') {
1348
+ toReturn['location'] = this.location;
1349
+ }
1350
+ if (typeof this.searchTerm !== 'undefined') {
1351
+ toReturn['searchTerm'] = this.searchTerm;
1352
+ }
1353
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
1354
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
1355
+ }
1356
+ return toReturn;
1357
+ }
1358
+ }
1359
+ class SearchConversationsResponse {
1360
+ constructor(kwargs) {
1361
+ if (!kwargs) {
1362
+ return;
1363
+ }
1364
+ Object.assign(this, kwargs);
1365
+ }
1366
+ static fromProto(proto) {
1367
+ let m = new SearchConversationsResponse();
1368
+ m = Object.assign(m, proto);
1369
+ if (proto.conversations) {
1370
+ m.conversations = proto.conversations.map(SearchConversationsResponseDetailedConversation.fromProto);
1371
+ }
1372
+ if (proto.pagingMetadata) {
1373
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
1374
+ }
1375
+ return m;
1376
+ }
1377
+ toApiJson() {
1378
+ const toReturn = {};
1379
+ if (typeof this.conversations !== 'undefined' && this.conversations !== null) {
1380
+ toReturn['conversations'] = 'toApiJson' in this.conversations ? this.conversations.toApiJson() : this.conversations;
1381
+ }
1382
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
1383
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
1384
+ }
1385
+ return toReturn;
1386
+ }
1387
+ }
1388
+ class SendMessageRequest {
1389
+ constructor(kwargs) {
1390
+ if (!kwargs) {
1391
+ return;
1392
+ }
1393
+ Object.assign(this, kwargs);
1394
+ }
1395
+ static fromProto(proto) {
1396
+ let m = new SendMessageRequest();
1397
+ m = Object.assign(m, proto);
1398
+ if (proto.sender) {
1399
+ m.sender = Participant.fromProto(proto.sender);
1400
+ }
1401
+ if (proto.recipient) {
1402
+ m.recipient = Participant.fromProto(proto.recipient);
1403
+ }
1404
+ if (proto.type) {
1405
+ m.type = enumStringToValue(MessageType, proto.type);
1406
+ }
1407
+ if (proto.metadata) {
1408
+ m.metadata = proto.metadata.map(Metadata.fromProto);
1409
+ }
1410
+ return m;
1411
+ }
1412
+ toApiJson() {
1413
+ const toReturn = {};
1414
+ if (typeof this.sender !== 'undefined' && this.sender !== null) {
1415
+ toReturn['sender'] = 'toApiJson' in this.sender ? this.sender.toApiJson() : this.sender;
1416
+ }
1417
+ if (typeof this.recipient !== 'undefined' && this.recipient !== null) {
1418
+ toReturn['recipient'] = 'toApiJson' in this.recipient ? this.recipient.toApiJson() : this.recipient;
1419
+ }
1420
+ if (typeof this.conversationId !== 'undefined') {
1421
+ toReturn['conversationId'] = this.conversationId;
1422
+ }
1423
+ if (typeof this.type !== 'undefined') {
1424
+ toReturn['type'] = this.type;
1425
+ }
1426
+ if (typeof this.body !== 'undefined') {
1427
+ toReturn['body'] = this.body;
1428
+ }
1429
+ if (typeof this.metadata !== 'undefined' && this.metadata !== null) {
1430
+ toReturn['metadata'] = 'toApiJson' in this.metadata ? this.metadata.toApiJson() : this.metadata;
1431
+ }
1432
+ return toReturn;
1433
+ }
1434
+ }
1435
+ class SendMessageResponse {
1436
+ constructor(kwargs) {
1437
+ if (!kwargs) {
1438
+ return;
1439
+ }
1440
+ Object.assign(this, kwargs);
1441
+ }
1442
+ static fromProto(proto) {
1443
+ let m = new SendMessageResponse();
1444
+ m = Object.assign(m, proto);
1445
+ return m;
1446
+ }
1447
+ toApiJson() {
1448
+ const toReturn = {};
1449
+ if (typeof this.workflowId !== 'undefined') {
1450
+ toReturn['workflowId'] = this.workflowId;
1451
+ }
1452
+ return toReturn;
1453
+ }
1454
+ }
1455
+ class SetLastSeenRequest {
1456
+ constructor(kwargs) {
1457
+ if (!kwargs) {
1458
+ return;
1459
+ }
1460
+ Object.assign(this, kwargs);
1461
+ }
1462
+ static fromProto(proto) {
1463
+ let m = new SetLastSeenRequest();
1464
+ m = Object.assign(m, proto);
1465
+ return m;
1466
+ }
1467
+ toApiJson() {
1468
+ const toReturn = {};
1469
+ if (typeof this.conversationId !== 'undefined') {
1470
+ toReturn['conversationId'] = this.conversationId;
1471
+ }
1472
+ return toReturn;
1473
+ }
1474
+ }
1475
+ class SetLastSeenResponse {
1476
+ constructor(kwargs) {
1477
+ if (!kwargs) {
1478
+ return;
1479
+ }
1480
+ Object.assign(this, kwargs);
1481
+ }
1482
+ static fromProto(proto) {
1483
+ let m = new SetLastSeenResponse();
1484
+ m = Object.assign(m, proto);
1485
+ if (proto.lastSeen) {
1486
+ m.lastSeen = new Date(proto.lastSeen);
1487
+ }
1488
+ return m;
1489
+ }
1490
+ toApiJson() {
1491
+ const toReturn = {};
1492
+ if (typeof this.lastSeen !== 'undefined' && this.lastSeen !== null) {
1493
+ toReturn['lastSeen'] = 'toApiJson' in this.lastSeen ? this.lastSeen.toApiJson() : this.lastSeen;
1494
+ }
1495
+ return toReturn;
1496
+ }
1497
+ }
1498
+ class UpdateMessageStatusRequest {
1499
+ constructor(kwargs) {
1500
+ if (!kwargs) {
1501
+ return;
1502
+ }
1503
+ Object.assign(this, kwargs);
1504
+ }
1505
+ static fromProto(proto) {
1506
+ let m = new UpdateMessageStatusRequest();
1507
+ m = Object.assign(m, proto);
1508
+ if (proto.status) {
1509
+ m.status = enumStringToValue(MessageStatus, proto.status);
1510
+ }
1511
+ return m;
1512
+ }
1513
+ toApiJson() {
1514
+ const toReturn = {};
1515
+ if (typeof this.messageId !== 'undefined') {
1516
+ toReturn['messageId'] = this.messageId;
1517
+ }
1518
+ if (typeof this.participantId !== 'undefined') {
1519
+ toReturn['participantId'] = this.participantId;
1520
+ }
1521
+ if (typeof this.status !== 'undefined') {
1522
+ toReturn['status'] = this.status;
1523
+ }
1524
+ return toReturn;
1525
+ }
1526
+ }
1527
+
1528
+ // *********************************
1529
+
1530
+ var _a;
1531
+ const environment = (_a = (window ? window['environment'] : 'prod')) !== null && _a !== void 0 ? _a : 'prod';
1532
+ const hostMap = {
1533
+ 'local': 'conversation-api.vendasta-local.com',
1534
+ 'test': '',
1535
+ 'demo': 'conversation-demo.apigateway.co',
1536
+ 'prod': 'conversation-prod.apigateway.co',
1537
+ 'production': 'conversation-prod.apigateway.co',
1538
+ };
1539
+ class HostService {
1540
+ get host() {
1541
+ return hostMap[environment.toLowerCase()];
1542
+ }
1543
+ get hostWithScheme() {
1544
+ return 'https://' + this.host;
1545
+ }
1546
+ }
1547
+ HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1548
+ HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: HostService, providedIn: 'root' });
1549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: HostService, decorators: [{
1550
+ type: Injectable,
1551
+ args: [{ providedIn: 'root' }]
1552
+ }] });
1553
+
1554
+ // *********************************
1555
+ class ConversationApiService {
1556
+ constructor(http, hostService) {
1557
+ this.http = http;
1558
+ this.hostService = hostService;
1559
+ this._host = this.hostService.hostWithScheme;
1560
+ }
1561
+ apiOptions() {
1562
+ return {
1563
+ headers: new HttpHeaders({
1564
+ 'Content-Type': 'application/json'
1565
+ }),
1566
+ withCredentials: true
1567
+ };
1568
+ }
1569
+ sendMessage(r) {
1570
+ const request = (r.toApiJson) ? r : new SendMessageRequest(r);
1571
+ return this.http.post(this._host + "/conversation.v1.ConversationService/SendMessage", request.toApiJson(), this.apiOptions())
1572
+ .pipe(map(resp => SendMessageResponse.fromProto(resp)));
1573
+ }
1574
+ getMessage(r) {
1575
+ const request = (r.toApiJson) ? r : new GetMessageRequest(r);
1576
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetMessage", request.toApiJson(), this.apiOptions())
1577
+ .pipe(map(resp => Message.fromProto(resp)));
1578
+ }
1579
+ listMessages(r) {
1580
+ const request = (r.toApiJson) ? r : new ListMessagesRequest(r);
1581
+ return this.http.post(this._host + "/conversation.v1.ConversationService/ListMessages", request.toApiJson(), this.apiOptions())
1582
+ .pipe(map(resp => ListMessagesResponse.fromProto(resp)));
1583
+ }
1584
+ deleteMessage(r) {
1585
+ const request = (r.toApiJson) ? r : new DeleteMessageRequest(r);
1586
+ return this.http.post(this._host + "/conversation.v1.ConversationService/DeleteMessage", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1587
+ }
1588
+ updateMessageStatus(r) {
1589
+ const request = (r.toApiJson) ? r : new UpdateMessageStatusRequest(r);
1590
+ return this.http.post(this._host + "/conversation.v1.ConversationService/UpdateMessageStatus", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1591
+ }
1592
+ lookupConversations(r) {
1593
+ const request = (r.toApiJson) ? r : new LookupConversationsRequest(r);
1594
+ return this.http.post(this._host + "/conversation.v1.ConversationService/LookupConversations", request.toApiJson(), this.apiOptions())
1595
+ .pipe(map(resp => LookupConversationsResponse.fromProto(resp)));
1596
+ }
1597
+ createConversation(r) {
1598
+ const request = (r.toApiJson) ? r : new CreateConversationRequest(r);
1599
+ return this.http.post(this._host + "/conversation.v1.ConversationService/CreateConversation", request.toApiJson(), this.apiOptions())
1600
+ .pipe(map(resp => CreateConversationResponse.fromProto(resp)));
1601
+ }
1602
+ deleteConversation(r) {
1603
+ const request = (r.toApiJson) ? r : new DeleteConversationRequest(r);
1604
+ return this.http.post(this._host + "/conversation.v1.ConversationService/DeleteConversation", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1605
+ }
1606
+ receiveMessage(r) {
1607
+ const request = (r.toApiJson) ? r : new ReceiveMessageRequest(r);
1608
+ return this.http.post(this._host + "/conversation.v1.ConversationService/ReceiveMessage", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1609
+ }
1610
+ getMultiMessages(r) {
1611
+ const request = (r.toApiJson) ? r : new GetMultiMessagesRequest(r);
1612
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiMessages", request.toApiJson(), this.apiOptions())
1613
+ .pipe(map(resp => GetMultiMessagesResponse.fromProto(resp)));
1614
+ }
1615
+ createMultiMessages(r) {
1616
+ const request = (r.toApiJson) ? r : new CreateMultiMessagesRequest(r);
1617
+ return this.http.post(this._host + "/conversation.v1.ConversationService/CreateMultiMessages", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
1618
+ }
1619
+ getMultiConversationDetails(r) {
1620
+ const request = (r.toApiJson) ? r : new GetMultiConversationDetailsRequest(r);
1621
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiConversationDetails", request.toApiJson(), this.apiOptions())
1622
+ .pipe(map(resp => GetMultiConversationDetailsResponse.fromProto(resp)));
1623
+ }
1624
+ getMultiParticipants(r) {
1625
+ const request = (r.toApiJson) ? r : new GetMultiParticipantsRequest(r);
1626
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiParticipants", request.toApiJson(), this.apiOptions())
1627
+ .pipe(map(resp => GetMultiParticipantsResponse.fromProto(resp)));
1628
+ }
1629
+ searchConversations(r) {
1630
+ const request = (r.toApiJson) ? r : new SearchConversationsRequest(r);
1631
+ return this.http.post(this._host + "/conversation.v1.ConversationService/SearchConversations", request.toApiJson(), this.apiOptions())
1632
+ .pipe(map(resp => SearchConversationsResponse.fromProto(resp)));
1633
+ }
1634
+ getMultiConversationMessageCount(r) {
1635
+ const request = (r.toApiJson) ? r : new GetMultiConversationMessageCountRequest(r);
1636
+ return this.http.post(this._host + "/conversation.v1.ConversationService/GetMultiConversationMessageCount", request.toApiJson(), this.apiOptions())
1637
+ .pipe(map(resp => GetMultiConversationMessageCountResponse.fromProto(resp)));
1638
+ }
1639
+ addMultiParticipants(r) {
1640
+ const request = (r.toApiJson) ? r : new AddMultiParticipantsRequest(r);
1641
+ return this.http.post(this._host + "/conversation.v1.ConversationService/AddMultiParticipants", request.toApiJson(), this.apiOptions())
1642
+ .pipe(map(resp => AddMultiParticipantsResponse.fromProto(resp)));
1643
+ }
1644
+ setLastSeen(r) {
1645
+ const request = (r.toApiJson) ? r : new SetLastSeenRequest(r);
1646
+ return this.http.post(this._host + "/conversation.v1.ConversationService/SetLastSeen", request.toApiJson(), this.apiOptions())
1647
+ .pipe(map(resp => SetLastSeenResponse.fromProto(resp)));
1648
+ }
1649
+ }
1650
+ ConversationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ConversationApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
1651
+ ConversationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ConversationApiService, providedIn: 'root' });
1652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ConversationApiService, decorators: [{
1653
+ type: Injectable,
1654
+ args: [{ providedIn: 'root' }]
1655
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
1656
+
1657
+ // *********************************
1658
+
1659
+ /**
1660
+ * Generated bundle index. Do not edit.
1661
+ */
1662
+
1663
+ export { AddMultiParticipantsRequest, AddMultiParticipantsResponse, Address, Conversation, ConversationApiService, ConversationChannel, ConversationMessageCount, CreateConversationRequest, CreateConversationResponse, CreateMultiMessagesRequest, DeleteConversationRequest, DeleteMessageRequest, GetMessageRequest, GetMultiConversationDetailsRequest, GetMultiConversationDetailsResponse, GetMultiConversationDetailsResponseDetailedConversation, GetMultiConversationMessageCountRequest, GetMultiConversationMessageCountResponse, GetMultiConversationMessageCountResponseCountsEntry, GetMultiMessagesRequest, GetMultiMessagesResponse, GetMultiParticipantsRequest, GetMultiParticipantsResponse, ListMessagesRequest, ListMessagesRequestListMessagesFilters, ListMessagesResponse, LookupConversationsRequest, LookupConversationsRequestLookupConversationsFilters, LookupConversationsResponse, LookupConversationsResponseConversations, Message, MessageStatus, MessageType, Metadata, MetadataDataEntry, MetadataIdentifier, PagedRequestOptions, PagedResponseMetadata, Participant, ParticipantMessageStatus, ParticipantType, PlatformLocation, ReceiveMessageRequest, ReceiveMessageRequestMetadataEntry, SearchConversationsRequest, SearchConversationsResponse, SearchConversationsResponseDetailedConversation, SendMessageRequest, SendMessageResponse, SetLastSeenRequest, SetLastSeenResponse, UpdateMessageStatusRequest };
1664
+ //# sourceMappingURL=vendasta-conversation.mjs.map