UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

94 lines • 3.64 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseActiveSession = /* @__PURE__ */ (() => { class BaseActiveSession extends APIResource { /** * Creates a new poll in an active session for the given meeting ID. * * @example * ```ts * const response = * await client.realtimeKit.activeSession.createPoll( * 'meeting_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * options: ['string'], * question: 'question', * }, * ); * ``` */ createPoll(meetingID, params, options) { const { account_id, app_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/active-session/poll`, { body, ...options }); } /** * Returns details of an ongoing active session for the given meeting ID. * * @example * ```ts * const response = * await client.realtimeKit.activeSession.getActiveSession( * 'meeting_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ getActiveSession(meetingID, params, options) { const { account_id, app_id } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/active-session`, options); } /** * Kicks all participants from an active session for the given meeting ID. * * @example * ```ts * const response = * await client.realtimeKit.activeSession.kickAllParticipants( * 'meeting_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ kickAllParticipants(meetingID, params, options) { const { account_id, app_id } = params; return this._client.post(path `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/active-session/kick-all`, options); } /** * Kicks one or more participants from an active session using user ID or custom * participant ID. * * @example * ```ts * const response = * await client.realtimeKit.activeSession.kickParticipants( * 'meeting_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ kickParticipants(meetingID, params, options) { const { account_id, app_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/active-session/kick`, { body, ...options }); } } BaseActiveSession._key = Object.freeze([ 'realtimeKit', 'activeSession', ]); return BaseActiveSession; })(); export class ActiveSession extends BaseActiveSession { } //# sourceMappingURL=active-session.mjs.map