/
models.ts
48 lines (40 loc) · 1.3 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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { HttpResponse, PipelineOptions } from "@azure/core-http";
import { CommunicationUser } from "@azure/communication-common";
import { CommunicationIdentityToken } from "./generated/src/models";
/**
* Represents the scope of the token.
*/
export type TokenScope = "chat" | "voip" | "pstn";
/**
* Client options used to configure the CommunicationIdentity API requests.
*/
export interface CommunicationIdentityOptions extends PipelineOptions {}
/**
* Represents an object with a non-enumerable _response property which provides
* information about the HTTP response.
*/
export type WithResponse<T> = T & { _response: HttpResponse };
/**
* Represents a generic HTTP response
*/
export type VoidResponse = WithResponse<{}>;
/**
* The issued token and the user it was issued for.
*/
export interface CommunicationUserToken
extends Pick<CommunicationIdentityToken, "token" | "expiresOn"> {
/**
* Represents the user the token was issued for
*/
user: CommunicationUser;
}
/**
* Represents the response from creating a user
*/
export type CreateUserResponse = WithResponse<CommunicationUser>;
/**
* Represents the response from issuing a token
*/
export type IssueTokenResponse = WithResponse<CommunicationUserToken>;