Skip to content

Commit 6d01f8e

Browse files
feat: add TypeScript definitions for MultiPartyCall API
1 parent 96c8368 commit 6d01f8e

File tree

2 files changed

+323
-0
lines changed

2 files changed

+323
-0
lines changed
Lines changed: 321 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,321 @@
1+
/**
2+
* Represents a MultiPartyCall
3+
* @constructor
4+
* @param {function} client - make api call
5+
* @param {object} [data] - data of call
6+
*/
7+
export class MultiPartyCall extends PlivoResource {
8+
constructor(client: Function, data?: {});
9+
id: string;
10+
get(params?: {}): Promise<any>;
11+
addParticipant(params: object): Promise<any>;
12+
start(params?: object): Promise<any>;
13+
stop(): Promise<any>;
14+
startRecording(params?: object): Promise<any>;
15+
stopRecording(): Promise<any>;
16+
pauseRecording(): Promise<any>;
17+
resumeRecording(): Promise<any>;
18+
listParticipants(params?: object): Promise<any>;
19+
[clientKey]: symbol;
20+
}
21+
22+
/**
23+
* Represents a MultiPartyCall Interface
24+
* @constructor
25+
* @param {function} client - make api call
26+
* @param {object} [data] - data of call
27+
*/
28+
export class MultiPartyCallInterface extends PlivoResourceInterface {
29+
constructor(client: Function, data?: {});
30+
/**
31+
* list all MultiPartyCalls
32+
* @method
33+
* @param {object} params - params to filter MultiPartyCalls
34+
* @promise {object[]} returns list of MultiPartyCall Object
35+
* @fail {Error} returns Error
36+
*/
37+
list(params?: {}): Promise<any>;
38+
39+
/**
40+
* get MultiPartyCall by given uuid or friendlyName
41+
* @method
42+
* @param {object} params - params with uuid or friendlyName
43+
* @param {string} [params.uuid] - uuid of MultiPartyCall
44+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
45+
* @promise {object} return {@link MultiPartyCall} object
46+
* @fail {Error} return Error
47+
*/
48+
get(params?: {
49+
uuid?: string;
50+
friendlyName?: string;
51+
}): Promise<any>;
52+
53+
/**
54+
* add Participant to MultiPartyCall
55+
* @method
56+
* @param {string} role - role of participant (agent, supervisor, customer)
57+
* @param {object} params - params with uuid or friendlyName and participant details
58+
* @param {string} [params.uuid] - uuid of MultiPartyCall
59+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
60+
* @promise {object} return {@link PlivoGenericResponse} object
61+
* @fail {Error} return Error
62+
*/
63+
addParticipant(role: string, params?: {
64+
uuid?: string;
65+
friendlyName?: string;
66+
[key: string]: any;
67+
}): Promise<any>;
68+
69+
/**
70+
* start MultiPartyCall
71+
* @method
72+
* @param {object} params - params with uuid or friendlyName
73+
* @param {string} [params.uuid] - uuid of MultiPartyCall
74+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
75+
* @param {string} [params.status] - status (active)
76+
* @promise {object} return {@link PlivoGenericResponse} object
77+
* @fail {Error} return Error
78+
*/
79+
start(params?: {
80+
uuid?: string;
81+
friendlyName?: string;
82+
status?: string;
83+
[key: string]: any;
84+
}): Promise<any>;
85+
86+
/**
87+
* stop MultiPartyCall
88+
* @method
89+
* @param {object} params - params with uuid or friendlyName
90+
* @param {string} [params.uuid] - uuid of MultiPartyCall
91+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
92+
* @promise {object} return {@link PlivoGenericResponse} object
93+
* @fail {Error} return Error
94+
*/
95+
stop(params?: {
96+
uuid?: string;
97+
friendlyName?: string;
98+
}): Promise<any>;
99+
100+
/**
101+
* start Recording for MultiPartyCall
102+
* @method
103+
* @param {object} params - params with uuid or friendlyName
104+
* @param {string} [params.uuid] - uuid of MultiPartyCall
105+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
106+
* @promise {object} return {@link PlivoGenericResponse} object
107+
* @fail {Error} return Error
108+
*/
109+
startRecording(params?: {
110+
uuid?: string;
111+
friendlyName?: string;
112+
[key: string]: any;
113+
}): Promise<any>;
114+
115+
/**
116+
* stop Recording for MultiPartyCall
117+
* @method
118+
* @param {object} params - params with uuid or friendlyName
119+
* @param {string} [params.uuid] - uuid of MultiPartyCall
120+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
121+
* @promise {object} return {@link PlivoGenericResponse} object
122+
* @fail {Error} return Error
123+
*/
124+
stopRecording(params?: {
125+
uuid?: string;
126+
friendlyName?: string;
127+
}): Promise<any>;
128+
129+
/**
130+
* pause Recording for MultiPartyCall
131+
* @method
132+
* @param {object} params - params with uuid or friendlyName
133+
* @param {string} [params.uuid] - uuid of MultiPartyCall
134+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
135+
* @promise {object} return {@link PlivoGenericResponse} object
136+
* @fail {Error} return Error
137+
*/
138+
pauseRecording(params?: {
139+
uuid?: string;
140+
friendlyName?: string;
141+
}): Promise<any>;
142+
143+
/**
144+
* resume Recording for MultiPartyCall
145+
* @method
146+
* @param {object} params - params with uuid or friendlyName
147+
* @param {string} [params.uuid] - uuid of MultiPartyCall
148+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
149+
* @promise {object} return {@link PlivoGenericResponse} object
150+
* @fail {Error} return Error
151+
*/
152+
resumeRecording(params?: {
153+
uuid?: string;
154+
friendlyName?: string;
155+
}): Promise<any>;
156+
157+
/**
158+
* list Participants of MultiPartyCall
159+
* @method
160+
* @param {object} params - params with uuid or friendlyName
161+
* @param {string} [params.uuid] - uuid of MultiPartyCall
162+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
163+
* @promise {object} return list of participants
164+
* @fail {Error} return Error
165+
*/
166+
listParticipants(params?: {
167+
uuid?: string;
168+
friendlyName?: string;
169+
[key: string]: any;
170+
}): Promise<any>;
171+
172+
/**
173+
* update Participant in MultiPartyCall
174+
* @method
175+
* @param {string|number} participantId - id of participant
176+
* @param {object} params - params with uuid or friendlyName
177+
* @param {string} [params.uuid] - uuid of MultiPartyCall
178+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
179+
* @promise {object} return {@link PlivoGenericResponse} object
180+
* @fail {Error} return Error
181+
*/
182+
updateParticipant(participantId: string | number, params?: {
183+
uuid?: string;
184+
friendlyName?: string;
185+
[key: string]: any;
186+
}): Promise<any>;
187+
188+
/**
189+
* kick Participant from MultiPartyCall
190+
* @method
191+
* @param {string|number} participantId - id of participant
192+
* @param {object} params - params with uuid or friendlyName
193+
* @param {string} [params.uuid] - uuid of MultiPartyCall
194+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
195+
* @promise {object} return {@link PlivoGenericResponse} object
196+
* @fail {Error} return Error
197+
*/
198+
kickParticipant(participantId: string | number, params?: {
199+
uuid?: string;
200+
friendlyName?: string;
201+
}): Promise<any>;
202+
203+
/**
204+
* get Participant from MultiPartyCall
205+
* @method
206+
* @param {string|number} participantId - id of participant
207+
* @param {object} params - params with uuid or friendlyName
208+
* @param {string} [params.uuid] - uuid of MultiPartyCall
209+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
210+
* @promise {object} return participant object
211+
* @fail {Error} return Error
212+
*/
213+
getParticipant(participantId: string | number, params?: {
214+
uuid?: string;
215+
friendlyName?: string;
216+
}): Promise<any>;
217+
218+
/**
219+
* start Recording for Participant
220+
* @method
221+
* @param {string|number} participantId - id of participant
222+
* @param {object} params - params with uuid or friendlyName
223+
* @param {string} [params.uuid] - uuid of MultiPartyCall
224+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
225+
* @promise {object} return {@link PlivoGenericResponse} object
226+
* @fail {Error} return Error
227+
*/
228+
startParticipantRecording(participantId: string | number, params?: {
229+
uuid?: string;
230+
friendlyName?: string;
231+
[key: string]: any;
232+
}): Promise<any>;
233+
234+
/**
235+
* stop Recording for Participant
236+
* @method
237+
* @param {string|number} participantId - id of participant
238+
* @param {object} params - params with uuid or friendlyName
239+
* @param {string} [params.uuid] - uuid of MultiPartyCall
240+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
241+
* @promise {object} return {@link PlivoGenericResponse} object
242+
* @fail {Error} return Error
243+
*/
244+
stopParticipantRecording(participantId: string | number, params?: {
245+
uuid?: string;
246+
friendlyName?: string;
247+
[key: string]: any;
248+
}): Promise<any>;
249+
250+
/**
251+
* pause Recording for Participant
252+
* @method
253+
* @param {string|number} participantId - id of participant
254+
* @param {object} params - params with uuid or friendlyName
255+
* @param {string} [params.uuid] - uuid of MultiPartyCall
256+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
257+
* @promise {object} return {@link PlivoGenericResponse} object
258+
* @fail {Error} return Error
259+
*/
260+
pauseParticipantRecording(participantId: string | number, params?: {
261+
uuid?: string;
262+
friendlyName?: string;
263+
[key: string]: any;
264+
}): Promise<any>;
265+
266+
/**
267+
* resume Recording for Participant
268+
* @method
269+
* @param {string|number} participantId - id of participant
270+
* @param {object} params - params with uuid or friendlyName
271+
* @param {string} [params.uuid] - uuid of MultiPartyCall
272+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
273+
* @promise {object} return {@link PlivoGenericResponse} object
274+
* @fail {Error} return Error
275+
*/
276+
resumeParticipantRecording(participantId: string | number, params?: {
277+
uuid?: string;
278+
friendlyName?: string;
279+
[key: string]: any;
280+
}): Promise<any>;
281+
282+
/**
283+
* start Play Audio for Participant
284+
* @method
285+
* @param {string|number} participantId - id of participant
286+
* @param {string} url - audio URL to play
287+
* @param {object} params - params with uuid or friendlyName
288+
* @param {string} [params.uuid] - uuid of MultiPartyCall
289+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
290+
* @promise {object} return {@link PlivoGenericResponse} object
291+
* @fail {Error} return Error
292+
*/
293+
startPlayAudio(participantId: string | number, url: string, params?: {
294+
uuid?: string;
295+
friendlyName?: string;
296+
[key: string]: any;
297+
}): Promise<any>;
298+
299+
/**
300+
* stop Play Audio for Participant
301+
* @method
302+
* @param {string|number} participantId - id of participant
303+
* @param {object} params - params with uuid or friendlyName
304+
* @param {string} [params.uuid] - uuid of MultiPartyCall
305+
* @param {string} [params.friendlyName] - friendlyName of MultiPartyCall
306+
* @promise {object} return {@link PlivoGenericResponse} object
307+
* @fail {Error} return Error
308+
*/
309+
stopPlayAudio(participantId: string | number, params?: {
310+
uuid?: string;
311+
friendlyName?: string;
312+
[key: string]: any;
313+
}): Promise<any>;
314+
[clientKey]: symbol;
315+
}
316+
317+
import { PlivoResource } from "../base";
318+
import { PlivoResourceInterface } from "../base";
319+
declare const clientKey: unique symbol;
320+
export {};
321+

types/rest/client.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class Client {
3131
complianceDocumentTypes: ComplianceDocumentTypeInterface;
3232
complianceDocuments: ComplianceDocumentInterface;
3333
complianceRequirements: ComplianceRequirementInterface;
34+
multiPartyCalls: MultiPartyCallInterface;
3435
complianceApplications: ComplianceApplicationInterface;
3536
loa: LOAInterface;
3637
hostedMessagingNumber: HostedMessagingNumberInterface;
@@ -74,6 +75,7 @@ import { ComplianceDocumentInterface} from "../resources/complianceDocuments";
7475
import { ComplianceRequirementInterface } from "../resources/complianceRequirements";
7576
import { ComplianceApplicationInterface } from "../resources/complianceApplications";
7677
import { LOAInterface } from "../resources/loa";
78+
import { MultiPartyCallInterface } from "../resources/multiPartyCall.js";
7779
import { HostedMessagingNumberInterface } from "../resources/hostedMessagingNumber";
7880
import { MaskingSessionInterface } from "../resources/maskingSession.js";
7981
import { TollfreeVerificationInterface } from "../resources/tollfree_verification.js";

0 commit comments

Comments
 (0)