UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

198 lines • 7.17 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 BasePresets = /* @__PURE__ */ (() => { class BasePresets extends APIResource { /** * Creates a preset belonging to the current App * * @example * ```ts * const preset = await client.realtimeKit.presets.create( * '14a396e7-ca44-4937-bf1f-050a69118543', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * config: { * max_screenshare_count: 0, * max_video_streams: { ... }, * media: { ... }, * view_type: 'GROUP_CALL', * }, * name: 'name', * permissions: { * accept_waiting_requests: true, * can_accept_production_requests: true, * can_change_participant_permissions: true, * can_edit_display_name: true, * can_livestream: true, * can_record: true, * can_spotlight: true, * chat: { ... }, * connected_meetings: { ... }, * disable_participant_audio: true, * disable_participant_screensharing: true, * disable_participant_video: true, * hidden_participant: true, * kick_participant: true, * media: { ... }, * pin_participant: true, * plugins: { ... }, * polls: { ... }, * recorder_type: 'RECORDER', * show_participant_list: true, * waiting_room_type: 'SKIP', * }, * ui: { * design_tokens: { ... }, * }, * }, * ); * ``` */ create(appID, params, options) { const { account_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/realtime/kit/${appID}/presets`, { body, ...options, }); } /** * Update a preset by the provided preset ID * * @example * ```ts * const preset = await client.realtimeKit.presets.update( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ update(presetID, params, options) { const { account_id, app_id, ...body } = params; return this._client.patch(path `/accounts/${account_id}/realtime/kit/${app_id}/presets/${presetID}`, { body, ...options, }); } /** * Deletes a preset using the provided preset ID * * @example * ```ts * const preset = await client.realtimeKit.presets.delete( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ delete(presetID, params, options) { const { account_id, app_id } = params; return this._client.delete(path `/accounts/${account_id}/realtime/kit/${app_id}/presets/${presetID}`, options); } /** * Fetches all the presets belonging to an App. * * @example * ```ts * const preset = await client.realtimeKit.presets.get( * '14a396e7-ca44-4937-bf1f-050a69118543', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(appID, params, options) { const { account_id, ...query } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${appID}/presets`, { query, ...options, }); } /** * Fetches details of a preset using the provided preset ID * * @example * ```ts * const response = * await client.realtimeKit.presets.getPresetByID( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ getPresetByID(presetID, params, options) { const { account_id, app_id } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${app_id}/presets/${presetID}`, options); } /** * Replace all details for the preset using the provided preset ID. * * @example * ```ts * const response = await client.realtimeKit.presets.replacePresetByID( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * config: { * max_screenshare_count: 0, * max_video_streams: { ... }, * media: { ... }, * view_type: 'GROUP_CALL', * }, * name: 'name', * permissions: { * accept_waiting_requests: true, * can_accept_production_requests: true, * can_change_participant_permissions: true, * can_edit_display_name: true, * can_livestream: true, * can_record: true, * can_spotlight: true, * chat: { ... }, * connected_meetings: { ... }, * disable_participant_audio: true, * disable_participant_screensharing: true, * disable_participant_video: true, * hidden_participant: true, * kick_participant: true, * media: { ... }, * pin_participant: true, * plugins: { ... }, * polls: { ... }, * recorder_type: 'RECORDER', * show_participant_list: true, * waiting_room_type: 'SKIP', * }, * ui: { * design_tokens: { ... }, * }, * }, * ); * ``` */ replacePresetByID(presetID, params, options) { const { account_id, app_id, ...body } = params; return this._client.put(path `/accounts/${account_id}/realtime/kit/${app_id}/presets/${presetID}`, { body, ...options, }); } } BasePresets._key = Object.freeze([ 'realtimeKit', 'presets', ]); return BasePresets; })(); export class Presets extends BasePresets { } //# sourceMappingURL=presets.mjs.map