-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
models.ts
125 lines (115 loc) · 5.43 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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { CommunicationIdentifier, CommunicationIdentifierKind } from "@azure/communication-common";
import { ChatError, ChatMessageType } from "../generated/src";
export {
AddChatParticipantsResult,
ChatMessageType,
ChatThreadItem,
ChatError,
SendChatMessageResult,
} from "../generated/src/models";
/** Chat thread. */
export interface ChatThreadProperties {
/** Chat thread id. */
id: string;
/** Chat thread topic. */
topic: string;
/** The timestamp when the chat thread was created. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */
createdOn: Date;
/** Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. */
readonly createdBy?: CommunicationIdentifierKind;
/** The timestamp when the chat thread was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */
deletedOn?: Date;
}
/** Chat message. */
export interface ChatMessage {
/** The id of the chat message. This id is server generated. */
id: string;
/** The chat message type. */
type: ChatMessageType;
/** Sequence of the chat message in the conversation. */
sequenceId: string;
/** Version of the chat message. */
version: string;
/** Content of a chat message. */
content?: ChatMessageContent;
/** The display name of the chat message sender. This property is used to populate sender name for push notifications. */
senderDisplayName?: string;
/** The timestamp when the chat message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */
createdOn: Date;
/** Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. */
sender?: CommunicationIdentifierKind;
/** The timestamp (if applicable) when the message was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */
deletedOn?: Date;
/** The last timestamp (if applicable) when the message was edited. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */
editedOn?: Date;
/** metadata */
metadata?: Record<string, string>;
}
/** Content of a chat message. */
export interface ChatMessageContent {
/** Chat message content for messages of types text or html. */
message?: string;
/** Chat message content for messages of type topicUpdated. */
topic?: string;
/** Chat message content for messages of types participantAdded or participantRemoved. */
participants?: ChatParticipant[];
/** List of attachments for this message */
attachments?: ChatAttachment[];
/** Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. */
initiator?: CommunicationIdentifierKind;
}
/** An attachment in a chat message. */
export interface ChatAttachment {
/** Id of the attachment */
id: string;
/** The type of attachment. */
attachmentType: "teamsInlineImage";
/** The type of content of the attachment, if available */
contentType?: string;
/** The name of the attachment content. */
name?: string;
/** The URL where the attachment can be downloaded */
url: string;
/** The URL where the preview of attachment can be downloaded */
previewUrl?: string;
}
/** A chat message read receipt indicates the time a chat message was read by a recipient. */
export interface ChatMessageReadReceipt {
/** Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. */
sender: CommunicationIdentifierKind;
/** Id of the chat message that has been read. This id is generated by the server. */
chatMessageId: string;
/** The time at which the message was read. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */
readOn: Date;
}
/** A participant of the chat thread. */
export interface ChatParticipant {
/** Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. */
id: CommunicationIdentifier;
/** Display name for the chat participant. */
displayName?: string;
/** Time from which the chat history is shared with the participant. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. */
shareHistoryTime?: Date;
}
/** Result of the create chat thread operation. */
export interface CreateChatThreadResult {
/** Chat thread. */
chatThread?: ChatThreadProperties;
/**
* The participants that failed to be added to the chat thread.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly invalidParticipants?: ChatError[];
}
/**
* 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;
}