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