Auto-commit 2026-04-29 16:31
This commit is contained in:
40
node_modules/twilio/lib/rest/voice/V1.d.ts
generated
vendored
Normal file
40
node_modules/twilio/lib/rest/voice/V1.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import VoiceBase from "../VoiceBase";
|
||||
import Version from "../../base/Version";
|
||||
import { ArchivedCallListInstance } from "./v1/archivedCall";
|
||||
import { ByocTrunkListInstance } from "./v1/byocTrunk";
|
||||
import { ConnectionPolicyListInstance } from "./v1/connectionPolicy";
|
||||
import { DialingPermissionsListInstance } from "./v1/dialingPermissions";
|
||||
import { IpRecordListInstance } from "./v1/ipRecord";
|
||||
import { SourceIpMappingListInstance } from "./v1/sourceIpMapping";
|
||||
export default class V1 extends Version {
|
||||
/**
|
||||
* Initialize the V1 version of Voice
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Voice) domain
|
||||
*/
|
||||
constructor(domain: VoiceBase);
|
||||
/** archivedCalls - { Twilio.Voice.V1.ArchivedCallListInstance } resource */
|
||||
protected _archivedCalls?: ArchivedCallListInstance;
|
||||
/** byocTrunks - { Twilio.Voice.V1.ByocTrunkListInstance } resource */
|
||||
protected _byocTrunks?: ByocTrunkListInstance;
|
||||
/** connectionPolicies - { Twilio.Voice.V1.ConnectionPolicyListInstance } resource */
|
||||
protected _connectionPolicies?: ConnectionPolicyListInstance;
|
||||
/** dialingPermissions - { Twilio.Voice.V1.DialingPermissionsListInstance } resource */
|
||||
protected _dialingPermissions?: DialingPermissionsListInstance;
|
||||
/** ipRecords - { Twilio.Voice.V1.IpRecordListInstance } resource */
|
||||
protected _ipRecords?: IpRecordListInstance;
|
||||
/** sourceIpMappings - { Twilio.Voice.V1.SourceIpMappingListInstance } resource */
|
||||
protected _sourceIpMappings?: SourceIpMappingListInstance;
|
||||
/** Getter for archivedCalls resource */
|
||||
get archivedCalls(): ArchivedCallListInstance;
|
||||
/** Getter for byocTrunks resource */
|
||||
get byocTrunks(): ByocTrunkListInstance;
|
||||
/** Getter for connectionPolicies resource */
|
||||
get connectionPolicies(): ConnectionPolicyListInstance;
|
||||
/** Getter for dialingPermissions resource */
|
||||
get dialingPermissions(): DialingPermissionsListInstance;
|
||||
/** Getter for ipRecords resource */
|
||||
get ipRecords(): IpRecordListInstance;
|
||||
/** Getter for sourceIpMappings resource */
|
||||
get sourceIpMappings(): SourceIpMappingListInstance;
|
||||
}
|
||||
69
node_modules/twilio/lib/rest/voice/V1.js
generated
vendored
Normal file
69
node_modules/twilio/lib/rest/voice/V1.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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 archivedCall_1 = require("./v1/archivedCall");
|
||||
const byocTrunk_1 = require("./v1/byocTrunk");
|
||||
const connectionPolicy_1 = require("./v1/connectionPolicy");
|
||||
const dialingPermissions_1 = require("./v1/dialingPermissions");
|
||||
const ipRecord_1 = require("./v1/ipRecord");
|
||||
const sourceIpMapping_1 = require("./v1/sourceIpMapping");
|
||||
class V1 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V1 version of Voice
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Voice) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v1");
|
||||
}
|
||||
/** Getter for archivedCalls resource */
|
||||
get archivedCalls() {
|
||||
this._archivedCalls = this._archivedCalls || (0, archivedCall_1.ArchivedCallListInstance)(this);
|
||||
return this._archivedCalls;
|
||||
}
|
||||
/** Getter for byocTrunks resource */
|
||||
get byocTrunks() {
|
||||
this._byocTrunks = this._byocTrunks || (0, byocTrunk_1.ByocTrunkListInstance)(this);
|
||||
return this._byocTrunks;
|
||||
}
|
||||
/** Getter for connectionPolicies resource */
|
||||
get connectionPolicies() {
|
||||
this._connectionPolicies =
|
||||
this._connectionPolicies || (0, connectionPolicy_1.ConnectionPolicyListInstance)(this);
|
||||
return this._connectionPolicies;
|
||||
}
|
||||
/** Getter for dialingPermissions resource */
|
||||
get dialingPermissions() {
|
||||
this._dialingPermissions =
|
||||
this._dialingPermissions || (0, dialingPermissions_1.DialingPermissionsListInstance)(this);
|
||||
return this._dialingPermissions;
|
||||
}
|
||||
/** Getter for ipRecords resource */
|
||||
get ipRecords() {
|
||||
this._ipRecords = this._ipRecords || (0, ipRecord_1.IpRecordListInstance)(this);
|
||||
return this._ipRecords;
|
||||
}
|
||||
/** Getter for sourceIpMappings resource */
|
||||
get sourceIpMappings() {
|
||||
this._sourceIpMappings =
|
||||
this._sourceIpMappings || (0, sourceIpMapping_1.SourceIpMappingListInstance)(this);
|
||||
return this._sourceIpMappings;
|
||||
}
|
||||
}
|
||||
exports.default = V1;
|
||||
60
node_modules/twilio/lib/rest/voice/v1/archivedCall.d.ts
generated
vendored
Normal file
60
node_modules/twilio/lib/rest/voice/v1/archivedCall.d.ts
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export interface ArchivedCallContext {
|
||||
/**
|
||||
* Remove a ArchivedCallInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ArchivedCallInstance 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>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface ArchivedCallContextSolution {
|
||||
date: Date;
|
||||
sid: string;
|
||||
}
|
||||
export declare class ArchivedCallContextImpl implements ArchivedCallContext {
|
||||
protected _version: V1;
|
||||
protected _solution: ArchivedCallContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, date: Date, sid: string);
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): ArchivedCallContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface ArchivedCallSolution {
|
||||
}
|
||||
export interface ArchivedCallListInstance {
|
||||
_version: V1;
|
||||
_solution: ArchivedCallSolution;
|
||||
_uri: string;
|
||||
(date: Date, sid: string): ArchivedCallContext;
|
||||
get(date: Date, sid: string): ArchivedCallContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ArchivedCallListInstance(version: V1): ArchivedCallListInstance;
|
||||
87
node_modules/twilio/lib/rest/voice/v1/archivedCall.js
generated
vendored
Normal file
87
node_modules/twilio/lib/rest/voice/v1/archivedCall.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.ArchivedCallContextImpl = void 0;
|
||||
exports.ArchivedCallListInstance = ArchivedCallListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class ArchivedCallContextImpl {
|
||||
constructor(_version, date, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(date)) {
|
||||
throw new Error("Parameter 'date' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { date, sid };
|
||||
this._uri = `/Archives/${date}/Calls/${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;
|
||||
}
|
||||
/**
|
||||
* 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.ArchivedCallContextImpl = ArchivedCallContextImpl;
|
||||
function ArchivedCallListInstance(version) {
|
||||
const instance = ((date, sid) => instance.get(date, sid));
|
||||
instance.get = function get(date, sid) {
|
||||
return new ArchivedCallContextImpl(version, date, sid);
|
||||
};
|
||||
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;
|
||||
}
|
||||
528
node_modules/twilio/lib/rest/voice/v1/byocTrunk.d.ts
generated
vendored
Normal file
528
node_modules/twilio/lib/rest/voice/v1/byocTrunk.d.ts
generated
vendored
Normal file
@@ -0,0 +1,528 @@
|
||||
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";
|
||||
/**
|
||||
* Options to pass to update a ByocTrunkInstance
|
||||
*/
|
||||
export interface ByocTrunkContextUpdateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */
|
||||
friendlyName?: string;
|
||||
/** The URL we should call when the BYOC Trunk receives a call. */
|
||||
voiceUrl?: string;
|
||||
/** The HTTP method we should use to call `voice_url` */
|
||||
voiceMethod?: string;
|
||||
/** The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. */
|
||||
voiceFallbackUrl?: string;
|
||||
/** The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. */
|
||||
voiceFallbackMethod?: string;
|
||||
/** The URL that we should call to pass status parameters (such as call ended) to your application. */
|
||||
statusCallbackUrl?: string;
|
||||
/** The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. */
|
||||
statusCallbackMethod?: string;
|
||||
/** Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. */
|
||||
cnamLookupEnabled?: boolean;
|
||||
/** The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. */
|
||||
connectionPolicySid?: string;
|
||||
/** The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". */
|
||||
fromDomainSid?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a ByocTrunkInstance
|
||||
*/
|
||||
export interface ByocTrunkListInstanceCreateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */
|
||||
friendlyName?: string;
|
||||
/** The URL we should call when the BYOC Trunk receives a call. */
|
||||
voiceUrl?: string;
|
||||
/** The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. */
|
||||
voiceMethod?: string;
|
||||
/** The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. */
|
||||
voiceFallbackUrl?: string;
|
||||
/** The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. */
|
||||
voiceFallbackMethod?: string;
|
||||
/** The URL that we should call to pass status parameters (such as call ended) to your application. */
|
||||
statusCallbackUrl?: string;
|
||||
/** The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. */
|
||||
statusCallbackMethod?: string;
|
||||
/** Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. */
|
||||
cnamLookupEnabled?: boolean;
|
||||
/** The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. */
|
||||
connectionPolicySid?: string;
|
||||
/** The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". */
|
||||
fromDomainSid?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface ByocTrunkListInstanceEachOptions {
|
||||
/** 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: ByocTrunkInstance, 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 ByocTrunkListInstanceOptions {
|
||||
/** 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 ByocTrunkListInstancePageOptions {
|
||||
/** 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 ByocTrunkContext {
|
||||
/**
|
||||
* Remove a ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ByocTrunkInstance 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 ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
/**
|
||||
* Fetch a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Update a ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
/**
|
||||
* Update a ByocTrunkInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
update(params: ByocTrunkContextUpdateOptions, callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
/**
|
||||
* Update a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Update a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ByocTrunkContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface ByocTrunkContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class ByocTrunkContextImpl implements ByocTrunkContext {
|
||||
protected _version: V1;
|
||||
protected _solution: ByocTrunkContextSolution;
|
||||
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?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
update(params?: ByocTrunkContextUpdateOptions | ((error: Error | null, item?: ByocTrunkInstance) => any), callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
updateWithHttpInfo(params?: ByocTrunkContextUpdateOptions | ((error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): ByocTrunkContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface ByocTrunkPayload extends TwilioResponsePayload {
|
||||
byoc_trunks: ByocTrunkResource[];
|
||||
}
|
||||
interface ByocTrunkResource {
|
||||
account_sid: string;
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
voice_url: string;
|
||||
voice_method: string;
|
||||
voice_fallback_url: string;
|
||||
voice_fallback_method: string;
|
||||
status_callback_url: string;
|
||||
status_callback_method: string;
|
||||
cnam_lookup_enabled: boolean;
|
||||
connection_policy_sid: string;
|
||||
from_domain_sid: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class ByocTrunkInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: ByocTrunkContextSolution;
|
||||
protected _context?: ByocTrunkContext;
|
||||
constructor(_version: V1, payload: ByocTrunkResource, sid?: string);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the BYOC Trunk resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The unique string that that we created to identify the BYOC Trunk resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The URL we call using the `voice_method` when the BYOC Trunk receives a call.
|
||||
*/
|
||||
voiceUrl: string;
|
||||
/**
|
||||
* The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`.
|
||||
*/
|
||||
voiceMethod: string;
|
||||
/**
|
||||
* The URL that we call when an error occurs while retrieving or executing the TwiML requested from `voice_url`.
|
||||
*/
|
||||
voiceFallbackUrl: string;
|
||||
/**
|
||||
* The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`.
|
||||
*/
|
||||
voiceFallbackMethod: string;
|
||||
/**
|
||||
* The URL that we call to pass status parameters (such as call ended) to your application.
|
||||
*/
|
||||
statusCallbackUrl: string;
|
||||
/**
|
||||
* The HTTP method we use to call `status_callback_url`. Either `GET` or `POST`.
|
||||
*/
|
||||
statusCallbackMethod: string;
|
||||
/**
|
||||
* Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
|
||||
*/
|
||||
cnamLookupEnabled: boolean;
|
||||
/**
|
||||
* The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
|
||||
*/
|
||||
connectionPolicySid: string;
|
||||
/**
|
||||
* The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \"call back\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \"sip.twilio.com\".
|
||||
*/
|
||||
fromDomainSid: string;
|
||||
/**
|
||||
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ByocTrunkInstance 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 ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
/**
|
||||
* Fetch a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Update a ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
/**
|
||||
* Update a ByocTrunkInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
update(params: ByocTrunkContextUpdateOptions, callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
/**
|
||||
* Update a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Update a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ByocTrunkContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
voiceUrl: string;
|
||||
voiceMethod: string;
|
||||
voiceFallbackUrl: string;
|
||||
voiceFallbackMethod: string;
|
||||
statusCallbackUrl: string;
|
||||
statusCallbackMethod: string;
|
||||
cnamLookupEnabled: boolean;
|
||||
connectionPolicySid: string;
|
||||
fromDomainSid: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface ByocTrunkSolution {
|
||||
}
|
||||
export interface ByocTrunkListInstance {
|
||||
_version: V1;
|
||||
_solution: ByocTrunkSolution;
|
||||
_uri: string;
|
||||
(sid: string): ByocTrunkContext;
|
||||
get(sid: string): ByocTrunkContext;
|
||||
/**
|
||||
* Create a ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
/**
|
||||
* Create a ByocTrunkInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
create(params: ByocTrunkListInstanceCreateOptions, callback?: (error: Error | null, item?: ByocTrunkInstance) => any): Promise<ByocTrunkInstance>;
|
||||
/**
|
||||
* Create a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Create a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: ByocTrunkListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<ByocTrunkInstance>) => any): Promise<ApiResponse<ByocTrunkInstance>>;
|
||||
/**
|
||||
* Streams ByocTrunkInstance 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 { ByocTrunkListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: ByocTrunkInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: ByocTrunkListInstanceEachOptions, callback?: (item: ByocTrunkInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams ByocTrunkInstance 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 { ByocTrunkListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: ByocTrunkInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: ByocTrunkListInstanceEachOptions, callback?: (item: ByocTrunkInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of ByocTrunkInstance 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: ByocTrunkPage) => any): Promise<ByocTrunkPage>;
|
||||
/**
|
||||
* Retrieve a single target page of ByocTrunkInstance 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<ByocTrunkPage>) => any): Promise<ApiResponse<ByocTrunkPage>>;
|
||||
/**
|
||||
* Lists ByocTrunkInstance 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 { ByocTrunkListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: ByocTrunkInstance[]) => any): Promise<ByocTrunkInstance[]>;
|
||||
list(params: ByocTrunkListInstanceOptions, callback?: (error: Error | null, items: ByocTrunkInstance[]) => any): Promise<ByocTrunkInstance[]>;
|
||||
/**
|
||||
* Lists ByocTrunkInstance 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 { ByocTrunkListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ByocTrunkInstance[]>) => any): Promise<ApiResponse<ByocTrunkInstance[]>>;
|
||||
listWithHttpInfo(params: ByocTrunkListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<ByocTrunkInstance[]>) => any): Promise<ApiResponse<ByocTrunkInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of ByocTrunkInstance 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 { ByocTrunkListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: ByocTrunkPage) => any): Promise<ByocTrunkPage>;
|
||||
page(params: ByocTrunkListInstancePageOptions, callback?: (error: Error | null, items: ByocTrunkPage) => any): Promise<ByocTrunkPage>;
|
||||
/**
|
||||
* Retrieve a single page of ByocTrunkInstance 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 { ByocTrunkListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ByocTrunkPage>) => any): Promise<ApiResponse<ByocTrunkPage>>;
|
||||
pageWithHttpInfo(params: ByocTrunkListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<ByocTrunkPage>) => any): Promise<ApiResponse<ByocTrunkPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ByocTrunkListInstance(version: V1): ByocTrunkListInstance;
|
||||
export declare class ByocTrunkPage extends Page<V1, ByocTrunkPayload, ByocTrunkResource, ByocTrunkInstance> {
|
||||
/**
|
||||
* Initialize the ByocTrunkPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: ByocTrunkSolution);
|
||||
/**
|
||||
* Build an instance of ByocTrunkInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: ByocTrunkResource): ByocTrunkInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
513
node_modules/twilio/lib/rest/voice/v1/byocTrunk.js
generated
vendored
Normal file
513
node_modules/twilio/lib/rest/voice/v1/byocTrunk.js
generated
vendored
Normal file
@@ -0,0 +1,513 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.ByocTrunkPage = exports.ByocTrunkInstance = exports.ByocTrunkContextImpl = void 0;
|
||||
exports.ByocTrunkListInstance = ByocTrunkListInstance;
|
||||
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 ByocTrunkContextImpl {
|
||||
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 = `/ByocTrunks/${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 ByocTrunkInstance(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 ByocTrunkInstance(operationVersion, response.body, 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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["voiceUrl"] !== undefined)
|
||||
data["VoiceUrl"] = params["voiceUrl"];
|
||||
if (params["voiceMethod"] !== undefined)
|
||||
data["VoiceMethod"] = params["voiceMethod"];
|
||||
if (params["voiceFallbackUrl"] !== undefined)
|
||||
data["VoiceFallbackUrl"] = params["voiceFallbackUrl"];
|
||||
if (params["voiceFallbackMethod"] !== undefined)
|
||||
data["VoiceFallbackMethod"] = params["voiceFallbackMethod"];
|
||||
if (params["statusCallbackUrl"] !== undefined)
|
||||
data["StatusCallbackUrl"] = params["statusCallbackUrl"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["cnamLookupEnabled"] !== undefined)
|
||||
data["CnamLookupEnabled"] = serialize.bool(params["cnamLookupEnabled"]);
|
||||
if (params["connectionPolicySid"] !== undefined)
|
||||
data["ConnectionPolicySid"] = params["connectionPolicySid"];
|
||||
if (params["fromDomainSid"] !== undefined)
|
||||
data["FromDomainSid"] = params["fromDomainSid"];
|
||||
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 ByocTrunkInstance(operationVersion, payload, 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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["voiceUrl"] !== undefined)
|
||||
data["VoiceUrl"] = params["voiceUrl"];
|
||||
if (params["voiceMethod"] !== undefined)
|
||||
data["VoiceMethod"] = params["voiceMethod"];
|
||||
if (params["voiceFallbackUrl"] !== undefined)
|
||||
data["VoiceFallbackUrl"] = params["voiceFallbackUrl"];
|
||||
if (params["voiceFallbackMethod"] !== undefined)
|
||||
data["VoiceFallbackMethod"] = params["voiceFallbackMethod"];
|
||||
if (params["statusCallbackUrl"] !== undefined)
|
||||
data["StatusCallbackUrl"] = params["statusCallbackUrl"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["cnamLookupEnabled"] !== undefined)
|
||||
data["CnamLookupEnabled"] = serialize.bool(params["cnamLookupEnabled"]);
|
||||
if (params["connectionPolicySid"] !== undefined)
|
||||
data["ConnectionPolicySid"] = params["connectionPolicySid"];
|
||||
if (params["fromDomainSid"] !== undefined)
|
||||
data["FromDomainSid"] = params["fromDomainSid"];
|
||||
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 ByocTrunkInstance(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.ByocTrunkContextImpl = ByocTrunkContextImpl;
|
||||
class ByocTrunkInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.voiceUrl = payload.voice_url;
|
||||
this.voiceMethod = payload.voice_method;
|
||||
this.voiceFallbackUrl = payload.voice_fallback_url;
|
||||
this.voiceFallbackMethod = payload.voice_fallback_method;
|
||||
this.statusCallbackUrl = payload.status_callback_url;
|
||||
this.statusCallbackMethod = payload.status_callback_method;
|
||||
this.cnamLookupEnabled = payload.cnam_lookup_enabled;
|
||||
this.connectionPolicySid = payload.connection_policy_sid;
|
||||
this.fromDomainSid = payload.from_domain_sid;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.url = payload.url;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new ByocTrunkContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a ByocTrunkInstance 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 ByocTrunkInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a ByocTrunkInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ByocTrunkInstance 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,
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
voiceUrl: this.voiceUrl,
|
||||
voiceMethod: this.voiceMethod,
|
||||
voiceFallbackUrl: this.voiceFallbackUrl,
|
||||
voiceFallbackMethod: this.voiceFallbackMethod,
|
||||
statusCallbackUrl: this.statusCallbackUrl,
|
||||
statusCallbackMethod: this.statusCallbackMethod,
|
||||
cnamLookupEnabled: this.cnamLookupEnabled,
|
||||
connectionPolicySid: this.connectionPolicySid,
|
||||
fromDomainSid: this.fromDomainSid,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ByocTrunkInstance = ByocTrunkInstance;
|
||||
function ByocTrunkListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new ByocTrunkContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/ByocTrunks`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["voiceUrl"] !== undefined)
|
||||
data["VoiceUrl"] = params["voiceUrl"];
|
||||
if (params["voiceMethod"] !== undefined)
|
||||
data["VoiceMethod"] = params["voiceMethod"];
|
||||
if (params["voiceFallbackUrl"] !== undefined)
|
||||
data["VoiceFallbackUrl"] = params["voiceFallbackUrl"];
|
||||
if (params["voiceFallbackMethod"] !== undefined)
|
||||
data["VoiceFallbackMethod"] = params["voiceFallbackMethod"];
|
||||
if (params["statusCallbackUrl"] !== undefined)
|
||||
data["StatusCallbackUrl"] = params["statusCallbackUrl"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["cnamLookupEnabled"] !== undefined)
|
||||
data["CnamLookupEnabled"] = serialize.bool(params["cnamLookupEnabled"]);
|
||||
if (params["connectionPolicySid"] !== undefined)
|
||||
data["ConnectionPolicySid"] = params["connectionPolicySid"];
|
||||
if (params["fromDomainSid"] !== undefined)
|
||||
data["FromDomainSid"] = params["fromDomainSid"];
|
||||
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 ByocTrunkInstance(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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["voiceUrl"] !== undefined)
|
||||
data["VoiceUrl"] = params["voiceUrl"];
|
||||
if (params["voiceMethod"] !== undefined)
|
||||
data["VoiceMethod"] = params["voiceMethod"];
|
||||
if (params["voiceFallbackUrl"] !== undefined)
|
||||
data["VoiceFallbackUrl"] = params["voiceFallbackUrl"];
|
||||
if (params["voiceFallbackMethod"] !== undefined)
|
||||
data["VoiceFallbackMethod"] = params["voiceFallbackMethod"];
|
||||
if (params["statusCallbackUrl"] !== undefined)
|
||||
data["StatusCallbackUrl"] = params["statusCallbackUrl"];
|
||||
if (params["statusCallbackMethod"] !== undefined)
|
||||
data["StatusCallbackMethod"] = params["statusCallbackMethod"];
|
||||
if (params["cnamLookupEnabled"] !== undefined)
|
||||
data["CnamLookupEnabled"] = serialize.bool(params["cnamLookupEnabled"]);
|
||||
if (params["connectionPolicySid"] !== undefined)
|
||||
data["ConnectionPolicySid"] = params["connectionPolicySid"];
|
||||
if (params["fromDomainSid"] !== undefined)
|
||||
data["FromDomainSid"] = params["fromDomainSid"];
|
||||
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 ByocTrunkInstance(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["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 ByocTrunkPage(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 ByocTrunkPage(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 ByocTrunkPage(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 ByocTrunkPage(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 ByocTrunkPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the ByocTrunkPage
|
||||
*
|
||||
* @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 ByocTrunkInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new ByocTrunkInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ByocTrunkPage = ByocTrunkPage;
|
||||
452
node_modules/twilio/lib/rest/voice/v1/connectionPolicy.d.ts
generated
vendored
Normal file
452
node_modules/twilio/lib/rest/voice/v1/connectionPolicy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,452 @@
|
||||
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 { ConnectionPolicyTargetListInstance } from "./connectionPolicy/connectionPolicyTarget";
|
||||
/**
|
||||
* Options to pass to update a ConnectionPolicyInstance
|
||||
*/
|
||||
export interface ConnectionPolicyContextUpdateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */
|
||||
friendlyName?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a ConnectionPolicyInstance
|
||||
*/
|
||||
export interface ConnectionPolicyListInstanceCreateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */
|
||||
friendlyName?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface ConnectionPolicyListInstanceEachOptions {
|
||||
/** 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: ConnectionPolicyInstance, 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 ConnectionPolicyListInstanceOptions {
|
||||
/** 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 ConnectionPolicyListInstancePageOptions {
|
||||
/** 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 ConnectionPolicyContext {
|
||||
targets: ConnectionPolicyTargetListInstance;
|
||||
/**
|
||||
* Remove a ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ConnectionPolicyInstance 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 ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
/**
|
||||
* Fetch a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Update a ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
/**
|
||||
* Update a ConnectionPolicyInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
update(params: ConnectionPolicyContextUpdateOptions, callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
/**
|
||||
* Update a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Update a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ConnectionPolicyContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface ConnectionPolicyContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class ConnectionPolicyContextImpl implements ConnectionPolicyContext {
|
||||
protected _version: V1;
|
||||
protected _solution: ConnectionPolicyContextSolution;
|
||||
protected _uri: string;
|
||||
protected _targets?: ConnectionPolicyTargetListInstance;
|
||||
constructor(_version: V1, sid: string);
|
||||
get targets(): ConnectionPolicyTargetListInstance;
|
||||
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?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
update(params?: ConnectionPolicyContextUpdateOptions | ((error: Error | null, item?: ConnectionPolicyInstance) => any), callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
updateWithHttpInfo(params?: ConnectionPolicyContextUpdateOptions | ((error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): ConnectionPolicyContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface ConnectionPolicyPayload extends TwilioResponsePayload {
|
||||
connection_policies: ConnectionPolicyResource[];
|
||||
}
|
||||
interface ConnectionPolicyResource {
|
||||
account_sid: string;
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class ConnectionPolicyInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: ConnectionPolicyContextSolution;
|
||||
protected _context?: ConnectionPolicyContext;
|
||||
constructor(_version: V1, payload: ConnectionPolicyResource, sid?: string);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Connection Policy resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The unique string that we created to identify the Connection Policy resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The URLs of related resources.
|
||||
*/
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ConnectionPolicyInstance 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 ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
/**
|
||||
* Fetch a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Update a ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
/**
|
||||
* Update a ConnectionPolicyInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
update(params: ConnectionPolicyContextUpdateOptions, callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
/**
|
||||
* Update a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Update a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ConnectionPolicyContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Access the targets.
|
||||
*/
|
||||
targets(): ConnectionPolicyTargetListInstance;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface ConnectionPolicySolution {
|
||||
}
|
||||
export interface ConnectionPolicyListInstance {
|
||||
_version: V1;
|
||||
_solution: ConnectionPolicySolution;
|
||||
_uri: string;
|
||||
(sid: string): ConnectionPolicyContext;
|
||||
get(sid: string): ConnectionPolicyContext;
|
||||
/**
|
||||
* Create a ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
/**
|
||||
* Create a ConnectionPolicyInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
create(params: ConnectionPolicyListInstanceCreateOptions, callback?: (error: Error | null, item?: ConnectionPolicyInstance) => any): Promise<ConnectionPolicyInstance>;
|
||||
/**
|
||||
* Create a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Create a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: ConnectionPolicyListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyInstance>) => any): Promise<ApiResponse<ConnectionPolicyInstance>>;
|
||||
/**
|
||||
* Streams ConnectionPolicyInstance 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 { ConnectionPolicyListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: ConnectionPolicyInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: ConnectionPolicyListInstanceEachOptions, callback?: (item: ConnectionPolicyInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams ConnectionPolicyInstance 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 { ConnectionPolicyListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: ConnectionPolicyInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: ConnectionPolicyListInstanceEachOptions, callback?: (item: ConnectionPolicyInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of ConnectionPolicyInstance 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: ConnectionPolicyPage) => any): Promise<ConnectionPolicyPage>;
|
||||
/**
|
||||
* Retrieve a single target page of ConnectionPolicyInstance 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<ConnectionPolicyPage>) => any): Promise<ApiResponse<ConnectionPolicyPage>>;
|
||||
/**
|
||||
* Lists ConnectionPolicyInstance 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 { ConnectionPolicyListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: ConnectionPolicyInstance[]) => any): Promise<ConnectionPolicyInstance[]>;
|
||||
list(params: ConnectionPolicyListInstanceOptions, callback?: (error: Error | null, items: ConnectionPolicyInstance[]) => any): Promise<ConnectionPolicyInstance[]>;
|
||||
/**
|
||||
* Lists ConnectionPolicyInstance 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 { ConnectionPolicyListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ConnectionPolicyInstance[]>) => any): Promise<ApiResponse<ConnectionPolicyInstance[]>>;
|
||||
listWithHttpInfo(params: ConnectionPolicyListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<ConnectionPolicyInstance[]>) => any): Promise<ApiResponse<ConnectionPolicyInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of ConnectionPolicyInstance 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 { ConnectionPolicyListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: ConnectionPolicyPage) => any): Promise<ConnectionPolicyPage>;
|
||||
page(params: ConnectionPolicyListInstancePageOptions, callback?: (error: Error | null, items: ConnectionPolicyPage) => any): Promise<ConnectionPolicyPage>;
|
||||
/**
|
||||
* Retrieve a single page of ConnectionPolicyInstance 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 { ConnectionPolicyListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ConnectionPolicyPage>) => any): Promise<ApiResponse<ConnectionPolicyPage>>;
|
||||
pageWithHttpInfo(params: ConnectionPolicyListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<ConnectionPolicyPage>) => any): Promise<ApiResponse<ConnectionPolicyPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ConnectionPolicyListInstance(version: V1): ConnectionPolicyListInstance;
|
||||
export declare class ConnectionPolicyPage extends Page<V1, ConnectionPolicyPayload, ConnectionPolicyResource, ConnectionPolicyInstance> {
|
||||
/**
|
||||
* Initialize the ConnectionPolicyPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: ConnectionPolicySolution);
|
||||
/**
|
||||
* Build an instance of ConnectionPolicyInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: ConnectionPolicyResource): ConnectionPolicyInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
438
node_modules/twilio/lib/rest/voice/v1/connectionPolicy.js
generated
vendored
Normal file
438
node_modules/twilio/lib/rest/voice/v1/connectionPolicy.js
generated
vendored
Normal file
@@ -0,0 +1,438 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.ConnectionPolicyPage = exports.ConnectionPolicyInstance = exports.ConnectionPolicyContextImpl = void 0;
|
||||
exports.ConnectionPolicyListInstance = ConnectionPolicyListInstance;
|
||||
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 connectionPolicyTarget_1 = require("./connectionPolicy/connectionPolicyTarget");
|
||||
class ConnectionPolicyContextImpl {
|
||||
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 = `/ConnectionPolicies/${sid}`;
|
||||
}
|
||||
get targets() {
|
||||
this._targets =
|
||||
this._targets ||
|
||||
(0, connectionPolicyTarget_1.ConnectionPolicyTargetListInstance)(this._version, this._solution.sid);
|
||||
return this._targets;
|
||||
}
|
||||
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 ConnectionPolicyInstance(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 ConnectionPolicyInstance(operationVersion, response.body, 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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
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 ConnectionPolicyInstance(operationVersion, payload, 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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
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 ConnectionPolicyInstance(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.ConnectionPolicyContextImpl = ConnectionPolicyContextImpl;
|
||||
class ConnectionPolicyInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.url = payload.url;
|
||||
this.links = payload.links;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new ConnectionPolicyContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a ConnectionPolicyInstance 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 ConnectionPolicyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a ConnectionPolicyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyInstance 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 targets.
|
||||
*/
|
||||
targets() {
|
||||
return this._proxy.targets;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accountSid: this.accountSid,
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
url: this.url,
|
||||
links: this.links,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ConnectionPolicyInstance = ConnectionPolicyInstance;
|
||||
function ConnectionPolicyListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new ConnectionPolicyContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/ConnectionPolicies`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
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 ConnectionPolicyInstance(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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
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 ConnectionPolicyInstance(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["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 ConnectionPolicyPage(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 ConnectionPolicyPage(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 ConnectionPolicyPage(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 ConnectionPolicyPage(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 ConnectionPolicyPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the ConnectionPolicyPage
|
||||
*
|
||||
* @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 ConnectionPolicyInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new ConnectionPolicyInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ConnectionPolicyPage = ConnectionPolicyPage;
|
||||
470
node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.d.ts
generated
vendored
Normal file
470
node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.d.ts
generated
vendored
Normal file
@@ -0,0 +1,470 @@
|
||||
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";
|
||||
/**
|
||||
* Options to pass to update a ConnectionPolicyTargetInstance
|
||||
*/
|
||||
export interface ConnectionPolicyTargetContextUpdateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */
|
||||
friendlyName?: string;
|
||||
/** The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. */
|
||||
target?: string;
|
||||
/** The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. */
|
||||
priority?: number;
|
||||
/** The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. */
|
||||
weight?: number;
|
||||
/** Whether the Target is enabled. */
|
||||
enabled?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a ConnectionPolicyTargetInstance
|
||||
*/
|
||||
export interface ConnectionPolicyTargetListInstanceCreateOptions {
|
||||
/** The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. */
|
||||
target: string;
|
||||
/** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */
|
||||
friendlyName?: string;
|
||||
/** The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. */
|
||||
priority?: number;
|
||||
/** The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. */
|
||||
weight?: number;
|
||||
/** Whether the Target is enabled. The default is `true`. */
|
||||
enabled?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface ConnectionPolicyTargetListInstanceEachOptions {
|
||||
/** 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: ConnectionPolicyTargetInstance, 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 ConnectionPolicyTargetListInstanceOptions {
|
||||
/** 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 ConnectionPolicyTargetListInstancePageOptions {
|
||||
/** 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 ConnectionPolicyTargetContext {
|
||||
/**
|
||||
* Remove a ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ConnectionPolicyTargetInstance 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 ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
/**
|
||||
* Fetch a ConnectionPolicyTargetInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
/**
|
||||
* Update a ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
/**
|
||||
* Update a ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance
|
||||
*/
|
||||
update(params: ConnectionPolicyTargetContextUpdateOptions, callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
/**
|
||||
* Update a ConnectionPolicyTargetInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
/**
|
||||
* Update a ConnectionPolicyTargetInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ConnectionPolicyTargetContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface ConnectionPolicyTargetContextSolution {
|
||||
connectionPolicySid: string;
|
||||
sid: string;
|
||||
}
|
||||
export declare class ConnectionPolicyTargetContextImpl implements ConnectionPolicyTargetContext {
|
||||
protected _version: V1;
|
||||
protected _solution: ConnectionPolicyTargetContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, connectionPolicySid: 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?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
update(params?: ConnectionPolicyTargetContextUpdateOptions | ((error: Error | null, item?: ConnectionPolicyTargetInstance) => any), callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
updateWithHttpInfo(params?: ConnectionPolicyTargetContextUpdateOptions | ((error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): ConnectionPolicyTargetContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface ConnectionPolicyTargetPayload extends TwilioResponsePayload {
|
||||
targets: ConnectionPolicyTargetResource[];
|
||||
}
|
||||
interface ConnectionPolicyTargetResource {
|
||||
account_sid: string;
|
||||
connection_policy_sid: string;
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
target: string;
|
||||
priority: number;
|
||||
weight: number;
|
||||
enabled: boolean;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class ConnectionPolicyTargetInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: ConnectionPolicyTargetContextSolution;
|
||||
protected _context?: ConnectionPolicyTargetContext;
|
||||
constructor(_version: V1, payload: ConnectionPolicyTargetResource, connectionPolicySid: string, sid?: string);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Target resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The SID of the Connection Policy that owns the Target.
|
||||
*/
|
||||
connectionPolicySid: string;
|
||||
/**
|
||||
* The unique string that we created to identify the Target resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported.
|
||||
*/
|
||||
target: string;
|
||||
/**
|
||||
* The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target.
|
||||
*/
|
||||
priority: number;
|
||||
/**
|
||||
* The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority.
|
||||
*/
|
||||
weight: number;
|
||||
/**
|
||||
* Whether the target is enabled. The default is `true`.
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ConnectionPolicyTargetInstance 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 ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
/**
|
||||
* Fetch a ConnectionPolicyTargetInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
/**
|
||||
* Update a ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
/**
|
||||
* Update a ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance
|
||||
*/
|
||||
update(params: ConnectionPolicyTargetContextUpdateOptions, callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
/**
|
||||
* Update a ConnectionPolicyTargetInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
/**
|
||||
* Update a ConnectionPolicyTargetInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ConnectionPolicyTargetContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
connectionPolicySid: string;
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
target: string;
|
||||
priority: number;
|
||||
weight: number;
|
||||
enabled: boolean;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface ConnectionPolicyTargetSolution {
|
||||
connectionPolicySid: string;
|
||||
}
|
||||
export interface ConnectionPolicyTargetListInstance {
|
||||
_version: V1;
|
||||
_solution: ConnectionPolicyTargetSolution;
|
||||
_uri: string;
|
||||
(sid: string): ConnectionPolicyTargetContext;
|
||||
get(sid: string): ConnectionPolicyTargetContext;
|
||||
/**
|
||||
* Create a ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance
|
||||
*/
|
||||
create(params: ConnectionPolicyTargetListInstanceCreateOptions, callback?: (error: Error | null, item?: ConnectionPolicyTargetInstance) => any): Promise<ConnectionPolicyTargetInstance>;
|
||||
/**
|
||||
* Create a ConnectionPolicyTargetInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: ConnectionPolicyTargetListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<ConnectionPolicyTargetInstance>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance>>;
|
||||
/**
|
||||
* Streams ConnectionPolicyTargetInstance 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 { ConnectionPolicyTargetListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: ConnectionPolicyTargetInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: ConnectionPolicyTargetListInstanceEachOptions, callback?: (item: ConnectionPolicyTargetInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams ConnectionPolicyTargetInstance 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 { ConnectionPolicyTargetListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: ConnectionPolicyTargetInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: ConnectionPolicyTargetListInstanceEachOptions, callback?: (item: ConnectionPolicyTargetInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of ConnectionPolicyTargetInstance 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: ConnectionPolicyTargetPage) => any): Promise<ConnectionPolicyTargetPage>;
|
||||
/**
|
||||
* Retrieve a single target page of ConnectionPolicyTargetInstance 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<ConnectionPolicyTargetPage>) => any): Promise<ApiResponse<ConnectionPolicyTargetPage>>;
|
||||
/**
|
||||
* Lists ConnectionPolicyTargetInstance 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 { ConnectionPolicyTargetListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: ConnectionPolicyTargetInstance[]) => any): Promise<ConnectionPolicyTargetInstance[]>;
|
||||
list(params: ConnectionPolicyTargetListInstanceOptions, callback?: (error: Error | null, items: ConnectionPolicyTargetInstance[]) => any): Promise<ConnectionPolicyTargetInstance[]>;
|
||||
/**
|
||||
* Lists ConnectionPolicyTargetInstance 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 { ConnectionPolicyTargetListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ConnectionPolicyTargetInstance[]>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance[]>>;
|
||||
listWithHttpInfo(params: ConnectionPolicyTargetListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<ConnectionPolicyTargetInstance[]>) => any): Promise<ApiResponse<ConnectionPolicyTargetInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of ConnectionPolicyTargetInstance 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 { ConnectionPolicyTargetListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: ConnectionPolicyTargetPage) => any): Promise<ConnectionPolicyTargetPage>;
|
||||
page(params: ConnectionPolicyTargetListInstancePageOptions, callback?: (error: Error | null, items: ConnectionPolicyTargetPage) => any): Promise<ConnectionPolicyTargetPage>;
|
||||
/**
|
||||
* Retrieve a single page of ConnectionPolicyTargetInstance 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 { ConnectionPolicyTargetListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<ConnectionPolicyTargetPage>) => any): Promise<ApiResponse<ConnectionPolicyTargetPage>>;
|
||||
pageWithHttpInfo(params: ConnectionPolicyTargetListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<ConnectionPolicyTargetPage>) => any): Promise<ApiResponse<ConnectionPolicyTargetPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ConnectionPolicyTargetListInstance(version: V1, connectionPolicySid: string): ConnectionPolicyTargetListInstance;
|
||||
export declare class ConnectionPolicyTargetPage extends Page<V1, ConnectionPolicyTargetPayload, ConnectionPolicyTargetResource, ConnectionPolicyTargetInstance> {
|
||||
/**
|
||||
* Initialize the ConnectionPolicyTargetPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: ConnectionPolicyTargetSolution);
|
||||
/**
|
||||
* Build an instance of ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: ConnectionPolicyTargetResource): ConnectionPolicyTargetInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
467
node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.js
generated
vendored
Normal file
467
node_modules/twilio/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.js
generated
vendored
Normal file
@@ -0,0 +1,467 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.ConnectionPolicyTargetPage = exports.ConnectionPolicyTargetInstance = exports.ConnectionPolicyTargetContextImpl = void 0;
|
||||
exports.ConnectionPolicyTargetListInstance = ConnectionPolicyTargetListInstance;
|
||||
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 ConnectionPolicyTargetContextImpl {
|
||||
constructor(_version, connectionPolicySid, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(connectionPolicySid)) {
|
||||
throw new Error("Parameter 'connectionPolicySid' is not valid.");
|
||||
}
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { connectionPolicySid, sid };
|
||||
this._uri = `/ConnectionPolicies/${connectionPolicySid}/Targets/${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 ConnectionPolicyTargetInstance(operationVersion, payload, instance._solution.connectionPolicySid, 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 ConnectionPolicyTargetInstance(operationVersion, response.body, instance._solution.connectionPolicySid, 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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["target"] !== undefined)
|
||||
data["Target"] = params["target"];
|
||||
if (params["priority"] !== undefined)
|
||||
data["Priority"] = params["priority"];
|
||||
if (params["weight"] !== undefined)
|
||||
data["Weight"] = params["weight"];
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
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 ConnectionPolicyTargetInstance(operationVersion, payload, instance._solution.connectionPolicySid, 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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["target"] !== undefined)
|
||||
data["Target"] = params["target"];
|
||||
if (params["priority"] !== undefined)
|
||||
data["Priority"] = params["priority"];
|
||||
if (params["weight"] !== undefined)
|
||||
data["Weight"] = params["weight"];
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
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 ConnectionPolicyTargetInstance(operationVersion, response.body, instance._solution.connectionPolicySid, 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.ConnectionPolicyTargetContextImpl = ConnectionPolicyTargetContextImpl;
|
||||
class ConnectionPolicyTargetInstance {
|
||||
constructor(_version, payload, connectionPolicySid, sid) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.connectionPolicySid = payload.connection_policy_sid;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.target = payload.target;
|
||||
this.priority = deserialize.integer(payload.priority);
|
||||
this.weight = deserialize.integer(payload.weight);
|
||||
this.enabled = payload.enabled;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.url = payload.url;
|
||||
this._solution = { connectionPolicySid, sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new ConnectionPolicyTargetContextImpl(this._version, this._solution.connectionPolicySid, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a ConnectionPolicyTargetInstance 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 ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a ConnectionPolicyTargetInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ConnectionPolicyTargetInstance 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,
|
||||
connectionPolicySid: this.connectionPolicySid,
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
target: this.target,
|
||||
priority: this.priority,
|
||||
weight: this.weight,
|
||||
enabled: this.enabled,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ConnectionPolicyTargetInstance = ConnectionPolicyTargetInstance;
|
||||
function ConnectionPolicyTargetListInstance(version, connectionPolicySid) {
|
||||
if (!(0, utility_1.isValidPathParam)(connectionPolicySid)) {
|
||||
throw new Error("Parameter 'connectionPolicySid' is not valid.");
|
||||
}
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new ConnectionPolicyTargetContextImpl(version, connectionPolicySid, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = { connectionPolicySid };
|
||||
instance._uri = `/ConnectionPolicies/${connectionPolicySid}/Targets`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["target"] === null || params["target"] === undefined) {
|
||||
throw new Error("Required parameter \"params['target']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["Target"] = params["target"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["priority"] !== undefined)
|
||||
data["Priority"] = params["priority"];
|
||||
if (params["weight"] !== undefined)
|
||||
data["Weight"] = params["weight"];
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
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 ConnectionPolicyTargetInstance(operationVersion, payload, instance._solution.connectionPolicySid));
|
||||
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["target"] === null || params["target"] === undefined) {
|
||||
throw new Error("Required parameter \"params['target']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["Target"] = params["target"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["priority"] !== undefined)
|
||||
data["Priority"] = params["priority"];
|
||||
if (params["weight"] !== undefined)
|
||||
data["Weight"] = params["weight"];
|
||||
if (params["enabled"] !== undefined)
|
||||
data["Enabled"] = serialize.bool(params["enabled"]);
|
||||
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 ConnectionPolicyTargetInstance(operationVersion, response.body, instance._solution.connectionPolicySid),
|
||||
}));
|
||||
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 ConnectionPolicyTargetPage(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 ConnectionPolicyTargetPage(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 ConnectionPolicyTargetPage(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 ConnectionPolicyTargetPage(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 ConnectionPolicyTargetPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the ConnectionPolicyTargetPage
|
||||
*
|
||||
* @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 ConnectionPolicyTargetInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new ConnectionPolicyTargetInstance(this._version, payload, this._solution.connectionPolicySid);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ConnectionPolicyTargetPage = ConnectionPolicyTargetPage;
|
||||
24
node_modules/twilio/lib/rest/voice/v1/dialingPermissions.d.ts
generated
vendored
Normal file
24
node_modules/twilio/lib/rest/voice/v1/dialingPermissions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { BulkCountryUpdateListInstance } from "./dialingPermissions/bulkCountryUpdate";
|
||||
import { CountryListInstance } from "./dialingPermissions/country";
|
||||
import { SettingsListInstance } from "./dialingPermissions/settings";
|
||||
export interface DialingPermissionsSolution {
|
||||
}
|
||||
export interface DialingPermissionsListInstance {
|
||||
_version: V1;
|
||||
_solution: DialingPermissionsSolution;
|
||||
_uri: string;
|
||||
_bulkCountryUpdates?: BulkCountryUpdateListInstance;
|
||||
bulkCountryUpdates: BulkCountryUpdateListInstance;
|
||||
_countries?: CountryListInstance;
|
||||
countries: CountryListInstance;
|
||||
_settings?: SettingsListInstance;
|
||||
settings: SettingsListInstance;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function DialingPermissionsListInstance(version: V1): DialingPermissionsListInstance;
|
||||
59
node_modules/twilio/lib/rest/voice/v1/dialingPermissions.js
generated
vendored
Normal file
59
node_modules/twilio/lib/rest/voice/v1/dialingPermissions.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.DialingPermissionsListInstance = DialingPermissionsListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const bulkCountryUpdate_1 = require("./dialingPermissions/bulkCountryUpdate");
|
||||
const country_1 = require("./dialingPermissions/country");
|
||||
const settings_1 = require("./dialingPermissions/settings");
|
||||
function DialingPermissionsListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/DialingPermissions`;
|
||||
Object.defineProperty(instance, "bulkCountryUpdates", {
|
||||
get: function bulkCountryUpdates() {
|
||||
if (!instance._bulkCountryUpdates) {
|
||||
instance._bulkCountryUpdates = (0, bulkCountryUpdate_1.BulkCountryUpdateListInstance)(instance._version);
|
||||
}
|
||||
return instance._bulkCountryUpdates;
|
||||
},
|
||||
});
|
||||
Object.defineProperty(instance, "countries", {
|
||||
get: function countries() {
|
||||
if (!instance._countries) {
|
||||
instance._countries = (0, country_1.CountryListInstance)(instance._version);
|
||||
}
|
||||
return instance._countries;
|
||||
},
|
||||
});
|
||||
Object.defineProperty(instance, "settings", {
|
||||
get: function settings() {
|
||||
if (!instance._settings) {
|
||||
instance._settings = (0, settings_1.SettingsListInstance)(instance._version);
|
||||
}
|
||||
return instance._settings;
|
||||
},
|
||||
});
|
||||
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;
|
||||
}
|
||||
68
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.d.ts
generated
vendored
Normal file
68
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../../V1";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a BulkCountryUpdateInstance
|
||||
*/
|
||||
export interface BulkCountryUpdateListInstanceCreateOptions {
|
||||
/** URL encoded JSON array of update objects. example : `[ { \\\"iso_code\\\": \\\"GB\\\", \\\"low_risk_numbers_enabled\\\": \\\"true\\\", \\\"high_risk_special_numbers_enabled\\\":\\\"true\\\", \\\"high_risk_tollfraud_numbers_enabled\\\": \\\"false\\\" } ]` */
|
||||
updateRequest: string;
|
||||
}
|
||||
export interface BulkCountryUpdateSolution {
|
||||
}
|
||||
export interface BulkCountryUpdateListInstance {
|
||||
_version: V1;
|
||||
_solution: BulkCountryUpdateSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a BulkCountryUpdateInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkCountryUpdateInstance
|
||||
*/
|
||||
create(params: BulkCountryUpdateListInstanceCreateOptions, callback?: (error: Error | null, item?: BulkCountryUpdateInstance) => any): Promise<BulkCountryUpdateInstance>;
|
||||
/**
|
||||
* Create a BulkCountryUpdateInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed BulkCountryUpdateInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: BulkCountryUpdateListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<BulkCountryUpdateInstance>) => any): Promise<ApiResponse<BulkCountryUpdateInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function BulkCountryUpdateListInstance(version: V1): BulkCountryUpdateListInstance;
|
||||
interface BulkCountryUpdateResource {
|
||||
update_count: number;
|
||||
update_request: string;
|
||||
}
|
||||
export declare class BulkCountryUpdateInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: BulkCountryUpdateResource);
|
||||
/**
|
||||
* The number of countries updated
|
||||
*/
|
||||
updateCount: number;
|
||||
/**
|
||||
* A bulk update request to change voice dialing country permissions stored as a URL-encoded, JSON array of update objects. For example : `[ { \"iso_code\": \"GB\", \"low_risk_numbers_enabled\": \"true\", \"high_risk_special_numbers_enabled\":\"true\", \"high_risk_tollfraud_numbers_enabled\": \"false\" } ]`
|
||||
*/
|
||||
updateRequest: string;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
updateCount: number;
|
||||
updateRequest: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
107
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.js
generated
vendored
Normal file
107
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.BulkCountryUpdateInstance = void 0;
|
||||
exports.BulkCountryUpdateListInstance = BulkCountryUpdateListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../../base/deserialize");
|
||||
const serialize = require("../../../../base/serialize");
|
||||
function BulkCountryUpdateListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/DialingPermissions/BulkCountryUpdates`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["updateRequest"] === null ||
|
||||
params["updateRequest"] === undefined) {
|
||||
throw new Error("Required parameter \"params['updateRequest']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["UpdateRequest"] = params["updateRequest"];
|
||||
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 BulkCountryUpdateInstance(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["updateRequest"] === null ||
|
||||
params["updateRequest"] === undefined) {
|
||||
throw new Error("Required parameter \"params['updateRequest']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["UpdateRequest"] = params["updateRequest"];
|
||||
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 BulkCountryUpdateInstance(operationVersion, response.body),
|
||||
}));
|
||||
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 BulkCountryUpdateInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.updateCount = deserialize.integer(payload.update_count);
|
||||
this.updateRequest = payload.update_request;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
updateCount: this.updateCount,
|
||||
updateRequest: this.updateRequest,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.BulkCountryUpdateInstance = BulkCountryUpdateInstance;
|
||||
348
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.d.ts
generated
vendored
Normal file
348
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.d.ts
generated
vendored
Normal file
@@ -0,0 +1,348 @@
|
||||
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 { HighriskSpecialPrefixListInstance } from "./country/highriskSpecialPrefix";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface CountryListInstanceEachOptions {
|
||||
/** Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) */
|
||||
isoCode?: string;
|
||||
/** Filter to retrieve the country permissions by specifying the continent */
|
||||
continent?: string;
|
||||
/** Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) */
|
||||
countryCode?: string;
|
||||
/** Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. */
|
||||
lowRiskNumbersEnabled?: boolean;
|
||||
/** Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` */
|
||||
highRiskSpecialNumbersEnabled?: boolean;
|
||||
/** Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. */
|
||||
highRiskTollfraudNumbersEnabled?: boolean;
|
||||
/** 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: CountryInstance, 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 CountryListInstanceOptions {
|
||||
/** Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) */
|
||||
isoCode?: string;
|
||||
/** Filter to retrieve the country permissions by specifying the continent */
|
||||
continent?: string;
|
||||
/** Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) */
|
||||
countryCode?: string;
|
||||
/** Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. */
|
||||
lowRiskNumbersEnabled?: boolean;
|
||||
/** Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` */
|
||||
highRiskSpecialNumbersEnabled?: boolean;
|
||||
/** Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. */
|
||||
highRiskTollfraudNumbersEnabled?: boolean;
|
||||
/** 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 CountryListInstancePageOptions {
|
||||
/** Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) */
|
||||
isoCode?: string;
|
||||
/** Filter to retrieve the country permissions by specifying the continent */
|
||||
continent?: string;
|
||||
/** Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) */
|
||||
countryCode?: string;
|
||||
/** Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. */
|
||||
lowRiskNumbersEnabled?: boolean;
|
||||
/** Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` */
|
||||
highRiskSpecialNumbersEnabled?: boolean;
|
||||
/** Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. */
|
||||
highRiskTollfraudNumbersEnabled?: boolean;
|
||||
/** 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 CountryContext {
|
||||
highriskSpecialPrefixes: HighriskSpecialPrefixListInstance;
|
||||
/**
|
||||
* Fetch a CountryInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CountryInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise<CountryInstance>;
|
||||
/**
|
||||
* Fetch a CountryInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CountryInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CountryInstance>) => any): Promise<ApiResponse<CountryInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface CountryContextSolution {
|
||||
isoCode: string;
|
||||
}
|
||||
export declare class CountryContextImpl implements CountryContext {
|
||||
protected _version: V1;
|
||||
protected _solution: CountryContextSolution;
|
||||
protected _uri: string;
|
||||
protected _highriskSpecialPrefixes?: HighriskSpecialPrefixListInstance;
|
||||
constructor(_version: V1, isoCode: string);
|
||||
get highriskSpecialPrefixes(): HighriskSpecialPrefixListInstance;
|
||||
fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise<CountryInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CountryInstance>) => any): Promise<ApiResponse<CountryInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): CountryContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface CountryPayload extends TwilioResponsePayload {
|
||||
content: CountryResource[];
|
||||
}
|
||||
interface CountryResource {
|
||||
iso_code: string;
|
||||
name: string;
|
||||
continent: string;
|
||||
country_codes: Array<string>;
|
||||
low_risk_numbers_enabled: boolean;
|
||||
high_risk_special_numbers_enabled: boolean;
|
||||
high_risk_tollfraud_numbers_enabled: boolean;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
}
|
||||
export declare class CountryInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: CountryContextSolution;
|
||||
protected _context?: CountryContext;
|
||||
constructor(_version: V1, payload: CountryResource, isoCode?: string);
|
||||
/**
|
||||
* The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
|
||||
*/
|
||||
isoCode: string;
|
||||
/**
|
||||
* The name of the country.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The name of the continent in which the country is located.
|
||||
*/
|
||||
continent: string;
|
||||
/**
|
||||
* The E.164 assigned [country codes(s)](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html)
|
||||
*/
|
||||
countryCodes: Array<string>;
|
||||
/**
|
||||
* Whether dialing to low-risk numbers is enabled.
|
||||
*/
|
||||
lowRiskNumbersEnabled: boolean;
|
||||
/**
|
||||
* Whether dialing to high-risk special services numbers is enabled. These prefixes include number ranges allocated by the country and include premium numbers, special services, shared cost, and others
|
||||
*/
|
||||
highRiskSpecialNumbersEnabled: boolean;
|
||||
/**
|
||||
* Whether dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers is enabled. These prefixes include narrow number ranges that have a high-risk of international revenue sharing fraud (IRSF) attacks, also known as [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html). These prefixes are collected from anti-fraud databases and verified by analyzing calls on our network. These prefixes are not available for download and are updated frequently
|
||||
*/
|
||||
highRiskTollfraudNumbersEnabled: boolean;
|
||||
/**
|
||||
* The absolute URL of this resource.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* A list of URLs related to this resource.
|
||||
*/
|
||||
links: Record<string, string>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a CountryInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CountryInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: CountryInstance) => any): Promise<CountryInstance>;
|
||||
/**
|
||||
* Fetch a CountryInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CountryInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CountryInstance>) => any): Promise<ApiResponse<CountryInstance>>;
|
||||
/**
|
||||
* Access the highriskSpecialPrefixes.
|
||||
*/
|
||||
highriskSpecialPrefixes(): HighriskSpecialPrefixListInstance;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
isoCode: string;
|
||||
name: string;
|
||||
continent: string;
|
||||
countryCodes: string[];
|
||||
lowRiskNumbersEnabled: boolean;
|
||||
highRiskSpecialNumbersEnabled: boolean;
|
||||
highRiskTollfraudNumbersEnabled: boolean;
|
||||
url: string;
|
||||
links: Record<string, string>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface CountrySolution {
|
||||
}
|
||||
export interface CountryListInstance {
|
||||
_version: V1;
|
||||
_solution: CountrySolution;
|
||||
_uri: string;
|
||||
(isoCode: string): CountryContext;
|
||||
get(isoCode: string): CountryContext;
|
||||
/**
|
||||
* Streams CountryInstance 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 { CountryListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams CountryInstance 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 { CountryListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of CountryInstance 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: CountryPage) => any): Promise<CountryPage>;
|
||||
/**
|
||||
* Retrieve a single target page of CountryInstance 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<CountryPage>) => any): Promise<ApiResponse<CountryPage>>;
|
||||
/**
|
||||
* Lists CountryInstance 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 { CountryListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: CountryInstance[]) => any): Promise<CountryInstance[]>;
|
||||
list(params: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise<CountryInstance[]>;
|
||||
/**
|
||||
* Lists CountryInstance 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 { CountryListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<CountryInstance[]>) => any): Promise<ApiResponse<CountryInstance[]>>;
|
||||
listWithHttpInfo(params: CountryListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<CountryInstance[]>) => any): Promise<ApiResponse<CountryInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of CountryInstance 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 { CountryListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: CountryPage) => any): Promise<CountryPage>;
|
||||
page(params: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise<CountryPage>;
|
||||
/**
|
||||
* Retrieve a single page of CountryInstance 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 { CountryListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<CountryPage>) => any): Promise<ApiResponse<CountryPage>>;
|
||||
pageWithHttpInfo(params: CountryListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<CountryPage>) => any): Promise<ApiResponse<CountryPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function CountryListInstance(version: V1): CountryListInstance;
|
||||
export declare class CountryPage extends Page<V1, CountryPayload, CountryResource, CountryInstance> {
|
||||
/**
|
||||
* Initialize the CountryPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: CountrySolution);
|
||||
/**
|
||||
* Build an instance of CountryInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: CountryResource): CountryInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
307
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.js
generated
vendored
Normal file
307
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country.js
generated
vendored
Normal file
@@ -0,0 +1,307 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.CountryPage = exports.CountryInstance = exports.CountryContextImpl = void 0;
|
||||
exports.CountryListInstance = CountryListInstance;
|
||||
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 highriskSpecialPrefix_1 = require("./country/highriskSpecialPrefix");
|
||||
class CountryContextImpl {
|
||||
constructor(_version, isoCode) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(isoCode)) {
|
||||
throw new Error("Parameter 'isoCode' is not valid.");
|
||||
}
|
||||
this._solution = { isoCode };
|
||||
this._uri = `/DialingPermissions/Countries/${isoCode}`;
|
||||
}
|
||||
get highriskSpecialPrefixes() {
|
||||
this._highriskSpecialPrefixes =
|
||||
this._highriskSpecialPrefixes ||
|
||||
(0, highriskSpecialPrefix_1.HighriskSpecialPrefixListInstance)(this._version, this._solution.isoCode);
|
||||
return this._highriskSpecialPrefixes;
|
||||
}
|
||||
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 CountryInstance(operationVersion, payload, instance._solution.isoCode));
|
||||
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 CountryInstance(operationVersion, response.body, instance._solution.isoCode),
|
||||
}));
|
||||
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.CountryContextImpl = CountryContextImpl;
|
||||
class CountryInstance {
|
||||
constructor(_version, payload, isoCode) {
|
||||
this._version = _version;
|
||||
this.isoCode = payload.iso_code;
|
||||
this.name = payload.name;
|
||||
this.continent = payload.continent;
|
||||
this.countryCodes = payload.country_codes;
|
||||
this.lowRiskNumbersEnabled = payload.low_risk_numbers_enabled;
|
||||
this.highRiskSpecialNumbersEnabled =
|
||||
payload.high_risk_special_numbers_enabled;
|
||||
this.highRiskTollfraudNumbersEnabled =
|
||||
payload.high_risk_tollfraud_numbers_enabled;
|
||||
this.url = payload.url;
|
||||
this.links = payload.links;
|
||||
this._solution = { isoCode: isoCode || this.isoCode };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new CountryContextImpl(this._version, this._solution.isoCode);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a CountryInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CountryInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a CountryInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed CountryInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Access the highriskSpecialPrefixes.
|
||||
*/
|
||||
highriskSpecialPrefixes() {
|
||||
return this._proxy.highriskSpecialPrefixes;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
isoCode: this.isoCode,
|
||||
name: this.name,
|
||||
continent: this.continent,
|
||||
countryCodes: this.countryCodes,
|
||||
lowRiskNumbersEnabled: this.lowRiskNumbersEnabled,
|
||||
highRiskSpecialNumbersEnabled: this.highRiskSpecialNumbersEnabled,
|
||||
highRiskTollfraudNumbersEnabled: this.highRiskTollfraudNumbersEnabled,
|
||||
url: this.url,
|
||||
links: this.links,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CountryInstance = CountryInstance;
|
||||
function CountryListInstance(version) {
|
||||
const instance = ((isoCode) => instance.get(isoCode));
|
||||
instance.get = function get(isoCode) {
|
||||
return new CountryContextImpl(version, isoCode);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/DialingPermissions/Countries`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["isoCode"] !== undefined)
|
||||
data["IsoCode"] = params["isoCode"];
|
||||
if (params["continent"] !== undefined)
|
||||
data["Continent"] = params["continent"];
|
||||
if (params["countryCode"] !== undefined)
|
||||
data["CountryCode"] = params["countryCode"];
|
||||
if (params["lowRiskNumbersEnabled"] !== undefined)
|
||||
data["LowRiskNumbersEnabled"] = serialize.bool(params["lowRiskNumbersEnabled"]);
|
||||
if (params["highRiskSpecialNumbersEnabled"] !== undefined)
|
||||
data["HighRiskSpecialNumbersEnabled"] = serialize.bool(params["highRiskSpecialNumbersEnabled"]);
|
||||
if (params["highRiskTollfraudNumbersEnabled"] !== undefined)
|
||||
data["HighRiskTollfraudNumbersEnabled"] = serialize.bool(params["highRiskTollfraudNumbersEnabled"]);
|
||||
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 CountryPage(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 CountryPage(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["isoCode"] !== undefined)
|
||||
data["IsoCode"] = params["isoCode"];
|
||||
if (params["continent"] !== undefined)
|
||||
data["Continent"] = params["continent"];
|
||||
if (params["countryCode"] !== undefined)
|
||||
data["CountryCode"] = params["countryCode"];
|
||||
if (params["lowRiskNumbersEnabled"] !== undefined)
|
||||
data["LowRiskNumbersEnabled"] = serialize.bool(params["lowRiskNumbersEnabled"]);
|
||||
if (params["highRiskSpecialNumbersEnabled"] !== undefined)
|
||||
data["HighRiskSpecialNumbersEnabled"] = serialize.bool(params["highRiskSpecialNumbersEnabled"]);
|
||||
if (params["highRiskTollfraudNumbersEnabled"] !== undefined)
|
||||
data["HighRiskTollfraudNumbersEnabled"] = serialize.bool(params["highRiskTollfraudNumbersEnabled"]);
|
||||
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 CountryPage(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 CountryPage(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 CountryPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the CountryPage
|
||||
*
|
||||
* @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 CountryInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new CountryInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.CountryPage = CountryPage;
|
||||
195
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.d.ts
generated
vendored
Normal file
195
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.d.ts
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
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";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface HighriskSpecialPrefixListInstanceEachOptions {
|
||||
/** 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: HighriskSpecialPrefixInstance, 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 HighriskSpecialPrefixListInstanceOptions {
|
||||
/** 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 HighriskSpecialPrefixListInstancePageOptions {
|
||||
/** 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 HighriskSpecialPrefixSolution {
|
||||
isoCode: string;
|
||||
}
|
||||
export interface HighriskSpecialPrefixListInstance {
|
||||
_version: V1;
|
||||
_solution: HighriskSpecialPrefixSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Streams HighriskSpecialPrefixInstance 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 { HighriskSpecialPrefixListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: HighriskSpecialPrefixInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: HighriskSpecialPrefixListInstanceEachOptions, callback?: (item: HighriskSpecialPrefixInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams HighriskSpecialPrefixInstance 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 { HighriskSpecialPrefixListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: HighriskSpecialPrefixInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: HighriskSpecialPrefixListInstanceEachOptions, callback?: (item: HighriskSpecialPrefixInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of HighriskSpecialPrefixInstance 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: HighriskSpecialPrefixPage) => any): Promise<HighriskSpecialPrefixPage>;
|
||||
/**
|
||||
* Retrieve a single target page of HighriskSpecialPrefixInstance 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<HighriskSpecialPrefixPage>) => any): Promise<ApiResponse<HighriskSpecialPrefixPage>>;
|
||||
/**
|
||||
* Lists HighriskSpecialPrefixInstance 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 { HighriskSpecialPrefixListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: HighriskSpecialPrefixInstance[]) => any): Promise<HighriskSpecialPrefixInstance[]>;
|
||||
list(params: HighriskSpecialPrefixListInstanceOptions, callback?: (error: Error | null, items: HighriskSpecialPrefixInstance[]) => any): Promise<HighriskSpecialPrefixInstance[]>;
|
||||
/**
|
||||
* Lists HighriskSpecialPrefixInstance 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 { HighriskSpecialPrefixListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<HighriskSpecialPrefixInstance[]>) => any): Promise<ApiResponse<HighriskSpecialPrefixInstance[]>>;
|
||||
listWithHttpInfo(params: HighriskSpecialPrefixListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<HighriskSpecialPrefixInstance[]>) => any): Promise<ApiResponse<HighriskSpecialPrefixInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of HighriskSpecialPrefixInstance 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 { HighriskSpecialPrefixListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: HighriskSpecialPrefixPage) => any): Promise<HighriskSpecialPrefixPage>;
|
||||
page(params: HighriskSpecialPrefixListInstancePageOptions, callback?: (error: Error | null, items: HighriskSpecialPrefixPage) => any): Promise<HighriskSpecialPrefixPage>;
|
||||
/**
|
||||
* Retrieve a single page of HighriskSpecialPrefixInstance 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 { HighriskSpecialPrefixListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<HighriskSpecialPrefixPage>) => any): Promise<ApiResponse<HighriskSpecialPrefixPage>>;
|
||||
pageWithHttpInfo(params: HighriskSpecialPrefixListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<HighriskSpecialPrefixPage>) => any): Promise<ApiResponse<HighriskSpecialPrefixPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function HighriskSpecialPrefixListInstance(version: V1, isoCode: string): HighriskSpecialPrefixListInstance;
|
||||
interface HighriskSpecialPrefixPayload extends TwilioResponsePayload {
|
||||
content: HighriskSpecialPrefixResource[];
|
||||
}
|
||||
interface HighriskSpecialPrefixResource {
|
||||
prefix: string;
|
||||
}
|
||||
export declare class HighriskSpecialPrefixInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: HighriskSpecialPrefixResource, isoCode: string);
|
||||
/**
|
||||
* A prefix is a contiguous number range for a block of E.164 numbers that includes the E.164 assigned country code. For example, a North American Numbering Plan prefix like `+1510720` written like `+1(510) 720` matches all numbers inclusive from `+1(510) 720-0000` to `+1(510) 720-9999`.
|
||||
*/
|
||||
prefix: string;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
prefix: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export declare class HighriskSpecialPrefixPage extends Page<V1, HighriskSpecialPrefixPayload, HighriskSpecialPrefixResource, HighriskSpecialPrefixInstance> {
|
||||
/**
|
||||
* Initialize the HighriskSpecialPrefixPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: HighriskSpecialPrefixSolution);
|
||||
/**
|
||||
* Build an instance of HighriskSpecialPrefixInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: HighriskSpecialPrefixResource): HighriskSpecialPrefixInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
171
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.js
generated
vendored
Normal file
171
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.js
generated
vendored
Normal file
@@ -0,0 +1,171 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.HighriskSpecialPrefixPage = exports.HighriskSpecialPrefixInstance = void 0;
|
||||
exports.HighriskSpecialPrefixListInstance = HighriskSpecialPrefixListInstance;
|
||||
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");
|
||||
function HighriskSpecialPrefixListInstance(version, isoCode) {
|
||||
if (!(0, utility_1.isValidPathParam)(isoCode)) {
|
||||
throw new Error("Parameter 'isoCode' is not valid.");
|
||||
}
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = { isoCode };
|
||||
instance._uri = `/DialingPermissions/Countries/${isoCode}/HighRiskSpecialPrefixes`;
|
||||
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 HighriskSpecialPrefixPage(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 HighriskSpecialPrefixPage(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 HighriskSpecialPrefixPage(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 HighriskSpecialPrefixPage(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 HighriskSpecialPrefixInstance {
|
||||
constructor(_version, payload, isoCode) {
|
||||
this._version = _version;
|
||||
this.prefix = payload.prefix;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
prefix: this.prefix,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.HighriskSpecialPrefixInstance = HighriskSpecialPrefixInstance;
|
||||
class HighriskSpecialPrefixPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the HighriskSpecialPrefixPage
|
||||
*
|
||||
* @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 HighriskSpecialPrefixInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new HighriskSpecialPrefixInstance(this._version, payload, this._solution.isoCode);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.HighriskSpecialPrefixPage = HighriskSpecialPrefixPage;
|
||||
181
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.d.ts
generated
vendored
Normal file
181
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.d.ts
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../../V1";
|
||||
import { ApiResponse } from "../../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to update a SettingsInstance
|
||||
*/
|
||||
export interface SettingsContextUpdateOptions {
|
||||
/** `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. */
|
||||
dialingPermissionsInheritance?: boolean;
|
||||
}
|
||||
export interface SettingsContext {
|
||||
/**
|
||||
* Fetch a SettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise<SettingsInstance>;
|
||||
/**
|
||||
* Fetch a SettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SettingsInstance>) => any): Promise<ApiResponse<SettingsInstance>>;
|
||||
/**
|
||||
* Update a SettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise<SettingsInstance>;
|
||||
/**
|
||||
* Update a SettingsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance
|
||||
*/
|
||||
update(params: SettingsContextUpdateOptions, callback?: (error: Error | null, item?: SettingsInstance) => any): Promise<SettingsInstance>;
|
||||
/**
|
||||
* Update a SettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SettingsInstance>) => any): Promise<ApiResponse<SettingsInstance>>;
|
||||
/**
|
||||
* Update a SettingsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: SettingsContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<SettingsInstance>) => any): Promise<ApiResponse<SettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface SettingsContextSolution {
|
||||
}
|
||||
export declare class SettingsContextImpl implements SettingsContext {
|
||||
protected _version: V1;
|
||||
protected _solution: SettingsContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1);
|
||||
fetch(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise<SettingsInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SettingsInstance>) => any): Promise<ApiResponse<SettingsInstance>>;
|
||||
update(params?: SettingsContextUpdateOptions | ((error: Error | null, item?: SettingsInstance) => any), callback?: (error: Error | null, item?: SettingsInstance) => any): Promise<SettingsInstance>;
|
||||
updateWithHttpInfo(params?: SettingsContextUpdateOptions | ((error: Error | null, item?: ApiResponse<SettingsInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<SettingsInstance>) => any): Promise<ApiResponse<SettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): SettingsContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface SettingsResource {
|
||||
dialing_permissions_inheritance: boolean;
|
||||
url: string;
|
||||
}
|
||||
export declare class SettingsInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: SettingsContextSolution;
|
||||
protected _context?: SettingsContext;
|
||||
constructor(_version: V1, payload: SettingsResource);
|
||||
/**
|
||||
* `true` if the sub-account will inherit voice dialing permissions from the Master Project; otherwise `false`.
|
||||
*/
|
||||
dialingPermissionsInheritance: boolean;
|
||||
/**
|
||||
* The absolute URL of this resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a SettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise<SettingsInstance>;
|
||||
/**
|
||||
* Fetch a SettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SettingsInstance>) => any): Promise<ApiResponse<SettingsInstance>>;
|
||||
/**
|
||||
* Update a SettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: SettingsInstance) => any): Promise<SettingsInstance>;
|
||||
/**
|
||||
* Update a SettingsInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance
|
||||
*/
|
||||
update(params: SettingsContextUpdateOptions, callback?: (error: Error | null, item?: SettingsInstance) => any): Promise<SettingsInstance>;
|
||||
/**
|
||||
* Update a SettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SettingsInstance>) => any): Promise<ApiResponse<SettingsInstance>>;
|
||||
/**
|
||||
* Update a SettingsInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: SettingsContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<SettingsInstance>) => any): Promise<ApiResponse<SettingsInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
dialingPermissionsInheritance: boolean;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface SettingsSolution {
|
||||
}
|
||||
export interface SettingsListInstance {
|
||||
_version: V1;
|
||||
_solution: SettingsSolution;
|
||||
_uri: string;
|
||||
(): SettingsContext;
|
||||
get(): SettingsContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function SettingsListInstance(version: V1): SettingsListInstance;
|
||||
export {};
|
||||
197
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.js
generated
vendored
Normal file
197
node_modules/twilio/lib/rest/voice/v1/dialingPermissions/settings.js
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.SettingsInstance = exports.SettingsContextImpl = void 0;
|
||||
exports.SettingsListInstance = SettingsListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../../base/deserialize");
|
||||
const serialize = require("../../../../base/serialize");
|
||||
class SettingsContextImpl {
|
||||
constructor(_version) {
|
||||
this._version = _version;
|
||||
this._solution = {};
|
||||
this._uri = `/Settings`;
|
||||
}
|
||||
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 SettingsInstance(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 SettingsInstance(operationVersion, response.body),
|
||||
}));
|
||||
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["dialingPermissionsInheritance"] !== undefined)
|
||||
data["DialingPermissionsInheritance"] = serialize.bool(params["dialingPermissionsInheritance"]);
|
||||
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 SettingsInstance(operationVersion, payload));
|
||||
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["dialingPermissionsInheritance"] !== undefined)
|
||||
data["DialingPermissionsInheritance"] = serialize.bool(params["dialingPermissionsInheritance"]);
|
||||
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 SettingsInstance(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.SettingsContextImpl = SettingsContextImpl;
|
||||
class SettingsInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.dialingPermissionsInheritance =
|
||||
payload.dialing_permissions_inheritance;
|
||||
this.url = payload.url;
|
||||
this._solution = {};
|
||||
}
|
||||
get _proxy() {
|
||||
this._context = this._context || new SettingsContextImpl(this._version);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a SettingsInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a SettingsInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SettingsInstance 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 {
|
||||
dialingPermissionsInheritance: this.dialingPermissionsInheritance,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SettingsInstance = SettingsInstance;
|
||||
function SettingsListInstance(version) {
|
||||
const instance = (() => instance.get());
|
||||
instance.get = function get() {
|
||||
return new SettingsContextImpl(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;
|
||||
}
|
||||
438
node_modules/twilio/lib/rest/voice/v1/ipRecord.d.ts
generated
vendored
Normal file
438
node_modules/twilio/lib/rest/voice/v1/ipRecord.d.ts
generated
vendored
Normal file
@@ -0,0 +1,438 @@
|
||||
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";
|
||||
/**
|
||||
* Options to pass to update a IpRecordInstance
|
||||
*/
|
||||
export interface IpRecordContextUpdateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */
|
||||
friendlyName?: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a IpRecordInstance
|
||||
*/
|
||||
export interface IpRecordListInstanceCreateOptions {
|
||||
/** An IP address in dotted decimal notation, IPv4 only. */
|
||||
ipAddress: string;
|
||||
/** A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */
|
||||
friendlyName?: string;
|
||||
/** An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. */
|
||||
cidrPrefixLength?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface IpRecordListInstanceEachOptions {
|
||||
/** 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: IpRecordInstance, 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 IpRecordListInstanceOptions {
|
||||
/** 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 IpRecordListInstancePageOptions {
|
||||
/** 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 IpRecordContext {
|
||||
/**
|
||||
* Remove a IpRecordInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a IpRecordInstance 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 IpRecordInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
/**
|
||||
* Fetch a IpRecordInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
/**
|
||||
* Update a IpRecordInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
/**
|
||||
* Update a IpRecordInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance
|
||||
*/
|
||||
update(params: IpRecordContextUpdateOptions, callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
/**
|
||||
* Update a IpRecordInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
/**
|
||||
* Update a IpRecordInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: IpRecordContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface IpRecordContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class IpRecordContextImpl implements IpRecordContext {
|
||||
protected _version: V1;
|
||||
protected _solution: IpRecordContextSolution;
|
||||
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?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
update(params?: IpRecordContextUpdateOptions | ((error: Error | null, item?: IpRecordInstance) => any), callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
updateWithHttpInfo(params?: IpRecordContextUpdateOptions | ((error: Error | null, item?: ApiResponse<IpRecordInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): IpRecordContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface IpRecordPayload extends TwilioResponsePayload {
|
||||
ip_records: IpRecordResource[];
|
||||
}
|
||||
interface IpRecordResource {
|
||||
account_sid: string;
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
ip_address: string;
|
||||
cidr_prefix_length: number;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class IpRecordInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: IpRecordContextSolution;
|
||||
protected _context?: IpRecordContext;
|
||||
constructor(_version: V1, payload: IpRecordResource, sid?: string);
|
||||
/**
|
||||
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IP Record resource.
|
||||
*/
|
||||
accountSid: string;
|
||||
/**
|
||||
* The unique string that we created to identify the IP Record resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* An IP address in dotted decimal notation, IPv4 only.
|
||||
*/
|
||||
ipAddress: string;
|
||||
/**
|
||||
* An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32.
|
||||
*/
|
||||
cidrPrefixLength: number;
|
||||
/**
|
||||
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a IpRecordInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a IpRecordInstance 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 IpRecordInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
/**
|
||||
* Fetch a IpRecordInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
/**
|
||||
* Update a IpRecordInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
/**
|
||||
* Update a IpRecordInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance
|
||||
*/
|
||||
update(params: IpRecordContextUpdateOptions, callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
/**
|
||||
* Update a IpRecordInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
/**
|
||||
* Update a IpRecordInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: IpRecordContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accountSid: string;
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
ipAddress: string;
|
||||
cidrPrefixLength: number;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface IpRecordSolution {
|
||||
}
|
||||
export interface IpRecordListInstance {
|
||||
_version: V1;
|
||||
_solution: IpRecordSolution;
|
||||
_uri: string;
|
||||
(sid: string): IpRecordContext;
|
||||
get(sid: string): IpRecordContext;
|
||||
/**
|
||||
* Create a IpRecordInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance
|
||||
*/
|
||||
create(params: IpRecordListInstanceCreateOptions, callback?: (error: Error | null, item?: IpRecordInstance) => any): Promise<IpRecordInstance>;
|
||||
/**
|
||||
* Create a IpRecordInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: IpRecordListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<IpRecordInstance>) => any): Promise<ApiResponse<IpRecordInstance>>;
|
||||
/**
|
||||
* Streams IpRecordInstance 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 { IpRecordListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: IpRecordInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: IpRecordListInstanceEachOptions, callback?: (item: IpRecordInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams IpRecordInstance 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 { IpRecordListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: IpRecordInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: IpRecordListInstanceEachOptions, callback?: (item: IpRecordInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of IpRecordInstance 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: IpRecordPage) => any): Promise<IpRecordPage>;
|
||||
/**
|
||||
* Retrieve a single target page of IpRecordInstance 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<IpRecordPage>) => any): Promise<ApiResponse<IpRecordPage>>;
|
||||
/**
|
||||
* Lists IpRecordInstance 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 { IpRecordListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: IpRecordInstance[]) => any): Promise<IpRecordInstance[]>;
|
||||
list(params: IpRecordListInstanceOptions, callback?: (error: Error | null, items: IpRecordInstance[]) => any): Promise<IpRecordInstance[]>;
|
||||
/**
|
||||
* Lists IpRecordInstance 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 { IpRecordListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<IpRecordInstance[]>) => any): Promise<ApiResponse<IpRecordInstance[]>>;
|
||||
listWithHttpInfo(params: IpRecordListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<IpRecordInstance[]>) => any): Promise<ApiResponse<IpRecordInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of IpRecordInstance 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 { IpRecordListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: IpRecordPage) => any): Promise<IpRecordPage>;
|
||||
page(params: IpRecordListInstancePageOptions, callback?: (error: Error | null, items: IpRecordPage) => any): Promise<IpRecordPage>;
|
||||
/**
|
||||
* Retrieve a single page of IpRecordInstance 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 { IpRecordListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<IpRecordPage>) => any): Promise<ApiResponse<IpRecordPage>>;
|
||||
pageWithHttpInfo(params: IpRecordListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<IpRecordPage>) => any): Promise<ApiResponse<IpRecordPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function IpRecordListInstance(version: V1): IpRecordListInstance;
|
||||
export declare class IpRecordPage extends Page<V1, IpRecordPayload, IpRecordResource, IpRecordInstance> {
|
||||
/**
|
||||
* Initialize the IpRecordPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: IpRecordSolution);
|
||||
/**
|
||||
* Build an instance of IpRecordInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: IpRecordResource): IpRecordInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
431
node_modules/twilio/lib/rest/voice/v1/ipRecord.js
generated
vendored
Normal file
431
node_modules/twilio/lib/rest/voice/v1/ipRecord.js
generated
vendored
Normal file
@@ -0,0 +1,431 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.IpRecordPage = exports.IpRecordInstance = exports.IpRecordContextImpl = void 0;
|
||||
exports.IpRecordListInstance = IpRecordListInstance;
|
||||
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 IpRecordContextImpl {
|
||||
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 = `/IpRecords/${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 IpRecordInstance(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 IpRecordInstance(operationVersion, response.body, 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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
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 IpRecordInstance(operationVersion, payload, 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["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
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 IpRecordInstance(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.IpRecordContextImpl = IpRecordContextImpl;
|
||||
class IpRecordInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.accountSid = payload.account_sid;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.ipAddress = payload.ip_address;
|
||||
this.cidrPrefixLength = deserialize.integer(payload.cidr_prefix_length);
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.url = payload.url;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new IpRecordContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a IpRecordInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a IpRecordInstance 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 IpRecordInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a IpRecordInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed IpRecordInstance 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,
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
ipAddress: this.ipAddress,
|
||||
cidrPrefixLength: this.cidrPrefixLength,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.IpRecordInstance = IpRecordInstance;
|
||||
function IpRecordListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new IpRecordContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/IpRecords`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["ipAddress"] === null || params["ipAddress"] === undefined) {
|
||||
throw new Error("Required parameter \"params['ipAddress']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["IpAddress"] = params["ipAddress"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["cidrPrefixLength"] !== undefined)
|
||||
data["CidrPrefixLength"] = params["cidrPrefixLength"];
|
||||
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 IpRecordInstance(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["ipAddress"] === null || params["ipAddress"] === undefined) {
|
||||
throw new Error("Required parameter \"params['ipAddress']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["IpAddress"] = params["ipAddress"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["cidrPrefixLength"] !== undefined)
|
||||
data["CidrPrefixLength"] = params["cidrPrefixLength"];
|
||||
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 IpRecordInstance(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["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 IpRecordPage(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 IpRecordPage(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 IpRecordPage(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 IpRecordPage(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 IpRecordPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the IpRecordPage
|
||||
*
|
||||
* @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 IpRecordInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new IpRecordInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.IpRecordPage = IpRecordPage;
|
||||
392
node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.d.ts
generated
vendored
Normal file
392
node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.d.ts
generated
vendored
Normal file
@@ -0,0 +1,392 @@
|
||||
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";
|
||||
/**
|
||||
* Options to pass to update a SourceIpMappingInstance
|
||||
*/
|
||||
export interface SourceIpMappingContextUpdateOptions {
|
||||
/** The SID of the SIP Domain that the IP Record should be mapped to. */
|
||||
sipDomainSid: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a SourceIpMappingInstance
|
||||
*/
|
||||
export interface SourceIpMappingListInstanceCreateOptions {
|
||||
/** The Twilio-provided string that uniquely identifies the IP Record resource to map from. */
|
||||
ipRecordSid: string;
|
||||
/** The SID of the SIP Domain that the IP Record should be mapped to. */
|
||||
sipDomainSid: string;
|
||||
}
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface SourceIpMappingListInstanceEachOptions {
|
||||
/** 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: SourceIpMappingInstance, 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 SourceIpMappingListInstanceOptions {
|
||||
/** 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 SourceIpMappingListInstancePageOptions {
|
||||
/** 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 SourceIpMappingContext {
|
||||
/**
|
||||
* Remove a SourceIpMappingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a SourceIpMappingInstance 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 SourceIpMappingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise<SourceIpMappingInstance>;
|
||||
/**
|
||||
* Fetch a SourceIpMappingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SourceIpMappingInstance>) => any): Promise<ApiResponse<SourceIpMappingInstance>>;
|
||||
/**
|
||||
* Update a SourceIpMappingInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance
|
||||
*/
|
||||
update(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise<SourceIpMappingInstance>;
|
||||
/**
|
||||
* Update a SourceIpMappingInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<SourceIpMappingInstance>) => any): Promise<ApiResponse<SourceIpMappingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface SourceIpMappingContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class SourceIpMappingContextImpl implements SourceIpMappingContext {
|
||||
protected _version: V1;
|
||||
protected _solution: SourceIpMappingContextSolution;
|
||||
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?: SourceIpMappingInstance) => any): Promise<SourceIpMappingInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SourceIpMappingInstance>) => any): Promise<ApiResponse<SourceIpMappingInstance>>;
|
||||
update(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise<SourceIpMappingInstance>;
|
||||
updateWithHttpInfo(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<SourceIpMappingInstance>) => any): Promise<ApiResponse<SourceIpMappingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): SourceIpMappingContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface SourceIpMappingPayload extends TwilioResponsePayload {
|
||||
source_ip_mappings: SourceIpMappingResource[];
|
||||
}
|
||||
interface SourceIpMappingResource {
|
||||
sid: string;
|
||||
ip_record_sid: string;
|
||||
sip_domain_sid: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
url: string;
|
||||
}
|
||||
export declare class SourceIpMappingInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: SourceIpMappingContextSolution;
|
||||
protected _context?: SourceIpMappingContext;
|
||||
constructor(_version: V1, payload: SourceIpMappingResource, sid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the IP Record resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The Twilio-provided string that uniquely identifies the IP Record resource to map from.
|
||||
*/
|
||||
ipRecordSid: string;
|
||||
/**
|
||||
* The SID of the SIP Domain that the IP Record is mapped to.
|
||||
*/
|
||||
sipDomainSid: string;
|
||||
/**
|
||||
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The absolute URL of the resource.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a SourceIpMappingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a SourceIpMappingInstance 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 SourceIpMappingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise<SourceIpMappingInstance>;
|
||||
/**
|
||||
* Fetch a SourceIpMappingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<SourceIpMappingInstance>) => any): Promise<ApiResponse<SourceIpMappingInstance>>;
|
||||
/**
|
||||
* Update a SourceIpMappingInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance
|
||||
*/
|
||||
update(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise<SourceIpMappingInstance>;
|
||||
/**
|
||||
* Update a SourceIpMappingInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: SourceIpMappingContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<SourceIpMappingInstance>) => any): Promise<ApiResponse<SourceIpMappingInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
ipRecordSid: string;
|
||||
sipDomainSid: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface SourceIpMappingSolution {
|
||||
}
|
||||
export interface SourceIpMappingListInstance {
|
||||
_version: V1;
|
||||
_solution: SourceIpMappingSolution;
|
||||
_uri: string;
|
||||
(sid: string): SourceIpMappingContext;
|
||||
get(sid: string): SourceIpMappingContext;
|
||||
/**
|
||||
* Create a SourceIpMappingInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance
|
||||
*/
|
||||
create(params: SourceIpMappingListInstanceCreateOptions, callback?: (error: Error | null, item?: SourceIpMappingInstance) => any): Promise<SourceIpMappingInstance>;
|
||||
/**
|
||||
* Create a SourceIpMappingInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: SourceIpMappingListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<SourceIpMappingInstance>) => any): Promise<ApiResponse<SourceIpMappingInstance>>;
|
||||
/**
|
||||
* Streams SourceIpMappingInstance 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 { SourceIpMappingListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(callback?: (item: SourceIpMappingInstance, done: (err?: Error) => void) => void): void;
|
||||
each(params: SourceIpMappingListInstanceEachOptions, callback?: (item: SourceIpMappingInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams SourceIpMappingInstance 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 { SourceIpMappingListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(callback?: (item: SourceIpMappingInstance, done: (err?: Error) => void) => void): void;
|
||||
eachWithHttpInfo(params: SourceIpMappingListInstanceEachOptions, callback?: (item: SourceIpMappingInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of SourceIpMappingInstance 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: SourceIpMappingPage) => any): Promise<SourceIpMappingPage>;
|
||||
/**
|
||||
* Retrieve a single target page of SourceIpMappingInstance 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<SourceIpMappingPage>) => any): Promise<ApiResponse<SourceIpMappingPage>>;
|
||||
/**
|
||||
* Lists SourceIpMappingInstance 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 { SourceIpMappingListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(callback?: (error: Error | null, items: SourceIpMappingInstance[]) => any): Promise<SourceIpMappingInstance[]>;
|
||||
list(params: SourceIpMappingListInstanceOptions, callback?: (error: Error | null, items: SourceIpMappingInstance[]) => any): Promise<SourceIpMappingInstance[]>;
|
||||
/**
|
||||
* Lists SourceIpMappingInstance 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 { SourceIpMappingListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SourceIpMappingInstance[]>) => any): Promise<ApiResponse<SourceIpMappingInstance[]>>;
|
||||
listWithHttpInfo(params: SourceIpMappingListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<SourceIpMappingInstance[]>) => any): Promise<ApiResponse<SourceIpMappingInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of SourceIpMappingInstance 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 { SourceIpMappingListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(callback?: (error: Error | null, items: SourceIpMappingPage) => any): Promise<SourceIpMappingPage>;
|
||||
page(params: SourceIpMappingListInstancePageOptions, callback?: (error: Error | null, items: SourceIpMappingPage) => any): Promise<SourceIpMappingPage>;
|
||||
/**
|
||||
* Retrieve a single page of SourceIpMappingInstance 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 { SourceIpMappingListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<SourceIpMappingPage>) => any): Promise<ApiResponse<SourceIpMappingPage>>;
|
||||
pageWithHttpInfo(params: SourceIpMappingListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<SourceIpMappingPage>) => any): Promise<ApiResponse<SourceIpMappingPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function SourceIpMappingListInstance(version: V1): SourceIpMappingListInstance;
|
||||
export declare class SourceIpMappingPage extends Page<V1, SourceIpMappingPayload, SourceIpMappingResource, SourceIpMappingInstance> {
|
||||
/**
|
||||
* Initialize the SourceIpMappingPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: SourceIpMappingSolution);
|
||||
/**
|
||||
* Build an instance of SourceIpMappingInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: SourceIpMappingResource): SourceIpMappingInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
427
node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.js
generated
vendored
Normal file
427
node_modules/twilio/lib/rest/voice/v1/sourceIpMapping.js
generated
vendored
Normal file
@@ -0,0 +1,427 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Voice
|
||||
* 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.SourceIpMappingPage = exports.SourceIpMappingInstance = exports.SourceIpMappingContextImpl = void 0;
|
||||
exports.SourceIpMappingListInstance = SourceIpMappingListInstance;
|
||||
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 SourceIpMappingContextImpl {
|
||||
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 = `/SourceIpMappings/${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 SourceIpMappingInstance(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 SourceIpMappingInstance(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["sipDomainSid"] === null ||
|
||||
params["sipDomainSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['sipDomainSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["SipDomainSid"] = params["sipDomainSid"];
|
||||
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 SourceIpMappingInstance(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["sipDomainSid"] === null ||
|
||||
params["sipDomainSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['sipDomainSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["SipDomainSid"] = params["sipDomainSid"];
|
||||
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 SourceIpMappingInstance(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.SourceIpMappingContextImpl = SourceIpMappingContextImpl;
|
||||
class SourceIpMappingInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.ipRecordSid = payload.ip_record_sid;
|
||||
this.sipDomainSid = payload.sip_domain_sid;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
||||
this.url = payload.url;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new SourceIpMappingContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a SourceIpMappingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a SourceIpMappingInstance 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 SourceIpMappingInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a SourceIpMappingInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed SourceIpMappingInstance 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 {
|
||||
sid: this.sid,
|
||||
ipRecordSid: this.ipRecordSid,
|
||||
sipDomainSid: this.sipDomainSid,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SourceIpMappingInstance = SourceIpMappingInstance;
|
||||
function SourceIpMappingListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new SourceIpMappingContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/SourceIpMappings`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["ipRecordSid"] === null || params["ipRecordSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['ipRecordSid']\" missing.");
|
||||
}
|
||||
if (params["sipDomainSid"] === null ||
|
||||
params["sipDomainSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['sipDomainSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["IpRecordSid"] = params["ipRecordSid"];
|
||||
data["SipDomainSid"] = params["sipDomainSid"];
|
||||
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 SourceIpMappingInstance(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["ipRecordSid"] === null || params["ipRecordSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['ipRecordSid']\" missing.");
|
||||
}
|
||||
if (params["sipDomainSid"] === null ||
|
||||
params["sipDomainSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['sipDomainSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["IpRecordSid"] = params["ipRecordSid"];
|
||||
data["SipDomainSid"] = params["sipDomainSid"];
|
||||
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 SourceIpMappingInstance(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["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 SourceIpMappingPage(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 SourceIpMappingPage(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 SourceIpMappingPage(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 SourceIpMappingPage(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 SourceIpMappingPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the SourceIpMappingPage
|
||||
*
|
||||
* @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 SourceIpMappingInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new SourceIpMappingInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.SourceIpMappingPage = SourceIpMappingPage;
|
||||
Reference in New Issue
Block a user