Auto-commit 2026-04-29 16:31
This commit is contained in:
40
node_modules/twilio/lib/rest/video/V1.d.ts
generated
vendored
Normal file
40
node_modules/twilio/lib/rest/video/V1.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import VideoBase from "../VideoBase";
|
||||
import Version from "../../base/Version";
|
||||
import { CompositionListInstance } from "./v1/composition";
|
||||
import { CompositionHookListInstance } from "./v1/compositionHook";
|
||||
import { CompositionSettingsListInstance } from "./v1/compositionSettings";
|
||||
import { RecordingListInstance } from "./v1/recording";
|
||||
import { RecordingSettingsListInstance } from "./v1/recordingSettings";
|
||||
import { RoomListInstance } from "./v1/room";
|
||||
export default class V1 extends Version {
|
||||
/**
|
||||
* Initialize the V1 version of Video
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Video) domain
|
||||
*/
|
||||
constructor(domain: VideoBase);
|
||||
/** compositions - { Twilio.Video.V1.CompositionListInstance } resource */
|
||||
protected _compositions?: CompositionListInstance;
|
||||
/** compositionHooks - { Twilio.Video.V1.CompositionHookListInstance } resource */
|
||||
protected _compositionHooks?: CompositionHookListInstance;
|
||||
/** compositionSettings - { Twilio.Video.V1.CompositionSettingsListInstance } resource */
|
||||
protected _compositionSettings?: CompositionSettingsListInstance;
|
||||
/** recordings - { Twilio.Video.V1.RecordingListInstance } resource */
|
||||
protected _recordings?: RecordingListInstance;
|
||||
/** recordingSettings - { Twilio.Video.V1.RecordingSettingsListInstance } resource */
|
||||
protected _recordingSettings?: RecordingSettingsListInstance;
|
||||
/** rooms - { Twilio.Video.V1.RoomListInstance } resource */
|
||||
protected _rooms?: RoomListInstance;
|
||||
/** Getter for compositions resource */
|
||||
get compositions(): CompositionListInstance;
|
||||
/** Getter for compositionHooks resource */
|
||||
get compositionHooks(): CompositionHookListInstance;
|
||||
/** Getter for compositionSettings resource */
|
||||
get compositionSettings(): CompositionSettingsListInstance;
|
||||
/** Getter for recordings resource */
|
||||
get recordings(): RecordingListInstance;
|
||||
/** Getter for recordingSettings resource */
|
||||
get recordingSettings(): RecordingSettingsListInstance;
|
||||
/** Getter for rooms resource */
|
||||
get rooms(): RoomListInstance;
|
||||
}
|
||||
69
node_modules/twilio/lib/rest/video/V1.js
generated
vendored
Normal file
69
node_modules/twilio/lib/rest/video/V1.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Version_1 = __importDefault(require("../../base/Version"));
|
||||
const composition_1 = require("./v1/composition");
|
||||
const compositionHook_1 = require("./v1/compositionHook");
|
||||
const compositionSettings_1 = require("./v1/compositionSettings");
|
||||
const recording_1 = require("./v1/recording");
|
||||
const recordingSettings_1 = require("./v1/recordingSettings");
|
||||
const room_1 = require("./v1/room");
|
||||
class V1 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V1 version of Video
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Video) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v1");
|
||||
}
|
||||
/** Getter for compositions resource */
|
||||
get compositions() {
|
||||
this._compositions = this._compositions || (0, composition_1.CompositionListInstance)(this);
|
||||
return this._compositions;
|
||||
}
|
||||
/** Getter for compositionHooks resource */
|
||||
get compositionHooks() {
|
||||
this._compositionHooks =
|
||||
this._compositionHooks || (0, compositionHook_1.CompositionHookListInstance)(this);
|
||||
return this._compositionHooks;
|
||||
}
|
||||
/** Getter for compositionSettings resource */
|
||||
get compositionSettings() {
|
||||
this._compositionSettings =
|
||||
this._compositionSettings || (0, compositionSettings_1.CompositionSettingsListInstance)(this);
|
||||
return this._compositionSettings;
|
||||
}
|
||||
/** Getter for recordings resource */
|
||||
get recordings() {
|
||||
this._recordings = this._recordings || (0, recording_1.RecordingListInstance)(this);
|
||||
return this._recordings;
|
||||
}
|
||||
/** Getter for recordingSettings resource */
|
||||
get recordingSettings() {
|
||||
this._recordingSettings =
|
||||
this._recordingSettings || (0, recordingSettings_1.RecordingSettingsListInstance)(this);
|
||||
return this._recordingSettings;
|
||||
}
|
||||
/** Getter for rooms resource */
|
||||
get rooms() {
|
||||
this._rooms = this._rooms || (0, room_1.RoomListInstance)(this);
|
||||
return this._rooms;
|
||||
}
|
||||
}
|
||||
exports.default = V1;
|
||||
477
node_modules/twilio/lib/rest/video/v1/composition.d.ts
generated
vendored
Normal file
477
node_modules/twilio/lib/rest/video/v1/composition.d.ts
generated
vendored
Normal file
@@ -0,0 +1,477 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
||||
import Response from "../../../http/response";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* The container format of the composition\'s media files as specified in the POST request that created the Composition resource. See [POST Parameters](https://www.twilio.com/docs/video/api/compositions-resource#http-post-parameters) for more information.
|
||||
*/
|
||||
export type CompositionFormat = "mp4" | "webm";
|
||||
/**
|
||||
* The status of the composition. Can be: `enqueued`, `processing`, `completed`, `deleted` or `failed`. `enqueued` is the initial state and indicates that the composition request has been received and is scheduled for processing; `processing` indicates the composition is being processed; `completed` indicates the composition has been completed and is available for download; `deleted` means the composition media has been deleted from the system, but its metadata is still available for 30 days; `failed` indicates the composition failed to execute the media processing task.
|
||||
*/
|
||||
export type CompositionStatus = "enqueued" | "processing" | "completed" | "deleted" | "failed";
|
||||
/**
|
||||
* Options to pass to create a CompositionInstance
|
||||
*/
|
||||
export interface CompositionListInstanceCreateOptions {
|
||||
/** The SID of the Group Room with the media tracks to be used as composition sources. */
|
||||
roomSid: string;
|
||||
/** An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request */
|
||||
videoLayout?: any;
|
||||
/** An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request */
|
||||
audioSources?: Array<string>;
|
||||
/** An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. */
|
||||
audioSourcesExcluded?: Array<string>;
|
||||
/** A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string\\\'s format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */
|
||||
resolution?: string;
|
||||
/** */
|
||||
format?: CompositionFormat;
|
||||
/** The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. */
|
||||
statusCallback?: string;
|
||||
/** The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */
|
||||
statusCallbackMethod?: string;
|
||||
/** Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */
|
||||
trim?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface CompositionListInstanceEachOptions {
|
||||
/** Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. */
|
||||
status?: CompositionStatus;
|
||||
/** Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Composition resources created before this ISO 8601 date-time with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only Composition resources with this Room SID. */
|
||||
roomSid?: string;
|
||||
/** How many resources to return in each list page. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: CompositionInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface CompositionListInstanceOptions {
|
||||
/** Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. */
|
||||
status?: CompositionStatus;
|
||||
/** Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Composition resources created before this ISO 8601 date-time with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only Composition resources with this Room SID. */
|
||||
roomSid?: string;
|
||||
/** How many resources to return in each list page. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface CompositionListInstancePageOptions {
|
||||
/** Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. */
|
||||
status?: CompositionStatus;
|
||||
/** Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Composition resources created before this ISO 8601 date-time with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only Composition resources with this Room SID. */
|
||||
roomSid?: string;
|
||||
/** How many resources to return in each list page. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface CompositionContext {
|
||||
/**
|
||||
* Remove a CompositionInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a CompositionInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a CompositionInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: CompositionInstance) => any): Promise<CompositionInstance>;
|
||||
/**
|
||||
* Fetch a CompositionInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionInstance>) => any): Promise<ApiResponse<CompositionInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface CompositionContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class CompositionContextImpl implements CompositionContext {
|
||||
protected _version: V1;
|
||||
protected _solution: CompositionContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, sid: string);
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
fetch(callback?: (error: Error | null, item?: CompositionInstance) => any): Promise<CompositionInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionInstance>) => any): Promise<ApiResponse<CompositionInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): CompositionContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface CompositionPayload extends TwilioResponsePayload {
|
||||
compositions: CompositionResource[];
|
||||
}
|
||||
interface CompositionResource {
|
||||
account_sid: string;
|
||||
status: CompositionStatus;
|
||||
date_created: Date;
|
||||
date_completed: Date;
|
||||
date_deleted: Date;
|
||||
sid: string;
|
||||
room_sid: string;
|
||||
audio_sources: Array<string>;
|
||||
audio_sources_excluded: Array<string>;
|
||||
video_layout: any;
|
||||
resolution: string;
|
||||
trim: boolean;
|
||||
format: CompositionFormat;
|
||||
bitrate: number;
|
||||
size: number;
|
||||
duration: number;
|
||||
media_external_location: string;
|
||||
status_callback: string;
|
||||
status_callback_method: string;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class CompositionInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: CompositionContextSolution;
|
||||
protected _context?: CompositionContext;
|
||||
constructor(_version: V1, payload: CompositionResource, sid?: string);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Composition resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
status: CompositionStatus;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the composition\'s media processing task finished, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCompleted: Date;
|
||||
/**
|
||||
* The date and time in GMT when the composition generated media was deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateDeleted: Date;
|
||||
/**
|
||||
* The unique string that we created to identify the Composition resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the Group Room that generated the audio and video tracks used in the composition. All media sources included in a composition must belong to the same Group Room.
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* The array of track names to include in the composition. The composition includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`.
|
||||
*/
|
||||
audioSources: Array<string>;
|
||||
/**
|
||||
* The array of track names to exclude from the composition. The composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty.
|
||||
*/
|
||||
audioSourcesExcluded: Array<string>;
|
||||
/**
|
||||
* An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
|
||||
*/
|
||||
videoLayout: any;
|
||||
/**
|
||||
* The dimensions of the video image in pixels expressed as columns (width) and rows (height). The string\'s format is `{width}x{height}`, such as `640x480`.
|
||||
*/
|
||||
resolution: string;
|
||||
/**
|
||||
* Whether to remove intervals with no media, as specified in the POST request that created the composition. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
|
||||
*/
|
||||
trim: boolean;
|
||||
format: CompositionFormat;
|
||||
/**
|
||||
* The average bit rate of the composition\'s media.
|
||||
*/
|
||||
bitrate: number;
|
||||
/**
|
||||
* The size of the composed media file in bytes.
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* The duration of the composition\'s media file in seconds.
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* The URL of the media file associated with the composition when stored externally. See [External S3 Compositions](/docs/video/api/external-s3-compositions) for more details.
|
||||
*/
|
||||
mediaExternalLocation: string;
|
||||
/**
|
||||
* The URL called using the `status_callback_method` to send status information on every composition event.
|
||||
*/
|
||||
statusCallback: string;
|
||||
/**
|
||||
* The HTTP method used to call `status_callback`. Can be: `POST` or `GET`, defaults to `POST`.
|
||||
*/
|
||||
statusCallbackMethod: string;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The URL of the media file associated with the composition.
|
||||
*/
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a CompositionInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a CompositionInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a CompositionInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: CompositionInstance) => any): Promise<CompositionInstance>;
|
||||
/**
|
||||
* Fetch a CompositionInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionInstance>) => any): Promise<ApiResponse<CompositionInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
status: CompositionStatus;
|
||||
dateCreated: Date;
|
||||
dateCompleted: Date;
|
||||
dateDeleted: Date;
|
||||
sid: string;
|
||||
roomSid: string;
|
||||
audioSources: string[];
|
||||
audioSourcesExcluded: string[];
|
||||
videoLayout: any;
|
||||
resolution: string;
|
||||
trim: boolean;
|
||||
format: CompositionFormat;
|
||||
bitrate: number;
|
||||
size: number;
|
||||
duration: number;
|
||||
mediaExternalLocation: string;
|
||||
statusCallback: string;
|
||||
statusCallbackMethod: string;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface CompositionSolution {
|
||||
}
|
||||
export interface CompositionListInstance {
|
||||
_version: V1;
|
||||
_solution: CompositionSolution;
|
||||
_uri: string;
|
||||
(sid: string): CompositionContext;
|
||||
get(sid: string): CompositionContext;
|
||||
/**
|
||||
* Create a CompositionInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionInstance
|
||||
*/
|
||||
create(params: CompositionListInstanceCreateOptions, callback?: (error: Error | null, item?: CompositionInstance) => any): Promise<CompositionInstance>;
|
||||
/**
|
||||
* Create a CompositionInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: CompositionListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<CompositionInstance>) => any): Promise<ApiResponse<CompositionInstance>>;
|
||||
/**
|
||||
* Streams CompositionInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: CompositionInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: CompositionListInstanceEachOptions, callback?: (item: CompositionInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams CompositionInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: CompositionInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: CompositionListInstanceEachOptions, callback?: (item: CompositionInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of CompositionInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: CompositionPage) => any): Promise<CompositionPage>;
|
||||
/**
|
||||
* Retrieve a single target page of CompositionInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<CompositionPage>) => any): Promise<ApiResponse<CompositionPage>>;
|
||||
/**
|
||||
* Lists CompositionInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: CompositionInstance[]) => any): Promise<CompositionInstance[]>;
|
||||
list(params: CompositionListInstanceOptions, callback?: (error: Error | null, items: CompositionInstance[]) => any): Promise<CompositionInstance[]>;
|
||||
/**
|
||||
* Lists CompositionInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<CompositionInstance[]>) => any): Promise<ApiResponse<CompositionInstance[]>>;
|
||||
listWithHttpInfo(params: CompositionListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<CompositionInstance[]>) => any): Promise<ApiResponse<CompositionInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of CompositionInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: CompositionPage) => any): Promise<CompositionPage>;
|
||||
page(params: CompositionListInstancePageOptions, callback?: (error: Error | null, items: CompositionPage) => any): Promise<CompositionPage>;
|
||||
/**
|
||||
* Retrieve a single page of CompositionInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<CompositionPage>) => any): Promise<ApiResponse<CompositionPage>>;
|
||||
pageWithHttpInfo(params: CompositionListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<CompositionPage>) => any): Promise<ApiResponse<CompositionPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function CompositionListInstance(version: V1): CompositionListInstance;
|
||||
export declare class CompositionPage extends Page<V1, CompositionPayload, CompositionResource, CompositionInstance> {
|
||||
/**
|
||||
* Initialize the CompositionPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: CompositionSolution);
|
||||
/**
|
||||
* Build an instance of CompositionInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: CompositionResource): CompositionInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
435
node_modules/twilio/lib/rest/video/v1/composition.js
generated
vendored
Normal file
435
node_modules/twilio/lib/rest/video/v1/composition.js
generated
vendored
Normal file
@@ -0,0 +1,435 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CompositionPage = exports.CompositionInstance = exports.CompositionContextImpl = void 0;
|
||||
exports.CompositionListInstance = CompositionListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../base/Page"));
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class CompositionContextImpl {
|
||||
constructor(_version, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { sid };
|
||||
this._uri = `/Compositions/${sid}`;
|
||||
}
|
||||
remove(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
||||
uri: instance._uri,
|
||||
method: "delete",
|
||||
headers,
|
||||
});
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
removeWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// DELETE operation - returns boolean based on status code
|
||||
let operationPromise = operationVersion
|
||||
.removeWithResponseInfo({ uri: instance._uri, method: "delete", headers })
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: response.statusCode === 204,
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new CompositionInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CompositionContextImpl = CompositionContextImpl;
|
||||
class CompositionInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.status = payload.status;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateCompleted = deserialize.iso8601DateTime(payload.date_completed);
|
||||
this.dateDeleted = deserialize.iso8601DateTime(payload.date_deleted);
|
||||
this.sid = payload.sid;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.audioSources = payload.audio_sources;
|
||||
this.audioSourcesExcluded = payload.audio_sources_excluded;
|
||||
this.videoLayout = payload.video_layout;
|
||||
this.resolution = payload.resolution;
|
||||
this.trim = payload.trim;
|
||||
this.format = payload.format;
|
||||
this.bitrate = deserialize.integer(payload.bitrate);
|
||||
this.size = payload.size;
|
||||
this.duration = deserialize.integer(payload.duration);
|
||||
this.mediaExternalLocation = payload.media_external_location;
|
||||
this.statusCallback = payload.status_callback;
|
||||
this.statusCallbackMethod = payload.status_callback_method;
|
||||
this.url = payload.url;
|
||||
this.links = payload.links;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new CompositionContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a CompositionInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a CompositionInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback) {
|
||||
return this._proxy.removeWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a CompositionInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a CompositionInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accountSid: this.accountSid,
|
||||
status: this.status,
|
||||
dateCreated: this.dateCreated,
|
||||
dateCompleted: this.dateCompleted,
|
||||
dateDeleted: this.dateDeleted,
|
||||
sid: this.sid,
|
||||
roomSid: this.roomSid,
|
||||
audioSources: this.audioSources,
|
||||
audioSourcesExcluded: this.audioSourcesExcluded,
|
||||
videoLayout: this.videoLayout,
|
||||
resolution: this.resolution,
|
||||
trim: this.trim,
|
||||
format: this.format,
|
||||
bitrate: this.bitrate,
|
||||
size: this.size,
|
||||
duration: this.duration,
|
||||
mediaExternalLocation: this.mediaExternalLocation,
|
||||
statusCallback: this.statusCallback,
|
||||
statusCallbackMethod: this.statusCallbackMethod,
|
||||
url: this.url,
|
||||
links: this.links,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CompositionInstance = CompositionInstance;
|
||||
function CompositionListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new CompositionContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Compositions`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["roomSid"] === null || params["roomSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['roomSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["RoomSid"] = params["roomSid"];
|
||||
if (params["videoLayout"] !== undefined)
|
||||
data["VideoLayout"] = serialize.object(params["videoLayout"]);
|
||||
if (params["audioSources"] !== undefined)
|
||||
data["AudioSources"] = serialize.map(params["audioSources"], (e) => e);
|
||||
if (params["audioSourcesExcluded"] !== undefined)
|
||||
data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e);
|
||||
if (params["resolution"] !== undefined)
|
||||
data["Resolution"] = params["resolution"];
|
||||
if (params["format"] !== undefined)
|
||||
data["Format"] = params["format"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["trim"] !== undefined)
|
||||
data["Trim"] = serialize.bool(params["trim"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["roomSid"] === null || params["roomSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['roomSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["RoomSid"] = params["roomSid"];
|
||||
if (params["videoLayout"] !== undefined)
|
||||
data["VideoLayout"] = serialize.object(params["videoLayout"]);
|
||||
if (params["audioSources"] !== undefined)
|
||||
data["AudioSources"] = serialize.map(params["audioSources"], (e) => e);
|
||||
if (params["audioSourcesExcluded"] !== undefined)
|
||||
data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e);
|
||||
if (params["resolution"] !== undefined)
|
||||
data["Resolution"] = params["resolution"];
|
||||
if (params["format"] !== undefined)
|
||||
data["Format"] = params["format"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["trim"] !== undefined)
|
||||
data["Trim"] = serialize.bool(params["trim"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new CompositionInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["roomSid"] !== undefined)
|
||||
data["RoomSid"] = params["roomSid"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new CompositionPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["roomSid"] !== undefined)
|
||||
data["RoomSid"] = params["roomSid"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new CompositionPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new CompositionPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class CompositionPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the CompositionPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of CompositionInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new CompositionInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CompositionPage = CompositionPage;
|
||||
505
node_modules/twilio/lib/rest/video/v1/compositionHook.d.ts
generated
vendored
Normal file
505
node_modules/twilio/lib/rest/video/v1/compositionHook.d.ts
generated
vendored
Normal file
@@ -0,0 +1,505 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
||||
import Response from "../../../http/response";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* The container format of the media files used by the compositions created by the composition hook. If `mp4` or `webm`, `audio_sources` must have one or more tracks and/or a `video_layout` element must contain a valid `video_sources` list, otherwise an error occurs.
|
||||
*/
|
||||
export type CompositionHookFormat = "mp4" | "webm";
|
||||
/**
|
||||
* Options to pass to update a CompositionHookInstance
|
||||
*/
|
||||
export interface CompositionHookContextUpdateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. */
|
||||
friendlyName: string;
|
||||
/** Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. */
|
||||
enabled?: boolean;
|
||||
/** A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */
|
||||
videoLayout?: any;
|
||||
/** An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. */
|
||||
audioSources?: Array<string>;
|
||||
/** An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. */
|
||||
audioSourcesExcluded?: Array<string>;
|
||||
/** Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */
|
||||
trim?: boolean;
|
||||
/** */
|
||||
format?: CompositionHookFormat;
|
||||
/** A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string\\\'s format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */
|
||||
resolution?: string;
|
||||
/** The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. */
|
||||
statusCallback?: string;
|
||||
/** The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */
|
||||
statusCallbackMethod?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a CompositionHookInstance
|
||||
*/
|
||||
export interface CompositionHookListInstanceCreateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. */
|
||||
friendlyName: string;
|
||||
/** Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. */
|
||||
enabled?: boolean;
|
||||
/** An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */
|
||||
videoLayout?: any;
|
||||
/** An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. */
|
||||
audioSources?: Array<string>;
|
||||
/** An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. */
|
||||
audioSourcesExcluded?: Array<string>;
|
||||
/** A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string\\\'s format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */
|
||||
resolution?: string;
|
||||
/** */
|
||||
format?: CompositionHookFormat;
|
||||
/** The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. */
|
||||
statusCallback?: string;
|
||||
/** The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */
|
||||
statusCallbackMethod?: string;
|
||||
/** Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */
|
||||
trim?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface CompositionHookListInstanceEachOptions {
|
||||
/** Read only CompositionHook resources with an `enabled` value that matches this parameter. */
|
||||
enabled?: boolean;
|
||||
/** Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: CompositionHookInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface CompositionHookListInstanceOptions {
|
||||
/** Read only CompositionHook resources with an `enabled` value that matches this parameter. */
|
||||
enabled?: boolean;
|
||||
/** Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface CompositionHookListInstancePageOptions {
|
||||
/** Read only CompositionHook resources with an `enabled` value that matches this parameter. */
|
||||
enabled?: boolean;
|
||||
/** Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. */
|
||||
friendlyName?: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface CompositionHookContext {
|
||||
/**
|
||||
* Remove a CompositionHookInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a CompositionHookInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise<CompositionHookInstance>;
|
||||
/**
|
||||
* Fetch a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionHookInstance>) => any): Promise<ApiResponse<CompositionHookInstance>>;
|
||||
/**
|
||||
* Update a CompositionHookInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance
|
||||
*/
|
||||
update(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise<CompositionHookInstance>;
|
||||
/**
|
||||
* Update a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<CompositionHookInstance>) => any): Promise<ApiResponse<CompositionHookInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface CompositionHookContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class CompositionHookContextImpl implements CompositionHookContext {
|
||||
protected _version: V1;
|
||||
protected _solution: CompositionHookContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, sid: string);
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
fetch(callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise<CompositionHookInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionHookInstance>) => any): Promise<ApiResponse<CompositionHookInstance>>;
|
||||
update(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise<CompositionHookInstance>;
|
||||
updateWithHttpInfo(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<CompositionHookInstance>) => any): Promise<ApiResponse<CompositionHookInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): CompositionHookContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface CompositionHookPayload extends TwilioResponsePayload {
|
||||
composition_hooks: CompositionHookResource[];
|
||||
}
|
||||
interface CompositionHookResource {
|
||||
account_sid: string;
|
||||
friendly_name: string;
|
||||
enabled: boolean;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
sid: string;
|
||||
audio_sources: Array<string>;
|
||||
audio_sources_excluded: Array<string>;
|
||||
video_layout: any;
|
||||
resolution: string;
|
||||
trim: boolean;
|
||||
format: CompositionHookFormat;
|
||||
status_callback: string;
|
||||
status_callback_method: string;
|
||||
url: string;
|
||||
}
|
||||
export declare class CompositionHookInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: CompositionHookContextSolution;
|
||||
protected _context?: CompositionHookContext;
|
||||
constructor(_version: V1, payload: CompositionHookResource, sid?: string);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionHook resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource. Can be up to 100 characters long and must be unique within the account.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* Whether the CompositionHook is active. When `true`, the CompositionHook is triggered for every completed Group Room on the account. When `false`, the CompositionHook is never triggered.
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The unique string that we created to identify the CompositionHook resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The array of track names to include in the compositions created by the composition hook. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request
|
||||
*/
|
||||
audioSources: Array<string>;
|
||||
/**
|
||||
* The array of track names to exclude from the compositions created by the composition hook. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty.
|
||||
*/
|
||||
audioSourcesExcluded: Array<string>;
|
||||
/**
|
||||
* A JSON object that describes the video layout of the composition in terms of regions as specified in the HTTP POST request that created the CompositionHook resource. See [POST Parameters](https://www.twilio.com/docs/video/api/compositions-resource#http-post-parameters) for more information. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request
|
||||
*/
|
||||
videoLayout: any;
|
||||
/**
|
||||
* The dimensions of the video image in pixels expressed as columns (width) and rows (height). The string\'s format is `{width}x{height}`, such as `640x480`.
|
||||
*/
|
||||
resolution: string;
|
||||
/**
|
||||
* Whether intervals with no media are clipped, as specified in the POST request that created the CompositionHook resource. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
|
||||
*/
|
||||
trim: boolean;
|
||||
format: CompositionHookFormat;
|
||||
/**
|
||||
* The URL we call using the `status_callback_method` to send status information to your application.
|
||||
*/
|
||||
statusCallback: string;
|
||||
/**
|
||||
* The HTTP method we should use to call `status_callback`. Can be `POST` or `GET` and defaults to `POST`.
|
||||
*/
|
||||
statusCallbackMethod: string;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a CompositionHookInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a CompositionHookInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise<CompositionHookInstance>;
|
||||
/**
|
||||
* Fetch a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionHookInstance>) => any): Promise<ApiResponse<CompositionHookInstance>>;
|
||||
/**
|
||||
* Update a CompositionHookInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance
|
||||
*/
|
||||
update(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise<CompositionHookInstance>;
|
||||
/**
|
||||
* Update a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: CompositionHookContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<CompositionHookInstance>) => any): Promise<ApiResponse<CompositionHookInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
friendlyName: string;
|
||||
enabled: boolean;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
sid: string;
|
||||
audioSources: string[];
|
||||
audioSourcesExcluded: string[];
|
||||
videoLayout: any;
|
||||
resolution: string;
|
||||
trim: boolean;
|
||||
format: CompositionHookFormat;
|
||||
statusCallback: string;
|
||||
statusCallbackMethod: string;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface CompositionHookSolution {
|
||||
}
|
||||
export interface CompositionHookListInstance {
|
||||
_version: V1;
|
||||
_solution: CompositionHookSolution;
|
||||
_uri: string;
|
||||
(sid: string): CompositionHookContext;
|
||||
get(sid: string): CompositionHookContext;
|
||||
/**
|
||||
* Create a CompositionHookInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance
|
||||
*/
|
||||
create(params: CompositionHookListInstanceCreateOptions, callback?: (error: Error | null, item?: CompositionHookInstance) => any): Promise<CompositionHookInstance>;
|
||||
/**
|
||||
* Create a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: CompositionHookListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<CompositionHookInstance>) => any): Promise<ApiResponse<CompositionHookInstance>>;
|
||||
/**
|
||||
* Streams CompositionHookInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionHookListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: CompositionHookInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: CompositionHookListInstanceEachOptions, callback?: (item: CompositionHookInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams CompositionHookInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionHookListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: CompositionHookInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: CompositionHookListInstanceEachOptions, callback?: (item: CompositionHookInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of CompositionHookInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: CompositionHookPage) => any): Promise<CompositionHookPage>;
|
||||
/**
|
||||
* Retrieve a single target page of CompositionHookInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<CompositionHookPage>) => any): Promise<ApiResponse<CompositionHookPage>>;
|
||||
/**
|
||||
* Lists CompositionHookInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionHookListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: CompositionHookInstance[]) => any): Promise<CompositionHookInstance[]>;
|
||||
list(params: CompositionHookListInstanceOptions, callback?: (error: Error | null, items: CompositionHookInstance[]) => any): Promise<CompositionHookInstance[]>;
|
||||
/**
|
||||
* Lists CompositionHookInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionHookListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<CompositionHookInstance[]>) => any): Promise<ApiResponse<CompositionHookInstance[]>>;
|
||||
listWithHttpInfo(params: CompositionHookListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<CompositionHookInstance[]>) => any): Promise<ApiResponse<CompositionHookInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of CompositionHookInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionHookListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: CompositionHookPage) => any): Promise<CompositionHookPage>;
|
||||
page(params: CompositionHookListInstancePageOptions, callback?: (error: Error | null, items: CompositionHookPage) => any): Promise<CompositionHookPage>;
|
||||
/**
|
||||
* Retrieve a single page of CompositionHookInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { CompositionHookListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<CompositionHookPage>) => any): Promise<ApiResponse<CompositionHookPage>>;
|
||||
pageWithHttpInfo(params: CompositionHookListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<CompositionHookPage>) => any): Promise<ApiResponse<CompositionHookPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function CompositionHookListInstance(version: V1): CompositionHookListInstance;
|
||||
export declare class CompositionHookPage extends Page<V1, CompositionHookPayload, CompositionHookResource, CompositionHookInstance> {
|
||||
/**
|
||||
* Initialize the CompositionHookPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: CompositionHookSolution);
|
||||
/**
|
||||
* Build an instance of CompositionHookInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: CompositionHookResource): CompositionHookInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
525
node_modules/twilio/lib/rest/video/v1/compositionHook.js
generated
vendored
Normal file
525
node_modules/twilio/lib/rest/video/v1/compositionHook.js
generated
vendored
Normal file
@@ -0,0 +1,525 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CompositionHookPage = exports.CompositionHookInstance = exports.CompositionHookContextImpl = void 0;
|
||||
exports.CompositionHookListInstance = CompositionHookListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../base/Page"));
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class CompositionHookContextImpl {
|
||||
constructor(_version, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { sid };
|
||||
this._uri = `/CompositionHooks/${sid}`;
|
||||
}
|
||||
remove(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
||||
uri: instance._uri,
|
||||
method: "delete",
|
||||
headers,
|
||||
});
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
removeWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// DELETE operation - returns boolean based on status code
|
||||
let operationPromise = operationVersion
|
||||
.removeWithResponseInfo({ uri: instance._uri, method: "delete", headers })
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: response.statusCode === 204,
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionHookInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new CompositionHookInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
update(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
if (params["videoLayout"] !== undefined)
|
||||
data["VideoLayout"] = serialize.object(params["videoLayout"]);
|
||||
if (params["audioSources"] !== undefined)
|
||||
data["AudioSources"] = serialize.map(params["audioSources"], (e) => e);
|
||||
if (params["audioSourcesExcluded"] !== undefined)
|
||||
data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e);
|
||||
if (params["trim"] !== undefined)
|
||||
data["Trim"] = serialize.bool(params["trim"]);
|
||||
if (params["format"] !== undefined)
|
||||
data["Format"] = params["format"];
|
||||
if (params["resolution"] !== undefined)
|
||||
data["Resolution"] = params["resolution"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionHookInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
if (params["videoLayout"] !== undefined)
|
||||
data["VideoLayout"] = serialize.object(params["videoLayout"]);
|
||||
if (params["audioSources"] !== undefined)
|
||||
data["AudioSources"] = serialize.map(params["audioSources"], (e) => e);
|
||||
if (params["audioSourcesExcluded"] !== undefined)
|
||||
data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e);
|
||||
if (params["trim"] !== undefined)
|
||||
data["Trim"] = serialize.bool(params["trim"]);
|
||||
if (params["format"] !== undefined)
|
||||
data["Format"] = params["format"];
|
||||
if (params["resolution"] !== undefined)
|
||||
data["Resolution"] = params["resolution"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new CompositionHookInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CompositionHookContextImpl = CompositionHookContextImpl;
|
||||
class CompositionHookInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.enabled = payload.enabled;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.sid = payload.sid;
|
||||
this.audioSources = payload.audio_sources;
|
||||
this.audioSourcesExcluded = payload.audio_sources_excluded;
|
||||
this.videoLayout = payload.video_layout;
|
||||
this.resolution = payload.resolution;
|
||||
this.trim = payload.trim;
|
||||
this.format = payload.format;
|
||||
this.statusCallback = payload.status_callback;
|
||||
this.statusCallbackMethod = payload.status_callback_method;
|
||||
this.url = payload.url;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new CompositionHookContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a CompositionHookInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback) {
|
||||
return this._proxy.removeWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a CompositionHookInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a CompositionHookInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionHookInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
update(params, callback) {
|
||||
return this._proxy.update(params, callback);
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
return this._proxy.updateWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accountSid: this.accountSid,
|
||||
friendlyName: this.friendlyName,
|
||||
enabled: this.enabled,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
sid: this.sid,
|
||||
audioSources: this.audioSources,
|
||||
audioSourcesExcluded: this.audioSourcesExcluded,
|
||||
videoLayout: this.videoLayout,
|
||||
resolution: this.resolution,
|
||||
trim: this.trim,
|
||||
format: this.format,
|
||||
statusCallback: this.statusCallback,
|
||||
statusCallbackMethod: this.statusCallbackMethod,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CompositionHookInstance = CompositionHookInstance;
|
||||
function CompositionHookListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new CompositionHookContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/CompositionHooks`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
if (params["videoLayout"] !== undefined)
|
||||
data["VideoLayout"] = serialize.object(params["videoLayout"]);
|
||||
if (params["audioSources"] !== undefined)
|
||||
data["AudioSources"] = serialize.map(params["audioSources"], (e) => e);
|
||||
if (params["audioSourcesExcluded"] !== undefined)
|
||||
data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e);
|
||||
if (params["resolution"] !== undefined)
|
||||
data["Resolution"] = params["resolution"];
|
||||
if (params["format"] !== undefined)
|
||||
data["Format"] = params["format"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["trim"] !== undefined)
|
||||
data["Trim"] = serialize.bool(params["trim"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionHookInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
if (params["videoLayout"] !== undefined)
|
||||
data["VideoLayout"] = serialize.object(params["videoLayout"]);
|
||||
if (params["audioSources"] !== undefined)
|
||||
data["AudioSources"] = serialize.map(params["audioSources"], (e) => e);
|
||||
if (params["audioSourcesExcluded"] !== undefined)
|
||||
data["AudioSourcesExcluded"] = serialize.map(params["audioSourcesExcluded"], (e) => e);
|
||||
if (params["resolution"] !== undefined)
|
||||
data["Resolution"] = params["resolution"];
|
||||
if (params["format"] !== undefined)
|
||||
data["Format"] = params["format"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["trim"] !== undefined)
|
||||
data["Trim"] = serialize.bool(params["trim"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new CompositionHookInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionHookPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new CompositionHookPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new CompositionHookPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new CompositionHookPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class CompositionHookPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the CompositionHookPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of CompositionHookInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new CompositionHookInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CompositionHookPage = CompositionHookPage;
|
||||
195
node_modules/twilio/lib/rest/video/v1/compositionSettings.d.ts
generated
vendored
Normal file
195
node_modules/twilio/lib/rest/video/v1/compositionSettings.d.ts
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a CompositionSettingsInstance
|
||||
*/
|
||||
export interface CompositionSettingsContextCreateOptions {
|
||||
/** A descriptive string that you create to describe the resource and show to the user in the console */
|
||||
friendlyName: string;
|
||||
/** The SID of the stored Credential resource. */
|
||||
awsCredentialsSid?: string;
|
||||
/** The SID of the Public Key resource to use for encryption. */
|
||||
encryptionKeySid?: string;
|
||||
/** The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). */
|
||||
awsS3Url?: string;
|
||||
/** Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. */
|
||||
awsStorageEnabled?: boolean;
|
||||
/** Whether all compositions should be stored in an encrypted form. The default is `false`. */
|
||||
encryptionEnabled?: boolean;
|
||||
}
|
||||
export interface CompositionSettingsContext {
|
||||
/**
|
||||
* Create a CompositionSettingsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance
|
||||
*/
|
||||
create(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise<CompositionSettingsInstance>;
|
||||
/**
|
||||
* Create a CompositionSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<CompositionSettingsInstance>) => any): Promise<ApiResponse<CompositionSettingsInstance>>;
|
||||
/**
|
||||
* Fetch a CompositionSettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise<CompositionSettingsInstance>;
|
||||
/**
|
||||
* Fetch a CompositionSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionSettingsInstance>) => any): Promise<ApiResponse<CompositionSettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface CompositionSettingsContextSolution {
|
||||
}
|
||||
export declare class CompositionSettingsContextImpl implements CompositionSettingsContext {
|
||||
protected _version: V1;
|
||||
protected _solution: CompositionSettingsContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1);
|
||||
create(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise<CompositionSettingsInstance>;
|
||||
createWithHttpInfo(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<CompositionSettingsInstance>) => any): Promise<ApiResponse<CompositionSettingsInstance>>;
|
||||
fetch(callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise<CompositionSettingsInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionSettingsInstance>) => any): Promise<ApiResponse<CompositionSettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): CompositionSettingsContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface CompositionSettingsResource {
|
||||
account_sid: string;
|
||||
friendly_name: string;
|
||||
aws_credentials_sid: string;
|
||||
aws_s3_url: string;
|
||||
aws_storage_enabled: boolean;
|
||||
encryption_key_sid: string;
|
||||
encryption_enabled: boolean;
|
||||
url: string;
|
||||
}
|
||||
export declare class CompositionSettingsInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: CompositionSettingsContextSolution;
|
||||
protected _context?: CompositionSettingsContext;
|
||||
constructor(_version: V1, payload: CompositionSettingsResource);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionSettings resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource and that will be shown in the console
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The SID of the stored Credential resource.
|
||||
*/
|
||||
awsCredentialsSid: string;
|
||||
/**
|
||||
* The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2).
|
||||
*/
|
||||
awsS3Url: string;
|
||||
/**
|
||||
* Whether all compositions are written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud.
|
||||
*/
|
||||
awsStorageEnabled: boolean;
|
||||
/**
|
||||
* The SID of the Public Key resource used for encryption.
|
||||
*/
|
||||
encryptionKeySid: string;
|
||||
/**
|
||||
* Whether all compositions are stored in an encrypted form. The default is `false`.
|
||||
*/
|
||||
encryptionEnabled: boolean;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Create a CompositionSettingsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance
|
||||
*/
|
||||
create(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise<CompositionSettingsInstance>;
|
||||
/**
|
||||
* Create a CompositionSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: CompositionSettingsContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<CompositionSettingsInstance>) => any): Promise<ApiResponse<CompositionSettingsInstance>>;
|
||||
/**
|
||||
* Fetch a CompositionSettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: CompositionSettingsInstance) => any): Promise<CompositionSettingsInstance>;
|
||||
/**
|
||||
* Fetch a CompositionSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CompositionSettingsInstance>) => any): Promise<ApiResponse<CompositionSettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
friendlyName: string;
|
||||
awsCredentialsSid: string;
|
||||
awsS3Url: string;
|
||||
awsStorageEnabled: boolean;
|
||||
encryptionKeySid: string;
|
||||
encryptionEnabled: boolean;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface CompositionSettingsSolution {
|
||||
}
|
||||
export interface CompositionSettingsListInstance {
|
||||
_version: V1;
|
||||
_solution: CompositionSettingsSolution;
|
||||
_uri: string;
|
||||
(): CompositionSettingsContext;
|
||||
get(): CompositionSettingsContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function CompositionSettingsListInstance(version: V1): CompositionSettingsListInstance;
|
||||
export {};
|
||||
227
node_modules/twilio/lib/rest/video/v1/compositionSettings.js
generated
vendored
Normal file
227
node_modules/twilio/lib/rest/video/v1/compositionSettings.js
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CompositionSettingsInstance = exports.CompositionSettingsContextImpl = void 0;
|
||||
exports.CompositionSettingsListInstance = CompositionSettingsListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
class CompositionSettingsContextImpl {
|
||||
constructor(_version) {
|
||||
this._version = _version;
|
||||
this._solution = {};
|
||||
this._uri = `/CompositionSettings/Default`;
|
||||
}
|
||||
create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["awsCredentialsSid"] !== undefined)
|
||||
data["AwsCredentialsSid"] = params["awsCredentialsSid"];
|
||||
if (params["encryptionKeySid"] !== undefined)
|
||||
data["EncryptionKeySid"] = params["encryptionKeySid"];
|
||||
if (params["awsS3Url"] !== undefined)
|
||||
data["AwsS3Url"] = params["awsS3Url"];
|
||||
if (params["awsStorageEnabled"] !== undefined)
|
||||
data["AwsStorageEnabled"] = serialize.bool(params["awsStorageEnabled"]);
|
||||
if (params["encryptionEnabled"] !== undefined)
|
||||
data["EncryptionEnabled"] = serialize.bool(params["encryptionEnabled"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionSettingsInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["awsCredentialsSid"] !== undefined)
|
||||
data["AwsCredentialsSid"] = params["awsCredentialsSid"];
|
||||
if (params["encryptionKeySid"] !== undefined)
|
||||
data["EncryptionKeySid"] = params["encryptionKeySid"];
|
||||
if (params["awsS3Url"] !== undefined)
|
||||
data["AwsS3Url"] = params["awsS3Url"];
|
||||
if (params["awsStorageEnabled"] !== undefined)
|
||||
data["AwsStorageEnabled"] = serialize.bool(params["awsStorageEnabled"]);
|
||||
if (params["encryptionEnabled"] !== undefined)
|
||||
data["EncryptionEnabled"] = serialize.bool(params["encryptionEnabled"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new CompositionSettingsInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new CompositionSettingsInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new CompositionSettingsInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CompositionSettingsContextImpl = CompositionSettingsContextImpl;
|
||||
class CompositionSettingsInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.awsCredentialsSid = payload.aws_credentials_sid;
|
||||
this.awsS3Url = payload.aws_s3_url;
|
||||
this.awsStorageEnabled = payload.aws_storage_enabled;
|
||||
this.encryptionKeySid = payload.encryption_key_sid;
|
||||
this.encryptionEnabled = payload.encryption_enabled;
|
||||
this.url = payload.url;
|
||||
this._solution = {};
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context || new CompositionSettingsContextImpl(this._version);
|
||||
return this._context;
|
||||
}
|
||||
create(params, callback) {
|
||||
return this._proxy.create(params, callback);
|
||||
}
|
||||
createWithHttpInfo(params, callback) {
|
||||
return this._proxy.createWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a CompositionSettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a CompositionSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CompositionSettingsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accountSid: this.accountSid,
|
||||
friendlyName: this.friendlyName,
|
||||
awsCredentialsSid: this.awsCredentialsSid,
|
||||
awsS3Url: this.awsS3Url,
|
||||
awsStorageEnabled: this.awsStorageEnabled,
|
||||
encryptionKeySid: this.encryptionKeySid,
|
||||
encryptionEnabled: this.encryptionEnabled,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CompositionSettingsInstance = CompositionSettingsInstance;
|
||||
function CompositionSettingsListInstance(version) {
|
||||
const instance = (() => instance.get());
|
||||
instance.get = function get() {
|
||||
return new CompositionSettingsContextImpl(version);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = ``;
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
429
node_modules/twilio/lib/rest/video/v1/recording.d.ts
generated
vendored
Normal file
429
node_modules/twilio/lib/rest/video/v1/recording.d.ts
generated
vendored
Normal file
@@ -0,0 +1,429 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
||||
import Response from "../../../http/response";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* The codec used to encode the track. Can be: `VP8`, `H264`, `OPUS`, and `PCMU`.
|
||||
*/
|
||||
export type RecordingCodec = "VP8" | "H264" | "OPUS" | "PCMU";
|
||||
export type RecordingFormat = "mka" | "mkv";
|
||||
/**
|
||||
* The status of the recording. Can be: `processing`, `completed`, or `deleted`. `processing` indicates the recording is still being captured; `completed` indicates the recording has been captured and is now available for download. `deleted` means the recording media has been deleted from the system, but its metadata is still available.
|
||||
*/
|
||||
export type RecordingStatus = "processing" | "completed" | "deleted" | "failed";
|
||||
/**
|
||||
* The recording\'s media type. Can be: `audio` or `video`.
|
||||
*/
|
||||
export type RecordingType = "audio" | "video" | "data";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface RecordingListInstanceEachOptions {
|
||||
/** Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. */
|
||||
status?: RecordingStatus;
|
||||
/** Read only the recordings that have this `source_sid`. */
|
||||
sourceSid?: string;
|
||||
/** Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. */
|
||||
groupingSid?: Array<string>;
|
||||
/** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only recordings that have this media type. Can be either `audio` or `video`. */
|
||||
mediaType?: RecordingType;
|
||||
/** How many resources to return in each list page. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: RecordingInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface RecordingListInstanceOptions {
|
||||
/** Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. */
|
||||
status?: RecordingStatus;
|
||||
/** Read only the recordings that have this `source_sid`. */
|
||||
sourceSid?: string;
|
||||
/** Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. */
|
||||
groupingSid?: Array<string>;
|
||||
/** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only recordings that have this media type. Can be either `audio` or `video`. */
|
||||
mediaType?: RecordingType;
|
||||
/** How many resources to return in each list page. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface RecordingListInstancePageOptions {
|
||||
/** Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. */
|
||||
status?: RecordingStatus;
|
||||
/** Read only the recordings that have this `source_sid`. */
|
||||
sourceSid?: string;
|
||||
/** Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. */
|
||||
groupingSid?: Array<string>;
|
||||
/** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** Read only recordings that have this media type. Can be either `audio` or `video`. */
|
||||
mediaType?: RecordingType;
|
||||
/** How many resources to return in each list page. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface RecordingContext {
|
||||
/**
|
||||
* Remove a RecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a RecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a RecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise<RecordingInstance>;
|
||||
/**
|
||||
* Fetch a RecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RecordingInstance>) => any): Promise<ApiResponse<RecordingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface RecordingContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class RecordingContextImpl implements RecordingContext {
|
||||
protected _version: V1;
|
||||
protected _solution: RecordingContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, sid: string);
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise<RecordingInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RecordingInstance>) => any): Promise<ApiResponse<RecordingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): RecordingContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface RecordingPayload extends TwilioResponsePayload {
|
||||
recordings: RecordingResource[];
|
||||
}
|
||||
interface RecordingResource {
|
||||
account_sid: string;
|
||||
status: RecordingStatus;
|
||||
date_created: Date;
|
||||
sid: string;
|
||||
source_sid: string;
|
||||
size: number;
|
||||
url: string;
|
||||
type: RecordingType;
|
||||
duration: number;
|
||||
container_format: RecordingFormat;
|
||||
codec: RecordingCodec;
|
||||
grouping_sids: any;
|
||||
track_name: string;
|
||||
offset: number;
|
||||
media_external_location: string;
|
||||
status_callback: string;
|
||||
status_callback_method: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class RecordingInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: RecordingContextSolution;
|
||||
protected _context?: RecordingContext;
|
||||
constructor(_version: V1, payload: RecordingResource, sid?: string);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
status: RecordingStatus;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The unique string that we created to identify the Recording resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the recording source. For a Room Recording, this value is a `track_sid`.
|
||||
*/
|
||||
sourceSid: string;
|
||||
/**
|
||||
* The size of the recorded track, in bytes.
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
type: RecordingType;
|
||||
/**
|
||||
* The duration of the recording in seconds rounded to the nearest second. Sub-second tracks have a `Duration` property of 1 second
|
||||
*/
|
||||
duration: number;
|
||||
containerFormat: RecordingFormat;
|
||||
codec: RecordingCodec;
|
||||
/**
|
||||
* A list of SIDs related to the recording. Includes the `room_sid` and `participant_sid`.
|
||||
*/
|
||||
groupingSids: any;
|
||||
/**
|
||||
* The name that was given to the source track of the recording. If no name is given, the `source_sid` is used.
|
||||
*/
|
||||
trackName: string;
|
||||
/**
|
||||
* The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started. This information provides a synchronization mechanism for recordings belonging to the same room.
|
||||
*/
|
||||
offset: number;
|
||||
/**
|
||||
* The URL of the media file associated with the recording when stored externally. See [External S3 Recordings](/docs/video/api/external-s3-recordings) for more details.
|
||||
*/
|
||||
mediaExternalLocation: string;
|
||||
/**
|
||||
* The URL called using the `status_callback_method` to send status information on every recording event.
|
||||
*/
|
||||
statusCallback: string;
|
||||
/**
|
||||
* The HTTP method used to call `status_callback`. Can be: `POST` or `GET`, defaults to `POST`.
|
||||
*/
|
||||
statusCallbackMethod: string;
|
||||
/**
|
||||
* The URLs of related resources.
|
||||
*/
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a RecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a RecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a RecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RecordingInstance) => any): Promise<RecordingInstance>;
|
||||
/**
|
||||
* Fetch a RecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RecordingInstance>) => any): Promise<ApiResponse<RecordingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
status: RecordingStatus;
|
||||
dateCreated: Date;
|
||||
sid: string;
|
||||
sourceSid: string;
|
||||
size: number;
|
||||
url: string;
|
||||
type: RecordingType;
|
||||
duration: number;
|
||||
containerFormat: RecordingFormat;
|
||||
codec: RecordingCodec;
|
||||
groupingSids: any;
|
||||
trackName: string;
|
||||
offset: number;
|
||||
mediaExternalLocation: string;
|
||||
statusCallback: string;
|
||||
statusCallbackMethod: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface RecordingSolution {
|
||||
}
|
||||
export interface RecordingListInstance {
|
||||
_version: V1;
|
||||
_solution: RecordingSolution;
|
||||
_uri: string;
|
||||
(sid: string): RecordingContext;
|
||||
get(sid: string): RecordingContext;
|
||||
/**
|
||||
* Streams RecordingInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RecordingListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: RecordingListInstanceEachOptions, callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams RecordingInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RecordingListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: RecordingListInstanceEachOptions, callback?: (item: RecordingInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of RecordingInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: RecordingPage) => any): Promise<RecordingPage>;
|
||||
/**
|
||||
* Retrieve a single target page of RecordingInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<RecordingPage>) => any): Promise<ApiResponse<RecordingPage>>;
|
||||
/**
|
||||
* Lists RecordingInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RecordingListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise<RecordingInstance[]>;
|
||||
list(params: RecordingListInstanceOptions, callback?: (error: Error | null, items: RecordingInstance[]) => any): Promise<RecordingInstance[]>;
|
||||
/**
|
||||
* Lists RecordingInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RecordingListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RecordingInstance[]>) => any): Promise<ApiResponse<RecordingInstance[]>>;
|
||||
listWithHttpInfo(params: RecordingListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<RecordingInstance[]>) => any): Promise<ApiResponse<RecordingInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of RecordingInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RecordingListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: RecordingPage) => any): Promise<RecordingPage>;
|
||||
page(params: RecordingListInstancePageOptions, callback?: (error: Error | null, items: RecordingPage) => any): Promise<RecordingPage>;
|
||||
/**
|
||||
* Retrieve a single page of RecordingInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RecordingListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RecordingPage>) => any): Promise<ApiResponse<RecordingPage>>;
|
||||
pageWithHttpInfo(params: RecordingListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<RecordingPage>) => any): Promise<ApiResponse<RecordingPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function RecordingListInstance(version: V1): RecordingListInstance;
|
||||
export declare class RecordingPage extends Page<V1, RecordingPayload, RecordingResource, RecordingInstance> {
|
||||
/**
|
||||
* Initialize the RecordingPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: RecordingSolution);
|
||||
/**
|
||||
* Build an instance of RecordingInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: RecordingResource): RecordingInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
355
node_modules/twilio/lib/rest/video/v1/recording.js
generated
vendored
Normal file
355
node_modules/twilio/lib/rest/video/v1/recording.js
generated
vendored
Normal file
@@ -0,0 +1,355 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RecordingPage = exports.RecordingInstance = exports.RecordingContextImpl = void 0;
|
||||
exports.RecordingListInstance = RecordingListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../base/Page"));
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class RecordingContextImpl {
|
||||
constructor(_version, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { sid };
|
||||
this._uri = `/Recordings/${sid}`;
|
||||
}
|
||||
remove(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
||||
uri: instance._uri,
|
||||
method: "delete",
|
||||
headers,
|
||||
});
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
removeWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// DELETE operation - returns boolean based on status code
|
||||
let operationPromise = operationVersion
|
||||
.removeWithResponseInfo({ uri: instance._uri, method: "delete", headers })
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: response.statusCode === 204,
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RecordingInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RecordingInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RecordingContextImpl = RecordingContextImpl;
|
||||
class RecordingInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.status = payload.status;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.sid = payload.sid;
|
||||
this.sourceSid = payload.source_sid;
|
||||
this.size = payload.size;
|
||||
this.url = payload.url;
|
||||
this.type = payload.type;
|
||||
this.duration = deserialize.integer(payload.duration);
|
||||
this.containerFormat = payload.container_format;
|
||||
this.codec = payload.codec;
|
||||
this.groupingSids = payload.grouping_sids;
|
||||
this.trackName = payload.track_name;
|
||||
this.offset = payload.offset;
|
||||
this.mediaExternalLocation = payload.media_external_location;
|
||||
this.statusCallback = payload.status_callback;
|
||||
this.statusCallbackMethod = payload.status_callback_method;
|
||||
this.links = payload.links;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new RecordingContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a RecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a RecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback) {
|
||||
return this._proxy.removeWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a RecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a RecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accountSid: this.accountSid,
|
||||
status: this.status,
|
||||
dateCreated: this.dateCreated,
|
||||
sid: this.sid,
|
||||
sourceSid: this.sourceSid,
|
||||
size: this.size,
|
||||
url: this.url,
|
||||
type: this.type,
|
||||
duration: this.duration,
|
||||
containerFormat: this.containerFormat,
|
||||
codec: this.codec,
|
||||
groupingSids: this.groupingSids,
|
||||
trackName: this.trackName,
|
||||
offset: this.offset,
|
||||
mediaExternalLocation: this.mediaExternalLocation,
|
||||
statusCallback: this.statusCallback,
|
||||
statusCallbackMethod: this.statusCallbackMethod,
|
||||
links: this.links,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RecordingInstance = RecordingInstance;
|
||||
function RecordingListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new RecordingContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Recordings`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["sourceSid"] !== undefined)
|
||||
data["SourceSid"] = params["sourceSid"];
|
||||
if (params["groupingSid"] !== undefined)
|
||||
data["GroupingSid"] = serialize.map(params["groupingSid"], (e) => e);
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["mediaType"] !== undefined)
|
||||
data["MediaType"] = params["mediaType"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RecordingPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new RecordingPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["sourceSid"] !== undefined)
|
||||
data["SourceSid"] = params["sourceSid"];
|
||||
if (params["groupingSid"] !== undefined)
|
||||
data["GroupingSid"] = serialize.map(params["groupingSid"], (e) => e);
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["mediaType"] !== undefined)
|
||||
data["MediaType"] = params["mediaType"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new RecordingPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new RecordingPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class RecordingPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the RecordingPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of RecordingInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new RecordingInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RecordingPage = RecordingPage;
|
||||
195
node_modules/twilio/lib/rest/video/v1/recordingSettings.d.ts
generated
vendored
Normal file
195
node_modules/twilio/lib/rest/video/v1/recordingSettings.d.ts
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a RecordingSettingsInstance
|
||||
*/
|
||||
export interface RecordingSettingsContextCreateOptions {
|
||||
/** A descriptive string that you create to describe the resource and be shown to users in the console */
|
||||
friendlyName: string;
|
||||
/** The SID of the stored Credential resource. */
|
||||
awsCredentialsSid?: string;
|
||||
/** The SID of the Public Key resource to use for encryption. */
|
||||
encryptionKeySid?: string;
|
||||
/** The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). */
|
||||
awsS3Url?: string;
|
||||
/** Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. */
|
||||
awsStorageEnabled?: boolean;
|
||||
/** Whether all recordings should be stored in an encrypted form. The default is `false`. */
|
||||
encryptionEnabled?: boolean;
|
||||
}
|
||||
export interface RecordingSettingsContext {
|
||||
/**
|
||||
* Create a RecordingSettingsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance
|
||||
*/
|
||||
create(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise<RecordingSettingsInstance>;
|
||||
/**
|
||||
* Create a RecordingSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<RecordingSettingsInstance>) => any): Promise<ApiResponse<RecordingSettingsInstance>>;
|
||||
/**
|
||||
* Fetch a RecordingSettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise<RecordingSettingsInstance>;
|
||||
/**
|
||||
* Fetch a RecordingSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RecordingSettingsInstance>) => any): Promise<ApiResponse<RecordingSettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface RecordingSettingsContextSolution {
|
||||
}
|
||||
export declare class RecordingSettingsContextImpl implements RecordingSettingsContext {
|
||||
protected _version: V1;
|
||||
protected _solution: RecordingSettingsContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1);
|
||||
create(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise<RecordingSettingsInstance>;
|
||||
createWithHttpInfo(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<RecordingSettingsInstance>) => any): Promise<ApiResponse<RecordingSettingsInstance>>;
|
||||
fetch(callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise<RecordingSettingsInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RecordingSettingsInstance>) => any): Promise<ApiResponse<RecordingSettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): RecordingSettingsContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface RecordingSettingsResource {
|
||||
account_sid: string;
|
||||
friendly_name: string;
|
||||
aws_credentials_sid: string;
|
||||
aws_s3_url: string;
|
||||
aws_storage_enabled: boolean;
|
||||
encryption_key_sid: string;
|
||||
encryption_enabled: boolean;
|
||||
url: string;
|
||||
}
|
||||
export declare class RecordingSettingsInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: RecordingSettingsContextSolution;
|
||||
protected _context?: RecordingSettingsContext;
|
||||
constructor(_version: V1, payload: RecordingSettingsResource);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RecordingSettings resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource and show the user in the console
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The SID of the stored Credential resource.
|
||||
*/
|
||||
awsCredentialsSid: string;
|
||||
/**
|
||||
* The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2).
|
||||
*/
|
||||
awsS3Url: string;
|
||||
/**
|
||||
* Whether all recordings are written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud.
|
||||
*/
|
||||
awsStorageEnabled: boolean;
|
||||
/**
|
||||
* The SID of the Public Key resource used for encryption.
|
||||
*/
|
||||
encryptionKeySid: string;
|
||||
/**
|
||||
* Whether all recordings are stored in an encrypted form. The default is `false`.
|
||||
*/
|
||||
encryptionEnabled: boolean;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Create a RecordingSettingsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance
|
||||
*/
|
||||
create(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise<RecordingSettingsInstance>;
|
||||
/**
|
||||
* Create a RecordingSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: RecordingSettingsContextCreateOptions, callback?: (error: Error | null, item?: ApiResponse<RecordingSettingsInstance>) => any): Promise<ApiResponse<RecordingSettingsInstance>>;
|
||||
/**
|
||||
* Fetch a RecordingSettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RecordingSettingsInstance) => any): Promise<RecordingSettingsInstance>;
|
||||
/**
|
||||
* Fetch a RecordingSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RecordingSettingsInstance>) => any): Promise<ApiResponse<RecordingSettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
friendlyName: string;
|
||||
awsCredentialsSid: string;
|
||||
awsS3Url: string;
|
||||
awsStorageEnabled: boolean;
|
||||
encryptionKeySid: string;
|
||||
encryptionEnabled: boolean;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface RecordingSettingsSolution {
|
||||
}
|
||||
export interface RecordingSettingsListInstance {
|
||||
_version: V1;
|
||||
_solution: RecordingSettingsSolution;
|
||||
_uri: string;
|
||||
(): RecordingSettingsContext;
|
||||
get(): RecordingSettingsContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function RecordingSettingsListInstance(version: V1): RecordingSettingsListInstance;
|
||||
export {};
|
||||
227
node_modules/twilio/lib/rest/video/v1/recordingSettings.js
generated
vendored
Normal file
227
node_modules/twilio/lib/rest/video/v1/recordingSettings.js
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RecordingSettingsInstance = exports.RecordingSettingsContextImpl = void 0;
|
||||
exports.RecordingSettingsListInstance = RecordingSettingsListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
class RecordingSettingsContextImpl {
|
||||
constructor(_version) {
|
||||
this._version = _version;
|
||||
this._solution = {};
|
||||
this._uri = `/RecordingSettings/Default`;
|
||||
}
|
||||
create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["awsCredentialsSid"] !== undefined)
|
||||
data["AwsCredentialsSid"] = params["awsCredentialsSid"];
|
||||
if (params["encryptionKeySid"] !== undefined)
|
||||
data["EncryptionKeySid"] = params["encryptionKeySid"];
|
||||
if (params["awsS3Url"] !== undefined)
|
||||
data["AwsS3Url"] = params["awsS3Url"];
|
||||
if (params["awsStorageEnabled"] !== undefined)
|
||||
data["AwsStorageEnabled"] = serialize.bool(params["awsStorageEnabled"]);
|
||||
if (params["encryptionEnabled"] !== undefined)
|
||||
data["EncryptionEnabled"] = serialize.bool(params["encryptionEnabled"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RecordingSettingsInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["friendlyName"] === null ||
|
||||
params["friendlyName"] === undefined) {
|
||||
throw new Error("Required parameter \"params['friendlyName']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["awsCredentialsSid"] !== undefined)
|
||||
data["AwsCredentialsSid"] = params["awsCredentialsSid"];
|
||||
if (params["encryptionKeySid"] !== undefined)
|
||||
data["EncryptionKeySid"] = params["encryptionKeySid"];
|
||||
if (params["awsS3Url"] !== undefined)
|
||||
data["AwsS3Url"] = params["awsS3Url"];
|
||||
if (params["awsStorageEnabled"] !== undefined)
|
||||
data["AwsStorageEnabled"] = serialize.bool(params["awsStorageEnabled"]);
|
||||
if (params["encryptionEnabled"] !== undefined)
|
||||
data["EncryptionEnabled"] = serialize.bool(params["encryptionEnabled"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RecordingSettingsInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RecordingSettingsInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RecordingSettingsInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RecordingSettingsContextImpl = RecordingSettingsContextImpl;
|
||||
class RecordingSettingsInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.awsCredentialsSid = payload.aws_credentials_sid;
|
||||
this.awsS3Url = payload.aws_s3_url;
|
||||
this.awsStorageEnabled = payload.aws_storage_enabled;
|
||||
this.encryptionKeySid = payload.encryption_key_sid;
|
||||
this.encryptionEnabled = payload.encryption_enabled;
|
||||
this.url = payload.url;
|
||||
this._solution = {};
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context || new RecordingSettingsContextImpl(this._version);
|
||||
return this._context;
|
||||
}
|
||||
create(params, callback) {
|
||||
return this._proxy.create(params, callback);
|
||||
}
|
||||
createWithHttpInfo(params, callback) {
|
||||
return this._proxy.createWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a RecordingSettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a RecordingSettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingSettingsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accountSid: this.accountSid,
|
||||
friendlyName: this.friendlyName,
|
||||
awsCredentialsSid: this.awsCredentialsSid,
|
||||
awsS3Url: this.awsS3Url,
|
||||
awsStorageEnabled: this.awsStorageEnabled,
|
||||
encryptionKeySid: this.encryptionKeySid,
|
||||
encryptionEnabled: this.encryptionEnabled,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RecordingSettingsInstance = RecordingSettingsInstance;
|
||||
function RecordingSettingsListInstance(version) {
|
||||
const instance = (() => instance.get());
|
||||
instance.get = function get() {
|
||||
return new RecordingSettingsContextImpl(version);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = ``;
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
565
node_modules/twilio/lib/rest/video/v1/room.d.ts
generated
vendored
Normal file
565
node_modules/twilio/lib/rest/video/v1/room.d.ts
generated
vendored
Normal file
@@ -0,0 +1,565 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
||||
import Response from "../../../http/response";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
import { ParticipantListInstance } from "./room/participant";
|
||||
import { RecordingRulesListInstance } from "./room/recordingRules";
|
||||
import { RoomRecordingListInstance } from "./room/roomRecording";
|
||||
import { TranscriptionsListInstance } from "./room/transcriptions";
|
||||
export type RoomRoomStatus = "in-progress" | "completed" | "failed";
|
||||
export type RoomRoomType = "go" | "peer-to-peer" | "group" | "group-small";
|
||||
export type RoomVideoCodec = "VP8" | "H264";
|
||||
/**
|
||||
* Options to pass to update a RoomInstance
|
||||
*/
|
||||
export interface RoomContextUpdateOptions {
|
||||
/** */
|
||||
status: RoomRoomStatus;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a RoomInstance
|
||||
*/
|
||||
export interface RoomListInstanceCreateOptions {
|
||||
/** Deprecated, now always considered to be true. */
|
||||
enableTurn?: boolean;
|
||||
/** */
|
||||
type?: RoomRoomType;
|
||||
/** An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource\\\'s `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. */
|
||||
uniqueName?: string;
|
||||
/** The URL Twilio should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. */
|
||||
statusCallback?: string;
|
||||
/** The HTTP method Twilio should use to call `status_callback`. Can be `POST` or `GET`. */
|
||||
statusCallbackMethod?: string;
|
||||
/** The maximum number of concurrent Participants allowed in the room. The maximum allowed value is 50. */
|
||||
maxParticipants?: number;
|
||||
/** Whether to start recording when Participants connect. */
|
||||
recordParticipantsOnConnect?: boolean;
|
||||
/** Whether to start transcriptions when Participants connect. If TranscriptionsConfiguration is not provided, default settings will be used. */
|
||||
transcribeParticipantsOnConnect?: boolean;
|
||||
/** An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. */
|
||||
videoCodecs?: Array<RoomVideoCodec>;
|
||||
/** The region for the Room\\\'s media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). */
|
||||
mediaRegion?: string;
|
||||
/** A collection of Recording Rules that describe how to include or exclude matching tracks for recording */
|
||||
recordingRules?: any;
|
||||
/** A collection of properties that describe transcription behaviour. If TranscribeParticipantsOnConnect is set to true and TranscriptionsConfiguration is not provided, default settings will be used. */
|
||||
transcriptionsConfiguration?: object;
|
||||
/** When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. */
|
||||
audioOnly?: boolean;
|
||||
/** The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). */
|
||||
maxParticipantDuration?: number;
|
||||
/** Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). */
|
||||
emptyRoomTimeout?: number;
|
||||
/** Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). */
|
||||
unusedRoomTimeout?: number;
|
||||
/** When set to true, indicated that this is the large room. */
|
||||
largeRoom?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface RoomListInstanceEachOptions {
|
||||
/** Read only the rooms with this status. Can be: `in-progress` (default) or `completed` */
|
||||
status?: RoomRoomStatus;
|
||||
/** Read only rooms with the this `unique_name`. */
|
||||
uniqueName?: string;
|
||||
/** Read only rooms that started on or after this date, given as `YYYY-MM-DD`. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only rooms that started before this date, given as `YYYY-MM-DD`. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: RoomInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface RoomListInstanceOptions {
|
||||
/** Read only the rooms with this status. Can be: `in-progress` (default) or `completed` */
|
||||
status?: RoomRoomStatus;
|
||||
/** Read only rooms with the this `unique_name`. */
|
||||
uniqueName?: string;
|
||||
/** Read only rooms that started on or after this date, given as `YYYY-MM-DD`. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only rooms that started before this date, given as `YYYY-MM-DD`. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface RoomListInstancePageOptions {
|
||||
/** Read only the rooms with this status. Can be: `in-progress` (default) or `completed` */
|
||||
status?: RoomRoomStatus;
|
||||
/** Read only rooms with the this `unique_name`. */
|
||||
uniqueName?: string;
|
||||
/** Read only rooms that started on or after this date, given as `YYYY-MM-DD`. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only rooms that started before this date, given as `YYYY-MM-DD`. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface RoomContext {
|
||||
participants: ParticipantListInstance;
|
||||
recordingRules: RecordingRulesListInstance;
|
||||
recordings: RoomRecordingListInstance;
|
||||
transcriptions: TranscriptionsListInstance;
|
||||
/**
|
||||
* Fetch a RoomInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise<RoomInstance>;
|
||||
/**
|
||||
* Fetch a RoomInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RoomInstance>) => any): Promise<ApiResponse<RoomInstance>>;
|
||||
/**
|
||||
* Update a RoomInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance
|
||||
*/
|
||||
update(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: RoomInstance) => any): Promise<RoomInstance>;
|
||||
/**
|
||||
* Update a RoomInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<RoomInstance>) => any): Promise<ApiResponse<RoomInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface RoomContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class RoomContextImpl implements RoomContext {
|
||||
protected _version: V1;
|
||||
protected _solution: RoomContextSolution;
|
||||
protected _uri: string;
|
||||
protected _participants?: ParticipantListInstance;
|
||||
protected _recordingRules?: RecordingRulesListInstance;
|
||||
protected _recordings?: RoomRecordingListInstance;
|
||||
protected _transcriptions?: TranscriptionsListInstance;
|
||||
constructor(_version: V1, sid: string);
|
||||
get participants(): ParticipantListInstance;
|
||||
get recordingRules(): RecordingRulesListInstance;
|
||||
get recordings(): RoomRecordingListInstance;
|
||||
get transcriptions(): TranscriptionsListInstance;
|
||||
fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise<RoomInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RoomInstance>) => any): Promise<ApiResponse<RoomInstance>>;
|
||||
update(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: RoomInstance) => any): Promise<RoomInstance>;
|
||||
updateWithHttpInfo(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<RoomInstance>) => any): Promise<ApiResponse<RoomInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): RoomContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface RoomPayload extends TwilioResponsePayload {
|
||||
rooms: RoomResource[];
|
||||
}
|
||||
interface RoomResource {
|
||||
sid: string;
|
||||
status: RoomRoomStatus;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
account_sid: string;
|
||||
enable_turn: boolean;
|
||||
unique_name: string;
|
||||
status_callback: string;
|
||||
status_callback_method: string;
|
||||
end_time: Date;
|
||||
duration: number;
|
||||
type: RoomRoomType;
|
||||
max_participants: number;
|
||||
max_participant_duration: number;
|
||||
max_concurrent_published_tracks: number;
|
||||
record_participants_on_connect: boolean;
|
||||
video_codecs: Array<RoomVideoCodec>;
|
||||
media_region: string;
|
||||
audio_only: boolean;
|
||||
empty_room_timeout: number;
|
||||
unused_room_timeout: number;
|
||||
large_room: boolean;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class RoomInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: RoomContextSolution;
|
||||
protected _context?: RoomContext;
|
||||
constructor(_version: V1, payload: RoomResource, sid?: string);
|
||||
/**
|
||||
* The unique string that Twilio created to identify the Room resource.
|
||||
*/
|
||||
sid: string;
|
||||
status: RoomRoomStatus;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Room resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* Deprecated, now always considered to be true.
|
||||
*/
|
||||
enableTurn: boolean;
|
||||
/**
|
||||
* An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource\'s `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`.
|
||||
*/
|
||||
uniqueName: string;
|
||||
/**
|
||||
* The URL Twilio calls using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info.
|
||||
*/
|
||||
statusCallback: string;
|
||||
/**
|
||||
* The HTTP method Twilio uses to call `status_callback`. Can be `POST` or `GET` and defaults to `POST`.
|
||||
*/
|
||||
statusCallbackMethod: string;
|
||||
/**
|
||||
* The UTC end time of the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.
|
||||
*/
|
||||
endTime: Date;
|
||||
/**
|
||||
* The duration of the room in seconds.
|
||||
*/
|
||||
duration: number;
|
||||
type: RoomRoomType;
|
||||
/**
|
||||
* The maximum number of concurrent Participants allowed in the room.
|
||||
*/
|
||||
maxParticipants: number;
|
||||
/**
|
||||
* The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours).
|
||||
*/
|
||||
maxParticipantDuration: number;
|
||||
/**
|
||||
* The maximum number of published audio, video, and data tracks all participants combined are allowed to publish in the room at the same time. Check [Programmable Video Limits](https://www.twilio.com/docs/video/programmable-video-limits) for more details. If it is set to 0 it means unconstrained.
|
||||
*/
|
||||
maxConcurrentPublishedTracks: number;
|
||||
/**
|
||||
* Whether to start recording when Participants connect.
|
||||
*/
|
||||
recordParticipantsOnConnect: boolean;
|
||||
/**
|
||||
* An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`.
|
||||
*/
|
||||
videoCodecs: Array<RoomVideoCodec>;
|
||||
/**
|
||||
* The region for the Room\'s media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#media-servers).
|
||||
*/
|
||||
mediaRegion: string;
|
||||
/**
|
||||
* When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed.
|
||||
*/
|
||||
audioOnly: boolean;
|
||||
/**
|
||||
* Specifies how long (in minutes) a room will remain active after last participant leaves. Can be configured when creating a room via REST API. For Ad-Hoc rooms this value cannot be changed.
|
||||
*/
|
||||
emptyRoomTimeout: number;
|
||||
/**
|
||||
* Specifies how long (in minutes) a room will remain active if no one joins. Can be configured when creating a room via REST API. For Ad-Hoc rooms this value cannot be changed.
|
||||
*/
|
||||
unusedRoomTimeout: number;
|
||||
/**
|
||||
* Indicates if this is a large room.
|
||||
*/
|
||||
largeRoom: boolean;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The URLs of related resources.
|
||||
*/
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a RoomInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RoomInstance) => any): Promise<RoomInstance>;
|
||||
/**
|
||||
* Fetch a RoomInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RoomInstance>) => any): Promise<ApiResponse<RoomInstance>>;
|
||||
/**
|
||||
* Update a RoomInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance
|
||||
*/
|
||||
update(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: RoomInstance) => any): Promise<RoomInstance>;
|
||||
/**
|
||||
* Update a RoomInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: RoomContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<RoomInstance>) => any): Promise<ApiResponse<RoomInstance>>;
|
||||
/**
|
||||
* Access the participants.
|
||||
*/
|
||||
participants(): ParticipantListInstance;
|
||||
/**
|
||||
* Access the recordingRules.
|
||||
*/
|
||||
recordingRules(): RecordingRulesListInstance;
|
||||
/**
|
||||
* Access the recordings.
|
||||
*/
|
||||
recordings(): RoomRecordingListInstance;
|
||||
/**
|
||||
* Access the transcriptions.
|
||||
*/
|
||||
transcriptions(): TranscriptionsListInstance;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
status: RoomRoomStatus;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
accountSid: string;
|
||||
enableTurn: boolean;
|
||||
uniqueName: string;
|
||||
statusCallback: string;
|
||||
statusCallbackMethod: string;
|
||||
endTime: Date;
|
||||
duration: number;
|
||||
type: RoomRoomType;
|
||||
maxParticipants: number;
|
||||
maxParticipantDuration: number;
|
||||
maxConcurrentPublishedTracks: number;
|
||||
recordParticipantsOnConnect: boolean;
|
||||
videoCodecs: RoomVideoCodec[];
|
||||
mediaRegion: string;
|
||||
audioOnly: boolean;
|
||||
emptyRoomTimeout: number;
|
||||
unusedRoomTimeout: number;
|
||||
largeRoom: boolean;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface RoomSolution {
|
||||
}
|
||||
export interface RoomListInstance {
|
||||
_version: V1;
|
||||
_solution: RoomSolution;
|
||||
_uri: string;
|
||||
(sid: string): RoomContext;
|
||||
get(sid: string): RoomContext;
|
||||
/**
|
||||
* Create a RoomInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: RoomInstance) => any): Promise<RoomInstance>;
|
||||
/**
|
||||
* Create a RoomInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance
|
||||
*/
|
||||
create(params: RoomListInstanceCreateOptions, callback?: (error: Error | null, item?: RoomInstance) => any): Promise<RoomInstance>;
|
||||
/**
|
||||
* Create a RoomInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RoomInstance>) => any): Promise<ApiResponse<RoomInstance>>;
|
||||
/**
|
||||
* Create a RoomInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: RoomListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<RoomInstance>) => any): Promise<ApiResponse<RoomInstance>>;
|
||||
/**
|
||||
* Streams RoomInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: RoomInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: RoomListInstanceEachOptions, callback?: (item: RoomInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams RoomInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: RoomInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: RoomListInstanceEachOptions, callback?: (item: RoomInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of RoomInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: RoomPage) => any): Promise<RoomPage>;
|
||||
/**
|
||||
* Retrieve a single target page of RoomInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<RoomPage>) => any): Promise<ApiResponse<RoomPage>>;
|
||||
/**
|
||||
* Lists RoomInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: RoomInstance[]) => any): Promise<RoomInstance[]>;
|
||||
list(params: RoomListInstanceOptions, callback?: (error: Error | null, items: RoomInstance[]) => any): Promise<RoomInstance[]>;
|
||||
/**
|
||||
* Lists RoomInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RoomInstance[]>) => any): Promise<ApiResponse<RoomInstance[]>>;
|
||||
listWithHttpInfo(params: RoomListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<RoomInstance[]>) => any): Promise<ApiResponse<RoomInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of RoomInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: RoomPage) => any): Promise<RoomPage>;
|
||||
page(params: RoomListInstancePageOptions, callback?: (error: Error | null, items: RoomPage) => any): Promise<RoomPage>;
|
||||
/**
|
||||
* Retrieve a single page of RoomInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RoomPage>) => any): Promise<ApiResponse<RoomPage>>;
|
||||
pageWithHttpInfo(params: RoomListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<RoomPage>) => any): Promise<ApiResponse<RoomPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function RoomListInstance(version: V1): RoomListInstance;
|
||||
export declare class RoomPage extends Page<V1, RoomPayload, RoomResource, RoomInstance> {
|
||||
/**
|
||||
* Initialize the RoomPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: RoomSolution);
|
||||
/**
|
||||
* Build an instance of RoomInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: RoomResource): RoomInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
541
node_modules/twilio/lib/rest/video/v1/room.js
generated
vendored
Normal file
541
node_modules/twilio/lib/rest/video/v1/room.js
generated
vendored
Normal file
@@ -0,0 +1,541 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RoomPage = exports.RoomInstance = exports.RoomContextImpl = void 0;
|
||||
exports.RoomListInstance = RoomListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../base/Page"));
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
const participant_1 = require("./room/participant");
|
||||
const recordingRules_1 = require("./room/recordingRules");
|
||||
const roomRecording_1 = require("./room/roomRecording");
|
||||
const transcriptions_1 = require("./room/transcriptions");
|
||||
class RoomContextImpl {
|
||||
constructor(_version, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { sid };
|
||||
this._uri = `/Rooms/${sid}`;
|
||||
}
|
||||
get participants() {
|
||||
this._participants =
|
||||
this._participants ||
|
||||
(0, participant_1.ParticipantListInstance)(this._version, this._solution.sid);
|
||||
return this._participants;
|
||||
}
|
||||
get recordingRules() {
|
||||
this._recordingRules =
|
||||
this._recordingRules ||
|
||||
(0, recordingRules_1.RecordingRulesListInstance)(this._version, this._solution.sid);
|
||||
return this._recordingRules;
|
||||
}
|
||||
get recordings() {
|
||||
this._recordings =
|
||||
this._recordings ||
|
||||
(0, roomRecording_1.RoomRecordingListInstance)(this._version, this._solution.sid);
|
||||
return this._recordings;
|
||||
}
|
||||
get transcriptions() {
|
||||
this._transcriptions =
|
||||
this._transcriptions ||
|
||||
(0, transcriptions_1.TranscriptionsListInstance)(this._version, this._solution.sid);
|
||||
return this._transcriptions;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RoomInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RoomInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
update(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["status"] === null || params["status"] === undefined) {
|
||||
throw new Error("Required parameter \"params['status']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["Status"] = params["status"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RoomInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["status"] === null || params["status"] === undefined) {
|
||||
throw new Error("Required parameter \"params['status']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["Status"] = params["status"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RoomInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RoomContextImpl = RoomContextImpl;
|
||||
class RoomInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.status = payload.status;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.accountSid = payload.account_sid;
|
||||
this.enableTurn = payload.enable_turn;
|
||||
this.uniqueName = payload.unique_name;
|
||||
this.statusCallback = payload.status_callback;
|
||||
this.statusCallbackMethod = payload.status_callback_method;
|
||||
this.endTime = deserialize.iso8601DateTime(payload.end_time);
|
||||
this.duration = deserialize.integer(payload.duration);
|
||||
this.type = payload.type;
|
||||
this.maxParticipants = deserialize.integer(payload.max_participants);
|
||||
this.maxParticipantDuration = deserialize.integer(payload.max_participant_duration);
|
||||
this.maxConcurrentPublishedTracks = deserialize.integer(payload.max_concurrent_published_tracks);
|
||||
this.recordParticipantsOnConnect = payload.record_participants_on_connect;
|
||||
this.videoCodecs = payload.video_codecs;
|
||||
this.mediaRegion = payload.media_region;
|
||||
this.audioOnly = payload.audio_only;
|
||||
this.emptyRoomTimeout = deserialize.integer(payload.empty_room_timeout);
|
||||
this.unusedRoomTimeout = deserialize.integer(payload.unused_room_timeout);
|
||||
this.largeRoom = payload.large_room;
|
||||
this.url = payload.url;
|
||||
this.links = payload.links;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context || new RoomContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a RoomInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a RoomInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
update(params, callback) {
|
||||
return this._proxy.update(params, callback);
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
return this._proxy.updateWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Access the participants.
|
||||
*/
|
||||
participants() {
|
||||
return this._proxy.participants;
|
||||
}
|
||||
/**
|
||||
* Access the recordingRules.
|
||||
*/
|
||||
recordingRules() {
|
||||
return this._proxy.recordingRules;
|
||||
}
|
||||
/**
|
||||
* Access the recordings.
|
||||
*/
|
||||
recordings() {
|
||||
return this._proxy.recordings;
|
||||
}
|
||||
/**
|
||||
* Access the transcriptions.
|
||||
*/
|
||||
transcriptions() {
|
||||
return this._proxy.transcriptions;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
status: this.status,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
accountSid: this.accountSid,
|
||||
enableTurn: this.enableTurn,
|
||||
uniqueName: this.uniqueName,
|
||||
statusCallback: this.statusCallback,
|
||||
statusCallbackMethod: this.statusCallbackMethod,
|
||||
endTime: this.endTime,
|
||||
duration: this.duration,
|
||||
type: this.type,
|
||||
maxParticipants: this.maxParticipants,
|
||||
maxParticipantDuration: this.maxParticipantDuration,
|
||||
maxConcurrentPublishedTracks: this.maxConcurrentPublishedTracks,
|
||||
recordParticipantsOnConnect: this.recordParticipantsOnConnect,
|
||||
videoCodecs: this.videoCodecs,
|
||||
mediaRegion: this.mediaRegion,
|
||||
audioOnly: this.audioOnly,
|
||||
emptyRoomTimeout: this.emptyRoomTimeout,
|
||||
unusedRoomTimeout: this.unusedRoomTimeout,
|
||||
largeRoom: this.largeRoom,
|
||||
url: this.url,
|
||||
links: this.links,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RoomInstance = RoomInstance;
|
||||
function RoomListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new RoomContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Rooms`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["enableTurn"] !== undefined)
|
||||
data["EnableTurn"] = serialize.bool(params["enableTurn"]);
|
||||
if (params["type"] !== undefined)
|
||||
data["Type"] = params["type"];
|
||||
if (params["uniqueName"] !== undefined)
|
||||
data["UniqueName"] = params["uniqueName"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["maxParticipants"] !== undefined)
|
||||
data["MaxParticipants"] = params["maxParticipants"];
|
||||
if (params["recordParticipantsOnConnect"] !== undefined)
|
||||
data["RecordParticipantsOnConnect"] = serialize.bool(params["recordParticipantsOnConnect"]);
|
||||
if (params["transcribeParticipantsOnConnect"] !== undefined)
|
||||
data["TranscribeParticipantsOnConnect"] = serialize.bool(params["transcribeParticipantsOnConnect"]);
|
||||
if (params["videoCodecs"] !== undefined)
|
||||
data["VideoCodecs"] = serialize.map(params["videoCodecs"], (e) => e);
|
||||
if (params["mediaRegion"] !== undefined)
|
||||
data["MediaRegion"] = params["mediaRegion"];
|
||||
if (params["recordingRules"] !== undefined)
|
||||
data["RecordingRules"] = serialize.object(params["recordingRules"]);
|
||||
if (params["transcriptionsConfiguration"] !== undefined)
|
||||
data["TranscriptionsConfiguration"] = serialize.object(params["transcriptionsConfiguration"]);
|
||||
if (params["audioOnly"] !== undefined)
|
||||
data["AudioOnly"] = serialize.bool(params["audioOnly"]);
|
||||
if (params["maxParticipantDuration"] !== undefined)
|
||||
data["MaxParticipantDuration"] = params["maxParticipantDuration"];
|
||||
if (params["emptyRoomTimeout"] !== undefined)
|
||||
data["EmptyRoomTimeout"] = params["emptyRoomTimeout"];
|
||||
if (params["unusedRoomTimeout"] !== undefined)
|
||||
data["UnusedRoomTimeout"] = params["unusedRoomTimeout"];
|
||||
if (params["largeRoom"] !== undefined)
|
||||
data["LargeRoom"] = serialize.bool(params["largeRoom"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RoomInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["enableTurn"] !== undefined)
|
||||
data["EnableTurn"] = serialize.bool(params["enableTurn"]);
|
||||
if (params["type"] !== undefined)
|
||||
data["Type"] = params["type"];
|
||||
if (params["uniqueName"] !== undefined)
|
||||
data["UniqueName"] = params["uniqueName"];
|
||||
if (params["statusCallback"] !== undefined)
|
||||
data["StatusCallback"] = params["statusCallback"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["maxParticipants"] !== undefined)
|
||||
data["MaxParticipants"] = params["maxParticipants"];
|
||||
if (params["recordParticipantsOnConnect"] !== undefined)
|
||||
data["RecordParticipantsOnConnect"] = serialize.bool(params["recordParticipantsOnConnect"]);
|
||||
if (params["transcribeParticipantsOnConnect"] !== undefined)
|
||||
data["TranscribeParticipantsOnConnect"] = serialize.bool(params["transcribeParticipantsOnConnect"]);
|
||||
if (params["videoCodecs"] !== undefined)
|
||||
data["VideoCodecs"] = serialize.map(params["videoCodecs"], (e) => e);
|
||||
if (params["mediaRegion"] !== undefined)
|
||||
data["MediaRegion"] = params["mediaRegion"];
|
||||
if (params["recordingRules"] !== undefined)
|
||||
data["RecordingRules"] = serialize.object(params["recordingRules"]);
|
||||
if (params["transcriptionsConfiguration"] !== undefined)
|
||||
data["TranscriptionsConfiguration"] = serialize.object(params["transcriptionsConfiguration"]);
|
||||
if (params["audioOnly"] !== undefined)
|
||||
data["AudioOnly"] = serialize.bool(params["audioOnly"]);
|
||||
if (params["maxParticipantDuration"] !== undefined)
|
||||
data["MaxParticipantDuration"] = params["maxParticipantDuration"];
|
||||
if (params["emptyRoomTimeout"] !== undefined)
|
||||
data["EmptyRoomTimeout"] = params["emptyRoomTimeout"];
|
||||
if (params["unusedRoomTimeout"] !== undefined)
|
||||
data["UnusedRoomTimeout"] = params["unusedRoomTimeout"];
|
||||
if (params["largeRoom"] !== undefined)
|
||||
data["LargeRoom"] = serialize.bool(params["largeRoom"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RoomInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["uniqueName"] !== undefined)
|
||||
data["UniqueName"] = params["uniqueName"];
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RoomPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new RoomPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["uniqueName"] !== undefined)
|
||||
data["UniqueName"] = params["uniqueName"];
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new RoomPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new RoomPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class RoomPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the RoomPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of RoomInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new RoomInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RoomPage = RoomPage;
|
||||
458
node_modules/twilio/lib/rest/video/v1/room/participant.d.ts
generated
vendored
Normal file
458
node_modules/twilio/lib/rest/video/v1/room/participant.d.ts
generated
vendored
Normal file
@@ -0,0 +1,458 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V1 from "../../V1";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
import { AnonymizeListInstance } from "./participant/anonymize";
|
||||
import { PublishedTrackListInstance } from "./participant/publishedTrack";
|
||||
import { SubscribeRulesListInstance } from "./participant/subscribeRules";
|
||||
import { SubscribedTrackListInstance } from "./participant/subscribedTrack";
|
||||
/**
|
||||
* The status of the Participant. Can be: `connected` or `disconnected`.
|
||||
*/
|
||||
export type ParticipantStatus = "connected" | "disconnected" | "reconnecting";
|
||||
/**
|
||||
* Options to pass to update a ParticipantInstance
|
||||
*/
|
||||
export interface ParticipantContextUpdateOptions {
|
||||
/** */
|
||||
status?: ParticipantStatus;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface ParticipantListInstanceEachOptions {
|
||||
/** Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. */
|
||||
status?: ParticipantStatus;
|
||||
/** Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. */
|
||||
identity?: string;
|
||||
/** Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface ParticipantListInstanceOptions {
|
||||
/** Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. */
|
||||
status?: ParticipantStatus;
|
||||
/** Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. */
|
||||
identity?: string;
|
||||
/** Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface ParticipantListInstancePageOptions {
|
||||
/** Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. */
|
||||
status?: ParticipantStatus;
|
||||
/** Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. */
|
||||
identity?: string;
|
||||
/** Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface ParticipantContext {
|
||||
anonymize: AnonymizeListInstance;
|
||||
publishedTracks: PublishedTrackListInstance;
|
||||
subscribeRules: SubscribeRulesListInstance;
|
||||
subscribedTracks: SubscribedTrackListInstance;
|
||||
/**
|
||||
* Fetch a ParticipantInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise<ParticipantInstance>;
|
||||
/**
|
||||
* Fetch a ParticipantInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ParticipantInstance>) => any): Promise<ApiResponse<ParticipantInstance>>;
|
||||
/**
|
||||
* Update a ParticipantInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise<ParticipantInstance>;
|
||||
/**
|
||||
* Update a ParticipantInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance
|
||||
*/
|
||||
update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise<ParticipantInstance>;
|
||||
/**
|
||||
* Update a ParticipantInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ParticipantInstance>) => any): Promise<ApiResponse<ParticipantInstance>>;
|
||||
/**
|
||||
* Update a ParticipantInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ParticipantInstance>) => any): Promise<ApiResponse<ParticipantInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface ParticipantContextSolution {
|
||||
roomSid: string;
|
||||
sid: string;
|
||||
}
|
||||
export declare class ParticipantContextImpl implements ParticipantContext {
|
||||
protected _version: V1;
|
||||
protected _solution: ParticipantContextSolution;
|
||||
protected _uri: string;
|
||||
protected _anonymize?: AnonymizeListInstance;
|
||||
protected _publishedTracks?: PublishedTrackListInstance;
|
||||
protected _subscribeRules?: SubscribeRulesListInstance;
|
||||
protected _subscribedTracks?: SubscribedTrackListInstance;
|
||||
constructor(_version: V1, roomSid: string, sid: string);
|
||||
get anonymize(): AnonymizeListInstance;
|
||||
get publishedTracks(): PublishedTrackListInstance;
|
||||
get subscribeRules(): SubscribeRulesListInstance;
|
||||
get subscribedTracks(): SubscribedTrackListInstance;
|
||||
fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise<ParticipantInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ParticipantInstance>) => any): Promise<ApiResponse<ParticipantInstance>>;
|
||||
update(params?: ParticipantContextUpdateOptions | ((error: Error | null, item?: ParticipantInstance) => any), callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise<ParticipantInstance>;
|
||||
updateWithHttpInfo(params?: ParticipantContextUpdateOptions | ((error: Error | null, item?: ApiResponse<ParticipantInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<ParticipantInstance>) => any): Promise<ApiResponse<ParticipantInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): ParticipantContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface ParticipantPayload extends TwilioResponsePayload {
|
||||
participants: ParticipantResource[];
|
||||
}
|
||||
interface ParticipantResource {
|
||||
sid: string;
|
||||
room_sid: string;
|
||||
account_sid: string;
|
||||
status: ParticipantStatus;
|
||||
identity: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
start_time: Date;
|
||||
end_time: Date;
|
||||
duration: number;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class ParticipantInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: ParticipantContextSolution;
|
||||
protected _context?: ParticipantContext;
|
||||
constructor(_version: V1, payload: ParticipantResource, roomSid: string, sid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the RoomParticipant resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the participant\'s room.
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RoomParticipant resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
status: ParticipantStatus;
|
||||
/**
|
||||
* The application-defined string that uniquely identifies the resource\'s User within a Room. If a client joins with an existing Identity, the existing client is disconnected. See [access tokens](https://www.twilio.com/docs/video/tutorials/user-identity-access-tokens) and [limits](https://www.twilio.com/docs/video/programmable-video-limits) for more info.
|
||||
*/
|
||||
identity: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The time of participant connected to the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.
|
||||
*/
|
||||
startTime: Date;
|
||||
/**
|
||||
* The time when the participant disconnected from the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.
|
||||
*/
|
||||
endTime: Date;
|
||||
/**
|
||||
* The duration in seconds that the participant was `connected`. Populated only after the participant is `disconnected`.
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The URLs of related resources.
|
||||
*/
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a ParticipantInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise<ParticipantInstance>;
|
||||
/**
|
||||
* Fetch a ParticipantInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ParticipantInstance>) => any): Promise<ApiResponse<ParticipantInstance>>;
|
||||
/**
|
||||
* Update a ParticipantInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise<ParticipantInstance>;
|
||||
/**
|
||||
* Update a ParticipantInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance
|
||||
*/
|
||||
update(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ParticipantInstance) => any): Promise<ParticipantInstance>;
|
||||
/**
|
||||
* Update a ParticipantInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ParticipantInstance>) => any): Promise<ApiResponse<ParticipantInstance>>;
|
||||
/**
|
||||
* Update a ParticipantInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ParticipantContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ParticipantInstance>) => any): Promise<ApiResponse<ParticipantInstance>>;
|
||||
/**
|
||||
* Access the anonymize.
|
||||
*/
|
||||
anonymize(): AnonymizeListInstance;
|
||||
/**
|
||||
* Access the publishedTracks.
|
||||
*/
|
||||
publishedTracks(): PublishedTrackListInstance;
|
||||
/**
|
||||
* Access the subscribeRules.
|
||||
*/
|
||||
subscribeRules(): SubscribeRulesListInstance;
|
||||
/**
|
||||
* Access the subscribedTracks.
|
||||
*/
|
||||
subscribedTracks(): SubscribedTrackListInstance;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
roomSid: string;
|
||||
accountSid: string;
|
||||
status: ParticipantStatus;
|
||||
identity: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
duration: number;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface ParticipantSolution {
|
||||
roomSid: string;
|
||||
}
|
||||
export interface ParticipantListInstance {
|
||||
_version: V1;
|
||||
_solution: ParticipantSolution;
|
||||
_uri: string;
|
||||
(sid: string): ParticipantContext;
|
||||
get(sid: string): ParticipantContext;
|
||||
/**
|
||||
* Streams ParticipantInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { ParticipantListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams ParticipantInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { ParticipantListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of ParticipantInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: ParticipantPage) => any): Promise<ParticipantPage>;
|
||||
/**
|
||||
* Retrieve a single target page of ParticipantInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<ParticipantPage>) => any): Promise<ApiResponse<ParticipantPage>>;
|
||||
/**
|
||||
* Lists ParticipantInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { ParticipantListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise<ParticipantInstance[]>;
|
||||
list(params: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise<ParticipantInstance[]>;
|
||||
/**
|
||||
* Lists ParticipantInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { ParticipantListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ParticipantInstance[]>) => any): Promise<ApiResponse<ParticipantInstance[]>>;
|
||||
listWithHttpInfo(params: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<ParticipantInstance[]>) => any): Promise<ApiResponse<ParticipantInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of ParticipantInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { ParticipantListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: ParticipantPage) => any): Promise<ParticipantPage>;
|
||||
page(params: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ParticipantPage) => any): Promise<ParticipantPage>;
|
||||
/**
|
||||
* Retrieve a single page of ParticipantInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { ParticipantListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ParticipantPage>) => any): Promise<ApiResponse<ParticipantPage>>;
|
||||
pageWithHttpInfo(params: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<ParticipantPage>) => any): Promise<ApiResponse<ParticipantPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ParticipantListInstance(version: V1, roomSid: string): ParticipantListInstance;
|
||||
export declare class ParticipantPage extends Page<V1, ParticipantPayload, ParticipantResource, ParticipantInstance> {
|
||||
/**
|
||||
* Initialize the ParticipantPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: ParticipantSolution);
|
||||
/**
|
||||
* Build an instance of ParticipantInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: ParticipantResource): ParticipantInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
410
node_modules/twilio/lib/rest/video/v1/room/participant.js
generated
vendored
Normal file
410
node_modules/twilio/lib/rest/video/v1/room/participant.js
generated
vendored
Normal file
@@ -0,0 +1,410 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ParticipantPage = exports.ParticipantInstance = exports.ParticipantContextImpl = void 0;
|
||||
exports.ParticipantListInstance = ParticipantListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../../base/Page"));
|
||||
const deserialize = require("../../../../base/deserialize");
|
||||
const serialize = require("../../../../base/serialize");
|
||||
const utility_1 = require("../../../../base/utility");
|
||||
const anonymize_1 = require("./participant/anonymize");
|
||||
const publishedTrack_1 = require("./participant/publishedTrack");
|
||||
const subscribeRules_1 = require("./participant/subscribeRules");
|
||||
const subscribedTrack_1 = require("./participant/subscribedTrack");
|
||||
class ParticipantContextImpl {
|
||||
constructor(_version, roomSid, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { roomSid, sid };
|
||||
this._uri = `/Rooms/${roomSid}/Participants/${sid}`;
|
||||
}
|
||||
get anonymize() {
|
||||
this._anonymize =
|
||||
this._anonymize ||
|
||||
(0, anonymize_1.AnonymizeListInstance)(this._version, this._solution.roomSid, this._solution.sid);
|
||||
return this._anonymize;
|
||||
}
|
||||
get publishedTracks() {
|
||||
this._publishedTracks =
|
||||
this._publishedTracks ||
|
||||
(0, publishedTrack_1.PublishedTrackListInstance)(this._version, this._solution.roomSid, this._solution.sid);
|
||||
return this._publishedTracks;
|
||||
}
|
||||
get subscribeRules() {
|
||||
this._subscribeRules =
|
||||
this._subscribeRules ||
|
||||
(0, subscribeRules_1.SubscribeRulesListInstance)(this._version, this._solution.roomSid, this._solution.sid);
|
||||
return this._subscribeRules;
|
||||
}
|
||||
get subscribedTracks() {
|
||||
this._subscribedTracks =
|
||||
this._subscribedTracks ||
|
||||
(0, subscribedTrack_1.SubscribedTrackListInstance)(this._version, this._solution.roomSid, this._solution.sid);
|
||||
return this._subscribedTracks;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new ParticipantInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
update(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new ParticipantInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new ParticipantInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ParticipantContextImpl = ParticipantContextImpl;
|
||||
class ParticipantInstance {
|
||||
constructor(_version, payload, roomSid, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.status = payload.status;
|
||||
this.identity = payload.identity;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.startTime = deserialize.iso8601DateTime(payload.start_time);
|
||||
this.endTime = deserialize.iso8601DateTime(payload.end_time);
|
||||
this.duration = deserialize.integer(payload.duration);
|
||||
this.url = payload.url;
|
||||
this.links = payload.links;
|
||||
this._solution = { roomSid, sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new ParticipantContextImpl(this._version, this._solution.roomSid, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a ParticipantInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a ParticipantInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ParticipantInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
update(params, callback) {
|
||||
return this._proxy.update(params, callback);
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
return this._proxy.updateWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Access the anonymize.
|
||||
*/
|
||||
anonymize() {
|
||||
return this._proxy.anonymize;
|
||||
}
|
||||
/**
|
||||
* Access the publishedTracks.
|
||||
*/
|
||||
publishedTracks() {
|
||||
return this._proxy.publishedTracks;
|
||||
}
|
||||
/**
|
||||
* Access the subscribeRules.
|
||||
*/
|
||||
subscribeRules() {
|
||||
return this._proxy.subscribeRules;
|
||||
}
|
||||
/**
|
||||
* Access the subscribedTracks.
|
||||
*/
|
||||
subscribedTracks() {
|
||||
return this._proxy.subscribedTracks;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
roomSid: this.roomSid,
|
||||
accountSid: this.accountSid,
|
||||
status: this.status,
|
||||
identity: this.identity,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
startTime: this.startTime,
|
||||
endTime: this.endTime,
|
||||
duration: this.duration,
|
||||
url: this.url,
|
||||
links: this.links,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ParticipantInstance = ParticipantInstance;
|
||||
function ParticipantListInstance(version, roomSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new ParticipantContextImpl(version, roomSid, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { roomSid };
|
||||
instance._uri = `/Rooms/${roomSid}/Participants`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["identity"] !== undefined)
|
||||
data["Identity"] = params["identity"];
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new ParticipantPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new ParticipantPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["identity"] !== undefined)
|
||||
data["Identity"] = params["identity"];
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new ParticipantPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new ParticipantPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class ParticipantPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the ParticipantPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of ParticipantInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new ParticipantInstance(this._version, payload, this._solution.roomSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ParticipantPage = ParticipantPage;
|
||||
163
node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.d.ts
generated
vendored
Normal file
163
node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.d.ts
generated
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../../../V1";
|
||||
import { ApiResponse } from "../../../../../base/ApiResponse";
|
||||
/**
|
||||
* The status of the Participant. Can be: `connected` or `disconnected`.
|
||||
*/
|
||||
export type AnonymizeStatus = "connected" | "disconnected";
|
||||
export interface AnonymizeContext {
|
||||
/**
|
||||
* Update a AnonymizeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AnonymizeInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: AnonymizeInstance) => any): Promise<AnonymizeInstance>;
|
||||
/**
|
||||
* Update a AnonymizeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AnonymizeInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AnonymizeInstance>) => any): Promise<ApiResponse<AnonymizeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface AnonymizeContextSolution {
|
||||
roomSid: string;
|
||||
sid: string;
|
||||
}
|
||||
export declare class AnonymizeContextImpl implements AnonymizeContext {
|
||||
protected _version: V1;
|
||||
protected _solution: AnonymizeContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, roomSid: string, sid: string);
|
||||
update(callback?: (error: Error | null, item?: AnonymizeInstance) => any): Promise<AnonymizeInstance>;
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AnonymizeInstance>) => any): Promise<ApiResponse<AnonymizeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): AnonymizeContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface AnonymizeResource {
|
||||
sid: string;
|
||||
room_sid: string;
|
||||
account_sid: string;
|
||||
status: AnonymizeStatus;
|
||||
identity: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
start_time: Date;
|
||||
end_time: Date;
|
||||
duration: number;
|
||||
url: string;
|
||||
}
|
||||
export declare class AnonymizeInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: AnonymizeContextSolution;
|
||||
protected _context?: AnonymizeContext;
|
||||
constructor(_version: V1, payload: AnonymizeResource, roomSid: string, sid: string);
|
||||
/**
|
||||
* The unique string that we created to identify the RoomParticipant resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the participant\'s room.
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RoomParticipant resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
status: AnonymizeStatus;
|
||||
/**
|
||||
* The SID of the participant.
|
||||
*/
|
||||
identity: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The time of participant connected to the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.
|
||||
*/
|
||||
startTime: Date;
|
||||
/**
|
||||
* The time when the participant disconnected from the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.
|
||||
*/
|
||||
endTime: Date;
|
||||
/**
|
||||
* The duration in seconds that the participant was `connected`. Populated only after the participant is `disconnected`.
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Update a AnonymizeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AnonymizeInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: AnonymizeInstance) => any): Promise<AnonymizeInstance>;
|
||||
/**
|
||||
* Update a AnonymizeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AnonymizeInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AnonymizeInstance>) => any): Promise<ApiResponse<AnonymizeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
roomSid: string;
|
||||
accountSid: string;
|
||||
status: AnonymizeStatus;
|
||||
identity: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
duration: number;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface AnonymizeSolution {
|
||||
roomSid: string;
|
||||
sid: string;
|
||||
}
|
||||
export interface AnonymizeListInstance {
|
||||
_version: V1;
|
||||
_solution: AnonymizeSolution;
|
||||
_uri: string;
|
||||
(): AnonymizeContext;
|
||||
get(): AnonymizeContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function AnonymizeListInstance(version: V1, roomSid: string, sid: string): AnonymizeListInstance;
|
||||
export {};
|
||||
167
node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.js
generated
vendored
Normal file
167
node_modules/twilio/lib/rest/video/v1/room/participant/anonymize.js
generated
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AnonymizeInstance = exports.AnonymizeContextImpl = void 0;
|
||||
exports.AnonymizeListInstance = AnonymizeListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../../../base/deserialize");
|
||||
const serialize = require("../../../../../base/serialize");
|
||||
const utility_1 = require("../../../../../base/utility");
|
||||
class AnonymizeContextImpl {
|
||||
constructor(_version, roomSid, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { roomSid, sid };
|
||||
this._uri = `/Rooms/${roomSid}/Participants/${sid}/Anonymize`;
|
||||
}
|
||||
update(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new AnonymizeInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new AnonymizeInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.AnonymizeContextImpl = AnonymizeContextImpl;
|
||||
class AnonymizeInstance {
|
||||
constructor(_version, payload, roomSid, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.status = payload.status;
|
||||
this.identity = payload.identity;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.startTime = deserialize.iso8601DateTime(payload.start_time);
|
||||
this.endTime = deserialize.iso8601DateTime(payload.end_time);
|
||||
this.duration = deserialize.integer(payload.duration);
|
||||
this.url = payload.url;
|
||||
this._solution = { roomSid, sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new AnonymizeContextImpl(this._version, this._solution.roomSid, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Update a AnonymizeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AnonymizeInstance
|
||||
*/
|
||||
update(callback) {
|
||||
return this._proxy.update(callback);
|
||||
}
|
||||
/**
|
||||
* Update a AnonymizeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AnonymizeInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback) {
|
||||
return this._proxy.updateWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
roomSid: this.roomSid,
|
||||
accountSid: this.accountSid,
|
||||
status: this.status,
|
||||
identity: this.identity,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
startTime: this.startTime,
|
||||
endTime: this.endTime,
|
||||
duration: this.duration,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.AnonymizeInstance = AnonymizeInstance;
|
||||
function AnonymizeListInstance(version, roomSid, sid) {
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
const instance = (() => instance.get());
|
||||
instance.get = function get() {
|
||||
return new AnonymizeContextImpl(version, roomSid, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { roomSid, sid };
|
||||
instance._uri = ``;
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
309
node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.d.ts
generated
vendored
Normal file
309
node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.d.ts
generated
vendored
Normal file
@@ -0,0 +1,309 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../../base/Page";
|
||||
import Response from "../../../../../http/response";
|
||||
import V1 from "../../../V1";
|
||||
import { ApiResponse } from "../../../../../base/ApiResponse";
|
||||
/**
|
||||
* The track type. Can be: `audio`, `video` or `data`.
|
||||
*/
|
||||
export type PublishedTrackKind = "audio" | "video" | "data";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface PublishedTrackListInstanceEachOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: PublishedTrackInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface PublishedTrackListInstanceOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface PublishedTrackListInstancePageOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface PublishedTrackContext {
|
||||
/**
|
||||
* Fetch a PublishedTrackInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PublishedTrackInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: PublishedTrackInstance) => any): Promise<PublishedTrackInstance>;
|
||||
/**
|
||||
* Fetch a PublishedTrackInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PublishedTrackInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PublishedTrackInstance>) => any): Promise<ApiResponse<PublishedTrackInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface PublishedTrackContextSolution {
|
||||
roomSid: string;
|
||||
participantSid: string;
|
||||
sid: string;
|
||||
}
|
||||
export declare class PublishedTrackContextImpl implements PublishedTrackContext {
|
||||
protected _version: V1;
|
||||
protected _solution: PublishedTrackContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, roomSid: string, participantSid: string, sid: string);
|
||||
fetch(callback?: (error: Error | null, item?: PublishedTrackInstance) => any): Promise<PublishedTrackInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PublishedTrackInstance>) => any): Promise<ApiResponse<PublishedTrackInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): PublishedTrackContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface PublishedTrackPayload extends TwilioResponsePayload {
|
||||
published_tracks: PublishedTrackResource[];
|
||||
}
|
||||
interface PublishedTrackResource {
|
||||
sid: string;
|
||||
participant_sid: string;
|
||||
room_sid: string;
|
||||
name: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
enabled: boolean;
|
||||
kind: PublishedTrackKind;
|
||||
url: string;
|
||||
}
|
||||
export declare class PublishedTrackInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: PublishedTrackContextSolution;
|
||||
protected _context?: PublishedTrackContext;
|
||||
constructor(_version: V1, payload: PublishedTrackResource, roomSid: string, participantSid: string, sid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the RoomParticipantPublishedTrack resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the Participant resource with the published track.
|
||||
*/
|
||||
participantSid: string;
|
||||
/**
|
||||
* The SID of the Room resource where the track is published.
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* The track name. Must be no more than 128 characters, and be unique among the participant\'s published tracks.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Whether the track is enabled.
|
||||
*/
|
||||
enabled: boolean;
|
||||
kind: PublishedTrackKind;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a PublishedTrackInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PublishedTrackInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: PublishedTrackInstance) => any): Promise<PublishedTrackInstance>;
|
||||
/**
|
||||
* Fetch a PublishedTrackInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PublishedTrackInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<PublishedTrackInstance>) => any): Promise<ApiResponse<PublishedTrackInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
participantSid: string;
|
||||
roomSid: string;
|
||||
name: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
enabled: boolean;
|
||||
kind: PublishedTrackKind;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface PublishedTrackSolution {
|
||||
roomSid: string;
|
||||
participantSid: string;
|
||||
}
|
||||
export interface PublishedTrackListInstance {
|
||||
_version: V1;
|
||||
_solution: PublishedTrackSolution;
|
||||
_uri: string;
|
||||
(sid: string): PublishedTrackContext;
|
||||
get(sid: string): PublishedTrackContext;
|
||||
/**
|
||||
* Streams PublishedTrackInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { PublishedTrackListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: PublishedTrackInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: PublishedTrackListInstanceEachOptions, callback?: (item: PublishedTrackInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams PublishedTrackInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { PublishedTrackListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: PublishedTrackInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: PublishedTrackListInstanceEachOptions, callback?: (item: PublishedTrackInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of PublishedTrackInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: PublishedTrackPage) => any): Promise<PublishedTrackPage>;
|
||||
/**
|
||||
* Retrieve a single target page of PublishedTrackInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<PublishedTrackPage>) => any): Promise<ApiResponse<PublishedTrackPage>>;
|
||||
/**
|
||||
* Lists PublishedTrackInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { PublishedTrackListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: PublishedTrackInstance[]) => any): Promise<PublishedTrackInstance[]>;
|
||||
list(params: PublishedTrackListInstanceOptions, callback?: (error: Error | null, items: PublishedTrackInstance[]) => any): Promise<PublishedTrackInstance[]>;
|
||||
/**
|
||||
* Lists PublishedTrackInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { PublishedTrackListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<PublishedTrackInstance[]>) => any): Promise<ApiResponse<PublishedTrackInstance[]>>;
|
||||
listWithHttpInfo(params: PublishedTrackListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<PublishedTrackInstance[]>) => any): Promise<ApiResponse<PublishedTrackInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of PublishedTrackInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { PublishedTrackListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: PublishedTrackPage) => any): Promise<PublishedTrackPage>;
|
||||
page(params: PublishedTrackListInstancePageOptions, callback?: (error: Error | null, items: PublishedTrackPage) => any): Promise<PublishedTrackPage>;
|
||||
/**
|
||||
* Retrieve a single page of PublishedTrackInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { PublishedTrackListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<PublishedTrackPage>) => any): Promise<ApiResponse<PublishedTrackPage>>;
|
||||
pageWithHttpInfo(params: PublishedTrackListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<PublishedTrackPage>) => any): Promise<ApiResponse<PublishedTrackPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function PublishedTrackListInstance(version: V1, roomSid: string, participantSid: string): PublishedTrackListInstance;
|
||||
export declare class PublishedTrackPage extends Page<V1, PublishedTrackPayload, PublishedTrackResource, PublishedTrackInstance> {
|
||||
/**
|
||||
* Initialize the PublishedTrackPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: PublishedTrackSolution);
|
||||
/**
|
||||
* Build an instance of PublishedTrackInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: PublishedTrackResource): PublishedTrackInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
280
node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.js
generated
vendored
Normal file
280
node_modules/twilio/lib/rest/video/v1/room/participant/publishedTrack.js
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PublishedTrackPage = exports.PublishedTrackInstance = exports.PublishedTrackContextImpl = void 0;
|
||||
exports.PublishedTrackListInstance = PublishedTrackListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../../../base/Page"));
|
||||
const deserialize = require("../../../../../base/deserialize");
|
||||
const serialize = require("../../../../../base/serialize");
|
||||
const utility_1 = require("../../../../../base/utility");
|
||||
class PublishedTrackContextImpl {
|
||||
constructor(_version, roomSid, participantSid, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(participantSid)) {
|
||||
throw new Error("Parameter 'participantSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { roomSid, participantSid, sid };
|
||||
this._uri = `/Rooms/${roomSid}/Participants/${participantSid}/PublishedTracks/${sid}`;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new PublishedTrackInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new PublishedTrackInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.participantSid, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PublishedTrackContextImpl = PublishedTrackContextImpl;
|
||||
class PublishedTrackInstance {
|
||||
constructor(_version, payload, roomSid, participantSid, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.participantSid = payload.participant_sid;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.name = payload.name;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.enabled = payload.enabled;
|
||||
this.kind = payload.kind;
|
||||
this.url = payload.url;
|
||||
this._solution = { roomSid, participantSid, sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new PublishedTrackContextImpl(this._version, this._solution.roomSid, this._solution.participantSid, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a PublishedTrackInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PublishedTrackInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a PublishedTrackInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed PublishedTrackInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
participantSid: this.participantSid,
|
||||
roomSid: this.roomSid,
|
||||
name: this.name,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
enabled: this.enabled,
|
||||
kind: this.kind,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PublishedTrackInstance = PublishedTrackInstance;
|
||||
function PublishedTrackListInstance(version, roomSid, participantSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(participantSid)) {
|
||||
throw new Error("Parameter 'participantSid' is not valid.");
|
||||
}
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new PublishedTrackContextImpl(version, roomSid, participantSid, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { roomSid, participantSid };
|
||||
instance._uri = `/Rooms/${roomSid}/Participants/${participantSid}/PublishedTracks`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new PublishedTrackPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new PublishedTrackPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new PublishedTrackPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new PublishedTrackPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class PublishedTrackPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the PublishedTrackPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of PublishedTrackInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new PublishedTrackInstance(this._version, payload, this._solution.roomSid, this._solution.participantSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.PublishedTrackPage = PublishedTrackPage;
|
||||
129
node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.d.ts
generated
vendored
Normal file
129
node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.d.ts
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../../../V1";
|
||||
import { ApiResponse } from "../../../../../base/ApiResponse";
|
||||
export declare class VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules {
|
||||
"type"?: string;
|
||||
"all"?: boolean;
|
||||
"publisher"?: string;
|
||||
"track"?: string;
|
||||
"kind"?: string;
|
||||
"priority"?: string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Options to pass to update a SubscribeRulesInstance
|
||||
*/
|
||||
export interface SubscribeRulesListInstanceUpdateOptions {
|
||||
/** A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. */
|
||||
rules?: any;
|
||||
}
|
||||
export interface SubscribeRulesSolution {
|
||||
roomSid: string;
|
||||
participantSid: string;
|
||||
}
|
||||
export interface SubscribeRulesListInstance {
|
||||
_version: V1;
|
||||
_solution: SubscribeRulesSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Fetch a SubscribeRulesInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribeRulesInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SubscribeRulesInstance) => any): Promise<SubscribeRulesInstance>;
|
||||
/**
|
||||
* Fetch a SubscribeRulesInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribeRulesInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SubscribeRulesInstance>) => any): Promise<ApiResponse<SubscribeRulesInstance>>;
|
||||
/**
|
||||
* Update a SubscribeRulesInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribeRulesInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: SubscribeRulesInstance) => any): Promise<SubscribeRulesInstance>;
|
||||
/**
|
||||
* Update a SubscribeRulesInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribeRulesInstance
|
||||
*/
|
||||
update(params: SubscribeRulesListInstanceUpdateOptions, callback?: (error: Error | null, item?: SubscribeRulesInstance) => any): Promise<SubscribeRulesInstance>;
|
||||
/**
|
||||
* Update a SubscribeRulesInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribeRulesInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SubscribeRulesInstance>) => any): Promise<ApiResponse<SubscribeRulesInstance>>;
|
||||
/**
|
||||
* Update a SubscribeRulesInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribeRulesInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: SubscribeRulesListInstanceUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<SubscribeRulesInstance>) => any): Promise<ApiResponse<SubscribeRulesInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function SubscribeRulesListInstance(version: V1, roomSid: string, participantSid: string): SubscribeRulesListInstance;
|
||||
interface SubscribeRulesResource {
|
||||
participant_sid: string;
|
||||
room_sid: string;
|
||||
rules: Array<VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules>;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
}
|
||||
export declare class SubscribeRulesInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: SubscribeRulesResource, roomSid: string, participantSid: string);
|
||||
/**
|
||||
* The SID of the Participant resource for the Subscribe Rules.
|
||||
*/
|
||||
participantSid: string;
|
||||
/**
|
||||
* The SID of the Room resource for the Subscribe Rules
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* A collection of Subscribe Rules that describe how to include or exclude matching tracks. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information.
|
||||
*/
|
||||
rules: Array<VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules>;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
participantSid: string;
|
||||
roomSid: string;
|
||||
rules: VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules[];
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
166
node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.js
generated
vendored
Normal file
166
node_modules/twilio/lib/rest/video/v1/room/participant/subscribeRules.js
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SubscribeRulesInstance = exports.VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules = void 0;
|
||||
exports.SubscribeRulesListInstance = SubscribeRulesListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../../../base/deserialize");
|
||||
const serialize = require("../../../../../base/serialize");
|
||||
const utility_1 = require("../../../../../base/utility");
|
||||
class VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules {
|
||||
constructor(payload) {
|
||||
this.type = payload["type"];
|
||||
this.all = payload["all"];
|
||||
this.publisher = payload["publisher"];
|
||||
this.track = payload["track"];
|
||||
this.kind = payload["kind"];
|
||||
this.priority = payload["priority"];
|
||||
}
|
||||
}
|
||||
exports.VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules = VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules;
|
||||
function SubscribeRulesListInstance(version, roomSid, participantSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(participantSid)) {
|
||||
throw new Error("Parameter 'participantSid' is not valid.");
|
||||
}
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = { roomSid, participantSid };
|
||||
instance._uri = `/Rooms/${roomSid}/Participants/${participantSid}/SubscribeRules`;
|
||||
instance.fetch = function fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new SubscribeRulesInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.fetchWithHttpInfo = function fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new SubscribeRulesInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.participantSid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.update = function update(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["rules"] !== undefined)
|
||||
data["Rules"] = serialize.object(params["rules"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new SubscribeRulesInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.updateWithHttpInfo = function updateWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["rules"] !== undefined)
|
||||
data["Rules"] = serialize.object(params["rules"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new SubscribeRulesInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.participantSid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class SubscribeRulesInstance {
|
||||
constructor(_version, payload, roomSid, participantSid) {
|
||||
this._version = _version;
|
||||
this.participantSid = payload.participant_sid;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.rules =
|
||||
payload.rules !== null && payload.rules !== undefined
|
||||
? payload.rules.map((payload) => new VideoV1RoomRoomParticipantRoomParticipantSubscribeRuleRules(payload))
|
||||
: null;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
participantSid: this.participantSid,
|
||||
roomSid: this.roomSid,
|
||||
rules: this.rules,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SubscribeRulesInstance = SubscribeRulesInstance;
|
||||
315
node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.d.ts
generated
vendored
Normal file
315
node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.d.ts
generated
vendored
Normal file
@@ -0,0 +1,315 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../../base/Page";
|
||||
import Response from "../../../../../http/response";
|
||||
import V1 from "../../../V1";
|
||||
import { ApiResponse } from "../../../../../base/ApiResponse";
|
||||
/**
|
||||
* The track type. Can be: `audio`, `video` or `data`.
|
||||
*/
|
||||
export type SubscribedTrackKind = "audio" | "video" | "data";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface SubscribedTrackListInstanceEachOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: SubscribedTrackInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface SubscribedTrackListInstanceOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface SubscribedTrackListInstancePageOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface SubscribedTrackContext {
|
||||
/**
|
||||
* Fetch a SubscribedTrackInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribedTrackInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SubscribedTrackInstance) => any): Promise<SubscribedTrackInstance>;
|
||||
/**
|
||||
* Fetch a SubscribedTrackInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribedTrackInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SubscribedTrackInstance>) => any): Promise<ApiResponse<SubscribedTrackInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface SubscribedTrackContextSolution {
|
||||
roomSid: string;
|
||||
participantSid: string;
|
||||
sid: string;
|
||||
}
|
||||
export declare class SubscribedTrackContextImpl implements SubscribedTrackContext {
|
||||
protected _version: V1;
|
||||
protected _solution: SubscribedTrackContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, roomSid: string, participantSid: string, sid: string);
|
||||
fetch(callback?: (error: Error | null, item?: SubscribedTrackInstance) => any): Promise<SubscribedTrackInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SubscribedTrackInstance>) => any): Promise<ApiResponse<SubscribedTrackInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): SubscribedTrackContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface SubscribedTrackPayload extends TwilioResponsePayload {
|
||||
subscribed_tracks: SubscribedTrackResource[];
|
||||
}
|
||||
interface SubscribedTrackResource {
|
||||
sid: string;
|
||||
participant_sid: string;
|
||||
publisher_sid: string;
|
||||
room_sid: string;
|
||||
name: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
enabled: boolean;
|
||||
kind: SubscribedTrackKind;
|
||||
url: string;
|
||||
}
|
||||
export declare class SubscribedTrackInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: SubscribedTrackContextSolution;
|
||||
protected _context?: SubscribedTrackContext;
|
||||
constructor(_version: V1, payload: SubscribedTrackResource, roomSid: string, participantSid: string, sid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the RoomParticipantSubscribedTrack resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the participant that subscribes to the track.
|
||||
*/
|
||||
participantSid: string;
|
||||
/**
|
||||
* The SID of the participant that publishes the track.
|
||||
*/
|
||||
publisherSid: string;
|
||||
/**
|
||||
* The SID of the room where the track is published.
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* The track name. Must have no more than 128 characters and be unique among the participant\'s published tracks.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Whether the track is enabled.
|
||||
*/
|
||||
enabled: boolean;
|
||||
kind: SubscribedTrackKind;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a SubscribedTrackInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribedTrackInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SubscribedTrackInstance) => any): Promise<SubscribedTrackInstance>;
|
||||
/**
|
||||
* Fetch a SubscribedTrackInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribedTrackInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SubscribedTrackInstance>) => any): Promise<ApiResponse<SubscribedTrackInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
participantSid: string;
|
||||
publisherSid: string;
|
||||
roomSid: string;
|
||||
name: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
enabled: boolean;
|
||||
kind: SubscribedTrackKind;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface SubscribedTrackSolution {
|
||||
roomSid: string;
|
||||
participantSid: string;
|
||||
}
|
||||
export interface SubscribedTrackListInstance {
|
||||
_version: V1;
|
||||
_solution: SubscribedTrackSolution;
|
||||
_uri: string;
|
||||
(sid: string): SubscribedTrackContext;
|
||||
get(sid: string): SubscribedTrackContext;
|
||||
/**
|
||||
* Streams SubscribedTrackInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { SubscribedTrackListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: SubscribedTrackInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: SubscribedTrackListInstanceEachOptions, callback?: (item: SubscribedTrackInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams SubscribedTrackInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { SubscribedTrackListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: SubscribedTrackInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: SubscribedTrackListInstanceEachOptions, callback?: (item: SubscribedTrackInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of SubscribedTrackInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: SubscribedTrackPage) => any): Promise<SubscribedTrackPage>;
|
||||
/**
|
||||
* Retrieve a single target page of SubscribedTrackInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<SubscribedTrackPage>) => any): Promise<ApiResponse<SubscribedTrackPage>>;
|
||||
/**
|
||||
* Lists SubscribedTrackInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { SubscribedTrackListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: SubscribedTrackInstance[]) => any): Promise<SubscribedTrackInstance[]>;
|
||||
list(params: SubscribedTrackListInstanceOptions, callback?: (error: Error | null, items: SubscribedTrackInstance[]) => any): Promise<SubscribedTrackInstance[]>;
|
||||
/**
|
||||
* Lists SubscribedTrackInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { SubscribedTrackListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SubscribedTrackInstance[]>) => any): Promise<ApiResponse<SubscribedTrackInstance[]>>;
|
||||
listWithHttpInfo(params: SubscribedTrackListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<SubscribedTrackInstance[]>) => any): Promise<ApiResponse<SubscribedTrackInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of SubscribedTrackInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { SubscribedTrackListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: SubscribedTrackPage) => any): Promise<SubscribedTrackPage>;
|
||||
page(params: SubscribedTrackListInstancePageOptions, callback?: (error: Error | null, items: SubscribedTrackPage) => any): Promise<SubscribedTrackPage>;
|
||||
/**
|
||||
* Retrieve a single page of SubscribedTrackInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { SubscribedTrackListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SubscribedTrackPage>) => any): Promise<ApiResponse<SubscribedTrackPage>>;
|
||||
pageWithHttpInfo(params: SubscribedTrackListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<SubscribedTrackPage>) => any): Promise<ApiResponse<SubscribedTrackPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function SubscribedTrackListInstance(version: V1, roomSid: string, participantSid: string): SubscribedTrackListInstance;
|
||||
export declare class SubscribedTrackPage extends Page<V1, SubscribedTrackPayload, SubscribedTrackResource, SubscribedTrackInstance> {
|
||||
/**
|
||||
* Initialize the SubscribedTrackPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: SubscribedTrackSolution);
|
||||
/**
|
||||
* Build an instance of SubscribedTrackInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: SubscribedTrackResource): SubscribedTrackInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
282
node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.js
generated
vendored
Normal file
282
node_modules/twilio/lib/rest/video/v1/room/participant/subscribedTrack.js
generated
vendored
Normal file
@@ -0,0 +1,282 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SubscribedTrackPage = exports.SubscribedTrackInstance = exports.SubscribedTrackContextImpl = void 0;
|
||||
exports.SubscribedTrackListInstance = SubscribedTrackListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../../../base/Page"));
|
||||
const deserialize = require("../../../../../base/deserialize");
|
||||
const serialize = require("../../../../../base/serialize");
|
||||
const utility_1 = require("../../../../../base/utility");
|
||||
class SubscribedTrackContextImpl {
|
||||
constructor(_version, roomSid, participantSid, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(participantSid)) {
|
||||
throw new Error("Parameter 'participantSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { roomSid, participantSid, sid };
|
||||
this._uri = `/Rooms/${roomSid}/Participants/${participantSid}/SubscribedTracks/${sid}`;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new SubscribedTrackInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.participantSid, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new SubscribedTrackInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.participantSid, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SubscribedTrackContextImpl = SubscribedTrackContextImpl;
|
||||
class SubscribedTrackInstance {
|
||||
constructor(_version, payload, roomSid, participantSid, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.participantSid = payload.participant_sid;
|
||||
this.publisherSid = payload.publisher_sid;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.name = payload.name;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.enabled = payload.enabled;
|
||||
this.kind = payload.kind;
|
||||
this.url = payload.url;
|
||||
this._solution = { roomSid, participantSid, sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new SubscribedTrackContextImpl(this._version, this._solution.roomSid, this._solution.participantSid, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a SubscribedTrackInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribedTrackInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a SubscribedTrackInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SubscribedTrackInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
participantSid: this.participantSid,
|
||||
publisherSid: this.publisherSid,
|
||||
roomSid: this.roomSid,
|
||||
name: this.name,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
enabled: this.enabled,
|
||||
kind: this.kind,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SubscribedTrackInstance = SubscribedTrackInstance;
|
||||
function SubscribedTrackListInstance(version, roomSid, participantSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(participantSid)) {
|
||||
throw new Error("Parameter 'participantSid' is not valid.");
|
||||
}
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new SubscribedTrackContextImpl(version, roomSid, participantSid, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { roomSid, participantSid };
|
||||
instance._uri = `/Rooms/${roomSid}/Participants/${participantSid}/SubscribedTracks`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new SubscribedTrackPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new SubscribedTrackPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new SubscribedTrackPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new SubscribedTrackPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class SubscribedTrackPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the SubscribedTrackPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of SubscribedTrackInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new SubscribedTrackInstance(this._version, payload, this._solution.roomSid, this._solution.participantSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SubscribedTrackPage = SubscribedTrackPage;
|
||||
121
node_modules/twilio/lib/rest/video/v1/room/recordingRules.d.ts
generated
vendored
Normal file
121
node_modules/twilio/lib/rest/video/v1/room/recordingRules.d.ts
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../../V1";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
export declare class VideoV1RoomRoomRecordingRuleRules {
|
||||
"type"?: string;
|
||||
"all"?: boolean;
|
||||
"publisher"?: string;
|
||||
"track"?: string;
|
||||
"kind"?: string;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Options to pass to update a RecordingRulesInstance
|
||||
*/
|
||||
export interface RecordingRulesListInstanceUpdateOptions {
|
||||
/** A JSON-encoded array of recording rules. */
|
||||
rules?: any;
|
||||
}
|
||||
export interface RecordingRulesSolution {
|
||||
roomSid: string;
|
||||
}
|
||||
export interface RecordingRulesListInstance {
|
||||
_version: V1;
|
||||
_solution: RecordingRulesSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Fetch a RecordingRulesInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingRulesInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RecordingRulesInstance) => any): Promise<RecordingRulesInstance>;
|
||||
/**
|
||||
* Fetch a RecordingRulesInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingRulesInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RecordingRulesInstance>) => any): Promise<ApiResponse<RecordingRulesInstance>>;
|
||||
/**
|
||||
* Update a RecordingRulesInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingRulesInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: RecordingRulesInstance) => any): Promise<RecordingRulesInstance>;
|
||||
/**
|
||||
* Update a RecordingRulesInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingRulesInstance
|
||||
*/
|
||||
update(params: RecordingRulesListInstanceUpdateOptions, callback?: (error: Error | null, item?: RecordingRulesInstance) => any): Promise<RecordingRulesInstance>;
|
||||
/**
|
||||
* Update a RecordingRulesInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingRulesInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RecordingRulesInstance>) => any): Promise<ApiResponse<RecordingRulesInstance>>;
|
||||
/**
|
||||
* Update a RecordingRulesInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RecordingRulesInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: RecordingRulesListInstanceUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<RecordingRulesInstance>) => any): Promise<ApiResponse<RecordingRulesInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function RecordingRulesListInstance(version: V1, roomSid: string): RecordingRulesListInstance;
|
||||
interface RecordingRulesResource {
|
||||
room_sid: string;
|
||||
rules: Array<VideoV1RoomRoomRecordingRuleRules>;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
}
|
||||
export declare class RecordingRulesInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: RecordingRulesResource, roomSid: string);
|
||||
/**
|
||||
* The SID of the Room resource for the Recording Rules
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* A collection of Recording Rules that describe how to include or exclude matching tracks for recording
|
||||
*/
|
||||
rules: Array<VideoV1RoomRoomRecordingRuleRules>;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
roomSid: string;
|
||||
rules: VideoV1RoomRoomRecordingRuleRules[];
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
160
node_modules/twilio/lib/rest/video/v1/room/recordingRules.js
generated
vendored
Normal file
160
node_modules/twilio/lib/rest/video/v1/room/recordingRules.js
generated
vendored
Normal file
@@ -0,0 +1,160 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RecordingRulesInstance = exports.VideoV1RoomRoomRecordingRuleRules = void 0;
|
||||
exports.RecordingRulesListInstance = RecordingRulesListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../../base/deserialize");
|
||||
const serialize = require("../../../../base/serialize");
|
||||
const utility_1 = require("../../../../base/utility");
|
||||
class VideoV1RoomRoomRecordingRuleRules {
|
||||
constructor(payload) {
|
||||
this.type = payload["type"];
|
||||
this.all = payload["all"];
|
||||
this.publisher = payload["publisher"];
|
||||
this.track = payload["track"];
|
||||
this.kind = payload["kind"];
|
||||
}
|
||||
}
|
||||
exports.VideoV1RoomRoomRecordingRuleRules = VideoV1RoomRoomRecordingRuleRules;
|
||||
function RecordingRulesListInstance(version, roomSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = { roomSid };
|
||||
instance._uri = `/Rooms/${roomSid}/RecordingRules`;
|
||||
instance.fetch = function fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RecordingRulesInstance(operationVersion, payload, instance._solution.roomSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.fetchWithHttpInfo = function fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RecordingRulesInstance(operationVersion, response.body, instance._solution.roomSid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.update = function update(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["rules"] !== undefined)
|
||||
data["Rules"] = serialize.object(params["rules"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RecordingRulesInstance(operationVersion, payload, instance._solution.roomSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.updateWithHttpInfo = function updateWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["rules"] !== undefined)
|
||||
data["Rules"] = serialize.object(params["rules"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RecordingRulesInstance(operationVersion, response.body, instance._solution.roomSid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class RecordingRulesInstance {
|
||||
constructor(_version, payload, roomSid) {
|
||||
this._version = _version;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.rules =
|
||||
payload.rules !== null && payload.rules !== undefined
|
||||
? payload.rules.map((payload) => new VideoV1RoomRoomRecordingRuleRules(payload))
|
||||
: null;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
roomSid: this.roomSid,
|
||||
rules: this.rules,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RecordingRulesInstance = RecordingRulesInstance;
|
||||
413
node_modules/twilio/lib/rest/video/v1/room/roomRecording.d.ts
generated
vendored
Normal file
413
node_modules/twilio/lib/rest/video/v1/room/roomRecording.d.ts
generated
vendored
Normal file
@@ -0,0 +1,413 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V1 from "../../V1";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* The codec used for the recording. Can be: `VP8` or `H264`.
|
||||
*/
|
||||
export type RoomRecordingCodec = "VP8" | "H264" | "OPUS" | "PCMU";
|
||||
export type RoomRecordingFormat = "mka" | "mkv";
|
||||
/**
|
||||
* The status of the recording. Can be: `processing`, `completed`, or `deleted`. `processing` indicates the Recording is still being captured. `completed` indicates the Recording has been captured and is now available for download. `deleted` means the recording media has been deleted from the system, but its metadata is still available for historical purposes.
|
||||
*/
|
||||
export type RoomRecordingStatus = "processing" | "completed" | "deleted" | "failed";
|
||||
/**
|
||||
* The recording\'s media type. Can be: `audio` or `video`.
|
||||
*/
|
||||
export type RoomRecordingType = "audio" | "video" | "data";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface RoomRecordingListInstanceEachOptions {
|
||||
/** Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. */
|
||||
status?: RoomRecordingStatus;
|
||||
/** Read only the recordings that have this `source_sid`. */
|
||||
sourceSid?: string;
|
||||
/** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: RoomRecordingInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface RoomRecordingListInstanceOptions {
|
||||
/** Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. */
|
||||
status?: RoomRecordingStatus;
|
||||
/** Read only the recordings that have this `source_sid`. */
|
||||
sourceSid?: string;
|
||||
/** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface RoomRecordingListInstancePageOptions {
|
||||
/** Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. */
|
||||
status?: RoomRecordingStatus;
|
||||
/** Read only the recordings that have this `source_sid`. */
|
||||
sourceSid?: string;
|
||||
/** Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedAfter?: Date;
|
||||
/** Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */
|
||||
dateCreatedBefore?: Date;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface RoomRecordingContext {
|
||||
/**
|
||||
* Remove a RoomRecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a RoomRecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a RoomRecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomRecordingInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RoomRecordingInstance) => any): Promise<RoomRecordingInstance>;
|
||||
/**
|
||||
* Fetch a RoomRecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomRecordingInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RoomRecordingInstance>) => any): Promise<ApiResponse<RoomRecordingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface RoomRecordingContextSolution {
|
||||
roomSid: string;
|
||||
sid: string;
|
||||
}
|
||||
export declare class RoomRecordingContextImpl implements RoomRecordingContext {
|
||||
protected _version: V1;
|
||||
protected _solution: RoomRecordingContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, roomSid: string, sid: string);
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
fetch(callback?: (error: Error | null, item?: RoomRecordingInstance) => any): Promise<RoomRecordingInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RoomRecordingInstance>) => any): Promise<ApiResponse<RoomRecordingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): RoomRecordingContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface RoomRecordingPayload extends TwilioResponsePayload {
|
||||
recordings: RoomRecordingResource[];
|
||||
}
|
||||
interface RoomRecordingResource {
|
||||
account_sid: string;
|
||||
status: RoomRecordingStatus;
|
||||
date_created: Date;
|
||||
sid: string;
|
||||
source_sid: string;
|
||||
size: number;
|
||||
url: string;
|
||||
type: RoomRecordingType;
|
||||
duration: number;
|
||||
container_format: RoomRecordingFormat;
|
||||
codec: RoomRecordingCodec;
|
||||
grouping_sids: any;
|
||||
track_name: string;
|
||||
offset: number;
|
||||
media_external_location: string;
|
||||
room_sid: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class RoomRecordingInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: RoomRecordingContextSolution;
|
||||
protected _context?: RoomRecordingContext;
|
||||
constructor(_version: V1, payload: RoomRecordingResource, roomSid: string, sid?: string);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RoomRecording resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
status: RoomRecordingStatus;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The unique string that we created to identify the RoomRecording resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The SID of the recording source. For a Room Recording, this value is a `track_sid`.
|
||||
*/
|
||||
sourceSid: string;
|
||||
/**
|
||||
* The size of the recorded track in bytes.
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
type: RoomRecordingType;
|
||||
/**
|
||||
* The duration of the recording rounded to the nearest second. Sub-second duration tracks have a `duration` of 1 second
|
||||
*/
|
||||
duration: number;
|
||||
containerFormat: RoomRecordingFormat;
|
||||
codec: RoomRecordingCodec;
|
||||
/**
|
||||
* A list of SIDs related to the Recording. Includes the `room_sid` and `participant_sid`.
|
||||
*/
|
||||
groupingSids: any;
|
||||
/**
|
||||
* The name that was given to the source track of the recording. If no name is given, the `source_sid` is used.
|
||||
*/
|
||||
trackName: string;
|
||||
/**
|
||||
* The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started. This information provides a synchronization mechanism for recordings belonging to the same room.
|
||||
*/
|
||||
offset: number;
|
||||
/**
|
||||
* The URL of the media file associated with the recording when stored externally. See [External S3 Recordings](/docs/video/api/external-s3-recordings) for more details.
|
||||
*/
|
||||
mediaExternalLocation: string;
|
||||
/**
|
||||
* The SID of the Room resource the recording is associated with.
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* The URLs of related resources.
|
||||
*/
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a RoomRecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a RoomRecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a RoomRecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomRecordingInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: RoomRecordingInstance) => any): Promise<RoomRecordingInstance>;
|
||||
/**
|
||||
* Fetch a RoomRecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomRecordingInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<RoomRecordingInstance>) => any): Promise<ApiResponse<RoomRecordingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
status: RoomRecordingStatus;
|
||||
dateCreated: Date;
|
||||
sid: string;
|
||||
sourceSid: string;
|
||||
size: number;
|
||||
url: string;
|
||||
type: RoomRecordingType;
|
||||
duration: number;
|
||||
containerFormat: RoomRecordingFormat;
|
||||
codec: RoomRecordingCodec;
|
||||
groupingSids: any;
|
||||
trackName: string;
|
||||
offset: number;
|
||||
mediaExternalLocation: string;
|
||||
roomSid: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface RoomRecordingSolution {
|
||||
roomSid: string;
|
||||
}
|
||||
export interface RoomRecordingListInstance {
|
||||
_version: V1;
|
||||
_solution: RoomRecordingSolution;
|
||||
_uri: string;
|
||||
(sid: string): RoomRecordingContext;
|
||||
get(sid: string): RoomRecordingContext;
|
||||
/**
|
||||
* Streams RoomRecordingInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomRecordingListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: RoomRecordingInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: RoomRecordingListInstanceEachOptions, callback?: (item: RoomRecordingInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams RoomRecordingInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomRecordingListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: RoomRecordingInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: RoomRecordingListInstanceEachOptions, callback?: (item: RoomRecordingInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of RoomRecordingInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: RoomRecordingPage) => any): Promise<RoomRecordingPage>;
|
||||
/**
|
||||
* Retrieve a single target page of RoomRecordingInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<RoomRecordingPage>) => any): Promise<ApiResponse<RoomRecordingPage>>;
|
||||
/**
|
||||
* Lists RoomRecordingInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomRecordingListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: RoomRecordingInstance[]) => any): Promise<RoomRecordingInstance[]>;
|
||||
list(params: RoomRecordingListInstanceOptions, callback?: (error: Error | null, items: RoomRecordingInstance[]) => any): Promise<RoomRecordingInstance[]>;
|
||||
/**
|
||||
* Lists RoomRecordingInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomRecordingListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RoomRecordingInstance[]>) => any): Promise<ApiResponse<RoomRecordingInstance[]>>;
|
||||
listWithHttpInfo(params: RoomRecordingListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<RoomRecordingInstance[]>) => any): Promise<ApiResponse<RoomRecordingInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of RoomRecordingInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomRecordingListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: RoomRecordingPage) => any): Promise<RoomRecordingPage>;
|
||||
page(params: RoomRecordingListInstancePageOptions, callback?: (error: Error | null, items: RoomRecordingPage) => any): Promise<RoomRecordingPage>;
|
||||
/**
|
||||
* Retrieve a single page of RoomRecordingInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { RoomRecordingListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RoomRecordingPage>) => any): Promise<ApiResponse<RoomRecordingPage>>;
|
||||
pageWithHttpInfo(params: RoomRecordingListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<RoomRecordingPage>) => any): Promise<ApiResponse<RoomRecordingPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function RoomRecordingListInstance(version: V1, roomSid: string): RoomRecordingListInstance;
|
||||
export declare class RoomRecordingPage extends Page<V1, RoomRecordingPayload, RoomRecordingResource, RoomRecordingInstance> {
|
||||
/**
|
||||
* Initialize the RoomRecordingPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: RoomRecordingSolution);
|
||||
/**
|
||||
* Build an instance of RoomRecordingInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: RoomRecordingResource): RoomRecordingInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
351
node_modules/twilio/lib/rest/video/v1/room/roomRecording.js
generated
vendored
Normal file
351
node_modules/twilio/lib/rest/video/v1/room/roomRecording.js
generated
vendored
Normal file
@@ -0,0 +1,351 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RoomRecordingPage = exports.RoomRecordingInstance = exports.RoomRecordingContextImpl = void 0;
|
||||
exports.RoomRecordingListInstance = RoomRecordingListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../../base/Page"));
|
||||
const deserialize = require("../../../../base/deserialize");
|
||||
const serialize = require("../../../../base/serialize");
|
||||
const utility_1 = require("../../../../base/utility");
|
||||
class RoomRecordingContextImpl {
|
||||
constructor(_version, roomSid, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { roomSid, sid };
|
||||
this._uri = `/Rooms/${roomSid}/Recordings/${sid}`;
|
||||
}
|
||||
remove(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
||||
uri: instance._uri,
|
||||
method: "delete",
|
||||
headers,
|
||||
});
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
removeWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// DELETE operation - returns boolean based on status code
|
||||
let operationPromise = operationVersion
|
||||
.removeWithResponseInfo({ uri: instance._uri, method: "delete", headers })
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: response.statusCode === 204,
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RoomRecordingInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new RoomRecordingInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RoomRecordingContextImpl = RoomRecordingContextImpl;
|
||||
class RoomRecordingInstance {
|
||||
constructor(_version, payload, roomSid, sid) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.status = payload.status;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.sid = payload.sid;
|
||||
this.sourceSid = payload.source_sid;
|
||||
this.size = payload.size;
|
||||
this.url = payload.url;
|
||||
this.type = payload.type;
|
||||
this.duration = deserialize.integer(payload.duration);
|
||||
this.containerFormat = payload.container_format;
|
||||
this.codec = payload.codec;
|
||||
this.groupingSids = payload.grouping_sids;
|
||||
this.trackName = payload.track_name;
|
||||
this.offset = payload.offset;
|
||||
this.mediaExternalLocation = payload.media_external_location;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.links = payload.links;
|
||||
this._solution = { roomSid, sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new RoomRecordingContextImpl(this._version, this._solution.roomSid, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a RoomRecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a RoomRecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback) {
|
||||
return this._proxy.removeWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a RoomRecordingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomRecordingInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a RoomRecordingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed RoomRecordingInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accountSid: this.accountSid,
|
||||
status: this.status,
|
||||
dateCreated: this.dateCreated,
|
||||
sid: this.sid,
|
||||
sourceSid: this.sourceSid,
|
||||
size: this.size,
|
||||
url: this.url,
|
||||
type: this.type,
|
||||
duration: this.duration,
|
||||
containerFormat: this.containerFormat,
|
||||
codec: this.codec,
|
||||
groupingSids: this.groupingSids,
|
||||
trackName: this.trackName,
|
||||
offset: this.offset,
|
||||
mediaExternalLocation: this.mediaExternalLocation,
|
||||
roomSid: this.roomSid,
|
||||
links: this.links,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RoomRecordingInstance = RoomRecordingInstance;
|
||||
function RoomRecordingListInstance(version, roomSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new RoomRecordingContextImpl(version, roomSid, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { roomSid };
|
||||
instance._uri = `/Rooms/${roomSid}/Recordings`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["sourceSid"] !== undefined)
|
||||
data["SourceSid"] = params["sourceSid"];
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new RoomRecordingPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new RoomRecordingPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["sourceSid"] !== undefined)
|
||||
data["SourceSid"] = params["sourceSid"];
|
||||
if (params["dateCreatedAfter"] !== undefined)
|
||||
data["DateCreatedAfter"] = serialize.iso8601DateTime(params["dateCreatedAfter"]);
|
||||
if (params["dateCreatedBefore"] !== undefined)
|
||||
data["DateCreatedBefore"] = serialize.iso8601DateTime(params["dateCreatedBefore"]);
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new RoomRecordingPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new RoomRecordingPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class RoomRecordingPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the RoomRecordingPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of RoomRecordingInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new RoomRecordingInstance(this._version, payload, this._solution.roomSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.RoomRecordingPage = RoomRecordingPage;
|
||||
445
node_modules/twilio/lib/rest/video/v1/room/transcriptions.d.ts
generated
vendored
Normal file
445
node_modules/twilio/lib/rest/video/v1/room/transcriptions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,445 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
||||
import Response from "../../../../http/response";
|
||||
import V1 from "../../V1";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* The status of the transcriptions resource.
|
||||
*/
|
||||
export type TranscriptionsStatus = "started" | "stopped" | "failed";
|
||||
/**
|
||||
* Options to pass to update a TranscriptionsInstance
|
||||
*/
|
||||
export interface TranscriptionsContextUpdateOptions {
|
||||
/** */
|
||||
status?: TranscriptionsStatus;
|
||||
/** A collection of properties that describe transcription behaviour. */
|
||||
configuration?: object;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a TranscriptionsInstance
|
||||
*/
|
||||
export interface TranscriptionsListInstanceCreateOptions {
|
||||
/** A collection of properties that describe transcription behaviour. */
|
||||
configuration?: object;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface TranscriptionsListInstanceEachOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: TranscriptionsInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface TranscriptionsListInstanceOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface TranscriptionsListInstancePageOptions {
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface TranscriptionsContext {
|
||||
/**
|
||||
* Fetch a TranscriptionsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
/**
|
||||
* Fetch a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Update a TranscriptionsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
/**
|
||||
* Update a TranscriptionsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
update(params: TranscriptionsContextUpdateOptions, callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
/**
|
||||
* Update a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Update a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: TranscriptionsContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface TranscriptionsContextSolution {
|
||||
roomSid: string;
|
||||
ttid: string;
|
||||
}
|
||||
export declare class TranscriptionsContextImpl implements TranscriptionsContext {
|
||||
protected _version: V1;
|
||||
protected _solution: TranscriptionsContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, roomSid: string, ttid: string);
|
||||
fetch(callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
update(params?: TranscriptionsContextUpdateOptions | ((error: Error | null, item?: TranscriptionsInstance) => any), callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
updateWithHttpInfo(params?: TranscriptionsContextUpdateOptions | ((error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): TranscriptionsContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface TranscriptionsPayload extends TwilioResponsePayload {
|
||||
transcriptions: TranscriptionsResource[];
|
||||
}
|
||||
interface TranscriptionsResource {
|
||||
ttid: string;
|
||||
account_sid: string;
|
||||
room_sid: string;
|
||||
source_sid: string;
|
||||
status: TranscriptionsStatus;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
start_time: Date;
|
||||
end_time: Date;
|
||||
duration: number;
|
||||
url: string;
|
||||
configuration: Record<string, object>;
|
||||
}
|
||||
export declare class TranscriptionsInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: TranscriptionsContextSolution;
|
||||
protected _context?: TranscriptionsContext;
|
||||
constructor(_version: V1, payload: TranscriptionsResource, roomSid: string, ttid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the transcriptions resource.
|
||||
*/
|
||||
ttid: string;
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Room resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The SID of the transcriptions\'s room.
|
||||
*/
|
||||
roomSid: string;
|
||||
/**
|
||||
* The SID of the transcriptions\'s associated call.
|
||||
*/
|
||||
sourceSid: string;
|
||||
status: TranscriptionsStatus;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The time of transcriptions connected to the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.
|
||||
*/
|
||||
startTime: Date;
|
||||
/**
|
||||
* The time when the transcriptions disconnected from the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.
|
||||
*/
|
||||
endTime: Date;
|
||||
/**
|
||||
* The duration in seconds that the transcriptions were `connected`. Populated only after the transcriptions is `stopped`.
|
||||
*/
|
||||
duration: number;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* An JSON object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
|
||||
*/
|
||||
configuration: Record<string, object>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a TranscriptionsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
/**
|
||||
* Fetch a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Update a TranscriptionsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
/**
|
||||
* Update a TranscriptionsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
update(params: TranscriptionsContextUpdateOptions, callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
/**
|
||||
* Update a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Update a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: TranscriptionsContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
ttid: string;
|
||||
accountSid: string;
|
||||
roomSid: string;
|
||||
sourceSid: string;
|
||||
status: TranscriptionsStatus;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
duration: number;
|
||||
url: string;
|
||||
configuration: Record<string, object>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface TranscriptionsSolution {
|
||||
roomSid: string;
|
||||
}
|
||||
export interface TranscriptionsListInstance {
|
||||
_version: V1;
|
||||
_solution: TranscriptionsSolution;
|
||||
_uri: string;
|
||||
(ttid: string): TranscriptionsContext;
|
||||
get(ttid: string): TranscriptionsContext;
|
||||
/**
|
||||
* Create a TranscriptionsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
/**
|
||||
* Create a TranscriptionsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
create(params: TranscriptionsListInstanceCreateOptions, callback?: (error: Error | null, item?: TranscriptionsInstance) => any): Promise<TranscriptionsInstance>;
|
||||
/**
|
||||
* Create a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Create a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: TranscriptionsListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<TranscriptionsInstance>) => any): Promise<ApiResponse<TranscriptionsInstance>>;
|
||||
/**
|
||||
* Streams TranscriptionsInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { TranscriptionsListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: TranscriptionsInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: TranscriptionsListInstanceEachOptions, callback?: (item: TranscriptionsInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams TranscriptionsInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { TranscriptionsListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: TranscriptionsInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: TranscriptionsListInstanceEachOptions, callback?: (item: TranscriptionsInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of TranscriptionsInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: TranscriptionsPage) => any): Promise<TranscriptionsPage>;
|
||||
/**
|
||||
* Retrieve a single target page of TranscriptionsInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<TranscriptionsPage>) => any): Promise<ApiResponse<TranscriptionsPage>>;
|
||||
/**
|
||||
* Lists TranscriptionsInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { TranscriptionsListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: TranscriptionsInstance[]) => any): Promise<TranscriptionsInstance[]>;
|
||||
list(params: TranscriptionsListInstanceOptions, callback?: (error: Error | null, items: TranscriptionsInstance[]) => any): Promise<TranscriptionsInstance[]>;
|
||||
/**
|
||||
* Lists TranscriptionsInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { TranscriptionsListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<TranscriptionsInstance[]>) => any): Promise<ApiResponse<TranscriptionsInstance[]>>;
|
||||
listWithHttpInfo(params: TranscriptionsListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<TranscriptionsInstance[]>) => any): Promise<ApiResponse<TranscriptionsInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of TranscriptionsInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { TranscriptionsListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: TranscriptionsPage) => any): Promise<TranscriptionsPage>;
|
||||
page(params: TranscriptionsListInstancePageOptions, callback?: (error: Error | null, items: TranscriptionsPage) => any): Promise<TranscriptionsPage>;
|
||||
/**
|
||||
* Retrieve a single page of TranscriptionsInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { TranscriptionsListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<TranscriptionsPage>) => any): Promise<ApiResponse<TranscriptionsPage>>;
|
||||
pageWithHttpInfo(params: TranscriptionsListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<TranscriptionsPage>) => any): Promise<ApiResponse<TranscriptionsPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function TranscriptionsListInstance(version: V1, roomSid: string): TranscriptionsListInstance;
|
||||
export declare class TranscriptionsPage extends Page<V1, TranscriptionsPayload, TranscriptionsResource, TranscriptionsInstance> {
|
||||
/**
|
||||
* Initialize the TranscriptionsPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: TranscriptionsSolution);
|
||||
/**
|
||||
* Build an instance of TranscriptionsInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: TranscriptionsResource): TranscriptionsInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
400
node_modules/twilio/lib/rest/video/v1/room/transcriptions.js
generated
vendored
Normal file
400
node_modules/twilio/lib/rest/video/v1/room/transcriptions.js
generated
vendored
Normal file
@@ -0,0 +1,400 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Video
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TranscriptionsPage = exports.TranscriptionsInstance = exports.TranscriptionsContextImpl = void 0;
|
||||
exports.TranscriptionsListInstance = TranscriptionsListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../../base/Page"));
|
||||
const deserialize = require("../../../../base/deserialize");
|
||||
const serialize = require("../../../../base/serialize");
|
||||
const utility_1 = require("../../../../base/utility");
|
||||
class TranscriptionsContextImpl {
|
||||
constructor(_version, roomSid, ttid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(ttid)) {
|
||||
throw new Error("Parameter 'ttid' is not valid.");
|
||||
}
|
||||
this._solution = { roomSid, ttid };
|
||||
this._uri = `/Rooms/${roomSid}/Transcriptions/${ttid}`;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new TranscriptionsInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.ttid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new TranscriptionsInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.ttid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
update(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["configuration"] !== undefined)
|
||||
data["Configuration"] = serialize.object(params["configuration"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new TranscriptionsInstance(operationVersion, payload, instance._solution.roomSid, instance._solution.ttid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["status"] !== undefined)
|
||||
data["Status"] = params["status"];
|
||||
if (params["configuration"] !== undefined)
|
||||
data["Configuration"] = serialize.object(params["configuration"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new TranscriptionsInstance(operationVersion, response.body, instance._solution.roomSid, instance._solution.ttid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.TranscriptionsContextImpl = TranscriptionsContextImpl;
|
||||
class TranscriptionsInstance {
|
||||
constructor(_version, payload, roomSid, ttid) {
|
||||
this._version = _version;
|
||||
this.ttid = payload.ttid;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.roomSid = payload.room_sid;
|
||||
this.sourceSid = payload.source_sid;
|
||||
this.status = payload.status;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.startTime = deserialize.iso8601DateTime(payload.start_time);
|
||||
this.endTime = deserialize.iso8601DateTime(payload.end_time);
|
||||
this.duration = deserialize.integer(payload.duration);
|
||||
this.url = payload.url;
|
||||
this.configuration = payload.configuration;
|
||||
this._solution = { roomSid, ttid: ttid || this.ttid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new TranscriptionsContextImpl(this._version, this._solution.roomSid, this._solution.ttid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a TranscriptionsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a TranscriptionsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TranscriptionsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
update(params, callback) {
|
||||
return this._proxy.update(params, callback);
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
return this._proxy.updateWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
ttid: this.ttid,
|
||||
accountSid: this.accountSid,
|
||||
roomSid: this.roomSid,
|
||||
sourceSid: this.sourceSid,
|
||||
status: this.status,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
startTime: this.startTime,
|
||||
endTime: this.endTime,
|
||||
duration: this.duration,
|
||||
url: this.url,
|
||||
configuration: this.configuration,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.TranscriptionsInstance = TranscriptionsInstance;
|
||||
function TranscriptionsListInstance(version, roomSid) {
|
||||
if (!(0, utility_1.isValidPathParam)(roomSid)) {
|
||||
throw new Error("Parameter 'roomSid' is not valid.");
|
||||
}
|
||||
const instance = ((ttid) => instance.get(ttid));
|
||||
instance.get = function get(ttid) {
|
||||
return new TranscriptionsContextImpl(version, roomSid, ttid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { roomSid };
|
||||
instance._uri = `/Rooms/${roomSid}/Transcriptions`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["configuration"] !== undefined)
|
||||
data["Configuration"] = serialize.object(params["configuration"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new TranscriptionsInstance(operationVersion, payload, instance._solution.roomSid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["configuration"] !== undefined)
|
||||
data["Configuration"] = serialize.object(params["configuration"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new TranscriptionsInstance(operationVersion, response.body, instance._solution.roomSid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new TranscriptionsPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new TranscriptionsPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new TranscriptionsPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new TranscriptionsPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class TranscriptionsPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the TranscriptionsPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of TranscriptionsInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new TranscriptionsInstance(this._version, payload, this._solution.roomSid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.TranscriptionsPage = TranscriptionsPage;
|
||||
Reference in New Issue
Block a user