-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
models.ts
136 lines (121 loc) · 3.56 KB
/
models.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { CommunicationUserIdentifier } from "@azure/communication-common";
import { HttpResponse } from "@azure/core-http";
import {
SendChatMessageResult,
ChatMessage as RestChatMessage,
ChatThread as RestChatThread,
ChatParticipant as RestChatParticipant,
ChatMessageReadReceipt as RestChatMessageReadReceipt,
ChatMessageContent as RestChatMessageContent,
ChatMessageType,
CreateChatThreadResult,
CreateChatThreadErrors,
AddChatParticipantsResult,
AddChatParticipantsErrors,
CommunicationError
} from "../generated/src/models";
export {
RestChatMessage,
RestChatThread,
RestChatParticipant,
RestChatMessageContent,
RestChatMessageReadReceipt,
CreateChatThreadResult,
CreateChatThreadErrors,
SendChatMessageResult,
AddChatParticipantsResult,
AddChatParticipantsErrors,
ChatMessageType,
CommunicationError
};
/**
* An interface representing a chat message.
*/
export interface ChatMessage extends Omit<RestChatMessage, "senderId" | "content"> {
/**
* The CommunicationUserIdentifier that identifies this chat message sender.
*/
sender?: CommunicationUserIdentifier;
/**
* Content of a chat message.
*/
content?: ChatMessageContent;
}
export interface ChatMessageContent extends Omit<RestChatMessageContent, "participants"> {
/**
* Chat message content for type "participantAdded" or "participantRemoved" messages.
*/
participants?: ChatParticipant[];
}
/**
* An interface representing a chat thread.
*/
export interface ChatThread extends Omit<RestChatThread, "createdBy"> {
/**
* The CommunicationUserIdentifier that identifies this chat thread owner.
*/
readonly createdBy?: CommunicationUserIdentifier;
}
/**
* A participant of the chat thread.
*/
export interface ChatParticipant extends Omit<RestChatParticipant, "id"> {
/**
* The CommunicationUserIdentifier that identifies this chat participant.
*/
user: CommunicationUserIdentifier;
}
/**
* A read receipt indicates the time a chat message was read by a recipient.
*/
export interface ChatMessageReadReceipt extends Omit<RestChatMessageReadReceipt, "senderId"> {
/**
* The CommunicationUserIdentifier that identifies this Read receipt sender.
*/
readonly sender: CommunicationUserIdentifier;
}
/**
* Arguments for retrieving the next page of search results.
*/
export interface ListPageSettings {
/**
* A token used for retrieving the next page of results when the server
* enforces pagination.
*/
continuationToken?: string;
}
/**
* Represents the repsonse for operations
*/
export interface OperationResponse {
/**
* The underlying HTTP response containing both raw and deserialized response data.
*/
_response: HttpResponse;
}
/**
* Represents an object with a non-enumerable _response property which provides
*/
export type WithResponse<T> = T & { _response: HttpResponse };
/**
* Represents the response from getting a chat message
*/
export type GetChatMessageResponse = WithResponse<ChatMessage>;
/**
* Represents the response from getting a chat thread
*/
export type GetChatThreadResponse = WithResponse<ChatThread>;
/**
* Represents the response from sending a chat message
*/
export type SendChatMessageResponse = WithResponse<SendChatMessageResult>;
/**
* Represents the response from creating a chat thread
*/
export type CreateChatThreadResponse = WithResponse<CreateChatThreadResult>;
/**
* Represents the response from adding chat participants
*/
export type AddChatParticipantsResponse = WithResponse<AddChatParticipantsResult>;