-
Notifications
You must be signed in to change notification settings - Fork 180
/
userRequest.ts
56 lines (51 loc) · 1.55 KB
/
userRequest.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
import { UserType } from '../index';
import { WebSocketChannelRequest } from './websocketChannelRequest';
/**
* Represents a request to create or update a user's properties.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`.
*/
export type UserPropertiesRequest = {
/**
* Custom key-value pairs associated with the user.
*
* @remarks Data here will not have their properties transformed
*/
custom_data: Record<string, string>;
};
/**
* Represents a request to create or update a user's channels.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`.
*/
export type UserChannelsRequest = {
/**
* An array of WebSocket channel requests.
*/
websocket: Array<WebSocketChannelRequest>;
} & Omit<Pick<UserType, 'channels'>, 'websocket'>;;
/**
* Represents a request to create or update a user.
*
* @remarks
* Vonage API's will return information using `snake_case`. This represents the
* pure response before the client will transform the keys into `camelCase`.
*/
export type UserRequest = {
/**
* The URL of the user's image.
*/
image_url: string;
/**
* User properties including custom data.
*/
properties: UserPropertiesRequest;
/**
* Channels for communication, specifically WebSocket channels.
*/
channels: UserChannelsRequest
} & Omit<UserType, 'imageUrl' | 'properties'>;